<?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="gdk4-General">
<refmeta>
<refentrytitle role="top_of_page" id="gdk4-General.top_of_page">General</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>General</refname>
<refpurpose>Library initialization and versioning</refpurpose>
</refnamediv>

<refsect1 id="gdk4-General.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="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-WINDOWING-X11:CAPS">GDK_WINDOWING_X11</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-WINDOWING-WIN32:CAPS">GDK_WINDOWING_WIN32</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-WINDOWING-QUARTZ:CAPS">GDK_WINDOWING_QUARTZ</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-WINDOWING-WAYLAND:CAPS">GDK_WINDOWING_WAYLAND</link></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-VERSION-4-0:CAPS">GDK_VERSION_4_0</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-VERSION-MIN-REQUIRED:CAPS">GDK_VERSION_MIN_REQUIRED</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-VERSION-MAX-ALLOWED:CAPS">GDK_VERSION_MAX_ALLOWED</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-DISABLE-DEPRECATION-WARNINGS:CAPS">GDK_DISABLE_DEPRECATION_WARNINGS</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

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

<refsect1 id="gdk4-General.description" role="desc">
<title role="desc.title">Description</title>
<para>This section describes miscellaneous macros and utility functions
related to library versioning, as well as deprecation facilities.</para>
<para>The GDK and GTK headers annotate deprecated APIs in a way that produces
compiler warnings if these deprecated APIs are used. The warnings
can be turned off by defining the macro <link linkend="GDK-DISABLE-DEPRECATION-WARNINGS:CAPS"><literal>GDK_DISABLE_DEPRECATION_WARNINGS</literal></link>
before including the glib.h header.</para>
<para>GDK and GTK also provide support for building applications against
defined subsets of deprecated or new APIs. Define the macro
<link linkend="GDK-VERSION-MIN-REQUIRED:CAPS"><literal>GDK_VERSION_MIN_REQUIRED</literal></link> to specify up to what version
you want to receive warnings about deprecated APIs. Define the
macro <link linkend="GDK-VERSION-MAX-ALLOWED:CAPS"><literal>GDK_VERSION_MAX_ALLOWED</literal></link> to specify the newest version
whose API you want to use.</para>

