alternative to assert
[gtkD.git] / gtkD / src / atk / Util.d
blob417ed47fdadbbe4866780ebe7222f75da922d6d0
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = AtkUtil.html
26 * outPack = atk
27 * outFile = Util
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = Util
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * module aliases:
47 * local aliases:
50 module atk.Util;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.atktypes;
62 private import gtkc.atk;
65 private import glib.Str;
70 /**
71 * Description
72 * A set of ATK utility functions which are used to support event registration of
73 * various types, and obtaining the 'root' accessible of a process and
74 * information about the current ATK implementation and toolkit version.
76 public class Util
79 /**
84 /**
85 * Adds the specified function to the list of functions to be called
86 * when an object receives focus.
87 * focus_tracker:
88 * Function to be added to the list of functions to be called
89 * when an object receives focus.
90 * Returns:
91 * added focus tracker id, or 0 on failure.
93 public static uint addFocusTracker(AtkEventListener focusTracker)
95 // guint atk_add_focus_tracker (AtkEventListener focus_tracker);
96 return atk_add_focus_tracker(focusTracker);
99 /**
100 * Removes the specified focus tracker from the list of functions
101 * to be called when any object receives focus.
102 * tracker_id:
103 * the id of the focus tracker to remove
105 public static void removeFocusTracker(uint trackerId)
107 // void atk_remove_focus_tracker (guint tracker_id);
108 atk_remove_focus_tracker(trackerId);
112 * Specifies the function to be called for focus tracker initialization.
113 * This function should be called by an implementation of the
114 * ATK interface if any specific work needs to be done to enable
115 * focus tracking.
116 * init:
117 * Function to be called for focus tracker initialization
119 public static void focusTrackerInit(AtkEventListenerInit init)
121 // void atk_focus_tracker_init (AtkEventListenerInit init);
122 atk_focus_tracker_init(init);
126 * Cause the focus tracker functions which have been specified to be
127 * executed for the object.
128 * object:
129 * an AtkObject
131 public static void focusTrackerNotify(AtkObject* object)
133 // void atk_focus_tracker_notify (AtkObject *object);
134 atk_focus_tracker_notify(object);
140 * Adds the specified function to the list of functions to be called
141 * when an event of type event_type occurs.
142 * listener:
143 * the listener to notify
144 * event_type:
145 * the type of event for which notification is requested
146 * Returns:
147 * added event listener id, or 0 on failure.
149 public static uint addGlobalEventListener(GSignalEmissionHook listener, char[] eventType)
151 // guint atk_add_global_event_listener (GSignalEmissionHook listener, const gchar *event_type);
152 return atk_add_global_event_listener(listener, Str.toStringz(eventType));
156 * Removes the specified event listener
157 * listener_id:
158 * the id of the event listener to remove
160 public static void removeGlobalEventListener(uint listenerId)
162 // void atk_remove_global_event_listener (guint listener_id);
163 atk_remove_global_event_listener(listenerId);
170 * Adds the specified function to the list of functions to be called
171 * when a key event occurs. The data element will be passed to the
172 * AtkKeySnoopFunc (listener) as the func_data param, on notification.
173 * listener:
174 * the listener to notify
175 * data:
176 * a gpointer that points to a block of data that should be sent to the registered listeners,
177 * along with the event notification, when it occurs.
178 * Returns:
179 * added event listener id, or 0 on failure.
181 public static uint addKeyEventListener(AtkKeySnoopFunc listener, void* data)
183 // guint atk_add_key_event_listener (AtkKeySnoopFunc listener, gpointer data);
184 return atk_add_key_event_listener(listener, data);
188 * Removes the specified event listener
189 * listener_id:
190 * the id of the event listener to remove
192 public static void removeKeyEventListener(uint listenerId)
194 // void atk_remove_key_event_listener (guint listener_id);
195 atk_remove_key_event_listener(listenerId);
199 * Gets the root accessible container for the current application.
200 * Returns:
201 * the root accessible container for the current application
203 public static AtkObject* getRoot()
205 // AtkObject* atk_get_root (void);
206 return atk_get_root();
210 * Gets the currently focused object.
211 * Returns:
212 * Returns:
213 * the currently focused object for the current application
214 * Since ATK 1.6
216 public static AtkObject* getFocusObject()
218 // AtkObject* atk_get_focus_object (void);
219 return atk_get_focus_object();
223 * Gets name string for the GUI toolkit implementing ATK for this application.
224 * Returns:
225 * name string for the GUI toolkit implementing ATK for this application
227 public static char[] getToolkitName()
229 // const gchar* atk_get_toolkit_name (void);
230 return Str.toString(atk_get_toolkit_name() );
234 * Gets version string for the GUI toolkit implementing ATK for this application.
235 * Returns:
236 * version string for the GUI toolkit implementing ATK for this application
238 public static char[] getToolkitVersion()
240 // const gchar* atk_get_toolkit_version (void);
241 return Str.toString(atk_get_toolkit_version() );