gtk.Selections.Selections Class Reference

List of all members.

Detailed Description

Description The selection mechanism provides the basis for different types of communication between processes.

In particular, drag and drop and GtkClipboard work via selections. You will very seldom or never need to use most of the functions in this section directly; GtkClipboard provides a nicer interface to the same functionality. Some of the datatypes defined this section are used in the GtkClipboard and drag-and-drop API's as well. The GtkTargetEntry structure and GtkTargetList objects represent lists of data types that are supported when sending or receiving data. The GtkSelectionData object is used to store a chunk of data along with the data type and other associated information.


Static Public Member Functions

static GtkTargetListtargetListNew (GtkTargetEntry *targets, uint ntargets)
 Creates a new GtkTargetList from an array of GtkTargetEntry.
static GtkTargetListtargetListRef (GtkTargetList *list)
 Increases the reference count of a GtkTargetList by one.
static void targetListUnref (GtkTargetList *list)
 Decreases the reference count of a GtkTargetList by one.
static void targetListAdd (GtkTargetList *list, GdkAtom target, uint flags, uint info)
 Appends another target to a GtkTargetList.
static void targetListAddTable (GtkTargetList *list, GtkTargetEntry *targets, uint ntargets)
 Prepends a table of GtkTargetEntry to a target list.
static void targetListAddTextTargets (GtkTargetList *list, uint info)
 Appends the text targets supported by GtkSelection to the target list.
static void targetListAddImageTargets (GtkTargetList *list, uint info, int writable)
 Appends the image targets supported by GtkSelection to the target list.
static void targetListAddUriTargets (GtkTargetList *list, uint info)
 Appends the URI targets supported by GtkSelection to the target list.
static void targetListAddRichTextTargets (GtkTargetList *list, uint info, int deserializable, GtkTextBuffer *buffer)
 Appends the rich text targets registered with gtk_text_buffer_register_serialize_format() or gtk_text_buffer_register_deserialize_format() to the target list.
static void targetListRemove (GtkTargetList *list, GdkAtom target)
 Removes a target from a target list.
static int targetListFind (GtkTargetList *list, GdkAtom target, uint *info)
 Looks up a given target in a GtkTargetList.
static void targetTableFree (GtkTargetEntry *targets, int nTargets)
 This function frees a target table as returned by gtk_target_table_new_from_list() targets: a GtkTargetEntry array n_targets: the number of entries in the array Since 2.10.
static GtkTargetEntrytargetTableNewFromList (GtkTargetList *list, int *nTargets)
 This function creates an GtkTargetEntry array that contains the same targets as the passed list.
static int selectionOwnerSet (Widget widget, GdkAtom selection, uint time)
 Claims ownership of a given selection for a particular widget, or, if widget is NULL, release ownership of the selection.
static int selectionOwnerSetForDisplay (Display display, Widget widget, GdkAtom selection, uint time)
 Claim ownership of a given selection for a particular widget, or, if widget is NULL, release ownership of the selection.
static void selectionAddTarget (Widget widget, GdkAtom selection, GdkAtom target, uint info)
 Appends a specified target to the list of supported targets for a given widget and selection.
static void selectionAddTargets (Widget widget, GdkAtom selection, GtkTargetEntry *targets, uint ntargets)
 Prepends a table of targets to the list of supported targets for a given widget and selection.
static void selectionClearTargets (Widget widget, GdkAtom selection)
 Remove all targets registered for the given selection for the widget.
static int selectionConvert (Widget widget, GdkAtom selection, GdkAtom target, uint time)
 Requests the contents of a selection.
static void selectionDataSet (GtkSelectionData *selectionData, GdkAtom type, int format, char *data, int length)
 Stores new data into a GtkSelectionData object.
static int selectionDataSetText (GtkSelectionData *selectionData, char[] str, int len)
 Sets the contents of the selection from a UTF-8 encoded string.
