<?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">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="gtk4-Testing">
<refmeta>
<refentrytitle role="top_of_page" id="gtk4-Testing.top_of_page">Testing</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Testing</refname>
<refpurpose>Utilities for testing GTK+ applications</refpurpose>
</refnamediv>

<refsect1 id="gtk4-Testing.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="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-test-init">gtk_test_init</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="GType"><returnvalue>GType</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-test-list-all-types">gtk_test_list_all_types</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="gtk-test-register-all-types">gtk_test_register_all_types</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="gtk-test-widget-wait-for-draw">gtk_test_widget_wait_for_draw</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

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

<refsect1 id="gtk4-Testing.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="gtk4-Testing.description" role="desc">
<title role="desc.title">Description</title>

</refsect1>
<refsect1 id="gtk4-Testing.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-test-init" role="function">
<title>gtk_test_init&#160;()</title>
<indexterm zone="gtk-test-init"><primary>gtk_test_init</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_test_init (<parameter><link linkend="int"><type>int</type></link> *argcp</parameter>,
               <parameter><link linkend="char"><type>char</type></link> ***argvp</parameter>,
               <parameter>...</parameter>);</programlisting>
<para>This function is used to initialize a GTK+ test program.</para>
<para>It will in turn call <link linkend="g-test-init"><function>g_test_init()</function></link> and <link linkend="gtk-init"><function>gtk_init()</function></link> to properly
initialize the testing framework and graphical toolkit. It’ll 
also set the program’s locale to “C”. This is done to make test
program environments as deterministic as possible.</para>
<para>Like <link linkend="gtk-init"><function>gtk_init()</function></link> and <link linkend="g-test-init"><function>g_test_init()</function></link>, any known arguments will be
processed and stripped from <parameter>argc</parameter>
 and <parameter>argv</parameter>
.</para>
<refsect3 id="gtk-test-init.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>argcp</para></entry>
<entry role="parameter_description"><para>Address of the <literal>argc</literal> parameter of the
<link linkend="main"><function>main()</function></link> function. Changed if any arguments were handled.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>argvp</para></entry>
<entry role="parameter_description"><para>Address of the
<literal>argv</literal> parameter of <link linkend="main"><function>main()</function></link>.
Any parameters understood by <link linkend="g-test-init"><function>g_test_init()</function></link> or <link linkend="gtk-init"><function>gtk_init()</function></link> are
stripped before return. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>inout</acronym>][<acronym>array</acronym> length=argcp]</emphasis></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>currently unused</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-test-list-all-types" role="function">
<title>gtk_test_list_all_types&#160;()</title>
<indexterm zone="gtk-test-list-all-types"><primary>gtk_test_list_all_types</primary></indexterm>
<programlisting language="C">const <link linkend="GType"><returnvalue>GType</returnvalue></link>&#160;*
gtk_test_list_all_types (<parameter><link linkend="guint"><type>guint</type></link> *n_types</parameter>);</programlisting>
<para>Return the type ids that have been registered after
calling <link linkend="gtk-test-register-all-types"><function>gtk_test_register_all_types()</function></link>.</para>
<refsect3 id="gtk-test-list-all-types.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>n_types</para></entry>
<entry role="parameter_description"><para>location to store number of types</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-test-list-all-types.returns" role="returns">
<title>Returns</title>
<para>0-terminated array of type ids. </para>
<para><emphasis role="annotation">[<acronym>array</acronym> length=n_types zero-terminated=1][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-test-register-all-types" role="function">
<title>gtk_test_register_all_types&#160;()</title>
<indexterm zone="gtk-test-register-all-types"><primary>gtk_test_register_all_types</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_test_register_all_types (<parameter><type>void</type></parameter>);</programlisting>
<para>Force registration of all core Gtk+ and Gdk object types.
This allowes to refer to any of those object types via
<link linkend="g-type-from-name"><function>g_type_from_name()</function></link> after calling this function.</para>
</refsect2>
<refsect2 id="gtk-test-widget-wait-for-draw" role="function">
<title>gtk_test_widget_wait_for_draw&#160;()</title>
<indexterm zone="gtk-test-widget-wait-for-draw"><primary>gtk_test_widget_wait_for_draw</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_test_widget_wait_for_draw (<parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *widget</parameter>);</programlisting>
<para>Enters the main loop and waits for <parameter>widget</parameter>
 to be “drawn”. In this
context that means it waits for the frame clock of <parameter>widget</parameter>
 to have
run a full styling, layout and drawing cycle.</para>
<para>This function is intended to be used for syncing with actions that
depend on <parameter>widget</parameter>
 relayouting or on interaction with the display
server.</para>
<refsect3 id="gtk-test-widget-wait-for-draw.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>widget</para></entry>
<entry role="parameter_description"><para>the widget to wait for</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>

</refentry>
