1 | /* GDK - The GIMP Drawing Kit |
2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library; if not, see <http://www.gnu.org/licenses/>. |
16 | */ |
17 | |
18 | /* |
19 | * Modified by the GTK+ Team and others 1997-2010. See the AUTHORS |
20 | * file for a list of people on the GTK+ Team. See the ChangeLog |
21 | * files for a list of changes. These files are distributed with |
22 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
23 | */ |
24 | |
25 | /* Uninstalled header, internal to GDK */ |
26 | |
27 | #ifndef __GDK_FRAME_CLOCK_PRIVATE_H__ |
28 | #define __GDK_FRAME_CLOCK_PRIVATE_H__ |
29 | |
30 | #include <gdk/gdkframeclock.h> |
31 | |
32 | G_BEGIN_DECLS |
33 | |
34 | /** |
35 | * GdkFrameClock: |
36 | * @parent_instance: The parent instance. |
37 | */ |
38 | struct _GdkFrameClock |
39 | { |
40 | GObject parent_instance; |
41 | |
42 | /*< private >*/ |
43 | GdkFrameClockPrivate *priv; |
44 | }; |
45 | |
46 | /** |
47 | * GdkFrameClockClass: |
48 | * @parent_class: The parent class. |
49 | |
50 | * @get_frame_time: Gets the time that should currently be used for |
51 | * animations. |
52 | * @request_phase: Asks the frame clock to run a particular phase. |
53 | * @begin_updating: Starts updates for an animation. |
54 | * @end_updating: Stops updates for an animation. |
55 | * @freeze: |
56 | * @thaw: |
57 | */ |
58 | struct _GdkFrameClockClass |
59 | { |
60 | GObjectClass parent_class; |
61 | |
62 | /*< public >*/ |
63 | |
64 | gint64 (* get_frame_time) (GdkFrameClock *clock); |
65 | |
66 | void (* request_phase) (GdkFrameClock *clock, |
67 | GdkFrameClockPhase phase); |
68 | void (* begin_updating) (GdkFrameClock *clock); |
69 | void (* end_updating) (GdkFrameClock *clock); |
70 | |
71 | void (* freeze) (GdkFrameClock *clock); |
72 | void (* thaw) (GdkFrameClock *clock); |
73 | |
74 | /* signals */ |
75 | /* void (* flush_events) (GdkFrameClock *clock); */ |
76 | /* void (* before_paint) (GdkFrameClock *clock); */ |
77 | /* void (* update) (GdkFrameClock *clock); */ |
78 | /* void (* layout) (GdkFrameClock *clock); */ |
79 | /* void (* paint) (GdkFrameClock *clock); */ |
80 | /* void (* after_paint) (GdkFrameClock *clock); */ |
81 | /* void (* resume_events) (GdkFrameClock *clock); */ |
82 | }; |
83 | |
84 | struct _GdkFrameTimings |
85 | { |
86 | /*< private >*/ |
87 | guint ref_count; |
88 | |
89 | gint64 frame_counter; |
90 | guint64 cookie; |
91 | gint64 frame_time; |
92 | gint64 drawn_time; |
93 | gint64 presentation_time; |
94 | gint64 refresh_interval; |
95 | gint64 predicted_presentation_time; |
96 | |
97 | #ifdef G_ENABLE_DEBUG |
98 | gint64 layout_start_time; |
99 | gint64 paint_start_time; |
100 | gint64 frame_end_time; |
101 | #endif /* G_ENABLE_DEBUG */ |
102 | |
103 | guint complete : 1; |
104 | guint slept_before : 1; |
105 | }; |
106 | |
107 | void _gdk_frame_clock_freeze (GdkFrameClock *clock); |
108 | void _gdk_frame_clock_thaw (GdkFrameClock *clock); |
109 | |
110 | void _gdk_frame_clock_begin_frame (GdkFrameClock *clock); |
111 | void _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock, |
112 | GdkFrameTimings *timings); |
113 | |
114 | GdkFrameTimings *_gdk_frame_timings_new (gint64 frame_counter); |
115 | gboolean _gdk_frame_timings_steal (GdkFrameTimings *timings, |
116 | gint64 frame_counter); |
117 | |
118 | void _gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock); |
119 | void _gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock); |
120 | void _gdk_frame_clock_emit_update (GdkFrameClock *frame_clock); |
121 | void _gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock); |
122 | void _gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock); |
123 | void _gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock); |
124 | void _gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock); |
125 | |
126 | G_END_DECLS |
127 | |
128 | #endif /* __GDK_FRAME_CLOCK_PRIVATE_H__ */ |
129 | |