module GI.Gio.Objects.AppLaunchContext
(
AppLaunchContext(..) ,
IsAppLaunchContext ,
toAppLaunchContext ,
noAppLaunchContext ,
AppLaunchContextGetDisplayMethodInfo ,
appLaunchContextGetDisplay ,
AppLaunchContextGetEnvironmentMethodInfo,
appLaunchContextGetEnvironment ,
AppLaunchContextGetStartupNotifyIdMethodInfo,
appLaunchContextGetStartupNotifyId ,
AppLaunchContextLaunchFailedMethodInfo ,
appLaunchContextLaunchFailed ,
appLaunchContextNew ,
AppLaunchContextSetenvMethodInfo ,
appLaunchContextSetenv ,
AppLaunchContextUnsetenvMethodInfo ,
appLaunchContextUnsetenv ,
AppLaunchContextLaunchFailedCallback ,
AppLaunchContextLaunchFailedSignalInfo ,
C_AppLaunchContextLaunchFailedCallback ,
afterAppLaunchContextLaunchFailed ,
genClosure_AppLaunchContextLaunchFailed ,
mk_AppLaunchContextLaunchFailedCallback ,
noAppLaunchContextLaunchFailedCallback ,
onAppLaunchContextLaunchFailed ,
wrap_AppLaunchContextLaunchFailedCallback,
AppLaunchContextLaunchedCallback ,
AppLaunchContextLaunchedSignalInfo ,
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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.AppInfo as Gio.AppInfo
import 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 => IsAppLaunchContext o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError AppLaunchContext a) =>
IsAppLaunchContext a
#endif
instance IsAppLaunchContext AppLaunchContext
instance GObject.Object.IsObject AppLaunchContext
toAppLaunchContext :: IsAppLaunchContext o => o -> IO AppLaunchContext
toAppLaunchContext = unsafeCastTo AppLaunchContext
noAppLaunchContext :: Maybe AppLaunchContext
noAppLaunchContext = Nothing
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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveAppLaunchContextMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
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 "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAppLaunchContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAppLaunchContextMethod t AppLaunchContext, O.MethodInfo info AppLaunchContext p) => O.IsLabelProxy t (AppLaunchContext -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAppLaunchContextMethod t AppLaunchContext, O.MethodInfo info AppLaunchContext p) => O.IsLabel t (AppLaunchContext -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#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 :: AppLaunchContextLaunchFailedCallback -> IO Closure
genClosure_AppLaunchContextLaunchFailed cb = do
let cb' = wrap_AppLaunchContextLaunchFailedCallback cb
mk_AppLaunchContextLaunchFailedCallback cb' >>= newCClosure
wrap_AppLaunchContextLaunchFailedCallback ::
AppLaunchContextLaunchFailedCallback ->
Ptr () ->
CString ->
Ptr () ->
IO ()
wrap_AppLaunchContextLaunchFailedCallback _cb _ startupNotifyId _ = do
startupNotifyId' <- cstringToText startupNotifyId
_cb startupNotifyId'
onAppLaunchContextLaunchFailed :: (GObject a, MonadIO m) => a -> AppLaunchContextLaunchFailedCallback -> m SignalHandlerId
onAppLaunchContextLaunchFailed obj cb = liftIO $ connectAppLaunchContextLaunchFailed obj cb SignalConnectBefore
afterAppLaunchContextLaunchFailed :: (GObject a, MonadIO m) => a -> AppLaunchContextLaunchFailedCallback -> m SignalHandlerId
afterAppLaunchContextLaunchFailed obj cb = connectAppLaunchContextLaunchFailed obj cb SignalConnectAfter
connectAppLaunchContextLaunchFailed :: (GObject a, MonadIO m) =>
a -> AppLaunchContextLaunchFailedCallback -> SignalConnectMode -> m SignalHandlerId
connectAppLaunchContextLaunchFailed obj cb after = liftIO $ do
let cb' = wrap_AppLaunchContextLaunchFailedCallback cb
cb'' <- mk_AppLaunchContextLaunchFailedCallback cb'
connectSignalFunPtr obj "launch-failed" cb'' after
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 :: AppLaunchContextLaunchedCallback -> IO Closure
genClosure_AppLaunchContextLaunched cb = do
let cb' = wrap_AppLaunchContextLaunchedCallback cb
mk_AppLaunchContextLaunchedCallback cb' >>= newCClosure
wrap_AppLaunchContextLaunchedCallback ::
AppLaunchContextLaunchedCallback ->
Ptr () ->
Ptr Gio.AppInfo.AppInfo ->
Ptr GVariant ->
Ptr () ->
IO ()
wrap_AppLaunchContextLaunchedCallback _cb _ info platformData _ = do
info' <- (newObject Gio.AppInfo.AppInfo) info
platformData' <- newGVariantFromPtr platformData
_cb info' platformData'
onAppLaunchContextLaunched :: (GObject a, MonadIO m) => a -> AppLaunchContextLaunchedCallback -> m SignalHandlerId
onAppLaunchContextLaunched obj cb = liftIO $ connectAppLaunchContextLaunched obj cb SignalConnectBefore
afterAppLaunchContextLaunched :: (GObject a, MonadIO m) => a -> AppLaunchContextLaunchedCallback -> m SignalHandlerId
afterAppLaunchContextLaunched obj cb = connectAppLaunchContextLaunched obj cb SignalConnectAfter
connectAppLaunchContextLaunched :: (GObject a, MonadIO m) =>
a -> AppLaunchContextLaunchedCallback -> SignalConnectMode -> m SignalHandlerId
connectAppLaunchContextLaunched obj cb after = liftIO $ do
let cb' = wrap_AppLaunchContextLaunchedCallback cb
cb'' <- mk_AppLaunchContextLaunchedCallback cb'
connectSignalFunPtr obj "launched" cb'' after
instance O.HasAttributeList AppLaunchContext
type instance O.AttributeList AppLaunchContext = AppLaunchContextAttributeList
type AppLaunchContextAttributeList = ('[ ] :: [(Symbol, *)])
data AppLaunchContextLaunchFailedSignalInfo
instance SignalInfo AppLaunchContextLaunchFailedSignalInfo where
type HaskellCallbackType AppLaunchContextLaunchFailedSignalInfo = AppLaunchContextLaunchFailedCallback
connectSignal _ = connectAppLaunchContextLaunchFailed
data AppLaunchContextLaunchedSignalInfo
instance SignalInfo AppLaunchContextLaunchedSignalInfo where
type HaskellCallbackType AppLaunchContextLaunchedSignalInfo = AppLaunchContextLaunchedCallback
connectSignal _ = connectAppLaunchContextLaunched
type instance O.SignalList AppLaunchContext = AppLaunchContextSignalList
type AppLaunchContextSignalList = ('[ '("launchFailed", AppLaunchContextLaunchFailedSignalInfo), '("launched", AppLaunchContextLaunchedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
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'
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'
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
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 [T.Text]
appLaunchContextGetEnvironment context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- g_app_launch_context_get_environment context'
checkUnexpectedReturnNULL "appLaunchContextGetEnvironment" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr context
return result'
data AppLaunchContextGetEnvironmentMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextGetEnvironmentMethodInfo a signature where
overloadedMethod _ = appLaunchContextGetEnvironment
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'
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
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 ()
data AppLaunchContextLaunchFailedMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextLaunchFailedMethodInfo a signature where
overloadedMethod _ = appLaunchContextLaunchFailed
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
-> T.Text
-> T.Text
-> m ()
appLaunchContextSetenv context variable value = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
variable' <- textToCString variable
value' <- textToCString value
g_app_launch_context_setenv context' variable' value'
touchManagedPtr context
freeMem variable'
freeMem value'
return ()
data AppLaunchContextSetenvMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextSetenvMethodInfo a signature where
overloadedMethod _ = appLaunchContextSetenv
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
-> T.Text
-> m ()
appLaunchContextUnsetenv context variable = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
variable' <- textToCString variable
g_app_launch_context_unsetenv context' variable'
touchManagedPtr context
freeMem variable'
return ()
data AppLaunchContextUnsetenvMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextUnsetenvMethodInfo a signature where
overloadedMethod _ = appLaunchContextUnsetenv