summaryrefslogtreecommitdiff
path: root/gdk/gdkframeclock.h
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2013-02-12 15:02:21 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2013-02-14 17:19:52 -0500
commit5f2d1654a5085fb64af96310e297db4a7c4a39c2 (patch)
treeb74dd1c718660dbe14b98a5efe566c7a3290ebcf /gdk/gdkframeclock.h
parentbe22b9fbb9ecd683b9b41d64144460f41d07f248 (diff)
downloadgtk+-5f2d1654a5085fb64af96310e297db4a7c4a39c2.tar.gz
Change GdkFrameClock from an interface to a class
It's unlikely that anyone will want to have, say, a GtkWidget that also acts as a GdkFrameClock, so an abstract base class is as flexible as making GdkFrameClock an interface, but has advantages: - If we decide to never make implementing your own frame clock possible, we can remove the virtualization. - We can put functionality like history into the base class. - Avoids the oddity of a interface without a public interface VTable, which may cause problems for language bindings.
Diffstat (limited to 'gdk/gdkframeclock.h')
-rw-r--r--gdk/gdkframeclock.h44
1 files changed, 9 insertions, 35 deletions
diff --git a/gdk/gdkframeclock.h b/gdk/gdkframeclock.h
index ba6a59f40a..608d74320b 100644
--- a/gdk/gdkframeclock.h
+++ b/gdk/gdkframeclock.h
@@ -35,13 +35,16 @@
G_BEGIN_DECLS
-typedef struct _GdkFrameClock GdkFrameClock;
-typedef struct _GdkFrameClockInterface GdkFrameClockInterface;
+#define GDK_TYPE_FRAME_CLOCK (gdk_frame_clock_get_type ())
+#define GDK_FRAME_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_FRAME_CLOCK, GdkFrameClock))
+#define GDK_FRAME_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_FRAME_CLOCK, GdkFrameClockClass))
+#define GDK_IS_FRAME_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_FRAME_CLOCK))
+#define GDK_IS_FRAME_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_FRAME_CLOCK))
+#define GDK_FRAME_CLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_FRAME_CLOCK, GdkFrameClockClass))
-#define GDK_TYPE_FRAME_CLOCK (gdk_frame_clock_get_type ())
-#define GDK_FRAME_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_FRAME_CLOCK, GdkFrameClock))
-#define GDK_IS_FRAME_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_FRAME_CLOCK))
-#define GDK_FRAME_CLOCK_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GDK_TYPE_FRAME_CLOCK, GdkFrameClockInterface))
+typedef struct _GdkFrameClock GdkFrameClock;
+typedef struct _GdkFrameClockPrivate GdkFrameClockPrivate;
+typedef struct _GdkFrameClockClass GdkFrameClockClass;
typedef enum {
GDK_FRAME_CLOCK_PHASE_NONE = 0,
@@ -54,32 +57,6 @@ typedef enum {
GDK_FRAME_CLOCK_PHASE_AFTER_PAINT = 1 << 6
} GdkFrameClockPhase;
-struct _GdkFrameClockInterface
-{
- GTypeInterface base_iface;
-
- guint64 (* get_frame_time) (GdkFrameClock *clock);
-
- void (* request_phase) (GdkFrameClock *clock,
- GdkFrameClockPhase phase);
- GdkFrameClockPhase (* get_requested) (GdkFrameClock *clock);
-
- void (* freeze) (GdkFrameClock *clock);
- void (* thaw) (GdkFrameClock *clock);
-
- GdkFrameHistory * (* get_history) (GdkFrameClock *clock);
-
- /* signals */
- /* void (* frame_requested) (GdkFrameClock *clock); */
- /* void (* flush_events) (GdkFrameClock *clock); */
- /* void (* before_paint) (GdkFrameClock *clock); */
- /* void (* update) (GdkFrameClock *clock); */
- /* void (* layout) (GdkFrameClock *clock); */
- /* void (* paint) (GdkFrameClock *clock); */
- /* void (* after_paint) (GdkFrameClock *clock); */
- /* void (* resume_events) (GdkFrameClock *clock); */
-};
-
GType gdk_frame_clock_get_type (void) G_GNUC_CONST;
guint64 gdk_frame_clock_get_frame_time (GdkFrameClock *clock);
@@ -104,9 +81,6 @@ void gdk_frame_clock_get_refresh_info (GdkFrameClock *clock,
GdkFrameTimings *gdk_frame_clock_get_current_frame_timings (GdkFrameClock *clock);
-/* Signal emitters (used in frame clock implementations) */
-void gdk_frame_clock_frame_requested (GdkFrameClock *clock);
-
G_END_DECLS
#endif /* __GDK_FRAME_CLOCK_H__ */