{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.Application
(
Application(..) ,
IsApplication ,
toApplication ,
noApplication ,
#if defined(ENABLE_OVERLOADING)
ResolveApplicationMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ApplicationAddAcceleratorMethodInfo ,
#endif
applicationAddAccelerator ,
#if defined(ENABLE_OVERLOADING)
ApplicationAddWindowMethodInfo ,
#endif
applicationAddWindow ,
#if defined(ENABLE_OVERLOADING)
ApplicationGetAccelsForActionMethodInfo ,
#endif
applicationGetAccelsForAction ,
#if defined(ENABLE_OVERLOADING)
ApplicationGetActionsForAccelMethodInfo ,
#endif
applicationGetActionsForAccel ,
#if defined(ENABLE_OVERLOADING)
ApplicationGetActiveWindowMethodInfo ,
#endif
applicationGetActiveWindow ,
#if defined(ENABLE_OVERLOADING)
ApplicationGetAppMenuMethodInfo ,
#endif
applicationGetAppMenu ,
#if defined(ENABLE_OVERLOADING)
ApplicationGetMenuByIdMethodInfo ,
#endif
applicationGetMenuById ,
#if defined(ENABLE_OVERLOADING)
ApplicationGetMenubarMethodInfo ,
#endif
applicationGetMenubar ,
#if defined(ENABLE_OVERLOADING)
ApplicationGetWindowByIdMethodInfo ,
#endif
applicationGetWindowById ,
#if defined(ENABLE_OVERLOADING)
ApplicationGetWindowsMethodInfo ,
#endif
applicationGetWindows ,
#if defined(ENABLE_OVERLOADING)
ApplicationInhibitMethodInfo ,
#endif
applicationInhibit ,
#if defined(ENABLE_OVERLOADING)
ApplicationIsInhibitedMethodInfo ,
#endif
applicationIsInhibited ,
#if defined(ENABLE_OVERLOADING)
ApplicationListActionDescriptionsMethodInfo,
#endif
applicationListActionDescriptions ,
applicationNew ,
#if defined(ENABLE_OVERLOADING)
ApplicationPrefersAppMenuMethodInfo ,
#endif
applicationPrefersAppMenu ,
#if defined(ENABLE_OVERLOADING)
ApplicationRemoveAcceleratorMethodInfo ,
#endif
applicationRemoveAccelerator ,
#if defined(ENABLE_OVERLOADING)
ApplicationRemoveWindowMethodInfo ,
#endif
applicationRemoveWindow ,
#if defined(ENABLE_OVERLOADING)
ApplicationSetAccelsForActionMethodInfo ,
#endif
applicationSetAccelsForAction ,
#if defined(ENABLE_OVERLOADING)
ApplicationSetAppMenuMethodInfo ,
#endif
applicationSetAppMenu ,
#if defined(ENABLE_OVERLOADING)
ApplicationSetMenubarMethodInfo ,
#endif
applicationSetMenubar ,
#if defined(ENABLE_OVERLOADING)
ApplicationUninhibitMethodInfo ,
#endif
applicationUninhibit ,
#if defined(ENABLE_OVERLOADING)
ApplicationActiveWindowPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
applicationActiveWindow ,
#endif
getApplicationActiveWindow ,
#if defined(ENABLE_OVERLOADING)
ApplicationAppMenuPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
applicationAppMenu ,
#endif
clearApplicationAppMenu ,
constructApplicationAppMenu ,
getApplicationAppMenu ,
setApplicationAppMenu ,
#if defined(ENABLE_OVERLOADING)
ApplicationMenubarPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
applicationMenubar ,
#endif
clearApplicationMenubar ,
constructApplicationMenubar ,
getApplicationMenubar ,
setApplicationMenubar ,
#if defined(ENABLE_OVERLOADING)
ApplicationRegisterSessionPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
applicationRegisterSession ,
#endif
constructApplicationRegisterSession ,
getApplicationRegisterSession ,
setApplicationRegisterSession ,
#if defined(ENABLE_OVERLOADING)
ApplicationScreensaverActivePropertyInfo,
#endif
#if defined(ENABLE_OVERLOADING)
applicationScreensaverActive ,
#endif
getApplicationScreensaverActive ,
ApplicationQueryEndCallback ,
#if defined(ENABLE_OVERLOADING)
ApplicationQueryEndSignalInfo ,
#endif
C_ApplicationQueryEndCallback ,
afterApplicationQueryEnd ,
genClosure_ApplicationQueryEnd ,
mk_ApplicationQueryEndCallback ,
noApplicationQueryEndCallback ,
onApplicationQueryEnd ,
wrap_ApplicationQueryEndCallback ,
ApplicationWindowAddedCallback ,
#if defined(ENABLE_OVERLOADING)
ApplicationWindowAddedSignalInfo ,
#endif
C_ApplicationWindowAddedCallback ,
afterApplicationWindowAdded ,
genClosure_ApplicationWindowAdded ,
mk_ApplicationWindowAddedCallback ,
noApplicationWindowAddedCallback ,
onApplicationWindowAdded ,
wrap_ApplicationWindowAddedCallback ,
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.ManagedPtr as B.ManagedPtr
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 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 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
newtype Application = Application (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)
foreign import ccall "gtk_application_get_type"
c_gtk_application_get_type :: IO GType
instance GObject Application where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_application_get_type
instance B.GValue.IsGValue Application where
toGValue :: Application -> IO GValue
toGValue o :: Application
o = do
GType
gtype <- IO GType
c_gtk_application_get_type
Application -> (Ptr Application -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Application
o (GType
-> (GValue -> Ptr Application -> IO ())
-> Ptr Application
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Application -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Application
fromGValue gv :: GValue
gv = do
Ptr Application
ptr <- GValue -> IO (Ptr Application)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Application)
(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
class (GObject o, O.IsDescendantOf Application o) => IsApplication o
instance (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]
toApplication :: (MonadIO m, IsApplication o) => o -> m Application
toApplication :: o -> m Application
toApplication = IO Application -> m Application
forall (m :: * -> *) a. MonadIO m => IO a -> m a
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, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Application -> Application
Application
noApplication :: Maybe Application
noApplication :: Maybe Application
noApplication = Maybe Application
forall a. Maybe a
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.MethodInfo 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
#endif
type ApplicationQueryEndCallback =
IO ()
noApplicationQueryEndCallback :: Maybe ApplicationQueryEndCallback
noApplicationQueryEndCallback :: Maybe (IO ())
noApplicationQueryEndCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_ApplicationQueryEndCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ApplicationQueryEndCallback :: C_ApplicationQueryEndCallback -> IO (FunPtr C_ApplicationQueryEndCallback)
genClosure_ApplicationQueryEnd :: MonadIO m => ApplicationQueryEndCallback -> m (GClosure C_ApplicationQueryEndCallback)
genClosure_ApplicationQueryEnd :: IO () -> m (GClosure C_ApplicationQueryEndCallback)
genClosure_ApplicationQueryEnd cb :: 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_ApplicationQueryEndCallback ::
ApplicationQueryEndCallback ->
C_ApplicationQueryEndCallback
wrap_ApplicationQueryEndCallback :: IO () -> C_ApplicationQueryEndCallback
wrap_ApplicationQueryEndCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onApplicationQueryEnd :: (IsApplication a, MonadIO m) => a -> ApplicationQueryEndCallback -> m SignalHandlerId
onApplicationQueryEnd :: a -> IO () -> m SignalHandlerId
onApplicationQueryEnd obj :: a
obj cb :: 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 "query-end" FunPtr C_ApplicationQueryEndCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterApplicationQueryEnd :: (IsApplication a, MonadIO m) => a -> ApplicationQueryEndCallback -> m SignalHandlerId
afterApplicationQueryEnd :: a -> IO () -> m SignalHandlerId
afterApplicationQueryEnd obj :: a
obj cb :: 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 "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
type ApplicationWindowAddedCallback =
Gtk.Window.Window
-> IO ()
noApplicationWindowAddedCallback :: Maybe ApplicationWindowAddedCallback
noApplicationWindowAddedCallback :: Maybe ApplicationWindowAddedCallback
noApplicationWindowAddedCallback = Maybe ApplicationWindowAddedCallback
forall a. Maybe a
Nothing
type C_ApplicationWindowAddedCallback =
Ptr () ->
Ptr Gtk.Window.Window ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ApplicationWindowAddedCallback :: C_ApplicationWindowAddedCallback -> IO (FunPtr C_ApplicationWindowAddedCallback)
genClosure_ApplicationWindowAdded :: MonadIO m => ApplicationWindowAddedCallback -> m (GClosure C_ApplicationWindowAddedCallback)
genClosure_ApplicationWindowAdded :: ApplicationWindowAddedCallback
-> m (GClosure C_ApplicationWindowAddedCallback)
genClosure_ApplicationWindowAdded cb :: 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_ApplicationWindowAddedCallback ::
ApplicationWindowAddedCallback ->
C_ApplicationWindowAddedCallback
wrap_ApplicationWindowAddedCallback :: ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowAddedCallback _cb :: ApplicationWindowAddedCallback
_cb _ window :: Ptr Window
window _ = 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'
onApplicationWindowAdded :: (IsApplication a, MonadIO m) => a -> ApplicationWindowAddedCallback -> m SignalHandlerId
onApplicationWindowAdded :: a -> ApplicationWindowAddedCallback -> m SignalHandlerId
onApplicationWindowAdded obj :: a
obj cb :: 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 "window-added" FunPtr C_ApplicationWindowAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterApplicationWindowAdded :: (IsApplication a, MonadIO m) => a -> ApplicationWindowAddedCallback -> m SignalHandlerId
afterApplicationWindowAdded :: a -> ApplicationWindowAddedCallback -> m SignalHandlerId
afterApplicationWindowAdded obj :: a
obj cb :: 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 "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
type ApplicationWindowRemovedCallback =
Gtk.Window.Window
-> IO ()
noApplicationWindowRemovedCallback :: Maybe ApplicationWindowRemovedCallback
noApplicationWindowRemovedCallback :: Maybe ApplicationWindowAddedCallback
noApplicationWindowRemovedCallback = Maybe ApplicationWindowAddedCallback
forall a. Maybe a
Nothing
type C_ApplicationWindowRemovedCallback =
Ptr () ->
Ptr Gtk.Window.Window ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ApplicationWindowRemovedCallback :: C_ApplicationWindowRemovedCallback -> IO (FunPtr C_ApplicationWindowRemovedCallback)
genClosure_ApplicationWindowRemoved :: MonadIO m => ApplicationWindowRemovedCallback -> m (GClosure C_ApplicationWindowRemovedCallback)
genClosure_ApplicationWindowRemoved :: ApplicationWindowAddedCallback
-> m (GClosure C_ApplicationWindowAddedCallback)
genClosure_ApplicationWindowRemoved cb :: 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_ApplicationWindowRemovedCallback ::
ApplicationWindowRemovedCallback ->
C_ApplicationWindowRemovedCallback
wrap_ApplicationWindowRemovedCallback :: ApplicationWindowAddedCallback -> C_ApplicationWindowAddedCallback
wrap_ApplicationWindowRemovedCallback _cb :: ApplicationWindowAddedCallback
_cb _ window :: Ptr Window
window _ = 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'
onApplicationWindowRemoved :: (IsApplication a, MonadIO m) => a -> ApplicationWindowRemovedCallback -> m SignalHandlerId
onApplicationWindowRemoved :: a -> ApplicationWindowAddedCallback -> m SignalHandlerId
onApplicationWindowRemoved obj :: a
obj cb :: 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 "window-removed" FunPtr C_ApplicationWindowAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterApplicationWindowRemoved :: (IsApplication a, MonadIO m) => a -> ApplicationWindowRemovedCallback -> m SignalHandlerId
afterApplicationWindowRemoved :: a -> ApplicationWindowAddedCallback -> m SignalHandlerId
afterApplicationWindowRemoved obj :: a
obj cb :: 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 "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
getApplicationActiveWindow :: (MonadIO m, IsApplication o) => o -> m (Maybe Gtk.Window.Window)
getApplicationActiveWindow :: o -> m (Maybe Window)
getApplicationActiveWindow obj :: o
obj = 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
$ 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 "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
getApplicationAppMenu :: (MonadIO m, IsApplication o) => o -> m (Maybe Gio.MenuModel.MenuModel)
obj :: o
obj = 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
$ 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 "app-menu" ManagedPtr MenuModel -> MenuModel
Gio.MenuModel.MenuModel
setApplicationAppMenu :: (MonadIO m, IsApplication o, Gio.MenuModel.IsMenuModel a) => o -> a -> m ()
obj :: o
obj val :: a
val = 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 a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "app-menu" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructApplicationAppMenu :: (IsApplication o, Gio.MenuModel.IsMenuModel a) => a -> IO (GValueConstruct o)
val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "app-menu" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
clearApplicationAppMenu :: (MonadIO m, IsApplication o) => o -> m ()
obj :: 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 "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
getApplicationMenubar :: (MonadIO m, IsApplication o) => o -> m Gio.MenuModel.MenuModel
obj :: o
obj = 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
$ Text -> IO (Maybe MenuModel) -> IO MenuModel
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "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 "menubar" ManagedPtr MenuModel -> MenuModel
Gio.MenuModel.MenuModel
setApplicationMenubar :: (MonadIO m, IsApplication o, Gio.MenuModel.IsMenuModel a) => o -> a -> m ()
obj :: o
obj val :: a
val = 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 a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "menubar" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructApplicationMenubar :: (IsApplication o, Gio.MenuModel.IsMenuModel a) => a -> IO (GValueConstruct o)
val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "menubar" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
clearApplicationMenubar :: (MonadIO m, IsApplication o) => o -> m ()
obj :: 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 "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
getApplicationRegisterSession :: (MonadIO m, IsApplication o) => o -> m Bool
getApplicationRegisterSession :: o -> m Bool
getApplicationRegisterSession obj :: o
obj = 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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "register-session"
setApplicationRegisterSession :: (MonadIO m, IsApplication o) => o -> Bool -> m ()
setApplicationRegisterSession :: o -> Bool -> m ()
setApplicationRegisterSession obj :: o
obj val :: Bool
val = 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 -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj "register-session" Bool
val
constructApplicationRegisterSession :: (IsApplication o) => Bool -> IO (GValueConstruct o)
constructApplicationRegisterSession :: Bool -> IO (GValueConstruct o)
constructApplicationRegisterSession val :: Bool
val = String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool "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
getApplicationScreensaverActive :: (MonadIO m, IsApplication o) => o -> m Bool
getApplicationScreensaverActive :: o -> m Bool
getApplicationScreensaverActive obj :: o
obj = 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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "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
foreign import ccall "gtk_application_new" gtk_application_new ::
CString ->
CUInt ->
IO (Ptr Application)
applicationNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (T.Text)
-> [Gio.Flags.ApplicationFlags]
-> m (Maybe Application)
applicationNew :: Maybe Text -> [ApplicationFlags] -> m (Maybe Application)
applicationNew applicationId :: Maybe Text
applicationId flags :: [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
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jApplicationId :: 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
$ \result' :: 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
foreign import ccall "gtk_application_add_accelerator" gtk_application_add_accelerator ::
Ptr Application ->
CString ->
CString ->
Ptr GVariant ->
IO ()
{-# DEPRECATED applicationAddAccelerator ["(Since version 3.14)","Use 'GI.Gtk.Objects.Application.applicationSetAccelsForAction' instead"] #-}
applicationAddAccelerator ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> T.Text
-> T.Text
-> Maybe (GVariant)
-> m ()
applicationAddAccelerator :: a -> Text -> Text -> Maybe GVariant -> m ()
applicationAddAccelerator application :: a
application accelerator :: Text
accelerator actionName :: Text
actionName parameter :: 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
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jParameter :: 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.MethodInfo ApplicationAddAcceleratorMethodInfo a signature where
overloadedMethod = applicationAddAccelerator
#endif
foreign import ccall "gtk_application_add_window" gtk_application_add_window ::
Ptr Application ->
Ptr Gtk.Window.Window ->
IO ()
applicationAddWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gtk.Window.IsWindow b) =>
a
-> b
-> m ()
applicationAddWindow :: a -> b -> m ()
applicationAddWindow application :: a
application window :: 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.MethodInfo ApplicationAddWindowMethodInfo a signature where
overloadedMethod = applicationAddWindow
#endif
foreign import ccall "gtk_application_get_accels_for_action" gtk_application_get_accels_for_action ::
Ptr Application ->
CString ->
IO (Ptr CString)
applicationGetAccelsForAction ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> T.Text
-> m [T.Text]
applicationGetAccelsForAction :: a -> Text -> m [Text]
applicationGetAccelsForAction application :: a
application detailedActionName :: 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 "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.MethodInfo ApplicationGetAccelsForActionMethodInfo a signature where
overloadedMethod = applicationGetAccelsForAction
#endif
foreign import ccall "gtk_application_get_actions_for_accel" gtk_application_get_actions_for_accel ::
Ptr Application ->
CString ->
IO (Ptr CString)
applicationGetActionsForAccel ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> T.Text
-> m [T.Text]
applicationGetActionsForAccel :: a -> Text -> m [Text]
applicationGetActionsForAccel application :: a
application accel :: 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 "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.MethodInfo ApplicationGetActionsForAccelMethodInfo a signature where
overloadedMethod = applicationGetActionsForAccel
#endif
foreign import ccall "gtk_application_get_active_window" gtk_application_get_active_window ::
Ptr Application ->
IO (Ptr Gtk.Window.Window)
applicationGetActiveWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m (Maybe Gtk.Window.Window)
applicationGetActiveWindow :: a -> m (Maybe Window)
applicationGetActiveWindow application :: 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
$ \result' :: 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.MethodInfo ApplicationGetActiveWindowMethodInfo a signature where
overloadedMethod = applicationGetActiveWindow
#endif
foreign import ccall "gtk_application_get_app_menu" ::
Ptr Application ->
IO (Ptr Gio.MenuModel.MenuModel)
applicationGetAppMenu ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m (Maybe Gio.MenuModel.MenuModel)
application :: 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
$ \result' :: 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.MethodInfo ApplicationGetAppMenuMethodInfo a signature where
overloadedMethod = applicationGetAppMenu
#endif
foreign import ccall "gtk_application_get_menu_by_id" ::
Ptr Application ->
CString ->
IO (Ptr Gio.Menu.Menu)
applicationGetMenuById ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> T.Text
-> m Gio.Menu.Menu
application :: a
application id :: 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 "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.MethodInfo ApplicationGetMenuByIdMethodInfo a signature where
overloadedMethod = applicationGetMenuById
#endif
foreign import ccall "gtk_application_get_menubar" ::
Ptr Application ->
IO (Ptr Gio.MenuModel.MenuModel)
applicationGetMenubar ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m Gio.MenuModel.MenuModel
application :: 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 "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.MethodInfo ApplicationGetMenubarMethodInfo a signature where
overloadedMethod = applicationGetMenubar
#endif
foreign import ccall "gtk_application_get_window_by_id" gtk_application_get_window_by_id ::
Ptr Application ->
Word32 ->
IO (Ptr Gtk.Window.Window)
applicationGetWindowById ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> Word32
-> m (Maybe Gtk.Window.Window)
applicationGetWindowById :: a -> Word32 -> m (Maybe Window)
applicationGetWindowById application :: a
application id :: 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
$ \result' :: 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.MethodInfo ApplicationGetWindowByIdMethodInfo a signature where
overloadedMethod = applicationGetWindowById
#endif
foreign import ccall "gtk_application_get_windows" gtk_application_get_windows ::
Ptr Application ->
IO (Ptr (GList (Ptr Gtk.Window.Window)))
applicationGetWindows ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m [Gtk.Window.Window]
applicationGetWindows :: a -> m [Window]
applicationGetWindows application :: 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.MethodInfo ApplicationGetWindowsMethodInfo a signature where
overloadedMethod = applicationGetWindows
#endif
foreign import ccall "gtk_application_inhibit" gtk_application_inhibit ::
Ptr Application ->
Ptr Gtk.Window.Window ->
CUInt ->
CString ->
IO Word32
applicationInhibit ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gtk.Window.IsWindow b) =>
a
-> Maybe (b)
-> [Gtk.Flags.ApplicationInhibitFlags]
-> Maybe (T.Text)
-> m Word32
applicationInhibit :: a -> Maybe b -> [ApplicationInhibitFlags] -> Maybe Text -> m Word32
applicationInhibit application :: a
application window :: Maybe b
window flags :: [ApplicationInhibitFlags]
flags reason :: 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
Nothing -> Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
forall a. Ptr a
nullPtr
Just jWindow :: 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
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just jReason :: 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.MethodInfo ApplicationInhibitMethodInfo a signature where
overloadedMethod = applicationInhibit
#endif
foreign import ccall "gtk_application_is_inhibited" gtk_application_is_inhibited ::
Ptr Application ->
CUInt ->
IO CInt
applicationIsInhibited ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> [Gtk.Flags.ApplicationInhibitFlags]
-> m Bool
applicationIsInhibited :: a -> [ApplicationInhibitFlags] -> m Bool
applicationIsInhibited application :: a
application flags :: [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
/= 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.MethodInfo ApplicationIsInhibitedMethodInfo a signature where
overloadedMethod = applicationIsInhibited
#endif
foreign import ccall "gtk_application_list_action_descriptions" gtk_application_list_action_descriptions ::
Ptr Application ->
IO (Ptr CString)
applicationListActionDescriptions ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m [T.Text]
applicationListActionDescriptions :: a -> m [Text]
applicationListActionDescriptions application :: 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 "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.MethodInfo ApplicationListActionDescriptionsMethodInfo a signature where
overloadedMethod = applicationListActionDescriptions
#endif
foreign import ccall "gtk_application_prefers_app_menu" ::
Ptr Application ->
IO CInt
applicationPrefersAppMenu ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m Bool
application :: 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
/= 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.MethodInfo ApplicationPrefersAppMenuMethodInfo a signature where
overloadedMethod = applicationPrefersAppMenu
#endif
foreign import ccall "gtk_application_remove_accelerator" gtk_application_remove_accelerator ::
Ptr Application ->
CString ->
Ptr GVariant ->
IO ()
{-# DEPRECATED applicationRemoveAccelerator ["(Since version 3.14)","Use 'GI.Gtk.Objects.Application.applicationSetAccelsForAction' instead"] #-}
applicationRemoveAccelerator ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> T.Text
-> Maybe (GVariant)
-> m ()
applicationRemoveAccelerator :: a -> Text -> Maybe GVariant -> m ()
applicationRemoveAccelerator application :: a
application actionName :: Text
actionName parameter :: 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
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
nullPtr
Just jParameter :: 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.MethodInfo ApplicationRemoveAcceleratorMethodInfo a signature where
overloadedMethod = applicationRemoveAccelerator
#endif
foreign import ccall "gtk_application_remove_window" gtk_application_remove_window ::
Ptr Application ->
Ptr Gtk.Window.Window ->
IO ()
applicationRemoveWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gtk.Window.IsWindow b) =>
a
-> b
-> m ()
applicationRemoveWindow :: a -> b -> m ()
applicationRemoveWindow application :: a
application window :: 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.MethodInfo ApplicationRemoveWindowMethodInfo a signature where
overloadedMethod = applicationRemoveWindow
#endif
foreign import ccall "gtk_application_set_accels_for_action" gtk_application_set_accels_for_action ::
Ptr Application ->
CString ->
Ptr CString ->
IO ()
applicationSetAccelsForAction ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> T.Text
-> [T.Text]
-> m ()
applicationSetAccelsForAction :: a -> Text -> [Text] -> m ()
applicationSetAccelsForAction application :: a
application detailedActionName :: Text
detailedActionName accels :: [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.MethodInfo ApplicationSetAccelsForActionMethodInfo a signature where
overloadedMethod = applicationSetAccelsForAction
#endif
foreign import ccall "gtk_application_set_app_menu" ::
Ptr Application ->
Ptr Gio.MenuModel.MenuModel ->
IO ()
applicationSetAppMenu ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gio.MenuModel.IsMenuModel b) =>
a
-> Maybe (b)
-> m ()
application :: a
application appMenu :: 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
Nothing -> Ptr MenuModel -> IO (Ptr MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MenuModel
forall a. Ptr a
nullPtr
Just jAppMenu :: 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.MethodInfo ApplicationSetAppMenuMethodInfo a signature where
overloadedMethod = applicationSetAppMenu
#endif
foreign import ccall "gtk_application_set_menubar" ::
Ptr Application ->
Ptr Gio.MenuModel.MenuModel ->
IO ()
applicationSetMenubar ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a, Gio.MenuModel.IsMenuModel b) =>
a
-> Maybe (b)
-> m ()
application :: a
application menubar :: 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
Nothing -> Ptr MenuModel -> IO (Ptr MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MenuModel
forall a. Ptr a
nullPtr
Just jMenubar :: 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.MethodInfo ApplicationSetMenubarMethodInfo a signature where
overloadedMethod = applicationSetMenubar
#endif
foreign import ccall "gtk_application_uninhibit" gtk_application_uninhibit ::
Ptr Application ->
Word32 ->
IO ()
applicationUninhibit ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> Word32
-> m ()
applicationUninhibit :: a -> Word32 -> m ()
applicationUninhibit application :: a
application cookie :: 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.MethodInfo ApplicationUninhibitMethodInfo a signature where
overloadedMethod = applicationUninhibit
#endif