<?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-GtkCustomLayout">
<refmeta>
<refentrytitle role="top_of_page" id="gtk4-GtkCustomLayout.top_of_page">GtkCustomLayout</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkCustomLayout</refname>
<refpurpose>A convenience layout manager</refpurpose>
</refnamediv>

<refsect1 id="gtk4-GtkCustomLayout.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="GtkSizeRequestMode"><returnvalue>GtkSizeRequestMode</returnvalue></link>
</entry><entry role="function_name"><phrase role="c_punctuation">(</phrase><link linkend="GtkCustomRequestModeFunc">*GtkCustomRequestModeFunc</link><phrase role="c_punctuation">)</phrase>&#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"><phrase role="c_punctuation">(</phrase><link linkend="GtkCustomMeasureFunc">*GtkCustomMeasureFunc</link><phrase role="c_punctuation">)</phrase>&#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"><phrase role="c_punctuation">(</phrase><link linkend="GtkCustomAllocateFunc">*GtkCustomAllocateFunc</link><phrase role="c_punctuation">)</phrase>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkLayoutManager"><returnvalue>GtkLayoutManager</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-custom-layout-new">gtk_custom_layout_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gtk4-GtkCustomLayout.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="GtkCustomLayout">GtkCustomLayout</link></entry></row>

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

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

<refsect1 id="gtk4-GtkCustomLayout.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkCustomLayout"><type>GtkCustomLayout</type></link> is a convenience type meant to be used as a transition
mechanism between <link linkend="GtkWidgets"><type>GtkWidgets</type></link> implementing a layout policy, and
<link linkend="GtkLayoutManager"><type>GtkLayoutManager</type></link> classes.</para>
<para>A <link linkend="GtkCustomLayout"><type>GtkCustomLayout</type></link> uses closures matching to the old <link linkend="GtkWidget"><type>GtkWidget</type></link> virtual
functions for size negotiation, as a convenience API to ease the porting
towards the corresponding <link linkend="GtkLayoutManager"><type>GtkLayoutManager</type></link> virtual functions.</para>

</refsect1>
<refsect1 id="gtk4-GtkCustomLayout.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="GtkCustomRequestModeFunc" role="function">
<title>GtkCustomRequestModeFunc&#160;()</title>
<indexterm zone="GtkCustomRequestModeFunc"><primary>GtkCustomRequestModeFunc</primary></indexterm>
<programlisting language="C"><link linkend="GtkSizeRequestMode"><returnvalue>GtkSizeRequestMode</returnvalue></link>
<phrase role="c_punctuation">(</phrase>*GtkCustomRequestModeFunc<phrase role="c_punctuation">)</phrase> (<parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *widget</parameter>);</programlisting>
<para>Queries a widget for its preferred size request mode.</para>
<refsect3 id="GtkCustomRequestModeFunc.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 be queried</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GtkCustomRequestModeFunc.returns" role="returns">
<title>Returns</title>
<para> the size request mode</para>
</refsect3></refsect2>
<refsect2 id="GtkCustomMeasureFunc" role="function">
<title>GtkCustomMeasureFunc&#160;()</title>
<indexterm zone="GtkCustomMeasureFunc"><primary>GtkCustomMeasureFunc</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
<phrase role="c_punctuation">(</phrase>*GtkCustomMeasureFunc<phrase role="c_punctuation">)</phrase> (<parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *widget</parameter>,
                         <parameter><link linkend="GtkOrientation"><type>GtkOrientation</type></link> orientation</parameter>,
                         <parameter><link linkend="int"><type>int</type></link> for_size</parameter>,
                         <parameter><link linkend="int"><type>int</type></link> *minimum</parameter>,
                         <parameter><link linkend="int"><type>int</type></link> *natural</parameter>,
                         <parameter><link linkend="int"><type>int</type></link> *minimum_baseline</parameter>,
                         <parameter><link linkend="int"><type>int</type></link> *natural_baseline</parameter>);</programlisting>
