<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GdkDisplayManager">
<refmeta>
<refentrytitle role="top_of_page" id="GdkDisplayManager.top_of_page">GdkDisplayManager</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GdkDisplayManager</refname>
<refpurpose>Maintains a list of all open GdkDisplays</refpurpose>
</refnamediv>

<refsect1 id="GdkDisplayManager.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GdkDisplayManager"><returnvalue>GdkDisplayManager</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-display-manager-get">gdk_display_manager_get</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-display-manager-get-default-display">gdk_display_manager_get_default_display</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-display-manager-set-default-display">gdk_display_manager_set_default_display</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GSList"><returnvalue>GSList</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-display-manager-list-displays">gdk_display_manager_list_displays</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-display-manager-open-display">gdk_display_manager_open_display</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-set-allowed-backends">gdk_set_allowed_backends</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkDisplayManager.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GdkDisplay"><type>GdkDisplay</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkDisplayManager--default-display">default-display</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkDisplayManager.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkDisplayManager-display-opened">display-opened</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkDisplayManager.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GdkDisplayManager-struct">GdkDisplayManager</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkDisplayManager.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GdkDisplayManager
</screen>
</refsect1>

<refsect1 id="GdkDisplayManager.includes"><title>Includes</title><synopsis>#include &lt;gdk/gdk.h&gt;
</synopsis></refsect1>

<refsect1 id="GdkDisplayManager.description" role="desc">
<title role="desc.title">Description</title>
<para>The purpose of the <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> singleton object is to offer
notification when displays appear or disappear or the default display
changes.</para>
<para>You can use <link linkend="gdk-display-manager-get"><function>gdk_display_manager_get()</function></link> to obtain the <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link>
singleton, but that should be rarely necessary. Typically, initializing
GTK opens a display that you can work with without ever accessing the
<link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link>.</para>
<para>The GDK library can be built with support for multiple backends.
The <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> object determines which backend is used
at runtime.</para>
<para>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 <link linkend="GDK-WINDOWING-X11:CAPS"><type>GDK_WINDOWING_X11</type></link>, <link linkend="GDK-WINDOWING-WIN32:CAPS"><type>GDK_WINDOWING_WIN32</type></link>
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 <link linkend="GDK-IS-X11-DISPLAY:CAPS"><function>GDK_IS_X11_DISPLAY()</function></link> to find out which backend is in use:</para>
<refsect3 id="backend-specific"><title>Backend-specific code</title><informalexample><programlisting role="example"><![CDATA[
#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");
]]></programlisting></informalexample>
<para></para>
</refsect3>

</refsect1>
<refsect1 id="GdkDisplayManager.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-display-manager-get" role="function">
<title>gdk_display_manager_get&#160;()</title>
<indexterm zone="gdk-display-manager-get"><primary>gdk_display_manager_get</primary></indexterm>
<programlisting language="C"><link linkend="GdkDisplayManager"><returnvalue>GdkDisplayManager</returnvalue></link>&#160;*
gdk_display_manager_get (<parameter><type>void</type></parameter>);</programlisting>
<para>Gets the singleton <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> object.</para>
<para>When called for the first time, this function consults the
<literal>GDK_BACKEND</literal> 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 <link linkend="gdk-set-allowed-backends"><function>gdk_set_allowed_backends()</function></link>
to limit what backends can be used.</para>
<refsect3 id="gdk-display-manager-get.returns" role="returns">
<title>Returns</title>
<para>The global <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> singleton. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-display-manager-get-default-display" role="function">
<title>gdk_display_manager_get_default_display&#160;()</title>
<indexterm zone="gdk-display-manager-get-default-display"><primary>gdk_display_manager_get_default_display</primary></indexterm>
<programlisting language="C"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
gdk_display_manager_get_default_display
                               (<parameter><link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> *manager</parameter>);</programlisting>
<para>Gets the default <link linkend="GdkDisplay"><type>GdkDisplay</type></link>.</para>
<refsect3 id="gdk-display-manager-get-default-display.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>manager</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-display-manager-get-default-display.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if
there is no default display. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-display-manager-set-default-display" role="function">
<title>gdk_display_manager_set_default_display&#160;()</title>
<indexterm zone="gdk-display-manager-set-default-display"><primary>gdk_display_manager_set_default_display</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_display_manager_set_default_display
                               (<parameter><link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> *manager</parameter>,
                                <parameter><link linkend="GdkDisplay"><type>GdkDisplay</type></link> *display</parameter>);</programlisting>
<para>Sets <parameter>display</parameter>
 as the default display.</para>
