SelectionDataProtocol
public protocol SelectionDataProtocol
The SelectionDataProtocol protocol exposes the methods and properties of an underlying GtkSelectionData instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see SelectionData.
Alternatively, use SelectionDataRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkSelectionDatainstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
selection_data_ptrDefault implementationTyped pointer to the underlying
GtkSelectionDatainstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkSelectionDatainstance.Declaration
Swift
var selection_data_ptr: UnsafeMutablePointer<GtkSelectionData>! { get } -
Required Initialiser for types conforming to
SelectionDataProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
copy()Extension methodMakes a copy of a
GtkSelectionData-structand its data.Declaration
Swift
@inlinable func copy() -> SelectionDataRef! -
free()Extension methodFrees a
GtkSelectionData-structreturned fromgtk_selection_data_copy().Declaration
Swift
@inlinable func free() -
getData()Extension methodRetrieves the raw data of the selection.
Declaration
Swift
@inlinable func getData() -> String! -
getDataType()Extension methodRetrieves the data type of the selection.
Declaration
Swift
@inlinable func getDataType() -> GdkAtom! -
getDataWith(length:Extension method) Retrieves the raw data of the selection along with its length.
Declaration
Swift
@inlinable func getDataWith(length: UnsafeMutablePointer<gint>!) -> String! -
getDisplay()Extension methodRetrieves the display of the selection.
Declaration
Swift
@inlinable func getDisplay() -> Gdk.DisplayRef! -
getFormat()Extension methodRetrieves the format of the selection.
Declaration
Swift
@inlinable func getFormat() -> Int -
getLength()Extension methodRetrieves the length of the raw data of the selection.
Declaration
Swift
@inlinable func getLength() -> Int -
getPixbuf()Extension methodGets the contents of the selection data as a
GdkPixbuf.Declaration
Swift
@inlinable func getPixbuf() -> PixbufRef! -
getSelection()Extension methodRetrieves the selection
GdkAtomof the selection data.Declaration
Swift
@inlinable func getSelection() -> GdkAtom! -
getTarget()Extension methodRetrieves the target of the selection.
Declaration
Swift
@inlinable func getTarget() -> GdkAtom! -
get(targets:Extension methodnAtoms: ) Gets the contents of
selection_dataas 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.Declaration
Swift
@inlinable func get(targets: UnsafeMutablePointer<UnsafeMutablePointer<GdkAtom?>?>!, nAtoms: UnsafeMutablePointer<gint>!) -> Bool -
getText()Extension methodGets the contents of the selection data as a UTF-8 string.
Declaration
Swift
@inlinable func getText() -> String! -
getURIs()Extension methodGets the contents of the selection data as array of URIs.
Declaration
Swift
@inlinable func getURIs() -> UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>! -
set(type:Extension methodformat: data: length: ) Stores new data into a
GtkSelectionDataobject. Should only be called from a selection handler callback. Zero-terminates the stored data.Declaration
Swift
@inlinable func set(type: GdkAtom, format: Int, data: UnsafePointer<guchar>!, length: Int) -
set(pixbuf:Extension method) Sets the contents of the selection from a
GdkPixbufThe pixbuf is converted to the form determined byselection_data->target.Declaration
Swift
@inlinable func set<PixbufT>(pixbuf: PixbufT) -> Bool where PixbufT : PixbufProtocol -
set(text:Extension methodlen: ) Sets the contents of the selection from a UTF-8 encoded string. The string is converted to the form determined by
selection_data->target.Declaration
Swift
@inlinable func set(text str: UnsafePointer<gchar>!, len: Int) -> Bool -
set(uris:Extension method) Sets the contents of the selection from a list of URIs. The string is converted to the form determined by
selection_data->target.Declaration
Swift
@inlinable func set(uris: UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>!) -> Bool -
targetsIncludeImage(writable:Extension method) Given a
GtkSelectionDataobject holding a list of targets, determines if any of the targets intargetscan be used to provide aGdkPixbuf.Declaration
Swift
@inlinable func targetsIncludeImage(writable: Bool) -> Bool -
targetsIncludeRichText(buffer:Extension method) Given a
GtkSelectionDataobject holding a list of targets, determines if any of the targets intargetscan be used to provide rich text.Declaration
Swift
@inlinable func targetsIncludeRichText<TextBufferT>(buffer: TextBufferT) -> Bool where TextBufferT : TextBufferProtocol -
targetsIncludeText()Extension methodGiven a
GtkSelectionDataobject holding a list of targets, determines if any of the targets intargetscan be used to provide text.Declaration
Swift
@inlinable func targetsIncludeText() -> Bool -
targetsIncludeURI()Extension methodGiven a
GtkSelectionDataobject holding a list of targets, determines if any of the targets intargetscan be used to provide a list or URIs.Declaration
Swift
@inlinable func targetsIncludeURI() -> Bool -
treeGetRowDragData(treeModel:Extension methodpath: ) Obtains a
tree_modelandpathfrom selection data of target typeGTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler. This function can only be used ifselection_dataoriginates from the same process that’s calling this function, because a pointer to the tree model is being passed around. If you aren’t in the same process, then you’ll get memory corruption. In theGtkTreeDragDestdrag_data_received handler, you can assume that selection data of typeGTK_TREE_MODEL_ROWis in from the current process. The returned path must be freed withgtk_tree_path_free().Declaration
Swift
@inlinable func treeGetRowDragData(treeModel: UnsafeMutablePointer<UnsafeMutablePointer<GtkTreeModel>?>? = nil, path: UnsafeMutablePointer<UnsafeMutablePointer<GtkTreePath>?>? = nil) -> Bool -
treeSetRowDragData(treeModel:Extension methodpath: ) Sets selection data of target type
GTK_TREE_MODEL_ROW. Normally used in a drag_data_get handler.Declaration
Swift
@inlinable func treeSetRowDragData<TreeModelT, TreePathT>(treeModel: TreeModelT, path: TreePathT) -> Bool where TreeModelT : TreeModelProtocol, TreePathT : TreePathProtocol -
dataExtension methodRetrieves the raw data of the selection.
Declaration
Swift
@inlinable var data: String! { get } -
dataTypeExtension methodRetrieves the data type of the selection.
Declaration
Swift
@inlinable var dataType: GdkAtom! { get } -
displayExtension methodRetrieves the display of the selection.
Declaration
Swift
@inlinable var display: Gdk.DisplayRef! { get } -
formatExtension methodRetrieves the format of the selection.
Declaration
Swift
@inlinable var format: Int { get } -
lengthExtension methodRetrieves the length of the raw data of the selection.
Declaration
Swift
@inlinable var length: Int { get } -
pixbufExtension methodGets the contents of the selection data as a
GdkPixbuf.Declaration
Swift
@inlinable var pixbuf: PixbufRef! { get nonmutating set } -
selectionExtension methodRetrieves the selection
GdkAtomof the selection data.Declaration
Swift
@inlinable var selection: GdkAtom! { get } -
targetExtension methodRetrieves the target of the selection.
Declaration
Swift
@inlinable var target: GdkAtom! { get } -
textExtension methodGets the contents of the selection data as a UTF-8 string.
Declaration
Swift
@inlinable var text: String! { get } -
urisExtension methodGets the contents of the selection data as array of URIs.
Declaration
Swift
@inlinable var uris: UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>! { get nonmutating set }
View on GitHub
Install in Dash
SelectionDataProtocol Protocol Reference