2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = glib-Timers.html
51 private import glib
.glibtypes
;
53 private import lib
.glib
;
58 * GTimer records a start time, and counts microseconds elapsed since that time.
59 * This is done somewhat differently on different platforms, and can be tricky to
60 * get exactly right, so GTimer provides a portable/convenient interface.
65 /** the main Gtk struct */
66 protected GTimer
* gTimer
;
69 public GTimer
* getTimerStruct()
75 /** the main Gtk struct as a void* */
76 protected void* getStruct()
78 return cast(void*)gTimer
;
82 * Sets our main struct and passes it to the parent class
84 public this (GTimer
* gTimer
)
94 * Creates a new timer, and starts timing (i.e. g_timer_start() is implicitly
99 public static Timer
_New()
101 // GTimer* g_timer_new (void);
102 return new Timer( g_timer_new() );
106 * Marks a start time, so that future calls to g_timer_elapsed() will report the
107 * time since g_timer_start() was called. g_timer_new() automatically marks the
108 * start time, so no need to call g_timer_start() immediately after creating the
115 // void g_timer_start (GTimer *timer);
116 g_timer_start(gTimer
);
120 * Marks an end time, so calls to g_timer_elapsed() will return the difference
121 * between this end time and the start time.
127 // void g_timer_stop (GTimer *timer);
128 g_timer_stop(gTimer
);
132 * Resumes a timer that has previously been stopped with g_timer_stop().
133 * g_timer_stop() must be called before using this function.
138 public void _Continue()
140 // void g_timer_continue (GTimer *timer);
141 g_timer_continue(gTimer
);
145 * If timer has been started but not stopped, obtains the time since the timer was
146 * started. If timer has been stopped, obtains the elapsed time between the time
147 * it was started and the time it was stopped. The return value is the number of
148 * seconds elapsed, including any fractional part. The microseconds
149 * out parameter is essentially useless.
153 * return location for the fractional part of seconds elapsed,
154 * in microseconds (that is, the total number of microseconds elapsed, modulo
157 * seconds elapsed as a floating point value, including
158 * any fractional part.
160 public double _Elapsed(uint* microseconds
)
162 // gdouble g_timer_elapsed (GTimer *timer, gulong *microseconds);
163 return g_timer_elapsed(gTimer
, microseconds
);
167 * This function is useless; it's fine to call g_timer_start() on an
168 * already-started timer to reset the start time, so g_timer_reset() serves no
175 // void g_timer_reset (GTimer *timer);
176 g_timer_reset(gTimer
);
180 * Destroys a timer, freeing associated resources.
182 * a GTimer to destroy.
184 public void _Destroy()
186 // void g_timer_destroy (GTimer *timer);
187 g_timer_destroy(gTimer
);