diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-02-11 21:13:34 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-02-11 21:13:34 -0800 |
commit | af59aa6e3c661fcd547df8bc4175750f9edb20ec (patch) | |
tree | 6599c3ee9a310850bb8134e1c1d5a24958648b12 /src/xsettings.c | |
parent | e87977013bd12fb0011936e9643d5b69f5452cd2 (diff) | |
download | emacs-af59aa6e3c661fcd547df8bc4175750f9edb20ec.tar.gz |
Port to Solaris 10, which doesn't support FC_HINT_STYLE.
Diffstat (limited to 'src/xsettings.c')
-rw-r--r-- | src/xsettings.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/xsettings.c b/src/xsettings.c index e3d2c6e9efb..097b2477e03 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -75,7 +75,7 @@ enum { SEEN_FONT = 0x40, SEEN_TB_STYLE = 0x80, }; -struct xsettings +struct xsettings { #ifdef HAVE_XFT FcBool aa, hinting; @@ -104,7 +104,7 @@ something_changedCB (GConfClient *client, gpointer user_data) { GConfValue *v = gconf_entry_get_value (entry); - + if (!v) return; if (v->type == GCONF_VALUE_STRING) { @@ -196,7 +196,7 @@ get_prop_window (struct x_display_info *dpyinfo) 4 CARD32 last-change-serial and then the value, For string: - + bytes type what ------------------------------------ 4 CARD32 n = value-length @@ -280,7 +280,7 @@ parse_settings (unsigned char *prop, (strcmp (XSETTINGS_FONT_NAME, name) == 0) || (strcmp (XSETTINGS_TOOL_BAR_STYLE, name) == 0); - switch (type) + switch (type) { case 0: /* Integer */ if (bytes_parsed+4 > bytes) return BadLength; @@ -310,14 +310,14 @@ parse_settings (unsigned char *prop, case 2: /* RGB value */ /* No need to parse this */ if (bytes_parsed+8 > bytes) return BadLength; - bytes_parsed += 8; /* 4 values (r, b, g, alpha), 2 bytes each. */ + bytes_parsed += 8; /* 4 values (r, b, g, alpha), 2 bytes each. */ break; default: /* Parse Error */ return BadValue; } - if (want_this) + if (want_this) { ++settings_seen; if (strcmp (name, XSETTINGS_FONT_NAME) == 0) @@ -341,6 +341,7 @@ parse_settings (unsigned char *prop, settings->seen |= SEEN_HINTING; settings->hinting = ival != 0; } +# ifdef FC_HINT_STYLE else if (strcmp (name, "Xft/HintStyle") == 0) { settings->seen |= SEEN_HINTSTYLE; @@ -355,6 +356,7 @@ parse_settings (unsigned char *prop, else settings->seen &= ~SEEN_HINTSTYLE; } +# endif else if (strcmp (name, "Xft/RGBA") == 0) { settings->seen |= SEEN_RGBA; @@ -442,7 +444,9 @@ apply_xft_settings (struct x_display_info *dpyinfo, pat); FcPatternGetBool (pat, FC_ANTIALIAS, 0, &oldsettings.aa); FcPatternGetBool (pat, FC_HINTING, 0, &oldsettings.hinting); +# ifdef FC_HINT_STYLE FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &oldsettings.hintstyle); +# endif FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter); FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba); FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi); @@ -488,6 +492,7 @@ apply_xft_settings (struct x_display_info *dpyinfo, if (strlen (buf) > 0) strcat (buf, ", "); sprintf (buf+strlen (buf), "LCDFilter: %d", oldsettings.lcdfilter); +# ifdef FC_HINT_STYLE if ((settings->seen & SEEN_HINTSTYLE) != 0 && oldsettings.hintstyle != settings->hintstyle) { @@ -496,6 +501,7 @@ apply_xft_settings (struct x_display_info *dpyinfo, ++changed; oldsettings.hintstyle = settings->hintstyle; } +# endif if (strlen (buf) > 0) strcat (buf, ", "); sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle); @@ -508,7 +514,7 @@ apply_xft_settings (struct x_display_info *dpyinfo, FcPatternAddDouble (pat, FC_DPI, settings->dpi); ++changed; oldsettings.dpi = settings->dpi; - + /* Change the DPI on this display and all frames on the display. */ dpyinfo->resy = dpyinfo->resx = settings->dpi; FOR_EACH_FRAME (tail, frame) @@ -565,7 +571,7 @@ read_and_apply_settings (struct x_display_info *dpyinfo, int send_event_p) if (settings.seen & SEEN_FONT) { - if (!current_font || strcmp (current_font, settings.font) != 0) + if (!current_font || strcmp (current_font, settings.font) != 0) { free (current_font); current_font = settings.font; @@ -774,4 +780,3 @@ If this variable is nil, Emacs ignores system font changes. */); Fprovide (intern_c_string ("dynamic-setting"), Qnil); } - |