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 |
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:
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 C_DisplayManagerDisplayOpenedCallback = Ptr () -> Ptr Display -> Ptr () -> IO ()
- type DisplayManagerDisplayOpenedCallback = Display -> IO ()
- afterDisplayManagerDisplayOpened :: (IsDisplayManager a, MonadIO m) => a -> DisplayManagerDisplayOpenedCallback -> m SignalHandlerId
- genClosure_DisplayManagerDisplayOpened :: MonadIO m => DisplayManagerDisplayOpenedCallback -> m (GClosure C_DisplayManagerDisplayOpenedCallback)
- mk_DisplayManagerDisplayOpenedCallback :: C_DisplayManagerDisplayOpenedCallback -> IO (FunPtr C_DisplayManagerDisplayOpenedCallback)
- noDisplayManagerDisplayOpenedCallback :: Maybe DisplayManagerDisplayOpenedCallback
- onDisplayManagerDisplayOpened :: (IsDisplayManager a, MonadIO m) => a -> DisplayManagerDisplayOpenedCallback -> m SignalHandlerId
- wrap_DisplayManagerDisplayOpenedCallback :: DisplayManagerDisplayOpenedCallback -> C_DisplayManagerDisplayOpenedCallback
Exported types
newtype DisplayManager Source #
Memory-managed wrapper type.
Instances
Eq DisplayManager Source # | |
Defined in GI.Gdk.Objects.DisplayManager (==) :: DisplayManager -> DisplayManager -> Bool # (/=) :: DisplayManager -> DisplayManager -> Bool # | |
IsGValue DisplayManager Source # | Convert |
Defined in GI.Gdk.Objects.DisplayManager toGValue :: DisplayManager -> IO GValue # fromGValue :: GValue -> IO DisplayManager # | |
ManagedPtrNewtype DisplayManager Source # | |
Defined in GI.Gdk.Objects.DisplayManager | |
TypedObject DisplayManager Source # | |
Defined in GI.Gdk.Objects.DisplayManager | |
GObject DisplayManager Source # | |
Defined in GI.Gdk.Objects.DisplayManager | |
HasParentTypes DisplayManager Source # | |
Defined in GI.Gdk.Objects.DisplayManager | |
type ParentTypes DisplayManager Source # | |
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
(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
Overloaded methods
get
:: (HasCallStack, MonadIO m) | |
=> m DisplayManager | Returns: The global |
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.
getDefaultDisplay
displayManagerGetDefaultDisplay Source #
:: (HasCallStack, MonadIO m, IsDisplayManager a) | |
=> a |
|
-> m (Maybe Display) | Returns: a |
Gets the default Display
.
listDisplays
displayManagerListDisplays Source #
:: (HasCallStack, MonadIO m, IsDisplayManager a) | |
=> a |
|
-> m [Display] | Returns: a newly
allocated |
List all currently open displays.
openDisplay
displayManagerOpenDisplay Source #
:: (HasCallStack, MonadIO m, IsDisplayManager a) | |
=> a |
|
-> Text |
|
-> m (Maybe Display) | Returns: a |
Opens a display.
setDefaultDisplay
displayManagerSetDefaultDisplay Source #
:: (HasCallStack, MonadIO m, IsDisplayManager a, IsDisplay b) | |
=> a |
|
-> b |
|
-> m () |
Sets display
as the default display.
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 C_DisplayManagerDisplayOpenedCallback = Ptr () -> Ptr Display -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type DisplayManagerDisplayOpenedCallback Source #
The displayOpened signal is emitted when a display is opened.
afterDisplayManagerDisplayOpened :: (IsDisplayManager a, MonadIO m) => 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
genClosure_DisplayManagerDisplayOpened :: MonadIO m => DisplayManagerDisplayOpenedCallback -> m (GClosure C_DisplayManagerDisplayOpenedCallback) Source #
Wrap the callback into a GClosure
.
mk_DisplayManagerDisplayOpenedCallback :: C_DisplayManagerDisplayOpenedCallback -> IO (FunPtr C_DisplayManagerDisplayOpenedCallback) Source #
Generate a function pointer callable from C code, from a C_DisplayManagerDisplayOpenedCallback
.
noDisplayManagerDisplayOpenedCallback :: Maybe DisplayManagerDisplayOpenedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
DisplayManagerDisplayOpenedCallback
onDisplayManagerDisplayOpened :: (IsDisplayManager a, MonadIO m) => 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