#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Wnck.Objects.Workspace
(
Workspace(..) ,
IsWorkspace ,
toWorkspace ,
noWorkspace ,
#if ENABLE_OVERLOADING
WorkspaceActivateMethodInfo ,
#endif
workspaceActivate ,
#if ENABLE_OVERLOADING
WorkspaceChangeNameMethodInfo ,
#endif
workspaceChangeName ,
#if ENABLE_OVERLOADING
WorkspaceGetHeightMethodInfo ,
#endif
workspaceGetHeight ,
#if ENABLE_OVERLOADING
WorkspaceGetLayoutColumnMethodInfo ,
#endif
workspaceGetLayoutColumn ,
#if ENABLE_OVERLOADING
WorkspaceGetLayoutRowMethodInfo ,
#endif
workspaceGetLayoutRow ,
#if ENABLE_OVERLOADING
WorkspaceGetNameMethodInfo ,
#endif
workspaceGetName ,
#if ENABLE_OVERLOADING
WorkspaceGetNeighborMethodInfo ,
#endif
workspaceGetNeighbor ,
#if ENABLE_OVERLOADING
WorkspaceGetNumberMethodInfo ,
#endif
workspaceGetNumber ,
#if ENABLE_OVERLOADING
WorkspaceGetScreenMethodInfo ,
#endif
workspaceGetScreen ,
#if ENABLE_OVERLOADING
WorkspaceGetViewportXMethodInfo ,
#endif
workspaceGetViewportX ,
#if ENABLE_OVERLOADING
WorkspaceGetViewportYMethodInfo ,
#endif
workspaceGetViewportY ,
#if ENABLE_OVERLOADING
WorkspaceGetWidthMethodInfo ,
#endif
workspaceGetWidth ,
#if ENABLE_OVERLOADING
WorkspaceIsVirtualMethodInfo ,
#endif
workspaceIsVirtual ,
C_WorkspaceNameChangedCallback ,
WorkspaceNameChangedCallback ,
#if ENABLE_OVERLOADING
WorkspaceNameChangedSignalInfo ,
#endif
afterWorkspaceNameChanged ,
genClosure_WorkspaceNameChanged ,
mk_WorkspaceNameChangedCallback ,
noWorkspaceNameChangedCallback ,
onWorkspaceNameChanged ,
wrap_WorkspaceNameChangedCallback ,
) 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.Wnck.Enums as Wnck.Enums
import {-# SOURCE #-} qualified GI.Wnck.Objects.Screen as Wnck.Screen
newtype Workspace = Workspace (ManagedPtr Workspace)
foreign import ccall "wnck_workspace_get_type"
c_wnck_workspace_get_type :: IO GType
instance GObject Workspace where
gobjectType = c_wnck_workspace_get_type
class (GObject o, O.IsDescendantOf Workspace o) => IsWorkspace o
instance (GObject o, O.IsDescendantOf Workspace o) => IsWorkspace o
instance O.HasParentTypes Workspace
type instance O.ParentTypes Workspace = '[GObject.Object.Object]
toWorkspace :: (MonadIO m, IsWorkspace o) => o -> m Workspace
toWorkspace = liftIO . unsafeCastTo Workspace
noWorkspace :: Maybe Workspace
noWorkspace = Nothing
#if ENABLE_OVERLOADING
type family ResolveWorkspaceMethod (t :: Symbol) (o :: *) :: * where
ResolveWorkspaceMethod "activate" o = WorkspaceActivateMethodInfo
ResolveWorkspaceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveWorkspaceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveWorkspaceMethod "changeName" o = WorkspaceChangeNameMethodInfo
ResolveWorkspaceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveWorkspaceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveWorkspaceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveWorkspaceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveWorkspaceMethod "isVirtual" o = WorkspaceIsVirtualMethodInfo
ResolveWorkspaceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveWorkspaceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveWorkspaceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveWorkspaceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveWorkspaceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveWorkspaceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveWorkspaceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveWorkspaceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveWorkspaceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveWorkspaceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveWorkspaceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveWorkspaceMethod "getHeight" o = WorkspaceGetHeightMethodInfo
ResolveWorkspaceMethod "getLayoutColumn" o = WorkspaceGetLayoutColumnMethodInfo
ResolveWorkspaceMethod "getLayoutRow" o = WorkspaceGetLayoutRowMethodInfo
ResolveWorkspaceMethod "getName" o = WorkspaceGetNameMethodInfo
ResolveWorkspaceMethod "getNeighbor" o = WorkspaceGetNeighborMethodInfo
ResolveWorkspaceMethod "getNumber" o = WorkspaceGetNumberMethodInfo
ResolveWorkspaceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveWorkspaceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveWorkspaceMethod "getScreen" o = WorkspaceGetScreenMethodInfo
ResolveWorkspaceMethod "getViewportX" o = WorkspaceGetViewportXMethodInfo
ResolveWorkspaceMethod "getViewportY" o = WorkspaceGetViewportYMethodInfo
ResolveWorkspaceMethod "getWidth" o = WorkspaceGetWidthMethodInfo
ResolveWorkspaceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveWorkspaceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveWorkspaceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveWorkspaceMethod t Workspace, O.MethodInfo info Workspace p) => OL.IsLabel t (Workspace -> 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 WorkspaceNameChangedCallback =
IO ()
noWorkspaceNameChangedCallback :: Maybe WorkspaceNameChangedCallback
noWorkspaceNameChangedCallback = Nothing
type C_WorkspaceNameChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WorkspaceNameChangedCallback :: C_WorkspaceNameChangedCallback -> IO (FunPtr C_WorkspaceNameChangedCallback)
genClosure_WorkspaceNameChanged :: MonadIO m => WorkspaceNameChangedCallback -> m (GClosure C_WorkspaceNameChangedCallback)
genClosure_WorkspaceNameChanged cb = liftIO $ do
let cb' = wrap_WorkspaceNameChangedCallback cb
mk_WorkspaceNameChangedCallback cb' >>= B.GClosure.newGClosure
wrap_WorkspaceNameChangedCallback ::
WorkspaceNameChangedCallback ->
C_WorkspaceNameChangedCallback
wrap_WorkspaceNameChangedCallback _cb _ _ = do
_cb
onWorkspaceNameChanged :: (IsWorkspace a, MonadIO m) => a -> WorkspaceNameChangedCallback -> m SignalHandlerId
onWorkspaceNameChanged obj cb = liftIO $ do
let cb' = wrap_WorkspaceNameChangedCallback cb
cb'' <- mk_WorkspaceNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' SignalConnectBefore
afterWorkspaceNameChanged :: (IsWorkspace a, MonadIO m) => a -> WorkspaceNameChangedCallback -> m SignalHandlerId
afterWorkspaceNameChanged obj cb = liftIO $ do
let cb' = wrap_WorkspaceNameChangedCallback cb
cb'' <- mk_WorkspaceNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
instance O.HasAttributeList Workspace
type instance O.AttributeList Workspace = WorkspaceAttributeList
type WorkspaceAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
data WorkspaceNameChangedSignalInfo
instance SignalInfo WorkspaceNameChangedSignalInfo where
type HaskellCallbackType WorkspaceNameChangedSignalInfo = WorkspaceNameChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_WorkspaceNameChangedCallback cb
cb'' <- mk_WorkspaceNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' connectMode
type instance O.SignalList Workspace = WorkspaceSignalList
type WorkspaceSignalList = ('[ '("nameChanged", WorkspaceNameChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "wnck_workspace_activate" wnck_workspace_activate ::
Ptr Workspace ->
Word32 ->
IO ()
workspaceActivate ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> Word32
-> m ()
workspaceActivate space timestamp = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
wnck_workspace_activate space' timestamp
touchManagedPtr space
return ()
#if ENABLE_OVERLOADING
data WorkspaceActivateMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceActivateMethodInfo a signature where
overloadedMethod _ = workspaceActivate
#endif
foreign import ccall "wnck_workspace_change_name" wnck_workspace_change_name ::
Ptr Workspace ->
CString ->
IO ()
workspaceChangeName ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> T.Text
-> m ()
workspaceChangeName space name = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
name' <- textToCString name
wnck_workspace_change_name space' name'
touchManagedPtr space
freeMem name'
return ()
#if ENABLE_OVERLOADING
data WorkspaceChangeNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceChangeNameMethodInfo a signature where
overloadedMethod _ = workspaceChangeName
#endif
foreign import ccall "wnck_workspace_get_height" wnck_workspace_get_height ::
Ptr Workspace ->
IO Int32
workspaceGetHeight ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Int32
workspaceGetHeight space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_height space'
touchManagedPtr space
return result
#if ENABLE_OVERLOADING
data WorkspaceGetHeightMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetHeightMethodInfo a signature where
overloadedMethod _ = workspaceGetHeight
#endif
foreign import ccall "wnck_workspace_get_layout_column" wnck_workspace_get_layout_column ::
Ptr Workspace ->
IO Int32
workspaceGetLayoutColumn ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Int32
workspaceGetLayoutColumn space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_layout_column space'
touchManagedPtr space
return result
#if ENABLE_OVERLOADING
data WorkspaceGetLayoutColumnMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetLayoutColumnMethodInfo a signature where
overloadedMethod _ = workspaceGetLayoutColumn
#endif
foreign import ccall "wnck_workspace_get_layout_row" wnck_workspace_get_layout_row ::
Ptr Workspace ->
IO Int32
workspaceGetLayoutRow ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Int32
workspaceGetLayoutRow space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_layout_row space'
touchManagedPtr space
return result
#if ENABLE_OVERLOADING
data WorkspaceGetLayoutRowMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetLayoutRowMethodInfo a signature where
overloadedMethod _ = workspaceGetLayoutRow
#endif
foreign import ccall "wnck_workspace_get_name" wnck_workspace_get_name ::
Ptr Workspace ->
IO CString
workspaceGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m T.Text
workspaceGetName space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_name space'
checkUnexpectedReturnNULL "workspaceGetName" result
result' <- cstringToText result
touchManagedPtr space
return result'
#if ENABLE_OVERLOADING
data WorkspaceGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetNameMethodInfo a signature where
overloadedMethod _ = workspaceGetName
#endif
foreign import ccall "wnck_workspace_get_neighbor" wnck_workspace_get_neighbor ::
Ptr Workspace ->
CInt ->
IO (Ptr Workspace)
workspaceGetNeighbor ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> Wnck.Enums.MotionDirection
-> m Workspace
workspaceGetNeighbor space direction = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
let direction' = (fromIntegral . fromEnum) direction
result <- wnck_workspace_get_neighbor space' direction'
checkUnexpectedReturnNULL "workspaceGetNeighbor" result
result' <- (newObject Workspace) result
touchManagedPtr space
return result'
#if ENABLE_OVERLOADING
data WorkspaceGetNeighborMethodInfo
instance (signature ~ (Wnck.Enums.MotionDirection -> m Workspace), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetNeighborMethodInfo a signature where
overloadedMethod _ = workspaceGetNeighbor
#endif
foreign import ccall "wnck_workspace_get_number" wnck_workspace_get_number ::
Ptr Workspace ->
IO Int32
workspaceGetNumber ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Int32
workspaceGetNumber space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_number space'
touchManagedPtr space
return result
#if ENABLE_OVERLOADING
data WorkspaceGetNumberMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetNumberMethodInfo a signature where
overloadedMethod _ = workspaceGetNumber
#endif
foreign import ccall "wnck_workspace_get_screen" wnck_workspace_get_screen ::
Ptr Workspace ->
IO (Ptr Wnck.Screen.Screen)
workspaceGetScreen ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Wnck.Screen.Screen
workspaceGetScreen space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_screen space'
checkUnexpectedReturnNULL "workspaceGetScreen" result
result' <- (newObject Wnck.Screen.Screen) result
touchManagedPtr space
return result'
#if ENABLE_OVERLOADING
data WorkspaceGetScreenMethodInfo
instance (signature ~ (m Wnck.Screen.Screen), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetScreenMethodInfo a signature where
overloadedMethod _ = workspaceGetScreen
#endif
foreign import ccall "wnck_workspace_get_viewport_x" wnck_workspace_get_viewport_x ::
Ptr Workspace ->
IO Int32
workspaceGetViewportX ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Int32
workspaceGetViewportX space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_viewport_x space'
touchManagedPtr space
return result
#if ENABLE_OVERLOADING
data WorkspaceGetViewportXMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetViewportXMethodInfo a signature where
overloadedMethod _ = workspaceGetViewportX
#endif
foreign import ccall "wnck_workspace_get_viewport_y" wnck_workspace_get_viewport_y ::
Ptr Workspace ->
IO Int32
workspaceGetViewportY ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Int32
workspaceGetViewportY space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_viewport_y space'
touchManagedPtr space
return result
#if ENABLE_OVERLOADING
data WorkspaceGetViewportYMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetViewportYMethodInfo a signature where
overloadedMethod _ = workspaceGetViewportY
#endif
foreign import ccall "wnck_workspace_get_width" wnck_workspace_get_width ::
Ptr Workspace ->
IO Int32
workspaceGetWidth ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Int32
workspaceGetWidth space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_get_width space'
touchManagedPtr space
return result
#if ENABLE_OVERLOADING
data WorkspaceGetWidthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceGetWidthMethodInfo a signature where
overloadedMethod _ = workspaceGetWidth
#endif
foreign import ccall "wnck_workspace_is_virtual" wnck_workspace_is_virtual ::
Ptr Workspace ->
IO CInt
workspaceIsVirtual ::
(B.CallStack.HasCallStack, MonadIO m, IsWorkspace a) =>
a
-> m Bool
workspaceIsVirtual space = liftIO $ do
space' <- unsafeManagedPtrCastPtr space
result <- wnck_workspace_is_virtual space'
let result' = (/= 0) result
touchManagedPtr space
return result'
#if ENABLE_OVERLOADING
data WorkspaceIsVirtualMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsWorkspace a) => O.MethodInfo WorkspaceIsVirtualMethodInfo a signature where
overloadedMethod _ = workspaceIsVirtual
#endif