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 is an implementation of GAppLaunchContext that
handles launching an application in a graphical context. It provides
startup notification and allows to launch applications on a specific
screen or workspace.
Launching an application
(C Language Example):
GdkAppLaunchContext *context;
context = gdk_display_get_app_launch_context (display);
gdk_app_launch_context_set_screen (screen);
gdk_app_launch_context_set_timestamp (event->time);
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);
-
Untyped pointer to the underlying
GdkAppLaunchContextinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
app_launch_context_ptrDefault implementationTyped pointer to the underlying
GdkAppLaunchContextinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkAppLaunchContextinstance.Declaration
Swift
var app_launch_context_ptr: UnsafeMutablePointer<GdkAppLaunchContext>! { get } -
Required Initialiser for types conforming to
AppLaunchContextProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
AppLaunchContextPropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a AppLaunchContext property
Declaration
Swift
@inlinable func get(property: AppLaunchContextPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) 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
propertythe property to get the value for
Return Value
the value of the named property
-
set(desktop:Extension method) Sets the workspace on which applications will be launched when using this context 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
desktopis 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(display:Extension method) Sets the display on which applications will be launched when using this context. See also
gdk_app_launch_context_set_screen().set_display is deprecated: Use gdk_display_get_app_launch_context() instead
Declaration
Swift
@available(*, deprecated) @inlinable func set<DisplayT>(display: DisplayT) where DisplayT : DisplayProtocol -
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
gdk_app_launch_context_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
gdk_app_launch_context_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_namewill be interpreted in the same way as the Icon field in desktop files. See alsogdk_app_launch_context_set_icon().If both
iconandicon_nameare set, theicon_nametakes priority. If neithericonoricon_nameis set, the icon is taken from either the file that is passed to launched application or from theGAppInfofor the launched application itself.Declaration
Swift
@inlinable func set(iconName: UnsafePointer<CChar>? = nil) -
set(screen:Extension method) Sets the screen on which applications will be launched when using this context. See also
gdk_app_launch_context_set_display().If both
screenanddisplayare set, thescreentakes priority. If neitherscreenordisplayare set, the default screen and display are used.Declaration
Swift
@inlinable func set<ScreenT>(screen: ScreenT) where ScreenT : ScreenProtocol -
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)
View on GitHub
Install in Dash
AppLaunchContextProtocol Protocol Reference