[gtk+/gdk-backend] Add a vfunc for gdk_selection_convert
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend] Add a vfunc for gdk_selection_convert
- Date: Fri, 17 Dec 2010 02:47:07 +0000 (UTC)
commit 7cdceea9ccac0b60e15c80f200258de7e1493b48
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Dec 16 20:25:32 2010 -0500
Add a vfunc for gdk_selection_convert
gdk/gdkdisplayprivate.h | 7 ++++++-
gdk/gdkselection.c | 16 ++++++++++++++++
gdk/x11/gdkdisplay-x11.c | 1 +
gdk/x11/gdkprivate-x11.h | 5 +++++
gdk/x11/gdkselection-x11.c | 12 +++++-------
5 files changed, 33 insertions(+), 8 deletions(-)
---
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 9f10ddb..9f51b36 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -208,12 +208,17 @@ struct _GdkDisplayClass
GdkAtom selection,
GdkAtom target,
GdkAtom property,
- guint32 time_);
+ guint32 time);
gint (*get_selection_property) (GdkDisplay *display,
GdkWindow *requestor,
guchar **data,
GdkAtom *type,
gint *format);
+ void (*convert_selection) (GdkDisplay *display,
+ GdkWindow *requestor,
+ GdkAtom selection,
+ GdkAtom target,
+ guint32 time);
/* Signals */
void (*closed) (GdkDisplay *display,
diff --git a/gdk/gdkselection.c b/gdk/gdkselection.c
index 8013188..c50a3f7 100644
--- a/gdk/gdkselection.c
+++ b/gdk/gdkselection.c
@@ -370,3 +370,19 @@ gdk_selection_property_get (GdkWindow *requestor,
return GDK_DISPLAY_GET_CLASS (display)
->get_selection_property (display, requestor, data, ret_type, ret_format);
}
+
+void
+gdk_selection_convert (GdkWindow *requestor,
+ GdkAtom selection,
+ GdkAtom target,
+ guint32 time)
+{
+ GdkDisplay *display;
+
+ g_return_if_fail (selection != GDK_NONE);
+
+ display = gdk_window_get_display (requestor);
+
+ GDK_DISPLAY_GET_CLASS (display)
+ ->convert_selection (display, requestor, selection, target, time);
+}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 26e1b94..cbba5aa 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -2764,4 +2764,5 @@ _gdk_display_x11_class_init (GdkDisplayX11Class * class)
display_class->set_selection_owner = _gdk_x11_display_set_selection_owner;
display_class->send_selection_notify = _gdk_x11_display_send_selection_notify;
display_class->get_selection_property = _gdk_x11_display_get_selection_property;
+ display_class->convert_selection = _gdk_x11_display_convert_selection;
}
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index d33b240..c630c31 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -207,6 +207,11 @@ gint _gdk_x11_display_get_selection_property (GdkDisplay *display,
guchar **data,
GdkAtom *ret_type,
gint *ret_format);
+void _gdk_x11_display_convert_selection (GdkDisplay *display,
+ GdkWindow *requestor,
+ GdkAtom selection,
+ GdkAtom target,
+ 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 52d0394..4331258 100644
--- a/gdk/x11/gdkselection-x11.c
+++ b/gdk/x11/gdkselection-x11.c
@@ -182,20 +182,18 @@ _gdk_x11_display_get_selection_owner (GdkDisplay *display,
}
void
-gdk_selection_convert (GdkWindow *requestor,
- GdkAtom selection,
- GdkAtom target,
- guint32 time)
+_gdk_x11_display_convert_selection (GdkDisplay *display,
+ GdkWindow *requestor,
+ GdkAtom selection,
+ GdkAtom target,
+ guint32 time)
{
- GdkDisplay *display;
-
g_return_if_fail (selection != GDK_NONE);
if (GDK_WINDOW_DESTROYED (requestor) || !GDK_WINDOW_IS_X11 (requestor))
return;
gdk_window_ensure_native (requestor);
- display = GDK_WINDOW_DISPLAY (requestor);
XConvertSelection (GDK_WINDOW_XDISPLAY (requestor),
gdk_x11_atom_to_xatom_for_display (display, selection),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]