<?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="GdkFrameClock">
<refmeta>
<refentrytitle role="top_of_page" id="GdkFrameClock.top_of_page">Frame clock</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Frame clock</refname>
<refpurpose>Frame clock syncs painting to a window or display</refpurpose>
</refnamediv>

<refsect1 id="GdkFrameClock.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="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-clock-get-frame-time">gdk_frame_clock_get_frame_time</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-frame-clock-request-phase">gdk_frame_clock_request_phase</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-frame-clock-begin-updating">gdk_frame_clock_begin_updating</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-frame-clock-end-updating">gdk_frame_clock_end_updating</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-clock-get-frame-counter">gdk_frame_clock_get_frame_counter</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-clock-get-history-start">gdk_frame_clock_get_history_start</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkFrameTimings"><returnvalue>GdkFrameTimings</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-frame-clock-get-timings">gdk_frame_clock_get_timings</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkFrameTimings"><returnvalue>GdkFrameTimings</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-frame-clock-get-current-timings">gdk_frame_clock_get_current_timings</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-frame-clock-get-refresh-info">gdk_frame_clock_get_refresh_info</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="double"><returnvalue>double</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-clock-get-fps">gdk_frame_clock_get_fps</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkFrameClock.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="GdkFrameClock-after-paint">after-paint</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkFrameClock-before-paint">before-paint</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkFrameClock-flush-events">flush-events</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkFrameClock-layout">layout</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkFrameClock-paint">paint</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkFrameClock-resume-events">resume-events</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkFrameClock-update">update</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkFrameClock.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> GdkFrameClock
</screen>
</refsect1>

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

