Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: DeviceChangedCallback

[393:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DeviceChangedCallback (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: Device

[17:7] extends: object

Represents an input device, such as a keyboard, mouse or touchpad. See the [class@Gdk.Seat] documentation for more information about the various kinds of devices, and their relationships.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Device (Handle = null)

    Creates a new Device 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 either when the number of either axes or keys changes. On X11 this will normally happen when the physical device routing events through the logical device changes (for example, user switches from the USB mouse to a tablet); in that case the logical device will change to reflect the axes and keys on the new physical device.

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

    Emitted on pen/eraser devices whenever tools enter or leave proximity.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Device Self, DeviceTool Tool).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setSeat (object Value)

    GdkSeat of this device.

    • @p Value is the new property value.
    • @r None.
  • get_active_layout_index ()

    Retrieves the index of the active layout of the keyboard. If there is no valid active layout for the GdkDevice, this function will return -1; This is only relevant for keyboard devices.

    • @r The layout index of the active layout or -1..
  • get_caps_lock_state ()

    Retrieves whether the Caps Lock modifier of the keyboard is locked. This is only relevant for keyboard devices.

    • @r %TRUE if Caps Lock is on for @device.
  • get_device_tool ()

    Retrieves the current tool for @device.

    • @r the GdkDeviceTool.
  • get_direction ()

    Returns the direction of effective layout of the keyboard. This is only relevant for keyboard devices. The direction of a layout is the direction of the majority of its symbols. See [func@Pango.unichar_direction].

    • @r %PANGO_DIRECTION_LTR or %PANGO_DIRECTION_RTL if it can determine the direction. %PANGO_DIRECTION_NEUTRAL otherwise.
  • get_display ()

    Returns the GdkDisplay to which @device pertains.

    • @r a GdkDisplay.
  • get_has_cursor ()

    Determines whether the pointer follows device motion. This is not meaningful for keyboard devices, which don't have a pointer.

    • @r %TRUE if the pointer follows device motion.
  • get_layout_names ()

    Retrieves the names of the layouts of the keyboard. This is only relevant for keyboard devices.

    • @r %NULL-terminated array of strings of layouts,.
  • get_modifier_state ()

    Retrieves the current modifier state of the keyboard. This is only relevant for keyboard devices.

    • @r the current modifier state.
  • get_name ()

    The name of the device, suitable for showing in a user interface.

    • @r a name.
  • get_num_lock_state ()

    Retrieves whether the Num Lock modifier of the keyboard is locked. This is only relevant for keyboard devices.

    • @r %TRUE if Num Lock is on for @device.
  • get_num_touches ()

    Retrieves the number of touch points associated to @device.

    • @r the number of touch points.
  • get_product_id ()

    Returns the product ID of this device. This ID is retrieved from the device, and does not change. See [method@Gdk.Device.get_vendor_id] for more information.

    • @r the product ID.
  • get_scroll_lock_state ()

    Retrieves whether the Scroll Lock modifier of the keyboard is locked. This is only relevant for keyboard devices.

    • @r %TRUE if Scroll Lock is on for @device.
  • get_seat ()

    Returns the GdkSeat the device belongs to.

    • @r a GdkSeat.
  • get_source ()

    Determines the type of the device.

    • @r a GdkInputSource.
  • get_vendor_id ()

    Returns the vendor ID of this device. This ID is retrieved from the device, and does not change. This function, together with [method@Gdk.Device.get_product_id], can be used to eg. compose GSettings paths to store settings for this device. c static GSettings * get_device_settings (GdkDevice *device) { const char *vendor, *product; GSettings *settings; GdkDevice *device; char *path; vendor = gdk_device_get_vendor_id (device); product = gdk_device_get_product_id (device); path = g_strdup_printf ("/org/example/app/devices/%s:%s/", vendor, product); settings = g_settings_new_with_path (DEVICE_SCHEMA, path); g_free (path); return settings; }

    • @r the vendor ID.
  • has_bidi_layouts ()

    Determines if layouts for both right-to-left and left-to-right languages are in use on the keyboard. This is only relevant for keyboard devices.

    • @r %TRUE if there are layouts with both directions, %FALSE otherwise.

class: DeviceMeta

[534:14] static extends: object

Generated metadata helpers for Device class surfaces.

Methods

  • properties ()

    Returns property metadata for Device.

    • @r A list.
  • signals ()

    Returns signal metadata for Device.

    • @r A list.

class: DeviceToolchangedCallback

[463:7] extends: object

Generated low-level callback wrapper for GIR callback tool-changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DeviceToolchangedCallback (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, tool, 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.