1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gdk.FrameTimings;
26 
27 private import gobject.ObjectG;
28 private import gtkc.gdk;
29 public  import gtkc.gdktypes;
30 
31 
32 /**
33  * A #GdkFrameTimings object holds timing information for a single frame
34  * of the application’s displays. To retrieve #GdkFrameTimings objects,
35  * use gdk_frame_clock_get_timings() or gdk_frame_clock_get_current_timings().
36  * The information in #GdkFrameTimings is useful for precise synchronization
37  * of video with the event or audio streams, and for measuring
38  * quality metrics for the application’s display, such as latency and jitter.
39  */
40 public class FrameTimings
41 {
42 	/** the main Gtk struct */
43 	protected GdkFrameTimings* gdkFrameTimings;
44 
45 	/** Get the main Gtk struct */
46 	public GdkFrameTimings* getFrameTimingsStruct()
47 	{
48 		return gdkFrameTimings;
49 	}
50 
51 	/** the main Gtk struct as a void* */
52 	protected void* getStruct()
53 	{
54 		return cast(void*)gdkFrameTimings;
55 	}
56 
57 	/**
58 	 * Sets our main struct and passes it to the parent class.
59 	 */
60 	public this (GdkFrameTimings* gdkFrameTimings)
61 	{
62 		this.gdkFrameTimings = gdkFrameTimings;
63 	}
64 
65 	/**
66 	 */
67 
68 	public static GType getType()
69 	{
70 		return gdk_frame_timings_get_type();
71 	}
72 
73 	/**
74 	 * The timing information in a #GdkFrameTimings is filled in
75 	 * incrementally as the frame as drawn and passed off to the
76 	 * window system for processing and display to the user. The
77 	 * accessor functions for #GdkFrameTimings can return 0 to
78 	 * indicate an unavailable value for two reasons: either because
79 	 * the information is not yet available, or because it isn't
80 	 * available at all. Once gdk_frame_timings_get_complete() returns
81 	 * %TRUE for a frame, you can be certain that no further values
82 	 * will become available and be stored in the #GdkFrameTimings.
83 	 *
84 	 * Return: %TRUE if all information that will be available
85 	 *     for the frame has been filled in.
86 	 *
87 	 * Since: 3.8
88 	 */
89 	public bool getComplete()
90 	{
91 		return gdk_frame_timings_get_complete(gdkFrameTimings) != 0;
92 	}
93 
94 	/**
95 	 * Gets the frame counter value of the #GdkFrameClock when this
96 	 * this frame was drawn.
97 	 *
98 	 * Return: the frame counter value for this frame
99 	 *
100 	 * Since: 3.8
101 	 */
102 	public long getFrameCounter()
103 	{
104 		return gdk_frame_timings_get_frame_counter(gdkFrameTimings);
105 	}
106 
107 	/**
108 	 * Returns the frame time for the frame. This is the time value
109 	 * that is typically used to time animations for the frame. See
110 	 * gdk_frame_clock_get_frame_time().
111 	 *
112 	 * Return: the frame time for the frame, in the timescale
113 	 *     of g_get_monotonic_time()
114 	 */
115 	public long getFrameTime()
116 	{
117 		return gdk_frame_timings_get_frame_time(gdkFrameTimings);
118 	}
119 
120 	/**
121 	 * Gets the predicted time at which this frame will be displayed. Although
122 	 * no predicted time may be available, if one is available, it will
123 	 * be available while the frame is being generated, in contrast to
124 	 * gdk_frame_timings_get_presentation_time(), which is only available
125 	 * after the frame has been presented. In general, if you are simply
126 	 * animating, you should use gdk_frame_clock_get_frame_time() rather
127 	 * than this function, but this function is useful for applications
128 	 * that want exact control over latency. For example, a movie player
129 	 * may want this information for Audio/Video synchronization.
130 	 *
131 	 * Return: The predicted time at which the frame will be presented,
132 	 *     in the timescale of g_get_monotonic_time(), or 0 if no predicted
133 	 *     presentation time is available.
134 	 *
135 	 * Since: 3.8
136 	 */
137 	public long getPredictedPresentationTime()
138 	{
139 		return gdk_frame_timings_get_predicted_presentation_time(gdkFrameTimings);
140 	}
141 
142 	/**
143 	 * Reurns the presentation time. This is the time at which the frame
144 	 * became visible to the user.
145 	 *
146 	 * Return: the time the frame was displayed to the user, in the
147 	 *     timescale of g_get_monotonic_time(), or 0 if no presentation
148 	 *     time is available. See gdk_frame_timings_get_complete()
149 	 *
150 	 * Since: 3.8
151 	 */
152 	public long getPresentationTime()
153 	{
154 		return gdk_frame_timings_get_presentation_time(gdkFrameTimings);
155 	}
156 
157 	/**
158 	 * Gets the natural interval between presentation times for
159 	 * the display that this frame was displayed on. Frame presentation
160 	 * usually happens during the “vertical blanking interval”.
161 	 *
162 	 * Return: the refresh interval of the display, in microseconds,
163 	 *     or 0 if the refresh interval is not available.
164 	 *     See gdk_frame_timings_get_complete().
165 	 *
166 	 * Since: 3.8
167 	 */
168 	public long getRefreshInterval()
169 	{
170 		return gdk_frame_timings_get_refresh_interval(gdkFrameTimings);
171 	}
172 
173 	/**
174 	 * Increases the reference count of @timings.
175 	 *
176 	 * Return: @timings
177 	 *
178 	 * Since: 3.8
179 	 */
180 	public FrameTimings doref()
181 	{
182 		auto p = gdk_frame_timings_ref(gdkFrameTimings);
183 		
184 		if(p is null)
185 		{
186 			return null;
187 		}
188 		
189 		return ObjectG.getDObject!(FrameTimings)(cast(GdkFrameTimings*) p);
190 	}
191 
192 	/**
193 	 * Decreases the reference count of @timings. If @timings
194 	 * is no longer referenced, it will be freed.
195 	 *
196 	 * Since: 3.8
197 	 */
198 	public void unref()
199 	{
200 		gdk_frame_timings_unref(gdkFrameTimings);
201 	}
202 }