Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: AppLaunchContextLaunchstartedCallback

[384:7] extends: object

Generated low-level callback wrapper for GIR callback launch-started.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • AppLaunchContextLaunchstartedCallback (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, info, platform_data, 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: AppLaunchContext

[14:7] extends: object

Integrating the launch with the launching application. This is used to handle for instance startup notification and launching the new application on the same screen as the launching window.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • AppLaunchContext ()

    Creates a new application launch context. This is not normally used, instead you instantiate a subclass of this, such as GdkAppLaunchContext.

  • 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.
  • setOnLaunchfailed (callback Fn, UserData = null)

    The [signal@Gio.AppLaunchContext::launch-failed] signal is emitted when a [iface@Gio.AppInfo] launch fails. The startup notification id is provided, so that the launcher can cancel the startup notification. Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one for each spawned instance.

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

    The [signal@Gio.AppLaunchContext::launch-started] signal is emitted when a [iface@Gio.AppInfo] is about to be launched. If non-null the

    • @platform_data is an GVariant dictionary mapping strings to variants (ie a{sv}), which contains additional, platform-specific data about this launch. On UNIX, at least the startup-notification-id keys will be present. The value of the startup-notification-id key (type s) is a startup notification ID corresponding to the format from the startup-notification specification. It allows tracking the progress of the launchee through startup. It is guaranteed that this signal is followed by either a [signal@Gio.AppLaunchContext::launched] or [signal@Gio.AppLaunchContext::launch-failed] signal. Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one for each spawned instance.
    • @p Fn is the Aussom callback.
    • @p Fn is called with (AppLaunchContext Self, AppInfo Info, Variant Platform_data).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnLaunched (callback Fn, UserData = null)

    The [signal@Gio.AppLaunchContext::launched] signal is emitted when a [iface@Gio.AppInfo] is successfully launched. Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one time for each spawned instance. The @platform_data is an GVariant dictionary mapping strings to variants (ie a{sv}), which contains additional, platform-specific data about this launch. On UNIX, at least the pid and startup-notification-id keys will be present. Since 2.72 the pid may be 0 if the process id wasn’t known (for example if the process was launched via D-Bus). The pid may not be set at all in subsequent releases. On Windows, pid is guaranteed to be valid only for the duration of the [signal@Gio.AppLaunchContext::launched] signal emission; after the signal is emitted, GLib will call [func@GLib.spawn_close_pid]. If you need to keep the [alias@GLib.Pid] after the signal has been emitted, then you can duplicate pid using DuplicateHandle().

    • @p Fn is the Aussom callback.
    • @p Fn is called with (AppLaunchContext Self, AppInfo Info, Variant Platform_data).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • get_display (object info, object files)

    Gets the display string for the @context. This is used to ensure new applications are started on the same display as the launching application, by setting the DISPLAY environment variable.

    • @p info is the app info.
    • @p files is a list of [iface@Gio.File] objects.
  • get_environment ()

    Gets the complete environment variable list to be passed to the child process when @context is used to launch an application. This is a NULL-terminated array of strings, where each string has the form KEY=VALUE.

  • get_startup_notify_id (object info, object files)

    Initiates startup notification for the application and returns the XDG_ACTIVATION_TOKEN or DESKTOP_STARTUP_ID for the launched operation, if supported. The returned token may be referred to equivalently as an ‘activation token’ (using Wayland terminology) or a ‘startup sequence ID’ (using X11 terminology). The two are interoperable. Activation tokens are defined in the XDG Activation Protocol, and startup notification IDs are defined in the freedesktop.org Startup Notification Protocol. Support for the XDG Activation Protocol was added in GLib 2.76. Since GLib 2.82 @info and @files can be NULL. If that’s not supported by the backend, the returned token will be NULL.

    • @p info is the app info.
    • @p files is a list of [iface@Gio.File] objects.
  • launch_failed (string startup_notify_id)

    Called when an application has failed to launch, so that it can cancel the application startup notification started in [method@Gio.AppLaunchContext.get_startup_notify_id].

    • @p startup_notify_id is the startup notification id that was returned by [method@Gio.AppLaunchContext.get_startup_notify_id]..
    • @r None.
  • setenv (string variable, string value)

    Arranges for @variable to be set to @value in the child’s environment when @context is used to launch an application.

    • @p variable is the environment variable to set.
    • @p value is the value for to set the variable to..
    • @r None.
  • unsetenv (string variable)

    Arranges for @variable to be unset in the child’s environment when

    • @context is used to launch an application.
    • @p variable is the environment variable to remove.
    • @r None.

class: AppLaunchContextLaunchfailedCallback

[314:7] extends: object

Generated low-level callback wrapper for GIR callback launch-failed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • AppLaunchContextLaunchfailedCallback (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, startup_notify_id, 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: AppLaunchContextLaunchedCallback

[456:7] extends: object

Generated low-level callback wrapper for GIR callback launched.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • AppLaunchContextLaunchedCallback (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, info, platform_data, 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: AppLaunchContextMeta

[528:14] static extends: object

Generated metadata helpers for AppLaunchContext class surfaces.

Methods

  • signals ()

    Returns signal metadata for AppLaunchContext.

    • @r A list.