<?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="GtkNative">
<refmeta>
<refentrytitle role="top_of_page" id="GtkNative.top_of_page">GtkNative</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkNative</refname>
<refpurpose>Interface for widgets having surfaces</refpurpose>
</refnamediv>

<refsect1 id="GtkNative.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="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-native-get-for-surface">gtk_native_get_for_surface</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkSurface"><returnvalue>GdkSurface</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-native-get-surface">gtk_native_get_surface</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GskRenderer"><returnvalue>GskRenderer</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-native-get-renderer">gtk_native_get_renderer</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-native-check-resize">gtk_native_check_resize</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-native-get-surface-transform">gtk_native_get_surface_transform</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkNative.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="GtkNative-struct">GtkNative</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GtkNativeInterface">GtkNativeInterface</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkNative.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GInterface">GInterface</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkNative
</screen>
</refsect1>
<refsect1 id="GtkNative.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GtkNative requires
 <link linkend="GtkWidget">GtkWidget</link>.</para>

</refsect1>
<refsect1 id="GtkNative.derived-interfaces" role="derived_interfaces">
<title role="derived_interfaces.title">Known Derived Interfaces</title>
<para>
GtkNative is required by
 <link linkend="GtkRoot">GtkRoot</link>.</para>

</refsect1>
<refsect1 id="GtkNative.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GtkNative is implemented by
 <link linkend="GtkAboutDialog">GtkAboutDialog</link>,  <link linkend="GtkAppChooserDialog">GtkAppChooserDialog</link>,  <link linkend="GtkApplicationWindow">GtkApplicationWindow</link>,  <link linkend="GtkAssistant">GtkAssistant</link>,  <link linkend="GtkColorChooserDialog">GtkColorChooserDialog</link>,  <link linkend="GtkDialog">GtkDialog</link>,  <link linkend="GtkDragIcon">GtkDragIcon</link>,  <link linkend="GtkEmojiChooser">GtkEmojiChooser</link>,  <link linkend="GtkFileChooserDialog">GtkFileChooserDialog</link>,  <link linkend="GtkFontChooserDialog">GtkFontChooserDialog</link>,  <link linkend="GtkMessageDialog">GtkMessageDialog</link>,  <link linkend="GtkPageSetupUnixDialog">GtkPageSetupUnixDialog</link>,  <link linkend="GtkPopover">GtkPopover</link>,  <link linkend="GtkPopoverMenu">GtkPopoverMenu</link>,  <link linkend="GtkPrintUnixDialog">GtkPrintUnixDialog</link>,  <link linkend="GtkShortcutsWindow">GtkShortcutsWindow</link> and  <link linkend="GtkWindow">GtkWindow</link>.</para>

</refsect1>

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

<refsect1 id="GtkNative.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkNative"><type>GtkNative</type></link> is the interface implemented by all widgets that can provide
a GdkSurface for widgets to render on.</para>
<para>The obvious example of a <link linkend="GtkNative"><type>GtkNative</type></link> is <link linkend="GtkWindow"><type>GtkWindow</type></link>.</para>

