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

Contents

- Exported types
- Methods
  - get
  - getDefaultDisplay
  - listDisplays
  - openDisplay
  - setDefaultDisplay
- Properties
  - defaultDisplay
- Signals
  - displayOpened

Description

The purpose of the `DisplayManager` singleton object is to offer notification when displays appear or disappear or the default display changes.

You can use `displayManagerGet` to obtain the `DisplayManager` singleton, but that should be rarely necessary. Typically, initializing GTK+ opens a display that you can work with without ever accessing the `DisplayManager`.

The GDK library can be built with support for multiple backends. The `DisplayManager` object determines which backend is used at runtime.

When writing backend-specific code that is supposed to work with multiple GDK backends, you have to consider both compile time and runtime. At compile time, use the `GDK_WINDOWING_X11`, `GDK_WINDOWING_WIN32` macros, etc. to find out which backends are present in the GDK library you are building your application against. At runtime, use type-check macros like `GDK_IS_X11_DISPLAY()` to find out which backend is in use:

## Backend-specific code ## {`backend`-specific}

### C code

    #ifdef GDK_WINDOWING_X11
      if (GDK_IS_X11_DISPLAY (display))
        {
          // make X11-specific calls here
        }
      else
    #endif
    #ifdef GDK_WINDOWING_QUARTZ
      if (GDK_IS_QUARTZ_DISPLAY (display))
        {
          // make Quartz-specific calls here
        }
      else
    #endif
      g_error ("Unsupported GDK backend");

Synopsis

- newtype DisplayManager = DisplayManager (ManagedPtr DisplayManager)
- class (GObject o, IsDescendantOf DisplayManager o) => IsDisplayManager o
- toDisplayManager :: (MonadIO m, IsDisplayManager o) => o -> m DisplayManager
- displayManagerGet :: (HasCallStack, MonadIO m) => m DisplayManager
- displayManagerGetDefaultDisplay :: (HasCallStack, MonadIO m, IsDisplayManager a) => a -> m (Maybe Display)
- displayManagerListDisplays :: (HasCallStack, MonadIO m, IsDisplayManager a) => a -> m [Display]
- displayManagerOpenDisplay :: (HasCallStack, MonadIO m, IsDisplayManager a) => a -> Text -> m (Maybe Display)
- displayManagerSetDefaultDisplay :: (HasCallStack, MonadIO m, IsDisplayManager a, IsDisplay b) => a -> b -> m ()
- constructDisplayManagerDefaultDisplay :: (IsDisplayManager o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o)
- getDisplayManagerDefaultDisplay :: (MonadIO m, IsDisplayManager o) => o -> m (Maybe Display)
- setDisplayManagerDefaultDisplay :: (MonadIO m, IsDisplayManager o, IsDisplay a) => o -> a -> m ()
- type DisplayManagerDisplayOpenedCallback = Display -> IO ()
- afterDisplayManagerDisplayOpened :: (IsDisplayManager a, MonadIO m) => a -> ((?self :: a) => DisplayManagerDisplayOpenedCallback) -> m SignalHandlerId
- onDisplayManagerDisplayOpened :: (IsDisplayManager a, MonadIO m) => a -> ((?self :: a) => DisplayManagerDisplayOpenedCallback) -> m SignalHandlerId

# Exported types

newtype DisplayManager Source #

Memory-managed wrapper type.

Constructors

DisplayManager (ManagedPtr DisplayManager) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf DisplayManager o) => IsDisplayManager o Source #

Type class for types which can be safely cast to `DisplayManager`, for instance with `toDisplayManager`.

#### Instances

Instances details

(GObject o, IsDescendantOf DisplayManager o) => IsDisplayManager o Source # |
Instance details Defined in GI.Gdk.Objects.DisplayManager

toDisplayManager :: (MonadIO m, IsDisplayManager o) => o -> m DisplayManager Source #

Cast to `DisplayManager`, 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, listDisplays, notify, notifyByPspec, openDisplay, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getDefaultDisplay, getProperty, getQdata.

#### Setters

setData, setDataFull, setDefaultDisplay, setProperty.

## get

displayManagerGet Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m DisplayManager | Returns: The global `DisplayManager` singleton; `parseArgs`, `init`, or `initCheck` must have been called first.

Gets the singleton `DisplayManager` object.

When called for the first time, this function consults the `GDK_BACKEND` environment variable to find out which of the supported GDK backends to use (in case GDK has been compiled with multiple backends). Applications can use `setAllowedBackends` to limit what backends can be used.

Since: 2.2

## getDefaultDisplay

displayManagerGetDefaultDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplayManager a) |
=> a | `manager`: a `DisplayManager`
-> m (Maybe Display) | Returns: a `Display`, or `Nothing` if there is no default display.

Gets the default `Display`.

Since: 2.2

## listDisplays

displayManagerListDisplays Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplayManager a) |
=> a | `manager`: a `DisplayManager`
-> m [Display] | Returns: a newly allocated `SList` of `Display` objects. Free with `g_slist_free()` when you are done with it.

List all currently open displays.

Since: 2.2

## openDisplay

displayManagerOpenDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplayManager a) |
=> a | `manager`: a `DisplayManager`
-> Text | `name`: the name of the display to open
-> m (Maybe Display) | Returns: a `Display`, or `Nothing` if the display could not be opened

Opens a display.

Since: 3.0

## setDefaultDisplay

displayManagerSetDefaultDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplayManager a, IsDisplay b) |
=> a | `manager`: a `DisplayManager`
-> b | `display`: a `Display`
-> m () |

Sets `display` as the default display.

Since: 2.2

# Properties

## defaultDisplay

No description available in the introspection data.

constructDisplayManagerDefaultDisplay :: (IsDisplayManager o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o) Source #

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

getDisplayManagerDefaultDisplay :: (MonadIO m, IsDisplayManager o) => o -> m (Maybe Display) Source #

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

    get displayManager #defaultDisplay

setDisplayManagerDefaultDisplay :: (MonadIO m, IsDisplayManager o, IsDisplay a) => o -> a -> m () Source #

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

    set displayManager [ #defaultDisplay := value ]

# Signals

## displayOpened

type DisplayManagerDisplayOpenedCallback Source #

Arguments

= Display | `display`: the opened display
-> IO () |

The displayOpened signal is emitted when a display is opened.

Since: 2.2

afterDisplayManagerDisplayOpened :: (IsDisplayManager a, MonadIO m) => a -> ((?self :: a) => DisplayManagerDisplayOpenedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the displayOpened signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after displayManager #displayOpened 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.

onDisplayManagerDisplayOpened :: (IsDisplayManager a, MonadIO m) => a -> ((?self :: a) => DisplayManagerDisplayOpenedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the displayOpened signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on displayManager #displayOpened callback