]> code.delx.au - gnu-emacs/blobdiff - src/xsettings.c
Fix build break in non-Cygw32 Cygwin builds introduced in 2012-10-29T17:24:29Z!dancol...
[gnu-emacs] / src / xsettings.c
index 06718df5a3c4b7e543f7dad1d8cb0ffd351b9a44..d23070791d8f3df5bd64d2dac56b87fa18af1423 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions for handling font and other changes dynamically.
 
-Copyright (C) 2009-2011  Free Software Foundation, Inc.
+Copyright (C) 2009-2012  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -21,7 +21,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <float.h>
 #include <limits.h>
-#include <setjmp.h>
 #include <fcntl.h>
 #include "lisp.h"
 #include "xterm.h"
@@ -30,7 +29,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "keyboard.h"
 #include "blockinput.h"
 #include "termhooks.h"
-#include "termopts.h"
 
 #include <X11/Xproto.h>
 
@@ -83,7 +81,7 @@ dpyinfo_valid (struct x_display_info *dpyinfo)
 
 /* Store a monospace font change event if the monospaced font changed.  */
 
-#ifdef HAVE_XFT
+#if defined HAVE_XFT && (defined HAVE_GSETTINGS || defined HAVE_GCONF)
 static void
 store_monospaced_changed (const char *newfont)
 {
@@ -99,9 +97,11 @@ store_monospaced_changed (const char *newfont)
                                   XCAR (first_dpyinfo->name_list_element));
     }
 }
+#endif
 
 /* Store a font name change event if the font name changed.  */
 
+#ifdef HAVE_XFT
 static void
 store_font_name_changed (const char *newfont)
 {
@@ -119,7 +119,7 @@ store_font_name_changed (const char *newfont)
 }
 #endif /* HAVE_XFT */
 
-/* Map TOOL_BAR_STYLE from a string to its correspinding Lisp value.
+/* Map TOOL_BAR_STYLE from a string to its corresponding Lisp value.
    Return Qnil if TOOL_BAR_STYLE is not known.  */
 
 static Lisp_Object
@@ -157,8 +157,9 @@ store_tool_bar_style_changed (const char *newstyle,
                                 XCAR (dpyinfo->name_list_element));
 }
 
-
+#ifdef HAVE_XFT
 #define XSETTINGS_FONT_NAME       "Gtk/FontName"
+#endif
 #define XSETTINGS_TOOL_BAR_STYLE  "Gtk/ToolbarStyle"
 
 enum {
@@ -252,7 +253,7 @@ something_changed_gsettingsCB (GSettings *settings,
           g_variant_unref (val);
         }
     }
-#endif /* HAVE_XFT */  
+#endif /* HAVE_XFT */
 }
 
 #endif /* HAVE_GSETTINGS */
@@ -441,14 +442,14 @@ parse_settings (unsigned char *prop,
       bytes_parsed += 4; /* Skip serial for this value */
       if (bytes_parsed > bytes) return BadLength;
 
-      want_this = 
+      want_this =
 #ifdef HAVE_XFT
         (nlen > 6 && strncmp (name, "Xft/", 4) == 0)
         || strcmp (XSETTINGS_FONT_NAME, name) == 0
         ||
 #endif
         strcmp (XSETTINGS_TOOL_BAR_STYLE, name) == 0;
-  
+
       switch (type)
         {
         case 0: /* Integer */
@@ -708,10 +709,12 @@ apply_xft_settings (struct x_display_info *dpyinfo,
       if (send_event_p)
         store_config_changed_event (Qfont_render,
                                     XCAR (dpyinfo->name_list_element));
-      sprintf (buf, format, oldsettings.aa, oldsettings.hinting,
-              oldsettings.rgba, oldsettings.lcdfilter,
-              oldsettings.hintstyle, oldsettings.dpi);
-      Vxft_settings = build_string (buf);
+      Vxft_settings
+       = make_formatted_string (buf, format,
+                                oldsettings.aa, oldsettings.hinting,
+                                oldsettings.rgba, oldsettings.lcdfilter,
+                                oldsettings.hintstyle, oldsettings.dpi);
+
     }
   else
     FcPatternDestroy (pat);
@@ -810,7 +813,7 @@ init_gsettings (void)
   g_type_init ();
 #endif
 
-  schemas = g_settings_list_schemas();
+  schemas = g_settings_list_schemas ();
   if (schemas == NULL) return;
   while (! schema_found && *schemas != NULL)
     schema_found = strcmp (*schemas++, GSETTINGS_SCHEMA) == 0;
@@ -925,7 +928,7 @@ init_xsettings (struct x_display_info *dpyinfo)
 {
   Display *dpy = dpyinfo->display;
 
-  BLOCK_INPUT;
+  block_input ();
 
   /* Select events so we can detect client messages sent when selection
      owner changes.  */
@@ -935,7 +938,7 @@ init_xsettings (struct x_display_info *dpyinfo)
   if (dpyinfo->xsettings_window != None)
     read_and_apply_settings (dpyinfo, False);
 
-  UNBLOCK_INPUT;
+  unblock_input ();
 }
 
 void
@@ -1022,7 +1025,7 @@ syms_of_xsettings (void)
   defsubr (&Sfont_get_system_normal_font);
 
   DEFVAR_BOOL ("font-use-system-font", use_system_font,
-    doc: /* *Non-nil means to apply the system defined font dynamically.
+    doc: /* Non-nil means to apply the system defined font dynamically.
 When this is non-nil and the system defined fixed width font changes, we
 update frames dynamically.
 If this variable is nil, Emacs ignores system font changes.  */);
@@ -1030,7 +1033,7 @@ If this variable is nil, Emacs ignores system font changes.  */);
 
   DEFVAR_LISP ("xft-settings", Vxft_settings,
                doc: /* Font settings applied to Xft.  */);
-  Vxft_settings = make_string ("", 0);
+  Vxft_settings = empty_unibyte_string;
 
 #ifdef HAVE_XFT
   Fprovide (intern_c_string ("font-render-setting"), Qnil);