#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Atk.Functions
(
focusTrackerNotify ,
getBinaryAge ,
getDefaultRegistry ,
getFocusObject ,
getInterfaceAge ,
getMajorVersion ,
getMicroVersion ,
getMinorVersion ,
getRoot ,
getToolkitName ,
getToolkitVersion ,
getVersion ,
removeFocusTracker ,
removeGlobalEventListener ,
removeKeyEventListener ,
) 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.BasicTypes as B.Types
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 Control.Monad.IO.Class as MIO
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 {-# SOURCE #-} qualified GI.Atk.Objects.Object as Atk.Object
import {-# SOURCE #-} qualified GI.Atk.Objects.Registry as Atk.Registry
foreign import ccall "atk_remove_key_event_listener" atk_remove_key_event_listener ::
Word32 ->
IO ()
removeKeyEventListener ::
(B.CallStack.HasCallStack, MonadIO m) =>
Word32
-> m ()
removeKeyEventListener :: Word32 -> m ()
removeKeyEventListener Word32
listenerId = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Word32 -> IO ()
atk_remove_key_event_listener Word32
listenerId
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "atk_remove_global_event_listener" atk_remove_global_event_listener ::
Word32 ->
IO ()
removeGlobalEventListener ::
(B.CallStack.HasCallStack, MonadIO m) =>
Word32
-> m ()
removeGlobalEventListener :: Word32 -> m ()
removeGlobalEventListener Word32
listenerId = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Word32 -> IO ()
atk_remove_global_event_listener Word32
listenerId
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "atk_remove_focus_tracker" atk_remove_focus_tracker ::
Word32 ->
IO ()
{-# DEPRECATED removeFocusTracker ["(Since version 2.9.4)","Focus tracking has been dropped as a feature"," to be implemented by ATK itself. If you need focus tracking on your"," implementation, subscribe to the [stateChange](\"GI.Atk.Objects.Object#g:signal:stateChange\") \\\"focused\\\""," signal."] #-}
removeFocusTracker ::
(B.CallStack.HasCallStack, MonadIO m) =>
Word32
-> m ()
removeFocusTracker :: Word32 -> m ()
removeFocusTracker Word32
trackerId = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Word32 -> IO ()
atk_remove_focus_tracker Word32
trackerId
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "atk_get_version" atk_get_version ::
IO CString
getVersion ::
(B.CallStack.HasCallStack, MonadIO m) =>
m T.Text
getVersion :: m Text
getVersion = 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
CString
result <- IO CString
atk_get_version
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getVersion" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
foreign import ccall "atk_get_toolkit_version" atk_get_toolkit_version ::
IO CString
getToolkitVersion ::
(B.CallStack.HasCallStack, MonadIO m) =>
m T.Text
getToolkitVersion :: m Text
getToolkitVersion = 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
CString
result <- IO CString
atk_get_toolkit_version
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getToolkitVersion" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
foreign import ccall "atk_get_toolkit_name" atk_get_toolkit_name ::
IO CString
getToolkitName ::
(B.CallStack.HasCallStack, MonadIO m) =>
m T.Text
getToolkitName :: m Text
getToolkitName = 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
CString
result <- IO CString
atk_get_toolkit_name
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getToolkitName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
foreign import ccall "atk_get_root" atk_get_root ::
IO (Ptr Atk.Object.Object)
getRoot ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Atk.Object.Object
getRoot :: m Object
getRoot = IO Object -> m Object
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Object -> m Object) -> IO Object -> m Object
forall a b. (a -> b) -> a -> b
$ do
Ptr Object
result <- IO (Ptr Object)
atk_get_root
Text -> Ptr Object -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getRoot" Ptr Object
result
Object
result' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Atk.Object.Object) Ptr Object
result
Object -> IO Object
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result'
foreign import ccall "atk_get_minor_version" atk_get_minor_version ::
IO Word32
getMinorVersion ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Word32
getMinorVersion :: m Word32
getMinorVersion = 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
Word32
result <- IO Word32
atk_get_minor_version
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
foreign import ccall "atk_get_micro_version" atk_get_micro_version ::
IO Word32
getMicroVersion ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Word32
getMicroVersion :: m Word32
getMicroVersion = 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
Word32
result <- IO Word32
atk_get_micro_version
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
foreign import ccall "atk_get_major_version" atk_get_major_version ::
IO Word32
getMajorVersion ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Word32
getMajorVersion :: m Word32
getMajorVersion = 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
Word32
result <- IO Word32
atk_get_major_version
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
foreign import ccall "atk_get_interface_age" atk_get_interface_age ::
IO Word32
getInterfaceAge ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Word32
getInterfaceAge :: m Word32
getInterfaceAge = 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
Word32
result <- IO Word32
atk_get_interface_age
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
foreign import ccall "atk_get_focus_object" atk_get_focus_object ::
IO (Ptr Atk.Object.Object)
getFocusObject ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Atk.Object.Object
getFocusObject :: m Object
getFocusObject = IO Object -> m Object
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Object -> m Object) -> IO Object -> m Object
forall a b. (a -> b) -> a -> b
$ do
Ptr Object
result <- IO (Ptr Object)
atk_get_focus_object
Text -> Ptr Object -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getFocusObject" Ptr Object
result
Object
result' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Atk.Object.Object) Ptr Object
result
Object -> IO Object
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result'
foreign import ccall "atk_get_default_registry" atk_get_default_registry ::
IO (Ptr Atk.Registry.Registry)
getDefaultRegistry ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Atk.Registry.Registry
getDefaultRegistry :: m Registry
getDefaultRegistry = IO Registry -> m Registry
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Registry -> m Registry) -> IO Registry -> m Registry
forall a b. (a -> b) -> a -> b
$ do
Ptr Registry
result <- IO (Ptr Registry)
atk_get_default_registry
Text -> Ptr Registry -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getDefaultRegistry" Ptr Registry
result
Registry
result' <- ((ManagedPtr Registry -> Registry) -> Ptr Registry -> IO Registry
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Registry -> Registry
Atk.Registry.Registry) Ptr Registry
result
Registry -> IO Registry
forall (m :: * -> *) a. Monad m => a -> m a
return Registry
result'
foreign import ccall "atk_get_binary_age" atk_get_binary_age ::
IO Word32
getBinaryAge ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Word32
getBinaryAge :: m Word32
getBinaryAge = 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
Word32
result <- IO Word32
atk_get_binary_age
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
foreign import ccall "atk_focus_tracker_notify" atk_focus_tracker_notify ::
Ptr Atk.Object.Object ->
IO ()
{-# DEPRECATED focusTrackerNotify ["(Since version 2.9.4)","Focus tracking has been dropped as a feature","to be implemented by ATK itself. As [focusEvent](\"GI.Atk.Objects.Object#g:signal:focusEvent\") was","deprecated in favor of a [stateChange](\"GI.Atk.Objects.Object#g:signal:stateChange\") signal, in order","to notify a focus change on your implementation, you can use","'GI.Atk.Objects.Object.objectNotifyStateChange' instead."] #-}
focusTrackerNotify ::
(B.CallStack.HasCallStack, MonadIO m, Atk.Object.IsObject a) =>
a
-> m ()
focusTrackerNotify :: a -> m ()
focusTrackerNotify a
object = 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 Object
object' <- a -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
object
Ptr Object -> IO ()
atk_focus_tracker_notify Ptr Object
object'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
object
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()