X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gdk%2Fwin32%2Fgdkproperty-win32.c;h=04cf3e39af1ff0b2d8f9002c7dc0d19a84ec10b9;hb=9d0febc9a64a5bfb0fcfc3a88de4757f6c1ff090;hp=5a0adc7286dcf013356bdcf64b6a9d48294a3438;hpb=80581c3011871fa000433a881554ffc1e9363468;p=~andy%2Fgtk
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c
index 5a0adc728..04cf3e39a 100644
--- a/gdk/win32/gdkproperty-win32.c
+++ b/gdk/win32/gdkproperty-win32.c
@@ -13,9 +13,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see .
*/
/*
@@ -25,7 +23,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include
+#include "config.h"
#include
#include
#include
@@ -34,10 +32,12 @@
#include "gdkproperty.h"
#include "gdkselection.h"
#include "gdkprivate-win32.h"
+#include "gdkwin32.h"
GdkAtom
-gdk_atom_intern (const gchar *atom_name,
- gint only_if_exists)
+_gdk_win32_display_manager_atom_intern (GdkDisplayManager *manager,
+ const gchar *atom_name,
+ gint only_if_exists)
{
ATOM win32_atom;
GdkAtom retval;
@@ -85,12 +85,14 @@ gdk_atom_intern (const gchar *atom_name,
}
gchar *
-gdk_atom_name (GdkAtom atom)
+_gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager,
+ GdkAtom atom)
{
ATOM win32_atom;
gchar name[256];
- if (GDK_SELECTION_PRIMARY == atom) return g_strdup ("PRIMARY");
+ if (GDK_NONE == atom) return g_strdup ("");
+ else if (GDK_SELECTION_PRIMARY == atom) return g_strdup ("PRIMARY");
else if (GDK_SELECTION_SECONDARY == atom) return g_strdup ("SECONDARY");
else if (GDK_SELECTION_CLIPBOARD == atom) return g_strdup ("CLIPBOARD");
else if (GDK_SELECTION_TYPE_ATOM == atom) return g_strdup ("ATOM");
@@ -112,7 +114,7 @@ gdk_atom_name (GdkAtom atom)
}
gint
-gdk_property_get (GdkWindow *window,
+_gdk_win32_window_get_property (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gulong offset,
@@ -134,110 +136,8 @@ gdk_property_get (GdkWindow *window,
return FALSE;
}
-static gboolean
-find_common_locale (const guchar *data,
- gint nelements,
- gint nchars,
- LCID *lcidp,
- guchar **bufp,
- gint *sizep)
-{
- static struct {
- LCID lcid;
- UINT cp;
- } locales[] = {
-#define ENTRY(lang, sublang) \
- { MAKELCID (MAKELANGID (LANG_##lang, SUBLANG_##sublang), SORT_DEFAULT), 0 }
- ENTRY (ENGLISH, DEFAULT),
- ENTRY (POLISH, DEFAULT),
- ENTRY (CZECH, DEFAULT),
- ENTRY (LITHUANIAN, DEFAULT),
- ENTRY (RUSSIAN, DEFAULT),
- ENTRY (GREEK, DEFAULT),
- ENTRY (TURKISH, DEFAULT),
- ENTRY (HEBREW, DEFAULT),
- ENTRY (ARABIC, DEFAULT),
- ENTRY (THAI, DEFAULT),
- ENTRY (JAPANESE, DEFAULT),
- ENTRY (CHINESE, CHINESE_SIMPLIFIED),
- ENTRY (CHINESE, CHINESE_TRADITIONAL),
- ENTRY (KOREAN, DEFAULT),
-#undef ENTRY
- };
-
- static gboolean been_here = FALSE;
- gint i;
- wchar_t *wcs;
-
- /* For each installed locale: Get the locale's default code page,
- * and store the list of locales and code pages.
- */
- if (!been_here)
- {
- been_here = TRUE;
- for (i = 0; i < G_N_ELEMENTS (locales); i++)
- if (IsValidLocale (locales[i].lcid, LCID_INSTALLED))
- {
- gchar buf[10];
- if (GetLocaleInfo (locales[i].lcid, LOCALE_IDEFAULTANSICODEPAGE,
- buf, sizeof (buf)))
- {
- gchar name[100];
- locales[i].cp = atoi (buf);
- GDK_NOTE (DND, (GetLocaleInfo (locales[i].lcid,
- LOCALE_SENGLANGUAGE,
- name, sizeof (name)),
- g_print ("locale %#lx: %s: CP%d\n",
- (gulong) locales[i].lcid, name,
- locales[i].cp)));
- }
- }
- }
-
- /* Allocate bufp big enough to store data in any code page. Two
- * bytes for each Unicode char should be enough, Windows code pages
- * are either single- or double-byte.
- */
- *bufp = g_malloc ((nchars+1) * 2);
- wcs = g_new (wchar_t, nchars+1);
-
- /* Convert to Windows wide chars into temp buf */
- _gdk_utf8_to_ucs2 (wcs, data, nelements, nchars);
- wcs[nchars] = 0;
-
- /* For each code page that is the default for an installed locale: */
- for (i = 0; i < G_N_ELEMENTS (locales); i++)
- {
- BOOL used_default;
- int nbytes;
-
- if (locales[i].cp == 0)
- continue;
-
- /* Convert to that code page into bufp */
-
- nbytes = WideCharToMultiByte (locales[i].cp, 0, wcs, -1,
- *bufp, (nchars+1)*2,
- NULL, &used_default);
-
- if (!used_default)
- {
- /* This locale is good for the string */
- g_free (wcs);
- *lcidp = locales[i].lcid;
- *sizep = nbytes;
- return TRUE;
- }
- }
-
- g_free (*bufp);
- g_free (wcs);
-
- return FALSE;
-}
-
void
-gdk_property_change (GdkWindow *window,
+_gdk_win32_window_change_property (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
@@ -245,17 +145,11 @@ gdk_property_change (GdkWindow *window,
const guchar *data,
gint nelements)
{
- HGLOBAL hdata, hlcid, hutf8;
- UINT cf = 0;
- LCID lcid;
- LCID *lcidptr;
- GString *rtf = NULL;
- gint i, size, nchars;
- gchar *prop_name, *type_name;
+ HGLOBAL hdata;
+ gint i, size;
guchar *ucptr, *buf = NULL;
- wchar_t *wcptr;
- enum { PLAIN_ASCII, UNICODE_TEXT, SINGLE_LOCALE, RICH_TEXT } method;
- gboolean ok = TRUE;
+ wchar_t *wcptr, *p;
+ glong wclen;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -263,223 +157,130 @@ gdk_property_change (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
- GDK_NOTE (DND,
- (prop_name = gdk_atom_name (property),
- type_name = gdk_atom_name (type),
- g_print ("gdk_property_change: %p %#x (%s) %#x (%s) %s %d*%d bytes %.10s\n",
- GDK_WINDOW_HWND (window),
- (guint) property, prop_name,
- (guint) type, type_name,
- (mode == GDK_PROP_MODE_REPLACE ? "REPLACE" :
- (mode == GDK_PROP_MODE_PREPEND ? "PREPEND" :
- (mode == GDK_PROP_MODE_APPEND ? "APPEND" :
- "???"))),
- format, nelements, data),
- g_free (prop_name),
- g_free (type_name)));
-
- if (property == _gdk_selection_property
- && type == GDK_TARGET_STRING
- && format == 8
- && mode == GDK_PROP_MODE_REPLACE)
- {
- if (!OpenClipboard (GDK_WINDOW_HWND (window)))
- {
- WIN32_API_FAILED ("OpenClipboard");
- return;
- }
-
- /* Check if only ASCII */
- for (i = 0; i < nelements; i++)
- if (data[i] >= 0200)
- break;
-
- if (i == nelements)
- nchars = nelements;
- else
- nchars = g_utf8_strlen (data, nelements);
-
- GDK_NOTE (DND, g_print ("...nchars:%d\n", nchars));
+ GDK_NOTE (DND, {
+ gchar *prop_name = gdk_atom_name (property);
+ gchar *type_name = gdk_atom_name (type);
- if (i == nelements)
- {
- /* If only ASCII, use CF_TEXT and the data as such. */
- method = PLAIN_ASCII;
- size = nelements;
- for (i = 0; i < nelements; i++)
- if (data[i] == '\n')
- size++;
- size++;
- GDK_NOTE (DND, g_print ("...as text: %.40s\n", data));
- }
- else if (IS_WIN_NT ())
- {
- /* On NT, use CF_UNICODETEXT if any non-ASCII char present */
- method = UNICODE_TEXT;
- size = (nchars + 1) * 2;
- GDK_NOTE (DND, g_print ("...as Unicode\n"));
- }
- else if (find_common_locale (data, nelements, nchars, &lcid, &buf, &size))
- {
- /* On Win9x, if all chars are in the default code page of
- * some installed locale, use CF_TEXT and CF_LOCALE.
- */
- method = SINGLE_LOCALE;
- GDK_NOTE (DND, g_print ("...as text in locale %#lx %d bytes\n",
- (gulong) lcid, size));
- }
- else
+ g_print ("gdk_property_change: %p %s %s %s %d*%d bits: %s\n",
+ GDK_WINDOW_HWND (window),
+ prop_name,
+ type_name,
+ (mode == GDK_PROP_MODE_REPLACE ? "REPLACE" :
+ (mode == GDK_PROP_MODE_PREPEND ? "PREPEND" :
+ (mode == GDK_PROP_MODE_APPEND ? "APPEND" :
+ "???"))),
+ format, nelements,
+ _gdk_win32_data_to_string (data, MIN (10, format*nelements/8)));
+ g_free (prop_name);
+ g_free (type_name);
+ });
+
+ /* We should never come here for these types */
+ g_return_if_fail (type != GDK_TARGET_STRING);
+ g_return_if_fail (type != _text);
+ g_return_if_fail (type != _compound_text);
+ g_return_if_fail (type != _save_targets);
+
+ if (property == _gdk_selection &&
+ format == 8 &&
+ mode == GDK_PROP_MODE_REPLACE)
+ {
+ if (type == _utf8_string)
{
- /* On Win9x, otherwise use RTF */
-
- const guchar *p = data;
-
- method = RICH_TEXT;
- rtf = g_string_new ("{\\rtf1\\uc0 ");
-
- while (p < data + nelements)
+ if (!OpenClipboard (GDK_WINDOW_HWND (window)))
{
- if (*p == '{' ||
- *p == '\\' ||
- *p == '}')
- {
- rtf = g_string_append_c (rtf, '\\');
- rtf = g_string_append_c (rtf, *p);
- p++;
- }
- else if (*p < 0200)
- {
- rtf = g_string_append_c (rtf, *p);
- p++;
- }
- else
- {
- guchar *q;
- gint n;
-
- rtf = g_string_append (rtf, "\\uNNNNN ");
- rtf->len -= 6; /* five digits and a space */
- q = rtf->str + rtf->len;
- n = g_sprintf (q, "%d ", g_utf8_get_char (p));
- g_assert (n <= 6);
- rtf->len += n;
-
- p = g_utf8_next_char (p);
- }
+ WIN32_API_FAILED ("OpenClipboard");
+ return;
}
- rtf = g_string_append (rtf, "}");
- size = rtf->len + 1;
- GDK_NOTE (DND, g_print ("...as RTF: %.40s\n", rtf->str));
- }
-
- if (!(hdata = GlobalAlloc (GMEM_MOVEABLE, size)))
- {
- WIN32_API_FAILED ("GlobalAlloc");
- if (!CloseClipboard ())
- WIN32_API_FAILED ("CloseClipboard");
- if (buf != NULL)
- g_free (buf);
- if (rtf != NULL)
- g_string_free (rtf, TRUE);
- return;
- }
- ucptr = GlobalLock (hdata);
+ wcptr = g_utf8_to_utf16 ((char *) data, nelements, NULL, &wclen, NULL);
- switch (method)
- {
- case PLAIN_ASCII:
- cf = CF_TEXT;
- for (i = 0; i < nelements; i++)
+ wclen++; /* Terminating 0 */
+ size = wclen * 2;
+ for (i = 0; i < wclen; i++)
+ if (wcptr[i] == '\n')
+ size += 2;
+
+ if (!(hdata = GlobalAlloc (GMEM_MOVEABLE, size)))
{
- if (data[i] == '\n')
- *ucptr++ = '\r';
- *ucptr++ = data[i];
+ WIN32_API_FAILED ("GlobalAlloc");
+ if (!CloseClipboard ())
+ WIN32_API_FAILED ("CloseClipboard");
+ g_free (buf);
+ return;
}
- *ucptr++ = '\0';
- break;
-
- case UNICODE_TEXT:
- cf = CF_UNICODETEXT;
- wcptr = (wchar_t *) ucptr;
- if (_gdk_utf8_to_ucs2 (wcptr, data, nelements, nchars) == -1)
- g_warning ("_gdk_utf8_to_ucs2() failed");
- wcptr[nchars] = 0;
- break;
-
- case SINGLE_LOCALE:
- cf = CF_TEXT;
- memmove (ucptr, buf, size);
- g_free (buf);
-
- /* Set the CF_LOCALE clipboard data, too */
- if (!(hlcid = GlobalAlloc (GMEM_MOVEABLE, sizeof (LCID))))
- WIN32_API_FAILED ("GlobalAlloc"), ok = FALSE;
- if (ok)
+
+ ucptr = GlobalLock (hdata);
+
+ p = (wchar_t *) ucptr;
+ for (i = 0; i < wclen; i++)
{
- lcidptr = GlobalLock (hlcid);
- *lcidptr = lcid;
- GlobalUnlock (hlcid);
- if (!SetClipboardData (CF_LOCALE, hlcid))
- WIN32_API_FAILED ("SetClipboardData (CF_LOCALE)"), ok = FALSE;
+ if (wcptr[i] == '\n')
+ *p++ = '\r';
+ *p++ = wcptr[i];
}
- break;
+ g_free (wcptr);
- case RICH_TEXT:
- cf = _cf_rtf;
- memmove (ucptr, rtf->str, size);
- g_string_free (rtf, TRUE);
-
- /* Set the UTF8_STRING clipboard data, too, for other
- * GTK+ apps to use (won't bother reading RTF).
+ GlobalUnlock (hdata);
+ GDK_NOTE (DND, g_print ("... SetClipboardData(CF_UNICODETEXT,%p)\n",
+ hdata));
+ if (!SetClipboardData (CF_UNICODETEXT, hdata))
+ WIN32_API_FAILED ("SetClipboardData");
+
+ if (!CloseClipboard ())
+ WIN32_API_FAILED ("CloseClipboard");
+ }
+ else
+ {
+ /* We use delayed rendering for everything else than
+ * text. We can't assign hdata to the clipboard here as type
+ * may be "image/png", "image/jpg", etc. In this case
+ * there's a further conversion afterwards.
*/
- if (!(hutf8 = GlobalAlloc (GMEM_MOVEABLE, nelements)))
- WIN32_API_FAILED ("GlobalAlloc");
- else
+ GDK_NOTE (DND, g_print ("... delayed rendering\n"));
+ _delayed_rendering_data = NULL;
+ if (!(hdata = GlobalAlloc (GMEM_MOVEABLE, nelements > 0 ? nelements : 1)))
{
- guchar *utf8ptr = GlobalLock (hutf8);
- memmove (utf8ptr, data, nelements);
- GlobalUnlock (hutf8);
- if (!SetClipboardData (_cf_utf8_string, hutf8))
- WIN32_API_FAILED ("SetClipboardData (UTF8_STRING)");
+ WIN32_API_FAILED ("GlobalAlloc");
+ return;
}
- break;
-
- default:
- g_assert_not_reached ();
+ ucptr = GlobalLock (hdata);
+ memcpy (ucptr, data, nelements);
+ GlobalUnlock (hdata);
+ _delayed_rendering_data = hdata;
}
-
- GlobalUnlock (hdata);
- if (ok && !SetClipboardData (cf, hdata))
- WIN32_API_FAILED ("SetClipboardData"), ok = FALSE;
-
- if (!CloseClipboard ())
- WIN32_API_FAILED ("CloseClipboard");
+ }
+ else if (property == _gdk_ole2_dnd)
+ {
+ /* Will happen only if gdkdnd-win32.c has OLE2 dnd support compiled in */
+ _gdk_win32_ole2_dnd_property_change (type, format, data, nelements);
}
else
g_warning ("gdk_property_change: General case not implemented");
}
void
-gdk_property_delete (GdkWindow *window,
- GdkAtom property)
+_gdk_win32_window_delete_property (GdkWindow *window,
+ GdkAtom property)
{
gchar *prop_name;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
- GDK_NOTE (DND,
- (prop_name = gdk_atom_name (property),
- g_print ("gdk_property_delete: %p %#x (%s)\n",
- GDK_WINDOW_HWND (window),
- (guint) property, prop_name),
- g_free (prop_name)));
+ GDK_NOTE (DND, {
+ prop_name = gdk_atom_name (property);
+
+ g_print ("gdk_property_delete: %p %s\n",
+ GDK_WINDOW_HWND (window),
+ prop_name);
+ g_free (prop_name);
+ });
- if (property == _gdk_selection_property)
+ if (property == _gdk_selection)
_gdk_selection_property_delete (window);
else if (property == _wm_transient_for)
- gdk_window_set_transient_for (window, _gdk_parent_root);
+ gdk_window_set_transient_for (window, _gdk_root);
else
{
prop_name = gdk_atom_name (property);
@@ -489,27 +290,150 @@ gdk_property_delete (GdkWindow *window,
}
}
+/*
+ For reference, from gdk/x11/gdksettings.c:
+
+ "Net/DoubleClickTime\0" "gtk-double-click-time\0"
+ "Net/DoubleClickDistance\0" "gtk-double-click-distance\0"
+ "Net/DndDragThreshold\0" "gtk-dnd-drag-threshold\0"
+ "Net/CursorBlink\0" "gtk-cursor-blink\0"
+ "Net/CursorBlinkTime\0" "gtk-cursor-blink-time\0"
+ "Net/ThemeName\0" "gtk-theme-name\0"
+ "Net/IconThemeName\0" "gtk-icon-theme-name\0"
+ "Gtk/CanChangeAccels\0" "gtk-can-change-accels\0"
+ "Gtk/ColorPalette\0" "gtk-color-palette\0"
+ "Gtk/FontName\0" "gtk-font-name\0"
+ "Gtk/IconSizes\0" "gtk-icon-sizes\0"
+ "Gtk/KeyThemeName\0" "gtk-key-theme-name\0"
+ "Gtk/ToolbarStyle\0" "gtk-toolbar-style\0"
+ "Gtk/ToolbarIconSize\0" "gtk-toolbar-icon-size\0"
+ "Gtk/IMPreeditStyle\0" "gtk-im-preedit-style\0"
+ "Gtk/IMStatusStyle\0" "gtk-im-status-style\0"
+ "Gtk/Modules\0" "gtk-modules\0"
+ "Gtk/FileChooserBackend\0" "gtk-file-chooser-backend\0"
+ "Gtk/ButtonImages\0" "gtk-button-images\0"
+ "Gtk/MenuImages\0" "gtk-menu-images\0"
+ "Gtk/MenuBarAccel\0" "gtk-menu-bar-accel\0"
+ "Gtk/CursorBlinkTimeout\0" "gtk-cursor-blink-timeout\0"
+ "Gtk/CursorThemeName\0" "gtk-cursor-theme-name\0"
+ "Gtk/CursorThemeSize\0" "gtk-cursor-theme-size\0"
+ "Gtk/ShowInputMethodMenu\0" "gtk-show-input-method-menu\0"
+ "Gtk/ShowUnicodeMenu\0" "gtk-show-unicode-menu\0"
+ "Gtk/TimeoutInitial\0" "gtk-timeout-initial\0"
+ "Gtk/TimeoutRepeat\0" "gtk-timeout-repeat\0"
+ "Gtk/ColorScheme\0" "gtk-color-scheme\0"
+ "Gtk/EnableAnimations\0" "gtk-enable-animations\0"
+ "Xft/Antialias\0" "gtk-xft-antialias\0"
+ "Xft/Hinting\0" "gtk-xft-hinting\0"
+ "Xft/HintStyle\0" "gtk-xft-hintstyle\0"
+ "Xft/RGBA\0" "gtk-xft-rgba\0"
+ "Xft/DPI\0" "gtk-xft-dpi\0"
+ "Net/FallbackIconTheme\0" "gtk-fallback-icon-theme\0"
+ "Gtk/TouchscreenMode\0" "gtk-touchscreen-mode\0"
+ "Gtk/EnableAccels\0" "gtk-enable-accels\0"
+ "Gtk/EnableMnemonics\0" "gtk-enable-mnemonics\0"
+ "Gtk/ScrolledWindowPlacement\0" "gtk-scrolled-window-placement\0"
+ "Gtk/IMModule\0" "gtk-im-module\0"
+ "Fontconfig/Timestamp\0" "gtk-fontconfig-timestamp\0"
+ "Net/SoundThemeName\0" "gtk-sound-theme-name\0"
+ "Net/EnableInputFeedbackSounds\0" "gtk-enable-input-feedback-sounds\0"
+ "Net/EnableEventSounds\0" "gtk-enable-event-sounds\0";
+
+ More, from various places in gtk sources:
+
+ gtk-entry-select-on-focus
+ gtk-split-cursor
+
+*/
gboolean
-gdk_screen_get_setting (GdkScreen *screen,
+_gdk_win32_screen_get_setting (GdkScreen *screen,
const gchar *name,
GValue *value)
{
- g_return_val_if_fail (screen == gdk_screen_get_default (), FALSE);
+ g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
/*
* XXX : if these values get changed through the Windoze UI the
* respective gdk_events are not generated yet.
*/
- if (strcmp ("double-click-timeout", name) == 0)
+ if (strcmp ("gtk-theme-name", name) == 0)
+ {
+ g_value_set_string (value, "ms-windows");
+ }
+ else if (strcmp ("gtk-double-click-time", name) == 0)
{
- g_value_set_int (value, GetDoubleClickTime ());
+ gint i = GetDoubleClickTime ();
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i));
+ g_value_set_int (value, i);
return TRUE;
}
- else if (strcmp ("drag-threshold", name) == 0)
+ else if (strcmp ("gtk-double-click-distance", name) == 0)
{
- g_value_set_int (value, MAX(GetSystemMetrics (SM_CXDRAG), GetSystemMetrics (SM_CYDRAG)));
+ gint i = MAX(GetSystemMetrics (SM_CXDOUBLECLK), GetSystemMetrics (SM_CYDOUBLECLK));
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i));
+ g_value_set_int (value, i);
return TRUE;
}
- else
- return FALSE;
+ else if (strcmp ("gtk-dnd-drag-threshold", name) == 0)
+ {
+ gint i = MAX(GetSystemMetrics (SM_CXDRAG), GetSystemMetrics (SM_CYDRAG));
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i));
+ g_value_set_int (value, i);
+ return TRUE;
+ }
+ else if (strcmp ("gtk-split-cursor", name) == 0)
+ {
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : FALSE\n", name));
+ g_value_set_boolean (value, FALSE);
+ return TRUE;
+ }
+ else if (strcmp ("gtk-alternative-button-order", name) == 0)
+ {
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : TRUE\n", name));
+ g_value_set_boolean (value, TRUE);
+ return TRUE;
+ }
+ else if (strcmp ("gtk-alternative-sort-arrows", name) == 0)
+ {
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : TRUE\n", name));
+ g_value_set_boolean (value, TRUE);
+ return TRUE;
+ }
+#if 0
+ /*
+ * With 'MS Sans Serif' as windows menu font (default on win98se) you'll get a
+ * bunch of :
+ * WARNING **: Couldn't load font "MS Sans Serif 8" falling back to "Sans 8"
+ * at least with testfilechooser (regardless of the bitmap check below)
+ * so just disabling this code seems to be the best we can do --hb
+ */
+ else if (strcmp ("gtk-font-name", name) == 0)
+ {
+ NONCLIENTMETRICS ncm;
+ ncm.cbSize = sizeof(NONCLIENTMETRICS);
+ if (SystemParametersInfo (SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, FALSE))
+ {
+ /* Pango finally uses GetDeviceCaps to scale, we use simple
+ * approximation here.
+ */
+ int nHeight = (0 > ncm.lfMenuFont.lfHeight ? -3*ncm.lfMenuFont.lfHeight/4 : 10);
+ if (OUT_STRING_PRECIS == ncm.lfMenuFont.lfOutPrecision)
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(%s) : ignoring bitmap font '%s'\n",
+ name, ncm.lfMenuFont.lfFaceName));
+ else if (ncm.lfMenuFont.lfFaceName && strlen(ncm.lfMenuFont.lfFaceName) > 0 &&
+ /* Avoid issues like those described in bug #135098 */
+ g_utf8_validate (ncm.lfMenuFont.lfFaceName, -1, NULL))
+ {
+ char* s = g_strdup_printf ("%s %d", ncm.lfMenuFont.lfFaceName, nHeight);
+ GDK_NOTE(MISC, g_print("gdk_screen_get_setting(%s) : %s\n", name, s));
+ g_value_set_string (value, s);
+
+ g_free(s);
+ return TRUE;
+ }
+ }
+ }
+#endif
+
+ return FALSE;
}