static charselectionDataGetText (GtkSelectionData *selectionData)
 Gets the contents of the selection data as a UTF-8 string.
static int selectionDataSetPixbuf (GtkSelectionData *selectionData, Pixbuf pixbuf)
 Sets the contents of the selection from a GdkPixbuf The pixbuf is converted to the form determined by selection_data->target.
static Pixbuf selectionDataGetPixbuf (GtkSelectionData *selectionData)
 Gets the contents of the selection data as a GdkPixbuf.
static int selectionDataSetUris (GtkSelectionData *selectionData, char **uris)
 Sets the contents of the selection from a list of URIs.
static char ** selectionDataGetUris (GtkSelectionData *selectionData)
 Gets the contents of the selection data as array of URIs.
static int selectionDataGetTargets (GtkSelectionData *selectionData, GdkAtom **targets, int *nAtoms)
 Gets the contents of selection_data as an array of targets.
static int selectionDataTargetsIncludeImage (GtkSelectionData *selectionData, int 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.
static int selectionDataTargetsIncludeText (GtkSelectionData *selectionData)
 Given a GtkSelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide text.
static int selectionDataTargetsIncludeUri (GtkSelectionData *selectionData)
 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.
static int selectionDataTargetsIncludeRichText (GtkSelectionData *selectionData, 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.
static int targetsIncludeImage (GdkAtom *targets, int nTargets, int writable)
 Determines if any of the targets in targets can be used to provide a GdkPixbuf.
static int targetsIncludeText (GdkAtom *targets, int nTargets)
 Determines if any of the targets in targets can be used to provide text.
static int targetsIncludeUri (GdkAtom *targets, int nTargets)
 Determines if any of the targets in targets can be used to provide an uri list.
static int targetsIncludeRichText (GdkAtom *targets, int nTargets, GtkTextBuffer *buffer)
 Determines if any of the targets in targets can be used to provide rich text.
static void selectionRemoveAll (Widget widget)
 Removes all handlers and unsets ownership of all selections for a widget.
static int selectionClear (Widget widget, GdkEventSelection *event)
 Warning gtk_selection_clear has been deprecated since version 2.4 and should not be used in newly-written code.
static GtkSelectionDataselectionDataCopy (GtkSelectionData *data)
 Makes a copy of a GtkSelectionData structure and its data.
static void selectionDataFree (GtkSelectionData *data)
 Frees a GtkSelectionData structure returned from gtk_selection_data_copy().


Member Function Documentation

static void gtk.Selections.Selections.selectionAddTarget ( Widget  widget,
GdkAtom  selection,
GdkAtom  target,
uint  info 
) [static]

Appends a specified target to the list of supported targets for a given widget and selection.

widget: a GtkTarget selection: the selection target: target to add. info: A unsigned integer which will be passed back to the application.

static void gtk.Selections.Selections.selectionAddTargets ( Widget  widget,
GdkAtom  selection,
GtkTargetEntry targets,
uint  ntargets 
) [static]

Prepends a table of targets to the list of supported targets for a given widget and selection.

widget: a GtkWidget selection: the selection targets: a table of targets to add ntargets: number of entries in targets

static int gtk.Selections.Selections.selectionClear ( Widget  widget,
GdkEventSelection event 
) [static]

Warning gtk_selection_clear has been deprecated since version 2.4 and should not be used in newly-written code.

Instead of calling this function, chain up from your selection_clear_event handler. Calling this function from any other context is illegal. The default handler for the GtkWidget.selection_clear_event signal. widget: a GtkWidget event: the event Returns: TRUE if the event was handled, otherwise false Since 2.2

static void gtk.Selections.Selections.selectionClearTargets ( Widget  widget,
GdkAtom  selection 
) [static]

Remove all targets registered for the given selection for the widget.

widget: a GtkWidget selection: an atom representing a selection

static int gtk.Selections.Selections.selectionConvert ( Widget  widget,
GdkAtom  selection,
GdkAtom  target,
uint  time 
) [static]

Requests the contents of a selection.

When received, a "selection_received" signal will be generated. widget: The widget which acts as requestor selection: Which selection to get target: Form of information desired (e.g., STRING) time_: Time of request (usually of triggering event) In emergency, you could use GDK_CURRENT_TIME Returns: TRUE if requested succeeded. FALSE if we could not process request. (e.g., there was already a request in process for this widget).

static GtkSelectionData* gtk.Selections.Selections.selectionDataCopy ( GtkSelectionData data  )  [static]

Makes a copy of a GtkSelectionData structure and its data.

data: a pointer to a GtkSelectionData structure. Returns: a pointer to a copy of data.

static void gtk.Selections.Selections.selectionDataFree ( GtkSelectionData data  )  [static]

Frees a GtkSelectionData structure returned from gtk_selection_data_copy().

data: a pointer to a GtkSelectionData structure. See Also GtkWidget Much of the operation of selections happens via signals for GtkWidget. In particular, if you are using the functions in this section, you may need to pay attention to selection_get, selection_received, and :selection_clear_event signals.

static Pixbuf gtk.Selections.Selections.selectionDataGetPixbuf ( GtkSelectionData selectionData  )  [static]

Gets the contents of the selection data as a GdkPixbuf.

selection_data: a GtkSelectionData 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(). Since 2.6

static int gtk.Selections.Selections.selectionDataGetTargets ( GtkSelectionData selectionData,
GdkAtom **  targets,
int nAtoms 
) [static]

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. selection_data: a GtkSelectionData object targets: location to store an array of targets. The result stored here must be freed with g_free(). n_atoms: location to store number of items in targets. Returns: TRUE if selection_data contains a valid array of targets, otherwise FALSE.

static char* gtk.Selections.Selections.selectionDataGetText ( GtkSelectionData selectionData  )  [static]

Gets the contents of the selection data as a UTF-8 string.

selection_data: a GtkSelectionData 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().

static char** gtk.Selections.Selections.selectionDataGetUris ( GtkSelectionData selectionData  )  [static]

Gets the contents of the selection data as array of URIs.

selection_data: a GtkSelectionData 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(). Since 2.6

static void gtk.Selections.Selections.selectionDataSet ( GtkSelectionData selectionData,
GdkAtom  type,
int  format,
char data,
int  length 
) [static]

Stores new data into a GtkSelectionData object.

Should only be called from a selection handler callback. Zero-terminates the stored data. selection_data: a pointer to a GtkSelectionData structure. type: the type of selection data format: format (number of bits in a unit) data: pointer to the data (will be copied) length: length of the data

static int gtk.Selections.Selections.selectionDataSetPixbuf ( GtkSelectionData selectionData,
Pixbuf  pixbuf 
) [static]

Sets the contents of the selection from a GdkPixbuf The pixbuf is converted to the form determined by selection_data->target.

selection_data: a GtkSelectionData pixbuf: a GdkPixbuf Returns: TRUE if the selection was successfully set, otherwise FALSE. Since 2.6

static int gtk.Selections.Selections.selectionDataSetText ( GtkSelectionData selectionData,
char[]  str,
int  len 
) [static]

Sets the contents of the selection from a UTF-8 encoded string.

The string is converted to the form determined by selection_data->target. selection_data: a GtkSelectionData str: a UTF-8 string len: the length of str, or -1 if str is nul-terminated. Returns: TRUE if the selection was successfully set, otherwise FALSE.

static int gtk.Selections.Selections.selectionDataSetUris ( GtkSelectionData selectionData,
char **  uris 
) [static]

Sets the contents of the selection from a list of URIs.

The string is converted to the form determined by selection_data->target. selection_data: a GtkSelectionData uris: a NULL-terminated array of strings hilding URIs Returns: TRUE if the selection was successfully set, otherwise FALSE. Since 2.6

static int gtk.Selections.Selections.selectionDataTargetsIncludeImage ( GtkSelectionData selectionData,
int  writable 
) [static]

Given a GtkSelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide a GdkPixbuf.

selection_data: a GtkSelectionData object writable: whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format Returns: TRUE if selection_data holds a list of targets, and a suitable target for images is included, otherwise FALSE. Since 2.6

static int gtk.Selections.Selections.selectionDataTargetsIncludeRichText ( GtkSelectionData selectionData,
GtkTextBuffer buffer 
) [static]

Given a GtkSelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide rich text.

selection_data: a GtkSelectionData object buffer: a GtkTextBuffer Returns: TRUE if selection_data holds a list of targets, and a suitable target for rich text is included, otherwise FALSE. Since 2.10

static int gtk.Selections.Selections.selectionDataTargetsIncludeText ( GtkSelectionData selectionData  )  [static]

Given a GtkSelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide text.

selection_data: a GtkSelectionData object Returns: TRUE if selection_data holds a list of targets, and a suitable target for text is included, otherwise FALSE.

static int gtk.Selections.Selections.selectionDataTargetsIncludeUri ( GtkSelectionData selectionData  )  [static]

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.

selection_data: a GtkSelectionData object Returns: TRUE if selection_data holds a list of targets, and a suitable target for text is included, otherwise FALSE. Since 2.10

static int gtk.Selections.Selections.selectionOwnerSet ( Widget  widget,
GdkAtom  selection,
uint  time 
) [static]

Claims ownership of a given selection for a particular widget, or, if widget is NULL, release ownership of the selection.

widget: a GtkWidget, or NULL. selection: an interned atom representing the selection to claim time_: timestamp with which to claim the selection Returns: TRUE if the operation succeeded

static int gtk.Selections.Selections.selectionOwnerSetForDisplay ( Display  display,
Widget  widget,
GdkAtom  selection,
uint  time 
) [static]

Claim ownership of a given selection for a particular widget, or, if widget is NULL, release ownership of the selection.

display: the Gdkdisplay where the selection is set widget: new selection owner (a GdkWidget), or NULL. selection: an interned atom representing the selection to claim. time_: timestamp with which to claim the selection Returns: TRUE if the operation succeeded Since 2.2

static void gtk.Selections.Selections.selectionRemoveAll ( Widget  widget  )  [static]

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. widget: a GtkWidget

static void gtk.Selections.Selections.targetListAdd ( GtkTargetList list,
GdkAtom  target,
uint  flags,
uint  info 
) [static]

Appends another target to a GtkTargetList.

list: a GtkTargetList target: the interned atom representing the target flags: the flags for this target info: an ID that will be passed back to the application

static void gtk.Selections.Selections.targetListAddImageTargets ( GtkTargetList list,
uint  info,
int  writable 
) [static]

Appends the image targets supported by GtkSelection to the target list.

All targets are added with the same info. list: a GtkTargetList info: an ID that will be passed back to the application writable: whether to add only targets for which GTK+ knows how to convert a pixbuf into the format Since 2.6

static void gtk.Selections.Selections.targetListAddRichTextTargets ( GtkTargetList list,
uint  info,
int  deserializable,
GtkTextBuffer buffer 
) [static]

Appends the rich text targets registered with gtk_text_buffer_register_serialize_format() or gtk_text_buffer_register_deserialize_format() to the target list.

All targets are added with the same info. list: a GtkTargetList info: an ID that will be passed back to the application deserializable: if TRUE, then deserializable rich text formats will be added, serializable formats otherwise. buffer: a GtkTextBuffer. Since 2.10

static void gtk.Selections.Selections.targetListAddTable ( GtkTargetList list,
GtkTargetEntry targets,
uint  ntargets 
) [static]

Prepends a table of GtkTargetEntry to a target list.

list: a GtkTargetList targets: the table of GtkTargetEntry ntargets: number of targets in the table

static void gtk.Selections.Selections.targetListAddTextTargets ( GtkTargetList list,
uint  info 
) [static]

Appends the text targets supported by GtkSelection to the target list.

All targets are added with the same info. list: a GtkTargetList info: an ID that will be passed back to the application Since 2.6

static void gtk.Selections.Selections.targetListAddUriTargets ( GtkTargetList list,
uint  info 
) [static]

Appends the URI targets supported by GtkSelection to the target list.

All targets are added with the same info. list: a GtkTargetList info: an ID that will be passed back to the application Since 2.6

static int gtk.Selections.Selections.targetListFind ( GtkTargetList list,
GdkAtom  target,
uint info 
) [static]

Looks up a given target in a GtkTargetList.

list: a GtkTargetList target: an interned atom representing the target to search for info: a pointer to the location to store application info for target Returns: TRUE if the target was found, otherwise FALSE

static GtkTargetList* gtk.Selections.Selections.targetListNew ( GtkTargetEntry targets,
uint  ntargets 
) [static]

Creates a new GtkTargetList from an array of GtkTargetEntry.

targets: Pointer to an array of GtkTargetEntry ntargets: number of entries in targets. Returns: the new GtkTargetList.

static GtkTargetList* gtk.Selections.Selections.targetListRef ( GtkTargetList list  )  [static]

Increases the reference count of a GtkTargetList by one.

list: a GtkTargetList Returns: the passed in GtkTargetList.

static void gtk.Selections.Selections.targetListRemove ( GtkTargetList list,
GdkAtom  target 
) [static]

Removes a target from a target list.

list: a GtkTargetList target: the interned atom representing the target

static void gtk.Selections.Selections.targetListUnref ( GtkTargetList list  )  [static]

Decreases the reference count of a GtkTargetList by one.

If the resulting reference count is zero, frees the list. list: a GtkTargetList

static int gtk.Selections.Selections.targetsIncludeImage ( GdkAtom targets,
int  nTargets,
int  writable 
) [static]

Determines if any of the targets in targets can be used to provide a GdkPixbuf.

targets: an array of GdkAtoms n_targets: the length of targets writable: whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format Returns: TRUE if targets include a suitable target for images, otherwise FALSE. Since 2.10

static int gtk.Selections.Selections.targetsIncludeRichText ( GdkAtom targets,
int  nTargets,
GtkTextBuffer buffer 
) [static]

Determines if any of the targets in targets can be used to provide rich text.

targets: an array of GdkAtoms n_targets: the length of targets buffer: a GtkTextBuffer Returns: TRUE if targets include a suitable target for rich text, otherwise FALSE. Since 2.10

static int gtk.Selections.Selections.targetsIncludeText ( GdkAtom targets,
int  nTargets 
) [static]

Determines if any of the targets in targets can be used to provide text.

targets: an array of GdkAtoms n_targets: the length of targets Returns: TRUE if targets include a suitable target for text, otherwise FALSE. Since 2.10

static int gtk.Selections.Selections.targetsIncludeUri ( GdkAtom targets,
int  nTargets 
) [static]

Determines if any of the targets in targets can be used to provide an uri list.

targets: an array of GdkAtoms n_targets: the length of targets Returns: TRUE if targets include a suitable target for uri lists, otherwise FALSE. Since 2.10

static void gtk.Selections.Selections.targetTableFree ( GtkTargetEntry targets,
int  nTargets 
) [static]

This function frees a target table as returned by gtk_target_table_new_from_list() targets: a GtkTargetEntry array n_targets: the number of entries in the array Since 2.10.

static GtkTargetEntry* gtk.Selections.Selections.targetTableNewFromList ( GtkTargetList list,
int nTargets 
) [static]

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. list: a GtkTargetList n_targets: return location for the number ot targets in the table Returns: the new table. Since 2.10


SourceForge.net Logo DSource.org Logo digitalmars.com Logo