Synopsis#include <gdk/gdk.h> typedef GdkSelection; typedef GdkSelectionType; typedef GdkTarget; #define GDK_SELECTION_PRIMARY #define GDK_SELECTION_SECONDARY #define GDK_SELECTION_CLIPBOARD #define GDK_TARGET_BITMAP #define GDK_TARGET_COLORMAP #define GDK_TARGET_DRAWABLE #define GDK_TARGET_PIXMAP #define GDK_TARGET_STRING #define GDK_SELECTION_TYPE_ATOM #define GDK_SELECTION_TYPE_BITMAP #define GDK_SELECTION_TYPE_COLORMAP #define GDK_SELECTION_TYPE_DRAWABLE #define GDK_SELECTION_TYPE_INTEGER #define GDK_SELECTION_TYPE_PIXMAP #define GDK_SELECTION_TYPE_WINDOW #define GDK_SELECTION_TYPE_STRING gboolean gdk_selection_owner_set (GdkWindow *owner, GdkAtom selection, guint32 time_, gboolean send_event); gboolean gdk_selection_owner_set_for_display (GdkDisplay *display, GdkWindow *owner, GdkAtom selection, guint32 time_, gboolean send_event); GdkWindow* gdk_selection_owner_get (GdkAtom selection); GdkWindow* gdk_selection_owner_get_for_display (GdkDisplay *display, GdkAtom selection); void gdk_selection_convert (GdkWindow *requestor, GdkAtom selection, GdkAtom target, guint32 time_); gboolean gdk_selection_property_get (GdkWindow *requestor, guchar **data, GdkAtom *prop_type, gint *prop_format); void gdk_selection_send_notify (GdkNativeWindow requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time_); void gdk_selection_send_notify_for_display (GdkDisplay *display, GdkNativeWindow requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time_); Description
The X selection mechanism provides a way to transfer
arbitrary chunks of data between programs.
A selection is a essentially
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
The contents of a selection can be represented in
a number of formats, called targets.
Each target is identified by an atom. A list of
all possible targets supported by the selection owner
can be retrieved by requesting the special target
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 DetailsGdkSelectiontypedef GdkAtom GdkSelection; Warning
The GdkSelection enumeration contains predefined atom values for several common selections. GdkSelectionTypetypedef GdkAtom GdkSelectionType; Warning
The GdkSelectionType enumeration contains predefined atom values used to represent the types of data transferred in response to a request for a target. See the ICCCM for details about what data should be transferred for each of these types. Other atoms can be used, and the recommended practice for GTK+ is to to use mime types for this purpose. However, supporting these types may be useful for compatibility with older programs. GdkTargettypedef GdkAtom GdkTarget; Warning
The GdkTarget enumeration contains predefined atom values which are used to describe possible targets for a selection. Other atoms can be used, and the recommended practice for GTK+ is to to use mime types for this purpose. However, supporting these types may be useful for compatibility with older programs. GDK_SELECTION_PRIMARY#define GDK_SELECTION_PRIMARY _GDK_MAKE_ATOM (1)
A GdkAtom representing the GDK_SELECTION_SECONDARY#define GDK_SELECTION_SECONDARY _GDK_MAKE_ATOM (2)
A GdkAtom representing the GDK_SELECTION_CLIPBOARD#define GDK_SELECTION_CLIPBOARD _GDK_MAKE_ATOM (69)
A GdkAtom representing the GDK_TARGET_BITMAP#define GDK_TARGET_BITMAP _GDK_MAKE_ATOM (5)
A GdkAtom representing the GDK_TARGET_COLORMAP#define GDK_TARGET_COLORMAP _GDK_MAKE_ATOM (7)
A GdkAtom representing the GDK_TARGET_DRAWABLE#define GDK_TARGET_DRAWABLE _GDK_MAKE_ATOM (17)
A GdkAtom representing the GDK_TARGET_PIXMAP#define GDK_TARGET_PIXMAP _GDK_MAKE_ATOM (20)
A GdkAtom representing the GDK_TARGET_STRING#define GDK_TARGET_STRING _GDK_MAKE_ATOM (31)
A GdkAtom representing the GDK_SELECTION_TYPE_ATOM#define GDK_SELECTION_TYPE_ATOM _GDK_MAKE_ATOM (4)
A GdkAtom representing the GDK_SELECTION_TYPE_BITMAP#define GDK_SELECTION_TYPE_BITMAP _GDK_MAKE_ATOM (5)
A GdkAtom representing the GDK_SELECTION_TYPE_COLORMAP#define GDK_SELECTION_TYPE_COLORMAP _GDK_MAKE_ATOM (7)
A GdkAtom representing the GDK_SELECTION_TYPE_DRAWABLE#define GDK_SELECTION_TYPE_DRAWABLE _GDK_MAKE_ATOM (17)
A GdkAtom representing the GDK_SELECTION_TYPE_INTEGER#define GDK_SELECTION_TYPE_INTEGER _GDK_MAKE_ATOM (19)
A GdkAtom representing the GDK_SELECTION_TYPE_PIXMAP#define GDK_SELECTION_TYPE_PIXMAP _GDK_MAKE_ATOM (20)
A GdkAtom representing the GDK_SELECTION_TYPE_WINDOW#define GDK_SELECTION_TYPE_WINDOW _GDK_MAKE_ATOM (33)
A GdkAtom representing the GDK_SELECTION_TYPE_STRING#define GDK_SELECTION_TYPE_STRING _GDK_MAKE_ATOM (31)
A GdkAtom representing the gdk_selection_owner_set ()gboolean gdk_selection_owner_set (GdkWindow *owner, GdkAtom selection, guint32 time_, gboolean send_event); Sets the owner of the given selection.
gdk_selection_owner_set_for_display ()gboolean gdk_selection_owner_set_for_display (GdkDisplay *display, GdkWindow *owner, GdkAtom selection, guint32 time_, gboolean send_event);
Sets the GdkWindow
Since 2.2 gdk_selection_owner_get ()GdkWindow* gdk_selection_owner_get (GdkAtom selection); Determines the owner of the given selection.
gdk_selection_owner_get_for_display ()GdkWindow* gdk_selection_owner_get_for_display (GdkDisplay *display, GdkAtom 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.
Since 2.2 gdk_selection_convert ()void gdk_selection_convert (GdkWindow *requestor, GdkAtom selection, GdkAtom target, guint32 time_); Retrieves the contents of a selection in a given form.
gdk_selection_property_get ()gboolean gdk_selection_property_get (GdkWindow *requestor, guchar **data, GdkAtom *prop_type, gint *prop_format);
Retrieves selection data that was stored by the selection
data in response to a call to
gdk_selection_send_notify ()void gdk_selection_send_notify (GdkNativeWindow requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time_); Sends a response to SelectionRequest event.
gdk_selection_send_notify_for_display ()void gdk_selection_send_notify_for_display (GdkDisplay *display, GdkNativeWindow requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time_); Send a response to SelectionRequest event.
Since 2.2 |