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.161 by sf-exg, Sun Dec 18 02:25:12 2011 UTC vs.
Revision 1.163 by sf-exg, Thu May 24 16:19:26 2012 UTC

270#endif 270#endif
271#if ISO_14755 271#if ISO_14755
272 BOOL (Rs_iso14755, "iso14755", NULL, Opt_iso14755, 0, NULL), 272 BOOL (Rs_iso14755, "iso14755", NULL, Opt_iso14755, 0, NULL),
273 BOOL (Rs_iso14755_52, "iso14755_52", NULL, Opt_iso14755_52, 0, NULL), 273 BOOL (Rs_iso14755_52, "iso14755_52", NULL, Opt_iso14755_52, 0, NULL),
274#endif 274#endif
275#ifdef HAVE_AFTERIMAGE
276 STRG (Rs_blendtype, "blendType", "blt", "string", "background image blending type - alpha, tint, etc..."),
277#endif
278#ifndef NO_RESOURCES 275#ifndef NO_RESOURCES
279 RINFO ("xrm", "string"), 276 RINFO ("xrm", "string"),
280#endif 277#endif
281#ifdef KEYSYM_RESOURCE 278#ifdef KEYSYM_RESOURCE
282 RINFO ("keysym.sym", "keysym"), 279 RINFO ("keysym.sym", "keysym"),
335 "fade," 332 "fade,"
336#endif 333#endif
337#if defined(ENABLE_TRANSPARENCY) 334#if defined(ENABLE_TRANSPARENCY)
338 "transparent," 335 "transparent,"
339 "tint," 336 "tint,"
340#endif
341#if HAVE_AFTERIMAGE
342 "afterimage,"
343#endif 337#endif
344#if HAVE_PIXBUF 338#if HAVE_PIXBUF
345 "pixbuf," 339 "pixbuf,"
346#endif 340#endif
347#if defined(USE_XIM) 341#if defined(USE_XIM)
766 /* 760 /*
767 * Query resources for options that affect us 761 * Query resources for options that affect us
768 */ 762 */
769 for (int entry = 0; entry < ecb_array_length (optList); entry++) 763 for (int entry = 0; entry < ecb_array_length (optList); entry++)
770 { 764 {
771 int s;
772 const char *kw = optList[entry].kw; 765 const char *kw = optList[entry].kw;
773 766
774 if (kw == NULL || rs[optList[entry].doff] != NULL) 767 if (kw == NULL || rs[optList[entry].doff] != NULL)
775 continue; // previously set 768 continue; // previously set
776 769
782 allocated.push_back ((void *)p); 775 allocated.push_back ((void *)p);
783 rs[optList[entry].doff] = p; 776 rs[optList[entry].doff] = p;
784 777
785 if (optList_isBool (entry)) 778 if (optList_isBool (entry))
786 { 779 {
787 s = strcasecmp (p, "TRUE") == 0 780 bool s = parse_bool_resource (p);
788 || strcasecmp (p, "YES") == 0
789 || strcasecmp (p, "ON") == 0
790 || strcasecmp (p, "1") == 0;
791 781
792 if (optList_isReverse (entry)) 782 if (optList_isReverse (entry))
793 s = !s; 783 s = !s;
794 784
795 set_option (optList[entry].index, s); 785 set_option (optList[entry].index, s);
800} 790}
801 791
802void 792void
803rxvt_term::extract_keysym_resources () 793rxvt_term::extract_keysym_resources ()
804{ 794{
805#ifndef NO_RESOURCES 795#if !defined NO_RESOURCES && defined KEYSYM_RESOURCE
796 find_resources ("keysym", "Keysym", XrmEnumOneLevel, rxvt_define_key);
797#endif
798}
799
800#if !defined NO_RESOURCES && defined KEYSYM_RESOURCE
801void
802rxvt_term::find_resources (const char *n_prefix, const char *c_prefix, int mode,
803 Bool (*proc)(XrmDatabase *, XrmBindingList, XrmQuarkList, XrmRepresentation *, XrmValue *, XPointer))
804{
806 /* 805 /*
807 * [R5 or later]: enumerate the resource database 806 * [R5 or later]: enumerate the resource database
808 */ 807 */
809# ifdef KEYSYM_RESOURCE
810 XrmDatabase database = XrmGetDatabase (dpy); 808 XrmDatabase database = XrmGetDatabase (dpy);
811 XrmName name_prefix[3]; 809 XrmName name_prefix[3];
812 XrmClass class_prefix[3]; 810 XrmClass class_prefix[3];
813 811
814 name_prefix[0] = XrmStringToName (rs[Rs_name]); 812 name_prefix[0] = XrmStringToName (rs[Rs_name]);
815 name_prefix[1] = XrmStringToName ("keysym"); 813 name_prefix[1] = XrmStringToName (n_prefix);
816 name_prefix[2] = NULLQUARK; 814 name_prefix[2] = NULLQUARK;
817 class_prefix[0] = XrmStringToName (RESCLASS); 815 class_prefix[0] = XrmStringToName (RESCLASS);
818 class_prefix[1] = XrmStringToName ("Keysym"); 816 class_prefix[1] = XrmStringToName (c_prefix);
819 class_prefix[2] = NULLQUARK; 817 class_prefix[2] = NULLQUARK;
820 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ 818 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */
821 XrmEnumerateDatabase (database, name_prefix, class_prefix, 819 XrmEnumerateDatabase (database, name_prefix, class_prefix,
822 XrmEnumOneLevel, rxvt_define_key, NULL); 820 mode, proc, NULL);
823# ifdef RESFALLBACK 821# ifdef RESFALLBACK
824 name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK); 822 name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK);
825 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ 823 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */
826 XrmEnumerateDatabase (database, name_prefix, class_prefix, 824 XrmEnumerateDatabase (database, name_prefix, class_prefix,
827 XrmEnumOneLevel, rxvt_define_key, NULL); 825 mode, proc, NULL);
828# endif 826# endif
829# endif
830
831#endif /* NO_RESOURCES */
832} 827}
828#endif
833 829
834/*----------------------- end-of-file (C source) -----------------------*/ 830/*----------------------- end-of-file (C source) -----------------------*/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines