ClipboardProtocol
public protocol ClipboardProtocol : ObjectProtocol
The ClipboardProtocol
protocol exposes the methods and properties of an underlying GtkClipboard
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 Clipboard
.
Alternatively, use ClipboardRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkClipboard
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
clipboard_ptr
Default implementationTyped pointer to the underlying
GtkClipboard
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkClipboard
instance.Declaration
Swift
var clipboard_ptr: UnsafeMutablePointer<GtkClipboard>! { get }
-
Required Initialiser for types conforming to
ClipboardProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
ClipboardSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ClipboardSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
ClipboardSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ClipboardSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onOwnerChange(flags:
Extension methodhandler: ) Note
This represents the underlyingowner-change
signalDeclaration
Swift
@discardableResult @inlinable func onOwnerChange(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ClipboardRef, _ event: Gdk.EventOwnerChangeRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
event
none
handler
The signal handler to call Run the given callback whenever the
ownerChange
signal is emitted -
ownerChangeSignal
Extension methodTyped
owner-change
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var ownerChangeSignal: ClipboardSignalName { get }
-
clear()
Extension methodUndocumented
Declaration
Swift
@inlinable func clear()
-
getDisplay()
Extension methodUndocumented
Declaration
Swift
@inlinable func getDisplay() -> Gdk.DisplayRef!
-
getOwner()
Extension methodUndocumented
Declaration
Swift
@inlinable func getOwner() -> GLibObject.ObjectRef!
-
getSelection()
Extension methodUndocumented
Declaration
Swift
@inlinable func getSelection() -> GdkAtom!
-
requestContents(target:
Extension methodcallback: userData: ) Undocumented
Declaration
Swift
@inlinable func requestContents(target: GdkAtom, callback: GtkClipboardReceivedFunc?, userData: gpointer! = nil)
-
requestImage(callback:
Extension methoduserData: ) Undocumented
Declaration
Swift
@inlinable func requestImage(callback: GtkClipboardImageReceivedFunc?, userData: gpointer! = nil)
-
requestRichText(buffer:
Extension methodcallback: userData: ) Undocumented
Declaration
Swift
@inlinable func requestRichText<TextBufferT>(buffer: TextBufferT, callback: GtkClipboardRichTextReceivedFunc?, userData: gpointer! = nil) where TextBufferT : TextBufferProtocol
-
requestTargets(callback:
Extension methoduserData: ) Undocumented
Declaration
Swift
@inlinable func requestTargets(callback: GtkClipboardTargetsReceivedFunc?, userData: gpointer! = nil)
-
requestText(callback:
Extension methoduserData: ) Undocumented
Declaration
Swift
@inlinable func requestText(callback: GtkClipboardTextReceivedFunc?, userData: gpointer! = nil)
-
requestURIs(callback:
Extension methoduserData: ) Undocumented
Declaration
Swift
@inlinable func requestURIs(callback: GtkClipboardURIReceivedFunc?, userData: gpointer! = nil)
-
setCanStore(targets:
Extension methodnTargets: ) Undocumented
Declaration
Swift
@inlinable func setCanStore(targets: UnsafePointer<GtkTargetEntry>! = nil, nTargets: Int)
-
setImage(pixbuf:
Extension method) Undocumented
Declaration
Swift
@inlinable func setImage<PixbufT>(pixbuf: PixbufT) where PixbufT : PixbufProtocol
-
set(text:
Extension methodlen: ) Undocumented
Declaration
Swift
@inlinable func set(text: UnsafePointer<gchar>!, len: Int)
-
setWithData(targets:
Extension methodnTargets: getFunc: clearFunc: userData: ) Undocumented
Declaration
Swift
@inlinable func setWithData(targets: UnsafePointer<GtkTargetEntry>!, nTargets: Int, getFunc: GtkClipboardGetFunc?, clearFunc: GtkClipboardClearFunc?, userData: gpointer! = nil) -> Bool
-
setWithOwner(targets:
Extension methodnTargets: getFunc: clearFunc: owner: ) Undocumented
Declaration
Swift
@inlinable func setWithOwner<ObjectT>(targets: UnsafePointer<GtkTargetEntry>!, nTargets: Int, getFunc: GtkClipboardGetFunc?, clearFunc: GtkClipboardClearFunc?, owner: ObjectT) -> Bool where ObjectT : ObjectProtocol
-
store()
Extension methodUndocumented
Declaration
Swift
@inlinable func store()
-
waitForContents(target:
Extension method) Undocumented
Declaration
Swift
@inlinable func waitForContents(target: GdkAtom) -> SelectionDataRef!
-
waitForImage()
Extension methodUndocumented
Declaration
Swift
@inlinable func waitForImage() -> PixbufRef!
-
waitForRichText(buffer:
Extension methodformat: length: ) Undocumented
Declaration
Swift
@inlinable func waitForRichText<TextBufferT>(buffer: TextBufferT, format: UnsafeMutablePointer<GdkAtom?>, length: UnsafeMutablePointer<gsize>!) -> UnsafeMutablePointer<guint8>? where TextBufferT : TextBufferProtocol
-
waitFor(targets:
Extension methodnTargets: ) Returns a list of targets that are present on the clipboard, or
nil
if there aren’t any targets available. The returned list must be freed withg_free()
. This function waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait.Declaration
Swift
@inlinable func waitFor(targets: UnsafeMutablePointer<UnsafeMutablePointer<GdkAtom?>?>!, nTargets: UnsafeMutablePointer<gint>!) -> Bool
-
waitForText()
Extension methodUndocumented
Declaration
Swift
@inlinable func waitForText() -> String!
-
waitForURIs()
Extension methodUndocumented
Declaration
Swift
@inlinable func waitForURIs() -> UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>!
-
waitIsImageAvailable()
Extension methodUndocumented
Declaration
Swift
@inlinable func waitIsImageAvailable() -> Bool
-
waitIsRichTextAvailable(buffer:
Extension method) Undocumented
Declaration
Swift
@inlinable func waitIsRichTextAvailable<TextBufferT>(buffer: TextBufferT) -> Bool where TextBufferT : TextBufferProtocol
-
waitIsTargetAvailable(target:
Extension method) Undocumented
Declaration
Swift
@inlinable func waitIsTargetAvailable(target: GdkAtom) -> Bool
-
waitIsTextAvailable()
Extension methodUndocumented
Declaration
Swift
@inlinable func waitIsTextAvailable() -> Bool
-
waitIsURIsAvailable()
Extension methodUndocumented
Declaration
Swift
@inlinable func waitIsURIsAvailable() -> Bool
-
display
Extension methodUndocumented
Declaration
Swift
@inlinable var display: Gdk.DisplayRef! { get }
-
owner
Extension methodUndocumented
Declaration
Swift
@inlinable var owner: GLibObject.ObjectRef! { get }
-
selection
Extension methodUndocumented
Declaration
Swift
@inlinable var selection: GdkAtom! { get }