gdk.display_manager

Module for [DisplayManager] class

Types 3

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

You can use gdk.display_manager.DisplayManager.get 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.

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}

#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");

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
DisplayManager self() nothrowReturns `this`, for use in `with` statements.
DisplayManagerGidBuilder builder() static nothrowGet builder for [gdk.display_manager.DisplayManager] Returns: New builder object
void defaultDisplay(gdk.display.Display propval) @property nothrow
gdk.display_manager.DisplayManager get() static nothrowGets the singleton #GdkDisplayManager object.
gdk.display.Display getDefaultDisplay() nothrowGets the default #GdkDisplay. Returns: a #GdkDisplay, or null if there is no default display.
gdk.display.Display[] listDisplays() nothrowList all currently open displays. Returns: a newly allocated #GSList of #GdkDisplay objects. Free with [glib.slist.SList.free] when you are done with it.
gdk.display.Display openDisplay(string name) nothrowOpens a display.
void setDefaultDisplay(gdk.display.Display display) nothrowSets display as the default display.
gulong connectDisplayOpened(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.display.Display))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.display_manager.DisplayManager))) && Parameters!T.length < 3) nothrowConnect to `DisplayOpened` signal.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
DisplayManager build() nothrowCreate object from builder. Returns: New object