<refsect1 id="GdkFrameClock.description" role="desc">
<title role="desc.title">Description</title>
<para>A <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> tells the application when to update and repaint a
window. This may be synced to the vertical refresh rate of the
monitor, for example. Even when the frame clock uses a simple timer
rather than a hardware-based vertical sync, the frame clock helps
because it ensures everything paints at the same time (reducing the
total number of frames). The frame clock can also automatically
stop painting when it knows the frames will not be visible, or
scale back animation framerates.</para>
<para><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> is designed to be compatible with an OpenGL-based
implementation or with mozRequestAnimationFrame in Firefox,
for example.</para>
<para>A frame clock is idle until someone requests a frame with
<link linkend="gdk-frame-clock-request-phase"><function>gdk_frame_clock_request_phase()</function></link>. At some later point that makes
sense for the synchronization being implemented, the clock will
process a frame and emit signals for each phase that has been
requested. (See the signals of the <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> class for
documentation of the phases. <link linkend="GDK-FRAME-CLOCK-PHASE-UPDATE:CAPS"><literal>GDK_FRAME_CLOCK_PHASE_UPDATE</literal></link> and the
<link linkend="GdkFrameClock-update"><type>“update”</type></link> signal are most interesting for application
writers, and are used to update the animations, using the frame time
given by <link linkend="gdk-frame-clock-get-frame-time"><function>gdk_frame_clock_get_frame_time()</function></link>.</para>
<para>The frame time is reported in microseconds and generally in the same
timescale as <link linkend="g-get-monotonic-time"><function>g_get_monotonic_time()</function></link>, however, it is not the same
as <link linkend="g-get-monotonic-time"><function>g_get_monotonic_time()</function></link>. The frame time does not advance during
the time a frame is being painted, and outside of a frame, an attempt
is made so that all calls to <link linkend="gdk-frame-clock-get-frame-time"><function>gdk_frame_clock_get_frame_time()</function></link> that
are called at a “similar” time get the same value. This means that
if different animations are timed by looking at the difference in
time between an initial value from <link linkend="gdk-frame-clock-get-frame-time"><function>gdk_frame_clock_get_frame_time()</function></link>
and the value inside the <link linkend="GdkFrameClock-update"><type>“update”</type></link> signal of the clock,
they will stay exactly synchronized.</para>

</refsect1>
<refsect1 id="GdkFrameClock.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-frame-clock-get-frame-time" role="function">
<title>gdk_frame_clock_get_frame_time&#160;()</title>
<indexterm zone="gdk-frame-clock-get-frame-time"><primary>gdk_frame_clock_get_frame_time</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
gdk_frame_clock_get_frame_time (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>);</programlisting>
<para>Gets the time that should currently be used for animations.  Inside
the processing of a frame, it’s the time used to compute the
animation position of everything in a frame. Outside of a frame, it's
the time of the conceptual “previous frame,” which may be either
the actual previous frame time, or if that’s too old, an updated
time.</para>
<refsect3 id="gdk-frame-clock-get-frame-time.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-clock-get-frame-time.returns" role="returns">
<title>Returns</title>
<para> a timestamp in microseconds, in the timescale of
of <link linkend="g-get-monotonic-time"><function>g_get_monotonic_time()</function></link>.</para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-request-phase" role="function">
<title>gdk_frame_clock_request_phase&#160;()</title>
<indexterm zone="gdk-frame-clock-request-phase"><primary>gdk_frame_clock_request_phase</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_frame_clock_request_phase (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>,
                               <parameter><link linkend="GdkFrameClockPhase"><type>GdkFrameClockPhase</type></link> phase</parameter>);</programlisting>
<para>Asks the frame clock to run a particular phase. The signal
corresponding the requested phase will be emitted the next
time the frame clock processes. Multiple calls to
<link linkend="gdk-frame-clock-request-phase"><function>gdk_frame_clock_request_phase()</function></link> will be combined together
and only one frame processed. If you are displaying animated
content and want to continually request the
<link linkend="GDK-FRAME-CLOCK-PHASE-UPDATE:CAPS"><literal>GDK_FRAME_CLOCK_PHASE_UPDATE</literal></link> phase for a period of time,
you should use <link linkend="gdk-frame-clock-begin-updating"><function>gdk_frame_clock_begin_updating()</function></link> instead, since
this allows GTK to adjust system parameters to get maximally
smooth animations.</para>
<refsect3 id="gdk-frame-clock-request-phase.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>phase</para></entry>
<entry role="parameter_description"><para>the phase that is requested</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-begin-updating" role="function">
<title>gdk_frame_clock_begin_updating&#160;()</title>
<indexterm zone="gdk-frame-clock-begin-updating"><primary>gdk_frame_clock_begin_updating</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_frame_clock_begin_updating (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>);</programlisting>
<para>Starts updates for an animation. Until a matching call to
<link linkend="gdk-frame-clock-end-updating"><function>gdk_frame_clock_end_updating()</function></link> is made, the frame clock will continually
request a new frame with the <link linkend="GDK-FRAME-CLOCK-PHASE-UPDATE:CAPS"><literal>GDK_FRAME_CLOCK_PHASE_UPDATE</literal></link> phase.
This function may be called multiple times and frames will be
requested until <link linkend="gdk-frame-clock-end-updating"><function>gdk_frame_clock_end_updating()</function></link> is called the same
number of times.</para>
<refsect3 id="gdk-frame-clock-begin-updating.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-end-updating" role="function">
<title>gdk_frame_clock_end_updating&#160;()</title>
<indexterm zone="gdk-frame-clock-end-updating"><primary>gdk_frame_clock_end_updating</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_frame_clock_end_updating (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>);</programlisting>
<para>Stops updates for an animation. See the documentation for
<link linkend="gdk-frame-clock-begin-updating"><function>gdk_frame_clock_begin_updating()</function></link>.</para>
<refsect3 id="gdk-frame-clock-end-updating.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-get-frame-counter" role="function">
<title>gdk_frame_clock_get_frame_counter&#160;()</title>
<indexterm zone="gdk-frame-clock-get-frame-counter"><primary>gdk_frame_clock_get_frame_counter</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
gdk_frame_clock_get_frame_counter (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>);</programlisting>
<para>A <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> maintains a 64-bit counter that increments for
each frame drawn.</para>
<refsect3 id="gdk-frame-clock-get-frame-counter.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-clock-get-frame-counter.returns" role="returns">
<title>Returns</title>
<para> inside frame processing, the value of the frame counter
for the current frame. Outside of frame processing, the frame
counter for the last frame.</para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-get-history-start" role="function">
<title>gdk_frame_clock_get_history_start&#160;()</title>
<indexterm zone="gdk-frame-clock-get-history-start"><primary>gdk_frame_clock_get_history_start</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
gdk_frame_clock_get_history_start (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>);</programlisting>
<para><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> internally keeps a history of <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link>
objects for recent frames that can be retrieved with
<link linkend="gdk-frame-clock-get-timings"><function>gdk_frame_clock_get_timings()</function></link>. The set of stored frames
is the set from the counter values given by
<link linkend="gdk-frame-clock-get-history-start"><function>gdk_frame_clock_get_history_start()</function></link> and
<link linkend="gdk-frame-clock-get-frame-counter"><function>gdk_frame_clock_get_frame_counter()</function></link>, inclusive.</para>
<refsect3 id="gdk-frame-clock-get-history-start.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-clock-get-history-start.returns" role="returns">
<title>Returns</title>
<para> the frame counter value for the oldest frame
that is available in the internal frame history of the
<link linkend="GdkFrameClock"><type>GdkFrameClock</type></link>.</para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-get-timings" role="function">
<title>gdk_frame_clock_get_timings&#160;()</title>
<indexterm zone="gdk-frame-clock-get-timings"><primary>gdk_frame_clock_get_timings</primary></indexterm>
<programlisting language="C"><link linkend="GdkFrameTimings"><returnvalue>GdkFrameTimings</returnvalue></link>&#160;*
gdk_frame_clock_get_timings (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>,
                             <parameter><link linkend="gint64"><type>gint64</type></link> frame_counter</parameter>);</programlisting>
<para>Retrieves a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> object holding timing information
for the current frame or a recent frame. The <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link>
object may not yet be complete: see <link linkend="gdk-frame-timings-get-complete"><function>gdk_frame_timings_get_complete()</function></link>.</para>
<refsect3 id="gdk-frame-clock-get-timings.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>frame_counter</para></entry>
<entry role="parameter_description"><para>the frame counter value identifying the frame to
be received.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-clock-get-timings.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> object for
the specified frame, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if it is not available. See
<link linkend="gdk-frame-clock-get-history-start"><function>gdk_frame_clock_get_history_start()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-get-current-timings" role="function">
<title>gdk_frame_clock_get_current_timings&#160;()</title>
<indexterm zone="gdk-frame-clock-get-current-timings"><primary>gdk_frame_clock_get_current_timings</primary></indexterm>
<programlisting language="C"><link linkend="GdkFrameTimings"><returnvalue>GdkFrameTimings</returnvalue></link>&#160;*
gdk_frame_clock_get_current_timings (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>);</programlisting>
<para>Gets the frame timings for the current frame.</para>
<refsect3 id="gdk-frame-clock-get-current-timings.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-clock-get-current-timings.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> for the
frame currently being processed, or even no frame is being
processed, for the previous frame. Before any frames have been
processed, returns <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-get-refresh-info" role="function">
<title>gdk_frame_clock_get_refresh_info&#160;()</title>
<indexterm zone="gdk-frame-clock-get-refresh-info"><primary>gdk_frame_clock_get_refresh_info</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_frame_clock_get_refresh_info (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>,
                                  <parameter><link linkend="gint64"><type>gint64</type></link> base_time</parameter>,
                                  <parameter><link linkend="gint64"><type>gint64</type></link> *refresh_interval_return</parameter>,
                                  <parameter><link linkend="gint64"><type>gint64</type></link> *presentation_time_return</parameter>);</programlisting>
<para>Using the frame history stored in the frame clock, finds the last
known presentation time and refresh interval, and assuming that
presentation times are separated by the refresh interval,
predicts a presentation time that is a multiple of the refresh
interval after the last presentation time, and later than <parameter>base_time</parameter>
.</para>
<refsect3 id="gdk-frame-clock-get-refresh-info.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>base_time</para></entry>
<entry role="parameter_description"><para>base time for determining a presentaton time</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>refresh_interval_return</para></entry>
<entry role="parameter_description"><para>a location to store the
determined refresh interval, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. A default refresh interval of
1/60th of a second will be stored if no history is present. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>presentation_time_return</para></entry>
<entry role="parameter_description"><para>a location to store the next
candidate presentation time after the given base time.
0 will be will be stored if no history is present. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-frame-clock-get-fps" role="function">
<title>gdk_frame_clock_get_fps&#160;()</title>
<indexterm zone="gdk-frame-clock-get-fps"><primary>gdk_frame_clock_get_fps</primary></indexterm>
<programlisting language="C"><link linkend="double"><returnvalue>double</returnvalue></link>
gdk_frame_clock_get_fps (<parameter><link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *frame_clock</parameter>);</programlisting>
<para>Calculates the current frames-per-second, based on the
frame timings of <parameter>frame_clock</parameter>
.</para>
<refsect3 id="gdk-frame-clock-get-fps.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>frame_clock</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-clock-get-fps.returns" role="returns">
<title>Returns</title>
<para> the current fps, as a double</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GdkFrameClock.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkFrameClock-struct" role="struct">
<title>GdkFrameClock</title>
<indexterm zone="GdkFrameClock-struct"><primary>GdkFrameClock</primary></indexterm>
<programlisting language="C">typedef struct _GdkFrameClock GdkFrameClock;</programlisting>
<refsect3 id="GdkFrameClock.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>
<refsect2 id="GdkFrameClockPhase" role="enum">
<title>enum GdkFrameClockPhase</title>
<indexterm zone="GdkFrameClockPhase"><primary>GdkFrameClockPhase</primary></indexterm>
<para><link linkend="GdkFrameClockPhase"><type>GdkFrameClockPhase</type></link> is used to represent the different paint clock
phases that can be requested. The elements of the enumeration
correspond to the signals of <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link>.</para>
<refsect3 id="GdkFrameClockPhase.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="GDK-FRAME-CLOCK-PHASE-NONE:CAPS">GDK_FRAME_CLOCK_PHASE_NONE</para></entry>
<entry role="enum_member_description"><para>no phase</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-FRAME-CLOCK-PHASE-FLUSH-EVENTS:CAPS">GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS</para></entry>
<entry role="enum_member_description"><para>corresponds to GdkFrameClock::flush-events. Should not be handled by applications.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-FRAME-CLOCK-PHASE-BEFORE-PAINT:CAPS">GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT</para></entry>
<entry role="enum_member_description"><para>corresponds to GdkFrameClock::before-paint. Should not be handled by applications.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-FRAME-CLOCK-PHASE-UPDATE:CAPS">GDK_FRAME_CLOCK_PHASE_UPDATE</para></entry>
<entry role="enum_member_description"><para>corresponds to GdkFrameClock::update.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-FRAME-CLOCK-PHASE-LAYOUT:CAPS">GDK_FRAME_CLOCK_PHASE_LAYOUT</para></entry>
<entry role="enum_member_description"><para>corresponds to GdkFrameClock::layout.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-FRAME-CLOCK-PHASE-PAINT:CAPS">GDK_FRAME_CLOCK_PHASE_PAINT</para></entry>
<entry role="enum_member_description"><para>corresponds to GdkFrameClock::paint.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-FRAME-CLOCK-PHASE-RESUME-EVENTS:CAPS">GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS</para></entry>
<entry role="enum_member_description"><para>corresponds to GdkFrameClock::resume-events. Should not be handled by applications.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-FRAME-CLOCK-PHASE-AFTER-PAINT:CAPS">GDK_FRAME_CLOCK_PHASE_AFTER_PAINT</para></entry>
<entry role="enum_member_description"><para>corresponds to GdkFrameClock::after-paint. Should not be handled by applications.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GdkFrameClock.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GdkFrameClock-after-paint" role="signal"><title>The <literal>“after-paint”</literal> signal</title>
<indexterm zone="GdkFrameClock-after-paint"><primary>GdkFrameClock::after-paint</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *clock,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>This signal ends processing of the frame. Applications
should generally not handle this signal.</para>
<refsect3 id="GdkFrameClock-after-paint.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>clock</para></entry>
<entry role="parameter_description"><para>the frame clock emitting the signal</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><refsect2 id="GdkFrameClock-before-paint" role="signal"><title>The <literal>“before-paint”</literal> signal</title>
<indexterm zone="GdkFrameClock-before-paint"><primary>GdkFrameClock::before-paint</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *clock,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>This signal begins processing of the frame. Applications
should generally not handle this signal.</para>
<refsect3 id="GdkFrameClock-before-paint.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>clock</para></entry>
<entry role="parameter_description"><para>the frame clock emitting the signal</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><refsect2 id="GdkFrameClock-flush-events" role="signal"><title>The <literal>“flush-events”</literal> signal</title>
<indexterm zone="GdkFrameClock-flush-events"><primary>GdkFrameClock::flush-events</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *clock,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>This signal is used to flush pending motion events that
are being batched up and compressed together. Applications
should not handle this signal.</para>
<refsect3 id="GdkFrameClock-flush-events.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>clock</para></entry>
<entry role="parameter_description"><para>the frame clock emitting the signal</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><refsect2 id="GdkFrameClock-layout" role="signal"><title>The <literal>“layout”</literal> signal</title>
<indexterm zone="GdkFrameClock-layout"><primary>GdkFrameClock::layout</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *clock,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>This signal is emitted as the second step of toolkit and
application processing of the frame. Any work to update
sizes and positions of application elements should be
performed. GTK normally handles this internally.</para>
<refsect3 id="GdkFrameClock-layout.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>clock</para></entry>
<entry role="parameter_description"><para>the frame clock emitting the signal</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><refsect2 id="GdkFrameClock-paint" role="signal"><title>The <literal>“paint”</literal> signal</title>
<indexterm zone="GdkFrameClock-paint"><primary>GdkFrameClock::paint</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *clock,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>This signal is emitted as the third step of toolkit and
application processing of the frame. The frame is
repainted. GDK normally handles this internally and
emits <link linkend="GdkSurface-render"><type>“render”</type></link> which are turned into
<link linkend="GtkWidget-snapshot"><type>“snapshot”</type></link> signals by GTK.</para>
<refsect3 id="GdkFrameClock-paint.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>clock</para></entry>
<entry role="parameter_description"><para>the frame clock emitting the signal</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><refsect2 id="GdkFrameClock-resume-events" role="signal"><title>The <literal>“resume-events”</literal> signal</title>
<indexterm zone="GdkFrameClock-resume-events"><primary>GdkFrameClock::resume-events</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *clock,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>This signal is emitted after processing of the frame is
finished, and is handled internally by GTK to resume normal
event processing. Applications should not handle this signal.</para>
<refsect3 id="GdkFrameClock-resume-events.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>clock</para></entry>
<entry role="parameter_description"><para>the frame clock emitting the signal</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><refsect2 id="GdkFrameClock-update" role="signal"><title>The <literal>“update”</literal> signal</title>
<indexterm zone="GdkFrameClock-update"><primary>GdkFrameClock::update</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> *clock,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>This signal is emitted as the first step of toolkit and
application processing of the frame. Animations should
be updated using <link linkend="gdk-frame-clock-get-frame-time"><function>gdk_frame_clock_get_frame_time()</function></link>.
Applications can connect directly to this signal, or
use <link linkend="gtk-widget-add-tick-callback"><function>gtk_widget_add_tick_callback()</function></link> as a more convenient
interface.</para>
<refsect3 id="GdkFrameClock-update.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>clock</para></entry>
<entry role="parameter_description"><para>the frame clock emitting the signal</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>
