Class DisplayManager
- All Implemented Interfaces:
Proxy
GdkDisplayManager is a singleton object.
You can use 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.
In the rare case that you need to influence which of the backends
is being used, you can use Gdk.setAllowedBackends(java.lang.String). 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:
#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");
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDisplayManager.Builder<B extends DisplayManager.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theDisplayOpenedCallbackcallback.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new DisplayManager.DisplayManager(MemorySegment address) Create a DisplayManager proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected DisplayManagerasParent()Returns this instance as if it were its parent type.static DisplayManager.Builder<? extends DisplayManager.Builder> builder()ADisplayManager.Builderobject constructs aDisplayManagerwith the specified properties.voidemitDisplayOpened(@Nullable Display display) Emits the "display-opened" signal.static DisplayManagerget()Gets the singletonGdkDisplayManagerobject.@Nullable DisplayGets the defaultGdkDisplay.static @Nullable TypegetType()Get the GType of the DisplayManager classList all currently open displays.Emitted when a display is opened.@Nullable DisplayopenDisplay(@Nullable String name) Opens a display.voidsetDefaultDisplay(Display display) Setsdisplayas the default display.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
DisplayManager
Create a DisplayManager proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
DisplayManager
public DisplayManager()Creates a new DisplayManager.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
get
Gets the singletonGdkDisplayManagerobject.When called for the first time, this function consults the
GDK_BACKENDenvironment variable to find out which of the supported GDK backends to use (in case GDK has been compiled with multiple backends).Applications can use
Gdk.setAllowedBackends(java.lang.String)to limit what backends will be used.- Returns:
- The global
GdkDisplayManagersingleton
-
getDefaultDisplay
-
listDisplays
-
openDisplay
-
setDefaultDisplay
Setsdisplayas the default display.- Parameters:
display- aGdkDisplay
-
onDisplayOpened
public SignalConnection<DisplayManager.DisplayOpenedCallback> onDisplayOpened(DisplayManager.DisplayOpenedCallback handler) Emitted when a display is opened.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitDisplayOpened
Emits the "display-opened" signal. SeeonDisplayOpened(org.gnome.gdk.DisplayManager.DisplayOpenedCallback). -
builder
ADisplayManager.Builderobject constructs aDisplayManagerwith the specified properties. Use the variousset...()methods to set properties, and finish construction withDisplayManager.Builder.build().- Returns:
- the builder object
-