[gtk+/xi2: 448/1239] Implement gtk_widget_set_support_multidevice().



commit 8c4da47fabb3e03fc399fcc23144b2184c8e041f
Author: Carlos Garnacho <carlos lanedo com>
Date:   Sun Jul 5 15:23:28 2009 +0100

    Implement gtk_widget_set_support_multidevice().
    
    This function will enable multidevice events on a widget, enabling
    extension events on the widget window and setting the
    GTK_MULTIDEVICE flag.

 gtk/gtkwidget.c |   18 ++++++++++++++++++
 gtk/gtkwidget.h |    8 +++++++-
 2 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 16fdc2b..d574032 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10337,5 +10337,23 @@ gtk_widget_get_window (GtkWidget *widget)
   return widget->window;
 }
 
+void
+gtk_widget_set_support_multidevice (GtkWidget *widget,
+                                    gboolean   support_multidevice)
+{
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  if (support_multidevice)
+    {
+      GTK_WIDGET_SET_FLAGS (widget, GTK_MULTIDEVICE);
+      gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL);
+    }
+  else
+    {
+      GTK_WIDGET_UNSET_FLAGS (widget, GTK_MULTIDEVICE);
+      gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_NONE);
+    }
+}
+
 #define __GTK_WIDGET_C__
 #include "gtkaliasdef.c"
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index c73e52b..476b9ba 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -78,7 +78,8 @@ typedef enum
   GTK_RECEIVES_DEFAULT = 1 << 20,
 
   GTK_DOUBLE_BUFFERED  = 1 << 21,
-  GTK_NO_SHOW_ALL      = 1 << 22
+  GTK_NO_SHOW_ALL      = 1 << 22,
+  GTK_MULTIDEVICE      = 1 << 23
 } GtkWidgetFlags;
 
 /* Kinds of widget-specific help */
@@ -621,6 +622,11 @@ GtkClipboard *gtk_widget_get_clipboard   (GtkWidget *widget,
 GdkPixmap *   gtk_widget_get_snapshot    (GtkWidget    *widget,
                                           GdkRectangle *clip_rect);
 
+/* Multidevice support */
+void             gtk_widget_set_support_multidevice (GtkWidget      *widget,
+                                                     gboolean        support_multidevice);
+
+
 #ifndef GTK_DISABLE_DEPRECATED
 #define gtk_widget_set_visual(widget,visual)  ((void) 0)
 #define gtk_widget_push_visual(visual)        ((void) 0)



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