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 = GtkItemFactory.html
27 * outFile = ItemFactory
28 * strct = GtkItemFactory
43 * - gtk_item_factory_create_menu_entries
51 * - GtkAccelGroup* -> AccelGroup
52 * - GtkItemFactory* -> ItemFactory
53 * - GtkWidget* -> Widget
57 module gtk
.ItemFactory
;
59 private import gtk
.gtktypes
;
61 private import lib
.gtk
;
63 private import glib
.Str
;
64 private import gtk
.AccelGroup
;
65 private import gtk
.Widget
;
66 private import gtk
.ItemFactory
;
70 * As of GTK+ 2.4, GtkItemFactory has been deprecated in favour of GtkUIManager.
72 private import gtk
.ObjectGtk
;
73 public class ItemFactory
: ObjectGtk
76 /** the main Gtk struct */
77 protected GtkItemFactory
* gtkItemFactory
;
80 public GtkItemFactory
* getItemFactoryStruct()
82 return gtkItemFactory
;
86 /** the main Gtk struct as a void* */
87 protected void* getStruct()
89 return cast(void*)gtkItemFactory
;
93 * Sets our main struct and passes it to the parent class
95 public this (GtkItemFactory
* gtkItemFactory
)
97 super(cast(GtkObject
*)gtkItemFactory
);
98 this.gtkItemFactory
= gtkItemFactory
;
114 * gtk_item_factory_new has been deprecated since version 2.4 and should not be used in newly-written code.
115 * Creates a new GtkItemFactory.
116 * Beware that the returned object does not have a floating reference.
118 * the kind of menu to create; can be
119 * GTK_TYPE_MENU_BAR, GTK_TYPE_MENU or GTK_TYPE_OPTION_MENU
121 * the factory path of the new item factory, a string of the form
124 * a GtkAccelGroup to which the accelerators for the
125 * menu items will be added, or NULL to create a new one
127 * a new GtkItemFactory
129 public this (GType containerType
, char[] path
, AccelGroup accelGroup
)
131 // GtkItemFactory* gtk_item_factory_new (GType container_type, const gchar *path, GtkAccelGroup *accel_group);
132 this(cast(GtkItemFactory
*)gtk_item_factory_new(containerType
, Str
.toStringz(path
), (accelGroup
is null) ?
null : accelGroup
.getAccelGroupStruct()) );
137 * gtk_item_factory_construct has been deprecated since version 2.4 and should not be used in newly-written code.
138 * Initializes an item factory.
142 * the kind of menu to create; can be
143 * GTK_TYPE_MENU_BAR, GTK_TYPE_MENU or GTK_TYPE_OPTION_MENU
145 * the factory path of ifactory, a string of the form
148 * a GtkAccelGroup to which the accelerators for the
149 * menu items will be added, or NULL to create a new one
151 public void construct(GType containerType
, char[] path
, AccelGroup accelGroup
)
153 // void gtk_item_factory_construct (GtkItemFactory *ifactory, GType container_type, const gchar *path, GtkAccelGroup *accel_group);
154 gtk_item_factory_construct(gtkItemFactory
, containerType
, Str
.toStringz(path
), (accelGroup
is null) ?
null : accelGroup
.getAccelGroupStruct());
159 * gtk_item_factory_add_foreign has been deprecated since version 2.4 and should not be used in newly-written code. The recommended API for this purpose are the functions
160 * gtk_menu_item_set_accel_path() and gtk_widget_set_accel_path(); don't
161 * use gtk_item_factory_add_foreign() in new code, since it is likely to
162 * be removed in the future.
163 * Installs an accelerator for accel_widget in accel_group, that causes
164 * the ::activate signal to be emitted if the accelerator is activated.
165 * This function can be used to make widgets participate in the accel
166 * saving/restoring functionality provided by gtk_accel_map_save() and
167 * gtk_accel_map_load(), even if they haven't been created by an item
170 * widget to install an accelerator on
172 * the full path for the accel_widget
174 * the accelerator group to install the accelerator in
176 * key value of the accelerator
178 * modifier combination of the accelerator
180 public static void addForeign(Widget accelWidget
, char[] fullPath
, AccelGroup accelGroup
, uint keyval
, GdkModifierType modifiers
)
182 // void gtk_item_factory_add_foreign (GtkWidget *accel_widget, const gchar *full_path, GtkAccelGroup *accel_group, guint keyval, GdkModifierType modifiers);
183 gtk_item_factory_add_foreign((accelWidget
is null) ?
null : accelWidget
.getWidgetStruct(), Str
.toStringz(fullPath
), (accelGroup
is null) ?
null : accelGroup
.getAccelGroupStruct(), keyval
, modifiers
);
188 * gtk_item_factory_from_widget is deprecated and should not be used in newly-written code. 2.4
189 * Obtains the item factory from which a widget was created.
193 * the item factory from which widget was created, or NULL
195 public static ItemFactory
fromWidget(Widget widget
)
197 // GtkItemFactory* gtk_item_factory_from_widget (GtkWidget *widget);
198 return new ItemFactory( gtk_item_factory_from_widget((widget
is null) ?
null : widget
.getWidgetStruct()) );
203 * gtk_item_factory_path_from_widget has been deprecated since version 2.4 and should not be used in newly-written code.
204 * If widget has been created by an item factory, returns the full path
205 * to it. (The full path of a widget is the concatenation of the factory
206 * path specified in gtk_item_factory_new() with the path specified in the
207 * GtkItemFactoryEntry from which the widget was created.)
211 * the full path to widget if it has been created by an item
212 * factory, NULL otherwise. This value is owned by GTK+ and must not be
215 public static char[] pathFromWidget(Widget widget
)
217 // const gchar* gtk_item_factory_path_from_widget (GtkWidget *widget);
218 return Str
.toString(gtk_item_factory_path_from_widget((widget
is null) ?
null : widget
.getWidgetStruct()) );
223 * gtk_item_factory_get_item has been deprecated since version 2.4 and should not be used in newly-written code.
224 * Obtains the menu item which corresponds to path.
225 * If the widget corresponding to path is a menu item which opens a
226 * submenu, then the item is returned. If you are interested in the submenu,
227 * use gtk_item_factory_get_widget() instead.
231 * the path to the menu item
233 * the menu item for the given path, or NULL if path doesn't
234 * lead to a menu item
236 public Widget
getItem(char[] path
)
238 // GtkWidget* gtk_item_factory_get_item (GtkItemFactory *ifactory, const gchar *path);
239 return new Widget( gtk_item_factory_get_item(gtkItemFactory
, Str
.toStringz(path
)) );
244 * gtk_item_factory_get_widget has been deprecated since version 2.4 and should not be used in newly-written code.
245 * Obtains the widget which corresponds to path.
246 * If the widget corresponding to path is a menu item which opens a
247 * submenu, then the submenu is returned. If you are interested in the menu
248 * item, use gtk_item_factory_get_item() instead.
252 * the path to the widget
254 * the widget for the given path, or NULL if path doesn't lead
257 public Widget
getWidget(char[] path
)
259 // GtkWidget* gtk_item_factory_get_widget (GtkItemFactory *ifactory, const gchar *path);
260 return new Widget( gtk_item_factory_get_widget(gtkItemFactory
, Str
.toStringz(path
)) );
265 * gtk_item_factory_get_widget_by_action has been deprecated since version 2.4 and should not be used in newly-written code.
266 * Obtains the widget which was constructed from the GtkItemFactoryEntry
267 * with the given action.
268 * If there are multiple items with the same action, the result is
273 * an action as specified in the callback_action field
274 * of GtkItemFactoryEntry
276 * the widget which corresponds to the given action, or NULL
277 * if no widget was found
279 public Widget
getWidgetByAction(uint action
)
281 // GtkWidget* gtk_item_factory_get_widget_by_action (GtkItemFactory *ifactory, guint action);
282 return new Widget( gtk_item_factory_get_widget_by_action(gtkItemFactory
, action
) );
287 * gtk_item_factory_get_item_by_action has been deprecated since version 2.4 and should not be used in newly-written code.
288 * Obtains the menu item which was constructed from the first
289 * GtkItemFactoryEntry with the given action.
293 * an action as specified in the callback_action field
294 * of GtkItemFactoryEntry
296 * the menu item which corresponds to the given action, or NULL
297 * if no menu item was found
299 public Widget
getItemByAction(uint action
)
301 // GtkWidget* gtk_item_factory_get_item_by_action (GtkItemFactory *ifactory, guint action);
302 return new Widget( gtk_item_factory_get_item_by_action(gtkItemFactory
, action
) );
307 * gtk_item_factory_create_item has been deprecated since version 2.4 and should not be used in newly-written code.
308 * Creates an item for entry.
312 * the GtkItemFactoryEntry to create an item for
314 * data passed to the callback function of entry
316 * 1 if the callback function of entry is of type
317 * GtkItemFactoryCallback1, 2 if it is of type GtkItemFactoryCallback2
319 public void createItem(GtkItemFactoryEntry
* entry
, void* callbackData
, uint callbackType
)
321 // void gtk_item_factory_create_item (GtkItemFactory *ifactory, GtkItemFactoryEntry *entry, gpointer callback_data, guint callback_type);
322 gtk_item_factory_create_item(gtkItemFactory
, entry
, callbackData
, callbackType
);
327 * gtk_item_factory_create_items has been deprecated since version 2.4 and should not be used in newly-written code.
328 * Creates the menu items from the entries.
332 * the length of entries
334 * an array of GtkItemFactoryEntrys whose callback members
335 * must by of type GtkItemFactoryCallback1
337 * data passed to the callback functions of all entries
339 public void createItems(uint nEntries
, GtkItemFactoryEntry
* entries
, void* callbackData
)
341 // void gtk_item_factory_create_items (GtkItemFactory *ifactory, guint n_entries, GtkItemFactoryEntry *entries, gpointer callback_data);
342 gtk_item_factory_create_items(gtkItemFactory
, nEntries
, entries
, callbackData
);
347 * gtk_item_factory_create_items_ac has been deprecated since version 2.4 and should not be used in newly-written code.
348 * Creates the menu items from the entries.
352 * the length of entries
354 * an array of GtkItemFactoryEntrys
356 * data passed to the callback functions of all entries
358 * 1 if the callback functions in entries are of type
359 * GtkItemFactoryCallback1, 2 if they are of type GtkItemFactoryCallback2
361 public void createItemsAc(uint nEntries
, GtkItemFactoryEntry
* entries
, void* callbackData
, uint callbackType
)
363 // void gtk_item_factory_create_items_ac (GtkItemFactory *ifactory, guint n_entries, GtkItemFactoryEntry *entries, gpointer callback_data, guint callback_type);
364 gtk_item_factory_create_items_ac(gtkItemFactory
, nEntries
, entries
, callbackData
, callbackType
);
369 * gtk_item_factory_delete_item has been deprecated since version 2.4 and should not be used in newly-written code.
370 * Deletes the menu item which was created for path by the given
377 public void deleteItem(char[] path
)
379 // void gtk_item_factory_delete_item (GtkItemFactory *ifactory, const gchar *path);
380 gtk_item_factory_delete_item(gtkItemFactory
, Str
.toStringz(path
));
385 * gtk_item_factory_delete_entry has been deprecated since version 2.4 and should not be used in newly-written code.
386 * Deletes the menu item which was created from entry by the given
391 * a GtkItemFactoryEntry
393 public void deleteEntry(GtkItemFactoryEntry
* entry
)
395 // void gtk_item_factory_delete_entry (GtkItemFactory *ifactory, GtkItemFactoryEntry *entry);
396 gtk_item_factory_delete_entry(gtkItemFactory
, entry
);
401 * gtk_item_factory_delete_entries has been deprecated since version 2.4 and should not be used in newly-written code.
402 * Deletes the menu items which were created from the entries by the given
407 * the length of entries
409 * an array of GtkItemFactoryEntrys
411 public void deleteEntries(uint nEntries
, GtkItemFactoryEntry
* entries
)
413 // void gtk_item_factory_delete_entries (GtkItemFactory *ifactory, guint n_entries, GtkItemFactoryEntry *entries);
414 gtk_item_factory_delete_entries(gtkItemFactory
, nEntries
, entries
);
419 * gtk_item_factory_popup has been deprecated since version 2.4 and should not be used in newly-written code.
420 * Pops up the menu constructed from the item factory at (x, y).
421 * The mouse_button parameter should be the mouse button pressed to initiate
422 * the menu popup. If the menu popup was initiated by something other than
423 * a mouse button press, such as a mouse button release or a keypress,
424 * mouse_button should be 0.
425 * The time_ parameter should be the time stamp of the event that
426 * initiated the popup. If such an event is not available, use
427 * gtk_get_current_event_time() instead.
428 * The operation of the mouse_button and the time_ parameter is the same
429 * as the button and activation_time parameters for gtk_menu_popup().
431 * a GtkItemFactory of type GTK_TYPE_MENU (see gtk_item_factory_new())
437 * the mouse button which was pressed to initiate the popup
439 * the time at which the activation event occurred
441 public void popup(uint x
, uint y
, uint mouseButton
, uint time
)
443 // void gtk_item_factory_popup (GtkItemFactory *ifactory, guint x, guint y, guint mouse_button, guint32 time_);
444 gtk_item_factory_popup(gtkItemFactory
, x
, y
, mouseButton
, time
);
449 * gtk_item_factory_popup_with_data has been deprecated since version 2.4 and should not be used in newly-written code.
450 * Pops up the menu constructed from the item factory at (x, y). Callbacks
451 * can access the popup_data while the menu is posted via
452 * gtk_item_factory_popup_data() and gtk_item_factory_popup_data_from_widget().
453 * The mouse_button parameter should be the mouse button pressed to initiate
454 * the menu popup. If the menu popup was initiated by something other than
455 * a mouse button press, such as a mouse button release or a keypress,
456 * mouse_button should be 0.
457 * The time_ parameter should be the time stamp of the event that
458 * initiated the popup. If such an event is not available, use
459 * gtk_get_current_event_time() instead.
460 * The operation of the mouse_button and the time_ parameters is the same
461 * as the button and activation_time parameters for gtk_menu_popup().
463 * a GtkItemFactory of type GTK_TYPE_MENU (see gtk_item_factory_new())
465 * data available for callbacks while the menu is posted
467 * a GtkDestroyNotify function to be called on popup_data when
468 * the menu is unposted
474 * the mouse button which was pressed to initiate the popup
476 * the time at which the activation event occurred
478 public void popupWithData(void* popupData
, GtkDestroyNotify destroy
, uint x
, uint y
, uint mouseButton
, uint time
)
480 // void gtk_item_factory_popup_with_data (GtkItemFactory *ifactory, gpointer popup_data, GtkDestroyNotify destroy, guint x, guint y, guint mouse_button, guint32 time_);
481 gtk_item_factory_popup_with_data(gtkItemFactory
, popupData
, destroy
, x
, y
, mouseButton
, time
);
486 * gtk_item_factory_popup_data has been deprecated since version 2.4 and should not be used in newly-written code.
487 * Obtains the popup_data which was passed to
488 * gtk_item_factory_popup_with_data(). This data is available until the menu
489 * is popped down again.
493 * popup_data associated with ifactory
495 public void* popupData()
497 // gpointer gtk_item_factory_popup_data (GtkItemFactory *ifactory);
498 return gtk_item_factory_popup_data(gtkItemFactory
);
503 * gtk_item_factory_popup_data_from_widget has been deprecated since version 2.4 and should not be used in newly-written code.
504 * Obtains the popup_data which was passed to
505 * gtk_item_factory_popup_with_data(). This data is available until the menu
506 * is popped down again.
510 * popup_data associated with the item factory from
511 * which widget was created, or NULL if widget wasn't created
514 public static void* popupDataFromWidget(Widget widget
)
516 // gpointer gtk_item_factory_popup_data_from_widget (GtkWidget *widget);
517 return gtk_item_factory_popup_data_from_widget((widget
is null) ?
null : widget
.getWidgetStruct());
522 * gtk_item_factory_from_path has been deprecated since version 2.4 and should not be used in newly-written code.
523 * Finds an item factory which has been constructed using the
524 * "<name>" prefix of path as the path argument
525 * for gtk_item_factory_new().
527 * a string starting with a factory path of the form
530 * the GtkItemFactory created for the given factory path, or NULL
532 public static ItemFactory
fromPath(char[] path
)
534 // GtkItemFactory* gtk_item_factory_from_path (const gchar *path);
535 return new ItemFactory( gtk_item_factory_from_path(Str
.toStringz(path
)) );
541 * gtk_item_factories_path_delete has been deprecated since version 2.4 and should not be used in newly-written code.
542 * Deletes all widgets constructed from the specified path.
544 * a factory path to prepend to path. May be NULL if path
545 * starts with a factory path
549 public static void itemFactoriesPathDelete(char[] ifactoryPath
, char[] path
)
551 // void gtk_item_factories_path_delete (const gchar *ifactory_path, const gchar *path);
552 gtk_item_factories_path_delete(Str
.toStringz(ifactoryPath
), Str
.toStringz(path
));
557 * gtk_item_factory_set_translate_func has been deprecated since version 2.4 and should not be used in newly-written code.
558 * Sets a function to be used for translating the path elements before they
563 * the GtkTranslateFunc function to be used to translate path elements
565 * data to pass to func and notify
567 * a GtkDestroyNotify function to be called when ifactory is
568 * destroyed and when the translation function is changed again
570 public void setTranslateFunc(GtkTranslateFunc func
, void* data
, GtkDestroyNotify notify
)
572 // void gtk_item_factory_set_translate_func (GtkItemFactory *ifactory, GtkTranslateFunc func, gpointer data, GtkDestroyNotify notify);
573 gtk_item_factory_set_translate_func(gtkItemFactory
, func
, data
, notify
);