gi-gdk4
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.DisplayManager

Description

A singleton object that offers notification when displays appear or disappear.

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

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

In the rare case that you need to influence which of the backends is being used, you can use setAllowedBackends. Note that you need to call this function before initializing GTK.

Backend-specific code

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:

c code

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

Exported types

newtype DisplayManager Source #

Memory-managed wrapper type.

Instances

Instances details
Eq DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

GObject DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

ManagedPtrNewtype DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

TypedObject DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

Methods

glibType :: IO GType #

HasParentTypes DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

HasAttributeList DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

(info ~ ResolveDisplayManagerMethod t DisplayManager, OverloadedMethod info DisplayManager p, HasField t DisplayManager p) => HasField (t :: Symbol) DisplayManager (p :: Type) Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

Methods

getField :: DisplayManager -> p #

(info ~ ResolveDisplayManagerMethod t DisplayManager, OverloadedMethodInfo info DisplayManager) => IsLabel t (MethodProxy info DisplayManager) Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

(info ~ ResolveDisplayManagerMethod t DisplayManager, OverloadedMethod info DisplayManager p) => IsLabel t (DisplayManager -> p) Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

Methods

fromLabel :: DisplayManager -> p #

IsGValue (Maybe DisplayManager) Source #

Convert DisplayManager to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttributeList DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type ParentTypes DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type SignalList DisplayManager Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

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

type family ResolveDisplayManagerMethod (t :: Symbol) o where ... Source #

Equations

ResolveDisplayManagerMethod "bindProperty" o = ObjectBindPropertyMethodInfo 
ResolveDisplayManagerMethod "bindPropertyFull" o = ObjectBindPropertyFullMethodInfo 
ResolveDisplayManagerMethod "forceFloating" o = ObjectForceFloatingMethodInfo 
ResolveDisplayManagerMethod "freezeNotify" o = ObjectFreezeNotifyMethodInfo 
ResolveDisplayManagerMethod "getv" o = ObjectGetvMethodInfo 
ResolveDisplayManagerMethod "isFloating" o = ObjectIsFloatingMethodInfo 
ResolveDisplayManagerMethod "listDisplays" o = DisplayManagerListDisplaysMethodInfo 
ResolveDisplayManagerMethod "notify" o = ObjectNotifyMethodInfo 
ResolveDisplayManagerMethod "notifyByPspec" o = ObjectNotifyByPspecMethodInfo 
ResolveDisplayManagerMethod "openDisplay" o = DisplayManagerOpenDisplayMethodInfo 
ResolveDisplayManagerMethod "ref" o = ObjectRefMethodInfo 
ResolveDisplayManagerMethod "refSink" o = ObjectRefSinkMethodInfo 
ResolveDisplayManagerMethod "runDispose" o = ObjectRunDisposeMethodInfo 
ResolveDisplayManagerMethod "stealData" o = ObjectStealDataMethodInfo 
ResolveDisplayManagerMethod "stealQdata" o = ObjectStealQdataMethodInfo 
ResolveDisplayManagerMethod "thawNotify" o = ObjectThawNotifyMethodInfo 
ResolveDisplayManagerMethod "unref" o = ObjectUnrefMethodInfo 
ResolveDisplayManagerMethod "watchClosure" o = ObjectWatchClosureMethodInfo 
ResolveDisplayManagerMethod "getData" o = ObjectGetDataMethodInfo 
ResolveDisplayManagerMethod "getDefaultDisplay" o = DisplayManagerGetDefaultDisplayMethodInfo 
ResolveDisplayManagerMethod "getProperty" o = ObjectGetPropertyMethodInfo 
ResolveDisplayManagerMethod "getQdata" o = ObjectGetQdataMethodInfo 
ResolveDisplayManagerMethod "setData" o = ObjectSetDataMethodInfo 
ResolveDisplayManagerMethod "setDataFull" o = ObjectSetDataFullMethodInfo 
ResolveDisplayManagerMethod "setDefaultDisplay" o = DisplayManagerSetDefaultDisplayMethodInfo 
ResolveDisplayManagerMethod "setProperty" o = ObjectSetPropertyMethodInfo 
ResolveDisplayManagerMethod l o = MethodResolutionFailed l o :: Type 

get

displayManagerGet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m DisplayManager

Returns: The global GdkDisplayManager singleton

Gets the singleton GdkDisplayManager 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 [funcsetAllowedBackends] to limit what backends will be used.

getDefaultDisplay

displayManagerGetDefaultDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplayManager a) 
=> a

manager: a GdkDisplayManager

-> m (Maybe Display)

Returns: a GdkDisplay

Gets the default GdkDisplay.

listDisplays

displayManagerListDisplays Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplayManager a) 
=> a

manager: a GdkDisplayManager

-> m [Display]

Returns: a newly allocated GSList of GdkDisplay objects

List all currently open displays.

openDisplay

displayManagerOpenDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplayManager a) 
=> a

manager: a GdkDisplayManager

-> Maybe Text

name: the name of the display to open

-> m (Maybe Display)

Returns: a GdkDisplay, or Nothing if the display could not be opened

Opens a display.

setDefaultDisplay

displayManagerSetDefaultDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplayManager a, IsDisplay b) 
=> a

manager: a GdkDisplayManager

-> b

display: a GdkDisplay

-> m () 

Sets display as the default display.

Properties

defaultDisplay

The default display.

data DisplayManagerDefaultDisplayPropertyInfo Source #

Instances

Instances details
AttrInfo DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

Associated Types

type AttrAllowedOps DisplayManagerDefaultDisplayPropertyInfo 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrBaseTypeConstraint DisplayManagerDefaultDisplayPropertyInfo 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrGetType DisplayManagerDefaultDisplayPropertyInfo 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrSetTypeConstraint DisplayManagerDefaultDisplayPropertyInfo 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrTransferTypeConstraint DisplayManagerDefaultDisplayPropertyInfo 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrTransferType DisplayManagerDefaultDisplayPropertyInfo 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrLabel DisplayManagerDefaultDisplayPropertyInfo 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrOrigin DisplayManagerDefaultDisplayPropertyInfo 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrAllowedOps DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrBaseTypeConstraint DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrGetType DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrLabel DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrOrigin DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrSetTypeConstraint DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrTransferType DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

type AttrTransferTypeConstraint DisplayManagerDefaultDisplayPropertyInfo Source # 
Instance details

Defined in GI.Gdk.Objects.DisplayManager

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

Emitted when a display is opened.

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