#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gdk.Objects.AppLaunchContext
(
AppLaunchContext(..) ,
IsAppLaunchContext ,
toAppLaunchContext ,
noAppLaunchContext ,
appLaunchContextNew ,
#if ENABLE_OVERLOADING
AppLaunchContextSetDesktopMethodInfo ,
#endif
appLaunchContextSetDesktop ,
#if ENABLE_OVERLOADING
AppLaunchContextSetDisplayMethodInfo ,
#endif
appLaunchContextSetDisplay ,
#if ENABLE_OVERLOADING
AppLaunchContextSetIconMethodInfo ,
#endif
appLaunchContextSetIcon ,
#if ENABLE_OVERLOADING
AppLaunchContextSetIconNameMethodInfo ,
#endif
appLaunchContextSetIconName ,
#if ENABLE_OVERLOADING
AppLaunchContextSetScreenMethodInfo ,
#endif
appLaunchContextSetScreen ,
#if ENABLE_OVERLOADING
AppLaunchContextSetTimestampMethodInfo ,
#endif
appLaunchContextSetTimestamp ,
#if ENABLE_OVERLOADING
AppLaunchContextDisplayPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
appLaunchContextDisplay ,
#endif
constructAppLaunchContextDisplay ,
getAppLaunchContextDisplay ,
) 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.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.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 {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Screen as Gdk.Screen
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
newtype AppLaunchContext = AppLaunchContext (ManagedPtr AppLaunchContext)
foreign import ccall "gdk_app_launch_context_get_type"
c_gdk_app_launch_context_get_type :: IO GType
instance GObject AppLaunchContext where
gobjectType _ = c_gdk_app_launch_context_get_type
class GObject o => IsAppLaunchContext o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError AppLaunchContext a) =>
IsAppLaunchContext a
#endif
instance IsAppLaunchContext AppLaunchContext
instance Gio.AppLaunchContext.IsAppLaunchContext AppLaunchContext
instance GObject.Object.IsObject AppLaunchContext
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 = Gio.AppLaunchContext.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 = Gio.AppLaunchContext.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 = Gio.AppLaunchContext.AppLaunchContextUnsetenvMethodInfo
ResolveAppLaunchContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAppLaunchContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAppLaunchContextMethod "getDisplay" o = Gio.AppLaunchContext.AppLaunchContextGetDisplayMethodInfo
ResolveAppLaunchContextMethod "getEnvironment" o = Gio.AppLaunchContext.AppLaunchContextGetEnvironmentMethodInfo
ResolveAppLaunchContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAppLaunchContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAppLaunchContextMethod "getStartupNotifyId" o = Gio.AppLaunchContext.AppLaunchContextGetStartupNotifyIdMethodInfo
ResolveAppLaunchContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAppLaunchContextMethod "setDesktop" o = AppLaunchContextSetDesktopMethodInfo
ResolveAppLaunchContextMethod "setDisplay" o = AppLaunchContextSetDisplayMethodInfo
ResolveAppLaunchContextMethod "setIcon" o = AppLaunchContextSetIconMethodInfo
ResolveAppLaunchContextMethod "setIconName" o = AppLaunchContextSetIconNameMethodInfo
ResolveAppLaunchContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAppLaunchContextMethod "setScreen" o = AppLaunchContextSetScreenMethodInfo
ResolveAppLaunchContextMethod "setTimestamp" o = AppLaunchContextSetTimestampMethodInfo
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
#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
#endif
getAppLaunchContextDisplay :: (MonadIO m, IsAppLaunchContext o) => o -> m (Maybe Gdk.Display.Display)
getAppLaunchContextDisplay obj = liftIO $ getObjectPropertyObject obj "display" Gdk.Display.Display
constructAppLaunchContextDisplay :: (IsAppLaunchContext o, Gdk.Display.IsDisplay a) => a -> IO (GValueConstruct o)
constructAppLaunchContextDisplay val = constructObjectPropertyObject "display" (Just val)
#if ENABLE_OVERLOADING
data AppLaunchContextDisplayPropertyInfo
instance AttrInfo AppLaunchContextDisplayPropertyInfo where
type AttrAllowedOps AppLaunchContextDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint AppLaunchContextDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrBaseTypeConstraint AppLaunchContextDisplayPropertyInfo = IsAppLaunchContext
type AttrGetType AppLaunchContextDisplayPropertyInfo = (Maybe Gdk.Display.Display)
type AttrLabel AppLaunchContextDisplayPropertyInfo = "display"
type AttrOrigin AppLaunchContextDisplayPropertyInfo = AppLaunchContext
attrGet _ = getAppLaunchContextDisplay
attrSet _ = undefined
attrConstruct _ = constructAppLaunchContextDisplay
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList AppLaunchContext
type instance O.AttributeList AppLaunchContext = AppLaunchContextAttributeList
type AppLaunchContextAttributeList = ('[ '("display", AppLaunchContextDisplayPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
appLaunchContextDisplay :: AttrLabelProxy "display"
appLaunchContextDisplay = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList AppLaunchContext = AppLaunchContextSignalList
type AppLaunchContextSignalList = ('[ '("launchFailed", Gio.AppLaunchContext.AppLaunchContextLaunchFailedSignalInfo), '("launched", Gio.AppLaunchContext.AppLaunchContextLaunchedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_app_launch_context_new" gdk_app_launch_context_new ::
IO (Ptr AppLaunchContext)
{-# DEPRECATED appLaunchContextNew ["(Since version 3.0)","Use 'GI.Gdk.Objects.Display.displayGetAppLaunchContext' instead"] #-}
appLaunchContextNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m AppLaunchContext
appLaunchContextNew = liftIO $ do
result <- gdk_app_launch_context_new
checkUnexpectedReturnNULL "appLaunchContextNew" result
result' <- (wrapObject AppLaunchContext) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gdk_app_launch_context_set_desktop" gdk_app_launch_context_set_desktop ::
Ptr AppLaunchContext ->
Int32 ->
IO ()
appLaunchContextSetDesktop ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a) =>
a
-> Int32
-> m ()
appLaunchContextSetDesktop context desktop = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
gdk_app_launch_context_set_desktop context' desktop
touchManagedPtr context
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextSetDesktopMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextSetDesktopMethodInfo a signature where
overloadedMethod _ = appLaunchContextSetDesktop
#endif
foreign import ccall "gdk_app_launch_context_set_display" gdk_app_launch_context_set_display ::
Ptr AppLaunchContext ->
Ptr Gdk.Display.Display ->
IO ()
{-# DEPRECATED appLaunchContextSetDisplay ["(Since version 3.0)","Use 'GI.Gdk.Objects.Display.displayGetAppLaunchContext' instead"] #-}
appLaunchContextSetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a, Gdk.Display.IsDisplay b) =>
a
-> b
-> m ()
appLaunchContextSetDisplay context display = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
display' <- unsafeManagedPtrCastPtr display
gdk_app_launch_context_set_display context' display'
touchManagedPtr context
touchManagedPtr display
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextSetDisplayMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsAppLaunchContext a, Gdk.Display.IsDisplay b) => O.MethodInfo AppLaunchContextSetDisplayMethodInfo a signature where
overloadedMethod _ = appLaunchContextSetDisplay
#endif
foreign import ccall "gdk_app_launch_context_set_icon" gdk_app_launch_context_set_icon ::
Ptr AppLaunchContext ->
Ptr Gio.Icon.Icon ->
IO ()
appLaunchContextSetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a, Gio.Icon.IsIcon b) =>
a
-> Maybe (b)
-> m ()
appLaunchContextSetIcon context icon = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
maybeIcon <- case icon of
Nothing -> return nullPtr
Just jIcon -> do
jIcon' <- unsafeManagedPtrCastPtr jIcon
return jIcon'
gdk_app_launch_context_set_icon context' maybeIcon
touchManagedPtr context
whenJust icon touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextSetIconMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsAppLaunchContext a, Gio.Icon.IsIcon b) => O.MethodInfo AppLaunchContextSetIconMethodInfo a signature where
overloadedMethod _ = appLaunchContextSetIcon
#endif
foreign import ccall "gdk_app_launch_context_set_icon_name" gdk_app_launch_context_set_icon_name ::
Ptr AppLaunchContext ->
CString ->
IO ()
appLaunchContextSetIconName ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a) =>
a
-> Maybe (T.Text)
-> m ()
appLaunchContextSetIconName context iconName = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
maybeIconName <- case iconName of
Nothing -> return nullPtr
Just jIconName -> do
jIconName' <- textToCString jIconName
return jIconName'
gdk_app_launch_context_set_icon_name context' maybeIconName
touchManagedPtr context
freeMem maybeIconName
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextSetIconNameMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextSetIconNameMethodInfo a signature where
overloadedMethod _ = appLaunchContextSetIconName
#endif
foreign import ccall "gdk_app_launch_context_set_screen" gdk_app_launch_context_set_screen ::
Ptr AppLaunchContext ->
Ptr Gdk.Screen.Screen ->
IO ()
appLaunchContextSetScreen ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a, Gdk.Screen.IsScreen b) =>
a
-> b
-> m ()
appLaunchContextSetScreen context screen = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
screen' <- unsafeManagedPtrCastPtr screen
gdk_app_launch_context_set_screen context' screen'
touchManagedPtr context
touchManagedPtr screen
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextSetScreenMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsAppLaunchContext a, Gdk.Screen.IsScreen b) => O.MethodInfo AppLaunchContextSetScreenMethodInfo a signature where
overloadedMethod _ = appLaunchContextSetScreen
#endif
foreign import ccall "gdk_app_launch_context_set_timestamp" gdk_app_launch_context_set_timestamp ::
Ptr AppLaunchContext ->
Word32 ->
IO ()
appLaunchContextSetTimestamp ::
(B.CallStack.HasCallStack, MonadIO m, IsAppLaunchContext a) =>
a
-> Word32
-> m ()
appLaunchContextSetTimestamp context timestamp = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
gdk_app_launch_context_set_timestamp context' timestamp
touchManagedPtr context
return ()
#if ENABLE_OVERLOADING
data AppLaunchContextSetTimestampMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsAppLaunchContext a) => O.MethodInfo AppLaunchContextSetTimestampMethodInfo a signature where
overloadedMethod _ = appLaunchContextSetTimestamp
#endif