|
Graphics.UI.Gtk.General.Selection | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
Functions for handling inter-process communication via selections.
|
|
Synopsis |
|
|
|
|
Types
|
|
|
A number that the application can use to differentiate between different
data types or application states.
|
|
|
An atom is an index into a global string table. It is possible to
associate binary data with each entry. This facility is used for
inter-application data exchange such as properties of
Graphics.UI.Gtk.Gdk.DrawWindow.DrawWindow (using PropertyTag),
Graphics.UI.Gtk.Clipboard.Clipboard or Graphics.UI.Gtk.General.Drag
(SelectionId and TargetId).
| Instances | |
|
|
|
A tag that uniquely identifies a target. A target describes the format of
the underlying data source, for instance, it might be a string. A single
selection may support multiple targets: suppose a new target is created for
the Haskell data type Double. In this case, the value of the floating
point number could also be offered as a string.
|
|
|
A tag that uniquely identifies a selection. A selection denotes the
exchange mechanism that is being used, for instance, the clipboard is the
most common exchange mechanism. For drag and drop applications, a new
selection tag is usually created for each different kind of data that is
being exchanged.
|
|
|
A tag that defines the encoding of the binary data. For instance, a
string might be encoded as UTF-8 or in a different locale. Each encoding
would use the same TargetTag but a different SelectionTypeTag.
|
|
|
A TargetList contains information about all possible formats
(represented as TargetTag) that a widget can create or receive in form of
a selection.
|
|
|
|
A monad providing access to selection data.
|
|
|
The TargetFlags enumeration is used to specify constraints on an entry
in a Graphics.UI.Gtk.Gdk.Selection.TargetList. These flags are only
used for drag and drop.
- If the TargetSameApp flag is set, the target will only be selected for
drags within a single application.
- If the TargetSameWidget flag is set, the target will only be selected
for drags within a single widget.
| Constructors | TargetSameApp | | TargetSameWidget | | TargetOtherApp | | TargetOtherWidget | |
| Instances | |
|
|
Constants
|
|
|
If this target is provided by a selection, then the data is a string.
|
|
|
The type indicating that the associated data is itself a (list of)
Graphics.UI.Gtk.General.Selection.Atoms.
|
|
|
The type indicating that the associated data consists of integers.
|
|
|
The type indicating that the associated data is a string without further
information on its encoding.
|
|
Constructors
|
|
|
Create a new TargetTag, SelectionTag, SelectionTypeTag or
PropertyTag. Note that creating two target tags with the same name will
create the same tag, in particular, the tag will be the same across
different applications. Note that the name of an Atom can be printed
by show though comparing the atom is merely an integer comparison.
|
|
|
Create a new, empty TargetList.
|
|
Methods
|
|
|
Append another target to the given TargetList.
- Note that the TargetFlags are only used for drag and drop, not in normal
selection handling.
|
|
|
Append all text targets supported by the selection mechanism to the
target list. All targets are added with the same InfoId.
|
|
|
Append all image targets supported by the selection mechanism to the
target list. All targets are added with the same InfoId. If the boolean
flag is set, only targets will be added which Gtk+ knows how to convert
into a Graphics.UI.Gtk.Pixbuf.Pixbuf.
|
|
|
Append all URI (universal resource indicator, fomerly URL) targets
supported by the selection mechanism to the target list. All targets are
added with the same InfoId.
|
|
|
Append all rich text targets registered with
Graphics.UI.Gtk.TextBuffer.textBufferRegisterSerializeFormat to the
target list. All targets are added with the same InfoId. If the boolean
flag is True then deserializable rich text formats will be added,
serializable formats otherwise.
|
|
|
Remove a target from a target list.
|
|
|
Appends a specified target to the list of supported targets for a given
widget and selection.
|
|
|
Remove all targets registered for the given selection for the widget.
|
|
|
Claims ownership of a given selection for a particular widget, or, if
widget is Nothing, release ownership of the selection.
|
|
|
Set the ownership of a given selection and display.
|
|
|
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.
|
|
|
Stores new data in the SelectionDataM monad. The stored data may only
be an array of integer types that are no larger than 32 bits.
|
|
|
Retreives the data in the SelectionDataM monad. The returned array
must have elements of the size that were used to set this data. If
the size or the type tag does not match, Nothing is returned.
|
|
|
Check if the currently stored data is valid.
- If this function returns False, no data is set in this selection
and selectionDataGet will return Nothing no matter what type
is requested.
|
|
|
Sets the contents of the selection from a string. The
string is converted to the form determined by the allowed targets of the
selection.
- Returns True if setting the text was successful.
|
|
|
Gets the contents of the selection data as a string.
|
|
|
Sets the contents of the selection from a Pixbuf. The pixbuf is
converted to the form determined by the allowed targets of the selection.
- Returns True if setting the Pixbuf was successful. Since Gtk 2.6.
|
|
|
Gets the contents of the selection data as a Pixbuf.
|
|
|
Sets the contents of the selection from a list of URIs. The string is
converted to the form determined by the possible targets of the selection.
- Returns True if setting the URIs was successful. Since Gtk 2.6.
|
|
|
Gets the contents of the selection data as list of URIs. Returns
Nothing if the selection did not contain any URIs.
|
|
selectionDataTargetsIncludeImage | Source |
|
:: Bool | whether to accept only targets for which GTK+ knows how to convert a
pixbuf into the format
| -> SelectionDataM Bool | | Given a SelectionDataM holding a list of targets, determines if any of
the targets in targets can be used to provide a Pixbuf.
|
|
|
|
Retrieve the currently set TargetTag in the selection.
|
|
|
Set the selection to the given TargetTag.
|
|
|
Queries the content type of the selection data as a list of targets.
Whenever the application is asked whether certain targets are acceptable,
it is handed a selection that contains a list of TargetTags as payload.
A similar result could be achieved using 'selectionDataGet
selectionTypeAtom'.
|
|
|
Given a SelectionDataM holding a list of targets, determines if any of
the targets in targets can be used to provide text.
|
|
|
Given a SelectionDataM holding a list of targets, determines if any of
the targets in targets can be used to provide URIs.
|
|
|
Given a SelectionDataM holding a list of targets, check if,
well, dunno really. FIXME: what does the TextBuffer do?
|
|
Signals
|
|
|
Emitted in order to ask the application for selection data. Within the
handler the function selectionDataSet or one of its derivatives should be
called.
|
|
|
Pass the supplied selection data to the application. The application is
expected to read the data using selectionDataGet or one of its
derivatives.
|
|
Produced by Haddock version 2.6.1 |