diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-10-22 04:34:42 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-10-22 04:34:42 +0000 |
commit | 46dde8042854304a12db1e687df00300d517d9e6 (patch) | |
tree | d8d950524745bcdd4e4fcb87ecfc66e16cd370c7 /gdk/win32/gdkproperty-win32.c | |
parent | 724a552c7d00889bcc64127e8921cd11d3eb6ec4 (diff) | |
download | gdk-pixbuf-46dde8042854304a12db1e687df00300d517d9e6.tar.gz |
Fix problem with g_return_if_fail return value.
Sun Oct 21 23:27:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_translate_coordinates): Fix
problem with g_return_if_fail return value.
* gdk/x11/gdkproperty-x11.c docs/Changes-2.0.txt: Move over the
virtual atom code from the gdk-multihead branch, removing the per-display
part. Virtualizing atoms needs to be done now to prevent compat
breakage in direct Xlib accessing code in the future. (#62208)
* gdk/x11/gdkx.h: gdk/gdk/x11/gdkproperty-x11.c: Export
gdk_x11_xatom_to_atom, gdk_x11_atom_to_xatom().
* gdk/gdktypes.h docs/Changes-2.0.txt: Make GdkAtom
an opaque pointer type so the compiler catches attempts
to mingle it with X atoms.
* gdk/x11/{gdkdnd-x11.c,gdkevents-x11.c,gdkglobals-x11.c,
gdkkeys-x11.c, gdkmain-x11.c, gdkprivate-x11.c,
gdkproperty-x11.c, gdkselection-x11.c, gdkwindow-x11.c}
gtk/{gtkclist.c,gtkctree.c,gtkdnd.c,gtkplug.c,gtksocket.c}
tests/testdnd.c,tests/testselection.c:
Fix up for above atom changes.
* gdk/gdkselection.h (GDK_SELECTION_CLIPBOARD): Add, since we
now have the ability to add custom predefines.
* gtk/{gtkentry.c,gtklabel.c,gtkoldeditable.c,gtktextview.c}:
Use GDK_SELECTION_CLIPBOARD instead of GDK_NONE in calls
to gtk_clipboard_get().
* gdk/win32/gdkproperty-win32.c: Add CLIPBOARD, fix up
for GdkAtom => pointer change.
* gdk/linux-fb/gdkproperty-fb.c: Fix handling of predefined
atoms, fix for GdkAtom => pointer change.
Diffstat (limited to 'gdk/win32/gdkproperty-win32.c')
-rw-r--r-- | gdk/win32/gdkproperty-win32.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c index ef912e95d..a6d6b3198 100644 --- a/gdk/win32/gdkproperty-win32.c +++ b/gdk/win32/gdkproperty-win32.c @@ -41,17 +41,20 @@ gdk_atom_intern (const gchar *atom_name, { GdkAtom retval; static GHashTable *atom_hash = NULL; + ATOM win32_atom; if (!atom_hash) atom_hash = g_hash_table_new (g_str_hash, g_str_equal); - retval = GPOINTER_TO_UINT (g_hash_table_lookup (atom_hash, atom_name)); + retval = g_hash_table_lookup (atom_hash, atom_name); if (!retval) { if (strcmp (atom_name, "PRIMARY") == 0) retval = GDK_SELECTION_PRIMARY; else if (strcmp (atom_name, "SECONDARY") == 0) retval = GDK_SELECTION_SECONDARY; + else if (strcmp (atom_name, "CLIPBOARD") == 0) + retval = GDK_SELECTION_CLIPBOARD; else if (strcmp (atom_name, "ATOM") == 0) retval = GDK_SELECTION_TYPE_ATOM; else if (strcmp (atom_name, "BITMAP") == 0) @@ -70,15 +73,16 @@ gdk_atom_intern (const gchar *atom_name, retval = GDK_SELECTION_TYPE_STRING; else { - retval = GlobalFindAtom (atom_name); + win32_atom = GlobalFindAtom (atom_name); if (only_if_exists && retval == 0) - retval = 0; + win32_atom = 0; else - retval = GlobalAddAtom (atom_name); + win32_atom = GlobalAddAtom (atom_name); + retval = GUINT_TO_POINTER (win32_atom); } g_hash_table_insert (atom_hash, g_strdup (atom_name), - GUINT_TO_POINTER (retval)); + retval); } return retval; @@ -88,11 +92,13 @@ gchar * gdk_atom_name (GdkAtom atom) { gchar name[256]; + ATOM win32_atom; switch (atom) { case GDK_SELECTION_PRIMARY: return g_strdup ("PRIMARY"); case GDK_SELECTION_SECONDARY: return g_strdup ("SECONDARY"); + case GDK_SELECTION_CLIPBOARD: return g_strdup ("CLIPBOARD"); case GDK_SELECTION_TYPE_ATOM: return g_strdup ("ATOM"); case GDK_SELECTION_TYPE_BITMAP: return g_strdup ("BITMAP"); case GDK_SELECTION_TYPE_COLORMAP: return g_strdup ("COLORMAP"); @@ -102,9 +108,12 @@ gdk_atom_name (GdkAtom atom) case GDK_SELECTION_TYPE_WINDOW: return g_strdup ("WINDOW"); case GDK_SELECTION_TYPE_STRING: return g_strdup ("STRING"); } - if (atom < 0xC000) - return g_strdup_printf ("#%x", (guint) atom); - else if (GlobalGetAtomName (atom, name, sizeof (name)) == 0) + + win32_atom = GPOINTER_TO_UINT (atom); + + if (win32_atom < 0xC000) + return g_strdup_printf ("#%x", atom); + else if (GlobalGetAtomName (win32_atom, name, sizeof (name)) == 0) return NULL; return g_strdup (name); } |