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 | |
| 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.
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/frame.c | 25 | ||||
| -rw-r--r-- | src/frame.h | 4 |
3 files changed, 32 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f7ed1023afc..6cf4b23dd87 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2011-04-16 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-04-16 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * frame.c, frame.h (x_get_resource_string): Bring this back, but | ||
| 4 | only if HAVE_X_WINDOWS && !USE_X_TOOLKIT. | ||
| 5 | |||
| 3 | * bitmaps: Change bitmaps from unsigned char back to the X11 | 6 | * bitmaps: Change bitmaps from unsigned char back to the X11 |
| 4 | compatible char. Avoid the old compiler warnings about | 7 | compatible char. Avoid the old compiler warnings about |
| 5 | out-of-range initializers by using, for example, '\xab' rather | 8 | out-of-range initializers by using, for example, '\xab' rather |
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 |
diff --git a/src/frame.h b/src/frame.h index 1f176f6f900..944a3270ae5 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -1133,6 +1133,10 @@ extern Lisp_Object display_x_get_resource (Display_Info *, | |||
| 1133 | Lisp_Object component, | 1133 | Lisp_Object component, |
| 1134 | Lisp_Object subclass); | 1134 | Lisp_Object subclass); |
| 1135 | 1135 | ||
| 1136 | #if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT | ||
| 1137 | extern char *x_get_resource_string (const char *, const char *); | ||
| 1138 | #endif | ||
| 1139 | |||
| 1136 | /* In xmenu.c */ | 1140 | /* In xmenu.c */ |
| 1137 | extern void set_frame_menubar (FRAME_PTR, int, int); | 1141 | extern void set_frame_menubar (FRAME_PTR, int, int); |
| 1138 | 1142 | ||