<para>A function to be used by <link linkend="GtkCustomLayout"><type>GtkCustomLayout</type></link> to measure a widget.</para>
<refsect3 id="GtkCustomMeasureFunc.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 be measured</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>orientation</para></entry>
<entry role="parameter_description"><para>the direction to be measured</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>for_size</para></entry>
<entry role="parameter_description"><para>the size to be measured for</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>minimum</para></entry>
<entry role="parameter_description"><para>the measured minimum size of the widget. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>natural</para></entry>
<entry role="parameter_description"><para>the measured natural size of the widget. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>minimum_baseline</para></entry>
<entry role="parameter_description"><para>the measured minimum baseline of the widget. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>natural_baseline</para></entry>
<entry role="parameter_description"><para>the measured natural baseline of the widget. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GtkCustomAllocateFunc" role="function">
<title>GtkCustomAllocateFunc&#160;()</title>
<indexterm zone="GtkCustomAllocateFunc"><primary>GtkCustomAllocateFunc</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
<phrase role="c_punctuation">(</phrase>*GtkCustomAllocateFunc<phrase role="c_punctuation">)</phrase> (<parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *widget</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> width</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> height</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> baseline</parameter>);</programlisting>
<para>A function to be used by <link linkend="GtkCustomLayout"><type>GtkCustomLayout</type></link> to allocate a widget.</para>
<refsect3 id="GtkCustomAllocateFunc.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 allocate</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>the new width of the widget</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>the new height of the widget</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>baseline</para></entry>
<entry role="parameter_description"><para>the new baseline of the widget, or -1</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-custom-layout-new" role="function">
<title>gtk_custom_layout_new&#160;()</title>
<indexterm zone="gtk-custom-layout-new"><primary>gtk_custom_layout_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkLayoutManager"><returnvalue>GtkLayoutManager</returnvalue></link>&#160;*
gtk_custom_layout_new (<parameter><link linkend="GtkCustomRequestModeFunc"><type>GtkCustomRequestModeFunc</type></link> request_mode</parameter>,
                       <parameter><link linkend="GtkCustomMeasureFunc"><type>GtkCustomMeasureFunc</type></link> measure</parameter>,
                       <parameter><link linkend="GtkCustomAllocateFunc"><type>GtkCustomAllocateFunc</type></link> allocate</parameter>);</programlisting>
<para>Creates a new legacy layout manager.</para>
<para>Legacy layout managers map to the old <link linkend="GtkWidget"><type>GtkWidget</type></link> size negotiation
virtual functions, and are meant to be used during the transition
from layout containers to layout manager delegates.</para>
<refsect3 id="gtk-custom-layout-new.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>request_mode</para></entry>
<entry role="parameter_description"><para>a function to retrieve
the <link linkend="GtkSizeRequestMode"><type>GtkSizeRequestMode</type></link> of the widget using the layout; the
default request mode is <link linkend="GTK-SIZE-REQUEST-CONSTANT-SIZE:CAPS"><literal>GTK_SIZE_REQUEST_CONSTANT_SIZE</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>scope call</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>measure</para></entry>
<entry role="parameter_description"><para>a function to measure the widget using the layout manager. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>scope call</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>allocate</para></entry>
<entry role="parameter_description"><para>a function to allocate the children of the widget using
the layout manager. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>not nullable</acronym>][<acronym>scope call</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-custom-layout-new.returns" role="returns">
<title>Returns</title>
<para>the newly created <link linkend="GtkCustomLayout"><type>GtkCustomLayout</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="gtk4-GtkCustomLayout.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkCustomLayout" role="struct">
<title>GtkCustomLayout</title>
<indexterm zone="GtkCustomLayout"><primary>GtkCustomLayout</primary></indexterm>
<programlisting language="C">typedef struct _GtkCustomLayout GtkCustomLayout;</programlisting>
</refsect2>

</refsect1>

</refentry>
