Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- newtype DisplayManager = DisplayManager (ManagedPtr DisplayManager)
- class (GObject o, IsDescendantOf DisplayManager o) => IsDisplayManager o
- toDisplayManager :: (MonadIO m, IsDisplayManager o) => o -> m DisplayManager
- type family ResolveDisplayManagerMethod (t :: Symbol) o where ...
- displayManagerGet :: (HasCallStack, MonadIO m) => m DisplayManager
- data DisplayManagerGetDefaultDisplayMethodInfo
- displayManagerGetDefaultDisplay :: (HasCallStack, MonadIO m, IsDisplayManager a) => a -> m (Maybe Display)
- data DisplayManagerListDisplaysMethodInfo
- displayManagerListDisplays :: (HasCallStack, MonadIO m, IsDisplayManager a) => a -> m [Display]
- data DisplayManagerOpenDisplayMethodInfo
- displayManagerOpenDisplay :: (HasCallStack, MonadIO m, IsDisplayManager a) => a -> Maybe Text -> m (Maybe Display)
- data DisplayManagerSetDefaultDisplayMethodInfo
- displayManagerSetDefaultDisplay :: (HasCallStack, MonadIO m, IsDisplayManager a, IsDisplay b) => a -> b -> m ()
- data DisplayManagerDefaultDisplayPropertyInfo
- constructDisplayManagerDefaultDisplay :: (IsDisplayManager o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o)
- displayManagerDefaultDisplay :: AttrLabelProxy "defaultDisplay"
- getDisplayManagerDefaultDisplay :: (MonadIO m, IsDisplayManager o) => o -> m (Maybe Display)
- setDisplayManagerDefaultDisplay :: (MonadIO m, IsDisplayManager o, IsDisplay a) => o -> a -> m ()
- type DisplayManagerDisplayOpenedCallback = Display -> IO ()
- data DisplayManagerDisplayOpenedSignalInfo
- 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
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
(GObject o, IsDescendantOf DisplayManager o) => IsDisplayManager o Source # | |
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
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
type family ResolveDisplayManagerMethod (t :: Symbol) o where ... Source #
Equations
get
Arguments
:: (HasCallStack, MonadIO m) | |
=> m DisplayManager | Returns: The global |
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
data DisplayManagerGetDefaultDisplayMethodInfo Source #
Instances
(signature ~ m (Maybe Display), MonadIO m, IsDisplayManager a) => OverloadedMethod DisplayManagerGetDefaultDisplayMethodInfo a signature Source # | |
Defined in GI.Gdk.Objects.DisplayManager Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo DisplayManagerGetDefaultDisplayMethodInfo (a :: Type) Source # | |
Defined in GI.Gdk.Objects.DisplayManager Methods |
displayManagerGetDefaultDisplay Source #
Arguments
:: (HasCallStack, MonadIO m, IsDisplayManager a) | |
=> a |
|
-> m (Maybe Display) | Returns: a |
Gets the default GdkDisplay
.
listDisplays
data DisplayManagerListDisplaysMethodInfo Source #
Instances
(signature ~ m [Display], MonadIO m, IsDisplayManager a) => OverloadedMethod DisplayManagerListDisplaysMethodInfo a signature Source # | |
Defined in GI.Gdk.Objects.DisplayManager Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo DisplayManagerListDisplaysMethodInfo (a :: Type) Source # | |
Defined in GI.Gdk.Objects.DisplayManager Methods |
displayManagerListDisplays Source #
Arguments
:: (HasCallStack, MonadIO m, IsDisplayManager a) | |
=> a |
|
-> m [Display] | Returns: a newly
allocated |
List all currently open displays.
openDisplay
data DisplayManagerOpenDisplayMethodInfo Source #
Instances
(signature ~ (Maybe Text -> m (Maybe Display)), MonadIO m, IsDisplayManager a) => OverloadedMethod DisplayManagerOpenDisplayMethodInfo a signature Source # | |
Defined in GI.Gdk.Objects.DisplayManager Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo DisplayManagerOpenDisplayMethodInfo (a :: Type) Source # | |
Defined in GI.Gdk.Objects.DisplayManager Methods |
displayManagerOpenDisplay Source #
Arguments
:: (HasCallStack, MonadIO m, IsDisplayManager a) | |
=> a |
|
-> Maybe Text |
|
-> m (Maybe Display) | Returns: a |
Opens a display.
setDefaultDisplay
data DisplayManagerSetDefaultDisplayMethodInfo Source #
Instances
(signature ~ (b -> m ()), MonadIO m, IsDisplayManager a, IsDisplay b) => OverloadedMethod DisplayManagerSetDefaultDisplayMethodInfo a signature Source # | |
Defined in GI.Gdk.Objects.DisplayManager Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo DisplayManagerSetDefaultDisplayMethodInfo (a :: Type) Source # | |
Defined in GI.Gdk.Objects.DisplayManager Methods |
displayManagerSetDefaultDisplay Source #
Arguments
:: (HasCallStack, MonadIO m, IsDisplayManager a, IsDisplay b) | |
=> a |
|
-> b |
|
-> m () |
Sets display
as the default display.
Properties
defaultDisplay
The default display.
data DisplayManagerDefaultDisplayPropertyInfo Source #
Instances
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
.
displayManagerDefaultDisplay :: AttrLabelProxy "defaultDisplay" Source #
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 #
Emitted when a display is opened.
data DisplayManagerDisplayOpenedSignalInfo Source #
Instances
SignalInfo DisplayManagerDisplayOpenedSignalInfo Source # | |||||
Defined in GI.Gdk.Objects.DisplayManager Associated Types
Methods connectSignal :: GObject o => o -> (o -> HaskellCallbackType DisplayManagerDisplayOpenedSignalInfo) -> SignalConnectMode -> Maybe Text -> IO SignalHandlerId # | |||||
type HaskellCallbackType DisplayManagerDisplayOpenedSignalInfo Source # | |||||
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