return TRUE;
}
-static GdkAtom
-convert_clipboard_selection_to_targets_target (GdkSurface *requestor)
-{
- int i;
- int format_count = CountClipboardFormats ();
- GArray *targets = g_array_sized_new (FALSE, FALSE, sizeof (GdkWin32ContentFormatPair), format_count);
-/* FIXME: REMOVE ALL THAT STUFF
- for (fmt = 0; 0 != (fmt = EnumClipboardFormats (fmt)); )
- _gdk_win32_add_format_to_targets (fmt, targets, NULL);
-*/
- GDK_NOTE (DND, {
- g_print ("... ");
- for (i = 0; i < targets->len; i++)
- {
- const char *atom_name = (const char *)g_array_index (targets, GdkWin32ContentFormatPair, i).contentformat;
-
- g_print ("%s", atom_name);
- if (i < targets->len - 1)
- g_print (", ");
- }
- g_print ("\n");
- });
-
- if (targets->len > 0)
- {
- gint len = targets->len;
- GdkAtom *targets_only = g_new0 (GdkAtom, len);
-
- for (i = 0; i < targets->len; i++)
- targets_only[i] = g_array_index (targets, GdkWin32ContentFormatPair, i).contentformat;
-
- g_array_free (targets, TRUE);
-/* FIXME: REMOVE ALL THAT STUFF
- selection_property_store (requestor, GDK_SELECTION_TYPE_ATOM,
- 32, (guchar *) targets_only,
- len * sizeof (GdkAtom));
-*/
- return _gdk_win32_clipdrop_atom (GDK_WIN32_ATOM_INDEX_GDK_SELECTION);
- }
- else
- {
- g_array_free (targets, TRUE);
- return NULL;
- }
-}
-
-/* It's hard to say whether implementing this actually is of any use
- * on the Win32 platform? gtk calls only
- * gdk_text_property_to_utf8_list_for_display().
- */
-gint
-gdk_text_property_to_text_list_for_display (GdkDisplay *display,
- GdkAtom encoding,
- gint format,
- const guchar *text,
- gint length,
- gchar ***list)
-{
- gchar *result;
- const gchar *charset;
- gchar *source_charset;
-
- GDK_NOTE (DND, {
- const char *enc_name = (const char *)encoding;
-
- g_print ("gdk_text_property_to_text_list_for_display: %s %d %.20s %d\n",
- enc_name, format, text, length);
- });
-
- if (!list)
- return 0;
-
- if (encoding == g_intern_static_string ("STRING"))
- source_charset = g_strdup ("ISO-8859-1");
- else if (encoding == _gdk_win32_clipdrop_atom (GDK_WIN32_ATOM_INDEX_TEXT_PLAIN_UTF8))
- source_charset = g_strdup ("UTF-8");
- else
- source_charset = g_strdup ((const char *)encoding);
-
- g_get_charset (&charset);
-
- result = g_convert ((const gchar *) text, length, charset, source_charset,
- NULL, NULL, NULL);
- g_free (source_charset);
-
- if (!result)
- return 0;
-
- *list = g_new (gchar *, 1);
- **list = result;
-
- return 1;
-}
-
-void
-gdk_free_text_list (gchar **list)
-{
- g_return_if_fail (list != NULL);
-
- g_free (*list);
- g_free (list);
-}
-
static gint
make_list (const gchar *text,
gint length,
#include "gdkprivate-win32.h"
#include "gdkwin32.h"
-GdkAtom
-_gdk_win32_display_manager_atom_intern (GdkDisplayManager *manager,
- const gchar *atom_name,
- gint only_if_exists)
-{
- ATOM win32_atom;
- GdkAtom retval;
- static GHashTable *atom_hash = NULL;
-
- if (!atom_hash)
- atom_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- retval = g_hash_table_lookup (atom_hash, atom_name);
- if (!retval)
- {
- win32_atom = GlobalAddAtom (atom_name);
- retval = GUINT_TO_POINTER ((guint) win32_atom);
-
- g_hash_table_insert (atom_hash,
- g_strdup (atom_name),
- retval);
- }
-
- return retval;
-}
-
-gchar *
-_gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager,
- GdkAtom atom)
-{
- ATOM win32_atom;
- gchar name[256];
-
- if (NULL == atom) return g_strdup ("<none>");
-
- win32_atom = GPOINTER_TO_UINT (atom);
-
- if (win32_atom < 0xC000)
- return g_strdup_printf ("#%p", atom);
- else if (GlobalGetAtomName (win32_atom, name, sizeof (name)) == 0)
- return NULL;
- return g_strdup (name);
-}
-
/*
For reference, from gdk/x11/gdksettings.c: