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.187 by sf-exg, Mon May 11 22:05:58 2015 UTC vs.
Revision 1.191 by sf-exg, Thu Jul 14 05:10:06 2016 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.
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"),
627 630
628/*}}} */ 631/*}}} */
629 632
630/*----------------------------------------------------------------------*/ 633/*----------------------------------------------------------------------*/
631 634
632# ifdef KEYSYM_RESOURCE 635#ifdef KEYSYM_RESOURCE
633static void 636static void
634rxvt_define_key (rxvt_term *term, const char *k, const char *v) 637rxvt_define_key (rxvt_term *term, const char *k, const char *v)
635{ 638{
636 term->bind_action (k, v); 639 term->bind_action (k, v);
637} 640}
641 * quarks will be something like 644 * quarks will be something like
642 * "rxvt" "keysym" "0xFF01" 645 * "rxvt" "keysym" "0xFF01"
643 * value will be a string 646 * value will be a string
644 */ 647 */
645static int 648static int
646rxvt_keysym_enumerate_helper ( 649rxvt_enumerate_helper (
647 XrmDatabase *database ecb_unused, 650 XrmDatabase *database ecb_unused,
648 XrmBindingList bindings ecb_unused, 651 XrmBindingList bindings ecb_unused,
649 XrmQuarkList quarks, 652 XrmQuarkList quarks,
650 XrmRepresentation *type ecb_unused, 653 XrmRepresentation *type ecb_unused,
651 XrmValue *value, 654 XrmValue *value,
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 783
781static char * 784static char *
782get_res (XrmDatabase database, const char *program, const char *option) 785get_res (XrmDatabase database, const char *program, const char *option)
783{ 786{
784 char resource[512]; 787 char resource[512];
856 } 859 }
857#endif /* NO_RESOURCES */ 860#endif /* NO_RESOURCES */
858} 861}
859 862
860void 863void
861rxvt_term::enumerate_keysym_resources (void (*cb)(rxvt_term *, const char *, const char *)) 864rxvt_term::enumerate_resources (void (*cb)(rxvt_term *, const char *, const char *), const char *name_p, const char *class_p)
862{ 865{
863 /* 866 /*
864 * [R5 or later]: enumerate the resource database 867 * [R5 or later]: enumerate the resource database
865 */ 868 */
866# ifdef KEYSYM_RESOURCE 869#ifdef KEYSYM_RESOURCE
867 void *closure[2] = { 870 void *closure[2] = {
868 (void *)this, 871 (void *)this,
869 (void *)cb, 872 (void *)cb,
870 }; 873 };
871 874
872 XrmDatabase database = XrmGetDatabase (dpy); 875 XrmDatabase database = XrmGetDatabase (dpy);
873 XrmName name_prefix[3]; 876 XrmName name_prefix[3];
874 XrmClass class_prefix[3]; 877 XrmClass class_prefix[3];
875 878
876 name_prefix[1] = XrmStringToName ("keysym"); 879 name_prefix[1] = name_p ? XrmStringToName (name_p) : NULLQUARK;
877 name_prefix[2] = NULLQUARK; 880 name_prefix[2] = NULLQUARK;
878 class_prefix[1] = XrmStringToName ("Keysym"); 881 class_prefix[1] = class_p ? XrmStringToName (class_p) : NULLQUARK;
879 class_prefix[2] = NULLQUARK; 882 class_prefix[2] = NULLQUARK;
880 883
881# ifdef RESFALLBACK 884# ifdef RESFALLBACK
882 name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK); 885 name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK);
883 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ 886 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */
884 XrmEnumerateDatabase (database, name_prefix, class_prefix, 887 XrmEnumerateDatabase (database, name_prefix, class_prefix,
885 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure); 888 XrmEnumOneLevel, rxvt_enumerate_helper, (XPointer)closure);
886# endif 889# endif
887 890
888 name_prefix[0] = class_prefix[0] = XrmStringToName (RESCLASS); 891 name_prefix[0] = class_prefix[0] = XrmStringToName (RESCLASS);
889 XrmEnumerateDatabase (database, name_prefix, class_prefix, 892 XrmEnumerateDatabase (database, name_prefix, class_prefix,
890 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure); 893 XrmEnumOneLevel, rxvt_enumerate_helper, (XPointer)closure);
891 894
892 name_prefix[0] = class_prefix[0] = XrmStringToName (rs[Rs_name]); 895 name_prefix[0] = class_prefix[0] = XrmStringToName (rs[Rs_name]);
893 XrmEnumerateDatabase (database, name_prefix, class_prefix, 896 XrmEnumerateDatabase (database, name_prefix, class_prefix,
894 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure); 897 XrmEnumOneLevel, rxvt_enumerate_helper, (XPointer)closure);
895# endif 898#endif
896} 899}
897 900
898void 901void
899rxvt_term::extract_keysym_resources () 902rxvt_term::extract_keysym_resources ()
900{ 903{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines