… | |
… | |
111 | STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"), |
111 | STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"), |
112 | BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, 0, NULL), |
112 | BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, 0, NULL), |
113 | BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_scrollTtyOutput, Optflag_Reverse, "scroll-on-tty-output inhibit"), |
113 | 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"), |
114 | BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, 0, "scroll-on-keypress"), |
115 | BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, 0, "scroll-with-buffer"), |
115 | BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, 0, "scroll-with-buffer"), |
116 | #if ENABLE_TRANSPARENCY |
116 | #if BG_IMAGE_FROM_ROOT |
117 | BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, 0, "inherit parent pixmap"), |
117 | BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, 0, "inherit parent pixmap"), |
118 | BOOL (Rs_transparent, "transparent", "tr", Opt_transparent, 0, "inherit parent pixmap"), |
118 | BOOL (Rs_transparent, "transparent", "tr", Opt_transparent, 0, "inherit parent pixmap"), |
119 | STRG (Rs_color + Color_tint, "tintColor", "tint", "color", "tint color"), |
119 | STRG (Rs_color + Color_tint, "tintColor", "tint", "color", "tint color"), |
120 | STRG (Rs_shade, "shading", "sh", "number", "shade background by number %."), |
120 | 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"), |
121 | STRG (Rs_blurradius, "blurRadius", "blr", "HxV", "gaussian blur radii to apply to the root background"), |
… | |
… | |
195 | STRG (Rs_color + Color_pointer_bg, "pointerColor2", "pr2", "color", "pointer bg color"), |
195 | STRG (Rs_color + Color_pointer_bg, "pointerColor2", "pr2", "color", "pointer bg color"), |
196 | STRG (Rs_color + Color_border, "borderColor", "bd", "color", "border color"), |
196 | STRG (Rs_color + Color_border, "borderColor", "bd", "color", "border color"), |
197 | #if BG_IMAGE_FROM_FILE |
197 | #if BG_IMAGE_FROM_FILE |
198 | RSTRG (Rs_path, "path", "search path"), |
198 | RSTRG (Rs_path, "path", "search path"), |
199 | STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"), |
199 | STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"), |
|
|
200 | #endif |
200 | # if ENABLE_EWMH |
201 | #if ENABLE_EWMH |
201 | STRG (Rs_iconfile, "iconFile", "icon", "file", "path to application icon image"), |
202 | STRG (Rs_iconfile, "iconFile", "icon", "file", "path to application icon image"), |
202 | # endif |
|
|
203 | #endif |
203 | #endif |
204 | /* fonts: command-line option = resource name */ |
204 | /* fonts: command-line option = resource name */ |
205 | STRG (Rs_font, "font", "fn", "fontname", "normal text font"), |
205 | STRG (Rs_font, "font", "fn", "fontname", "normal text font"), |
206 | #if ENABLE_STYLES |
206 | #if ENABLE_STYLES |
207 | STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"), |
207 | STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"), |
… | |
… | |
639 | rxvt_define_key (XrmDatabase *database ecb_unused, |
639 | rxvt_define_key (XrmDatabase *database ecb_unused, |
640 | XrmBindingList bindings ecb_unused, |
640 | XrmBindingList bindings ecb_unused, |
641 | XrmQuarkList quarks, |
641 | XrmQuarkList quarks, |
642 | XrmRepresentation *type ecb_unused, |
642 | XrmRepresentation *type ecb_unused, |
643 | XrmValue *value, |
643 | XrmValue *value, |
644 | XPointer closure ecb_unused) |
644 | XPointer closure) |
645 | { |
645 | { |
|
|
646 | rxvt_term *term = (rxvt_term *)closure; |
646 | int last; |
647 | int last; |
647 | |
648 | |
648 | for (last = 0; quarks[last] != NULLQUARK; last++) /* look for last quark in list */ |
649 | for (last = 0; quarks[last] != NULLQUARK; last++) /* look for last quark in list */ |
649 | ; |
650 | ; |
650 | |
651 | |
651 | last--; |
652 | last--; |
652 | GET_R->parse_keysym (XrmQuarkToString (quarks[last]), (char *)value->addr);//D//TODO |
653 | term->parse_keysym (XrmQuarkToString (quarks[last]), (char *)value->addr); |
653 | return False; |
654 | return False; |
654 | } |
655 | } |
655 | |
656 | |
656 | /* |
657 | /* |
657 | * look for something like this (XK_Delete) |
658 | * look for something like this (XK_Delete) |
… | |
… | |
742 | } |
743 | } |
743 | |
744 | |
744 | wchar_t *ws = rxvt_mbstowcs (arg); |
745 | wchar_t *ws = rxvt_mbstowcs (arg); |
745 | if (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END))) |
746 | if (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END))) |
746 | keyboard->register_user_translation (sym, state, ws); |
747 | keyboard->register_user_translation (sym, state, ws); |
|
|
748 | |
747 | free (ws); |
749 | free (ws); |
748 | return 1; |
750 | return 1; |
749 | } |
751 | } |
750 | |
752 | |
751 | # endif /* KEYSYM_RESOURCE */ |
753 | # endif /* KEYSYM_RESOURCE */ |
… | |
… | |
797 | /* |
799 | /* |
798 | * Query resources for options that affect us |
800 | * Query resources for options that affect us |
799 | */ |
801 | */ |
800 | for (int entry = 0; entry < ecb_array_length (optList); entry++) |
802 | for (int entry = 0; entry < ecb_array_length (optList); entry++) |
801 | { |
803 | { |
|
|
804 | int s; |
802 | const char *kw = optList[entry].kw; |
805 | const char *kw = optList[entry].kw; |
803 | |
806 | |
804 | if (kw == NULL || rs[optList[entry].doff] != NULL) |
807 | if (kw == NULL || rs[optList[entry].doff] != NULL) |
805 | continue; // previously set |
808 | continue; // previously set |
806 | |
809 | |
… | |
… | |
812 | allocated.push_back ((void *)p); |
815 | allocated.push_back ((void *)p); |
813 | rs[optList[entry].doff] = p; |
816 | rs[optList[entry].doff] = p; |
814 | |
817 | |
815 | if (optList_isBool (entry)) |
818 | if (optList_isBool (entry)) |
816 | { |
819 | { |
817 | bool s = parse_bool_resource (p); |
820 | s = strcasecmp (p, "TRUE") == 0 |
|
|
821 | || strcasecmp (p, "YES") == 0 |
|
|
822 | || strcasecmp (p, "ON") == 0 |
|
|
823 | || strcasecmp (p, "1") == 0; |
818 | |
824 | |
819 | if (optList_isReverse (entry)) |
825 | if (optList_isReverse (entry)) |
820 | s = !s; |
826 | s = !s; |
821 | |
827 | |
822 | set_option (optList[entry].index, s); |
828 | set_option (optList[entry].index, s); |
… | |
… | |
827 | } |
833 | } |
828 | |
834 | |
829 | void |
835 | void |
830 | rxvt_term::extract_keysym_resources () |
836 | rxvt_term::extract_keysym_resources () |
831 | { |
837 | { |
832 | #if !defined NO_RESOURCES && defined KEYSYM_RESOURCE |
838 | #ifndef NO_RESOURCES |
833 | find_resources ("keysym", "Keysym", XrmEnumOneLevel, rxvt_define_key); |
|
|
834 | #endif |
|
|
835 | } |
|
|
836 | |
|
|
837 | #if !defined NO_RESOURCES && defined KEYSYM_RESOURCE |
|
|
838 | void |
|
|
839 | rxvt_term::find_resources (const char *n_prefix, const char *c_prefix, int mode, |
|
|
840 | Bool (*proc)(XrmDatabase *, XrmBindingList, XrmQuarkList, XrmRepresentation *, XrmValue *, XPointer)) |
|
|
841 | { |
|
|
842 | /* |
839 | /* |
843 | * [R5 or later]: enumerate the resource database |
840 | * [R5 or later]: enumerate the resource database |
844 | */ |
841 | */ |
|
|
842 | # ifdef KEYSYM_RESOURCE |
845 | XrmDatabase database = XrmGetDatabase (dpy); |
843 | XrmDatabase database = XrmGetDatabase (dpy); |
846 | XrmName name_prefix[3]; |
844 | XrmName name_prefix[3]; |
847 | XrmClass class_prefix[3]; |
845 | XrmClass class_prefix[3]; |
848 | |
846 | |
849 | name_prefix[0] = XrmStringToName (rs[Rs_name]); |
847 | name_prefix[0] = XrmStringToName (rs[Rs_name]); |
850 | name_prefix[1] = XrmStringToName (n_prefix); |
848 | name_prefix[1] = XrmStringToName ("keysym"); |
851 | name_prefix[2] = NULLQUARK; |
849 | name_prefix[2] = NULLQUARK; |
852 | class_prefix[0] = XrmStringToName (RESCLASS); |
850 | class_prefix[0] = XrmStringToName (RESCLASS); |
853 | class_prefix[1] = XrmStringToName (c_prefix); |
851 | class_prefix[1] = XrmStringToName ("Keysym"); |
854 | class_prefix[2] = NULLQUARK; |
852 | class_prefix[2] = NULLQUARK; |
855 | /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ |
853 | /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ |
856 | XrmEnumerateDatabase (database, name_prefix, class_prefix, |
854 | XrmEnumerateDatabase (database, name_prefix, class_prefix, |
857 | mode, proc, NULL); |
855 | XrmEnumOneLevel, rxvt_define_key, (XPointer)this); |
858 | # ifdef RESFALLBACK |
856 | # ifdef RESFALLBACK |
859 | name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK); |
857 | name_prefix[0] = class_prefix[0] = XrmStringToName (RESFALLBACK); |
860 | /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ |
858 | /* XXX: Need to check sizeof (rxvt_t) == sizeof (XPointer) */ |
861 | XrmEnumerateDatabase (database, name_prefix, class_prefix, |
859 | XrmEnumerateDatabase (database, name_prefix, class_prefix, |
862 | mode, proc, NULL); |
860 | XrmEnumOneLevel, rxvt_define_key, (XPointer)this); |
863 | # endif |
861 | # endif |
|
|
862 | # endif |
|
|
863 | |
|
|
864 | #endif /* NO_RESOURCES */ |
864 | } |
865 | } |
865 | #endif |
|
|
866 | |
866 | |
867 | /*----------------------- end-of-file (C source) -----------------------*/ |
867 | /*----------------------- end-of-file (C source) -----------------------*/ |