summaryrefslogtreecommitdiffstats
path: root/x11-terms/xterm/files/xterm-ds-sm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'x11-terms/xterm/files/xterm-ds-sm.patch')
-rw-r--r--x11-terms/xterm/files/xterm-ds-sm.patch129
1 files changed, 129 insertions, 0 deletions
diff --git a/x11-terms/xterm/files/xterm-ds-sm.patch b/x11-terms/xterm/files/xterm-ds-sm.patch
new file mode 100644
index 0000000..12c1258
--- /dev/null
+++ b/x11-terms/xterm/files/xterm-ds-sm.patch
@@ -0,0 +1,129 @@
+diff -dPNur xterm-207-new/menu.c xterm-207/menu.c
+--- xterm-207-new/menu.c 2005-11-13 23:10:36.000000000 +0000
++++ xterm-207/menu.c 2005-12-26 13:58:51.000000000 +0000
+@@ -175,6 +175,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
+@@ -339,6 +343,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 },
+ #endif
+ #endif /* toggles for other font extensions */
+@@ -683,6 +688,15 @@
+ #if OPT_WIDE_CHARS
+ update_font_utf8_mode();
+ #endif
++#if OPT_WIDE_CHARS
++ if ((term->screen.utf8_mode==2)||(!term->screen.wide_chars)) {
++ set_sensitivity(mw,
++ fontMenuEntries[fontMenu_font_multibyte].widget,
++ False);
++ } else {
++ update_font_multibyte();
++ }
++#endif
+ }
+ FindFontSelection(NULL, True);
+ set_sensitivity(mw,
+@@ -1423,6 +1437,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
+ */
+@@ -2054,6 +2085,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-207-new/menu.h xterm-207/menu.h
+--- xterm-207-new/menu.h 2005-11-03 13:17:28.000000000 +0000
++++ xterm-207/menu.h 2005-12-26 13:58:51.000000000 +0000
+@@ -87,6 +87,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;
+@@ -252,6 +253,9 @@
+ fontMenu_font_loadable,
+ #endif
+ #endif
++#if OPT_WIDE_CHARS
++ fontMenu_font_multibyte,
++#endif
+
+ #if OPT_RENDERFONT || OPT_WIDE_CHARS
+ fontMenu_line2,
+@@ -430,6 +434,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() \
++ update_menu_item (term->screen.fontMenu, \
++ fontMenuEntries[fontMenu_font_multibyte].widget, \
++ 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-207-new/ptyx.h xterm-207/ptyx.h
+--- xterm-207-new/ptyx.h 2005-11-03 13:17:28.000000000 +0000
++++ xterm-207/ptyx.h 2005-12-26 13:59:17.000000000 +0000
+@@ -1237,6 +1237,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;
+ #endif