module patches;

enum PatchConfig {
    ALPHA_PATCH = true,
    ALPHA_FOCUS_HIGHLIGHT_PATCH = false,
    ALPHA_GRADIENT_PATCH = false,
    ANYSIZE_PATCH = false,
    ANYSIZE_SIMPLE_PATCH = false,
    BACKGROUND_IMAGE_PATCH = false,
    BACKGROUND_IMAGE_RELOAD_PATCH = false,
    BLINKING_CURSOR_PATCH = false,
    BOLD_IS_NOT_BRIGHT_PATCH = false,
    BOXDRAW_PATCH = true,
    CLIPBOARD_PATCH = false,
    COLUMNS_PATCH = false,
    COPYURL_PATCH = false,
    COPYURL_HIGHLIGHT_SELECTED_URLS_PATCH = false,
    CSI_22_23_PATCH = true,
    DEFAULT_CURSOR_PATCH = false,
    DELKEY_PATCH = false,
    DISABLE_BOLD_FONTS_PATCH = false,
    DISABLE_ITALIC_FONTS_PATCH = true,
    DISABLE_ROMAN_FONTS_PATCH = false,
    DYNAMIC_CURSOR_COLOR_PATCH = false,
    EXTERNALPIPE_PATCH = true,
    EXTERNALPIPEIN_PATCH = true,
    FIXKEYBOARDINPUT_PATCH = true,
    FONT2_PATCH = true,
    FULLSCREEN_PATCH = false,
    HIDECURSOR_PATCH = false,
    HIDE_TERMINAL_CURSOR_PATCH = false,
    INVERT_PATCH = false,
    ISO14755_PATCH = false,
    KEYBOARDSELECT_PATCH = false,
    LIGATURES_PATCH = false,
    MONOCHROME_PATCH = false,
    NETWMICON_PATCH = false,
    NETWMICON_FF_PATCH = false,
    NETWMICON_LEGACY_PATCH = false,
    NEWTERM_PATCH = false,
    NO_WINDOW_DECORATIONS_PATCH = false,
    OPENCOPIED_PATCH = false,
    OPENURLONCLICK_PATCH = true,
    REFLOW_PATCH = true,
    RELATIVEBORDER_PATCH = false,
    RIGHTCLICKTOPLUMB_PATCH = true,
    SCROLLBACK_PATCH = false,
    SCROLLBACK_MOUSE_PATCH = false,
    SCROLLBACK_MOUSE_ALTSCREEN_PATCH = true,
    SELECTION_COLORS_PATCH = false,
    SINGLE_DRAWABLE_BUFFER_PATCH = false,
    SIXEL_PATCH = true,
    ST_EMBEDDER_PATCH = true,
    SPOILER_PATCH = false,
    SWAPMOUSE_PATCH = false,
    SYNC_PATCH = true,
    THEMED_CURSOR_PATCH = false,
    UNDERCURL_PATCH = true,
    UNIVERSCROLL_PATCH = false,
    USE_XFTFONTMATCH_PATCH = false,
    VERTCENTER_PATCH = false,
    VISUALBELL_1_PATCH = false,
    W3M_PATCH = false,
    WIDE_GLYPHS_PATCH = true,
    WIDE_GLYPH_SPACING_PATCH = false,
    WORKINGDIR_PATCH = false,
    XRESOURCES_PATCH = false,
    XRESOURCES_RELOAD_PATCH = false,
}

template isPatchEnabled(string patchName) {
    enum isPatchEnabled = __traits(getMember, PatchConfig, patchName);
}

static if (isPatchEnabled!"REFLOW_PATCH" || isPatchEnabled!"SCROLLBACK_PATCH") {
    enum HISTSIZE = 2000;
}