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.162 by sf-exg, Sat Feb 4 21:47:06 2012 UTC vs.
Revision 1.179 by mikachu, Tue Jul 29 13:50:05 2014 UTC

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 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 2 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.
16 * 16 *
17 * This program is distributed in the hope that it will be useful, 17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96 STRG (Rs_geometry, "geometry", "geometry", "geometry", "size (in characters) and position"), 96 STRG (Rs_geometry, "geometry", "geometry", "geometry", "size (in characters) and position"),
97 SWCH ("C", Opt_console, 0, "intercept console messages"), 97 SWCH ("C", Opt_console, 0, "intercept console messages"),
98 SWCH ("iconic", Opt_iconic, 0, "start iconic"), 98 SWCH ("iconic", Opt_iconic, 0, "start iconic"),
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 BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"), 102 BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"),
102 BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"), 103 BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"),
103 BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"), 104 BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"),
104 BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"), 105 BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"),
105 BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"), 106 BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"),
111 STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"), 112 STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"),
112 BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, 0, NULL), 113 BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, 0, NULL),
113 BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_scrollTtyOutput, Optflag_Reverse, "scroll-on-tty-output inhibit"), 114 BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_scrollTtyOutput, Optflag_Reverse, "scroll-on-tty-output inhibit"),
114 BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, 0, "scroll-on-keypress"), 115 BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, 0, "scroll-on-keypress"),
115 BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, 0, "scroll-with-buffer"), 116 BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, 0, "scroll-with-buffer"),
116#if ENABLE_TRANSPARENCY 117#if BG_IMAGE_FROM_ROOT
117 BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, 0, "inherit parent pixmap"), 118 BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, 0, "inherit parent pixmap"),
118 BOOL (Rs_transparent, "transparent", "tr", Opt_transparent, 0, "inherit parent pixmap"), 119 BOOL (Rs_transparent, "transparent", "tr", Opt_transparent, 0, "inherit parent pixmap"),
119 STRG (Rs_color + Color_tint, "tintColor", "tint", "color", "tint color"), 120 STRG (Rs_color + Color_tint, "tintColor", "tint", "color", "tint color"),
120 STRG (Rs_shade, "shading", "sh", "number", "shade background by number %."), 121 STRG (Rs_shade, "shading", "sh", "number", "shade background by number %."),
121 STRG (Rs_blurradius, "blurRadius", "blr", "HxV", "gaussian blur radii to apply to the root background"), 122 STRG (Rs_blurradius, "blurRadius", "blr", "HxV", "gaussian blur radii to apply to the root background"),
192 RSTRG (Rs_color + Color_cursor2, "cursorColor2", "color"), 193 RSTRG (Rs_color + Color_cursor2, "cursorColor2", "color"),
193#endif /* NO_CURSORCOLOR */ 194#endif /* NO_CURSORCOLOR */
194 STRG (Rs_color + Color_pointer_fg, "pointerColor", "pr", "color", "pointer color"), 195 STRG (Rs_color + Color_pointer_fg, "pointerColor", "pr", "color", "pointer color"),
195 STRG (Rs_color + Color_pointer_bg, "pointerColor2", "pr2", "color", "pointer bg color"), 196 STRG (Rs_color + Color_pointer_bg, "pointerColor2", "pr2", "color", "pointer bg color"),
196 STRG (Rs_color + Color_border, "borderColor", "bd", "color", "border color"), 197 STRG (Rs_color + Color_border, "borderColor", "bd", "color", "border color"),
197#ifdef BG_IMAGE_FROM_FILE 198#if BG_IMAGE_FROM_FILE
198 RSTRG (Rs_path, "path", "search path"), 199 RSTRG (Rs_path, "path", "search path"),
199 STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"), 200 STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"),
201#endif
200# if ENABLE_EWMH 202#if ENABLE_EWMH
201 STRG (Rs_iconfile, "iconFile", "icon", "file", "path to application icon image"), 203 STRG (Rs_iconfile, "iconFile", "icon", "file", "path to application icon image"),
202# endif
203#endif 204#endif
204 /* fonts: command-line option = resource name */ 205 /* fonts: command-line option = resource name */
205 STRG (Rs_font, "font", "fn", "fontname", "normal text font"), 206 STRG (Rs_font, "font", "fn", "fontname", "normal text font"),
206#if ENABLE_STYLES 207#if ENABLE_STYLES
207 STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"), 208 STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"),
208 STRG (Rs_italicFont, "italicFont", "fi", "fontname", "italic font"), 209 STRG (Rs_italicFont, "italicFont", "fi", "fontname", "italic font"),
209 STRG (Rs_boldItalicFont, "boldItalicFont", "fbi", "fontname", "bold italic font"), 210 STRG (Rs_boldItalicFont, "boldItalicFont", "fbi", "fontname", "bold italic font"),
210 BOOL (Rs_intensityStyles, "intensityStyles", "is", Opt_intensityStyles, 0, "font styles imply intensity changes"), 211 BOOL (Rs_intensityStyles, "intensityStyles", "is", Opt_intensityStyles, 0, "font styles imply intensity changes"),
211#endif 212#endif
212#ifdef USE_XIM 213#if USE_XIM
213 STRG (Rs_inputMethod, "inputMethod", "im", "name", "name of input method"), 214 STRG (Rs_inputMethod, "inputMethod", "im", "name", "name of input method"),
214 STRG (Rs_preeditType, "preeditType", "pt", "style", "input style: style = OverTheSpot|OffTheSpot|Root"), 215 STRG (Rs_preeditType, "preeditType", "pt", "style", "input style: style = OverTheSpot|OffTheSpot|Root"),
215 STRG (Rs_imLocale, "imLocale", "imlocale", "string", "locale to use for input method"), 216 STRG (Rs_imLocale, "imLocale", "imlocale", "string", "locale to use for input method"),
216 STRG (Rs_imFont, "imFont", "imfont", "fontname", "fontset for styles OverTheSpot and OffTheSpot"), 217 STRG (Rs_imFont, "imFont", "imfont", "fontname", "fontset for styles OverTheSpot and OffTheSpot"),
217#endif /* USE_XIM */ 218#endif /* USE_XIM */
222 STRG (Rs_saveLines, "saveLines", "sl", "number", "number of scrolled lines to save"), 223 STRG (Rs_saveLines, "saveLines", "sl", "number", "number of scrolled lines to save"),
223#if ENABLE_XEMBED 224#if ENABLE_XEMBED
224 STRG (Rs_embed, NULL, "embed", "windowid", "window id to embed terminal in"), 225 STRG (Rs_embed, NULL, "embed", "windowid", "window id to embed terminal in"),
225#endif 226#endif
226#if XFT 227#if XFT
228 BOOL (Rs_buffered, "buffered", NULL, Opt_buffered, 0, NULL),
229#endif
230#if ENABLE_FRILLS
227 STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"), 231 STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"),
228 BOOL (Rs_buffered, "buffered", NULL, Opt_buffered, 0, NULL), 232 STRG (Rs_visual, "visual", "visual", "number", "visual id to request"),
229#endif
230#if ENABLE_FRILLS
231 RSTRG (Rs_transient_for, "transient-for", "windowid"), 233 RSTRG (Rs_transient_for, "transient-for", "windowid"),
232 BOOL (Rs_override_redirect, "override-redirect", "override-redirect", Opt_override_redirect, 0, "set override-redirect on the terminal window"), 234 BOOL (Rs_override_redirect, "override-redirect", "override-redirect", Opt_override_redirect, 0, "set override-redirect on the terminal window"),
233 STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"), 235 STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"),
234 BOOL (Rs_hold, "hold", "hold", Opt_hold, 0, "retain window after shell exit"), 236 BOOL (Rs_hold, "hold", "hold", Opt_hold, 0, "retain window after shell exit"),
235 STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"), 237 STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"),
384#if defined(XTERM_SCROLLBAR) 386#if defined(XTERM_SCROLLBAR)
385 "+xterm" 387 "+xterm"
386#endif 388#endif
387 "\nUsage: "; /* Usage */ 389 "\nUsage: "; /* Usage */
388 390
389#define INDENT 18 391#define INDENT 28
390 392
391const char rxvt_term::resval_undef [] = "<undef>"; 393const char rxvt_term::resval_undef [] = "<undef>";
392const char rxvt_term::resval_on [] = "on"; 394const char rxvt_term::resval_on [] = "on";
393const char rxvt_term::resval_off [] = "off"; 395const char rxvt_term::resval_off [] = "off";
394 396
395/*{{{ usage: */ 397/*{{{ usage: */
396/*----------------------------------------------------------------------*/ 398/*----------------------------------------------------------------------*/
397static void 399void
398rxvt_usage (int type) 400rxvt_term::rxvt_usage (int type)
399{ 401{
400 unsigned int i, col; 402 unsigned int i, col;
401 403
402 rxvt_log ("%s%s%s", releasestring, optionsstring, RESNAME); 404 rxvt_log ("%s%s%s", releasestring, optionsstring, RESNAME);
403 405
411 { 413 {
412 int len = 0; 414 int len = 0;
413 415
414 if (optList[i].arg) 416 if (optList[i].arg)
415 len = strlen (optList[i].arg) + 1; 417 len = strlen (optList[i].arg) + 1;
418
416 assert (optList[i].opt != NULL); 419 assert (optList[i].opt != NULL);
417 len += 4 + strlen (optList[i].opt) + (optList_isBool (i) ? 2 : 0); 420 len += 4 + strlen (optList[i].opt) + (optList_isBool (i) ? 2 : 0);
418 col += len; 421 col += len;
422
419 if (col > 79) 423 if (col > 79)
420 { 424 {
421 /* assume regular width */ 425 /* assume regular width */
422 rxvt_log ("\n"); 426 rxvt_log ("\n");
423 col = 1 + len; 427 col = 1 + len;
424 } 428 }
425 429
426 rxvt_log (" [-%s%s", (optList_isBool (i) ? "/+" : ""), optList[i].opt); 430 rxvt_log (" [-%s%s", (optList_isBool (i) ? "/+" : ""), optList[i].opt);
431
427 if (optList[i].arg) 432 if (optList[i].arg)
428 rxvt_log (" %s]", optList[i].arg); 433 rxvt_log (" %s]", optList[i].arg);
429 else 434 else
430 rxvt_log ("]"); 435 rxvt_log ("]");
431 } 436 }
444 + (optList_isBool (i) ? 0 : 2)), 449 + (optList_isBool (i) ? 0 : 2)),
445 (optList[i].arg ? optList[i].arg : ""), 450 (optList[i].arg ? optList[i].arg : ""),
446 (optList_isBool (i) ? "turn on/off " : ""), 451 (optList_isBool (i) ? "turn on/off " : ""),
447 optList[i].desc); 452 optList[i].desc);
448 } 453 }
454
455#if ENABLE_PERL
456 rxvt_perl.init (this);
457 rxvt_perl.usage (this, 1);
458#endif
459
449 rxvt_log ("\n --help to list long-options"); 460 rxvt_log ("\n --help to list long-options");
450 break; 461 break;
451 462
452 case 2: /* full resource listing */ 463 case 2: /* full resource listing */
453 rxvt_log (" [options] [-e command args]\n\n" 464 rxvt_log (" [options] [-e command args]\n\n"
455 466
456 for (i = 0; i < ecb_array_length (optList); i++) 467 for (i = 0; i < ecb_array_length (optList); i++)
457 if (optList[i].kw != NULL) 468 if (optList[i].kw != NULL)
458 rxvt_log (" %s: %*s%s\n", 469 rxvt_log (" %s: %*s%s\n",
459 optList[i].kw, 470 optList[i].kw,
460 (INDENT - strlen (optList[i].kw)), "", /* XXX */ 471 (INDENT + 2 - strlen (optList[i].kw)), "", /* XXX */
461 (optList_isBool (i) ? "boolean" : optList[i].arg)); 472 (optList_isBool (i) ? "boolean" : optList[i].arg));
473
474#if ENABLE_PERL
475 rxvt_perl.init (this);
476 rxvt_perl.usage (this, 2);
477#endif
478
462 rxvt_log ("\n -help to list options"); 479 rxvt_log ("\n -help to list options");
463 break; 480 break;
464 } 481 }
465 482
466 rxvt_log ("\n\n"); 483 rxvt_log ("\n\n");
531 * default values 548 * default values
532 */ 549 */
533 550
534 if (optList[entry].doff != -1) 551 if (optList[entry].doff != -1)
535 { 552 {
536 if (flag && i+1 == argc) 553 if (flag && i + 1 == argc)
537 rxvt_fatal ("option '%s' requires an argument, aborting.\n", argv [i]); 554 rxvt_fatal ("option '%s' requires an argument, aborting.\n", argv [i]);
538 555
539 rs[optList[entry].doff] = flag ? argv[++i] : resval_undef; 556 rs[optList[entry].doff] = flag ? argv[++i] : resval_undef;
540 } 557 }
541 } 558 }
549 } 566 }
550 } 567 }
551#ifndef NO_RESOURCES 568#ifndef NO_RESOURCES
552 else if (!strcmp (opt, "xrm")) 569 else if (!strcmp (opt, "xrm"))
553 { 570 {
554 if (i+1 < argc) 571 if (i + 1 < argc)
555 XrmPutLineResource (&option_db, argv[++i]); 572 XrmPutLineResource (&option_db, argv[++i]);
556 } 573 }
557#endif 574#endif
558#ifdef KEYSYM_RESOURCE 575#ifdef KEYSYM_RESOURCE
559 else if (!strncmp (opt, "keysym.", sizeof ("keysym.") - 1)) 576 else if (!strncmp (opt, "keysym.", sizeof ("keysym.") - 1))
560 { 577 {
561 if (i+1 < argc) 578 if (i + 1 < argc)
562 { 579 {
563 char *res = rxvt_temp_buf<char> (strlen (opt) + strlen (argv[++i]) + 6); 580 char *res = rxvt_temp_buf<char> (strlen (opt) + strlen (argv[++i]) + 6);
564 sprintf (res, "*.%s: %s\n", opt, argv[i]); 581 sprintf (res, "*.%s: %s\n", opt, argv[i]);
565 XrmPutLineResource (&option_db, res); 582 XrmPutLineResource (&option_db, res);
566 } 583 }
567 } 584 }
568#endif 585#endif
569 else if (!strcmp (opt, "e")) 586 else if (!strcmp (opt, "e"))
570 { 587 {
571 if (i+1 == argc) 588 if (i + 1 < argc)
572 rxvt_fatal ("option '-e' requires an argument, aborting.\n");
573
574 return (const char **)argv + i + 1; 589 return (const char **)argv + i + 1;
590
591 rxvt_warn ("option '-e' requires an argument, aborting.\n");
592 bad_option = 1;
575 } 593 }
576 else 594 else
577 { 595 {
596#if ENABLE_PERL
597 rxvt_perl.init (this);
598
599 if (int flags = rxvt_perl.parse_resource (this, opt, true, longopt, flag, argv [i + 1]))
600 {
601 if (flags & rxvt_perl.RESOURCE_ARG)
602 {
603 if (i + 1 == argc)
604 {
605 rxvt_warn ("option '%s' requires an argument.\n", argv [i]);
578 bad_option = 1; 606 bad_option = 1;
607 }
608 else
609 ++i;
610 }
611 }
612 else
613#endif
614 {
579 rxvt_warn ("\"%s\": unknown or malformed option.\n", opt); 615 rxvt_warn ("\"%s\": unknown or malformed option.\n", opt);
616 bad_option = 1;
617 }
580 } 618 }
581 } 619 }
582 620
583 if (bad_option) 621 if (bad_option)
584 rxvt_usage (0); 622 rxvt_usage (0);
590 628
591#ifndef NO_RESOURCES 629#ifndef NO_RESOURCES
592/*----------------------------------------------------------------------*/ 630/*----------------------------------------------------------------------*/
593 631
594# ifdef KEYSYM_RESOURCE 632# ifdef KEYSYM_RESOURCE
633static void
634rxvt_define_key (rxvt_term *term, const char *k, const char *v)
635{
636 term->bind_action (k, v);
637}
638
595/* 639/*
596 * Define key from XrmEnumerateDatabase. 640 * Define key from XrmEnumerateDatabase.
597 * quarks will be something like 641 * quarks will be something like
598 * "rxvt" "keysym" "0xFF01" 642 * "rxvt" "keysym" "0xFF01"
599 * value will be a string 643 * value will be a string
600 */ 644 */
601static int 645static int
646rxvt_keysym_enumerate_helper (
602rxvt_define_key (XrmDatabase *database ecb_unused, 647 XrmDatabase *database ecb_unused,
603 XrmBindingList bindings ecb_unused, 648 XrmBindingList bindings ecb_unused,
604 XrmQuarkList quarks, 649 XrmQuarkList quarks,
605 XrmRepresentation *type ecb_unused, 650 XrmRepresentation *type ecb_unused,
606 XrmValue *value, 651 XrmValue *value,
607 XPointer closure ecb_unused) 652 XPointer closure
653)
608{ 654{
609 int last; 655 int last;
610 656
611 for (last = 0; quarks[last] != NULLQUARK; last++) /* look for last quark in list */ 657 for (last = 0; quarks[last] != NULLQUARK; last++) /* look for last quark in list */
612 ; 658 ;
613 659
614 last--; 660 rxvt_term *term = (rxvt_term *)(((void **)closure)[0]);
615 GET_R->parse_keysym (XrmQuarkToString (quarks[last]), (char *)value->addr);//D//TODO 661 void (*cb)(rxvt_term *, const char *, const char *)
662 = (void (*)(rxvt_term *, const char *, const char *))
663 (((void **)closure)[1]);
664
665 cb (term, XrmQuarkToString (quarks[last - 1]), (char *)value->addr);
666
616 return False; 667 return False;
617} 668}
618 669
619/* 670/*
620 * look for something like this (XK_Delete) 671 * look for something like this (XK_Delete)
655 { "4", 1, Mod4Mask }, 706 { "4", 1, Mod4Mask },
656 { "5", 1, Mod5Mask }, 707 { "5", 1, Mod5Mask },
657}; 708};
658 709
659int 710int
660rxvt_term::parse_keysym (const char *str, const char *arg) 711rxvt_term::bind_action (const char *str, const char *arg)
661{ 712{
662 int sym; 713 int sym;
663 unsigned int state = 0; 714 unsigned int state = 0;
664 const char *key = strrchr (str, '-'); 715 const char *key = strrchr (str, '-');
665 716
704 return -1; 755 return -1;
705 } 756 }
706 757
707 wchar_t *ws = rxvt_mbstowcs (arg); 758 wchar_t *ws = rxvt_mbstowcs (arg);
708 if (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END))) 759 if (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END)))
709 keyboard->register_user_translation (sym, state, ws); 760 keyboard->register_action (sym, state, ws);
761
710 free (ws); 762 free (ws);
711 return 1; 763 return 1;
712} 764}
713 765
714# endif /* KEYSYM_RESOURCE */ 766# endif /* KEYSYM_RESOURCE */
792 } 844 }
793#endif /* NO_RESOURCES */ 845#endif /* NO_RESOURCES */
794} 846}
795 847
796void 848void
797rxvt_term::extract_keysym_resources () 849rxvt_term::enumerate_keysym_resources (void (*cb)(rxvt_term *, const char *, const char *))
798{ 850{
799#ifndef NO_RESOURCES 851#ifndef NO_RESOURCES
800 /* 852 /*
801 * [R5 or later]: enumerate the resource database 853 * [R5 or later]: enumerate the resource database
802 */ 854 */
803# ifdef KEYSYM_RESOURCE 855# ifdef KEYSYM_RESOURCE
856 void *closure[2] = {
857 (void *)this,
858 (void *)cb,
859 };
860
804 XrmDatabase database = XrmGetDatabase (dpy); 861 XrmDatabase database = XrmGetDatabase (dpy);
805 XrmName name_prefix[3]; 862 XrmName name_prefix[3];
806 XrmClass class_prefix[3]; 863 XrmClass class_prefix[3];
807 864
808 name_prefix[0] = XrmStringToName (rs[Rs_name]); 865 name_prefix[0] = XrmStringToName (rs[Rs_name]);
811 class_prefix[0] = XrmStringToName (RESCLASS); 868 class_prefix[0] = XrmStringToName (RESCLASS);
812 class_prefix[1] = XrmStringToName ("Keysym"); 869 class_prefix[1] = XrmStringToName ("Keysym");
813 class_prefix[2] = NULLQUARK; 870 class_prefix[2] = NULLQUARK;
814 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ 871 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */
815 XrmEnumerateDatabase (database, name_prefix, class_prefix, 872 XrmEnumerateDatabase (database, name_prefix, class_prefix,
816 XrmEnumOneLevel, rxvt_define_key, NULL); 873 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure);
817# ifdef RESFALLBACK 874# ifdef RESFALLBACK
818 name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK); 875 name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK);
819 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ 876 /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */
820 XrmEnumerateDatabase (database, name_prefix, class_prefix, 877 XrmEnumerateDatabase (database, name_prefix, class_prefix,
821 XrmEnumOneLevel, rxvt_define_key, NULL); 878 XrmEnumOneLevel, rxvt_keysym_enumerate_helper, (XPointer)closure);
822# endif 879# endif
823# endif 880# endif
824 881
825#endif /* NO_RESOURCES */ 882#endif /* NO_RESOURCES */
826} 883}
827 884
885void
886rxvt_term::extract_keysym_resources ()
887{
888 enumerate_keysym_resources (rxvt_define_key);
889}
890
828/*----------------------- end-of-file (C source) -----------------------*/ 891/*----------------------- end-of-file (C source) -----------------------*/
892

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines