diff options
author | Tor Lillqvist <tml@novell.com> | 2005-04-04 00:12:26 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-04-04 00:12:26 +0000 |
commit | 0b2ac32cf5d8ed96ebf743cbfc112d7e52928c81 (patch) | |
tree | 36a7395abd82e5c8bc1ad3ca0aec863ae0c8bc57 /gtk/gtkselection.c | |
parent | ba433af9fb2419f3429622d40300c7ac3659fd75 (diff) | |
download | gdk-pixbuf-0b2ac32cf5d8ed96ebf743cbfc112d7e52928c81.tar.gz |
New debugging function, to log a clipboard format name symbolically.
2005-04-04 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkmain.c (_gdk_win32_cf_to_string): New debugging
function, to log a clipboard format name symbolically.
(_gdk_win32_data_to_string): Also new, to log random data bytes.
Implement delayed rendering on Win32, specifically for transfering
images through the clipboard from GTK+ apps to other
apps (#168173, implementation by Ivan Wong):
* gdk/win32/gdkevents-win32.c (gdk_event_translate):
Handle WM_RENDERFORMAT.
* gdk/win32/gdkprivate-win32.h
* gdk/win32/gdkglobals-win32.c: Add _format_atom_table,
_delayed_rendering_data and _image_bmp.
* gdk/win32/gdkmain-win32.c: Initialize _image_bmp.
* gdk/win32/gdkproperty-win32.c (gdk_property_change):
Accept formats other than GDK_TARGET_STRING or _utf8_string, and
assume they are handled through delayed rendering.
* gdk/win32/gdkselection-win32.c (gdk_selection_convert):
Return all available formats (including those registered by GTK+
apps) on request_targets.
(gdk_selection_property_get): We should append a zero byte like
X11 does.
(gdk_win32_selection_add_targets): New function, for
gtkselection's use. Win32 requires that the clipboard owner
registers all valid formats even if the owner wants delayed
rendering.
(_gdk_win32_selection_convert_to_dib): New function. Convert
images to DIB using gdk-pixbuf.
* gdk/win32/gdkwin32.h: Declare gdk_win32_selection_add_targets().
* gtk/gtkselection.c (gtk_selection_add_target,
gtk_selection_add_targets): Call gdk_win32_selection_add_targets()
to register target formats.
* gdk/gdk.symbols: Add gdk_win32_selection_add_targets().
Diffstat (limited to 'gtk/gtkselection.c')
-rw-r--r-- | gtk/gtkselection.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index e119df308..328c5d390 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -64,6 +64,10 @@ #include "x11/gdkx.h" #endif +#ifdef GDK_WINDOWING_WIN32 +#include "win32/gdkwin32.h" +#endif + #include "gtkalias.h" #undef DEBUG_SELECTION @@ -750,6 +754,9 @@ gtk_selection_add_target (GtkWidget *widget, list = gtk_selection_target_list_get (widget, selection); gtk_target_list_add (list, target, 0, info); +#ifdef GDK_WINDOWING_WIN32 + gdk_win32_selection_add_targets (widget->window, selection, 1, &target); +#endif } /** @@ -776,6 +783,18 @@ gtk_selection_add_targets (GtkWidget *widget, list = gtk_selection_target_list_get (widget, selection); gtk_target_list_add_table (list, targets, ntargets); + +#ifdef GDK_WINDOWING_WIN32 + { + int i; + GdkAtom *atoms = g_new (GdkAtom, ntargets); + + for (i = 0; i < ntargets; ++i) + atoms[i] = gdk_atom_intern (targets[i].target, FALSE); + gdk_win32_selection_add_targets (widget->window, selection, ntargets, atoms); + g_free (atoms); + } +#endif } |