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