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 gtk.Application;
26 
27 private import gio.ActionGroupIF;
28 private import gio.ActionGroupT;
29 private import gio.ActionMapIF;
30 private import gio.ActionMapT;
31 private import gio.Application : GioApplication = Application;
32 private import gio.Menu;
33 private import gio.MenuModel;
34 private import glib.ConstructionException;
35 private import glib.ListG;
36 private import glib.Str;
37 private import glib.Variant;
38 private import gobject.ObjectG;
39 private import gobject.Signals;
40 private import gtk.Window;
41 public  import gtkc.gdktypes;
42 private import gtkc.gtk;
43 public  import gtkc.gtktypes;
44 
45 
46 /**
47  * #GtkApplication is a class that handles many important aspects
48  * of a GTK+ application in a convenient fashion, without enforcing
49  * a one-size-fits-all application model.
50  * 
51  * Currently, GtkApplication handles GTK+ initialization, application
52  * uniqueness, session management, provides some basic scriptability and
53  * desktop shell integration by exporting actions and menus and manages a
54  * list of toplevel windows whose life-cycle is automatically tied to the
55  * life-cycle of your application.
56  * 
57  * While GtkApplication works fine with plain #GtkWindows, it is recommended
58  * to use it together with #GtkApplicationWindow.
59  * 
60  * When GDK threads are enabled, GtkApplication will acquire the GDK
61  * lock when invoking actions that arrive from other processes.  The GDK
62  * lock is not touched for local action invocations.  In order to have
63  * actions invoked in a predictable context it is therefore recommended
64  * that the GDK lock be held while invoking actions locally with
65  * g_action_group_activate_action().  The same applies to actions
66  * associated with #GtkApplicationWindow and to the “activate” and
67  * 'open' #GApplication methods.
68  * 
69  * ## Automatic resources ## {#automatic-resources}
70  * 
71  * #GtkApplication will automatically load menus from the #GtkBuilder
72  * file located at "gtk/menus.ui", relative to the application's
73  * resource base path (see g_application_set_resource_base_path()).  The
74  * menu with the ID "app-menu" is taken as the application's app menu
75  * and the menu with the ID "menubar" is taken as the application's
76  * menubar.  Additional menus (most interesting submenus) can be named
77  * and accessed via gtk_application_get_menu_by_id() which allows for
78  * dynamic population of a part of the menu structure.
79  * 
80  * If the files "gtk/menus-appmenu.ui" or "gtk/menus-traditional.ui" are
81  * present then these files will be used in preference, depending on the
82  * value of gtk_application_prefers_app_menu().
83  * 
84  * It is also possible to provide the menus manually using
85  * gtk_application_set_app_menu() and gtk_application_set_menubar().
86  * 
87  * #GtkApplication will also automatically setup an icon search path for
88  * the default icon theme by appending "icons" to the resource base
89  * path.  This allows your application to easily store its icons as
90  * resources.  See gtk_icon_theme_add_resource_path() for more
91  * information.
92  * 
93  * ## A simple application ## {#gtkapplication}
94  * 
95  * [A simple example](https://git.gnome.org/browse/gtk+/tree/examples/bp/bloatpad.c)
96  * 
97  * GtkApplication optionally registers with a session manager
98  * of the users session (if you set the #GtkApplication:register-session
99  * property) and offers various functionality related to the session
100  * life-cycle.
101  * 
102  * An application can block various ways to end the session with
103  * the gtk_application_inhibit() function. Typical use cases for
104  * this kind of inhibiting are long-running, uninterruptible operations,
105  * such as burning a CD or performing a disk backup. The session
106  * manager may not honor the inhibitor, but it can be expected to
107  * inform the user about the negative consequences of ending the
108  * session while inhibitors are present.
109  * 
110  * ## See Also ## {#seealso}
111  * HowDoI: [Using GtkApplication] (https://wiki.gnome.org/HowDoI/GtkApplication)
112  * [Getting Started with GTK+: Basics] (https://developer.gnome.org/gtk3/stable/gtk-getting-started.html#id-1.2.3.3)
113  */
114 public class Application : GioApplication
115 {
116 	/** the main Gtk struct */
117 	protected GtkApplication* gtkApplication;
118 
119 	/** Get the main Gtk struct */
120 	public GtkApplication* getGtkApplicationStruct()
121 	{
122 		return gtkApplication;
123 	}
124 
125 	/** the main Gtk struct as a void* */
126 	protected override void* getStruct()
127 	{
128 		return cast(void*)gtkApplication;
129 	}
130 
131 	protected override void setStruct(GObject* obj)
132 	{
133 		gtkApplication = cast(GtkApplication*)obj;
134 		super.setStruct(obj);
135 	}
136 
137 	/**
138 	 * Sets our main struct and passes it to the parent class.
139 	 */
140 	public this (GtkApplication* gtkApplication, bool ownedRef = false)
141 	{
142 		this.gtkApplication = gtkApplication;
143 		super(cast(GApplication*)gtkApplication, ownedRef);
144 	}
145 
146 	/**
147 	 */
148 
149 	public static GType getType()
150 	{
151 		return gtk_application_get_type();
152 	}
153 
154 	/**
155 	 * Creates a new #GtkApplication instance.
156 	 *
157 	 * When using #GtkApplication, it is not necessary to call gtk_init()
158 	 * manually. It is called as soon as the application gets registered as
159 	 * the primary instance.
160 	 *
161 	 * Concretely, gtk_init() is called in the default handler for the
162 	 * #GApplication::startup signal. Therefore, #GtkApplication subclasses should
163 	 * chain up in their #GApplication::startup handler before using any GTK+ API.
164 	 *
165 	 * Note that commandline arguments are not passed to gtk_init().
166 	 * All GTK+ functionality that is available via commandline arguments
167 	 * can also be achieved by setting suitable environment variables
168 	 * such as `G_DEBUG`, so this should not be a big
169 	 * problem. If you absolutely must support GTK+ commandline arguments,
170 	 * you can explicitly call gtk_init() before creating the application
171 	 * instance.
172 	 *
173 	 * If non-%NULL, the application ID must be valid.  See
174 	 * g_application_id_is_valid().
175 	 *
176 	 * If no application ID is given then some features (most notably application
177 	 * uniqueness) will be disabled. A null application ID is only allowed with
178 	 * GTK+ 3.6 or later.
179 	 *
180 	 * Params:
181 	 *     applicationId = The application ID.
182 	 *     flags = the application flags
183 	 *
184 	 * Return: a new #GtkApplication instance
185 	 *
186 	 * Since: 3.0
187 	 *
188 	 * Throws: ConstructionException GTK+ fails to create the object.
189 	 */
190 	public this(string applicationId, GApplicationFlags flags)
191 	{
192 		auto p = gtk_application_new(Str.toStringz(applicationId), flags);
193 		
194 		if(p is null)
195 		{
196 			throw new ConstructionException("null returned by new");
197 		}
198 		
199 		this(cast(GtkApplication*) p, true);
200 	}
201 
202 	/**
203 	 * Installs an accelerator that will cause the named action
204 	 * to be activated when the key combination specificed by @accelerator
205 	 * is pressed.
206 	 *
207 	 * @accelerator must be a string that can be parsed by gtk_accelerator_parse(),
208 	 * e.g. "<Primary>q" or “<Control><Alt>p”.
209 	 *
210 	 * @action_name must be the name of an action as it would be used
211 	 * in the app menu, i.e. actions that have been added to the application
212 	 * are referred to with an “app.” prefix, and window-specific actions
213 	 * with a “win.” prefix.
214 	 *
215 	 * GtkApplication also extracts accelerators out of “accel” attributes
216 	 * in the #GMenuModels passed to gtk_application_set_app_menu() and
217 	 * gtk_application_set_menubar(), which is usually more convenient
218 	 * than calling this function for each accelerator.
219 	 *
220 	 * Deprecated: Use gtk_application_set_accels_for_action() instead
221 	 *
222 	 * Params:
223 	 *     accelerator = accelerator string
224 	 *     actionName = the name of the action to activate
225 	 *     parameter = parameter to pass when activating the action,
226 	 *         or %NULL if the action does not accept an activation parameter
227 	 *
228 	 * Since: 3.4
229 	 */
230 	public void addAccelerator(string accelerator, string actionName, Variant parameter)
231 	{
232 		gtk_application_add_accelerator(gtkApplication, Str.toStringz(accelerator), Str.toStringz(actionName), (parameter is null) ? null : parameter.getVariantStruct());
233 	}
234 
235 	/**
236 	 * Adds a window to @application.
237 	 *
238 	 * This call is equivalent to setting the #GtkWindow:application
239 	 * property of @window to @application.
240 	 *
241 	 * Normally, the connection between the application and the window
242 	 * will remain until the window is destroyed, but you can explicitly
243 	 * remove it with gtk_application_remove_window().
244 	 *
245 	 * GTK+ will keep the application running as long as it has
246 	 * any windows.
247 	 *
248 	 * Params:
249 	 *     window = a #GtkWindow
250 	 *
251 	 * Since: 3.0
252 	 */
253 	public void addWindow(Window window)
254 	{
255 		gtk_application_add_window(gtkApplication, (window is null) ? null : window.getWindowStruct());
256 	}
257 
258 	/**
259 	 * Gets the accelerators that are currently associated with
260 	 * the given action.
261 	 *
262 	 * Params:
263 	 *     detailedActionName = a detailed action name, specifying an action
264 	 *         and target to obtain accelerators for
265 	 *
266 	 * Return: accelerators for @detailed_action_name, as
267 	 *     a %NULL-terminated array. Free with g_strfreev() when no longer needed
268 	 *
269 	 * Since: 3.12
270 	 */
271 	public string[] getAccelsForAction(string detailedActionName)
272 	{
273 		return Str.toStringArray(gtk_application_get_accels_for_action(gtkApplication, Str.toStringz(detailedActionName)));
274 	}
275 
276 	/**
277 	 * Returns the list of actions (possibly empty) that @accel maps to.
278 	 * Each item in the list is a detailed action name in the usual form.
279 	 *
280 	 * This might be useful to discover if an accel already exists in
281 	 * order to prevent installation of a conflicting accelerator (from
282 	 * an accelerator editor or a plugin system, for example). Note that
283 	 * having more than one action per accelerator may not be a bad thing
284 	 * and might make sense in cases where the actions never appear in the
285 	 * same context.
286 	 *
287 	 * In case there are no actions for a given accelerator, an empty array
288 	 * is returned.  %NULL is never returned.
289 	 *
290 	 * It is a programmer error to pass an invalid accelerator string.
291 	 * If you are unsure, check it with gtk_accelerator_parse() first.
292 	 *
293 	 * Params:
294 	 *     accel = an accelerator that can be parsed by gtk_accelerator_parse()
295 	 *
296 	 * Return: a %NULL-terminated array of actions for @accel
297 	 *
298 	 * Since: 3.14
299 	 */
300 	public string[] getActionsForAccel(string accel)
301 	{
302 		return Str.toStringArray(gtk_application_get_actions_for_accel(gtkApplication, Str.toStringz(accel)));
303 	}
304 
305 	/**
306 	 * Gets the “active” window for the application.
307 	 *
308 	 * The active window is the one that was most recently focused (within
309 	 * the application).  This window may not have the focus at the moment
310 	 * if another application has it -- this is just the most
311 	 * recently-focused window within this application.
312 	 *
313 	 * Return: the active window
314 	 *
315 	 * Since: 3.6
316 	 */
317 	public Window getActiveWindow()
318 	{
319 		auto p = gtk_application_get_active_window(gtkApplication);
320 		
321 		if(p is null)
322 		{
323 			return null;
324 		}
325 		
326 		return ObjectG.getDObject!(Window)(cast(GtkWindow*) p);
327 	}
328 
329 	/**
330 	 * Returns the menu model that has been set with
331 	 * gtk_application_set_app_menu().
332 	 *
333 	 * Return: the application menu of @application
334 	 *
335 	 * Since: 3.4
336 	 */
337 	public MenuModel getAppMenu()
338 	{
339 		auto p = gtk_application_get_app_menu(gtkApplication);
340 		
341 		if(p is null)
342 		{
343 			return null;
344 		}
345 		
346 		return ObjectG.getDObject!(MenuModel)(cast(GMenuModel*) p);
347 	}
348 
349 	/**
350 	 * Gets a menu from automatically loaded resources.
351 	 * See [Automatic resources][automatic-resources]
352 	 * for more information.
353 	 *
354 	 * Params:
355 	 *     id = the id of the menu to look up
356 	 *
357 	 * Return: Gets the menu with the
358 	 *     given id from the automatically loaded resources
359 	 *
360 	 * Since: 3.14
361 	 */
362 	public Menu getMenuById(string id)
363 	{
364 		auto p = gtk_application_get_menu_by_id(gtkApplication, Str.toStringz(id));
365 		
366 		if(p is null)
367 		{
368 			return null;
369 		}
370 		
371 		return ObjectG.getDObject!(Menu)(cast(GMenu*) p);
372 	}
373 
374 	/**
375 	 * Returns the menu model that has been set with
376 	 * gtk_application_set_menubar().
377 	 *
378 	 * Return: the menubar for windows of @application
379 	 *
380 	 * Since: 3.4
381 	 */
382 	public MenuModel getMenubar()
383 	{
384 		auto p = gtk_application_get_menubar(gtkApplication);
385 		
386 		if(p is null)
387 		{
388 			return null;
389 		}
390 		
391 		return ObjectG.getDObject!(MenuModel)(cast(GMenuModel*) p);
392 	}
393 
394 	/**
395 	 * Returns the #GtkApplicationWindow with the given ID.
396 	 *
397 	 * Params:
398 	 *     id = an identifier number
399 	 *
400 	 * Return: the window with ID @id, or
401 	 *     %NULL if there is no window with this ID
402 	 *
403 	 * Since: 3.6
404 	 */
405 	public Window getWindowById(uint id)
406 	{
407 		auto p = gtk_application_get_window_by_id(gtkApplication, id);
408 		
409 		if(p is null)
410 		{
411 			return null;
412 		}
413 		
414 		return ObjectG.getDObject!(Window)(cast(GtkWindow*) p);
415 	}
416 
417 	/**
418 	 * Gets a list of the #GtkWindows associated with @application.
419 	 *
420 	 * The list is sorted by most recently focused window, such that the first
421 	 * element is the currently focused window. (Useful for choosing a parent
422 	 * for a transient window.)
423 	 *
424 	 * The list that is returned should not be modified in any way. It will
425 	 * only remain valid until the next focus change or window creation or
426 	 * deletion.
427 	 *
428 	 * Return: a #GList of #GtkWindow
429 	 *
430 	 * Since: 3.0
431 	 */
432 	public ListG getWindows()
433 	{
434 		auto p = gtk_application_get_windows(gtkApplication);
435 		
436 		if(p is null)
437 		{
438 			return null;
439 		}
440 		
441 		return new ListG(cast(GList*) p);
442 	}
443 
444 	/**
445 	 * Inform the session manager that certain types of actions should be
446 	 * inhibited. This is not guaranteed to work on all platforms and for
447 	 * all types of actions.
448 	 *
449 	 * Applications should invoke this method when they begin an operation
450 	 * that should not be interrupted, such as creating a CD or DVD. The
451 	 * types of actions that may be blocked are specified by the @flags
452 	 * parameter. When the application completes the operation it should
453 	 * call gtk_application_uninhibit() to remove the inhibitor. Note that
454 	 * an application can have multiple inhibitors, and all of the must
455 	 * be individually removed. Inhibitors are also cleared when the
456 	 * application exits.
457 	 *
458 	 * Applications should not expect that they will always be able to block
459 	 * the action. In most cases, users will be given the option to force
460 	 * the action to take place.
461 	 *
462 	 * Reasons should be short and to the point.
463 	 *
464 	 * If @window is given, the session manager may point the user to
465 	 * this window to find out more about why the action is inhibited.
466 	 *
467 	 * Params:
468 	 *     window = a #GtkWindow, or %NULL
469 	 *     flags = what types of actions should be inhibited
470 	 *     reason = a short, human-readable string that explains
471 	 *         why these operations are inhibited
472 	 *
473 	 * Return: A non-zero cookie that is used to uniquely identify this
474 	 *     request. It should be used as an argument to gtk_application_uninhibit()
475 	 *     in order to remove the request. If the platform does not support
476 	 *     inhibiting or the request failed for some reason, 0 is returned.
477 	 *
478 	 * Since: 3.4
479 	 */
480 	public uint inhibit(Window window, GtkApplicationInhibitFlags flags, string reason)
481 	{
482 		return gtk_application_inhibit(gtkApplication, (window is null) ? null : window.getWindowStruct(), flags, Str.toStringz(reason));
483 	}
484 
485 	/**
486 	 * Determines if any of the actions specified in @flags are
487 	 * currently inhibited (possibly by another application).
488 	 *
489 	 * Params:
490 	 *     flags = what types of actions should be queried
491 	 *
492 	 * Return: %TRUE if any of the actions specified in @flags are inhibited
493 	 *
494 	 * Since: 3.4
495 	 */
496 	public bool isInhibited(GtkApplicationInhibitFlags flags)
497 	{
498 		return gtk_application_is_inhibited(gtkApplication, flags) != 0;
499 	}
500 
501 	/**
502 	 * Lists the detailed action names which have associated accelerators.
503 	 * See gtk_application_set_accels_for_action().
504 	 *
505 	 * Return: a %NULL-terminated array of strings,
506 	 *     free with g_strfreev() when done
507 	 *
508 	 * Since: 3.12
509 	 */
510 	public string[] listActionDescriptions()
511 	{
512 		return Str.toStringArray(gtk_application_list_action_descriptions(gtkApplication));
513 	}
514 
515 	/**
516 	 * Determines if the desktop environment in which the application is
517 	 * running would prefer an application menu be shown.
518 	 *
519 	 * If this function returns %TRUE then the application should call
520 	 * gtk_application_set_app_menu() with the contents of an application
521 	 * menu, which will be shown by the desktop environment.  If it returns
522 	 * %FALSE then you should consider using an alternate approach, such as
523 	 * a menubar.
524 	 *
525 	 * The value returned by this function is purely advisory and you are
526 	 * free to ignore it.  If you call gtk_application_set_app_menu() even
527 	 * if the desktop environment doesn't support app menus, then a fallback
528 	 * will be provided.
529 	 *
530 	 * Applications are similarly free not to set an app menu even if the
531 	 * desktop environment wants to show one.  In that case, a fallback will
532 	 * also be created by the desktop environment (GNOME, for example, uses
533 	 * a menu with only a "Quit" item in it).
534 	 *
535 	 * The value returned by this function never changes.  Once it returns a
536 	 * particular value, it is guaranteed to always return the same value.
537 	 *
538 	 * You may only call this function after the application has been
539 	 * registered and after the base startup handler has run.  You're most
540 	 * likely to want to use this from your own startup handler.  It may
541 	 * also make sense to consult this function while constructing UI (in
542 	 * activate, open or an action activation handler) in order to determine
543 	 * if you should show a gear menu or not.
544 	 *
545 	 * This function will return %FALSE on Mac OS and a default app menu
546 	 * will be created automatically with the "usual" contents of that menu
547 	 * typical to most Mac OS applications.  If you call
548 	 * gtk_application_set_app_menu() anyway, then this menu will be
549 	 * replaced with your own.
550 	 *
551 	 * Return: %TRUE if you should set an app menu
552 	 *
553 	 * Since: 3.14
554 	 */
555 	public bool prefersAppMenu()
556 	{
557 		return gtk_application_prefers_app_menu(gtkApplication) != 0;
558 	}
559 
560 	/**
561 	 * Removes an accelerator that has been previously added
562 	 * with gtk_application_add_accelerator().
563 	 *
564 	 * Deprecated: Use gtk_application_set_accels_for_action() instead
565 	 *
566 	 * Params:
567 	 *     actionName = the name of the action to activate
568 	 *     parameter = parameter to pass when activating the action,
569 	 *         or %NULL if the action does not accept an activation parameter
570 	 *
571 	 * Since: 3.4
572 	 */
573 	public void removeAccelerator(string actionName, Variant parameter)
574 	{
575 		gtk_application_remove_accelerator(gtkApplication, Str.toStringz(actionName), (parameter is null) ? null : parameter.getVariantStruct());
576 	}
577 
578 	/**
579 	 * Remove a window from @application.
580 	 *
581 	 * If @window belongs to @application then this call is equivalent to
582 	 * setting the #GtkWindow:application property of @window to
583 	 * %NULL.
584 	 *
585 	 * The application may stop running as a result of a call to this
586 	 * function.
587 	 *
588 	 * Params:
589 	 *     window = a #GtkWindow
590 	 *
591 	 * Since: 3.0
592 	 */
593 	public void removeWindow(Window window)
594 	{
595 		gtk_application_remove_window(gtkApplication, (window is null) ? null : window.getWindowStruct());
596 	}
597 
598 	/**
599 	 * Sets zero or more keyboard accelerators that will trigger the
600 	 * given action. The first item in @accels will be the primary
601 	 * accelerator, which may be displayed in the UI.
602 	 *
603 	 * To remove all accelerators for an action, use an empty, zero-terminated
604 	 * array for @accels.
605 	 *
606 	 * Params:
607 	 *     detailedActionName = a detailed action name, specifying an action
608 	 *         and target to associate accelerators with
609 	 *     accels = a list of accelerators in the format understood by
610 	 *         gtk_accelerator_parse()
611 	 *
612 	 * Since: 3.12
613 	 */
614 	public void setAccelsForAction(string detailedActionName, string[] accels)
615 	{
616 		gtk_application_set_accels_for_action(gtkApplication, Str.toStringz(detailedActionName), Str.toStringzArray(accels));
617 	}
618 
619 	/**
620 	 * Sets or unsets the application menu for @application.
621 	 *
622 	 * This can only be done in the primary instance of the application,
623 	 * after it has been registered.  #GApplication::startup is a good place
624 	 * to call this.
625 	 *
626 	 * The application menu is a single menu containing items that typically
627 	 * impact the application as a whole, rather than acting on a specific
628 	 * window or document.  For example, you would expect to see
629 	 * “Preferences” or “Quit” in an application menu, but not “Save” or
630 	 * “Print”.
631 	 *
632 	 * If supported, the application menu will be rendered by the desktop
633 	 * environment.
634 	 *
635 	 * Use the base #GActionMap interface to add actions, to respond to the user
636 	 * selecting these menu items.
637 	 *
638 	 * Params:
639 	 *     appMenu = a #GMenuModel, or %NULL
640 	 *
641 	 * Since: 3.4
642 	 */
643 	public void setAppMenu(MenuModel appMenu)
644 	{
645 		gtk_application_set_app_menu(gtkApplication, (appMenu is null) ? null : appMenu.getMenuModelStruct());
646 	}
647 
648 	/**
649 	 * Sets or unsets the menubar for windows of @application.
650 	 *
651 	 * This is a menubar in the traditional sense.
652 	 *
653 	 * This can only be done in the primary instance of the application,
654 	 * after it has been registered.  #GApplication::startup is a good place
655 	 * to call this.
656 	 *
657 	 * Depending on the desktop environment, this may appear at the top of
658 	 * each window, or at the top of the screen.  In some environments, if
659 	 * both the application menu and the menubar are set, the application
660 	 * menu will be presented as if it were the first item of the menubar.
661 	 * Other environments treat the two as completely separate -- for
662 	 * example, the application menu may be rendered by the desktop shell
663 	 * while the menubar (if set) remains in each individual window.
664 	 *
665 	 * Use the base #GActionMap interface to add actions, to respond to the user
666 	 * selecting these menu items.
667 	 *
668 	 * Params:
669 	 *     menubar = a #GMenuModel, or %NULL
670 	 *
671 	 * Since: 3.4
672 	 */
673 	public void setMenubar(MenuModel menubar)
674 	{
675 		gtk_application_set_menubar(gtkApplication, (menubar is null) ? null : menubar.getMenuModelStruct());
676 	}
677 
678 	/**
679 	 * Removes an inhibitor that has been established with gtk_application_inhibit().
680 	 * Inhibitors are also cleared when the application exits.
681 	 *
682 	 * Params:
683 	 *     cookie = a cookie that was returned by gtk_application_inhibit()
684 	 *
685 	 * Since: 3.4
686 	 */
687 	public void uninhibit(uint cookie)
688 	{
689 		gtk_application_uninhibit(gtkApplication, cookie);
690 	}
691 
692 	int[string] connectedSignals;
693 
694 	void delegate(Window, Application)[] onWindowAddedListeners;
695 	/**
696 	 * Emitted when a #GtkWindow is added to @application through
697 	 * gtk_application_add_window().
698 	 *
699 	 * Params:
700 	 *     window = the newly-added #GtkWindow
701 	 *
702 	 * Since: 3.2
703 	 */
704 	void addOnWindowAdded(void delegate(Window, Application) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
705 	{
706 		if ( "window-added" !in connectedSignals )
707 		{
708 			Signals.connectData(
709 				this,
710 				"window-added",
711 				cast(GCallback)&callBackWindowAdded,
712 				cast(void*)this,
713 				null,
714 				connectFlags);
715 			connectedSignals["window-added"] = 1;
716 		}
717 		onWindowAddedListeners ~= dlg;
718 	}
719 	extern(C) static void callBackWindowAdded(GtkApplication* applicationStruct, GtkWindow* window, Application _application)
720 	{
721 		foreach ( void delegate(Window, Application) dlg; _application.onWindowAddedListeners )
722 		{
723 			dlg(ObjectG.getDObject!(Window)(window), _application);
724 		}
725 	}
726 
727 	void delegate(Window, Application)[] onWindowRemovedListeners;
728 	/**
729 	 * Emitted when a #GtkWindow is removed from @application,
730 	 * either as a side-effect of being destroyed or explicitly
731 	 * through gtk_application_remove_window().
732 	 *
733 	 * Params:
734 	 *     window = the #GtkWindow that is being removed
735 	 *
736 	 * Since: 3.2
737 	 */
738 	void addOnWindowRemoved(void delegate(Window, Application) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
739 	{
740 		if ( "window-removed" !in connectedSignals )
741 		{
742 			Signals.connectData(
743 				this,
744 				"window-removed",
745 				cast(GCallback)&callBackWindowRemoved,
746 				cast(void*)this,
747 				null,
748 				connectFlags);
749 			connectedSignals["window-removed"] = 1;
750 		}
751 		onWindowRemovedListeners ~= dlg;
752 	}
753 	extern(C) static void callBackWindowRemoved(GtkApplication* applicationStruct, GtkWindow* window, Application _application)
754 	{
755 		foreach ( void delegate(Window, Application) dlg; _application.onWindowRemovedListeners )
756 		{
757 			dlg(ObjectG.getDObject!(Window)(window), _application);
758 		}
759 	}
760 }