diff options
| author | Paul Eggert | 2011-04-16 01:36:41 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-16 01:36:41 -0700 |
| commit | 018c5e19a5a0c8ef4b361a8230dca2db6c804fb3 (patch) | |
| tree | e15f75749e4855a183067a44405d03ecc6146402 /src/frame.c | |
| parent | 63d2b86e5d50aea812a88bacf9a210ce505e11c2 (diff) | |
| download | emacs-018c5e19a5a0c8ef4b361a8230dca2db6c804fb3.tar.gz emacs-018c5e19a5a0c8ef4b361a8230dca2db6c804fb3.zip | |
* frame.c, frame.h (x_get_resource_string): Bring this back, but
only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index cafcd149503..9024a2fb5e2 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3845,6 +3845,31 @@ display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute, Lisp_Objec | |||
| 3845 | attribute, class, component, subclass); | 3845 | attribute, class, component, subclass); |
| 3846 | } | 3846 | } |
| 3847 | 3847 | ||
| 3848 | #if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT | ||
| 3849 | /* Used when C code wants a resource value. */ | ||
| 3850 | /* Called from oldXMenu/Create.c. */ | ||
| 3851 | char * | ||
| 3852 | x_get_resource_string (const char *attribute, const char *class) | ||
| 3853 | { | ||
| 3854 | char *name_key; | ||
| 3855 | char *class_key; | ||
| 3856 | struct frame *sf = SELECTED_FRAME (); | ||
| 3857 | |||
| 3858 | /* Allocate space for the components, the dots which separate them, | ||
| 3859 | and the final '\0'. */ | ||
| 3860 | name_key = (char *) alloca (SBYTES (Vinvocation_name) | ||
| 3861 | + strlen (attribute) + 2); | ||
| 3862 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | ||
| 3863 | + strlen (class) + 2); | ||
| 3864 | |||
| 3865 | sprintf (name_key, "%s.%s", SSDATA (Vinvocation_name), attribute); | ||
| 3866 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); | ||
| 3867 | |||
| 3868 | return x_get_string_resource (FRAME_X_DISPLAY_INFO (sf)->xrdb, | ||
| 3869 | name_key, class_key); | ||
| 3870 | } | ||
| 3871 | #endif | ||
| 3872 | |||
| 3848 | /* Return the value of parameter PARAM. | 3873 | /* Return the value of parameter PARAM. |
| 3849 | 3874 | ||
| 3850 | First search ALIST, then Vdefault_frame_alist, then the X defaults | 3875 | First search ALIST, then Vdefault_frame_alist, then the X defaults |