2008-07-01 22:57:50 +00:00
|
|
|
|
/* GDK - The GIMP Drawing Kit
|
2005-07-12 05:09:13 +00:00
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2005-07-12 05:09:13 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
2010-10-15 02:05:51 +00:00
|
|
|
|
|
|
|
|
|
#include "gdkselection.h"
|
|
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
#include "gdkproperty.h"
|
2010-12-17 00:22:44 +00:00
|
|
|
|
#include "gdkdisplayprivate.h"
|
2010-07-09 00:34:45 +00:00
|
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
|
2010-11-15 16:20:51 +00:00
|
|
|
|
/**
|
|
|
|
|
* SECTION:selections
|
2018-04-18 23:13:04 +00:00
|
|
|
|
* @Short_description: Functions for transferring data between programs
|
2010-11-15 16:20:51 +00:00
|
|
|
|
* @Title: Selections
|
|
|
|
|
*
|
2018-04-18 23:13:04 +00:00
|
|
|
|
* GDK’s selection functions, based on the [X selection mechanism](
|
|
|
|
|
* https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html),
|
|
|
|
|
* provide a way to transfer arbitrary chunks of
|
2014-02-04 23:10:11 +00:00
|
|
|
|
* data between programs. A “selection” is a essentially
|
2010-11-15 16:20:51 +00:00
|
|
|
|
* a named clipboard, identified by a string interned as a #GdkAtom. By
|
|
|
|
|
* claiming ownership of a selection, an application indicates that it will
|
|
|
|
|
* be responsible for supplying its contents. The most common selections are
|
2014-02-04 23:21:13 +00:00
|
|
|
|
* `PRIMARY` and `CLIPBOARD`.
|
2010-11-15 16:20:51 +00:00
|
|
|
|
*
|
|
|
|
|
* The contents of a selection can be represented in a number of formats,
|
2014-02-04 23:10:11 +00:00
|
|
|
|
* called “targets”. Each target is identified by an atom.
|
2010-11-15 16:20:51 +00:00
|
|
|
|
* A list of all possible targets supported by the selection owner can be
|
2014-02-04 23:21:13 +00:00
|
|
|
|
* retrieved by requesting the special target `TARGETS`. When
|
2010-11-15 16:20:51 +00:00
|
|
|
|
* a selection is retrieved, the data is accompanied by a type (an atom), and
|
|
|
|
|
* a format (an integer, representing the number of bits per item).
|
2014-02-07 02:07:03 +00:00
|
|
|
|
* See [Properties and Atoms][gdk3-Properties-and-Atoms]
|
2010-11-15 16:20:51 +00:00
|
|
|
|
* for more information.
|
|
|
|
|
*
|
|
|
|
|
* The functions in this section only contain the lowlevel parts of the
|
|
|
|
|
* selection protocol. A considerably more complicated implementation is needed
|
|
|
|
|
* on top of this. GTK+ contains such an implementation in the functions in
|
2014-02-04 23:21:13 +00:00
|
|
|
|
* `gtkselection.h` and programmers should use those functions
|
2010-11-15 16:20:51 +00:00
|
|
|
|
* instead of the ones presented here. If you plan to implement selection
|
|
|
|
|
* handling directly on top of the functions here, you should refer to the
|
2018-04-18 23:13:04 +00:00
|
|
|
|
* [X Inter-Client Communication Conventions Manual (ICCCM)](
|
|
|
|
|
* https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html).
|
|
|
|
|
*
|
|
|
|
|
* Note that although much of the selection API design is based on that of X,
|
|
|
|
|
* it will work on other GDK backends too.
|
2010-11-15 16:20:51 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_selection_owner_set:
|
2014-05-17 03:12:51 +00:00
|
|
|
|
* @owner: (allow-none): a #GdkWindow or %NULL to indicate that the
|
2010-11-15 16:20:51 +00:00
|
|
|
|
* 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 owner of the given selection.
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the selection owner was successfully
|
|
|
|
|
* changed to @owner, otherwise %FALSE.
|
|
|
|
|
*/
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gdk_selection_owner_set (GdkWindow *owner,
|
|
|
|
|
GdkAtom selection,
|
|
|
|
|
guint32 time,
|
|
|
|
|
gboolean send_event)
|
|
|
|
|
{
|
2002-06-20 23:59:27 +00:00
|
|
|
|
return gdk_selection_owner_set_for_display (gdk_display_get_default (),
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
owner, selection,
|
|
|
|
|
time, send_event);
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-15 16:20:51 +00:00
|
|
|
|
/**
|
|
|
|
|
* gdk_selection_owner_get:
|
|
|
|
|
* @selection: an atom indentifying a selection.
|
|
|
|
|
*
|
|
|
|
|
* Determines the owner of the given selection.
|
|
|
|
|
*
|
2014-05-08 19:55:50 +00:00
|
|
|
|
* Returns: (nullable) (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. 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.
|
2010-11-15 16:20:51 +00:00
|
|
|
|
*/
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
GdkWindow*
|
|
|
|
|
gdk_selection_owner_get (GdkAtom selection)
|
|
|
|
|
{
|
2002-06-20 23:59:27 +00:00
|
|
|
|
return gdk_selection_owner_get_for_display (gdk_display_get_default (),
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
selection);
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-15 16:20:51 +00:00
|
|
|
|
/**
|
|
|
|
|
* gdk_selection_send_notify:
|
|
|
|
|
* @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.
|
|
|
|
|
*
|
|
|
|
|
* Sends a response to SelectionRequest event.
|
|
|
|
|
*/
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
void
|
2011-02-01 16:22:04 +00:00
|
|
|
|
gdk_selection_send_notify (GdkWindow *requestor,
|
2008-08-04 22:43:57 +00:00
|
|
|
|
GdkAtom selection,
|
|
|
|
|
GdkAtom target,
|
|
|
|
|
GdkAtom property,
|
|
|
|
|
guint32 time)
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
{
|
2011-02-01 16:22:04 +00:00
|
|
|
|
gdk_selection_send_notify_for_display (gdk_window_get_display (requestor),
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
|
requestor, selection,
|
|
|
|
|
target, property, time);
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-17 00:22:44 +00:00
|
|
|
|
/**
|
|
|
|
|
* gdk_selection_owner_set_for_display:
|
|
|
|
|
* @display: the #GdkDisplay
|
2014-05-17 03:12:51 +00:00
|
|
|
|
* @owner: (nullable): a #GdkWindow or %NULL to indicate that the owner for
|
2010-12-17 00:22:44 +00:00
|
|
|
|
* 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.
|
|
|
|
|
*
|
2014-05-17 03:12:51 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): if there is a selection owner
|
2014-05-08 19:55:50 +00:00
|
|
|
|
* for this window, and it is a window known to the current
|
|
|
|
|
* process, the #GdkWindow that owns the selection, otherwise
|
|
|
|
|
* %NULL.
|
2010-12-17 00:22:44 +00:00
|
|
|
|
*
|
|
|
|
|
* 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);
|
|
|
|
|
}
|
2010-12-17 00:58:07 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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,
|
2011-02-01 16:22:04 +00:00
|
|
|
|
GdkWindow *requestor,
|
2010-12-17 00:58:07 +00:00
|
|
|
|
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_);
|
|
|
|
|
}
|
2010-12-17 01:10:11 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2011-01-18 05:37:11 +00:00
|
|
|
|
* gdk_selection_property_get: (skip)
|
2010-12-17 01:10:11 +00:00
|
|
|
|
* @requestor: the window on which the data is stored
|
|
|
|
|
* @data: location to store a pointer to the retrieved data.
|
|
|
|
|
If the retrieval failed, %NULL we be stored here, otherwise, it
|
|
|
|
|
will be non-%NULL and the returned data should be freed with g_free()
|
|
|
|
|
when you are finished using it. The length of the
|
|
|
|
|
allocated memory is one more than the length
|
|
|
|
|
of the returned data, and the final byte will always
|
|
|
|
|
be zero, to ensure nul-termination of strings
|
|
|
|
|
* @prop_type: location to store the type of the property
|
|
|
|
|
* @prop_format: location to store the format of the property
|
|
|
|
|
*
|
|
|
|
|
* Retrieves selection data that was stored by the selection
|
|
|
|
|
* data in response to a call to gdk_selection_convert(). This function
|
|
|
|
|
* will not be used by applications, who should use the #GtkClipboard
|
|
|
|
|
* API instead.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the length of the retrieved data.
|
2010-12-17 01:10:11 +00:00
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gdk_selection_property_get (GdkWindow *requestor,
|
|
|
|
|
guchar **data,
|
|
|
|
|
GdkAtom *ret_type,
|
|
|
|
|
gint *ret_format)
|
|
|
|
|
{
|
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0);
|
|
|
|
|
|
|
|
|
|
display = gdk_window_get_display (requestor);
|
|
|
|
|
|
|
|
|
|
return GDK_DISPLAY_GET_CLASS (display)
|
|
|
|
|
->get_selection_property (display, requestor, data, ret_type, ret_format);
|
|
|
|
|
}
|
2010-12-17 01:25:32 +00:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2010-12-17 04:44:50 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_text_property_to_utf8_list_for_display:
|
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
|
* @encoding: an atom representing the encoding of the text
|
|
|
|
|
* @format: the format of the property
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @text: (array length=length): the text to convert
|
2010-12-17 04:44:50 +00:00
|
|
|
|
* @length: the length of @text, in bytes
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @list: (out) (array zero-terminated=1): location to store the list
|
|
|
|
|
* of strings or %NULL. The list should be freed with
|
|
|
|
|
* g_strfreev().
|
2010-12-17 04:44:50 +00:00
|
|
|
|
*
|
|
|
|
|
* Converts a text property in the given encoding to
|
|
|
|
|
* a list of UTF-8 strings.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the number of strings in the resulting list
|
2010-12-17 04:44:50 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.2
|
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
|
|
|
|
|
GdkAtom encoding,
|
|
|
|
|
gint format,
|
|
|
|
|
const guchar *text,
|
|
|
|
|
gint length,
|
|
|
|
|
gchar ***list)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (text != NULL, 0);
|
|
|
|
|
g_return_val_if_fail (length >= 0, 0);
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
|
|
|
|
|
|
|
|
|
return GDK_DISPLAY_GET_CLASS (display)
|
|
|
|
|
->text_property_to_utf8_list (display, encoding, format, text, length, list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gdk_utf8_to_string_target:
|
|
|
|
|
* @str: a UTF-8 string
|
|
|
|
|
*
|
|
|
|
|
* Converts an UTF-8 string into the best possible representation
|
|
|
|
|
* as a STRING. The representation of characters not in STRING
|
|
|
|
|
* is not specified; it may be as pseudo-escape sequences
|
|
|
|
|
* \x{ABCD}, or it may be in some other form of approximation.
|
|
|
|
|
*
|
2014-05-08 19:55:50 +00:00
|
|
|
|
* Returns: (nullable): the newly-allocated string, or %NULL if the
|
|
|
|
|
* conversion failed. (It should not fail for any properly
|
|
|
|
|
* formed UTF-8 string unless system limits like memory or
|
|
|
|
|
* file descriptors are exceeded.)
|
2010-12-17 04:44:50 +00:00
|
|
|
|
**/
|
|
|
|
|
gchar *
|
|
|
|
|
gdk_utf8_to_string_target (const gchar *str)
|
|
|
|
|
{
|
|
|
|
|
GdkDisplay *display = gdk_display_get_default ();
|
|
|
|
|
|
|
|
|
|
return GDK_DISPLAY_GET_CLASS (display)->utf8_to_string_target (display, str);
|
|
|
|
|
}
|