[gtk+] Add a vfunc for gdk_selection_send_notify_for_display



commit 625b8305e9111ddf22394a35cdae1b4a4ba978b1
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Dec 16 19:58:07 2010 -0500

    Add a vfunc for gdk_selection_send_notify_for_display

 gdk/gdkdisplayprivate.h    |    6 ++++++
 gdk/gdkselection.c         |   28 ++++++++++++++++++++++++++++
 gdk/x11/gdkdisplay-x11.c   |    1 +
 gdk/x11/gdkprivate-x11.h   |   20 +++++++++++++-------
 gdk/x11/gdkselection-x11.c |   30 +++++++-----------------------
 5 files changed, 55 insertions(+), 30 deletions(-)
---
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 4764909..74843f1 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -203,6 +203,12 @@ struct _GdkDisplayClass
                                                      GdkAtom       selection,
                                                      guint32       time,
                                                      gboolean      send_event);
+  void                       (*send_selection_notify) (GdkDisplay *dispay,
+                                                       GdkNativeWindow  requestor,
+                                                       GdkAtom          selection,
+                                                       GdkAtom          target,
+                                                       GdkAtom          property,
+                                                       guint32          time_);
 
   /* Signals */
   void (*closed) (GdkDisplay *display,
diff --git a/gdk/gdkselection.c b/gdk/gdkselection.c
index 57b8584..188e64f 100644
--- a/gdk/gdkselection.c
+++ b/gdk/gdkselection.c
@@ -306,3 +306,31 @@ gdk_selection_owner_get_for_display (GdkDisplay *display,
 
   return GDK_DISPLAY_GET_CLASS (display)->get_selection_owner (display, selection);
 }
+
+/**
+ * gdk_selection_send_notify_for_display:
+ * @display: the #GdkDisplay where @requestor is realized
+ * @requestor: window to which to deliver response
+ * @selection: selection that was requested
+ * @target: target that was selected
+ * @property: property in which the selection owner stored the data,
+ *            or %GDK_NONE to indicate that the request was rejected
+ * @time_: timestamp
+ *
+ * Send a response to SelectionRequest event.
+ *
+ * Since: 2.2
+ */
+void
+gdk_selection_send_notify_for_display (GdkDisplay       *display,
+                                       GdkNativeWindow  requestor,
+                                       GdkAtom          selection,
+                                       GdkAtom          target,
+                                       GdkAtom          property,
+                                       guint32          time_)
+{
+  g_return_if_fail (GDK_IS_DISPLAY (display));
+
+  GDK_DISPLAY_GET_CLASS (display)
+    ->send_selection_notify (display, requestor, selection,target, property, time_);
+}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 4ad87a4..4595c67 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -2762,4 +2762,5 @@ _gdk_display_x11_class_init (GdkDisplayX11Class * class)
   display_class->pop_error_trap = pop_error_trap;
   display_class->get_selection_owner = _gdk_x11_display_get_selection_owner;
   display_class->set_selection_owner = _gdk_x11_display_set_selection_owner;
+  display_class->send_selection_notify = _gdk_x11_display_send_selection_notify;
 }
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 68ec939..866854a 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -189,13 +189,19 @@ void _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
 void _gdk_x11_display_queue_events            (GdkDisplay *display);
 
 
-gboolean    _gdk_x11_display_set_selection_owner (GdkDisplay *display,
-                                                  GdkWindow  *owner,
-                                                  GdkAtom     selection,
-                                                  guint32     time,
-                                                  gboolean    send_event);
-GdkWindow * _gdk_x11_display_get_selection_owner (GdkDisplay *display,
-                                                  GdkAtom     selection);
+gboolean    _gdk_x11_display_set_selection_owner   (GdkDisplay *display,
+                                                    GdkWindow  *owner,
+                                                    GdkAtom     selection,
+                                                    guint32     time,
+                                                    gboolean    send_event);
+GdkWindow * _gdk_x11_display_get_selection_owner   (GdkDisplay *display,
+                                                    GdkAtom     selection);
+void        _gdk_x11_display_send_selection_notify (GdkDisplay       *display,
+                                                    GdkNativeWindow  requestor,
+                                                    GdkAtom          selection,
+                                                    GdkAtom          target,
+                                                    GdkAtom          property,
+                                                    guint32          time);
 
 void _gdk_x11_device_check_extension_events   (GdkDevice  *device);
 
diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c
index 0ba0519..81963dc 100644
--- a/gdk/x11/gdkselection-x11.c
+++ b/gdk/x11/gdkselection-x11.c
@@ -334,32 +334,16 @@ gdk_selection_property_get (GdkWindow  *requestor,
   return 0;
 }
 
-/**
- * gdk_selection_send_notify_for_display:
- * @display: the #GdkDisplay where @requestor is realized
- * @requestor: window to which to deliver response.
- * @selection: selection that was requested.
- * @target: target that was selected.
- * @property: property in which the selection owner stored the data,
- *            or %GDK_NONE to indicate that the request was rejected.
- * @time_: timestamp. 
- *
- * Send a response to SelectionRequest event.
- *
- * Since: 2.2
- **/
 void
-gdk_selection_send_notify_for_display (GdkDisplay       *display,
-				       GdkNativeWindow  requestor,
-				       GdkAtom          selection,
-				       GdkAtom          target,
-				       GdkAtom          property, 
-				       guint32          time)
+_gdk_x11_display_send_selection_notify (GdkDisplay       *display,
+                                        GdkNativeWindow  requestor,
+                                        GdkAtom          selection,
+                                        GdkAtom          target,
+                                        GdkAtom          property,
+                                        guint32          time)
 {
   XSelectionEvent xevent;
-  
-  g_return_if_fail (GDK_IS_DISPLAY (display));
-  
+
   xevent.type = SelectionNotify;
   xevent.serial = 0;
   xevent.send_event = True;



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