Functions
gtk_target_list_unref ()
void
gtk_target_list_unref (GtkTargetList *list);
Decreases the reference count of a GtkTargetList by one.
If the resulting reference count is zero, frees the list.
gtk_target_list_add_text_targets ()
void
gtk_target_list_add_text_targets (GtkTargetList *list,
guint info);
Appends the text targets supported by GtkSelectionData to
the target list. All targets are added with the same info
.
Since: 2.6
gtk_target_list_add_image_targets ()
void
gtk_target_list_add_image_targets (GtkTargetList *list,
guint info,
gboolean writable);
Appends the image targets supported by GtkSelectionData to
the target list. All targets are added with the same info
.
Since: 2.6
gtk_target_list_add_uri_targets ()
void
gtk_target_list_add_uri_targets (GtkTargetList *list,
guint info);
Appends the URI targets supported by GtkSelectionData to
the target list. All targets are added with the same info
.
Since: 2.6
gtk_target_list_remove ()
void
gtk_target_list_remove (GtkTargetList *list,
GdkAtom target);
Removes a target from a target list.
gtk_target_table_new_from_list ()
GtkTargetEntry *
gtk_target_table_new_from_list (GtkTargetList *list,
gint *n_targets);
This function creates an GtkTargetEntry array that contains the
same targets as the passed list. The returned table is newly
allocated and should be freed using gtk_target_table_free() when no
longer needed.
Returns
the new table.
[array length=n_targets][transfer full]
Since: 2.10
gtk_selection_owner_set ()
gboolean
gtk_selection_owner_set (GtkWidget *widget,
GdkAtom selection,
guint32 time_);
Claims ownership of a given selection for a particular widget,
or, if widget
is NULL, release ownership of the selection.
Returns
TRUE if the operation succeeded
gtk_selection_owner_set_for_display ()
gboolean
gtk_selection_owner_set_for_display (GdkDisplay *display,
GtkWidget *widget,
GdkAtom selection,
guint32 time_);
Claim ownership of a given selection for a particular widget, or,
if widget
is NULL, release ownership of the selection.
Returns
TRUE if the operation succeeded
Since: 2.2
gtk_selection_add_target ()
void
gtk_selection_add_target (GtkWidget *widget,
GdkAtom selection,
GdkAtom target,
guint info);
Appends a specified target to the list of supported targets for a
given widget and selection.
gtk_selection_add_targets ()
void
gtk_selection_add_targets (GtkWidget *widget,
GdkAtom selection,
const GtkTargetEntry *targets,
guint ntargets);
Prepends a table of targets to the list of supported targets
for a given widget and selection.
gtk_selection_clear_targets ()
void
gtk_selection_clear_targets (GtkWidget *widget,
GdkAtom selection);
Remove all targets registered for the given selection for the
widget.
gtk_selection_convert ()
gboolean
gtk_selection_convert (GtkWidget *widget,
GdkAtom selection,
GdkAtom target,
guint32 time_);
Requests the contents of a selection. When received,
a “selection-received” signal will be generated.
Returns
TRUE if requested succeeded. FALSE if we could not process
request. (e.g., there was already a request in process for
this widget).
gtk_selection_data_set ()
void
gtk_selection_data_set (GtkSelectionData *selection_data,
GdkAtom type,
gint format,
const guchar *data,
gint length);
Stores new data into a GtkSelectionData object. Should
only be called from a selection handler callback.
Zero-terminates the stored data.
gtk_selection_data_set_text ()
gboolean
gtk_selection_data_set_text (GtkSelectionData *selection_data,
const gchar *str,
gint len);
Sets the contents of the selection from a UTF-8 encoded string.
The string is converted to the form determined by
selection_data->target
.
Returns
TRUE if the selection was successfully set,
otherwise FALSE.
gtk_selection_data_get_text ()
guchar *
gtk_selection_data_get_text (const GtkSelectionData *selection_data);
Gets the contents of the selection data as a UTF-8 string.
Returns
if the selection data contained a
recognized text type and it could be converted to UTF-8, a newly
allocated string containing the converted text, otherwise NULL.
If the result is non-NULL it must be freed with g_free().
[type utf8][nullable][transfer full]
gtk_selection_data_set_pixbuf ()
gboolean
gtk_selection_data_set_pixbuf (GtkSelectionData *selection_data,
GdkPixbuf *pixbuf);
Sets the contents of the selection from a GdkPixbuf
The pixbuf is converted to the form determined by
selection_data->target
.
Returns
TRUE if the selection was successfully set,
otherwise FALSE.
Since: 2.6
gtk_selection_data_get_pixbuf ()
GdkPixbuf *
gtk_selection_data_get_pixbuf (const GtkSelectionData *selection_data);
Gets the contents of the selection data as a GdkPixbuf.
Returns
if the selection data
contained a recognized image type and it could be converted to a
GdkPixbuf, a newly allocated pixbuf is returned, otherwise
NULL. If the result is non-NULL it must be freed with
g_object_unref().
[nullable][transfer full]
Since: 2.6
gtk_selection_data_set_uris ()
gboolean
gtk_selection_data_set_uris (GtkSelectionData *selection_data,
gchar **uris);
Sets the contents of the selection from a list of URIs.
The string is converted to the form determined by
selection_data->target
.
Returns
TRUE if the selection was successfully set,
otherwise FALSE.
Since: 2.6
gtk_selection_data_get_uris ()
gchar **
gtk_selection_data_get_uris (const GtkSelectionData *selection_data);
Gets the contents of the selection data as array of URIs.
Returns
if
the selection data contains a list of
URIs, a newly allocated NULL-terminated string array
containing the URIs, otherwise NULL. If the result is
non-NULL it must be freed with g_strfreev().
[array zero-terminated=1][element-type utf8][transfer full]
Since: 2.6
gtk_selection_data_get_targets ()
gboolean
gtk_selection_data_get_targets (const GtkSelectionData *selection_data,
GdkAtom **targets,
gint *n_atoms);
Gets the contents of selection_data
as an array of targets.
This can be used to interpret the results of getting
the standard TARGETS target that is always supplied for
any selection.
Returns
TRUE if selection_data
contains a valid
array of targets, otherwise FALSE.
gtk_selection_data_targets_include_image ()
gboolean
gtk_selection_data_targets_include_image
(const GtkSelectionData *selection_data,
gboolean writable);
Given a GtkSelectionData object holding a list of targets,
determines if any of the targets in targets
can be used to
provide a GdkPixbuf.
Returns
TRUE if selection_data
holds a list of targets,
and a suitable target for images is included, otherwise FALSE.
Since: 2.6
gtk_selection_data_targets_include_text ()
gboolean
gtk_selection_data_targets_include_text
(const GtkSelectionData *selection_data);
Given a GtkSelectionData object holding a list of targets,
determines if any of the targets in targets
can be used to
provide text.
Returns
TRUE if selection_data
holds a list of targets,
and a suitable target for text is included, otherwise FALSE.
gtk_selection_data_targets_include_uri ()
gboolean
gtk_selection_data_targets_include_uri
(const GtkSelectionData *selection_data);
Given a GtkSelectionData object holding a list of targets,
determines if any of the targets in targets
can be used to
provide a list or URIs.
Returns
TRUE if selection_data
holds a list of targets,
and a suitable target for URI lists is included, otherwise FALSE.
Since: 2.10
gtk_selection_data_targets_include_rich_text ()
gboolean
gtk_selection_data_targets_include_rich_text
(const GtkSelectionData *selection_data,
GtkTextBuffer *buffer);
Given a GtkSelectionData object holding a list of targets,
determines if any of the targets in targets
can be used to
provide rich text.
Returns
TRUE if selection_data
holds a list of targets,
and a suitable target for rich text is included,
otherwise FALSE.
Since: 2.10
gtk_selection_data_get_selection ()
GdkAtom
gtk_selection_data_get_selection (const GtkSelectionData *selection_data);
Retrieves the selection GdkAtom of the selection data.
Returns
the selection GdkAtom of the selection data.
[transfer none]
Since: 2.16
gtk_selection_data_get_data ()
const guchar *
gtk_selection_data_get_data (const GtkSelectionData *selection_data);
Retrieves the raw data of the selection.
[skip]
Returns
the raw data of the selection.
[array][element-type guint8]
Since: 2.14
gtk_selection_data_get_length ()
gint
gtk_selection_data_get_length (const GtkSelectionData *selection_data);
Retrieves the length of the raw data of the selection.
Returns
the length of the data of the selection.
Since: 2.14
gtk_selection_data_get_data_with_length ()
const guchar *
gtk_selection_data_get_data_with_length
(const GtkSelectionData *selection_data,
gint *length);
Retrieves the raw data of the selection along with its length.
[rename-to gtk_selection_data_get_data]
Returns
the raw data of the selection.
[array length=length]
Since: 3.0
gtk_selection_data_get_data_type ()
GdkAtom
gtk_selection_data_get_data_type (const GtkSelectionData *selection_data);
Retrieves the data type of the selection.
Returns
the data type of the selection.
[transfer none]
Since: 2.14
gtk_selection_data_get_display ()
GdkDisplay *
gtk_selection_data_get_display (const GtkSelectionData *selection_data);
Retrieves the display of the selection.
Returns
the display of the selection.
[transfer none]
Since: 2.14
gtk_selection_data_get_format ()
gint
gtk_selection_data_get_format (const GtkSelectionData *selection_data);
Retrieves the format of the selection.
Returns
the format of the selection.
Since: 2.14
gtk_selection_data_get_target ()
GdkAtom
gtk_selection_data_get_target (const GtkSelectionData *selection_data);
Retrieves the target of the selection.
Returns
the target of the selection.
[transfer none]
Since: 2.14
gtk_targets_include_image ()
gboolean
gtk_targets_include_image (GdkAtom *targets,
gint n_targets,
gboolean writable);
Determines if any of the targets in targets
can be used to
provide a GdkPixbuf.
Returns
TRUE if targets
include a suitable target for images,
otherwise FALSE.
Since: 2.10
gtk_targets_include_text ()
gboolean
gtk_targets_include_text (GdkAtom *targets,
gint n_targets);
Determines if any of the targets in targets
can be used to
provide text.
Returns
TRUE if targets
include a suitable target for text,
otherwise FALSE.
Since: 2.10
gtk_targets_include_uri ()
gboolean
gtk_targets_include_uri (GdkAtom *targets,
gint n_targets);
Determines if any of the targets in targets
can be used to
provide an uri list.
Returns
TRUE if targets
include a suitable target for uri lists,
otherwise FALSE.
Since: 2.10
gtk_targets_include_rich_text ()
gboolean
gtk_targets_include_rich_text (GdkAtom *targets,
gint n_targets,
GtkTextBuffer *buffer);
Determines if any of the targets in targets
can be used to
provide rich text.
Returns
TRUE if targets
include a suitable target for rich text,
otherwise FALSE.
Since: 2.10
gtk_selection_remove_all ()
void
gtk_selection_remove_all (GtkWidget *widget);
Removes all handlers and unsets ownership of all
selections for a widget. Called when widget is being
destroyed. This function will not generally be
called by applications.