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
GtkSelectionData
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
selection_data_ptr
Default implementationTyped pointer to the underlying
GtkSelectionData
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkSelectionData
instance.Declaration
Swift
var selection_data_ptr: UnsafeMutablePointer<GtkSelectionData>! { get }
-
Required Initialiser for types conforming to
SelectionDataProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
copy()
Extension methodMakes a copy of a
GtkSelectionData-struct
and its data.Declaration
Swift
@inlinable func copy() -> SelectionDataRef!
-
free()
Extension methodFrees a
GtkSelectionData-struct
returned 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
GdkAtom
of 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_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.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
GtkSelectionData
object. 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
GdkPixbuf
The 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
GtkSelectionData
object holding a list of targets, determines if any of the targets intargets
can be used to provide aGdkPixbuf
.Declaration
Swift
@inlinable func targetsIncludeImage(writable: Bool) -> Bool
-
targetsIncludeRichText(buffer:
Extension method) Given a
GtkSelectionData
object holding a list of targets, determines if any of the targets intargets
can be used to provide rich text.Declaration
Swift
@inlinable func targetsIncludeRichText<TextBufferT>(buffer: TextBufferT) -> Bool where TextBufferT : TextBufferProtocol
-
targetsIncludeText()
Extension methodGiven a
GtkSelectionData
object holding a list of targets, determines if any of the targets intargets
can be used to provide text.Declaration
Swift
@inlinable func targetsIncludeText() -> Bool
-
targetsIncludeURI()
Extension methodGiven a
GtkSelectionData
object holding a list of targets, determines if any of the targets intargets
can be used to provide a list or URIs.Declaration
Swift
@inlinable func targetsIncludeURI() -> Bool
-
treeGetRowDragData(treeModel:
Extension methodpath: ) Obtains a
tree_model
andpath
from selection data of target typeGTK_TREE_MODEL_ROW
. Normally called from a drag_data_received handler. This function can only be used ifselection_data
originates 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 theGtkTreeDragDest
drag_data_received handler, you can assume that selection data of typeGTK_TREE_MODEL_ROW
is 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
-
data
Extension methodRetrieves the raw data of the selection.
Declaration
Swift
@inlinable var data: String! { get }
-
dataType
Extension methodRetrieves the data type of the selection.
Declaration
Swift
@inlinable var dataType: GdkAtom! { get }
-
display
Extension methodRetrieves the display of the selection.
Declaration
Swift
@inlinable var display: Gdk.DisplayRef! { get }
-
format
Extension methodRetrieves the format of the selection.
Declaration
Swift
@inlinable var format: Int { get }
-
length
Extension methodRetrieves the length of the raw data of the selection.
Declaration
Swift
@inlinable var length: Int { get }
-
pixbuf
Extension methodGets the contents of the selection data as a
GdkPixbuf
.Declaration
Swift
@inlinable var pixbuf: PixbufRef! { get nonmutating set }
-
selection
Extension methodRetrieves the selection
GdkAtom
of the selection data.Declaration
Swift
@inlinable var selection: GdkAtom! { get }
-
target
Extension methodRetrieves the target of the selection.
Declaration
Swift
@inlinable var target: GdkAtom! { get }
-
text
Extension methodGets the contents of the selection data as a UTF-8 string.
Declaration
Swift
@inlinable var text: String! { get }
-
uris
Extension methodGets the contents of the selection data as array of URIs.
Declaration
Swift
@inlinable var uris: UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>! { get nonmutating set }