#include "gdkframeclock.h"
+G_DEFINE_INTERFACE (GdkFrameClockTarget, gdk_frame_clock_target, G_TYPE_OBJECT)
+
+static void
+gdk_frame_clock_target_default_init (GdkFrameClockTargetInterface *iface)
+{
+}
+
+void gdk_frame_clock_target_set_clock (GdkFrameClockTarget *target,
+ GdkFrameClock *clock)
+{
+ GDK_FRAME_CLOCK_TARGET_GET_IFACE (target)->set_clock (target, clock);
+}
+
/**
* SECTION:frameclock
* @Short_description: Frame clock syncs painting to a window or display
* for example.
*
* A frame clock is idle until someone requests a frame with
- * gdk_frame_clock_request_frame(). At that time, the frame clock
+ * gdk_frame_clock_request_phase(). At that time, the frame clock
* emits its GdkFrameClock:frame-requested signal if no frame was
* already pending.
*
enum {
FRAME_REQUESTED,
+ FLUSH_EVENTS,
BEFORE_PAINT,
+ UPDATE,
+ LAYOUT,
PAINT,
AFTER_PAINT,
+ RESUME_EVENTS,
LAST_SIGNAL
};
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ /**
+ * GdkFrameClock::flush-events:
+ * @clock: the frame clock emitting the signal
+ *
+ * FIXME.
+ */
+ signals[FLUSH_EVENTS] =
+ g_signal_new (g_intern_static_string ("flush-events"),
+ GDK_TYPE_FRAME_CLOCK,
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
/**
* GdkFrameClock::before-paint:
* @clock: the frame clock emitting the signal
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ /**
+ * GdkFrameClock::update:
+ * @clock: the frame clock emitting the signal
+ *
+ * FIXME.
+ */
+ signals[UPDATE] =
+ g_signal_new (g_intern_static_string ("update"),
+ GDK_TYPE_FRAME_CLOCK,
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * GdkFrameClock::layout:
+ * @clock: the frame clock emitting the signal
+ *
+ * This signal is emitted immediately before the paint signal and
+ * indicates that the frame time has been updated, and signal
+ * handlers should perform any preparatory work before painting.
+ */
+ signals[LAYOUT] =
+ g_signal_new (g_intern_static_string ("layout"),
+ GDK_TYPE_FRAME_CLOCK,
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
/**
* GdkFrameClock::paint:
* @clock: the frame clock emitting the signal
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+
+ /**
+ * GdkFrameClock::resume-events:
+ * @clock: the frame clock emitting the signal
+ *
+ * FIXME.
+ */
+ signals[RESUME_EVENTS] =
+ g_signal_new (g_intern_static_string ("resume-events"),
+ GDK_TYPE_FRAME_CLOCK,
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
/**
}
/**
- * gdk_frame_clock_request_frame:
+ * gdk_frame_clock_request_phase:
* @clock: the clock
*
* Asks the frame clock to paint a frame. The frame
* Since: 3.0
*/
void
-gdk_frame_clock_request_frame (GdkFrameClock *clock)
+gdk_frame_clock_request_phase (GdkFrameClock *clock,
+ GdkFrameClockPhase phase)
+{
+ g_return_if_fail (GDK_IS_FRAME_CLOCK (clock));
+
+ GDK_FRAME_CLOCK_GET_IFACE (clock)->request_phase (clock, phase);
+}
+
+
+void
+gdk_frame_clock_freeze (GdkFrameClock *clock)
+{
+ g_return_if_fail (GDK_IS_FRAME_CLOCK (clock));
+
+ GDK_FRAME_CLOCK_GET_IFACE (clock)->freeze (clock);
+}
+
+
+void
+gdk_frame_clock_thaw (GdkFrameClock *clock)
{
g_return_if_fail (GDK_IS_FRAME_CLOCK (clock));
- GDK_FRAME_CLOCK_GET_IFACE (clock)->request_frame (clock);
+ GDK_FRAME_CLOCK_GET_IFACE (clock)->thaw (clock);
}
/**
- * gdk_frame_clock_get_frame_requested:
+ * gdk_frame_clock_get_requested:
* @clock: the clock
*
* Gets whether a frame paint has been requested but has not been
* Since: 3.0
* Return value: TRUE if a frame paint is pending
*/
-gboolean
-gdk_frame_clock_get_frame_requested (GdkFrameClock *clock)
+GdkFrameClockPhase
+gdk_frame_clock_get_requested (GdkFrameClock *clock)
{
g_return_val_if_fail (GDK_IS_FRAME_CLOCK (clock), FALSE);
- return GDK_FRAME_CLOCK_GET_IFACE (clock)->get_frame_requested (clock);
+ return GDK_FRAME_CLOCK_GET_IFACE (clock)->get_requested (clock);
}
/**
g_signal_emit (G_OBJECT (clock),
signals[FRAME_REQUESTED], 0);
}
-
-/**
- * gdk_frame_clock_paint:
- * @clock: the clock
- *
- * Emits the before-paint, paint, and after-paint signals. Used in
- * implementations of the #GdkFrameClock interface.
- */
-void
-gdk_frame_clock_paint (GdkFrameClock *clock)
-{
- g_return_if_fail (GDK_IS_FRAME_CLOCK (clock));
-
- g_signal_emit (G_OBJECT (clock),
- signals[BEFORE_PAINT], 0);
-
- g_signal_emit (G_OBJECT (clock),
- signals[PAINT], 0);
-
- g_signal_emit (G_OBJECT (clock),
- signals[AFTER_PAINT], 0);
-}