gi-gio-2.0.27: Gio bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.AppLaunchContext

Contents

- Exported types
- Methods
  - Overloaded methods
  - getDisplay
  - getEnvironment
  - getStartupNotifyId
  - launchFailed
  - new
  - setenv
  - unsetenv
- Signals
  - launchFailed
  - launched

Description

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 Text
- appLaunchContextGetEnvironment :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> m [[Char]]
- appLaunchContextGetStartupNotifyId :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsAppInfo b, IsFile c) => a -> b -> [c] -> m 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 ()
- type C_AppLaunchContextLaunchFailedCallback = Ptr () -> CString -> Ptr () -> IO ()
- afterAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => a -> AppLaunchContextLaunchFailedCallback -> m SignalHandlerId
- genClosure_AppLaunchContextLaunchFailed :: MonadIO m => AppLaunchContextLaunchFailedCallback -> m (GClosure C_AppLaunchContextLaunchFailedCallback)
- mk_AppLaunchContextLaunchFailedCallback :: C_AppLaunchContextLaunchFailedCallback -> IO (FunPtr C_AppLaunchContextLaunchFailedCallback)
- noAppLaunchContextLaunchFailedCallback :: Maybe AppLaunchContextLaunchFailedCallback
- onAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => a -> AppLaunchContextLaunchFailedCallback -> m SignalHandlerId
- wrap_AppLaunchContextLaunchFailedCallback :: AppLaunchContextLaunchFailedCallback -> C_AppLaunchContextLaunchFailedCallback
- type AppLaunchContextLaunchedCallback = AppInfo -> GVariant -> IO ()
- type C_AppLaunchContextLaunchedCallback = Ptr () -> Ptr AppInfo -> Ptr GVariant -> Ptr () -> IO ()
- afterAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => a -> AppLaunchContextLaunchedCallback -> m SignalHandlerId
- genClosure_AppLaunchContextLaunched :: MonadIO m => AppLaunchContextLaunchedCallback -> m (GClosure C_AppLaunchContextLaunchedCallback)
- mk_AppLaunchContextLaunchedCallback :: C_AppLaunchContextLaunchedCallback -> IO (FunPtr C_AppLaunchContextLaunchedCallback)
- noAppLaunchContextLaunchedCallback :: Maybe AppLaunchContextLaunchedCallback
- onAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => a -> AppLaunchContextLaunchedCallback -> m SignalHandlerId
- wrap_AppLaunchContextLaunchedCallback :: AppLaunchContextLaunchedCallback -> C_AppLaunchContextLaunchedCallback

# Exported types

newtype AppLaunchContext Source #

Memory-managed wrapper type.

Constructors

AppLaunchContext (ManagedPtr AppLaunchContext) |

#### Instances

Instances details

Eq AppLaunchContext Source # |
Instance details Defined in GI.Gio.Objects.AppLaunchContext Methods (==) :: AppLaunchContext -> AppLaunchContext -> Bool # (/=) :: AppLaunchContext -> AppLaunchContext -> Bool #
GObject AppLaunchContext Source # |
Instance details Defined in GI.Gio.Objects.AppLaunchContext
TypedObject AppLaunchContext Source # |
Instance details Defined in GI.Gio.Objects.AppLaunchContext Methods glibType :: IO GType Source #
ManagedPtrNewtype AppLaunchContext Source # |
Instance details Defined in GI.Gio.Objects.AppLaunchContext Methods toManagedPtr :: AppLaunchContext -> ManagedPtr AppLaunchContext Source #
IsGValue AppLaunchContext Source # | Convert `AppLaunchContext` to and from `GValue` with `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.AppLaunchContext Methods toGValue :: AppLaunchContext -> IO GValue Source # fromGValue :: GValue -> IO AppLaunchContext Source #
HasParentTypes AppLaunchContext Source # |
Instance details Defined in GI.Gio.Objects.AppLaunchContext
type ParentTypes AppLaunchContext Source # |
Instance details 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

Instances details

(GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o Source # |
Instance details 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

## Overloaded methods

## getDisplay

appLaunchContextGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsAppInfo b, IsFile c) |
=> a | `context`: a `AppLaunchContext`
-> b | `info`: a `AppInfo`
-> [c] | `files`: a `List` of `File` objects
-> m 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 #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) |
=> a | `context`: a `AppLaunchContext`
-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsAppInfo b, IsFile c) |
=> a | `context`: a `AppLaunchContext`
-> b | `info`: a `AppInfo`
-> [c] | `files`: a `List` of of `File` objects
-> m Text | Returns: a startup notification ID for the application, or `Nothing` if not supported.

Initiates startup notification for the application and returns the `DESKTOP_STARTUP_ID` for the launched operation, if supported.

Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard.

## launchFailed

appLaunchContextLaunchFailed Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) |
=> a | `context`: a `AppLaunchContext`.
-> Text | `startupNotifyId`: the startup notification id that was returned by `appLaunchContextGetStartupNotifyId`.
-> m () |

Called when an application has failed to launch, so that it can cancel the application startup notification started in `appLaunchContextGetStartupNotifyId`.

## new

appLaunchContextNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m AppLaunchContext | Returns: a `AppLaunchContext`.

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

## setenv

appLaunchContextSetenv Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) |
=> a | `context`: a `AppLaunchContext`
-> [Char] | `variable`: the environment variable to set
-> [Char] | `value`: the value for to set the variable to.
-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) |
=> a | `context`: a `AppLaunchContext`
-> [Char] | `variable`: the environment variable to remove
-> 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 #

Arguments

= Text | `startupNotifyId`: the startup notification id for the failed launch
-> IO () |

The launchFailed signal is emitted when a `AppInfo` launch fails. The startup notification id is provided, so that the launcher can cancel the startup notification.

Since: 2.36

type C_AppLaunchContextLaunchFailedCallback = Ptr () -> CString -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => 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

genClosure_AppLaunchContextLaunchFailed :: MonadIO m => AppLaunchContextLaunchFailedCallback -> m (GClosure C_AppLaunchContextLaunchFailedCallback) Source #

Wrap the callback into a `GClosure`.

mk_AppLaunchContextLaunchFailedCallback :: C_AppLaunchContextLaunchFailedCallback -> IO (FunPtr C_AppLaunchContextLaunchFailedCallback) Source #

Generate a function pointer callable from C code, from a `C_AppLaunchContextLaunchFailedCallback`.

noAppLaunchContextLaunchFailedCallback :: Maybe AppLaunchContextLaunchFailedCallback Source #

A convenience synonym for ``Nothing` :: `Maybe` `AppLaunchContextLaunchFailedCallback``.

onAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => 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

wrap_AppLaunchContextLaunchFailedCallback :: AppLaunchContextLaunchFailedCallback -> C_AppLaunchContextLaunchFailedCallback Source #

Wrap a `AppLaunchContextLaunchFailedCallback` into a `C_AppLaunchContextLaunchFailedCallback`.

## launched

type AppLaunchContextLaunchedCallback Source #

Arguments

= AppInfo | `info`: the `AppInfo` that was just launched
-> GVariant | `platformData`: additional platform-specific data for this launch
-> IO () |

The launched signal is emitted when a `AppInfo` is successfully launched. 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.36

type C_AppLaunchContextLaunchedCallback = Ptr () -> Ptr AppInfo -> Ptr GVariant -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

afterAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => 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

genClosure_AppLaunchContextLaunched :: MonadIO m => AppLaunchContextLaunchedCallback -> m (GClosure C_AppLaunchContextLaunchedCallback) Source #

Wrap the callback into a `GClosure`.

mk_AppLaunchContextLaunchedCallback :: C_AppLaunchContextLaunchedCallback -> IO (FunPtr C_AppLaunchContextLaunchedCallback) Source #

Generate a function pointer callable from C code, from a `C_AppLaunchContextLaunchedCallback`.

noAppLaunchContextLaunchedCallback :: Maybe AppLaunchContextLaunchedCallback Source #

A convenience synonym for ``Nothing` :: `Maybe` `AppLaunchContextLaunchedCallback``.

onAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => 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

wrap_AppLaunchContextLaunchedCallback :: AppLaunchContextLaunchedCallback -> C_AppLaunchContextLaunchedCallback Source #

Wrap a `AppLaunchContextLaunchedCallback` into a `C_AppLaunchContextLaunchedCallback`.