alternative to assert
[gtkD.git] / src / atk / Util.d
blobaf8e0c8f1a42e69035d27c526f58a02734520aa3
1 /*
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 = 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 * local aliases:
49 module atk.Util;
51 private import atk.atktypes;
53 private import lib.atk;
55 private import glib.Str;
57 /**
58 * Description
59 * A set of ATK utility functions which are used to support event registration of
60 * various types, and obtaining the 'root' accessible of a process and
61 * information about the current ATK implementation and toolkit version.
63 public class Util
66 /**
71 /**
72 * Adds the specified function to the list of functions to be called
73 * when an object receives focus.
74 * focus_tracker:
75 * Function to be added to the list of functions to be called
76 * when an object receives focus.
77 * Returns:
78 * added focus tracker id, or 0 on failure.
80 public static uint addFocusTracker(AtkEventListener focusTracker)
82 // guint atk_add_focus_tracker (AtkEventListener focus_tracker);
83 return atk_add_focus_tracker(focusTracker);
86 /**
87 * Removes the specified focus tracker from the list of functions
88 * to be called when any object receives focus.
89 * tracker_id:
90 * the id of the focus tracker to remove
92 public static void removeFocusTracker(uint trackerId)
94 // void atk_remove_focus_tracker (guint tracker_id);
95 atk_remove_focus_tracker(trackerId);
98 /**
99 * Specifies the function to be called for focus tracker initialization.
100 * This function should be called by an implementation of the
101 * ATK interface if any specific work needs to be done to enable
102 * focus tracking.
103 * init:
104 * Function to be called for focus tracker initialization
106 public static void focusTrackerInit(AtkEventListenerInit init)
108 // void atk_focus_tracker_init (AtkEventListenerInit init);
109 atk_focus_tracker_init(init);
113 * Cause the focus tracker functions which have been specified to be
114 * executed for the object.
115 * object:
116 * an AtkObject
118 public static void focusTrackerNotify(AtkObject* object)
120 // void atk_focus_tracker_notify (AtkObject *object);
121 atk_focus_tracker_notify(object);
127 * Adds the specified function to the list of functions to be called
128 * when an event of type event_type occurs.
129 * listener:
130 * the listener to notify
131 * event_type:
132 * the type of event for which notification is requested
133 * Returns:
134 * added event listener id, or 0 on failure.
136 public static uint addGlobalEventListener(GSignalEmissionHook listener, char[] eventType)
138 // guint atk_add_global_event_listener (GSignalEmissionHook listener, const gchar *event_type);
139 return atk_add_global_event_listener(listener, Str.toStringz(eventType));
143 * Removes the specified event listener
144 * listener_id:
145 * the id of the event listener to remove
147 public static void removeGlobalEventListener(uint listenerId)
149 // void atk_remove_global_event_listener (guint listener_id);
150 atk_remove_global_event_listener(listenerId);
157 * Adds the specified function to the list of functions to be called
158 * when a key event occurs. The data element will be passed to the
159 * AtkKeySnoopFunc (listener) as the func_data param, on notification.
160 * listener:
161 * the listener to notify
162 * data:
163 * a gpointer that points to a block of data that should be sent to the registered listeners,
164 * along with the event notification, when it occurs.
165 * Returns:
166 * added event listener id, or 0 on failure.
168 public static uint addKeyEventListener(AtkKeySnoopFunc listener, void* data)
170 // guint atk_add_key_event_listener (AtkKeySnoopFunc listener, gpointer data);
171 return atk_add_key_event_listener(listener, data);
175 * Removes the specified event listener
176 * listener_id:
177 * the id of the event listener to remove
179 public static void removeKeyEventListener(uint listenerId)
181 // void atk_remove_key_event_listener (guint listener_id);
182 atk_remove_key_event_listener(listenerId);
186 * Gets the root accessible container for the current application.
187 * Returns:
188 * the root accessible container for the current application
190 public static AtkObject* getRoot()
192 // AtkObject* atk_get_root (void);
193 return atk_get_root();
197 * Gets the currently focused object.
198 * Returns:
199 * Returns:
200 * the currently focused object for the current application
201 * Since ATK 1.6
203 public static AtkObject* getFocusObject()
205 // AtkObject* atk_get_focus_object (void);
206 return atk_get_focus_object();
210 * Gets name string for the GUI toolkit implementing ATK for this application.
211 * Returns:
212 * name string for the GUI toolkit implementing ATK for this application
214 public static char[] getToolkitName()
216 // const gchar* atk_get_toolkit_name (void);
217 return Str.toString(atk_get_toolkit_name() );
221 * Gets version string for the GUI toolkit implementing ATK for this application.
222 * Returns:
223 * version string for the GUI toolkit implementing ATK for this application
225 public static char[] getToolkitVersion()
227 // const gchar* atk_get_toolkit_version (void);
228 return Str.toString(atk_get_toolkit_version() );