</refsect1>
<refsect1 id="gdk4-General.functions_details" role="details">
<title role="details.title">Functions</title>
<para />
</refsect1>
<refsect1 id="gdk4-General.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GDK-WINDOWING-X11:CAPS" role="macro">
<title>GDK_WINDOWING_X11</title>
<indexterm zone="GDK-WINDOWING-X11:CAPS"><primary>GDK_WINDOWING_X11</primary></indexterm>
<programlisting language="C">#define GDK_WINDOWING_X11
</programlisting>
<para>The <link linkend="GDK-WINDOWING-X11:CAPS"><type>GDK_WINDOWING_X11</type></link> macro is defined if the X11 backend
is supported.</para>
<para>Use this macro to guard code that is specific to the X11 backend.</para>
</refsect2>
<refsect2 id="GDK-WINDOWING-WIN32:CAPS" role="macro">
<title>GDK_WINDOWING_WIN32</title>
<indexterm zone="GDK-WINDOWING-WIN32:CAPS"><primary>GDK_WINDOWING_WIN32</primary></indexterm>
<programlisting language="C">#define GDK_WINDOWING_WIN32
</programlisting>
<para>The <link linkend="GDK-WINDOWING-WIN32:CAPS"><type>GDK_WINDOWING_WIN32</type></link> macro is defined if the Win32 backend
is supported.</para>
<para>Use this macro to guard code that is specific to the Win32 backend.</para>
</refsect2>
<refsect2 id="GDK-WINDOWING-QUARTZ:CAPS" role="macro">
<title>GDK_WINDOWING_QUARTZ</title>
<indexterm zone="GDK-WINDOWING-QUARTZ:CAPS"><primary>GDK_WINDOWING_QUARTZ</primary></indexterm>
<programlisting language="C">#define GDK_WINDOWING_QUARTZ
</programlisting>
<para>The <link linkend="GDK-WINDOWING-QUARTZ:CAPS"><type>GDK_WINDOWING_QUARTZ</type></link> macro is defined if the Quartz backend
is supported.</para>
<para>Use this macro to guard code that is specific to the Quartz backend.</para>
</refsect2>
<refsect2 id="GDK-WINDOWING-WAYLAND:CAPS" role="macro">
<title>GDK_WINDOWING_WAYLAND</title>
<indexterm zone="GDK-WINDOWING-WAYLAND:CAPS"><primary>GDK_WINDOWING_WAYLAND</primary></indexterm>
<programlisting language="C">#define GDK_WINDOWING_WAYLAND
</programlisting>
<para>The <link linkend="GDK-WINDOWING-WAYLAND:CAPS"><type>GDK_WINDOWING_WAYLAND</type></link> macro is defined if the Wayland backend
is supported.</para>
<para>Use this macro to guard code that is specific to the Wayland backend.</para>
</refsect2>
<refsect2 id="GDK-VERSION-4-0:CAPS" role="macro">
<title>GDK_VERSION_4_0</title>
<indexterm zone="GDK-VERSION-4-0:CAPS"><primary>GDK_VERSION_4_0</primary></indexterm>
<programlisting language="C">#define GDK_VERSION_4_0        (G_ENCODE_VERSION (4, 0))
</programlisting>
<para>A macro that evaluates to the 4.0 version of GDK, in a format
that can be used by the C pre-processor.</para>
</refsect2>
<refsect2 id="GDK-VERSION-MIN-REQUIRED:CAPS" role="macro">
<title>GDK_VERSION_MIN_REQUIRED</title>
<indexterm zone="GDK-VERSION-MIN-REQUIRED:CAPS"><primary>GDK_VERSION_MIN_REQUIRED</primary></indexterm>
<programlisting language="C"># define GDK_VERSION_MIN_REQUIRED      (GDK_VERSION_CUR_STABLE)
</programlisting>
<para>A macro that should be defined by the user prior to including
the gdk.h header.
The definition should be one of the predefined GDK version
macros: <link linkend="GDK-VERSION-4-0:CAPS"><literal>GDK_VERSION_4_0</literal></link>, <link linkend="GDK-VERSION-4-2:CAPS"><literal>GDK_VERSION_4_2</literal></link>,...</para>
<para>This macro defines the lower bound for the GDK API to use.</para>
<para>If a function has been deprecated in a newer version of GDK,
it is possible to use this symbol to avoid the compiler warnings
without disabling warning for every deprecated function.</para>
</refsect2>
<refsect2 id="GDK-VERSION-MAX-ALLOWED:CAPS" role="macro">
<title>GDK_VERSION_MAX_ALLOWED</title>
<indexterm zone="GDK-VERSION-MAX-ALLOWED:CAPS"><primary>GDK_VERSION_MAX_ALLOWED</primary></indexterm>
<programlisting language="C">#  define GDK_VERSION_MAX_ALLOWED      GDK_VERSION_MIN_REQUIRED
</programlisting>
<para>A macro that should be defined by the user prior to including
the gdk.h header.
The definition should be one of the predefined GDK version
macros: <link linkend="GDK-VERSION-4-0:CAPS"><literal>GDK_VERSION_4_0</literal></link>, <link linkend="GDK-VERSION-4-2:CAPS"><literal>GDK_VERSION_4_2</literal></link>,...</para>
<para>This macro defines the upper bound for the GDK API to use.</para>
<para>If a function has been introduced in a newer version of GDK,
it is possible to use this symbol to get compiler warnings when
trying to use that function.</para>
</refsect2>
<refsect2 id="GDK-DISABLE-DEPRECATION-WARNINGS:CAPS" role="macro">
<title>GDK_DISABLE_DEPRECATION_WARNINGS</title>
<indexterm zone="GDK-DISABLE-DEPRECATION-WARNINGS:CAPS"><primary>GDK_DISABLE_DEPRECATION_WARNINGS</primary></indexterm>
<programlisting language="C">#define GDK_DISABLE_DEPRECATION_WARNINGS
</programlisting>
<para>A macro that should be defined before including the gdk.h header.
If it is defined, no compiler warnings will be produced for uses
of deprecated GDK and GTK APIs.</para>
</refsect2>

</refsect1>

</refentry>
