Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ClipboardChangedCallback

[296:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ClipboardChangedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: ClipboardMeta

[366:14] static extends: object

Generated metadata helpers for Clipboard class surfaces.

Methods

  • properties ()

    Returns property metadata for Clipboard.

    • @r A list.
  • signals ()

    Returns signal metadata for Clipboard.

    • @r A list.

class: Clipboard

[23:7] extends: object

Represents data shared between applications or inside an application. To get a GdkClipboard object, use [method@Gdk.Display.get_clipboard] or [method@Gdk.Display.get_primary_clipboard]. You can find out about the data that is currently available in a clipboard using [method@Gdk.Clipboard.get_formats]. To make text or image data available in a clipboard, use [method@Gdk.Clipboard.set_text] or [method@Gdk.Clipboard.set_texture]. For other data, you can use [method@Gdk.Clipboard.set_content], which takes a [class@Gdk.ContentProvider] object. To read textual or image data from a clipboard, use [method@Gdk.Clipboard.read_text_async] or [method@Gdk.Clipboard.read_texture_async]. For other data, use [method@Gdk.Clipboard.read_async], which provides a GInputStream object.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Clipboard (Handle = null)

    Creates a new Clipboard by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnChanged (callback Fn, UserData = null)

    Emitted when the clipboard changes ownership.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Clipboard Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • get_content ()

    Returns the GdkContentProvider currently set on @clipboard. If the

    • @clipboard is empty or its contents are not owned by the current process, %NULL will be returned.
  • get_display ()

    Gets the GdkDisplay that the clipboard was created for.

  • get_formats ()

    Gets the formats that the clipboard can provide its current contents in.

  • is_local ()

    Returns if the clipboard is local. A clipboard is considered local if it was last claimed by the running application. Note that [method@Gdk.Clipboard.get_content] may return %NULL even on a local clipboard. In this case the clipboard is empty.

  • read_text_finish (object result)

    Finishes an asynchronous clipboard read. See [method@Gdk.Clipboard.read_text_async].

    • @p result is a GAsyncResult.
  • read_texture_finish (object result)

    Finishes an asynchronous clipboard read. See [method@Gdk.Clipboard.read_texture_async].

    • @p result is a GAsyncResult.
  • read_value_finish (object result)

    Finishes an asynchronous clipboard read. See [method@Gdk.Clipboard.read_value_async].

    • @p result is a GAsyncResult.
  • set_content (object provider)

    Sets a new content provider on @clipboard. The clipboard will claim the GdkDisplay's resources and advertise these new contents to other applications. In the rare case of a failure, this function will return %FALSE. The clipboard will then continue reporting its old contents and ignore @provider. If the contents are read by either an external application or the @clipboard's read functions, @clipboard will select the best format to transfer the contents and then request that format from @provider.

    • @p provider is the new contents of @clipboard or %NULL to clear the clipboard.
  • set_text (string text)

    Puts the given @text into the clipboard.

    • @p text is Text to put into the clipboard.
    • @r None.
  • set_texture (object texture)

    Puts the given @texture into the clipboard.

    • @p texture is a GdkTexture to put into the clipboard.
    • @r None.
  • set_value (object value)

    Sets the @clipboard to contain the given @value.

    • @p value is a GValue to set.
    • @r None.
  • store_finish (object result)

    Finishes an asynchronous clipboard store. See [method@Gdk.Clipboard.store_async].

    • @p result is a GAsyncResult.