summaryrefslogtreecommitdiffstats
path: root/x11-terms/xterm/files/xterm-ds-sm-243.patch
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /x11-terms/xterm/files/xterm-ds-sm-243.patch
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'x11-terms/xterm/files/xterm-ds-sm-243.patch')
-rw-r--r--x11-terms/xterm/files/xterm-ds-sm-243.patch144
1 files changed, 144 insertions, 0 deletions
diff --git a/x11-terms/xterm/files/xterm-ds-sm-243.patch b/x11-terms/xterm/files/xterm-ds-sm-243.patch
new file mode 100644
index 0000000..bb35ee2
--- /dev/null
+++ b/x11-terms/xterm/files/xterm-ds-sm-243.patch
@@ -0,0 +1,144 @@
+diff -dPNur xterm-243/menu.c xterm-243-sm/menu.c
+--- xterm-243/menu.c 2009-03-28 18:27:57.000000000 +0100
++++ xterm-243-sm/menu.c 2009-06-14 05:54:26.000000000 +0200
+@@ -186,6 +186,10 @@
+ static void do_font_loadable PROTO_XT_CALLBACK_ARGS;
+ #endif
+
++#if OPT_WIDE_CHARS
++static void do_font_multibyte PROTO_XT_CALLBACK_ARGS;
++#endif
++
+ #if OPT_HP_FUNC_KEYS
+ static void do_hp_fkeys PROTO_XT_CALLBACK_ARGS;
+ #endif
+@@ -245,6 +249,15 @@
+ static void do_font_utf8_title PROTO_XT_CALLBACK_ARGS;
+ #endif
+
++static void
++UpdateMenuItem(
++#if OPT_TRACE
++ const char *func,
++#endif
++ MenuEntry * menu,
++ int which,
++ Bool val);
++
+ /*
+ * The order of entries MUST match the values given in menu.h
+ */
+@@ -365,6 +378,7 @@
+ { "render-font", do_font_renderfont,NULL },
+ #endif
+ #if OPT_WIDE_CHARS
++ { "font-multibyte", do_font_multibyte, NULL },
+ { "utf8-mode", do_font_utf8_mode,NULL },
+ { "utf8-title", do_font_utf8_title,NULL },
+ #endif
+@@ -697,6 +711,14 @@
+ }
+ }
+ #endif
++#if OPT_WIDE_CHARS
++ if ((term->screen.utf8_mode>255)||(!term->screen.wide_chars)) {
++ SetItemSensitivity(fontMenuEntries[fontMenu_font_multibyte].widget,
++ False);
++ } else {
++ update_font_multibyte();
++ }
++#endif
+ }
+ break;
+
+@@ -1560,6 +1582,23 @@
+ }
+ #endif
+
++#if OPT_WIDE_CHARS
++static void
++do_font_multibyte(Widget gw GCC_UNUSED,
++ XtPointer closure GCC_UNUSED,
++ XtPointer data GCC_UNUSED)
++{
++ term->screen.font_multibyte = !term->screen.font_multibyte;
++ if (term->screen.font_multibyte) {
++ term->screen.utf8_mode=1;
++ } else {
++ term->screen.utf8_mode=0;
++ }
++ update_font_multibyte();
++ Redraw();
++}
++#endif
++
+ /*
+ * tek menu
+ */
+@@ -2221,6 +2260,18 @@
+ }
+ #endif
+
++#if OPT_WIDE_CHARS
++void
++HandleFontMultibyte(Widget w,
++ XEvent * event GCC_UNUSED,
++ String * params,
++ Cardinal * param_count)
++{
++ handle_toggle(do_font_multibyte, (int) term->screen.font_multibyte,
++ params, *param_count, w, (XtPointer) 0, (XtPointer) 0);
++}
++#endif
++
+ #if OPT_BOX_CHARS
+ void
+ HandleFontBoxChars(Widget w,
+diff -dPNur xterm-243/menu.h xterm-243-sm/menu.h
+--- xterm-243/menu.h 2009-02-13 20:55:26.000000000 +0100
++++ xterm-243-sm/menu.h 2009-06-14 05:57:56.000000000 +0200
+@@ -90,6 +90,7 @@
+ extern void HandleFontBoxChars PROTO_XT_ACTIONS_ARGS;
+ extern void HandleFontDoublesize PROTO_XT_ACTIONS_ARGS;
+ extern void HandleFontLoading PROTO_XT_ACTIONS_ARGS;
++extern void HandleFontMultibyte PROTO_XT_ACTIONS_ARGS;
+ extern void HandleHardReset PROTO_XT_ACTIONS_ARGS;
+ extern void HandleHpFunctionKeys PROTO_XT_ACTIONS_ARGS;
+ extern void HandleJumpscroll PROTO_XT_ACTIONS_ARGS;
+@@ -264,6 +265,9 @@
+ fontMenu_font_loadable,
+ #endif
+ #endif
++#if OPT_WIDE_CHARS
++ fontMenu_font_multibyte,
++#endif
+
+ #if OPT_RENDERFONT || OPT_WIDE_CHARS
+ fontMenu_line2,
+@@ -470,6 +474,15 @@
+ #define FS2MI(n) (n) /* font_size_to_menu_item */
+ #define MI2FS(n) (n) /* menu_item_to_font_size */
+
++#if OPT_WIDE_CHARS
++#define update_font_multibyte() \
++ UpdateMenuItem (fontMenuEntries, \
++ fontMenu_font_multibyte, \
++ term->screen.font_multibyte)
++#else
++#define update_font_multibyte() /* nothing */
++#endif
++
+ #if OPT_TEK4014
+ extern void set_tekfont_menu_item(int n,int val);
+ #else
+diff -dPNur xterm-243/ptyx.h xterm-243-sm/ptyx.h
+--- xterm-243/ptyx.h 2009-03-24 23:20:06.000000000 +0100
++++ xterm-243-sm/ptyx.h 2009-06-14 05:59:38.000000000 +0200
+@@ -1358,6 +1358,7 @@
+ int unicode_font; /* font uses unicode encoding */
+ int utf_count; /* state of utf_char */
+ IChar utf_char; /* in-progress character */
++ int font_multibyte; /* is UTF mode switched on */
+ int last_written_col;
+ int last_written_row;
+ XChar2b *draw_buf; /* drawXtermText() data */