Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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.
Synopsis
- newtype AppLaunchContext = AppLaunchContext (ManagedPtr AppLaunchContext)
- class (GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o
- toAppLaunchContext :: (MonadIO m, IsAppLaunchContext o) => o -> m AppLaunchContext
- appLaunchContextGetDisplay :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsAppInfo b, IsFile c) => a -> b -> [c] -> m (Maybe Text)
- appLaunchContextGetEnvironment :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> m [[Char]]
- appLaunchContextGetStartupNotifyId :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsAppInfo b, IsFile c) => a -> b -> [c] -> m (Maybe Text)
- appLaunchContextLaunchFailed :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Text -> m ()
- appLaunchContextNew :: (HasCallStack, MonadIO m) => m AppLaunchContext
- appLaunchContextSetenv :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> [Char] -> [Char] -> m ()
- appLaunchContextUnsetenv :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> [Char] -> m ()
- type AppLaunchContextLaunchFailedCallback = Text -> IO ()
- afterAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchFailedCallback) -> m SignalHandlerId
- onAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchFailedCallback) -> m SignalHandlerId
- type AppLaunchContextLaunchStartedCallback = AppInfo -> Maybe GVariant -> IO ()
- afterAppLaunchContextLaunchStarted :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchStartedCallback) -> m SignalHandlerId
- onAppLaunchContextLaunchStarted :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchStartedCallback) -> m SignalHandlerId
- type AppLaunchContextLaunchedCallback = AppInfo -> GVariant -> IO ()
- afterAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchedCallback) -> m SignalHandlerId
- onAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchedCallback) -> m SignalHandlerId
Exported types
newtype AppLaunchContext Source #
Memory-managed wrapper type.
Instances
Eq AppLaunchContext Source # | |
Defined in GI.Gio.Objects.AppLaunchContext (==) :: AppLaunchContext -> AppLaunchContext -> Bool # (/=) :: AppLaunchContext -> AppLaunchContext -> Bool # | |
GObject AppLaunchContext Source # | |
Defined in GI.Gio.Objects.AppLaunchContext | |
ManagedPtrNewtype AppLaunchContext Source # | |
Defined in GI.Gio.Objects.AppLaunchContext | |
TypedObject AppLaunchContext Source # | |
Defined in GI.Gio.Objects.AppLaunchContext | |
HasParentTypes AppLaunchContext Source # | |
Defined in GI.Gio.Objects.AppLaunchContext | |
IsGValue (Maybe AppLaunchContext) Source # | Convert |
Defined in GI.Gio.Objects.AppLaunchContext gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe AppLaunchContext -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe AppLaunchContext) # | |
type ParentTypes AppLaunchContext Source # | |
Defined in GI.Gio.Objects.AppLaunchContext type ParentTypes AppLaunchContext = '[Object] |
class (GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o Source #
Type class for types which can be safely cast to AppLaunchContext
, for instance with toAppLaunchContext
.
Instances
(GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o Source # | |
Defined in GI.Gio.Objects.AppLaunchContext |
toAppLaunchContext :: (MonadIO m, IsAppLaunchContext o) => o -> m AppLaunchContext Source #
Cast to AppLaunchContext
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, launchFailed, notify, notifyByPspec, ref, refSink, runDispose, setenv, stealData, stealQdata, thawNotify, unref, unsetenv, watchClosure.
Getters
getData, getDisplay, getEnvironment, getProperty, getQdata, getStartupNotifyId.
Setters
getDisplay
appLaunchContextGetDisplay Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsAppInfo b, IsFile c) | |
=> a |
|
-> b |
|
-> [c] | |
-> m (Maybe Text) | Returns: a display string for the display. |
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.
getEnvironment
appLaunchContextGetEnvironment Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> m [[Char]] | Returns: the child's 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 Nothing
-terminated array of strings, where each string has
the form KEY=VALUE
.
Since: 2.32
getStartupNotifyId
appLaunchContextGetStartupNotifyId Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsAppInfo b, IsFile c) | |
=> a |
|
-> b |
|
-> [c] | |
-> m (Maybe Text) | Returns: a startup notification ID for the application, or |
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.
launchFailed
appLaunchContextLaunchFailed Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> Text |
|
-> m () |
Called when an application has failed to launch, so that it can cancel
the application startup notification started in appLaunchContextGetStartupNotifyId
.
new
:: (HasCallStack, MonadIO m) | |
=> m AppLaunchContext | Returns: a |
Creates a new application launch context. This is not normally used,
instead you instantiate a subclass of this, such as GdkAppLaunchContext
.
setenv
appLaunchContextSetenv Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> [Char] |
|
-> [Char] |
|
-> m () |
Arranges for variable
to be set to value
in the child's
environment when context
is used to launch an application.
Since: 2.32
unsetenv
appLaunchContextUnsetenv Source #
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> a |
|
-> [Char] |
|
-> m () |
Arranges for variable
to be unset in the child's environment
when context
is used to launch an application.
Since: 2.32
Signals
launchFailed
type AppLaunchContextLaunchFailedCallback Source #
The AppLaunchContext::launchFailed signal is emitted when a 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.
Since: 2.36
afterAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchFailedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the launchFailed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appLaunchContext #launchFailed callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchFailedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the launchFailed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appLaunchContext #launchFailed callback
launchStarted
type AppLaunchContextLaunchStartedCallback Source #
= AppInfo |
|
-> Maybe GVariant |
|
-> IO () |
The AppLaunchContext::launchStarted signal is emitted when a AppInfo
is
about to be launched. If non-null the platformData
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 <https://specifications.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt startup-notification
specification>.
It allows tracking the progress of the launchee through startup.
It is guaranteed that this signal is followed by either a AppLaunchContext::launched or AppLaunchContext::launchFailed 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.
Since: 2.72
afterAppLaunchContextLaunchStarted :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchStartedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the launchStarted signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appLaunchContext #launchStarted callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppLaunchContextLaunchStarted :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchStartedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the launchStarted signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appLaunchContext #launchStarted callback
launched
type AppLaunchContextLaunchedCallback Source #
= AppInfo |
|
-> GVariant |
|
-> IO () |
The AppLaunchContext::launched signal is emitted when a 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 platformData
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
AppLaunchContext::launched signal emission; after the signal is emitted,
GLib will call spawnClosePid
. If you need to keep the GPid
after the
signal has been emitted, then you can duplicate pid
using DuplicateHandle()
.
Since: 2.36
afterAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the launched signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appLaunchContext #launched callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => a -> ((?self :: a) => AppLaunchContextLaunchedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the launched signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appLaunchContext #launched callback