gi-gdk-3.0.11: Gdk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.DisplayManager

Contents

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}

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

Exported types

Methods

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

data DisplayManagerDefaultDisplayPropertyInfo Source #

Instances

AttrInfo DisplayManagerDefaultDisplayPropertyInfo Source # 
type AttrOrigin DisplayManagerDefaultDisplayPropertyInfo Source # 
type AttrLabel DisplayManagerDefaultDisplayPropertyInfo Source # 
type AttrGetType DisplayManagerDefaultDisplayPropertyInfo Source # 
type AttrBaseTypeConstraint DisplayManagerDefaultDisplayPropertyInfo Source # 
type AttrSetTypeConstraint DisplayManagerDefaultDisplayPropertyInfo Source # 
type AttrAllowedOps DisplayManagerDefaultDisplayPropertyInfo Source # 

Signals

displayOpened