]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdkframeclock.c
x11: Get rid of XSettingsClient object
[~andy/gtk] / gdk / gdkframeclock.c
index 00a1631c132d416f37c6a44e9d5807b67e147983..1994b00e8ba3e6c0d4982a971e27f2add69a88c3 100644 (file)
@@ -186,7 +186,7 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
                   G_TYPE_NONE, 0);
 
   /**
-   * GdkFrameClock::layout:
+   * GdkFrameClock::paint:
    * @clock: the frame clock emitting the signal
    *
    * This signal is emitted as the third step of toolkit and
@@ -269,7 +269,7 @@ gdk_frame_clock_init (GdkFrameClock *clock)
  * Return value: a timestamp in microseconds, in the timescale of
  *  of g_get_monotonic_time().
  */
-guint64
+gint64
 gdk_frame_clock_get_frame_time (GdkFrameClock *frame_clock)
 {
   g_return_val_if_fail (GDK_IS_FRAME_CLOCK (frame_clock), 0);
@@ -285,7 +285,12 @@ gdk_frame_clock_get_frame_time (GdkFrameClock *frame_clock)
  * corresponding the requested phase will be emitted the next
  * time the frame clock processes. Multiple calls to
  * gdk_frame_clock_request_phase() will be combined togethe
- * and only one frame processed.
+ * and only one frame processed. If you are displaying animated
+ * content and want to continually request the
+ * %GDK_FRAME_CLOCK_PHASE_UPDATE phase for a period of time,
+ * you should use gdk_frame_clock_begin_updating() instead, since
+ * this allows GTK+ to adjust system parameters to get maximally
+ * smooth animations.
  *
  * Since: 3.8
  */
@@ -298,6 +303,43 @@ gdk_frame_clock_request_phase (GdkFrameClock      *frame_clock,
   GDK_FRAME_CLOCK_GET_CLASS (frame_clock)->request_phase (frame_clock, phase);
 }
 
+/**
+ * gdk_frame_clock_begin_updating:
+ * @frame_clock: a #GdkFrameClock
+ *
+ * Starts updates for an animation. Until a matching call to
+ * gdk_frame_clock_end_updating() is made, the frame clock will continually
+ * request a new frame with the %GDK_FRAME_CLOCK_PHASE_UPDATE phase.
+ * This function may be called multiple times and frames will be
+ * requested until gdk_frame_clock_end_updating() is called the same
+ * number of times.
+ *
+ * Since: 3.8
+ */
+void
+gdk_frame_clock_begin_updating (GdkFrameClock *frame_clock)
+{
+  g_return_if_fail (GDK_IS_FRAME_CLOCK (frame_clock));
+
+  GDK_FRAME_CLOCK_GET_CLASS (frame_clock)->begin_updating (frame_clock);
+}
+
+/**
+ * gdk_frame_clock_end_updating:
+ * @frame_clock: a #GdkFrameClock
+ *
+ * Stops updates for an animation. See the documentation for
+ * gdk_frame_clock_begin_updating().
+ *
+ * Since: 3.8
+ */
+void
+gdk_frame_clock_end_updating (GdkFrameClock *frame_clock)
+{
+  g_return_if_fail (GDK_IS_FRAME_CLOCK (frame_clock));
+
+  GDK_FRAME_CLOCK_GET_CLASS (frame_clock)->end_updating (frame_clock);
+}
 
 void
 _gdk_frame_clock_freeze (GdkFrameClock *clock)