diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-12-16 19:22:44 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-12-21 12:07:03 -0500 |
commit | cc03a6df793fc79c0e2e2337c89fb249ab635e47 (patch) | |
tree | 24ce9ca4c431eb2110ef04fdd9442c75099b1c4d /gdk/gdkselection.c | |
parent | 519f09f7f4b60305df1308d9cda2736c166ff5e9 (diff) | |
download | gtk+-cc03a6df793fc79c0e2e2337c89fb249ab635e47.tar.gz |
Add vfuncs for get/set_selection_owner
Diffstat (limited to 'gdk/gdkselection.c')
-rw-r--r-- | gdk/gdkselection.c | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/gdk/gdkselection.c b/gdk/gdkselection.c index 9468604fe6..57b85840c4 100644 --- a/gdk/gdkselection.c +++ b/gdk/gdkselection.c @@ -29,7 +29,7 @@ #include "gdkselection.h" #include "gdkproperty.h" -#include "gdkdisplay.h" +#include "gdkdisplayprivate.h" /** @@ -246,3 +246,63 @@ gdk_utf8_to_compound_text (const gchar *str, str, encoding, format, ctext, length); } + +/** + * gdk_selection_owner_set_for_display: + * @display: the #GdkDisplay + * @owner: a #GdkWindow or %NULL to indicate that the owner for + * the given should be unset + * @selection: an atom identifying a selection + * @time_: timestamp to use when setting the selection + * If this is older than the timestamp given last time the owner was + * set for the given selection, the request will be ignored + * @send_event: if %TRUE, and the new owner is different from the current + * owner, the current owner will be sent a SelectionClear event + * + * Sets the #GdkWindow @owner as the current owner of the selection @selection. + * + * Returns: %TRUE if the selection owner was successfully changed to owner, + * otherwise %FALSE. + * + * Since: 2.2 + */ +gboolean +gdk_selection_owner_set_for_display (GdkDisplay *display, + GdkWindow *owner, + GdkAtom selection, + guint32 time, + gboolean send_event) +{ + g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); + g_return_val_if_fail (selection != GDK_NONE, FALSE); + + return GDK_DISPLAY_GET_CLASS (display) + ->set_selection_owner (display, owner, selection, time, send_event); +} + +/** + * gdk_selection_owner_get_for_display: + * @display: a #GdkDisplay + * @selection: an atom indentifying a selection + * + * Determine the owner of the given selection. + * + * Note that the return value may be owned by a different + * process if a foreign window was previously created for that + * window, but a new foreign window will never be created by this call. + * + * Returns: (transfer none): if there is a selection owner for this window, + * and it is a window known to the current process, the #GdkWindow that + * owns the selection, otherwise %NULL. + * + * Since: 2.2 + */ +GdkWindow * +gdk_selection_owner_get_for_display (GdkDisplay *display, + GdkAtom selection) +{ + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + g_return_val_if_fail (selection != GDK_NONE, NULL); + + return GDK_DISPLAY_GET_CLASS (display)->get_selection_owner (display, selection); +} |