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 	protected bool ownedRef;
45 
46 	/** Get the main Gtk struct */
47 	public GdkFrameTimings* getFrameTimingsStruct()
48 	{
49 		return gdkFrameTimings;
50 	}
51 
52 	/** the main Gtk struct as a void* */
53 	protected void* getStruct()
54 	{
55 		return cast(void*)gdkFrameTimings;
56 	}
57 
58 	/**
59 	 * Sets our main struct and passes it to the parent class.
60 	 */
61 	public this (GdkFrameTimings* gdkFrameTimings, bool ownedRef = false)
62 	{
63 		this.gdkFrameTimings = gdkFrameTimings;
64 		this.ownedRef = ownedRef;
65 	}
66 
67 
68 	/** */
69 	public static GType getType()
70 	{
71 		return gdk_frame_timings_get_type();
72 	}
73 
74 	/**
75 	 * The timing information in a #GdkFrameTimings is filled in
76 	 * incrementally as the frame as drawn and passed off to the
77 	 * window system for processing and display to the user. The
78 	 * accessor functions for #GdkFrameTimings can return 0 to
79 	 * indicate an unavailable value for two reasons: either because
80 	 * the information is not yet available, or because it isn't
81 	 * available at all. Once gdk_frame_timings_get_complete() returns
82 	 * %TRUE for a frame, you can be certain that no further values
83 	 * will become available and be stored in the #GdkFrameTimings.
84 	 *
85 	 * Return: %TRUE if all information that will be available
86 	 *     for the frame has been filled in.
87 	 *
88 	 * Since: 3.8
89 	 */
90 	public bool getComplete()
91 	{
92 		return gdk_frame_timings_get_complete(gdkFrameTimings) != 0;
93 	}
94 
95 	/**
96 	 * Gets the frame counter value of the #GdkFrameClock when this
97 	 * this frame was drawn.
98 	 *
99 	 * Return: the frame counter value for this frame
100 	 *
101 	 * Since: 3.8
102 	 */
103 	public long getFrameCounter()
104 	{
105 		return gdk_frame_timings_get_frame_counter(gdkFrameTimings);
106 	}
107 
108 	/**
109 	 * Returns the frame time for the frame. This is the time value
110 	 * that is typically used to time animations for the frame. See
111 	 * gdk_frame_clock_get_frame_time().
112 	 *
113 	 * Return: the frame time for the frame, in the timescale
114 	 *     of g_get_monotonic_time()
115 	 */
116 	public long getFrameTime()
117 	{
118 		return gdk_frame_timings_get_frame_time(gdkFrameTimings);
119 	}
120 
121 	/**
122 	 * Gets the predicted time at which this frame will be displayed. Although
123 	 * no predicted time may be available, if one is available, it will
124 	 * be available while the frame is being generated, in contrast to
125 	 * gdk_frame_timings_get_presentation_time(), which is only available
126 	 * after the frame has been presented. In general, if you are simply
127 	 * animating, you should use gdk_frame_clock_get_frame_time() rather
128 	 * than this function, but this function is useful for applications
129 	 * that want exact control over latency. For example, a movie player
130 	 * may want this information for Audio/Video synchronization.
131 	 *
132 	 * Return: The predicted time at which the frame will be presented,
133 	 *     in the timescale of g_get_monotonic_time(), or 0 if no predicted
134 	 *     presentation time is available.
135 	 *
136 	 * Since: 3.8
137 	 */
138 	public long getPredictedPresentationTime()
139 	{
140 		return gdk_frame_timings_get_predicted_presentation_time(gdkFrameTimings);
141 	}
142 
143 	/**
144 	 * Reurns the presentation time. This is the time at which the frame
145 	 * became visible to the user.
146 	 *
147 	 * Return: the time the frame was displayed to the user, in the
148 	 *     timescale of g_get_monotonic_time(), or 0 if no presentation
149 	 *     time is available. See gdk_frame_timings_get_complete()
150 	 *
151 	 * Since: 3.8
152 	 */
153 	public long getPresentationTime()
154 	{
155 		return gdk_frame_timings_get_presentation_time(gdkFrameTimings);
156 	}
157 
158 	/**
159 	 * Gets the natural interval between presentation times for
160 	 * the display that this frame was displayed on. Frame presentation
161 	 * usually happens during the “vertical blanking interval”.
162 	 *
163 	 * Return: the refresh interval of the display, in microseconds,
164 	 *     or 0 if the refresh interval is not available.
165 	 *     See gdk_frame_timings_get_complete().
166 	 *
167 	 * Since: 3.8
168 	 */
169 	public long getRefreshInterval()
170 	{
171 		return gdk_frame_timings_get_refresh_interval(gdkFrameTimings);
172 	}
173 
174 	/**
175 	 * Increases the reference count of @timings.
176 	 *
177 	 * Return: @timings
178 	 *
179 	 * Since: 3.8
180 	 */
181 	public FrameTimings doref()
182 	{
183 		auto p = gdk_frame_timings_ref(gdkFrameTimings);
184 		
185 		if(p is null)
186 		{
187 			return null;
188 		}
189 		
190 		return ObjectG.getDObject!(FrameTimings)(cast(GdkFrameTimings*) p, true);
191 	}
192 
193 	/**
194 	 * Decreases the reference count of @timings. If @timings
195 	 * is no longer referenced, it will be freed.
196 	 *
197 	 * Since: 3.8
198 	 */
199 	public void unref()
200 	{
201 		gdk_frame_timings_unref(gdkFrameTimings);
202 	}
203 }