{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- t'GI.Gtk.Objects.Application.Application' is a class that handles many important aspects
-- of a GTK+ application in a convenient fashion, without enforcing
-- a one-size-fits-all application model.
-- 
-- Currently, GtkApplication handles GTK+ initialization, application
-- uniqueness, session management, provides some basic scriptability and
-- desktop shell integration by exporting actions and menus and manages a
-- list of toplevel windows whose life-cycle is automatically tied to the
-- life-cycle of your application.
-- 
-- While GtkApplication works fine with plain @/GtkWindows/@, it is recommended
-- to use it together with t'GI.Gtk.Objects.ApplicationWindow.ApplicationWindow'.
-- 
-- When GDK threads are enabled, GtkApplication will acquire the GDK
-- lock when invoking actions that arrive from other processes.  The GDK
-- lock is not touched for local action invocations.  In order to have
-- actions invoked in a predictable context it is therefore recommended
-- that the GDK lock be held while invoking actions locally with
-- 'GI.Gio.Interfaces.ActionGroup.actionGroupActivateAction'.  The same applies to actions
-- associated with t'GI.Gtk.Objects.ApplicationWindow.ApplicationWindow' and to the “activate” and
-- “open” t'GI.Gio.Objects.Application.Application' methods.
-- 
-- ## Automatic resources ## {@/automatic/@-resources}
-- 
-- t'GI.Gtk.Objects.Application.Application' will automatically load menus from the t'GI.Gtk.Objects.Builder.Builder'
-- resource located at \"gtk\/menus.ui\", relative to the application\'s
-- resource base path (see 'GI.Gio.Objects.Application.applicationSetResourceBasePath').  The
-- menu with the ID \"app-menu\" is taken as the application\'s app menu
-- and the menu with the ID \"menubar\" is taken as the application\'s
-- menubar.  Additional menus (most interesting submenus) can be named
-- and accessed via 'GI.Gtk.Objects.Application.applicationGetMenuById' which allows for
-- dynamic population of a part of the menu structure.
-- 
-- If the resources \"gtk\/menus-appmenu.ui\" or \"gtk\/menus-traditional.ui\" are
-- present then these files will be used in preference, depending on the value
-- of 'GI.Gtk.Objects.Application.applicationPrefersAppMenu'. If the resource \"gtk\/menus-common.ui\"
-- is present it will be loaded as well. This is useful for storing items that
-- are referenced from both \"gtk\/menus-appmenu.ui\" and
-- \"gtk\/menus-traditional.ui\".
-- 
-- It is also possible to provide the menus manually using
-- 'GI.Gtk.Objects.Application.applicationSetAppMenu' and 'GI.Gtk.Objects.Application.applicationSetMenubar'.
-- 
-- t'GI.Gtk.Objects.Application.Application' will also automatically setup an icon search path for
-- the default icon theme by appending \"icons\" to the resource base
-- path.  This allows your application to easily store its icons as
-- resources.  See 'GI.Gtk.Objects.IconTheme.iconThemeAddResourcePath' for more
-- information.
-- 
-- If there is a resource located at \"gtk\/help-overlay.ui\" which
-- defines a t'GI.Gtk.Objects.ShortcutsWindow.ShortcutsWindow' with ID \"help_overlay\" then GtkApplication
-- associates an instance of this shortcuts window with each
-- t'GI.Gtk.Objects.ApplicationWindow.ApplicationWindow' and sets up keyboard accelerators (Control-F1
-- and Control-?) to open it. To create a menu item that displays the
-- shortcuts window, associate the item with the action win.show-help-overlay.
-- 
-- ## A simple application ## {@/gtkapplication/@}
-- 
-- <https://git.gnome.org/browse/gtk+/tree/examples/bp/bloatpad.c A simple example>
-- 
-- GtkApplication optionally registers with a session manager
-- of the users session (if you set the t'GI.Gtk.Objects.Application.Application':@/register-session/@
-- property) and offers various functionality related to the session
-- life-cycle.
-- 
-- An application can block various ways to end the session with
-- the 'GI.Gtk.Objects.Application.applicationInhibit' function. Typical use cases for
-- this kind of inhibiting are long-running, uninterruptible operations,
-- such as burning a CD or performing a disk backup. The session
-- manager may not honor the inhibitor, but it can be expected to
-- inform the user about the negative consequences of ending the
-- session while inhibitors are present.
-- 
-- ## See Also ## {@/seealso/@}
-- <https://wiki.gnome.org/HowDoI/GtkApplication HowDoI: Using GtkApplication>,
-- <https://developer.gnome.org/gtk3/stable/gtk-getting-started.html#id-1.2.3.3 Getting Started with GTK+: Basics>

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Gtk.Objects.Application
    ( 

-- * Exported types
    Application(..)                         ,
    IsApplication                           ,
    toApplication                           ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [actionAdded]("GI.Gio.Interfaces.ActionGroup#g:method:actionAdded"), [actionEnabledChanged]("GI.Gio.Interfaces.ActionGroup#g:method:actionEnabledChanged"), [actionRemoved]("GI.Gio.Interfaces.ActionGroup#g:method:actionRemoved"), [actionStateChanged]("GI.Gio.Interfaces.ActionGroup#g:method:actionStateChanged"), [activate]("GI.Gio.Objects.Application#g:method:activate"), [activateAction]("GI.Gio.Interfaces.ActionGroup#g:method:activateAction"), [addAccelerator]("GI.Gtk.Objects.Application#g:method:addAccelerator"), [addAction]("GI.Gio.Interfaces.ActionMap#g:method:addAction"), [addActionEntries]("GI.Gio.Interfaces.ActionMap#g:method:addActionEntries"), [addMainOption]("GI.Gio.Objects.Application#g:method:addMainOption"), [addMainOptionEntries]("GI.Gio.Objects.Application#g:method:addMainOptionEntries"), [addOptionGroup]("GI.Gio.Objects.Application#g:method:addOptionGroup"), [addWindow]("GI.Gtk.Objects.Application#g:method:addWindow"), [bindBusyProperty]("GI.Gio.Objects.Application#g:method:bindBusyProperty"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [changeActionState]("GI.Gio.Interfaces.ActionGroup#g:method:changeActionState"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [hasAction]("GI.Gio.Interfaces.ActionGroup#g:method:hasAction"), [hold]("GI.Gio.Objects.Application#g:method:hold"), [inhibit]("GI.Gtk.Objects.Application#g:method:inhibit"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isInhibited]("GI.Gtk.Objects.Application#g:method:isInhibited"), [listActionDescriptions]("GI.Gtk.Objects.Application#g:method:listActionDescriptions"), [listActions]("GI.Gio.Interfaces.ActionGroup#g:method:listActions"), [lookupAction]("GI.Gio.Interfaces.ActionMap#g:method:lookupAction"), [markBusy]("GI.Gio.Objects.Application#g:method:markBusy"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [open]("GI.Gio.Objects.Application#g:method:open"), [prefersAppMenu]("GI.Gtk.Objects.Application#g:method:prefersAppMenu"), [queryAction]("GI.Gio.Interfaces.ActionGroup#g:method:queryAction"), [quit]("GI.Gio.Objects.Application#g:method:quit"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [register]("GI.Gio.Objects.Application#g:method:register"), [release]("GI.Gio.Objects.Application#g:method:release"), [removeAccelerator]("GI.Gtk.Objects.Application#g:method:removeAccelerator"), [removeAction]("GI.Gio.Interfaces.ActionMap#g:method:removeAction"), [removeWindow]("GI.Gtk.Objects.Application#g:method:removeWindow"), [run]("GI.Gio.Objects.Application#g:method:run"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [sendNotification]("GI.Gio.Objects.Application#g:method:sendNotification"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unbindBusyProperty]("GI.Gio.Objects.Application#g:method:unbindBusyProperty"), [uninhibit]("GI.Gtk.Objects.Application#g:method:uninhibit"), [unmarkBusy]("GI.Gio.Objects.Application#g:method:unmarkBusy"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure"), [withdrawNotification]("GI.Gio.Objects.Application#g:method:withdrawNotification").
-- 
-- ==== Getters
-- [getAccelsForAction]("GI.Gtk.Objects.Application#g:method:getAccelsForAction"), [getActionEnabled]("GI.Gio.Interfaces.ActionGroup#g:method:getActionEnabled"), [getActionParameterType]("GI.Gio.Interfaces.ActionGroup#g:method:getActionParameterType"), [getActionState]("GI.Gio.Interfaces.ActionGroup#g:method:getActionState"), [getActionStateHint]("GI.Gio.Interfaces.ActionGroup#g:method:getActionStateHint"), [getActionStateType]("GI.Gio.Interfaces.ActionGroup#g:method:getActionStateType"), [getActionsForAccel]("GI.Gtk.Objects.Application#g:method:getActionsForAccel"), [getActiveWindow]("GI.Gtk.Objects.Application#g:method:getActiveWindow"), [getAppMenu]("GI.Gtk.Objects.Application#g:method:getAppMenu"), [getApplicationId]("GI.Gio.Objects.Application#g:method:getApplicationId"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDbusConnection]("GI.Gio.Objects.Application#g:method:getDbusConnection"), [getDbusObjectPath]("GI.Gio.Objects.Application#g:method:getDbusObjectPath"), [getFlags]("GI.Gio.Objects.Application#g:method:getFlags"), [getInactivityTimeout]("GI.Gio.Objects.Application#g:method:getInactivityTimeout"), [getIsBusy]("GI.Gio.Objects.Application#g:method:getIsBusy"), [getIsRegistered]("GI.Gio.Objects.Application#g:method:getIsRegistered"), [getIsRemote]("GI.Gio.Objects.Application#g:method:getIsRemote"), [getMenuById]("GI.Gtk.Objects.Application#g:method:getMenuById"), [getMenubar]("GI.Gtk.Objects.Application#g:method:getMenubar"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getResourceBasePath]("GI.Gio.Objects.Application#g:method:getResourceBasePath"), [getWindowById]("GI.Gtk.Objects.Application#g:method:getWindowById"), [getWindows]("GI.Gtk.Objects.Application#g:method:getWindows").
-- 
-- ==== Setters
-- [setAccelsForAction]("GI.Gtk.Objects.Application#g:method:setAccelsForAction"), [setActionGroup]("GI.Gio.Objects.Application#g:method:setActionGroup"), [setAppMenu]("GI.Gtk.Objects.Application#g:method:setAppMenu"), [setApplicationId]("GI.Gio.Objects.Application#g:method:setApplicationId"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setDefault]("GI.Gio.Objects.Application#g:method:setDefault"), [setFlags]("GI.Gio.Objects.Application#g:method:setFlags"), [setInactivityTimeout]("GI.Gio.Objects.Application#g:method:setInactivityTimeout"), [setMenubar]("GI.Gtk.Objects.Application#g:method:setMenubar"), [setOptionContextDescription]("GI.Gio.Objects.Application#g:method:setOptionContextDescription"), [setOptionContextParameterString]("GI.Gio.Objects.Application#g:method:setOptionContextParameterString"), [setOptionContextSummary]("GI.Gio.Objects.Application#g:method:setOptionContextSummary"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setResourceBasePath]("GI.Gio.Objects.Application#g:method:setResourceBasePath").

#if defined(ENABLE_OVERLOADING)
    ResolveApplicationMethod                ,
#endif

-- ** addAccelerator #method:addAccelerator#

#if defined(ENABLE_OVERLOADING)
    ApplicationAddAcceleratorMethodInfo     ,
#endif
    applicationAddAccelerator               ,


-- ** addWindow #method:addWindow#

#if defined(ENABLE_OVERLOADING)
    ApplicationAddWindowMethodInfo          ,
#endif
    applicationAddWindow                    ,


-- ** getAccelsForAction #method:getAccelsForAction#

#if defined(ENABLE_OVERLOADING)
    ApplicationGetAccelsForActionMethodInfo ,
#endif
    applicationGetAccelsForAction           ,


-- ** getActionsForAccel #method:getActionsForAccel#

#if defined(ENABLE_OVERLOADING)
    ApplicationGetActionsForAccelMethodInfo ,
#endif
    applicationGetActionsForAccel           ,


-- ** getActiveWindow #method:getActiveWindow#

#if defined(ENABLE_OVERLOADING)
    ApplicationGetActiveWindowMethodInfo    ,
#endif
    applicationGetActiveWindow              ,


-- ** getAppMenu #method:getAppMenu#

#if defined(ENABLE_OVERLOADING)
    ApplicationGetAppMenuMethodInfo         ,
#endif
    applicationGetAppMenu                   ,


-- ** getMenuById #method:getMenuById#

#if defined(ENABLE_OVERLOADING)
    ApplicationGetMenuByIdMethodInfo        ,
#endif
    applicationGetMenuById                  ,


-- ** getMenubar #method:getMenubar#

#if defined(ENABLE_OVERLOADING)
    ApplicationGetMenubarMethodInfo         ,
#endif
    applicationGetMenubar                   ,


-- ** getWindowById #method:getWindowById#

#if defined(ENABLE_OVERLOADING)
    ApplicationGetWindowByIdMethodInfo      ,
#endif
    applicationGetWindowById                ,


-- ** getWindows #method:getWindows#

#if defined(ENABLE_OVERLOADING)
    ApplicationGetWindowsMethodInfo         ,
#endif
    applicationGetWindows                   ,


-- ** inhibit #method:inhibit#

#if defined(ENABLE_OVERLOADING)
    ApplicationInhibitMethodInfo            ,
#endif
    applicationInhibit                      ,


-- ** isInhibited #method:isInhibited#

#if defined(ENABLE_OVERLOADING)
    ApplicationIsInhibitedMethodInfo        ,
#endif
    applicationIsInhibited                  ,


-- ** listActionDescriptions #method:listActionDescriptions#

#if defined(ENABLE_OVERLOADING)
    ApplicationListActionDescriptionsMethodInfo,
#endif
    applicationListActionDescriptions       ,


-- ** new #method:new#

    applicationNew                          ,


-- ** prefersAppMenu #method:prefersAppMenu#

#if defined(ENABLE_OVERLOADING)
    ApplicationPrefersAppMenuMethodInfo     ,
#endif
    applicationPrefersAppMenu               ,


-- ** removeAccelerator #method:removeAccelerator#

#if defined(ENABLE_OVERLOADING)
    ApplicationRemoveAcceleratorMethodInfo  ,
#endif
    applicationRemoveAccelerator            ,


-- ** removeWindow #method:removeWindow#

#if defined(ENABLE_OVERLOADING)
    ApplicationRemoveWindowMethodInfo       ,
#endif
    applicationRemoveWindow                 ,


-- ** setAccelsForAction #method:setAccelsForAction#

#if defined(ENABLE_OVERLOADING)
    ApplicationSetAccelsForActionMethodInfo ,
#endif
    applicationSetAccelsForAction           ,


-- ** setAppMenu #method:setAppMenu#

#if defined(ENABLE_OVERLOADING)
    ApplicationSetAppMenuMethodInfo         ,
#endif
    applicationSetAppMenu                   ,


-- ** setMenubar #method:setMenubar#

#if defined(ENABLE_OVERLOADING)
    ApplicationSetMenubarMethodInfo         ,
#endif
    applicationSetMenubar                   ,


-- ** uninhibit #method:uninhibit#

#if defined(ENABLE_OVERLOADING)
    ApplicationUninhibitMethodInfo          ,
#endif
    applicationUninhibit                    ,




 -- * Properties


-- ** activeWindow #attr:activeWindow#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    ApplicationActiveWindowPropertyInfo     ,
#endif
#if defined(ENABLE_OVERLOADING)
    applicationActiveWindow                 ,
#endif
    getApplicationActiveWindow              ,


-- ** appMenu #attr:appMenu#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    ApplicationAppMenuPropertyInfo          ,
#endif
#if defined(ENABLE_OVERLOADING)
    applicationAppMenu                      ,
#endif
    clearApplicationAppMenu                 ,
    constructApplicationAppMenu             ,
    getApplicationAppMenu                   ,
    setApplicationAppMenu                   ,


-- ** menubar #attr:menubar#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    ApplicationMenubarPropertyInfo          ,
#endif
#if defined(ENABLE_OVERLOADING)
    applicationMenubar                      ,
#endif
    clearApplicationMenubar                 ,
    constructApplicationMenubar             ,
    getApplicationMenubar                   ,
    setApplicationMenubar                   ,


-- ** registerSession #attr:registerSession#
-- | Set this property to 'P.True' to register with the session manager.
-- 
-- /Since: 3.4/

#if defined(ENABLE_OVERLOADING)
    ApplicationRegisterSessionPropertyInfo  ,
#endif
#if defined(ENABLE_OVERLOADING)
    applicationRegisterSession              ,
#endif
    constructApplicationRegisterSession     ,
    getApplicationRegisterSession           ,
    setApplicationRegisterSession           ,


-- ** screensaverActive #attr:screensaverActive#
-- | This property is 'P.True' if GTK+ believes that the screensaver is
-- currently active. GTK+ only tracks session state (including this)
-- when t'GI.Gtk.Objects.Application.Application'::@/register-session/@ is set to 'P.True'.
-- 
-- Tracking the screensaver state is supported on Linux.
-- 
-- /Since: 3.24/

#if defined(ENABLE_OVERLOADING)
    ApplicationScreensaverActivePropertyInfo,
#endif
#if defined(ENABLE_OVERLOADING)
    applicationScreensaverActive            ,
#endif
    getApplicationScreensaverActive         ,




 -- * Signals


-- ** queryEnd #signal:queryEnd#

    ApplicationQueryEndCallback             ,
#if defined(ENABLE_OVERLOADING)
    ApplicationQueryEndSignalInfo           ,
#endif
    C_ApplicationQueryEndCallback           ,
    afterApplicationQueryEnd                ,
    genClosure_ApplicationQueryEnd          ,
    mk_ApplicationQueryEndCallback          ,
    noApplicationQueryEndCallback           ,
    onApplicationQueryEnd                   ,
    wrap_ApplicationQueryEndCallback        ,


-- ** windowAdded #signal:windowAdded#

    ApplicationWindowAddedCallback          ,
#if defined(ENABLE_OVERLOADING)
    ApplicationWindowAddedSignalInfo        ,
#endif
    C_ApplicationWindowAddedCallback        ,
    afterApplicationWindowAdded             ,
    genClosure_ApplicationWindowAdded       ,
    mk_ApplicationWindowAddedCallback       ,
    noApplicationWindowAddedCallback        ,
    onApplicationWindowAdded                ,
    wrap_ApplicationWindowAddedCallback     ,


-- ** windowRemoved #signal:windowRemoved#

    ApplicationWindowRemovedCallback        ,
#if defined(ENABLE_OVERLOADING)
    ApplicationWindowRemovedSignalInfo      ,
#endif
    C_ApplicationWindowRemovedCallback      ,
    afterApplicationWindowRemoved           ,
    genClosure_ApplicationWindowRemoved     ,
    mk_ApplicationWindowRemovedCallback     ,
    noApplicationWindowRemovedCallback      ,
    onApplicationWindowRemoved              ,
    wrap_ApplicationWindowRemovedCallback   ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.ActionGroup as Gio.ActionGroup
import qualified GI.Gio.Interfaces.ActionMap as Gio.ActionMap
import qualified GI.Gio.Objects.Application as Gio.Application
import qualified GI.Gio.Objects.Menu as Gio.Menu
import qualified GI.Gio.Objects.MenuModel as Gio.MenuModel
import {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
import {-# SOURCE #-} qualified GI.Gtk.Objects.Window as Gtk.Window

-- | Memory-managed wrapper type.
newtype Application = Application (SP.ManagedPtr Application)
    deriving (Application -> Application -> Bool
(Application -> Application -> Bool)
-> (Application -> Application -> Bool) -> Eq Application
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Application -> Application -> Bool
$c/= :: Application -> Application -> Bool
== :: Application -> Application -> Bool
$c== :: Application -> Application -> Bool
Eq)

instance SP.ManagedPtrNewtype Application where
    toManagedPtr :: Application -> ManagedPtr Application
toManagedPtr (Application ManagedPtr Application
p) = ManagedPtr Application
p

foreign import ccall "gtk_application_get_type"
    c_gtk_application_get_type :: IO B.Types.GType

instance B.Types.TypedObject Application where
    glibType :: IO GType
glibType = IO GType
c_gtk_application_get_type

instance B.Types.GObject Application

-- | Type class for types which can be safely cast to `Application`, for instance with `toApplication`.
class (SP.GObject o, O.IsDescendantOf Application o) => IsApplication o
instance (SP.GObject o, O.IsDescendantOf Application o) => IsApplication o

instance O.HasParentTypes Application
type instance O.ParentTypes Application = '[Gio.Application.Application, GObject.Object.Object, Gio.ActionGroup.ActionGroup, Gio.ActionMap.ActionMap]

-- | Cast to `Application`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toApplication :: (MIO.MonadIO m, IsApplication o) => o -> m Application
toApplication :: forall (m :: * -> *) o.
(MonadIO m, IsApplication o) =>
o -> m Application
toApplication = IO Application -> m Application
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Application -> m Application)
-> (o -> IO Application) -> o -> m Application
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Application -> Application) -> o -> IO Application
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Application -> Application
Application

-- | Convert 'Application' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe Application) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_application_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Application -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Application
P.Nothing = Ptr GValue -> Ptr Application -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Application
forall a. Ptr a
FP.nullPtr :: FP.Ptr Application)
    gvalueSet_ Ptr GValue
gv (P.Just Application
obj) = Application -> (Ptr Application -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Application
obj (Ptr GValue -> Ptr Application -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Application)
gvalueGet_ Ptr GValue
gv = do
        Ptr Application
ptr <- Ptr GValue -> IO (Ptr Application)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Application)
        if Ptr Application
ptr Ptr Application -> Ptr Application -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Application
forall a. Ptr a
FP.nullPtr
        then Application -> Maybe Application
forall a. a -> Maybe a
P.Just (Application -> Maybe Application)
-> IO Application -> IO (Maybe Application)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Application -> Application)
-> Ptr Application -> IO Application
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Application -> Application
Application Ptr Application
ptr
        else Maybe Application -> IO (Maybe Application)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Application
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveApplicationMethod (t :: Symbol) (o :: *) :: * where
    ResolveApplicationMethod "actionAdded" o = Gio.ActionGroup.ActionGroupActionAddedMethodInfo
    ResolveApplicationMethod "actionEnabledChanged" o = Gio.ActionGroup.ActionGroupActionEnabledChangedMethodInfo
    ResolveApplicationMethod "actionRemoved" o = Gio.ActionGroup.ActionGroupActionRemovedMethodInfo
    ResolveApplicationMethod "actionStateChanged" o = Gio.ActionGroup.ActionGroupActionStateChangedMethodInfo
    ResolveApplicationMethod "activate" o = Gio.Application.ApplicationActivateMethodInfo
    ResolveApplicationMethod "activateAction" o = Gio.ActionGroup.ActionGroupActivateActionMethodInfo
    ResolveApplicationMethod "addAccelerator" o = ApplicationAddAcceleratorMethodInfo
    ResolveApplicationMethod "addAction" o = Gio.ActionMap.ActionMapAddActionMethodInfo
    ResolveApplicationMethod "addActionEntries" o = Gio.ActionMap.ActionMapAddActionEntriesMethodInfo
    ResolveApplicationMethod "addMainOption" o = Gio.Application.ApplicationAddMainOptionMethodInfo
    ResolveApplicationMethod "addMainOptionEntries" o = Gio.Application.ApplicationAddMainOptionEntriesMethodInfo
    ResolveApplicationMethod "addOptionGroup" o = Gio.Application.ApplicationAddOptionGroupMethodInfo
    ResolveApplicationMethod "addWindow" o = ApplicationAddWindowMethodInfo
    ResolveApplicationMethod "bindBusyProperty" o = Gio.Application.ApplicationBindBusyPropertyMethodInfo
    ResolveApplicationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveApplicationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveApplicationMethod "changeActionState" o = Gio.ActionGroup.ActionGroupChangeActionStateMethodInfo
    ResolveApplicationMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveApplicationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveApplicationMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveApplicationMethod "hasAction" o = Gio.ActionGroup.ActionGroupHasActionMethodInfo
    ResolveApplicationMethod "hold" o = Gio.Application.ApplicationHoldMethodInfo
    ResolveApplicationMethod "inhibit" o = ApplicationInhibitMethodInfo
    ResolveApplicationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveApplicationMethod "isInhibited" o = ApplicationIsInhibitedMethodInfo
    ResolveApplicationMethod "listActionDescriptions" o = ApplicationListActionDescriptionsMethodInfo
    ResolveApplicationMethod "listActions" o = Gio.ActionGroup.ActionGroupListActionsMethodInfo
    ResolveApplicationMethod "lookupAction" o = Gio.ActionMap.ActionMapLookupActionMethodInfo
    ResolveApplicationMethod "markBusy" o = Gio.Application.ApplicationMarkBusyMethodInfo
    ResolveApplicationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveApplicationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveApplicationMethod "open" o = Gio.Application.ApplicationOpenMethodInfo
    ResolveApplicationMethod "prefersAppMenu" o = ApplicationPrefersAppMenuMethodInfo
    ResolveApplicationMethod "queryAction" o = Gio.ActionGroup.ActionGroupQueryActionMethodInfo
    ResolveApplicationMethod "quit" o = Gio.Application.ApplicationQuitMethodInfo
    ResolveApplicationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveApplicationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveApplicationMethod "register" o = Gio.Application.ApplicationRegisterMethodInfo
    ResolveApplicationMethod "release" o = Gio.Application.ApplicationReleaseMethodInfo
    ResolveApplicationMethod "removeAccelerator" o = ApplicationRemoveAcceleratorMethodInfo
    ResolveApplicationMethod "removeAction" o = Gio.ActionMap.ActionMapRemoveActionMethodInfo
    ResolveApplicationMethod "removeWindow" o = ApplicationRemoveWindowMethodInfo
    ResolveApplicationMethod "run" o = Gio.Application.ApplicationRunMethodInfo
    ResolveApplicationMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveApplicationMethod "sendNotification" o = Gio.Application.ApplicationSendNotificationMethodInfo
    ResolveApplicationMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveApplicationMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveApplicationMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveApplicationMethod "unbindBusyProperty" o = Gio.Application.ApplicationUnbindBusyPropertyMethodInfo
    ResolveApplicationMethod "uninhibit" o = ApplicationUninhibitMethodInfo
    ResolveApplicationMethod "unmarkBusy" o = Gio.Application.ApplicationUnmarkBusyMethodInfo
    ResolveApplicationMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveApplicationMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveApplicationMethod "withdrawNotification" o = Gio.Application.ApplicationWithdrawNotificationMethodInfo
    ResolveApplicationMethod "getAccelsForAction" o = ApplicationGetAccelsForActionMethodInfo
    ResolveApplicationMethod "getActionEnabled" o = Gio.ActionGroup.ActionGroupGetActionEnabledMethodInfo
    ResolveApplicationMethod "getActionParameterType" o = Gio.ActionGroup.ActionGroupGetActionParameterTypeMethodInfo
    ResolveApplicationMethod "getActionState" o = Gio.ActionGroup.ActionGroupGetActionStateMethodInfo
    ResolveApplicationMethod "getActionStateHint" o = Gio.ActionGroup.ActionGroupGetActionStateHintMethodInfo
    ResolveApplicationMethod "getActionStateType" o = Gio.ActionGroup.ActionGroupGetActionStateTypeMethodInfo
    ResolveApplicationMethod "getActionsForAccel" o = ApplicationGetActionsForAccelMethodInfo
    ResolveApplicationMethod "getActiveWindow" o = ApplicationGetActiveWindowMethodInfo
    ResolveApplicationMethod "getAppMenu" o = ApplicationGetAppMenuMethodInfo
    ResolveApplicationMethod "getApplicationId" o = Gio.Application.ApplicationGetApplicationIdMethodInfo
    ResolveApplicationMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveApplicationMethod "getDbusConnection" o = Gio.Application.ApplicationGetDbusConnectionMethodInfo
    ResolveApplicationMethod "getDbusObjectPath" o = Gio.Application.ApplicationGetDbusObjectPathMethodInfo
    ResolveApplicationMethod "getFlags" o = Gio.Application.ApplicationGetFlagsMethodInfo
    ResolveApplicationMethod "getInactivityTimeout" o = Gio.Application.ApplicationGetInactivityTimeoutMethodInfo
    ResolveApplicationMethod "getIsBusy" o = Gio.Application.ApplicationGetIsBusyMethodInfo
    ResolveApplicationMethod "getIsRegistered" o = Gio.Application.ApplicationGetIsRegisteredMethodInfo
    ResolveApplicationMethod "getIsRemote" o = Gio.Application.ApplicationGetIsRemoteMethodInfo
    ResolveApplicationMethod "getMenuById" o = ApplicationGetMenuByIdMethodInfo
    ResolveApplicationMethod "getMenubar" o = ApplicationGetMenubarMethodInfo
    ResolveApplicationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveApplicationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveApplicationMethod "getResourceBasePath" o = Gio.Application.ApplicationGetResourceBasePathMethodInfo
    ResolveApplicationMethod "getWindowById" o = ApplicationGetWindowByIdMethodInfo
    ResolveApplicationMethod "getWindows" o = ApplicationGetWindowsMethodInfo
    ResolveApplicationMethod "setAccelsForAction" o = ApplicationSetAccelsForActionMethodInfo
    ResolveApplicationMethod "setActionGroup" o = Gio.Application.ApplicationSetActionGroupMethodInfo
    ResolveApplicationMethod "setAppMenu" o = ApplicationSetAppMenuMethodInfo
    ResolveApplicationMethod "setApplicationId" o = Gio.Application.ApplicationSetApplicationIdMethodInfo
    ResolveApplicationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveApplicationMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveApplicationMethod "setDefault" o = Gio.Application.ApplicationSetDefaultMethodInfo
    ResolveApplicationMethod "setFlags" o = Gio.Application.ApplicationSetFlagsMethodInfo
    ResolveApplicationMethod "setInactivityTimeout" o = Gio.Application.ApplicationSetInactivityTimeoutMethodInfo
    ResolveApplicationMethod "setMenubar" o = ApplicationSetMenubarMethodInfo
    ResolveApplicationMethod "setOptionContextDescription" o = Gio.Application.ApplicationSetOptionContextDescriptionMethodInfo
    ResolveApplicationMethod "setOptionContextParameterString" o = Gio.Application.ApplicationSetOptionContextParameterStringMethodInfo
    ResolveApplicationMethod "setOptionContextSummary" o = Gio.Application.ApplicationSetOptionContextSummaryMethodInfo
    ResolveApplicationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveApplicationMethod "setResourceBasePath" o = Gio.Application.ApplicationSetResourceBasePathMethodInfo
    ResolveApplicationMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveApplicationMethod t Application, O.OverloadedMethod info Application p) => OL.IsLabel t (Application -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveApplicationMethod t Application, O.OverloadedMethod info Application p, R.HasField t Application p) => R.HasField t Application p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveApplicationMethod t Application, O.OverloadedMethodInfo info Application) => OL.IsLabel t (O.MethodProxy info Application) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

-- signal Application::query-end
-- | Emitted when the session manager is about to end the session, only
-- if t'GI.Gtk.Objects.Application.Application'::@/register-session/@ is 'P.True'. Applications can
-- connect to this signal and call 'GI.Gtk.Objects.Application.applicationInhibit' with
-- 'GI.Gtk.Flags.ApplicationInhibitFlagsLogout' to delay the end of the session
-- until state has been saved.
-- 
-- /Since: 3.24.8/
type ApplicationQueryEndCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ApplicationQueryEndCallback`@.
noApplicationQueryEndCallback :: Maybe ApplicationQueryEndCallback
noApplicationQueryEndCallback :: Maybe (IO ())
noApplicationQueryEndCallback = Maybe (IO ())
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_ApplicationQueryEndCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_ApplicationQueryEndCallback`.
foreign import ccall "wrapper"
    mk_ApplicationQueryEndCallback :: C_ApplicationQueryEndCallback -> IO (FunPtr C_ApplicationQueryEndCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_ApplicationQueryEnd :: MonadIO m => ApplicationQueryEndCallback -> m (GClosure C_ApplicationQueryEndCallback)
genClosure_ApplicationQueryEnd :: forall (m :: * -> *).
MonadIO m =>
IO () -> m (GClosure C_ApplicationQueryEndCallback)
genClosure_ApplicationQueryEnd IO ()
cb = IO (GClosure C_ApplicationQueryEndCallback)
-> m (GClosure C_ApplicationQueryEndCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ApplicationQueryEndCallback)
 -> m (GClosure C_ApplicationQueryEndCallback))
-> IO (GClosure C_ApplicationQueryEndCallback)
-> m (GClosure C_ApplicationQueryEndCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationQueryEndCallback
cb' = IO () -> C_ApplicationQueryEndCallback
wrap_ApplicationQueryEndCallback IO ()
cb
    C_ApplicationQueryEndCallback
-> IO (FunPtr C_ApplicationQueryEndCallback)
mk_ApplicationQueryEndCallback C_ApplicationQueryEndCallback
cb' IO (FunPtr C_ApplicationQueryEndCallback)
-> (FunPtr C_ApplicationQueryEndCallback
    -> IO (GClosure C_ApplicationQueryEndCallback))
-> IO (GClosure C_ApplicationQueryEndCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ApplicationQueryEndCallback
-> IO (GClosure C_ApplicationQueryEndCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ApplicationQueryEndCallback` into a `C_ApplicationQueryEndCallback`.
wrap_ApplicationQueryEndCallback ::
    ApplicationQueryEndCallback ->
    C_ApplicationQueryEndCallback
wrap_ApplicationQueryEndCallback :: IO () -> C_ApplicationQueryEndCallback
wrap_ApplicationQueryEndCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
    IO ()
_cb 


-- | Connect a signal handler for the [queryEnd](#signal:queryEnd) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' application #queryEnd callback
-- @
-- 
-- 
onApplicationQueryEnd :: (IsApplication a, MonadIO m) => a -> ApplicationQueryEndCallback -> m SignalHandlerId
onApplicationQueryEnd :: forall a (m :: * -> *).
(IsApplication a, MonadIO m) =>
a -> IO () -> m SignalHandlerId
onApplicationQueryEnd a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationQueryEndCallback
cb' = IO () -> C_ApplicationQueryEndCallback
wrap_ApplicationQueryEndCallback IO ()
cb
    FunPtr C_ApplicationQueryEndCallback
cb'' <- C_ApplicationQueryEndCallback
-> IO (FunPtr C_ApplicationQueryEndCallback)
mk_ApplicationQueryEndCallback C_ApplicationQueryEndCallback
cb'
    a
-> Text
-> FunPtr C_ApplicationQueryEndCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"query-end" FunPtr C_ApplicationQueryEndCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [queryEnd](#signal:queryEnd) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' application #queryEnd callback
-- @
-- 
-- 
afterApplicationQueryEnd :: (IsApplication a, MonadIO m) => a -> ApplicationQueryEndCallback -> m SignalHandlerId
afterApplicationQueryEnd :: forall a (m :: * -> *).
(IsApplication a, MonadIO m) =>
a -> IO () -> m SignalHandlerId
afterApplicationQueryEnd a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationQueryEndCallback
cb' = IO () -> C_ApplicationQueryEndCallback
wrap_ApplicationQueryEndCallback IO ()
cb
    FunPtr C_ApplicationQueryEndCallback
cb'' <- C_ApplicationQueryEndCallback
-> IO (FunPtr C_ApplicationQueryEndCallback)
mk_ApplicationQueryEndCallback C_ApplicationQueryEndCallback
cb'
    a
-> Text
-> FunPtr C_ApplicationQueryEndCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"query-end" FunPtr C_ApplicationQueryEndCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data ApplicationQueryEndSignalInfo
instance SignalInfo ApplicationQueryEndSignalInfo where
    type HaskellCallbackType ApplicationQueryEndSignalInfo = ApplicationQueryEndCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ApplicationQueryEndCallback cb
        cb'' <- mk_ApplicationQueryEndCallback cb'
        connectSignalFunPtr obj "query-end" cb'' connectMode detail

#endif

-- signal Application::window-added
-- | Emitted when a t'GI.Gtk.Objects.Window.Window' is added to /@application@/ through
-- 'GI.Gtk.Objects.Application.applicationAddWindow'.
-- 
-- /Since: 3.2/
type ApplicationWindowAddedCallback =
    Gtk.Window.Window
    -- ^ /@window@/: the newly-added t'GI.Gtk.Objects.Window.Window'
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ApplicationWindowAddedCallback`@.
noApplicationWindowAddedCallback :: Maybe ApplicationWindowAddedCallback
noApplicationWindowAddedCallback :: Maybe ApplicationWindowAddedCallback
noApplicationWindowAddedCallback = Maybe ApplicationWindowAddedCallback
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_ApplicationWindowAddedCallback =
    Ptr () ->                               -- object
    Ptr Gtk.Window.Window ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_ApplicationWindowAddedCallback`.
foreign import ccall "wrapper"
    mk_ApplicationWindowAddedCallback :: C_ApplicationWindowAddedCallback -> IO (FunPtr C_ApplicationWindowAddedCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_ApplicationWindowAdded :: MonadIO m => ApplicationWindowAddedCallback -> m (GClosure C_ApplicationWindowAddedCallback)
genClosure_ApplicationWindowAdded :: forall (m :: * -> *).
MonadIO m =>
ApplicationWindowAddedCallback
-> m (GClosure C_ApplicationWindowAddedCallback)
genClosure_ApplicationWindowAdded ApplicationWindowAddedCallback
cb = IO (GClosure C_ApplicationWindowAddedCallback)
-> m (GClosure C_ApplicationWindowAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ApplicationWindowAddedCallback)
 -> m (GClosure C_ApplicationWindowAddedCallback))
-> IO (GClosure C_ApplicationWindowAddedCallback)
-> m (GClosure C_ApplicationWindowAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationWindowAddedCallback
cb' = ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowAddedCallback ApplicationWindowAddedCallback
cb
    C_ApplicationWindowAddedCallback
-> IO (FunPtr C_ApplicationWindowAddedCallback)
mk_ApplicationWindowAddedCallback C_ApplicationWindowAddedCallback
cb' IO (FunPtr C_ApplicationWindowAddedCallback)
-> (FunPtr C_ApplicationWindowAddedCallback
    -> IO (GClosure C_ApplicationWindowAddedCallback))
-> IO (GClosure C_ApplicationWindowAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ApplicationWindowAddedCallback
-> IO (GClosure C_ApplicationWindowAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ApplicationWindowAddedCallback` into a `C_ApplicationWindowAddedCallback`.
wrap_ApplicationWindowAddedCallback ::
    ApplicationWindowAddedCallback ->
    C_ApplicationWindowAddedCallback
wrap_ApplicationWindowAddedCallback :: ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowAddedCallback ApplicationWindowAddedCallback
_cb Ptr ()
_ Ptr Window
window Ptr ()
_ = do
    Window
window' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gtk.Window.Window) Ptr Window
window
    ApplicationWindowAddedCallback
_cb  Window
window'


-- | Connect a signal handler for the [windowAdded](#signal:windowAdded) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' application #windowAdded callback
-- @
-- 
-- 
onApplicationWindowAdded :: (IsApplication a, MonadIO m) => a -> ApplicationWindowAddedCallback -> m SignalHandlerId
onApplicationWindowAdded :: forall a (m :: * -> *).
(IsApplication a, MonadIO m) =>
a -> ApplicationWindowAddedCallback -> m SignalHandlerId
onApplicationWindowAdded a
obj ApplicationWindowAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationWindowAddedCallback
cb' = ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowAddedCallback ApplicationWindowAddedCallback
cb
    FunPtr C_ApplicationWindowAddedCallback
cb'' <- C_ApplicationWindowAddedCallback
-> IO (FunPtr C_ApplicationWindowAddedCallback)
mk_ApplicationWindowAddedCallback C_ApplicationWindowAddedCallback
cb'
    a
-> Text
-> FunPtr C_ApplicationWindowAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"window-added" FunPtr C_ApplicationWindowAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [windowAdded](#signal:windowAdded) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' application #windowAdded callback
-- @
-- 
-- 
afterApplicationWindowAdded :: (IsApplication a, MonadIO m) => a -> ApplicationWindowAddedCallback -> m SignalHandlerId
afterApplicationWindowAdded :: forall a (m :: * -> *).
(IsApplication a, MonadIO m) =>
a -> ApplicationWindowAddedCallback -> m SignalHandlerId
afterApplicationWindowAdded a
obj ApplicationWindowAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationWindowAddedCallback
cb' = ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowAddedCallback ApplicationWindowAddedCallback
cb
    FunPtr C_ApplicationWindowAddedCallback
cb'' <- C_ApplicationWindowAddedCallback
-> IO (FunPtr C_ApplicationWindowAddedCallback)
mk_ApplicationWindowAddedCallback C_ApplicationWindowAddedCallback
cb'
    a
-> Text
-> FunPtr C_ApplicationWindowAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"window-added" FunPtr C_ApplicationWindowAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data ApplicationWindowAddedSignalInfo
instance SignalInfo ApplicationWindowAddedSignalInfo where
    type HaskellCallbackType ApplicationWindowAddedSignalInfo = ApplicationWindowAddedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ApplicationWindowAddedCallback cb
        cb'' <- mk_ApplicationWindowAddedCallback cb'
        connectSignalFunPtr obj "window-added" cb'' connectMode detail

#endif

-- signal Application::window-removed
-- | Emitted when a t'GI.Gtk.Objects.Window.Window' is removed from /@application@/,
-- either as a side-effect of being destroyed or explicitly
-- through 'GI.Gtk.Objects.Application.applicationRemoveWindow'.
-- 
-- /Since: 3.2/
type ApplicationWindowRemovedCallback =
    Gtk.Window.Window
    -- ^ /@window@/: the t'GI.Gtk.Objects.Window.Window' that is being removed
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ApplicationWindowRemovedCallback`@.
noApplicationWindowRemovedCallback :: Maybe ApplicationWindowRemovedCallback
noApplicationWindowRemovedCallback :: Maybe ApplicationWindowAddedCallback
noApplicationWindowRemovedCallback = Maybe ApplicationWindowAddedCallback
forall a. Maybe a
Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_ApplicationWindowRemovedCallback =
    Ptr () ->                               -- object
    Ptr Gtk.Window.Window ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_ApplicationWindowRemovedCallback`.
foreign import ccall "wrapper"
    mk_ApplicationWindowRemovedCallback :: C_ApplicationWindowRemovedCallback -> IO (FunPtr C_ApplicationWindowRemovedCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_ApplicationWindowRemoved :: MonadIO m => ApplicationWindowRemovedCallback -> m (GClosure C_ApplicationWindowRemovedCallback)
genClosure_ApplicationWindowRemoved :: forall (m :: * -> *).
MonadIO m =>
ApplicationWindowAddedCallback
-> m (GClosure C_ApplicationWindowAddedCallback)
genClosure_ApplicationWindowRemoved ApplicationWindowAddedCallback
cb = IO (GClosure C_ApplicationWindowAddedCallback)
-> m (GClosure C_ApplicationWindowAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ApplicationWindowAddedCallback)
 -> m (GClosure C_ApplicationWindowAddedCallback))
-> IO (GClosure C_ApplicationWindowAddedCallback)
-> m (GClosure C_ApplicationWindowAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationWindowAddedCallback
cb' = ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowRemovedCallback ApplicationWindowAddedCallback
cb
    C_ApplicationWindowAddedCallback
-> IO (FunPtr C_ApplicationWindowAddedCallback)
mk_ApplicationWindowRemovedCallback C_ApplicationWindowAddedCallback
cb' IO (FunPtr C_ApplicationWindowAddedCallback)
-> (FunPtr C_ApplicationWindowAddedCallback
    -> IO (GClosure C_ApplicationWindowAddedCallback))
-> IO (GClosure C_ApplicationWindowAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ApplicationWindowAddedCallback
-> IO (GClosure C_ApplicationWindowAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ApplicationWindowRemovedCallback` into a `C_ApplicationWindowRemovedCallback`.
wrap_ApplicationWindowRemovedCallback ::
    ApplicationWindowRemovedCallback ->
    C_ApplicationWindowRemovedCallback
wrap_ApplicationWindowRemovedCallback :: ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowRemovedCallback ApplicationWindowAddedCallback
_cb Ptr ()
_ Ptr Window
window Ptr ()
_ = do
    Window
window' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gtk.Window.Window) Ptr Window
window
    ApplicationWindowAddedCallback
_cb  Window
window'


-- | Connect a signal handler for the [windowRemoved](#signal:windowRemoved) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' application #windowRemoved callback
-- @
-- 
-- 
onApplicationWindowRemoved :: (IsApplication a, MonadIO m) => a -> ApplicationWindowRemovedCallback -> m SignalHandlerId
onApplicationWindowRemoved :: forall a (m :: * -> *).
(IsApplication a, MonadIO m) =>
a -> ApplicationWindowAddedCallback -> m SignalHandlerId
onApplicationWindowRemoved a
obj ApplicationWindowAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationWindowAddedCallback
cb' = ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowRemovedCallback ApplicationWindowAddedCallback
cb
    FunPtr C_ApplicationWindowAddedCallback
cb'' <- C_ApplicationWindowAddedCallback
-> IO (FunPtr C_ApplicationWindowAddedCallback)
mk_ApplicationWindowRemovedCallback C_ApplicationWindowAddedCallback
cb'
    a
-> Text
-> FunPtr C_ApplicationWindowAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"window-removed" FunPtr C_ApplicationWindowAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [windowRemoved](#signal:windowRemoved) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' application #windowRemoved callback
-- @
-- 
-- 
afterApplicationWindowRemoved :: (IsApplication a, MonadIO m) => a -> ApplicationWindowRemovedCallback -> m SignalHandlerId
afterApplicationWindowRemoved :: forall a (m :: * -> *).
(IsApplication a, MonadIO m) =>
a -> ApplicationWindowAddedCallback -> m SignalHandlerId
afterApplicationWindowRemoved a
obj ApplicationWindowAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ApplicationWindowAddedCallback
cb' = ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowRemovedCallback ApplicationWindowAddedCallback
cb
    FunPtr C_ApplicationWindowAddedCallback
cb'' <- C_ApplicationWindowAddedCallback
-> IO (FunPtr C_ApplicationWindowAddedCallback)
mk_ApplicationWindowRemovedCallback C_ApplicationWindowAddedCallback
cb'
    a
-> Text
-> FunPtr C_ApplicationWindowAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"window-removed" FunPtr C_ApplicationWindowAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data ApplicationWindowRemovedSignalInfo
instance SignalInfo ApplicationWindowRemovedSignalInfo where
    type HaskellCallbackType ApplicationWindowRemovedSignalInfo = ApplicationWindowRemovedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ApplicationWindowRemovedCallback cb
        cb'' <- mk_ApplicationWindowRemovedCallback cb'
        connectSignalFunPtr obj "window-removed" cb'' connectMode detail

#endif

-- VVV Prop "active-window"
   -- Type: TInterface (Name {namespace = "Gtk", name = "Window"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Just True,Nothing)

-- | Get the value of the “@active-window@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' application #activeWindow
-- @
getApplicationActiveWindow :: (MonadIO m, IsApplication o) => o -> m (Maybe Gtk.Window.Window)
getApplicationActiveWindow :: forall (m :: * -> *) o.
(MonadIO m, IsApplication o) =>
o -> m (Maybe Window)
getApplicationActiveWindow o
obj = IO (Maybe Window) -> m (Maybe Window)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Window) -> m (Maybe Window))
-> IO (Maybe Window) -> m (Maybe Window)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Window -> Window) -> IO (Maybe Window)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"active-window" ManagedPtr Window -> Window
Gtk.Window.Window

#if defined(ENABLE_OVERLOADING)
data ApplicationActiveWindowPropertyInfo
instance AttrInfo ApplicationActiveWindowPropertyInfo where
    type AttrAllowedOps ApplicationActiveWindowPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint ApplicationActiveWindowPropertyInfo = IsApplication
    type AttrSetTypeConstraint ApplicationActiveWindowPropertyInfo = (~) ()
    type AttrTransferTypeConstraint ApplicationActiveWindowPropertyInfo = (~) ()
    type AttrTransferType ApplicationActiveWindowPropertyInfo = ()
    type AttrGetType ApplicationActiveWindowPropertyInfo = (Maybe Gtk.Window.Window)
    type AttrLabel ApplicationActiveWindowPropertyInfo = "active-window"
    type AttrOrigin ApplicationActiveWindowPropertyInfo = Application
    attrGet = getApplicationActiveWindow
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
#endif

-- VVV Prop "app-menu"
   -- Type: TInterface (Name {namespace = "Gio", name = "MenuModel"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just True)

-- | Get the value of the “@app-menu@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' application #appMenu
-- @
getApplicationAppMenu :: (MonadIO m, IsApplication o) => o -> m (Maybe Gio.MenuModel.MenuModel)
getApplicationAppMenu :: forall (m :: * -> *) o.
(MonadIO m, IsApplication o) =>
o -> m (Maybe MenuModel)
getApplicationAppMenu o
obj = IO (Maybe MenuModel) -> m (Maybe MenuModel)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe MenuModel) -> m (Maybe MenuModel))
-> IO (Maybe MenuModel) -> m (Maybe MenuModel)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr MenuModel -> MenuModel)
-> IO (Maybe MenuModel)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"app-menu" ManagedPtr MenuModel -> MenuModel
Gio.MenuModel.MenuModel

-- | Set the value of the “@app-menu@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' application [ #appMenu 'Data.GI.Base.Attributes.:=' value ]
-- @
setApplicationAppMenu :: (MonadIO m, IsApplication o, Gio.MenuModel.IsMenuModel a) => o -> a -> m ()
setApplicationAppMenu :: forall (m :: * -> *) o a.
(MonadIO m, IsApplication o, IsMenuModel a) =>
o -> a -> m ()
setApplicationAppMenu o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"app-menu" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@app-menu@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructApplicationAppMenu :: (IsApplication o, MIO.MonadIO m, Gio.MenuModel.IsMenuModel a) => a -> m (GValueConstruct o)
constructApplicationAppMenu :: forall o (m :: * -> *) a.
(IsApplication o, MonadIO m, IsMenuModel a) =>
a -> m (GValueConstruct o)
constructApplicationAppMenu a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"app-menu" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

-- | Set the value of the “@app-menu@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #appMenu
-- @
clearApplicationAppMenu :: (MonadIO m, IsApplication o) => o -> m ()
clearApplicationAppMenu :: forall (m :: * -> *) o. (MonadIO m, IsApplication o) => o -> m ()
clearApplicationAppMenu o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe MenuModel -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"app-menu" (Maybe MenuModel
forall a. Maybe a
Nothing :: Maybe Gio.MenuModel.MenuModel)

#if defined(ENABLE_OVERLOADING)
data ApplicationAppMenuPropertyInfo
instance AttrInfo ApplicationAppMenuPropertyInfo where
    type AttrAllowedOps ApplicationAppMenuPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint ApplicationAppMenuPropertyInfo = IsApplication
    type AttrSetTypeConstraint ApplicationAppMenuPropertyInfo = Gio.MenuModel.IsMenuModel
    type AttrTransferTypeConstraint ApplicationAppMenuPropertyInfo = Gio.MenuModel.IsMenuModel
    type AttrTransferType ApplicationAppMenuPropertyInfo = Gio.MenuModel.MenuModel
    type AttrGetType ApplicationAppMenuPropertyInfo = (Maybe Gio.MenuModel.MenuModel)
    type AttrLabel ApplicationAppMenuPropertyInfo = "app-menu"
    type AttrOrigin ApplicationAppMenuPropertyInfo = Application
    attrGet = getApplicationAppMenu
    attrSet = setApplicationAppMenu
    attrTransfer _ v = do
        unsafeCastTo Gio.MenuModel.MenuModel v
    attrConstruct = constructApplicationAppMenu
    attrClear = clearApplicationAppMenu
#endif

-- VVV Prop "menubar"
   -- Type: TInterface (Name {namespace = "Gio", name = "MenuModel"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just True)

-- | Get the value of the “@menubar@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' application #menubar
-- @
getApplicationMenubar :: (MonadIO m, IsApplication o) => o -> m Gio.MenuModel.MenuModel
getApplicationMenubar :: forall (m :: * -> *) o.
(MonadIO m, IsApplication o) =>
o -> m MenuModel
getApplicationMenubar o
obj = IO MenuModel -> m MenuModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO MenuModel -> m MenuModel) -> IO MenuModel -> m MenuModel
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe MenuModel) -> IO MenuModel
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getApplicationMenubar" (IO (Maybe MenuModel) -> IO MenuModel)
-> IO (Maybe MenuModel) -> IO MenuModel
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr MenuModel -> MenuModel)
-> IO (Maybe MenuModel)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"menubar" ManagedPtr MenuModel -> MenuModel
Gio.MenuModel.MenuModel

-- | Set the value of the “@menubar@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' application [ #menubar 'Data.GI.Base.Attributes.:=' value ]
-- @
setApplicationMenubar :: (MonadIO m, IsApplication o, Gio.MenuModel.IsMenuModel a) => o -> a -> m ()
setApplicationMenubar :: forall (m :: * -> *) o a.
(MonadIO m, IsApplication o, IsMenuModel a) =>
o -> a -> m ()
setApplicationMenubar o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"menubar" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@menubar@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructApplicationMenubar :: (IsApplication o, MIO.MonadIO m, Gio.MenuModel.IsMenuModel a) => a -> m (GValueConstruct o)
constructApplicationMenubar :: forall o (m :: * -> *) a.
(IsApplication o, MonadIO m, IsMenuModel a) =>
a -> m (GValueConstruct o)
constructApplicationMenubar a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"menubar" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

-- | Set the value of the “@menubar@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #menubar
-- @
clearApplicationMenubar :: (MonadIO m, IsApplication o) => o -> m ()
clearApplicationMenubar :: forall (m :: * -> *) o. (MonadIO m, IsApplication o) => o -> m ()
clearApplicationMenubar o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe MenuModel -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"menubar" (Maybe MenuModel
forall a. Maybe a
Nothing :: Maybe Gio.MenuModel.MenuModel)

#if defined(ENABLE_OVERLOADING)
data ApplicationMenubarPropertyInfo
instance AttrInfo ApplicationMenubarPropertyInfo where
    type AttrAllowedOps ApplicationMenubarPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint ApplicationMenubarPropertyInfo = IsApplication
    type AttrSetTypeConstraint ApplicationMenubarPropertyInfo = Gio.MenuModel.IsMenuModel
    type AttrTransferTypeConstraint ApplicationMenubarPropertyInfo = Gio.MenuModel.IsMenuModel
    type AttrTransferType ApplicationMenubarPropertyInfo = Gio.MenuModel.MenuModel
    type AttrGetType ApplicationMenubarPropertyInfo = Gio.MenuModel.MenuModel
    type AttrLabel ApplicationMenubarPropertyInfo = "menubar"
    type AttrOrigin ApplicationMenubarPropertyInfo = Application
    attrGet = getApplicationMenubar
    attrSet = setApplicationMenubar
    attrTransfer _ v = do
        unsafeCastTo Gio.MenuModel.MenuModel v
    attrConstruct = constructApplicationMenubar
    attrClear = clearApplicationMenubar
#endif

-- VVV Prop "register-session"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@register-session@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' application #registerSession
-- @
getApplicationRegisterSession :: (MonadIO m, IsApplication o) => o -> m Bool
getApplicationRegisterSession :: forall (m :: * -> *) o. (MonadIO m, IsApplication o) => o -> m Bool
getApplicationRegisterSession o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"register-session"

-- | Set the value of the “@register-session@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' application [ #registerSession 'Data.GI.Base.Attributes.:=' value ]
-- @
setApplicationRegisterSession :: (MonadIO m, IsApplication o) => o -> Bool -> m ()
setApplicationRegisterSession :: forall (m :: * -> *) o.
(MonadIO m, IsApplication o) =>
o -> Bool -> m ()
setApplicationRegisterSession o
obj Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"register-session" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@register-session@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructApplicationRegisterSession :: (IsApplication o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructApplicationRegisterSession :: forall o (m :: * -> *).
(IsApplication o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructApplicationRegisterSession Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"register-session" Bool
val

#if defined(ENABLE_OVERLOADING)
data ApplicationRegisterSessionPropertyInfo
instance AttrInfo ApplicationRegisterSessionPropertyInfo where
    type AttrAllowedOps ApplicationRegisterSessionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint ApplicationRegisterSessionPropertyInfo = IsApplication
    type AttrSetTypeConstraint ApplicationRegisterSessionPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint ApplicationRegisterSessionPropertyInfo = (~) Bool
    type AttrTransferType ApplicationRegisterSessionPropertyInfo = Bool
    type AttrGetType ApplicationRegisterSessionPropertyInfo = Bool
    type AttrLabel ApplicationRegisterSessionPropertyInfo = "register-session"
    type AttrOrigin ApplicationRegisterSessionPropertyInfo = Application
    attrGet = getApplicationRegisterSession
    attrSet = setApplicationRegisterSession
    attrTransfer _ v = do
        return v
    attrConstruct = constructApplicationRegisterSession
    attrClear = undefined
#endif

-- VVV Prop "screensaver-active"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@screensaver-active@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' application #screensaverActive
-- @
getApplicationScreensaverActive :: (MonadIO m, IsApplication o) => o -> m Bool
getApplicationScreensaverActive :: forall (m :: * -> *) o. (MonadIO m, IsApplication o) => o -> m Bool
getApplicationScreensaverActive o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"screensaver-active"

#if defined(ENABLE_OVERLOADING)
data ApplicationScreensaverActivePropertyInfo
instance AttrInfo ApplicationScreensaverActivePropertyInfo where
    type AttrAllowedOps ApplicationScreensaverActivePropertyInfo = '[ 'AttrGet]
    type AttrBaseTypeConstraint ApplicationScreensaverActivePropertyInfo = IsApplication
    type AttrSetTypeConstraint ApplicationScreensaverActivePropertyInfo = (~) ()
    type AttrTransferTypeConstraint ApplicationScreensaverActivePropertyInfo = (~) ()
    type AttrTransferType ApplicationScreensaverActivePropertyInfo = ()
    type AttrGetType ApplicationScreensaverActivePropertyInfo = Bool
    type AttrLabel ApplicationScreensaverActivePropertyInfo = "screensaver-active"
    type AttrOrigin ApplicationScreensaverActivePropertyInfo = Application
    attrGet = getApplicationScreensaverActive
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Application
type instance O.AttributeList Application = ApplicationAttributeList
type ApplicationAttributeList = ('[ '("actionGroup", Gio.Application.ApplicationActionGroupPropertyInfo), '("activeWindow", ApplicationActiveWindowPropertyInfo), '("appMenu", ApplicationAppMenuPropertyInfo), '("applicationId", Gio.Application.ApplicationApplicationIdPropertyInfo), '("flags", Gio.Application.ApplicationFlagsPropertyInfo), '("inactivityTimeout", Gio.Application.ApplicationInactivityTimeoutPropertyInfo), '("isBusy", Gio.Application.ApplicationIsBusyPropertyInfo), '("isRegistered", Gio.Application.ApplicationIsRegisteredPropertyInfo), '("isRemote", Gio.Application.ApplicationIsRemotePropertyInfo), '("menubar", ApplicationMenubarPropertyInfo), '("registerSession", ApplicationRegisterSessionPropertyInfo), '("resourceBasePath", Gio.Application.ApplicationResourceBasePathPropertyInfo), '("screensaverActive", ApplicationScreensaverActivePropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
applicationActiveWindow :: AttrLabelProxy "activeWindow"
applicationActiveWindow = AttrLabelProxy

applicationAppMenu :: AttrLabelProxy "appMenu"
applicationAppMenu = AttrLabelProxy

applicationMenubar :: AttrLabelProxy "menubar"
applicationMenubar = AttrLabelProxy

applicationRegisterSession :: AttrLabelProxy "registerSession"
applicationRegisterSession = AttrLabelProxy

applicationScreensaverActive :: AttrLabelProxy "screensaverActive"
applicationScreensaverActive = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Application = ApplicationSignalList
type ApplicationSignalList = ('[ '("actionAdded", Gio.ActionGroup.ActionGroupActionAddedSignalInfo), '("actionEnabledChanged", Gio.ActionGroup.ActionGroupActionEnabledChangedSignalInfo), '("actionRemoved", Gio.ActionGroup.ActionGroupActionRemovedSignalInfo), '("actionStateChanged", Gio.ActionGroup.ActionGroupActionStateChangedSignalInfo), '("activate", Gio.Application.ApplicationActivateSignalInfo), '("commandLine", Gio.Application.ApplicationCommandLineSignalInfo), '("handleLocalOptions", Gio.Application.ApplicationHandleLocalOptionsSignalInfo), '("nameLost", Gio.Application.ApplicationNameLostSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("open", Gio.Application.ApplicationOpenSignalInfo), '("queryEnd", ApplicationQueryEndSignalInfo), '("shutdown", Gio.Application.ApplicationShutdownSignalInfo), '("startup", Gio.Application.ApplicationStartupSignalInfo), '("windowAdded", ApplicationWindowAddedSignalInfo), '("windowRemoved", ApplicationWindowRemovedSignalInfo)] :: [(Symbol, *)])

#endif

-- method Application::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "application_id"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The application ID."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "ApplicationFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the application flags"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Application" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_new" gtk_application_new :: 
    CString ->                              -- application_id : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "ApplicationFlags"})
    IO (Ptr Application)

-- | Creates a new t'GI.Gtk.Objects.Application.Application' instance.
-- 
-- When using t'GI.Gtk.Objects.Application.Application', it is not necessary to call 'GI.Gtk.Functions.init'
-- manually. It is called as soon as the application gets registered as
-- the primary instance.
-- 
-- Concretely, 'GI.Gtk.Functions.init' is called in the default handler for the
-- [startup]("GI.Gio.Objects.Application#g:signal:startup") signal. Therefore, t'GI.Gtk.Objects.Application.Application' subclasses should
-- chain up in their [startup]("GI.Gio.Objects.Application#g:signal:startup") handler before using any GTK+ API.
-- 
-- Note that commandline arguments are not passed to 'GI.Gtk.Functions.init'.
-- All GTK+ functionality that is available via commandline arguments
-- can also be achieved by setting suitable environment variables
-- such as @G_DEBUG@, so this should not be a big
-- problem. If you absolutely must support GTK+ commandline arguments,
-- you can explicitly call 'GI.Gtk.Functions.init' before creating the application
-- instance.
-- 
-- If non-'P.Nothing', the application ID must be valid.  See
-- 'GI.Gio.Objects.Application.applicationIdIsValid'.
-- 
-- If no application ID is given then some features (most notably application
-- uniqueness) will be disabled. A null application ID is only allowed with
-- GTK+ 3.6 or later.
-- 
-- /Since: 3.0/
applicationNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Maybe (T.Text)
    -- ^ /@applicationId@/: The application ID.
    -> [Gio.Flags.ApplicationFlags]
    -- ^ /@flags@/: the application flags
    -> m (Maybe Application)
    -- ^ __Returns:__ a new t'GI.Gtk.Objects.Application.Application' instance
applicationNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe Text -> [ApplicationFlags] -> m (Maybe Application)
applicationNew Maybe Text
applicationId [ApplicationFlags]
flags = IO (Maybe Application) -> m (Maybe Application)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Application) -> m (Maybe Application))
-> IO (Maybe Application) -> m (Maybe Application)
forall a b. (a -> b) -> a -> b
$ do
    Ptr CChar
maybeApplicationId <- case Maybe Text
applicationId of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jApplicationId -> do
            Ptr CChar
jApplicationId' <- Text -> IO (Ptr CChar)
textToCString Text
jApplicationId
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jApplicationId'
    let flags' :: CUInt
flags' = [ApplicationFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ApplicationFlags]
flags
    Ptr Application
result <- Ptr CChar -> CUInt -> IO (Ptr Application)
gtk_application_new Ptr CChar
maybeApplicationId CUInt
flags'
    Maybe Application
maybeResult <- Ptr Application
-> (Ptr Application -> IO Application) -> IO (Maybe Application)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Application
result ((Ptr Application -> IO Application) -> IO (Maybe Application))
-> (Ptr Application -> IO Application) -> IO (Maybe Application)
forall a b. (a -> b) -> a -> b
$ \Ptr Application
result' -> do
        Application
result'' <- ((ManagedPtr Application -> Application)
-> Ptr Application -> IO Application
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Application -> Application
Application) Ptr Application
result'
        Application -> IO Application
forall (m :: * -> *) a. Monad m => a -> m a
return Application
result''
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeApplicationId
    Maybe Application -> IO (Maybe Application)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Application
maybeResult

#if defined(ENABLE_OVERLOADING)
#endif

-- method Application::add_accelerator
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator string" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "action_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the action to activate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parameter"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "parameter to pass when activating the action,\n  or %NULL if the action does not accept an activation parameter"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_add_accelerator" gtk_application_add_accelerator :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    CString ->                              -- accelerator : TBasicType TUTF8
    CString ->                              -- action_name : TBasicType TUTF8
    Ptr GVariant ->                         -- parameter : TVariant
    IO ()

{-# DEPRECATED applicationAddAccelerator ["(Since version 3.14)","Use 'GI.Gtk.Objects.Application.applicationSetAccelsForAction' instead"] #-}
-- | Installs an accelerator that will cause the named action
-- to be activated when the key combination specificed by /@accelerator@/
-- is pressed.
-- 
-- /@accelerator@/ must be a string that can be parsed by 'GI.Gtk.Functions.acceleratorParse',
-- e.g. \"\<Primary>q\" or “\<Control>\<Alt>p”.
-- 
-- /@actionName@/ must be the name of an action as it would be used
-- in the app menu, i.e. actions that have been added to the application
-- are referred to with an “app.” prefix, and window-specific actions
-- with a “win.” prefix.
-- 
-- GtkApplication also extracts accelerators out of “accel” attributes
-- in the @/GMenuModels/@ passed to 'GI.Gtk.Objects.Application.applicationSetAppMenu' and
-- 'GI.Gtk.Objects.Application.applicationSetMenubar', which is usually more convenient
-- than calling this function for each accelerator.
-- 
-- /Since: 3.4/
applicationAddAccelerator ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> T.Text
    -- ^ /@accelerator@/: accelerator string
    -> T.Text
    -- ^ /@actionName@/: the name of the action to activate
    -> Maybe (GVariant)
    -- ^ /@parameter@/: parameter to pass when activating the action,
    --   or 'P.Nothing' if the action does not accept an activation parameter
    -> m ()
applicationAddAccelerator :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> Text -> Text -> Maybe GVariant -> m ()
applicationAddAccelerator a
application Text
accelerator Text
actionName Maybe GVariant
parameter = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr CChar
accelerator' <- Text -> IO (Ptr CChar)
textToCString Text
accelerator
    Ptr CChar
actionName' <- Text -> IO (Ptr CChar)
textToCString Text
actionName
    Ptr GVariant
maybeParameter <- case Maybe GVariant
parameter of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
        Just GVariant
jParameter -> do
            Ptr GVariant
jParameter' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameter
            Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameter'
    Ptr Application -> Ptr CChar -> Ptr CChar -> Ptr GVariant -> IO ()
gtk_application_add_accelerator Ptr Application
application' Ptr CChar
accelerator' Ptr CChar
actionName' Ptr GVariant
maybeParameter
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameter GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
accelerator'
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
actionName'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ApplicationAddAcceleratorMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (GVariant) -> m ()), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationAddAcceleratorMethodInfo a signature where
    overloadedMethod = applicationAddAccelerator

instance O.OverloadedMethodInfo ApplicationAddAcceleratorMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationAddAccelerator",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationAddAccelerator"
        }


#endif

-- method Application::add_window
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkWindow" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_add_window" gtk_application_add_window :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO ()

-- | Adds a window to /@application@/.
-- 
-- This call can only happen after the /@application@/ has started;
-- typically, you should add new application windows in response
-- to the emission of the [activate]("GI.Gio.Objects.Application#g:signal:activate") signal.
-- 
-- This call is equivalent to setting the t'GI.Gtk.Objects.Window.Window':@/application/@
-- property of /@window@/ to /@application@/.
-- 
-- Normally, the connection between the application and the window
-- will remain until the window is destroyed, but you can explicitly
-- remove it with 'GI.Gtk.Objects.Application.applicationRemoveWindow'.
-- 
-- GTK+ will keep the /@application@/ running as long as it has
-- any windows.
-- 
-- /Since: 3.0/
applicationAddWindow ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gtk.Window.IsWindow b) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> b
    -- ^ /@window@/: a t'GI.Gtk.Objects.Window.Window'
    -> m ()
applicationAddWindow :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsApplication a, IsWindow b) =>
a -> b -> m ()
applicationAddWindow a
application b
window = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr Window
window' <- b -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
window
    Ptr Application -> Ptr Window -> IO ()
gtk_application_add_window Ptr Application
application' Ptr Window
window'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
window
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ApplicationAddWindowMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsApplication a, Gtk.Window.IsWindow b) => O.OverloadedMethod ApplicationAddWindowMethodInfo a signature where
    overloadedMethod = applicationAddWindow

instance O.OverloadedMethodInfo ApplicationAddWindowMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationAddWindow",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationAddWindow"
        }


#endif

-- method Application::get_accels_for_action
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "detailed_action_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a detailed action name, specifying an action\n    and target to obtain accelerators for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_get_accels_for_action" gtk_application_get_accels_for_action :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    CString ->                              -- detailed_action_name : TBasicType TUTF8
    IO (Ptr CString)

-- | Gets the accelerators that are currently associated with
-- the given action.
-- 
-- /Since: 3.12/
applicationGetAccelsForAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> T.Text
    -- ^ /@detailedActionName@/: a detailed action name, specifying an action
    --     and target to obtain accelerators for
    -> m [T.Text]
    -- ^ __Returns:__ accelerators for /@detailedActionName@/, as
    --     a 'P.Nothing'-terminated array. Free with 'GI.GLib.Functions.strfreev' when no longer needed
applicationGetAccelsForAction :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> Text -> m [Text]
applicationGetAccelsForAction a
application Text
detailedActionName = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr CChar
detailedActionName' <- Text -> IO (Ptr CChar)
textToCString Text
detailedActionName
    Ptr (Ptr CChar)
result <- Ptr Application -> Ptr CChar -> IO (Ptr (Ptr CChar))
gtk_application_get_accels_for_action Ptr Application
application' Ptr CChar
detailedActionName'
    Text -> Ptr (Ptr CChar) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"applicationGetAccelsForAction" Ptr (Ptr CChar)
result
    [Text]
result' <- HasCallStack => Ptr (Ptr CChar) -> IO [Text]
Ptr (Ptr CChar) -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr (Ptr CChar)
result
    (Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result
    Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
detailedActionName'
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'

#if defined(ENABLE_OVERLOADING)
data ApplicationGetAccelsForActionMethodInfo
instance (signature ~ (T.Text -> m [T.Text]), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationGetAccelsForActionMethodInfo a signature where
    overloadedMethod = applicationGetAccelsForAction

instance O.OverloadedMethodInfo ApplicationGetAccelsForActionMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationGetAccelsForAction",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationGetAccelsForAction"
        }


#endif

-- method Application::get_actions_for_accel
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accel"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "an accelerator that can be parsed by gtk_accelerator_parse()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_get_actions_for_accel" gtk_application_get_actions_for_accel :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    CString ->                              -- accel : TBasicType TUTF8
    IO (Ptr CString)

-- | Returns the list of actions (possibly empty) that /@accel@/ maps to.
-- Each item in the list is a detailed action name in the usual form.
-- 
-- This might be useful to discover if an accel already exists in
-- order to prevent installation of a conflicting accelerator (from
-- an accelerator editor or a plugin system, for example). Note that
-- having more than one action per accelerator may not be a bad thing
-- and might make sense in cases where the actions never appear in the
-- same context.
-- 
-- In case there are no actions for a given accelerator, an empty array
-- is returned.  'P.Nothing' is never returned.
-- 
-- It is a programmer error to pass an invalid accelerator string.
-- If you are unsure, check it with 'GI.Gtk.Functions.acceleratorParse' first.
-- 
-- /Since: 3.14/
applicationGetActionsForAccel ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> T.Text
    -- ^ /@accel@/: an accelerator that can be parsed by 'GI.Gtk.Functions.acceleratorParse'
    -> m [T.Text]
    -- ^ __Returns:__ a 'P.Nothing'-terminated array of actions for /@accel@/
applicationGetActionsForAccel :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> Text -> m [Text]
applicationGetActionsForAccel a
application Text
accel = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr CChar
accel' <- Text -> IO (Ptr CChar)
textToCString Text
accel
    Ptr (Ptr CChar)
result <- Ptr Application -> Ptr CChar -> IO (Ptr (Ptr CChar))
gtk_application_get_actions_for_accel Ptr Application
application' Ptr CChar
accel'
    Text -> Ptr (Ptr CChar) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"applicationGetActionsForAccel" Ptr (Ptr CChar)
result
    [Text]
result' <- HasCallStack => Ptr (Ptr CChar) -> IO [Text]
Ptr (Ptr CChar) -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr (Ptr CChar)
result
    (Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result
    Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
accel'
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'

#if defined(ENABLE_OVERLOADING)
data ApplicationGetActionsForAccelMethodInfo
instance (signature ~ (T.Text -> m [T.Text]), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationGetActionsForAccelMethodInfo a signature where
    overloadedMethod = applicationGetActionsForAccel

instance O.OverloadedMethodInfo ApplicationGetActionsForAccelMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationGetActionsForAccel",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationGetActionsForAccel"
        }


#endif

-- method Application::get_active_window
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Window" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_get_active_window" gtk_application_get_active_window :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    IO (Ptr Gtk.Window.Window)

-- | Gets the “active” window for the application.
-- 
-- The active window is the one that was most recently focused (within
-- the application).  This window may not have the focus at the moment
-- if another application has it — this is just the most
-- recently-focused window within this application.
-- 
-- /Since: 3.6/
applicationGetActiveWindow ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> m (Maybe Gtk.Window.Window)
    -- ^ __Returns:__ the active window, or 'P.Nothing' if
    --   there isn\'t one.
applicationGetActiveWindow :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> m (Maybe Window)
applicationGetActiveWindow a
application = IO (Maybe Window) -> m (Maybe Window)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Window) -> m (Maybe Window))
-> IO (Maybe Window) -> m (Maybe Window)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr Window
result <- Ptr Application -> IO (Ptr Window)
gtk_application_get_active_window Ptr Application
application'
    Maybe Window
maybeResult <- Ptr Window -> (Ptr Window -> IO Window) -> IO (Maybe Window)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Window
result ((Ptr Window -> IO Window) -> IO (Maybe Window))
-> (Ptr Window -> IO Window) -> IO (Maybe Window)
forall a b. (a -> b) -> a -> b
$ \Ptr Window
result' -> do
        Window
result'' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gtk.Window.Window) Ptr Window
result'
        Window -> IO Window
forall (m :: * -> *) a. Monad m => a -> m a
return Window
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Maybe Window -> IO (Maybe Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Window
maybeResult

#if defined(ENABLE_OVERLOADING)
data ApplicationGetActiveWindowMethodInfo
instance (signature ~ (m (Maybe Gtk.Window.Window)), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationGetActiveWindowMethodInfo a signature where
    overloadedMethod = applicationGetActiveWindow

instance O.OverloadedMethodInfo ApplicationGetActiveWindowMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationGetActiveWindow",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationGetActiveWindow"
        }


#endif

-- method Application::get_app_menu
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "MenuModel" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_get_app_menu" gtk_application_get_app_menu :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    IO (Ptr Gio.MenuModel.MenuModel)

-- | Returns the menu model that has been set with
-- 'GI.Gtk.Objects.Application.applicationSetAppMenu'.
-- 
-- /Since: 3.4/
applicationGetAppMenu ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> m (Maybe Gio.MenuModel.MenuModel)
    -- ^ __Returns:__ the application menu of /@application@/
    --   or 'P.Nothing' if no application menu has been set.
applicationGetAppMenu :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> m (Maybe MenuModel)
applicationGetAppMenu a
application = IO (Maybe MenuModel) -> m (Maybe MenuModel)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MenuModel) -> m (Maybe MenuModel))
-> IO (Maybe MenuModel) -> m (Maybe MenuModel)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr MenuModel
result <- Ptr Application -> IO (Ptr MenuModel)
gtk_application_get_app_menu Ptr Application
application'
    Maybe MenuModel
maybeResult <- Ptr MenuModel
-> (Ptr MenuModel -> IO MenuModel) -> IO (Maybe MenuModel)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr MenuModel
result ((Ptr MenuModel -> IO MenuModel) -> IO (Maybe MenuModel))
-> (Ptr MenuModel -> IO MenuModel) -> IO (Maybe MenuModel)
forall a b. (a -> b) -> a -> b
$ \Ptr MenuModel
result' -> do
        MenuModel
result'' <- ((ManagedPtr MenuModel -> MenuModel)
-> Ptr MenuModel -> IO MenuModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr MenuModel -> MenuModel
Gio.MenuModel.MenuModel) Ptr MenuModel
result'
        MenuModel -> IO MenuModel
forall (m :: * -> *) a. Monad m => a -> m a
return MenuModel
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Maybe MenuModel -> IO (Maybe MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MenuModel
maybeResult

#if defined(ENABLE_OVERLOADING)
data ApplicationGetAppMenuMethodInfo
instance (signature ~ (m (Maybe Gio.MenuModel.MenuModel)), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationGetAppMenuMethodInfo a signature where
    overloadedMethod = applicationGetAppMenu

instance O.OverloadedMethodInfo ApplicationGetAppMenuMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationGetAppMenu",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationGetAppMenu"
        }


#endif

-- method Application::get_menu_by_id
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the id of the menu to look up"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "Menu" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_get_menu_by_id" gtk_application_get_menu_by_id :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    CString ->                              -- id : TBasicType TUTF8
    IO (Ptr Gio.Menu.Menu)

-- | Gets a menu from automatically loaded resources.
-- See [Automatic resources][automatic-resources]
-- for more information.
-- 
-- /Since: 3.14/
applicationGetMenuById ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> T.Text
    -- ^ /@id@/: the id of the menu to look up
    -> m Gio.Menu.Menu
    -- ^ __Returns:__ Gets the menu with the
    --     given id from the automatically loaded resources
applicationGetMenuById :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> Text -> m Menu
applicationGetMenuById a
application Text
id = IO Menu -> m Menu
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Menu -> m Menu) -> IO Menu -> m Menu
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr CChar
id' <- Text -> IO (Ptr CChar)
textToCString Text
id
    Ptr Menu
result <- Ptr Application -> Ptr CChar -> IO (Ptr Menu)
gtk_application_get_menu_by_id Ptr Application
application' Ptr CChar
id'
    Text -> Ptr Menu -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"applicationGetMenuById" Ptr Menu
result
    Menu
result' <- ((ManagedPtr Menu -> Menu) -> Ptr Menu -> IO Menu
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Menu -> Menu
Gio.Menu.Menu) Ptr Menu
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
id'
    Menu -> IO Menu
forall (m :: * -> *) a. Monad m => a -> m a
return Menu
result'

#if defined(ENABLE_OVERLOADING)
data ApplicationGetMenuByIdMethodInfo
instance (signature ~ (T.Text -> m Gio.Menu.Menu), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationGetMenuByIdMethodInfo a signature where
    overloadedMethod = applicationGetMenuById

instance O.OverloadedMethodInfo ApplicationGetMenuByIdMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationGetMenuById",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationGetMenuById"
        }


#endif

-- method Application::get_menubar
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "MenuModel" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_get_menubar" gtk_application_get_menubar :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    IO (Ptr Gio.MenuModel.MenuModel)

-- | Returns the menu model that has been set with
-- 'GI.Gtk.Objects.Application.applicationSetMenubar'.
-- 
-- /Since: 3.4/
applicationGetMenubar ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> m Gio.MenuModel.MenuModel
    -- ^ __Returns:__ the menubar for windows of /@application@/
applicationGetMenubar :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> m MenuModel
applicationGetMenubar a
application = IO MenuModel -> m MenuModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuModel -> m MenuModel) -> IO MenuModel -> m MenuModel
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr MenuModel
result <- Ptr Application -> IO (Ptr MenuModel)
gtk_application_get_menubar Ptr Application
application'
    Text -> Ptr MenuModel -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"applicationGetMenubar" Ptr MenuModel
result
    MenuModel
result' <- ((ManagedPtr MenuModel -> MenuModel)
-> Ptr MenuModel -> IO MenuModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr MenuModel -> MenuModel
Gio.MenuModel.MenuModel) Ptr MenuModel
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    MenuModel -> IO MenuModel
forall (m :: * -> *) a. Monad m => a -> m a
return MenuModel
result'

#if defined(ENABLE_OVERLOADING)
data ApplicationGetMenubarMethodInfo
instance (signature ~ (m Gio.MenuModel.MenuModel), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationGetMenubarMethodInfo a signature where
    overloadedMethod = applicationGetMenubar

instance O.OverloadedMethodInfo ApplicationGetMenubarMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationGetMenubar",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationGetMenubar"
        }


#endif

-- method Application::get_window_by_id
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an identifier number"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Window" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_get_window_by_id" gtk_application_get_window_by_id :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    Word32 ->                               -- id : TBasicType TUInt
    IO (Ptr Gtk.Window.Window)

-- | Returns the t'GI.Gtk.Objects.ApplicationWindow.ApplicationWindow' with the given ID.
-- 
-- The ID of a t'GI.Gtk.Objects.ApplicationWindow.ApplicationWindow' can be retrieved with
-- 'GI.Gtk.Objects.ApplicationWindow.applicationWindowGetId'.
-- 
-- /Since: 3.6/
applicationGetWindowById ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> Word32
    -- ^ /@id@/: an identifier number
    -> m (Maybe Gtk.Window.Window)
    -- ^ __Returns:__ the window with ID /@id@/, or
    --   'P.Nothing' if there is no window with this ID
applicationGetWindowById :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> Word32 -> m (Maybe Window)
applicationGetWindowById a
application Word32
id = IO (Maybe Window) -> m (Maybe Window)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Window) -> m (Maybe Window))
-> IO (Maybe Window) -> m (Maybe Window)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr Window
result <- Ptr Application -> Word32 -> IO (Ptr Window)
gtk_application_get_window_by_id Ptr Application
application' Word32
id
    Maybe Window
maybeResult <- Ptr Window -> (Ptr Window -> IO Window) -> IO (Maybe Window)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Window
result ((Ptr Window -> IO Window) -> IO (Maybe Window))
-> (Ptr Window -> IO Window) -> IO (Maybe Window)
forall a b. (a -> b) -> a -> b
$ \Ptr Window
result' -> do
        Window
result'' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gtk.Window.Window) Ptr Window
result'
        Window -> IO Window
forall (m :: * -> *) a. Monad m => a -> m a
return Window
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Maybe Window -> IO (Maybe Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Window
maybeResult

#if defined(ENABLE_OVERLOADING)
data ApplicationGetWindowByIdMethodInfo
instance (signature ~ (Word32 -> m (Maybe Gtk.Window.Window)), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationGetWindowByIdMethodInfo a signature where
    overloadedMethod = applicationGetWindowById

instance O.OverloadedMethodInfo ApplicationGetWindowByIdMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationGetWindowById",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationGetWindowById"
        }


#endif

-- method Application::get_windows
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList (TInterface Name { namespace = "Gtk" , name = "Window" }))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_get_windows" gtk_application_get_windows :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    IO (Ptr (GList (Ptr Gtk.Window.Window)))

-- | Gets a list of the @/GtkWindows/@ associated with /@application@/.
-- 
-- The list is sorted by most recently focused window, such that the first
-- element is the currently focused window. (Useful for choosing a parent
-- for a transient window.)
-- 
-- The list that is returned should not be modified in any way. It will
-- only remain valid until the next focus change or window creation or
-- deletion.
-- 
-- /Since: 3.0/
applicationGetWindows ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> m [Gtk.Window.Window]
    -- ^ __Returns:__ a t'GI.GLib.Structs.List.List' of t'GI.Gtk.Objects.Window.Window'
applicationGetWindows :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> m [Window]
applicationGetWindows a
application = IO [Window] -> m [Window]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Window] -> m [Window]) -> IO [Window] -> m [Window]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr (GList (Ptr Window))
result <- Ptr Application -> IO (Ptr (GList (Ptr Window)))
gtk_application_get_windows Ptr Application
application'
    [Ptr Window]
result' <- Ptr (GList (Ptr Window)) -> IO [Ptr Window]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Window))
result
    [Window]
result'' <- (Ptr Window -> IO Window) -> [Ptr Window] -> IO [Window]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gtk.Window.Window) [Ptr Window]
result'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    [Window] -> IO [Window]
forall (m :: * -> *) a. Monad m => a -> m a
return [Window]
result''

#if defined(ENABLE_OVERLOADING)
data ApplicationGetWindowsMethodInfo
instance (signature ~ (m [Gtk.Window.Window]), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationGetWindowsMethodInfo a signature where
    overloadedMethod = applicationGetWindows

instance O.OverloadedMethodInfo ApplicationGetWindowsMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationGetWindows",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationGetWindows"
        }


#endif

-- method Application::inhibit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GtkApplication"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkWindow, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "Gtk" , name = "ApplicationInhibitFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "what types of actions should be inhibited"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "reason"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a short, human-readable string that explains\n    why these operations are inhibited"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_inhibit" gtk_application_inhibit :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gtk", name = "ApplicationInhibitFlags"})
    CString ->                              -- reason : TBasicType TUTF8
    IO Word32

-- | Inform the session manager that certain types of actions should be
-- inhibited. This is not guaranteed to work on all platforms and for
-- all types of actions.
-- 
-- Applications should invoke this method when they begin an operation
-- that should not be interrupted, such as creating a CD or DVD. The
-- types of actions that may be blocked are specified by the /@flags@/
-- parameter. When the application completes the operation it should
-- call 'GI.Gtk.Objects.Application.applicationUninhibit' to remove the inhibitor. Note that
-- an application can have multiple inhibitors, and all of them must
-- be individually removed. Inhibitors are also cleared when the
-- application exits.
-- 
-- Applications should not expect that they will always be able to block
-- the action. In most cases, users will be given the option to force
-- the action to take place.
-- 
-- Reasons should be short and to the point.
-- 
-- If /@window@/ is given, the session manager may point the user to
-- this window to find out more about why the action is inhibited.
-- 
-- /Since: 3.4/
applicationInhibit ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gtk.Window.IsWindow b) =>
    a
    -- ^ /@application@/: the t'GI.Gtk.Objects.Application.Application'
    -> Maybe (b)
    -- ^ /@window@/: a t'GI.Gtk.Objects.Window.Window', or 'P.Nothing'
    -> [Gtk.Flags.ApplicationInhibitFlags]
    -- ^ /@flags@/: what types of actions should be inhibited
    -> Maybe (T.Text)
    -- ^ /@reason@/: a short, human-readable string that explains
    --     why these operations are inhibited
    -> m Word32
    -- ^ __Returns:__ A non-zero cookie that is used to uniquely identify this
    --     request. It should be used as an argument to 'GI.Gtk.Objects.Application.applicationUninhibit'
    --     in order to remove the request. If the platform does not support
    --     inhibiting or the request failed for some reason, 0 is returned.
applicationInhibit :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsApplication a, IsWindow b) =>
a -> Maybe b -> [ApplicationInhibitFlags] -> Maybe Text -> m Word32
applicationInhibit a
application Maybe b
window [ApplicationInhibitFlags]
flags Maybe Text
reason = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr Window
maybeWindow <- case Maybe b
window of
        Maybe b
Nothing -> Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
forall a. Ptr a
nullPtr
        Just b
jWindow -> do
            Ptr Window
jWindow' <- b -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jWindow
            Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
jWindow'
    let flags' :: CUInt
flags' = [ApplicationInhibitFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ApplicationInhibitFlags]
flags
    Ptr CChar
maybeReason <- case Maybe Text
reason of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jReason -> do
            Ptr CChar
jReason' <- Text -> IO (Ptr CChar)
textToCString Text
jReason
            Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jReason'
    Word32
result <- Ptr Application -> Ptr Window -> CUInt -> Ptr CChar -> IO Word32
gtk_application_inhibit Ptr Application
application' Ptr Window
maybeWindow CUInt
flags' Ptr CChar
maybeReason
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
window b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeReason
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data ApplicationInhibitMethodInfo
instance (signature ~ (Maybe (b) -> [Gtk.Flags.ApplicationInhibitFlags] -> Maybe (T.Text) -> m Word32), MonadIO m, IsApplication a, Gtk.Window.IsWindow b) => O.OverloadedMethod ApplicationInhibitMethodInfo a signature where
    overloadedMethod = applicationInhibit

instance O.OverloadedMethodInfo ApplicationInhibitMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationInhibit",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationInhibit"
        }


#endif

-- method Application::is_inhibited
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GtkApplication"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "Gtk" , name = "ApplicationInhibitFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "what types of actions should be queried"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_is_inhibited" gtk_application_is_inhibited :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gtk", name = "ApplicationInhibitFlags"})
    IO CInt

-- | Determines if any of the actions specified in /@flags@/ are
-- currently inhibited (possibly by another application).
-- 
-- Note that this information may not be available (for example
-- when the application is running in a sandbox).
-- 
-- /Since: 3.4/
applicationIsInhibited ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: the t'GI.Gtk.Objects.Application.Application'
    -> [Gtk.Flags.ApplicationInhibitFlags]
    -- ^ /@flags@/: what types of actions should be queried
    -> m Bool
    -- ^ __Returns:__ 'P.True' if any of the actions specified in /@flags@/ are inhibited
applicationIsInhibited :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> [ApplicationInhibitFlags] -> m Bool
applicationIsInhibited a
application [ApplicationInhibitFlags]
flags = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    let flags' :: CUInt
flags' = [ApplicationInhibitFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ApplicationInhibitFlags]
flags
    CInt
result <- Ptr Application -> CUInt -> IO CInt
gtk_application_is_inhibited Ptr Application
application' CUInt
flags'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ApplicationIsInhibitedMethodInfo
instance (signature ~ ([Gtk.Flags.ApplicationInhibitFlags] -> m Bool), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationIsInhibitedMethodInfo a signature where
    overloadedMethod = applicationIsInhibited

instance O.OverloadedMethodInfo ApplicationIsInhibitedMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationIsInhibited",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationIsInhibited"
        }


#endif

-- method Application::list_action_descriptions
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_list_action_descriptions" gtk_application_list_action_descriptions :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    IO (Ptr CString)

-- | Lists the detailed action names which have associated accelerators.
-- See 'GI.Gtk.Objects.Application.applicationSetAccelsForAction'.
-- 
-- /Since: 3.12/
applicationListActionDescriptions ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> m [T.Text]
    -- ^ __Returns:__ a 'P.Nothing'-terminated array of strings,
    --     free with 'GI.GLib.Functions.strfreev' when done
applicationListActionDescriptions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> m [Text]
applicationListActionDescriptions a
application = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr (Ptr CChar)
result <- Ptr Application -> IO (Ptr (Ptr CChar))
gtk_application_list_action_descriptions Ptr Application
application'
    Text -> Ptr (Ptr CChar) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"applicationListActionDescriptions" Ptr (Ptr CChar)
result
    [Text]
result' <- HasCallStack => Ptr (Ptr CChar) -> IO [Text]
Ptr (Ptr CChar) -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr (Ptr CChar)
result
    (Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result
    Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'

#if defined(ENABLE_OVERLOADING)
data ApplicationListActionDescriptionsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationListActionDescriptionsMethodInfo a signature where
    overloadedMethod = applicationListActionDescriptions

instance O.OverloadedMethodInfo ApplicationListActionDescriptionsMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationListActionDescriptions",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationListActionDescriptions"
        }


#endif

-- method Application::prefers_app_menu
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_prefers_app_menu" gtk_application_prefers_app_menu :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    IO CInt

-- | Determines if the desktop environment in which the application is
-- running would prefer an application menu be shown.
-- 
-- If this function returns 'P.True' then the application should call
-- 'GI.Gtk.Objects.Application.applicationSetAppMenu' with the contents of an application
-- menu, which will be shown by the desktop environment.  If it returns
-- 'P.False' then you should consider using an alternate approach, such as
-- a menubar.
-- 
-- The value returned by this function is purely advisory and you are
-- free to ignore it.  If you call 'GI.Gtk.Objects.Application.applicationSetAppMenu' even
-- if the desktop environment doesn\'t support app menus, then a fallback
-- will be provided.
-- 
-- Applications are similarly free not to set an app menu even if the
-- desktop environment wants to show one.  In that case, a fallback will
-- also be created by the desktop environment (GNOME, for example, uses
-- a menu with only a \"Quit\" item in it).
-- 
-- The value returned by this function never changes.  Once it returns a
-- particular value, it is guaranteed to always return the same value.
-- 
-- You may only call this function after the application has been
-- registered and after the base startup handler has run.  You\'re most
-- likely to want to use this from your own startup handler.  It may
-- also make sense to consult this function while constructing UI (in
-- activate, open or an action activation handler) in order to determine
-- if you should show a gear menu or not.
-- 
-- This function will return 'P.False' on Mac OS and a default app menu
-- will be created automatically with the \"usual\" contents of that menu
-- typical to most Mac OS applications.  If you call
-- 'GI.Gtk.Objects.Application.applicationSetAppMenu' anyway, then this menu will be
-- replaced with your own.
-- 
-- /Since: 3.14/
applicationPrefersAppMenu ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if you should set an app menu
applicationPrefersAppMenu :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> m Bool
applicationPrefersAppMenu a
application = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    CInt
result <- Ptr Application -> IO CInt
gtk_application_prefers_app_menu Ptr Application
application'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ApplicationPrefersAppMenuMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationPrefersAppMenuMethodInfo a signature where
    overloadedMethod = applicationPrefersAppMenu

instance O.OverloadedMethodInfo ApplicationPrefersAppMenuMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationPrefersAppMenu",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationPrefersAppMenu"
        }


#endif

-- method Application::remove_accelerator
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "action_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the action to activate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parameter"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "parameter to pass when activating the action,\n  or %NULL if the action does not accept an activation parameter"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_remove_accelerator" gtk_application_remove_accelerator :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    CString ->                              -- action_name : TBasicType TUTF8
    Ptr GVariant ->                         -- parameter : TVariant
    IO ()

{-# DEPRECATED applicationRemoveAccelerator ["(Since version 3.14)","Use 'GI.Gtk.Objects.Application.applicationSetAccelsForAction' instead"] #-}
-- | Removes an accelerator that has been previously added
-- with 'GI.Gtk.Objects.Application.applicationAddAccelerator'.
-- 
-- /Since: 3.4/
applicationRemoveAccelerator ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> T.Text
    -- ^ /@actionName@/: the name of the action to activate
    -> Maybe (GVariant)
    -- ^ /@parameter@/: parameter to pass when activating the action,
    --   or 'P.Nothing' if the action does not accept an activation parameter
    -> m ()
applicationRemoveAccelerator :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> Text -> Maybe GVariant -> m ()
applicationRemoveAccelerator a
application Text
actionName Maybe GVariant
parameter = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr CChar
actionName' <- Text -> IO (Ptr CChar)
textToCString Text
actionName
    Ptr GVariant
maybeParameter <- case Maybe GVariant
parameter of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
        Just GVariant
jParameter -> do
            Ptr GVariant
jParameter' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParameter
            Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jParameter'
    Ptr Application -> Ptr CChar -> Ptr GVariant -> IO ()
gtk_application_remove_accelerator Ptr Application
application' Ptr CChar
actionName' Ptr GVariant
maybeParameter
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
parameter GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
actionName'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ApplicationRemoveAcceleratorMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> m ()), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationRemoveAcceleratorMethodInfo a signature where
    overloadedMethod = applicationRemoveAccelerator

instance O.OverloadedMethodInfo ApplicationRemoveAcceleratorMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationRemoveAccelerator",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationRemoveAccelerator"
        }


#endif

-- method Application::remove_window
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "window"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkWindow" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_remove_window" gtk_application_remove_window :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    Ptr Gtk.Window.Window ->                -- window : TInterface (Name {namespace = "Gtk", name = "Window"})
    IO ()

-- | Remove a window from /@application@/.
-- 
-- If /@window@/ belongs to /@application@/ then this call is equivalent to
-- setting the t'GI.Gtk.Objects.Window.Window':@/application/@ property of /@window@/ to
-- 'P.Nothing'.
-- 
-- The application may stop running as a result of a call to this
-- function.
-- 
-- /Since: 3.0/
applicationRemoveWindow ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gtk.Window.IsWindow b) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> b
    -- ^ /@window@/: a t'GI.Gtk.Objects.Window.Window'
    -> m ()
applicationRemoveWindow :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsApplication a, IsWindow b) =>
a -> b -> m ()
applicationRemoveWindow a
application b
window = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr Window
window' <- b -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
window
    Ptr Application -> Ptr Window -> IO ()
gtk_application_remove_window Ptr Application
application' Ptr Window
window'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
window
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ApplicationRemoveWindowMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsApplication a, Gtk.Window.IsWindow b) => O.OverloadedMethod ApplicationRemoveWindowMethodInfo a signature where
    overloadedMethod = applicationRemoveWindow

instance O.OverloadedMethodInfo ApplicationRemoveWindowMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationRemoveWindow",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationRemoveWindow"
        }


#endif

-- method Application::set_accels_for_action
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "detailed_action_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a detailed action name, specifying an action\n    and target to associate accelerators with"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accels"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a list of accelerators in the format\n    understood by gtk_accelerator_parse()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_set_accels_for_action" gtk_application_set_accels_for_action :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    CString ->                              -- detailed_action_name : TBasicType TUTF8
    Ptr CString ->                          -- accels : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO ()

-- | Sets zero or more keyboard accelerators that will trigger the
-- given action. The first item in /@accels@/ will be the primary
-- accelerator, which may be displayed in the UI.
-- 
-- To remove all accelerators for an action, use an empty, zero-terminated
-- array for /@accels@/.
-- 
-- For the /@detailedActionName@/, see 'GI.Gio.Functions.actionParseDetailedName' and
-- 'GI.Gio.Functions.actionPrintDetailedName'.
-- 
-- /Since: 3.12/
applicationSetAccelsForAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> T.Text
    -- ^ /@detailedActionName@/: a detailed action name, specifying an action
    --     and target to associate accelerators with
    -> [T.Text]
    -- ^ /@accels@/: a list of accelerators in the format
    --     understood by 'GI.Gtk.Functions.acceleratorParse'
    -> m ()
applicationSetAccelsForAction :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> Text -> [Text] -> m ()
applicationSetAccelsForAction a
application Text
detailedActionName [Text]
accels = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr CChar
detailedActionName' <- Text -> IO (Ptr CChar)
textToCString Text
detailedActionName
    Ptr (Ptr CChar)
accels' <- [Text] -> IO (Ptr (Ptr CChar))
packZeroTerminatedUTF8CArray [Text]
accels
    Ptr Application -> Ptr CChar -> Ptr (Ptr CChar) -> IO ()
gtk_application_set_accels_for_action Ptr Application
application' Ptr CChar
detailedActionName' Ptr (Ptr CChar)
accels'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
detailedActionName'
    (Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
accels'
    Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
accels'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ApplicationSetAccelsForActionMethodInfo
instance (signature ~ (T.Text -> [T.Text] -> m ()), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationSetAccelsForActionMethodInfo a signature where
    overloadedMethod = applicationSetAccelsForAction

instance O.OverloadedMethodInfo ApplicationSetAccelsForActionMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationSetAccelsForAction",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationSetAccelsForAction"
        }


#endif

-- method Application::set_app_menu
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "app_menu"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "MenuModel" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GMenuModel, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_set_app_menu" gtk_application_set_app_menu :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    Ptr Gio.MenuModel.MenuModel ->          -- app_menu : TInterface (Name {namespace = "Gio", name = "MenuModel"})
    IO ()

-- | Sets or unsets the application menu for /@application@/.
-- 
-- This can only be done in the primary instance of the application,
-- after it has been registered.  [startup]("GI.Gio.Objects.Application#g:signal:startup") is a good place
-- to call this.
-- 
-- The application menu is a single menu containing items that typically
-- impact the application as a whole, rather than acting on a specific
-- window or document.  For example, you would expect to see
-- “Preferences” or “Quit” in an application menu, but not “Save” or
-- “Print”.
-- 
-- If supported, the application menu will be rendered by the desktop
-- environment.
-- 
-- Use the base t'GI.Gio.Interfaces.ActionMap.ActionMap' interface to add actions, to respond to the user
-- selecting these menu items.
-- 
-- /Since: 3.4/
applicationSetAppMenu ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gio.MenuModel.IsMenuModel b) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> Maybe (b)
    -- ^ /@appMenu@/: a t'GI.Gio.Objects.MenuModel.MenuModel', or 'P.Nothing'
    -> m ()
applicationSetAppMenu :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsApplication a, IsMenuModel b) =>
a -> Maybe b -> m ()
applicationSetAppMenu a
application Maybe b
appMenu = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr MenuModel
maybeAppMenu <- case Maybe b
appMenu of
        Maybe b
Nothing -> Ptr MenuModel -> IO (Ptr MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MenuModel
forall a. Ptr a
nullPtr
        Just b
jAppMenu -> do
            Ptr MenuModel
jAppMenu' <- b -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jAppMenu
            Ptr MenuModel -> IO (Ptr MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MenuModel
jAppMenu'
    Ptr Application -> Ptr MenuModel -> IO ()
gtk_application_set_app_menu Ptr Application
application' Ptr MenuModel
maybeAppMenu
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
appMenu b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ApplicationSetAppMenuMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsApplication a, Gio.MenuModel.IsMenuModel b) => O.OverloadedMethod ApplicationSetAppMenuMethodInfo a signature where
    overloadedMethod = applicationSetAppMenu

instance O.OverloadedMethodInfo ApplicationSetAppMenuMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationSetAppMenu",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationSetAppMenu"
        }


#endif

-- method Application::set_menubar
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkApplication" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "menubar"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "MenuModel" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GMenuModel, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_set_menubar" gtk_application_set_menubar :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    Ptr Gio.MenuModel.MenuModel ->          -- menubar : TInterface (Name {namespace = "Gio", name = "MenuModel"})
    IO ()

-- | Sets or unsets the menubar for windows of /@application@/.
-- 
-- This is a menubar in the traditional sense.
-- 
-- This can only be done in the primary instance of the application,
-- after it has been registered.  [startup]("GI.Gio.Objects.Application#g:signal:startup") is a good place
-- to call this.
-- 
-- Depending on the desktop environment, this may appear at the top of
-- each window, or at the top of the screen.  In some environments, if
-- both the application menu and the menubar are set, the application
-- menu will be presented as if it were the first item of the menubar.
-- Other environments treat the two as completely separate — for example,
-- the application menu may be rendered by the desktop shell while the
-- menubar (if set) remains in each individual window.
-- 
-- Use the base t'GI.Gio.Interfaces.ActionMap.ActionMap' interface to add actions, to respond to the
-- user selecting these menu items.
-- 
-- /Since: 3.4/
applicationSetMenubar ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gio.MenuModel.IsMenuModel b) =>
    a
    -- ^ /@application@/: a t'GI.Gtk.Objects.Application.Application'
    -> Maybe (b)
    -- ^ /@menubar@/: a t'GI.Gio.Objects.MenuModel.MenuModel', or 'P.Nothing'
    -> m ()
applicationSetMenubar :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsApplication a, IsMenuModel b) =>
a -> Maybe b -> m ()
applicationSetMenubar a
application Maybe b
menubar = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr MenuModel
maybeMenubar <- case Maybe b
menubar of
        Maybe b
Nothing -> Ptr MenuModel -> IO (Ptr MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MenuModel
forall a. Ptr a
nullPtr
        Just b
jMenubar -> do
            Ptr MenuModel
jMenubar' <- b -> IO (Ptr MenuModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMenubar
            Ptr MenuModel -> IO (Ptr MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MenuModel
jMenubar'
    Ptr Application -> Ptr MenuModel -> IO ()
gtk_application_set_menubar Ptr Application
application' Ptr MenuModel
maybeMenubar
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
menubar b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ApplicationSetMenubarMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsApplication a, Gio.MenuModel.IsMenuModel b) => O.OverloadedMethod ApplicationSetMenubarMethodInfo a signature where
    overloadedMethod = applicationSetMenubar

instance O.OverloadedMethodInfo ApplicationSetMenubarMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationSetMenubar",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationSetMenubar"
        }


#endif

-- method Application::uninhibit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "application"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "Application" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GtkApplication"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cookie"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a cookie that was returned by gtk_application_inhibit()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_application_uninhibit" gtk_application_uninhibit :: 
    Ptr Application ->                      -- application : TInterface (Name {namespace = "Gtk", name = "Application"})
    Word32 ->                               -- cookie : TBasicType TUInt
    IO ()

-- | Removes an inhibitor that has been established with 'GI.Gtk.Objects.Application.applicationInhibit'.
-- Inhibitors are also cleared when the application exits.
-- 
-- /Since: 3.4/
applicationUninhibit ::
    (B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
    a
    -- ^ /@application@/: the t'GI.Gtk.Objects.Application.Application'
    -> Word32
    -- ^ /@cookie@/: a cookie that was returned by 'GI.Gtk.Objects.Application.applicationInhibit'
    -> m ()
applicationUninhibit :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsApplication a) =>
a -> Word32 -> m ()
applicationUninhibit a
application Word32
cookie = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Application
application' <- a -> IO (Ptr Application)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
application
    Ptr Application -> Word32 -> IO ()
gtk_application_uninhibit Ptr Application
application' Word32
cookie
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
application
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ApplicationUninhibitMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsApplication a) => O.OverloadedMethod ApplicationUninhibitMethodInfo a signature where
    overloadedMethod = applicationUninhibit

instance O.OverloadedMethodInfo ApplicationUninhibitMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.Gtk.Objects.Application.applicationUninhibit",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-Application.html#v:applicationUninhibit"
        }


#endif