Selections

Selections

Functions

Types and Values

Includes

#include <gdk/gdk.h>

Description

Functions

gdk_selection_owner_set ()

gboolean
gdk_selection_owner_set (GdkWindow *owner,
                         GdkAtom selection,
                         guint32 time_,
                         gboolean send_event);

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 owner as the current owner of the selection selection .

Parameters

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.

 

Returns

TRUE if the selection owner was successfully changed to owner, otherwise FALSE.

Since: 2.2


gdk_selection_owner_get ()

GdkWindow *
gdk_selection_owner_get (GdkAtom 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.

Parameters

display

a GdkDisplay.

 

selection

an atom indentifying a selection.

 

Returns

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


gdk_selection_convert ()

void
gdk_selection_convert (GdkWindow *requestor,
                       GdkAtom selection,
                       GdkAtom target,
                       guint32 time_);

gdk_selection_property_get ()

gint
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_convert(). This function will not be used by applications, who should use the GtkClipboard API instead.

Parameters

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.

 

Returns

the length of the retrieved data.


gdk_selection_send_notify ()

void
gdk_selection_send_notify (GdkNativeWindow requestor,
                           GdkAtom selection,
                           GdkAtom target,
                           GdkAtom property,
                           guint32 time_);

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.

Parameters

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.

 

Since: 2.2

Types and Values

GdkSelection

typedef GdkAtom GdkSelection;

GdkSelection is deprecated and should not be used in newly-written code.


GdkSelectionType

typedef GdkAtom GdkSelectionType;

GdkSelectionType is deprecated and should not be used in newly-written code.


GdkTarget

typedef GdkAtom GdkTarget;

GdkTarget is deprecated and should not be used in newly-written code.


GDK_SELECTION_PRIMARY

#define GDK_SELECTION_PRIMARY 		_GDK_MAKE_ATOM (1)

GDK_SELECTION_SECONDARY

#define GDK_SELECTION_SECONDARY 	_GDK_MAKE_ATOM (2)

GDK_SELECTION_CLIPBOARD

#define GDK_SELECTION_CLIPBOARD 	_GDK_MAKE_ATOM (69)

GDK_TARGET_BITMAP

#define GDK_TARGET_BITMAP 		_GDK_MAKE_ATOM (5)

GDK_TARGET_COLORMAP

#define GDK_TARGET_COLORMAP 		_GDK_MAKE_ATOM (7)

GDK_TARGET_DRAWABLE

#define GDK_TARGET_DRAWABLE 		_GDK_MAKE_ATOM (17)

GDK_TARGET_PIXMAP

#define GDK_TARGET_PIXMAP 		_GDK_MAKE_ATOM (20)

GDK_TARGET_STRING

#define GDK_TARGET_STRING 		_GDK_MAKE_ATOM (31)

GDK_SELECTION_TYPE_ATOM

#define GDK_SELECTION_TYPE_ATOM 	_GDK_MAKE_ATOM (4)

GDK_SELECTION_TYPE_BITMAP

#define GDK_SELECTION_TYPE_BITMAP 	_GDK_MAKE_ATOM (5)

GDK_SELECTION_TYPE_COLORMAP

#define GDK_SELECTION_TYPE_COLORMAP 	_GDK_MAKE_ATOM (7)

GDK_SELECTION_TYPE_DRAWABLE

#define GDK_SELECTION_TYPE_DRAWABLE 	_GDK_MAKE_ATOM (17)

GDK_SELECTION_TYPE_INTEGER

#define GDK_SELECTION_TYPE_INTEGER 	_GDK_MAKE_ATOM (19)

GDK_SELECTION_TYPE_PIXMAP

#define GDK_SELECTION_TYPE_PIXMAP 	_GDK_MAKE_ATOM (20)

GDK_SELECTION_TYPE_WINDOW

#define GDK_SELECTION_TYPE_WINDOW 	_GDK_MAKE_ATOM (33)

GDK_SELECTION_TYPE_STRING

#define GDK_SELECTION_TYPE_STRING 	_GDK_MAKE_ATOM (31)