changeset 105062:5f7b67da2bbd

(x_get_resource_string): Re-add for non-toolkit builds (bug#4461).
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 17 Sep 2009 16:41:55 +0000
parents 633effc81f3d
children f9ef3a7fab3d
files src/ChangeLog src/frame.c
diffstat 2 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Sep 17 15:58:56 2009 +0000
+++ b/src/ChangeLog	Thu Sep 17 16:41:55 2009 +0000
@@ -1,3 +1,8 @@
+2009-09-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* frame.c (x_get_resource_string): Re-add for non-toolkit builds
+	(bug#4461).
+
 2009-09-17  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* puresize.h (BASE_PURESIZE): Increase to 1290000.
--- a/src/frame.c	Thu Sep 17 15:58:56 2009 +0000
+++ b/src/frame.c	Thu Sep 17 16:41:55 2009 +0000
@@ -3893,6 +3893,32 @@
 			    attribute, class, component, subclass);
 }
 
+#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
+/* Used when C code wants a resource value.  */
+/* Called from oldXMenu/Create.c.  */
+char *
+x_get_resource_string (attribute, class)
+     char *attribute, *class;
+{
+  char *name_key;
+  char *class_key;
+  struct frame *sf = SELECTED_FRAME ();
+
+  /* Allocate space for the components, the dots which separate them,
+     and the final '\0'.  */
+  name_key = (char *) alloca (SBYTES (Vinvocation_name)
+			      + strlen (attribute) + 2);
+  class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
+			       + strlen (class) + 2);
+
+  sprintf (name_key, "%s.%s", SDATA (Vinvocation_name), attribute);
+  sprintf (class_key, "%s.%s", EMACS_CLASS, class);
+
+  return x_get_string_resource (FRAME_X_DISPLAY_INFO (sf)->xrdb,
+				name_key, class_key);
+}
+#endif
+
 /* Return the value of parameter PARAM.
 
    First search ALIST, then Vdefault_frame_alist, then the X defaults