#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.AppLaunchContext
(
AppLaunchContext(..) ,
IsAppLaunchContext ,
toAppLaunchContext ,
noAppLaunchContext ,
#if ENABLE_OVERLOADING
AppLaunchContextGetDisplayMethodInfo ,
#endif
appLaunchContextGetDisplay ,
#if ENABLE_OVERLOADING
AppLaunchContextGetEnvironmentMethodInfo,
#endif
appLaunchContextGetEnvironment ,
#if ENABLE_OVERLOADING
AppLaunchContextGetStartupNotifyIdMethodInfo,
#endif
appLaunchContextGetStartupNotifyId ,
#if ENABLE_OVERLOADING
AppLaunchContextLaunchFailedMethodInfo ,
#endif
appLaunchContextLaunchFailed ,
appLaunchContextNew ,
#if ENABLE_OVERLOADING
AppLaunchContextSetenvMethodInfo ,
#endif
appLaunchContextSetenv ,
#if ENABLE_OVERLOADING
AppLaunchContextUnsetenvMethodInfo ,
#endif
appLaunchContextUnsetenv ,
AppLaunchContextLaunchFailedCallback ,
#if ENABLE_OVERLOADING
AppLaunchContextLaunchFailedSignalInfo ,
#endif
C_AppLaunchContextLaunchFailedCallback ,
afterAppLaunchContextLaunchFailed ,
genClosure_AppLaunchContextLaunchFailed ,
mk_AppLaunchContextLaunchFailedCallback ,
noAppLaunchContextLaunchFailedCallback ,
onAppLaunchContextLaunchFailed ,
wrap_AppLaunchContextLaunchFailedCallback,
AppLaunchContextLaunchedCallback ,
#if ENABLE_OVERLOADING
AppLaunchContextLaunchedSignalInfo ,
#endif
C_AppLaunchContextLaunchedCallback ,
afterAppLaunchContextLaunched ,
genClosure_AppLaunchContextLaunched ,
mk_AppLaunchContextLaunchedCallback ,
noAppLaunchContextLaunchedCallback ,
onAppLaunchContextLaunched ,
wrap_AppLaunchContextLaunchedCallback ,
) 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.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 {-# SOURCE #-} qualified GI.Gio.Interfaces.AppInfo as Gio.AppInfo
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
newtype AppLaunchContext = AppLaunchContext (ManagedPtr AppLaunchContext)
foreign import ccall "g_app_launch_context_get_type"
c_g_app_launch_context_get_type :: IO GType
instance GObject AppLaunchContext where
gobjectType = c_g_app_launch_context_get_type
class (GObject o, O.IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o
instance (GObject o, O.IsDescendantOf AppLaunchContext o) => IsAppLaunchContext o
instance O.HasParentTypes AppLaunchContext
type instance O.ParentTypes AppLaunchContext = '[GObject.Object.Object]
toAppLaunchContext :: (MonadIO m, IsAppLaunchContext o) => o -> m AppLaunchContext
toAppLaunchContext = liftIO . unsafeCastTo AppLaunchContext
noAppLaunchContext :: Maybe AppLaunchContext
noAppLaunchContext = Nothing
#if ENABLE_OVERLOADING
type family ResolveAppLaunchContextMethod (t :: Symbol) (o :: *) :: * where
ResolveAppLaunchContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAppLaunchContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAppLaunchContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAppLaunchContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAppLaunchContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAppLaunchContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAppLaunchContextMethod "launchFailed" o = AppLaunchContextLaunchFailedMethodInfo
ResolveAppLaunchContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAppLaunchContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAppLaunchContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAppLaunchContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAppLaunchContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAppLaunchContextMethod "setenv" o = AppLaunchContextSetenvMethodInfo
ResolveAppLaunchContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAppLaunchContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAppLaunchContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAppLaunchContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAppLaunchContextMethod "unsetenv" o = AppLaunchContextUnsetenvMethodInfo
ResolveAppLaunchContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAppLaunchContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAppLaunchContextMethod "getDisplay" o = AppLaunchContextGetDisplayMethodInfo
ResolveAppLaunchContextMethod "getEnvironment" o = AppLaunchContextGetEnvironmentMethodInfo
ResolveAppLaunchContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAppLaunchContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAppLaunchContextMethod "getStartupNotifyId" o = AppLaunchContextGetStartupNotifyIdMethodInfo
ResolveAppLaunchContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAppLaunchContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAppLaunchContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAppLaunchContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAppLaunchContextMethod t AppLaunchContext, O.MethodInfo info AppLaunchContext p) => OL.IsLabel t (AppLaunchContext -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
type AppLaunchContextLaunchFailedCallback =
T.Text
-> IO ()
noAppLaunchContextLaunchFailedCallback :: Maybe AppLaunchContextLaunchFailedCallback
noAppLaunchContextLaunchFailedCallback = Nothing
type C_AppLaunchContextLaunchFailedCallback =
Ptr () ->
CString ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_AppLaunchContextLaunchFailedCallback :: C_AppLaunchContextLaunchFailedCallback -> IO (FunPtr C_AppLaunchContextLaunchFailedCallback)
genClosure_AppLaunchContextLaunchFailed :: MonadIO m => AppLaunchContextLaunchFailedCallback -> m (GClosure C_AppLaunchContextLaunchFailedCallback)
genClosure_AppLaunchContextLaunchFailed cb = liftIO $ do
let cb' = wrap_AppLaunchContextLaunchFailedCallback cb
mk_AppLaunchContextLaunchFailedCallback cb' >>= B.GClosure.newGClosure
wrap_AppLaunchContextLaunchFailedCallback ::
AppLaunchContextLaunchFailedCallback ->
C_AppLaunchContextLaunchFailedCallback
wrap_AppLaunchContextLaunchFailedCallback _cb _ startupNotifyId _ = do
startupNotifyId' <- cstringToText startupNotifyId
_cb startupNotifyId'
onAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => a -> AppLaunchContextLaunchFailedCallback -> m SignalHandlerId
onAppLaunchContextLaunchFailed obj cb = liftIO $ do
let cb' = wrap_AppLaunchContextLaunchFailedCallback cb
cb'' <- mk_AppLaunchContextLaunchFailedCallback cb'
connectSignalFunPtr obj "launch-failed" cb'' SignalConnectBefore
afterAppLaunchContextLaunchFailed :: (IsAppLaunchContext a, MonadIO m) => a -> AppLaunchContextLaunchFailedCallback -> m SignalHandlerId
afterAppLaunchContextLaunchFailed obj cb = liftIO $ do
let cb' = wrap_AppLaunchContextLaunchFailedCallback cb
cb'' <- mk_AppLaunchContextLaunchFailedCallback cb'
connectSignalFunPtr obj "launch-failed" cb'' SignalConnectAfter
type AppLaunchContextLaunchedCallback =
Gio.AppInfo.AppInfo
-> GVariant
-> IO ()
noAppLaunchContextLaunchedCallback :: Maybe AppLaunchContextLaunchedCallback
noAppLaunchContextLaunchedCallback = Nothing
type C_AppLaunchContextLaunchedCallback =
Ptr () ->
Ptr Gio.AppInfo.AppInfo ->
Ptr GVariant ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_AppLaunchContextLaunchedCallback :: C_AppLaunchContextLaunchedCallback -> IO (FunPtr C_AppLaunchContextLaunchedCallback)
genClosure_AppLaunchContextLaunched :: MonadIO m => AppLaunchContextLaunchedCallback -> m (GClosure C_AppLaunchContextLaunchedCallback)
genClosure_AppLaunchContextLaunched cb = liftIO $ do
let cb' = wrap_AppLaunchContextLaunchedCallback cb
mk_AppLaunchContextLaunchedCallback cb' >>= B.GClosure.newGClosure
wrap_AppLaunchContextLaunchedCallback ::
AppLaunchContextLaunchedCallback ->
C_AppLaunchContextLaunchedCallback
wrap_AppLaunchContextLaunchedCallback _cb _ info platformData _ = do
info' <- (newObject Gio.AppInfo.AppInfo) info
platformData' <- B.GVariant.newGVariantFromPtr platformData
_cb info' platformData'
onAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => a -> AppLaunchContextLaunchedCallback -> m SignalHandlerId
onAppLaunchContextLaunched obj cb = liftIO $ do
let cb' = wrap_AppLaunchContextLaunchedCallback cb
cb'' <- mk_AppLaunchContextLaunchedCallback cb'
connectSignalFunPtr obj "launched" cb'' SignalConnectBefore
afterAppLaunchContextLaunched :: (IsAppLaunchContext a, MonadIO m) => a -> AppLaunchContextLaunchedCallback -> m SignalHandlerId
afterAppLaunchContextLaunched obj cb = liftIO $ do
let cb' = wrap_AppLaunchContextLaunchedCallback cb
cb'' <- mk_AppLaunchContextLaunchedCallback cb'
connectSignalFunPtr obj "launched" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
instance O.HasAttributeList AppLaunchContext
type instance O.AttributeList AppLaunchContext = AppLaunchContextAttributeList
type AppLaunchContextAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
data AppLaunchContextLaunchFailedSignalInfo
instance SignalInfo AppLaunchContextLaunchFailedSignalInfo where
type HaskellCallbackType AppLaunchContextLaunchFailedSignalInfo = AppLaunchContextLaunchFailedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_AppLaunchContextLaunchFailedCallback cb
cb'' <- mk_AppLaunchContextLaunchFailedCallback cb'
connectSignalFunPtr obj "launch-failed" cb'' connectMode
data AppLaunchContextLaunchedSignalInfo
instance SignalInfo AppLaunchContextLaunchedSignalInfo where
type HaskellCallbackType AppLaunchContextLaunchedSignalInfo = AppLaunchContextLaunchedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_AppLaunchContextLaunchedCallback cb
cb'' <- mk_AppLaunchContextLaunchedCallback cb'
connectSignalFunPtr obj "launched" cb'' connectMode
type instance O.SignalList AppLaunchContext = AppLaunchContextSignalList
type AppLaunchContextSignalList = ('[ '("launchFailed", AppLaunchContextLaunchFailedSignalInfo), '("launched", AppLaunchContextLaunchedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_app_launch_context_new" g_app_launch_context_new ::
IO (Ptr AppLaunchContext)
appLaunchContextNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m AppLaunchContext
appLaunchContextNew = liftIO $ do
result <- g_app_launch_context_new
checkUnexpectedReturnNULL "appLaunchContextNew" result
result' <- (wrapObject AppLaunchContext) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_app_launch_context_get_display" g_app_launch_context_get_display ::
Ptr AppLaunchContext ->
Ptr Gio.AppInfo.AppInfo ->
Ptr (GList (Ptr Gio.File.File)) ->
IO CString
appLaunchContextGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a, Gio.AppInfo.IsAppInfo b, Gio.File.IsFile c) =>
a
-> b
-> [c]
-> m T.Text
appLaunchContextGetDisplay context info files = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
info' <- unsafeManagedPtrCastPtr info
files' <- mapM unsafeManagedPtrCastPtr files
files'' <- packGList files'
result <- g_app_launch_context_get_display context' info' files''
checkUnexpectedReturnNULL "appLaunchContextGetDisplay" result
result' <- cstringToText result
freeMem result
touchManagedPtr context
touchManagedPtr info
mapM_ touchManagedPtr files
g_list_free files''
return result'
#if ENABLE_OVERLOADING
data AppLaunchContextGetDisplayMethodInfo
instance (signature ~ (b -> [c] -> m T.Text), MonadIO m, IsAppLaunchContext a, Gio.AppInfo.IsAppInfo b, Gio.File.IsFile c) => O.MethodInfo AppLaunchContextGetDisplayMethodInfo a signature where
overloadedMethod _ = appLaunchContextGetDisplay
#endif
foreign import ccall "g_app_launch_context_get_environment" g_app_launch_context_get_environment ::
Ptr AppLaunchContext ->
IO (Ptr CString)
appLaunchContextGetEnvironment ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a) =>
a
-> m [[Char]]
appLaunchContextGetEnvironment context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- g_app_launch_context_get_environment context'
checkUnexpectedReturnNULL "appLaunchContextGetEnvironment" result
result' <- unpackZeroTerminatedFileNameArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr context
return result'
#if ENABLE_OVERLOADING
data AppLaunchContextGetEnvironmentMethodInfo
instance (signature ~ (m [[Char]]), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextGetEnvironmentMethodInfo a signature where
overloadedMethod _ = appLaunchContextGetEnvironment
#endif
foreign import ccall "g_app_launch_context_get_startup_notify_id" g_app_launch_context_get_startup_notify_id ::
Ptr AppLaunchContext ->
Ptr Gio.AppInfo.AppInfo ->
Ptr (GList (Ptr Gio.File.File)) ->
IO CString
appLaunchContextGetStartupNotifyId ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a, Gio.AppInfo.IsAppInfo b, Gio.File.IsFile c) =>
a
-> b
-> [c]
-> m T.Text
appLaunchContextGetStartupNotifyId context info files = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
info' <- unsafeManagedPtrCastPtr info
files' <- mapM unsafeManagedPtrCastPtr files
files'' <- packGList files'
result <- g_app_launch_context_get_startup_notify_id context' info' files''
checkUnexpectedReturnNULL "appLaunchContextGetStartupNotifyId" result
result' <- cstringToText result
freeMem result
touchManagedPtr context
touchManagedPtr info
mapM_ touchManagedPtr files
g_list_free files''
return result'
#if ENABLE_OVERLOADING
data AppLaunchContextGetStartupNotifyIdMethodInfo
instance (signature ~ (b -> [c] -> m T.Text), MonadIO m, IsAppLaunchContext a, Gio.AppInfo.IsAppInfo b, Gio.File.IsFile c) => O.MethodInfo AppLaunchContextGetStartupNotifyIdMethodInfo a signature where
overloadedMethod _ = appLaunchContextGetStartupNotifyId
#endif
foreign import ccall "g_app_launch_context_launch_failed" g_app_launch_context_launch_failed ::
Ptr AppLaunchContext ->
CString ->
IO ()
appLaunchContextLaunchFailed ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a) =>
a
-> T.Text
-> m ()
appLaunchContextLaunchFailed context startupNotifyId = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
startupNotifyId' <- textToCString startupNotifyId
g_app_launch_context_launch_failed context' startupNotifyId'
touchManagedPtr context
freeMem startupNotifyId'
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextLaunchFailedMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextLaunchFailedMethodInfo a signature where
overloadedMethod _ = appLaunchContextLaunchFailed
#endif
foreign import ccall "g_app_launch_context_setenv" g_app_launch_context_setenv ::
Ptr AppLaunchContext ->
CString ->
CString ->
IO ()
appLaunchContextSetenv ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a) =>
a
-> [Char]
-> [Char]
-> m ()
appLaunchContextSetenv context variable value = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
variable' <- stringToCString variable
value' <- stringToCString value
g_app_launch_context_setenv context' variable' value'
touchManagedPtr context
freeMem variable'
freeMem value'
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextSetenvMethodInfo
instance (signature ~ ([Char] -> [Char] -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextSetenvMethodInfo a signature where
overloadedMethod _ = appLaunchContextSetenv
#endif
foreign import ccall "g_app_launch_context_unsetenv" g_app_launch_context_unsetenv ::
Ptr AppLaunchContext ->
CString ->
IO ()
appLaunchContextUnsetenv ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a) =>
a
-> [Char]
-> m ()
appLaunchContextUnsetenv context variable = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
variable' <- stringToCString variable
g_app_launch_context_unsetenv context' variable'
touchManagedPtr context
freeMem variable'
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextUnsetenvMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextUnsetenvMethodInfo a signature where
overloadedMethod _ = appLaunchContextUnsetenv
#endif