gtk+ r22520 - in branches/gtk-2-14: . gdk/win32



Author: tml
Date: Wed Mar 11 13:57:24 2009
New Revision: 22520
URL: http://svn.gnome.org/viewvc/gtk+?rev=22520&view=rev

Log:
2009-03-11  Tor Lillqvist  <tml iki fi>

	Add more debugging printout for --gdk-debug=dnd.

	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkprivate-win32.h: (_gdk_win32_drag_protocol_to_string)
	(_gdk_win32_drag_action_to_string): New functions for use in
	debugging printouts.



Modified:
   branches/gtk-2-14/ChangeLog
   branches/gtk-2-14/gdk/win32/gdkmain-win32.c
   branches/gtk-2-14/gdk/win32/gdkprivate-win32.h

Modified: branches/gtk-2-14/gdk/win32/gdkmain-win32.c
==============================================================================
--- branches/gtk-2-14/gdk/win32/gdkmain-win32.c	(original)
+++ branches/gtk-2-14/gdk/win32/gdkmain-win32.c	Wed Mar 11 13:57:24 2009
@@ -478,6 +478,26 @@
 }
 
 gchar *
+_gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol)
+{
+  switch (protocol)
+    {
+#define CASE(x) case GDK_DRAG_PROTO_##x: return #x
+      CASE (MOTIF);
+      CASE (XDND);
+      CASE (ROOTWIN);
+      CASE (NONE);
+      CASE (WIN32_DROPFILES);
+      CASE (OLE2);
+      CASE (LOCAL);
+#undef CASE
+    default: return static_printf ("illegal_%d", protocol);
+    }
+  /* NOTREACHED */
+  return NULL; 
+}
+
+gchar *
 _gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask)
 {
   gchar buf[400];
@@ -657,6 +677,30 @@
 }
 
 gchar *
+_gdk_win32_drag_action_to_string (GdkDragAction actions)
+{
+  gchar buf[100];
+  gchar *bufp = buf;
+  gchar *s = "";
+
+  buf[0] = '\0';
+
+#define BIT(x)						\
+  if (actions & GDK_ACTION_ ## x)				\
+    (bufp += sprintf (bufp, "%s" #x, s), s = "|")
+
+  BIT (DEFAULT);
+  BIT (COPY);
+  BIT (MOVE);
+  BIT (LINK);
+  BIT (PRIVATE);
+  BIT (ASK);
+#undef BIT
+
+  return static_printf ("%s", buf);  
+}
+
+gchar *
 _gdk_win32_rop2_to_string (int rop2)
 {
   switch (rop2)

Modified: branches/gtk-2-14/gdk/win32/gdkprivate-win32.h
==============================================================================
--- branches/gtk-2-14/gdk/win32/gdkprivate-win32.h	(original)
+++ branches/gtk-2-14/gdk/win32/gdkprivate-win32.h	Wed Mar 11 13:57:24 2009
@@ -314,11 +314,13 @@
 gchar *_gdk_win32_function_to_string   (GdkFunction  function);
 gchar *_gdk_win32_join_style_to_string (GdkJoinStyle join_style);
 gchar *_gdk_win32_line_style_to_string (GdkLineStyle line_style);
+gchar *_gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol);
 gchar *_gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask);
 gchar *_gdk_win32_window_state_to_string (GdkWindowState state);
 gchar *_gdk_win32_window_style_to_string (LONG style);
 gchar *_gdk_win32_window_exstyle_to_string (LONG style);
 gchar *_gdk_win32_window_pos_bits_to_string (UINT flags);
+gchar *_gdk_win32_drag_action_to_string (GdkDragAction actions);
 gchar *_gdk_win32_drawable_description (GdkDrawable *d);
 
 gchar *_gdk_win32_rop2_to_string       (int          rop2);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]