<refsect3 id="gdk-display-manager-set-default-display.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>manager</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>display</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDisplay"><type>GdkDisplay</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-display-manager-list-displays" role="function">
<title>gdk_display_manager_list_displays&#160;()</title>
<indexterm zone="gdk-display-manager-list-displays"><primary>gdk_display_manager_list_displays</primary></indexterm>
<programlisting language="C"><link linkend="GSList"><returnvalue>GSList</returnvalue></link>&#160;*
gdk_display_manager_list_displays (<parameter><link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> *manager</parameter>);</programlisting>
<para>List all currently open displays.</para>
<refsect3 id="gdk-display-manager-list-displays.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>manager</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-display-manager-list-displays.returns" role="returns">
<title>Returns</title>
<para>a newly
allocated <link linkend="GSList"><type>GSList</type></link> of <link linkend="GdkDisplay"><type>GdkDisplay</type></link> objects. Free with <link linkend="g-slist-free"><function>g_slist_free()</function></link>
when you are done with it. </para>
<para><emphasis role="annotation">[<acronym>transfer container</acronym>][<acronym>element-type</acronym> GdkDisplay]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-display-manager-open-display" role="function">
<title>gdk_display_manager_open_display&#160;()</title>
<indexterm zone="gdk-display-manager-open-display"><primary>gdk_display_manager_open_display</primary></indexterm>
<programlisting language="C"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
gdk_display_manager_open_display (<parameter><link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> *manager</parameter>,
                                  <parameter>const <link linkend="char"><type>char</type></link> *name</parameter>);</programlisting>
<para>Opens a display.</para>
<refsect3 id="gdk-display-manager-open-display.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>manager</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>name</para></entry>
<entry role="parameter_description"><para>the name of the display to open</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-display-manager-open-display.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the
display could not be opened. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-set-allowed-backends" role="function">
<title>gdk_set_allowed_backends&#160;()</title>
<indexterm zone="gdk-set-allowed-backends"><primary>gdk_set_allowed_backends</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_set_allowed_backends (<parameter>const <link linkend="char"><type>char</type></link> *backends</parameter>);</programlisting>
<para>Sets a list of backends that GDK should try to use.</para>
<para>This can be useful if your application does not
work with certain GDK backends.</para>
<para>By default, GDK tries all included backends.</para>
<para>For example,</para>
<informalexample><programlisting role="example"><![CDATA[
gdk_set_allowed_backends ("wayland,quartz,*");
]]></programlisting></informalexample>
<para>
instructs GDK to try the Wayland backend first,
followed by the Quartz backend, and then all
others.</para>
<para>If the <literal>GDK_BACKEND</literal> environment variable
is set, it determines what backends are tried in what
order, while still respecting the set of allowed backends
that are specified by this function.</para>
<para>The possible backend names are x11, win32, quartz,
broadway, wayland. You can also include a * in the
list to try all remaining backends.</para>
<para>This call must happen prior to <link linkend="gdk-display-open"><function>gdk_display_open()</function></link>,
<link linkend="gtk-init"><function>gtk_init()</function></link>, or <link linkend="gtk-init-check"><function>gtk_init_check()</function></link>
in order to take effect.</para>
<refsect3 id="gdk-set-allowed-backends.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>backends</para></entry>
<entry role="parameter_description"><para>a comma-separated list of backends</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GdkDisplayManager.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkDisplayManager-struct" role="struct">
<title>GdkDisplayManager</title>
<indexterm zone="GdkDisplayManager-struct"><primary>GdkDisplayManager</primary></indexterm>
<programlisting language="C">typedef struct _GdkDisplayManager GdkDisplayManager;</programlisting>
<para>The GdkDisplayManager struct contains only private fields and
should not be accessed directly.</para>
</refsect2>

</refsect1>
<refsect1 id="GdkDisplayManager.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GdkDisplayManager--default-display" role="property"><title>The <literal>“default-display”</literal> property</title>
<indexterm zone="GdkDisplayManager--default-display"><primary>GdkDisplayManager:default-display</primary></indexterm>
<programlisting>  “default-display”          <link linkend="GdkDisplay"><type>GdkDisplay</type></link>&#160;*</programlisting>
<para>The default display for GDK.</para><para>Owner: GdkDisplayManager</para>
<para>Flags: Read / Write</para>
</refsect2>

</refsect1>
<refsect1 id="GdkDisplayManager.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GdkDisplayManager-display-opened" role="signal"><title>The <literal>“display-opened”</literal> signal</title>
<indexterm zone="GdkDisplayManager-display-opened"><primary>GdkDisplayManager::display-opened</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkDisplayManager"><type>GdkDisplayManager</type></link> *manager,
               <link linkend="GdkDisplay"><type>GdkDisplay</type></link>        *display,
               <link linkend="gpointer"><type>gpointer</type></link>           user_data)</programlisting>
<para>The ::display-opened signal is emitted when a display is opened.</para>
<refsect3 id="GdkDisplayManager-display-opened.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>manager</para></entry>
<entry role="parameter_description"><para>the object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>display</para></entry>
<entry role="parameter_description"><para>the opened display</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>

</refentry>
