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  * Conversion parameters:
26  * inFile  = gdk3-GdkFrameTimings.html
27  * outPack = gdk
28  * outFile = FrameTimings
29  * strct   = GdkFrameTimings
30  * realStrct=
31  * ctorStrct=
32  * clss    = FrameTimings
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gdk_frame_timings_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * structWrap:
47  * 	- GdkFrameTimings* -> FrameTimings
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gdk.FrameTimings;
54 
55 public  import gtkc.gdktypes;
56 
57 private import gtkc.gdk;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 
62 
63 
64 
65 
66 /**
67  * A GdkFrameTimings object holds timing information for a single frame
68  * of the application's displays. To retrieve GdkFrameTimings objects,
69  * use gdk_frame_clock_get_timings() or gdk_frame_clock_get_current_timings().
70  * The information in GdkFrameTimings is useful for precise synchronization
71  * of video with the event or audio streams, and for measuring
72  * quality metrics for the application's display, such as latency and jitter.
73  */
74 public class FrameTimings
75 {
76 	
77 	/** the main Gtk struct */
78 	protected GdkFrameTimings* gdkFrameTimings;
79 	
80 	
81 	public GdkFrameTimings* getFrameTimingsStruct()
82 	{
83 		return gdkFrameTimings;
84 	}
85 	
86 	
87 	/** the main Gtk struct as a void* */
88 	protected void* getStruct()
89 	{
90 		return cast(void*)gdkFrameTimings;
91 	}
92 	
93 	/**
94 	 * Sets our main struct and passes it to the parent class
95 	 */
96 	public this (GdkFrameTimings* gdkFrameTimings)
97 	{
98 		this.gdkFrameTimings = gdkFrameTimings;
99 	}
100 	
101 	/**
102 	 */
103 	
104 	/**
105 	 * Increases the reference count of timings.
106 	 * Returns: timings Since 3.8
107 	 */
108 	public FrameTimings doref()
109 	{
110 		// GdkFrameTimings * gdk_frame_timings_ref (GdkFrameTimings *timings);
111 		auto p = gdk_frame_timings_ref(gdkFrameTimings);
112 		
113 		if(p is null)
114 		{
115 			return null;
116 		}
117 		
118 		return ObjectG.getDObject!(FrameTimings)(cast(GdkFrameTimings*) p);
119 	}
120 	
121 	/**
122 	 * Decreases the reference count of timings. If timings
123 	 * is no longer referenced, it will be freed.
124 	 */
125 	public void unref()
126 	{
127 		// void gdk_frame_timings_unref (GdkFrameTimings *timings);
128 		gdk_frame_timings_unref(gdkFrameTimings);
129 	}
130 	
131 	/**
132 	 * Gets the frame counter value of the GdkFrameClock when this
133 	 * this frame was drawn.
134 	 * Returns: the frame counter value for this frame Since 3.8
135 	 */
136 	public long getFrameCounter()
137 	{
138 		// gint64 gdk_frame_timings_get_frame_counter (GdkFrameTimings *timings);
139 		return gdk_frame_timings_get_frame_counter(gdkFrameTimings);
140 	}
141 	
142 	/**
143 	 * The timing information in a GdkFrameTimings is filled in
144 	 * incrementally as the frame as drawn and passed off to the
145 	 * window system for processing and display to the user. The
146 	 * accessor functions for GdkFrameTimings can return 0 to
147 	 * indicate an unavailable value for two reasons: either because
148 	 * the information is not yet available, or because it isn't
149 	 * available at all. Once gdk_frame_timings_complete() returns
150 	 * TRUE for a frame, you can be certain that no further values
151 	 * will become available and be stored in the GdkFrameTimings.
152 	 * Returns: TRUE if all information that will be available for the frame has been filled in. Since 3.8
153 	 */
154 	public int getComplete()
155 	{
156 		// gboolean gdk_frame_timings_get_complete (GdkFrameTimings *timings);
157 		return gdk_frame_timings_get_complete(gdkFrameTimings);
158 	}
159 	
160 	/**
161 	 * Returns the frame time for the frame. This is the time value
162 	 * that is typically used to time animations for the frame. See
163 	 * gdk_frame_clock_get_frame_time().
164 	 * Returns: the frame time for the frame, in the timescale of g_get_monotonic_time()
165 	 */
166 	public long getFrameTime()
167 	{
168 		// gint64 gdk_frame_timings_get_frame_time (GdkFrameTimings *timings);
169 		return gdk_frame_timings_get_frame_time(gdkFrameTimings);
170 	}
171 	
172 	/**
173 	 * Reurns the presentation time. This is the time at which the frame
174 	 * became visible to the user.
175 	 * Returns: the time the frame was displayed to the user, in the timescale of g_get_monotonic_time(), or 0 if no presentation time is available. See gdk_frame_timings_get_complete() Since 3.8
176 	 */
177 	public long getPresentationTime()
178 	{
179 		// gint64 gdk_frame_timings_get_presentation_time  (GdkFrameTimings *timings);
180 		return gdk_frame_timings_get_presentation_time(gdkFrameTimings);
181 	}
182 	
183 	/**
184 	 * Gets the natural interval between presentation times for
185 	 * the display that this frame was displayed on. Frame presentation
186 	 * usually happens during the "vertical blanking interval".
187 	 * Returns: the refresh interval of the display, in microseconds, or 0 if the refresh interval is not available. See gdk_frame_timings_get_complete(). Since 3.8
188 	 */
189 	public long getRefreshInterval()
190 	{
191 		// gint64 gdk_frame_timings_get_refresh_interval  (GdkFrameTimings *timings);
192 		return gdk_frame_timings_get_refresh_interval(gdkFrameTimings);
193 	}
194 	
195 	/**
196 	 * Gets the predicted time at which this frame will be displayed. Although
197 	 * no predicted time may be available, if one is available, it will
198 	 * be available while the frame is being generated, in contrast to
199 	 * gdk_frame_timings_get_presentation_time(), which is only available
200 	 * after the frame has been presented. In general, if you are simply
201 	 * animating, you should use gdk_frame_clock_get_frame_time() rather
202 	 * than this function, but this function is useful for applications
203 	 * that want exact control over latency. For example, a movie player
204 	 * may want this information for Audio/Video synchronization.
205 	 * Returns: The predicted time at which the frame will be presented, in the timescale of g_get_monotonic_time(), or 0 if no predicted presentation time is available. Since 3.8
206 	 */
207 	public long getPredictedPresentationTime()
208 	{
209 		// gint64 gdk_frame_timings_get_predicted_presentation_time  (GdkFrameTimings *timings);
210 		return gdk_frame_timings_get_predicted_presentation_time(gdkFrameTimings);
211 	}
212 }