AppLaunchContextProtocol

public protocol AppLaunchContextProtocol : AppLaunchContextProtocol

The AppLaunchContextProtocol protocol exposes the methods and properties of an underlying GdkAppLaunchContext 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 AppLaunchContext. Alternatively, use AppLaunchContextRef as a lighweight, unowned reference if you already have an instance you just want to use.

GdkAppLaunchContext handles launching an application in a graphical context.

It is an implementation of GAppLaunchContext that provides startup notification and allows to launch applications on a specific screen or workspace.

Launching an application

GdkAppLaunchContext *context;

context = gdk_display_get_app_launch_context (display);

gdk_app_launch_context_set_display (display);
gdk_app_launch_context_set_timestamp (gdk_event_get_time (event));

if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
  g_warning ("Launching failed: `s`\n", error->message);

g_object_unref (context);
  • ptr

    Untyped pointer to the underlying GdkAppLaunchContext instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GdkAppLaunchContext instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GdkAppLaunchContext instance.

    Declaration

    Swift

    var app_launch_context_ptr: UnsafeMutablePointer<GdkAppLaunchContext>! { get }
  • Required Initialiser for types conforming to AppLaunchContextProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

AppLaunchContext Class

  • Bind a AppLaunchContextPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: AppLaunchContextPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a AppLaunchContext property

    Declaration

    Swift

    @inlinable
    func get(property: AppLaunchContextPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a AppLaunchContext property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: AppLaunchContextPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

AppLaunchContext Class: AppLaunchContextProtocol extension (methods and fields)

  • getDisplay() Extension method

    Gets the GdkDisplay that context is for.

    Declaration

    Swift

    @inlinable
    func getDisplay() -> DisplayRef!
  • set(desktop:) Extension method

    Sets the workspace on which applications will be launched.

    This only works when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints.

    When the workspace is not specified or desktop is set to -1, it is up to the window manager to pick one, typically it will be the current workspace.

    Declaration

    Swift

    @inlinable
    func set(desktop: Int)
  • set(icon:) Extension method

    Sets the icon for applications that are launched with this context.

    Window Managers can use this information when displaying startup notification.

    See also [methodGdk.AppLaunchContext.set_icon_name].

    Declaration

    Swift

    @inlinable
    func set(icon: GIO.IconRef? = nil)
  • set(icon:) Extension method

    Sets the icon for applications that are launched with this context.

    Window Managers can use this information when displaying startup notification.

    See also [methodGdk.AppLaunchContext.set_icon_name].

    Declaration

    Swift

    @inlinable
    func set<IconT>(icon: IconT?) where IconT : IconProtocol
  • set(iconName:) Extension method

    Sets the icon for applications that are launched with this context.

    The icon_name will be interpreted in the same way as the Icon field in desktop files. See also [methodGdk.AppLaunchContext.set_icon()].

    If both icon and icon_name are set, the icon_name takes priority. If neither icon or icon_name is set, the icon is taken from either the file that is passed to launched application or from the GAppInfo for the launched application itself.

    Declaration

    Swift

    @inlinable
    func set(iconName: UnsafePointer<CChar>? = nil)
  • set(timestamp:) Extension method

    Sets the timestamp of context.

    The timestamp should ideally be taken from the event that triggered the launch.

    Window managers can use this information to avoid moving the focus to the newly launched application when the user is busy typing in another window. This is also known as ‘focus stealing prevention’.

    Declaration

    Swift

    @inlinable
    func set(timestamp: guint32)
  • display Extension method

    The display that the GdkAppLaunchContext is on.

    Declaration

    Swift

    @inlinable
    var display: DisplayRef! { get }