</refsect1>
<refsect1 id="GtkNative.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-native-get-for-surface" role="function">
<title>gtk_native_get_for_surface&#160;()</title>
<indexterm zone="gtk-native-get-for-surface"><primary>gtk_native_get_for_surface</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_native_get_for_surface (<parameter><link linkend="GdkSurface"><type>GdkSurface</type></link> *surface</parameter>);</programlisting>
<para>Finds the GtkNative associated with the surface.</para>
<refsect3 id="gtk-native-get-for-surface.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>surface</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkSurface"><type>GdkSurface</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-native-get-for-surface.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GtkNative"><type>GtkNative</type></link> that is associated with <parameter>surface</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-native-get-surface" role="function">
<title>gtk_native_get_surface&#160;()</title>
<indexterm zone="gtk-native-get-surface"><primary>gtk_native_get_surface</primary></indexterm>
<programlisting language="C"><link linkend="GdkSurface"><returnvalue>GdkSurface</returnvalue></link>&#160;*
gtk_native_get_surface (<parameter><link linkend="GtkNative"><type>GtkNative</type></link> *self</parameter>);</programlisting>
<para>Returns the surface of this <link linkend="GtkNative"><type>GtkNative</type></link>.</para>
<refsect3 id="gtk-native-get-surface.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkNative"><type>GtkNative</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-native-get-surface.returns" role="returns">
<title>Returns</title>
<para>the surface of <parameter>self</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-native-get-renderer" role="function">
<title>gtk_native_get_renderer&#160;()</title>
<indexterm zone="gtk-native-get-renderer"><primary>gtk_native_get_renderer</primary></indexterm>
<programlisting language="C"><link linkend="GskRenderer"><returnvalue>GskRenderer</returnvalue></link>&#160;*
gtk_native_get_renderer (<parameter><link linkend="GtkNative"><type>GtkNative</type></link> *self</parameter>);</programlisting>
<para>Returns the renderer that is used for this <link linkend="GtkNative"><type>GtkNative</type></link>.</para>
<refsect3 id="gtk-native-get-renderer.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkNative"><type>GtkNative</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-native-get-renderer.returns" role="returns">
<title>Returns</title>
<para>the renderer for <parameter>self</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-native-check-resize" role="function">
<title>gtk_native_check_resize&#160;()</title>
<indexterm zone="gtk-native-check-resize"><primary>gtk_native_check_resize</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_native_check_resize (<parameter><link linkend="GtkNative"><type>GtkNative</type></link> *self</parameter>);</programlisting>
<para>Reposition and resize a <link linkend="GtkNative"><type>GtkNative</type></link>.</para>
<para>Widgets need to call this function on their attached
native widgets when they receive a new size allocation.</para>
<refsect3 id="gtk-native-check-resize.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkNative"><type>GtkNative</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-native-get-surface-transform" role="function">
<title>gtk_native_get_surface_transform&#160;()</title>
<indexterm zone="gtk-native-get-surface-transform"><primary>gtk_native_get_surface_transform</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_native_get_surface_transform (<parameter><link linkend="GtkNative"><type>GtkNative</type></link> *self</parameter>,
                                  <parameter><link linkend="double"><type>double</type></link> *x</parameter>,
                                  <parameter><link linkend="double"><type>double</type></link> *y</parameter>);</programlisting>
<para>Retrieves the surface transform of <parameter>self</parameter>
. This is the translation
from <parameter>self</parameter>
's surface coordinates into <parameter>self</parameter>
's widget coordinates.</para>
<refsect3 id="gtk-native-get-surface-transform.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>self</para></entry>
<entry role="parameter_description"><para>a <parameter>GtkNative</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>x</para></entry>
<entry role="parameter_description"><para>return location for the x coordinate. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>y</para></entry>
<entry role="parameter_description"><para>return location for the y coordinate. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkNative.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkNative-struct" role="struct">
<title>GtkNative</title>
<indexterm zone="GtkNative-struct"><primary>GtkNative</primary></indexterm>
<programlisting language="C">typedef struct _GtkNative GtkNative;</programlisting>
</refsect2>
<refsect2 id="GtkNativeInterface" role="struct">
<title>struct GtkNativeInterface</title>
<indexterm zone="GtkNativeInterface"><primary>GtkNativeInterface</primary></indexterm>
<programlisting language="C">struct GtkNativeInterface {
  GdkSurface *  (* get_surface)           (GtkNative    *self);
  GskRenderer * (* get_renderer)          (GtkNative    *self);

  void          (* get_surface_transform) (GtkNative    *self,
                                           double       *x,
                                           double       *y);

  void          (* check_resize)          (GtkNative    *self);
};
</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkNative.see-also">
<title>See Also</title>
<para><link linkend="GtkRoot"><type>GtkRoot</type></link></para>

</refsect1>

</refentry>
