ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/xdefaults.C
(Generate patch)

Comparing rxvt-unicode/src/xdefaults.C (file contents):
Revision 1.182 by sf-exg, Wed Sep 3 18:47:16 2014 UTC vs.
Revision 1.190 by sf-exg, Tue Oct 13 08:10:43 2015 UTC

5 * All portions of code are copyright by their respective author/s. 5 * All portions of code are copyright by their respective author/s.
6 * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> 6 * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com>
7 * - original version 7 * - original version
8 * Copyright (c) 1997,1998 mj olesen <olesen@me.queensu.ca> 8 * Copyright (c) 1997,1998 mj olesen <olesen@me.queensu.ca>
9 * Copyright (c) 2003-2006 Marc Lehmann <schmorp@schmorp.de> 9 * Copyright (c) 2003-2006 Marc Lehmann <schmorp@schmorp.de>
10 * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it> 10 * Copyright (c) 2007,2015 Emanuele Giaquinta <e.giaquinta@glauco.it>
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by 13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or 14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version. 15 * (at your option) any later version.
99 SWCH ("ic", Opt_iconic, 0, NULL), /* short form */ 99 SWCH ("ic", Opt_iconic, 0, NULL), /* short form */
100 STRG (Rs_chdir, "chdir", "cd", "string", "start shell in this directory"), 100 STRG (Rs_chdir, "chdir", "cd", "string", "start shell in this directory"),
101 SWCH ("dockapp", Opt_dockapp, 0, "start as dockapp"), 101 SWCH ("dockapp", Opt_dockapp, 0, "start as dockapp"),
102 BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"), 102 BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"),
103 BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"), 103 BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"),
104 STRG (Rs_multiClickTime, "multiClickTime", "mc", "number", "Maximum time (in ms) between multi-click selections"), 104 STRG (Rs_multiClickTime, "multiClickTime", "mc", "number", "maximum time (in ms) between multi-click selections"),
105 BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"), 105 BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"),
106 BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"), 106 BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"),
107 BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"), 107 BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"),
108 RSTRG (Rs_scrollstyle, "scrollstyle", "mode"), 108 RSTRG (Rs_scrollstyle, "scrollstyle", "mode"),
109 BOOL (Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, 0, "scrollbar"), 109 BOOL (Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, 0, "scrollbar"),
201 STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"), 201 STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"),
202#endif 202#endif
203#if ENABLE_EWMH 203#if ENABLE_EWMH
204 STRG (Rs_iconfile, "iconFile", "icon", "file", "path to application icon image"), 204 STRG (Rs_iconfile, "iconFile", "icon", "file", "path to application icon image"),
205#endif 205#endif
206#ifdef HAVE_XMU
207 RSTRG (Rs_pointerShape, "pointerShape", "string"),
208#endif
206 /* fonts: command-line option = resource name */ 209 /* fonts: command-line option = resource name */
207 STRG (Rs_font, "font", "fn", "fontname", "normal text font"), 210 STRG (Rs_font, "font", "fn", "fontname", "normal text font"),
208#if ENABLE_STYLES 211#if ENABLE_STYLES
209 STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"), 212 STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"),
210 STRG (Rs_italicFont, "italicFont", "fi", "fontname", "italic font"), 213 STRG (Rs_italicFont, "italicFont", "fi", "fontname", "italic font"),
625 return 0; 628 return 0;
626} 629}
627 630
628/*}}} */ 631/*}}} */
629 632
630#ifndef NO_RESOURCES
631/*----------------------------------------------------------------------*/ 633/*----------------------------------------------------------------------*/
632 634
633# ifdef KEYSYM_RESOURCE 635#ifdef KEYSYM_RESOURCE
634static void 636static void
635rxvt_define_key (rxvt_term *term, const char *k, const char *v) 637rxvt_define_key (rxvt_term *term, const char *k, const char *v)
636{ 638{
637 term->bind_action (k, v); 639 term->bind_action (k, v);
638} 640}
768 770
769 if (*arg == '\0' || (sym = parse_keysym (str, state)) == -1) 771 if (*arg == '\0' || (sym = parse_keysym (str, state)) == -1)
770 return -1; 772 return -1;
771 773
772 wchar_t *ws = rxvt_mbstowcs (arg); 774 wchar_t *ws = rxvt_mbstowcs (arg);
775 if (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END)))
773 keyboard->register_action (sym, state, ws); 776 keyboard->register_action (sym, state, ws);
774 777
775 free (ws); 778 free (ws);
776 return 1; 779 return 1;
777} 780}
778 781
779# endif /* KEYSYM_RESOURCE */ 782#endif /* KEYSYM_RESOURCE */
780#endif /* NO_RESOURCES */
781 783
782static char * 784static char *
783get_res (XrmDatabase database, const char *program, const char *option) 785get_res (XrmDatabase database, const char *program, const char *option)
784{ 786{
785 char resource[512]; 787 char resource[512];
859} 861}
860 862
861void 863void
862rxvt_term::enumerate_keysym_resources (void (*cb)(rxvt_term *, const char *, const char *)) 864rxvt_term::enumerate_keysym_resources (void (*cb)(rxvt_term *, const char *, const char *))
863{ 865{
864#ifndef NO_RESOURCES
865 /* 866 /*
866 * [R5 or later]: enumerate the resource database 867 * [R5 or later]: enumerate the resource database
867 */ 868 */
868# ifdef KEYSYM_RESOURCE 869#ifdef KEYSYM_RESOURCE
869 void *closure[2] = { 870 void *closure[2] = {
870 (void *)this, 871 (void *)this,
871 (void *)cb, 872 (void *)cb,
872 }; 873 };
873 874
874 XrmDatabase database = XrmGetDatabase (dpy); 875 XrmDatabase database = XrmGetDatabase (dpy);
875 XrmName name_prefix[3]; 876 XrmName name_prefix[3];
876 XrmClass class_prefix[3]; 877 XrmClass class_prefix[3];
877 878
878 name_prefix[0] = XrmStringToName (rs[Rs_name]);
879 name_prefix[1] = XrmStringToName ("keysym"); 879 name_prefix[1] = XrmStringToName ("keysym");
880 name_prefix[2] = NULLQUARK; 880 name_prefix[2] = NULLQUARK;
881 class_prefix[0] = XrmStringToName (RESCLASS);
882 class_prefix[1] = XrmStringToName ("Keysym"); 881 class_prefix[1] = XrmStringToName ("Keysym");
883 class_prefix[2] = NULLQUARK; 882 class_prefix[2] = NULLQUARK;
884 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ 883
885 XrmEnumerateDatabase (database, name_prefix, class_prefix,
886 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure);
887# ifdef RESFALLBACK 884# ifdef RESFALLBACK
888 name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK); 885 name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK);
889 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ 886 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */
890 XrmEnumerateDatabase (database, name_prefix, class_prefix, 887 XrmEnumerateDatabase (database, name_prefix, class_prefix,
891 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure); 888 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure);
892# endif
893# endif 889# endif
894 890
895#endif /* NO_RESOURCES */ 891 name_prefix[0] = class_prefix[0] = XrmStringToName (RESCLASS);
892 XrmEnumerateDatabase (database, name_prefix, class_prefix,
893 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure);
894
895 name_prefix[0] = class_prefix[0] = XrmStringToName (rs[Rs_name]);
896 XrmEnumerateDatabase (database, name_prefix, class_prefix,
897 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure);
898#endif
896} 899}
897 900
898void 901void
899rxvt_term::extract_keysym_resources () 902rxvt_term::extract_keysym_resources ()
900{ 903{
904#ifdef KEYSYM_RESOURCE
901 enumerate_keysym_resources (rxvt_define_key); 905 enumerate_keysym_resources (rxvt_define_key);
906#endif
902} 907}
903 908
904/*----------------------- end-of-file (C source) -----------------------*/ 909/*----------------------- end-of-file (C source) -----------------------*/
905 910

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines