gi-gdk-3.0.28: Gdk bindings

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

GI.Gdk.Objects.AppLaunchContext

Contents

- Exported types
- Methods
  - new
  - setDesktop
  - setDisplay
  - setIcon
  - setIconName
  - setScreen
  - setTimestamp
- Properties
  - display

Description

GdkAppLaunchContext is an implementation of `AppLaunchContext` 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 code

    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);

Synopsis

- newtype AppLaunchContext = AppLaunchContext (ManagedPtr AppLaunchContext)
- class (GObject o, IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o
- toAppLaunchContext :: (MonadIO m, IsAppLaunchContext o) => o -> m AppLaunchContext
- appLaunchContextNew :: (HasCallStack, MonadIO m) => m AppLaunchContext
- appLaunchContextSetDesktop :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Int32 -> m ()
- appLaunchContextSetDisplay :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsDisplay b) => a -> b -> m ()
- appLaunchContextSetIcon :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsIcon b) => a -> Maybe b -> m ()
- appLaunchContextSetIconName :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Maybe Text -> m ()
- appLaunchContextSetScreen :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsScreen b) => a -> b -> m ()
- appLaunchContextSetTimestamp :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => a -> Word32 -> m ()
- constructAppLaunchContextDisplay :: (IsAppLaunchContext o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o)
- getAppLaunchContextDisplay :: (MonadIO m, IsAppLaunchContext o) => o -> m (Maybe Display)

# Exported types

newtype AppLaunchContext Source #

Memory-managed wrapper type.

Constructors

AppLaunchContext (ManagedPtr AppLaunchContext) |

#### Instances

Instances details

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

Expand

#### 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

setData, setDataFull, setDesktop, setDisplay, setIcon, setIconName, setProperty, setScreen, setTimestamp.

## new

appLaunchContextNew Source #

Arguments

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

Deprecated: (Since version 3.0)Use `displayGetAppLaunchContext` instead

Creates a new `AppLaunchContext`.

Since: 2.14

## setDesktop

appLaunchContextSetDesktop Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) |
=> a | `context`: a `AppLaunchContext`
-> Int32 | `desktop`: the number of a workspace, or -1
-> m () |

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 `desktop` is set to -1, it is up to the window manager to pick one, typically it will be the current workspace.

Since: 2.14

## setDisplay

appLaunchContextSetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsDisplay b) |
=> a | `context`: a `AppLaunchContext`
-> b | `display`: a `Display`
-> m () |

Deprecated: (Since version 3.0)Use `displayGetAppLaunchContext` instead

Sets the display on which applications will be launched when using this context. See also `appLaunchContextSetScreen`.

Since: 2.14

## setIcon

appLaunchContextSetIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsIcon b) |
=> a | `context`: a `AppLaunchContext`
-> Maybe b | `icon`: a `Icon`, or `Nothing`
-> m () |

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

Window Managers can use this information when displaying startup notification.

See also `appLaunchContextSetIconName`.

Since: 2.14

## setIconName

appLaunchContextSetIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) |
=> a | `context`: a `AppLaunchContext`
-> Maybe Text | `iconName`: an icon name, or `Nothing`
-> m () |

Sets the icon for applications that are launched with this context. The `iconName` will be interpreted in the same way as the Icon field in desktop files. See also `appLaunchContextSetIcon`.

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

Since: 2.14

## setScreen

appLaunchContextSetScreen Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsScreen b) |
=> a | `context`: a `AppLaunchContext`
-> b | `screen`: a `Screen`
-> m () |

Sets the screen on which applications will be launched when using this context. See also `appLaunchContextSetDisplay`.

Note that, typically, a `Screen` represents a logical screen, not a physical monitor.

If both `screen` and `display` are set, the `screen` takes priority. If neither `screen` or `display` are set, the default screen and display are used.

Since: 2.14

## setTimestamp

appLaunchContextSetTimestamp Source #

Arguments

:: (HasCallStack, MonadIO m, IsAppLaunchContext a) |
=> a | `context`: a `AppLaunchContext`
-> Word32 | `timestamp`: a timestamp
-> m () |

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'.

Since: 2.14

# Properties

## display

No description available in the introspection data.

constructAppLaunchContextDisplay :: (IsAppLaunchContext o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`display`” property. This is rarely needed directly, but it is used by `new`.

getAppLaunchContextDisplay :: (MonadIO m, IsAppLaunchContext o) => o -> m (Maybe Display) Source #

Get the value of the “`display`” property. When overloading is enabled, this is equivalent to

    get appLaunchContext #display