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