summaryrefslogtreecommitdiff
path: root/gdk/gdkframeclock.h
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2012-10-03 19:38:40 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2013-02-14 17:19:48 -0500
commitc4545cc5d47364b66b7ecd7bb482210fb8c8655a (patch)
tree0afc69916a4fa8f865daa658ec91b78f82c10e1b /gdk/gdkframeclock.h
parent7753883add412a4bbc6b49b9bc7ef037c5a34c36 (diff)
downloadgtk+-c4545cc5d47364b66b7ecd7bb482210fb8c8655a.tar.gz
GdkFrameClock: Make the phase explicit when requesting the frame
Instead of having gdk_frame_clock_request_frame() have gdk_frame_clock_request_phase() where we can say what phase we need. This allows us to know if we get a frame-request during layout whether it's just a request for drawing from the layout, or whether another layout phase is needed. https://bugzilla.gnome.org/show_bug.cgi?id=685460
Diffstat (limited to 'gdk/gdkframeclock.h')
-rw-r--r--gdk/gdkframeclock.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/gdk/gdkframeclock.h b/gdk/gdkframeclock.h
index 043a890514..fe0ea58b60 100644
--- a/gdk/gdkframeclock.h
+++ b/gdk/gdkframeclock.h
@@ -43,18 +43,28 @@ G_BEGIN_DECLS
typedef struct _GdkFrameClock GdkFrameClock;
typedef struct _GdkFrameClockInterface GdkFrameClockInterface;
+typedef enum {
+ GDK_FRAME_CLOCK_PHASE_NONE = 0,
+ GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT = 1 << 0,
+ GDK_FRAME_CLOCK_PHASE_LAYOUT = 1 << 1,
+ GDK_FRAME_CLOCK_PHASE_PAINT = 1 << 2,
+ GDK_FRAME_CLOCK_PHASE_AFTER_PAINT = 1 << 3
+} GdkFrameClockPhase;
+
struct _GdkFrameClockInterface
{
GTypeInterface base_iface;
guint64 (* get_frame_time) (GdkFrameClock *clock);
- void (* request_frame) (GdkFrameClock *clock);
- gboolean (* get_frame_requested) (GdkFrameClock *clock);
+
+ void (* request_phase) (GdkFrameClock *clock,
+ GdkFrameClockPhase phase);
+ GdkFrameClockPhase (* get_requested) (GdkFrameClock *clock);
/* signals */
/* void (* frame_requested) (GdkFrameClock *clock); */
/* void (* before_paint) (GdkFrameClock *clock); */
- /* void (* layout) 1(GdkFrameClock *clock); */
+ /* void (* layout) (GdkFrameClock *clock); */
/* void (* paint) (GdkFrameClock *clock); */
/* void (* after_paint) (GdkFrameClock *clock); */
};
@@ -62,8 +72,10 @@ struct _GdkFrameClockInterface
GType gdk_frame_clock_get_type (void) G_GNUC_CONST;
guint64 gdk_frame_clock_get_frame_time (GdkFrameClock *clock);
-void gdk_frame_clock_request_frame (GdkFrameClock *clock);
-gboolean gdk_frame_clock_get_frame_requested (GdkFrameClock *clock);
+
+void gdk_frame_clock_request_phase (GdkFrameClock *clock,
+ GdkFrameClockPhase phase);
+GdkFrameClockPhase gdk_frame_clock_get_requested (GdkFrameClock *clock);
/* Convenience API */
void gdk_frame_clock_get_frame_time_val (GdkFrameClock *clock,
@@ -71,7 +83,6 @@ void gdk_frame_clock_get_frame_time_val (GdkFrameClock *clock,
/* Signal emitters (used in frame clock implementations) */
void gdk_frame_clock_frame_requested (GdkFrameClock *clock);
-void gdk_frame_clock_paint (GdkFrameClock *clock);
G_END_DECLS