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.

  • ptr

    Untyped pointer to the underlying GtkSelectionData instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • selection_data_ptr Default implementation

    Typed 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)

SelectionData Record: SelectionDataProtocol extension (methods and fields)

  • copy() Extension method

    Makes a copy of a GtkSelectionData-struct and its data.

    Declaration

    Swift

    @inlinable
    func copy() -> SelectionDataRef!
  • free() Extension method

    Frees a GtkSelectionData-struct returned from gtk_selection_data_copy().

    Declaration

    Swift

    @inlinable
    func free()
  • getData() Extension method

    Retrieves the raw data of the selection.

    Declaration

    Swift

    @inlinable
    func getData() -> String!
  • getDataType() Extension method

    Retrieves 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 method

    Retrieves the display of the selection.

    Declaration

    Swift

    @inlinable
    func getDisplay() -> Gdk.DisplayRef!
  • getFormat() Extension method

    Retrieves the format of the selection.

    Declaration

    Swift

    @inlinable
    func getFormat() -> Int
  • getLength() Extension method

    Retrieves the length of the raw data of the selection.

    Declaration

    Swift

    @inlinable
    func getLength() -> Int
  • getPixbuf() Extension method

    Gets the contents of the selection data as a GdkPixbuf.

    Declaration

    Swift

    @inlinable
    func getPixbuf() -> PixbufRef!
  • getSelection() Extension method

    Retrieves the selection GdkAtom of the selection data.

    Declaration

    Swift

    @inlinable
    func getSelection() -> GdkAtom!
  • getTarget() Extension method

    Retrieves the target of the selection.

    Declaration

    Swift

    @inlinable
    func getTarget() -> GdkAtom!
  • get(targets:nAtoms:) Extension method

    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 method

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

    Declaration

    Swift

    @inlinable
    func getText() -> String!
  • getURIs() Extension method

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

    Declaration

    Swift

    @inlinable
    func getURIs() -> UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>!
  • 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 by selection_data->target.

    Declaration

    Swift

    @inlinable
    func set<PixbufT>(pixbuf: PixbufT) -> Bool where PixbufT : PixbufProtocol
  • set(text:len:) Extension method

    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
  • Given a GtkSelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide a GdkPixbuf.

    Declaration

    Swift

    @inlinable
    func targetsIncludeImage(writable: Bool) -> Bool
  • Given a GtkSelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide rich text.

    Declaration

    Swift

    @inlinable
    func targetsIncludeRichText<TextBufferT>(buffer: TextBufferT) -> Bool where TextBufferT : TextBufferProtocol
  • targetsIncludeText() Extension method

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

    Declaration

    Swift

    @inlinable
    func targetsIncludeText() -> Bool
  • targetsIncludeURI() Extension method

    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.

    Declaration

    Swift

    @inlinable
    func targetsIncludeURI() -> Bool
  • Obtains a tree_model and path from selection data of target type GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler. This function can only be used if selection_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 the GtkTreeDragDest drag_data_received handler, you can assume that selection data of type GTK_TREE_MODEL_ROW is in from the current process. The returned path must be freed with gtk_tree_path_free().

    Declaration

    Swift

    @inlinable
    func treeGetRowDragData(treeModel: UnsafeMutablePointer<UnsafeMutablePointer<GtkTreeModel>?>? = nil, path: UnsafeMutablePointer<UnsafeMutablePointer<GtkTreePath>?>? = nil) -> Bool
  • 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 method

    Retrieves the raw data of the selection.

    Declaration

    Swift

    @inlinable
    var data: String! { get }
  • dataType Extension method

    Retrieves the data type of the selection.

    Declaration

    Swift

    @inlinable
    var dataType: GdkAtom! { get }
  • display Extension method

    Retrieves the display of the selection.

    Declaration

    Swift

    @inlinable
    var display: Gdk.DisplayRef! { get }
  • format Extension method

    Retrieves the format of the selection.

    Declaration

    Swift

    @inlinable
    var format: Int { get }
  • length Extension method

    Retrieves the length of the raw data of the selection.

    Declaration

    Swift

    @inlinable
    var length: Int { get }
  • pixbuf Extension method

    Gets the contents of the selection data as a GdkPixbuf.

    Declaration

    Swift

    @inlinable
    var pixbuf: PixbufRef! { get nonmutating set }
  • selection Extension method

    Retrieves the selection GdkAtom of the selection data.

    Declaration

    Swift

    @inlinable
    var selection: GdkAtom! { get }
  • target Extension method

    Retrieves the target of the selection.

    Declaration

    Swift

    @inlinable
    var target: GdkAtom! { get }
  • text Extension method

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

    Declaration

    Swift

    @inlinable
    var text: String! { get }
  • uris Extension method

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

    Declaration

    Swift

    @inlinable
    var uris: UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>! { get nonmutating set }