module GI.Gio.Interfaces.DBusObjectManager
(
DBusObjectManager(..) ,
noDBusObjectManager ,
DBusObjectManagerK ,
toDBusObjectManager ,
dBusObjectManagerGetInterface ,
dBusObjectManagerGetObject ,
dBusObjectManagerGetObjectPath ,
dBusObjectManagerGetObjects ,
DBusObjectManagerInterfaceAddedCallback ,
DBusObjectManagerInterfaceAddedCallbackC,
DBusObjectManagerInterfaceAddedSignalInfo,
afterDBusObjectManagerInterfaceAdded ,
dBusObjectManagerInterfaceAddedCallbackWrapper,
dBusObjectManagerInterfaceAddedClosure ,
mkDBusObjectManagerInterfaceAddedCallback,
noDBusObjectManagerInterfaceAddedCallback,
onDBusObjectManagerInterfaceAdded ,
DBusObjectManagerInterfaceRemovedCallback,
DBusObjectManagerInterfaceRemovedCallbackC,
DBusObjectManagerInterfaceRemovedSignalInfo,
afterDBusObjectManagerInterfaceRemoved ,
dBusObjectManagerInterfaceRemovedCallbackWrapper,
dBusObjectManagerInterfaceRemovedClosure,
mkDBusObjectManagerInterfaceRemovedCallback,
noDBusObjectManagerInterfaceRemovedCallback,
onDBusObjectManagerInterfaceRemoved ,
DBusObjectManagerObjectAddedCallback ,
DBusObjectManagerObjectAddedCallbackC ,
DBusObjectManagerObjectAddedSignalInfo ,
afterDBusObjectManagerObjectAdded ,
dBusObjectManagerObjectAddedCallbackWrapper,
dBusObjectManagerObjectAddedClosure ,
mkDBusObjectManagerObjectAddedCallback ,
noDBusObjectManagerObjectAddedCallback ,
onDBusObjectManagerObjectAdded ,
DBusObjectManagerObjectRemovedCallback ,
DBusObjectManagerObjectRemovedCallbackC ,
DBusObjectManagerObjectRemovedSignalInfo,
afterDBusObjectManagerObjectRemoved ,
dBusObjectManagerObjectRemovedCallbackWrapper,
dBusObjectManagerObjectRemovedClosure ,
mkDBusObjectManagerObjectRemovedCallback,
noDBusObjectManagerObjectRemovedCallback,
onDBusObjectManagerObjectRemoved ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Gio.Types
import GI.Gio.Callbacks
import qualified GI.GObject as GObject
newtype DBusObjectManager = DBusObjectManager (ForeignPtr DBusObjectManager)
noDBusObjectManager :: Maybe DBusObjectManager
noDBusObjectManager = Nothing
type DBusObjectManagerInterfaceAddedCallback =
DBusObject ->
DBusInterface ->
IO ()
noDBusObjectManagerInterfaceAddedCallback :: Maybe DBusObjectManagerInterfaceAddedCallback
noDBusObjectManagerInterfaceAddedCallback = Nothing
type DBusObjectManagerInterfaceAddedCallbackC =
Ptr () ->
Ptr DBusObject ->
Ptr DBusInterface ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkDBusObjectManagerInterfaceAddedCallback :: DBusObjectManagerInterfaceAddedCallbackC -> IO (FunPtr DBusObjectManagerInterfaceAddedCallbackC)
dBusObjectManagerInterfaceAddedClosure :: DBusObjectManagerInterfaceAddedCallback -> IO Closure
dBusObjectManagerInterfaceAddedClosure cb = newCClosure =<< mkDBusObjectManagerInterfaceAddedCallback wrapped
where wrapped = dBusObjectManagerInterfaceAddedCallbackWrapper cb
dBusObjectManagerInterfaceAddedCallbackWrapper ::
DBusObjectManagerInterfaceAddedCallback ->
Ptr () ->
Ptr DBusObject ->
Ptr DBusInterface ->
Ptr () ->
IO ()
dBusObjectManagerInterfaceAddedCallbackWrapper _cb _ object interface _ = do
object' <- (newObject DBusObject) object
interface' <- (newObject DBusInterface) interface
_cb object' interface'
onDBusObjectManagerInterfaceAdded :: (GObject a, MonadIO m) => a -> DBusObjectManagerInterfaceAddedCallback -> m SignalHandlerId
onDBusObjectManagerInterfaceAdded obj cb = liftIO $ connectDBusObjectManagerInterfaceAdded obj cb SignalConnectBefore
afterDBusObjectManagerInterfaceAdded :: (GObject a, MonadIO m) => a -> DBusObjectManagerInterfaceAddedCallback -> m SignalHandlerId
afterDBusObjectManagerInterfaceAdded obj cb = connectDBusObjectManagerInterfaceAdded obj cb SignalConnectAfter
connectDBusObjectManagerInterfaceAdded :: (GObject a, MonadIO m) =>
a -> DBusObjectManagerInterfaceAddedCallback -> SignalConnectMode -> m SignalHandlerId
connectDBusObjectManagerInterfaceAdded obj cb after = liftIO $ do
cb' <- mkDBusObjectManagerInterfaceAddedCallback (dBusObjectManagerInterfaceAddedCallbackWrapper cb)
connectSignalFunPtr obj "interface-added" cb' after
type DBusObjectManagerInterfaceRemovedCallback =
DBusObject ->
DBusInterface ->
IO ()
noDBusObjectManagerInterfaceRemovedCallback :: Maybe DBusObjectManagerInterfaceRemovedCallback
noDBusObjectManagerInterfaceRemovedCallback = Nothing
type DBusObjectManagerInterfaceRemovedCallbackC =
Ptr () ->
Ptr DBusObject ->
Ptr DBusInterface ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkDBusObjectManagerInterfaceRemovedCallback :: DBusObjectManagerInterfaceRemovedCallbackC -> IO (FunPtr DBusObjectManagerInterfaceRemovedCallbackC)
dBusObjectManagerInterfaceRemovedClosure :: DBusObjectManagerInterfaceRemovedCallback -> IO Closure
dBusObjectManagerInterfaceRemovedClosure cb = newCClosure =<< mkDBusObjectManagerInterfaceRemovedCallback wrapped
where wrapped = dBusObjectManagerInterfaceRemovedCallbackWrapper cb
dBusObjectManagerInterfaceRemovedCallbackWrapper ::
DBusObjectManagerInterfaceRemovedCallback ->
Ptr () ->
Ptr DBusObject ->
Ptr DBusInterface ->
Ptr () ->
IO ()
dBusObjectManagerInterfaceRemovedCallbackWrapper _cb _ object interface _ = do
object' <- (newObject DBusObject) object
interface' <- (newObject DBusInterface) interface
_cb object' interface'
onDBusObjectManagerInterfaceRemoved :: (GObject a, MonadIO m) => a -> DBusObjectManagerInterfaceRemovedCallback -> m SignalHandlerId
onDBusObjectManagerInterfaceRemoved obj cb = liftIO $ connectDBusObjectManagerInterfaceRemoved obj cb SignalConnectBefore
afterDBusObjectManagerInterfaceRemoved :: (GObject a, MonadIO m) => a -> DBusObjectManagerInterfaceRemovedCallback -> m SignalHandlerId
afterDBusObjectManagerInterfaceRemoved obj cb = connectDBusObjectManagerInterfaceRemoved obj cb SignalConnectAfter
connectDBusObjectManagerInterfaceRemoved :: (GObject a, MonadIO m) =>
a -> DBusObjectManagerInterfaceRemovedCallback -> SignalConnectMode -> m SignalHandlerId
connectDBusObjectManagerInterfaceRemoved obj cb after = liftIO $ do
cb' <- mkDBusObjectManagerInterfaceRemovedCallback (dBusObjectManagerInterfaceRemovedCallbackWrapper cb)
connectSignalFunPtr obj "interface-removed" cb' after
type DBusObjectManagerObjectAddedCallback =
DBusObject ->
IO ()
noDBusObjectManagerObjectAddedCallback :: Maybe DBusObjectManagerObjectAddedCallback
noDBusObjectManagerObjectAddedCallback = Nothing
type DBusObjectManagerObjectAddedCallbackC =
Ptr () ->
Ptr DBusObject ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkDBusObjectManagerObjectAddedCallback :: DBusObjectManagerObjectAddedCallbackC -> IO (FunPtr DBusObjectManagerObjectAddedCallbackC)
dBusObjectManagerObjectAddedClosure :: DBusObjectManagerObjectAddedCallback -> IO Closure
dBusObjectManagerObjectAddedClosure cb = newCClosure =<< mkDBusObjectManagerObjectAddedCallback wrapped
where wrapped = dBusObjectManagerObjectAddedCallbackWrapper cb
dBusObjectManagerObjectAddedCallbackWrapper ::
DBusObjectManagerObjectAddedCallback ->
Ptr () ->
Ptr DBusObject ->
Ptr () ->
IO ()
dBusObjectManagerObjectAddedCallbackWrapper _cb _ object _ = do
object' <- (newObject DBusObject) object
_cb object'
onDBusObjectManagerObjectAdded :: (GObject a, MonadIO m) => a -> DBusObjectManagerObjectAddedCallback -> m SignalHandlerId
onDBusObjectManagerObjectAdded obj cb = liftIO $ connectDBusObjectManagerObjectAdded obj cb SignalConnectBefore
afterDBusObjectManagerObjectAdded :: (GObject a, MonadIO m) => a -> DBusObjectManagerObjectAddedCallback -> m SignalHandlerId
afterDBusObjectManagerObjectAdded obj cb = connectDBusObjectManagerObjectAdded obj cb SignalConnectAfter
connectDBusObjectManagerObjectAdded :: (GObject a, MonadIO m) =>
a -> DBusObjectManagerObjectAddedCallback -> SignalConnectMode -> m SignalHandlerId
connectDBusObjectManagerObjectAdded obj cb after = liftIO $ do
cb' <- mkDBusObjectManagerObjectAddedCallback (dBusObjectManagerObjectAddedCallbackWrapper cb)
connectSignalFunPtr obj "object-added" cb' after
type DBusObjectManagerObjectRemovedCallback =
DBusObject ->
IO ()
noDBusObjectManagerObjectRemovedCallback :: Maybe DBusObjectManagerObjectRemovedCallback
noDBusObjectManagerObjectRemovedCallback = Nothing
type DBusObjectManagerObjectRemovedCallbackC =
Ptr () ->
Ptr DBusObject ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkDBusObjectManagerObjectRemovedCallback :: DBusObjectManagerObjectRemovedCallbackC -> IO (FunPtr DBusObjectManagerObjectRemovedCallbackC)
dBusObjectManagerObjectRemovedClosure :: DBusObjectManagerObjectRemovedCallback -> IO Closure
dBusObjectManagerObjectRemovedClosure cb = newCClosure =<< mkDBusObjectManagerObjectRemovedCallback wrapped
where wrapped = dBusObjectManagerObjectRemovedCallbackWrapper cb
dBusObjectManagerObjectRemovedCallbackWrapper ::
DBusObjectManagerObjectRemovedCallback ->
Ptr () ->
Ptr DBusObject ->
Ptr () ->
IO ()
dBusObjectManagerObjectRemovedCallbackWrapper _cb _ object _ = do
object' <- (newObject DBusObject) object
_cb object'
onDBusObjectManagerObjectRemoved :: (GObject a, MonadIO m) => a -> DBusObjectManagerObjectRemovedCallback -> m SignalHandlerId
onDBusObjectManagerObjectRemoved obj cb = liftIO $ connectDBusObjectManagerObjectRemoved obj cb SignalConnectBefore
afterDBusObjectManagerObjectRemoved :: (GObject a, MonadIO m) => a -> DBusObjectManagerObjectRemovedCallback -> m SignalHandlerId
afterDBusObjectManagerObjectRemoved obj cb = connectDBusObjectManagerObjectRemoved obj cb SignalConnectAfter
connectDBusObjectManagerObjectRemoved :: (GObject a, MonadIO m) =>
a -> DBusObjectManagerObjectRemovedCallback -> SignalConnectMode -> m SignalHandlerId
connectDBusObjectManagerObjectRemoved obj cb after = liftIO $ do
cb' <- mkDBusObjectManagerObjectRemovedCallback (dBusObjectManagerObjectRemovedCallbackWrapper cb)
connectSignalFunPtr obj "object-removed" cb' after
type instance AttributeList DBusObjectManager = DBusObjectManagerAttributeList
type DBusObjectManagerAttributeList = ('[ ] :: [(Symbol, *)])
data DBusObjectManagerInterfaceAddedSignalInfo
instance SignalInfo DBusObjectManagerInterfaceAddedSignalInfo where
type HaskellCallbackType DBusObjectManagerInterfaceAddedSignalInfo = DBusObjectManagerInterfaceAddedCallback
connectSignal _ = connectDBusObjectManagerInterfaceAdded
data DBusObjectManagerInterfaceRemovedSignalInfo
instance SignalInfo DBusObjectManagerInterfaceRemovedSignalInfo where
type HaskellCallbackType DBusObjectManagerInterfaceRemovedSignalInfo = DBusObjectManagerInterfaceRemovedCallback
connectSignal _ = connectDBusObjectManagerInterfaceRemoved
data DBusObjectManagerObjectAddedSignalInfo
instance SignalInfo DBusObjectManagerObjectAddedSignalInfo where
type HaskellCallbackType DBusObjectManagerObjectAddedSignalInfo = DBusObjectManagerObjectAddedCallback
connectSignal _ = connectDBusObjectManagerObjectAdded
data DBusObjectManagerObjectRemovedSignalInfo
instance SignalInfo DBusObjectManagerObjectRemovedSignalInfo where
type HaskellCallbackType DBusObjectManagerObjectRemovedSignalInfo = DBusObjectManagerObjectRemovedCallback
connectSignal _ = connectDBusObjectManagerObjectRemoved
type instance SignalList DBusObjectManager = DBusObjectManagerSignalList
type DBusObjectManagerSignalList = ('[ '("interface-added", DBusObjectManagerInterfaceAddedSignalInfo), '("interface-removed", DBusObjectManagerInterfaceRemovedSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("object-added", DBusObjectManagerObjectAddedSignalInfo), '("object-removed", DBusObjectManagerObjectRemovedSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "g_dbus_object_manager_get_type"
c_g_dbus_object_manager_get_type :: IO GType
type instance ParentTypes DBusObjectManager = DBusObjectManagerParentTypes
type DBusObjectManagerParentTypes = '[GObject.Object]
instance GObject DBusObjectManager where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_g_dbus_object_manager_get_type
class GObject o => DBusObjectManagerK o
instance (GObject o, IsDescendantOf DBusObjectManager o) => DBusObjectManagerK o
toDBusObjectManager :: DBusObjectManagerK o => o -> IO DBusObjectManager
toDBusObjectManager = unsafeCastTo DBusObjectManager
foreign import ccall "g_dbus_object_manager_get_interface" g_dbus_object_manager_get_interface ::
Ptr DBusObjectManager ->
CString ->
CString ->
IO (Ptr DBusInterface)
dBusObjectManagerGetInterface ::
(MonadIO m, DBusObjectManagerK a) =>
a ->
T.Text ->
T.Text ->
m DBusInterface
dBusObjectManagerGetInterface _obj object_path interface_name = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
object_path' <- textToCString object_path
interface_name' <- textToCString interface_name
result <- g_dbus_object_manager_get_interface _obj' object_path' interface_name'
checkUnexpectedReturnNULL "g_dbus_object_manager_get_interface" result
result' <- (wrapObject DBusInterface) result
touchManagedPtr _obj
freeMem object_path'
freeMem interface_name'
return result'
foreign import ccall "g_dbus_object_manager_get_object" g_dbus_object_manager_get_object ::
Ptr DBusObjectManager ->
CString ->
IO (Ptr DBusObject)
dBusObjectManagerGetObject ::
(MonadIO m, DBusObjectManagerK a) =>
a ->
T.Text ->
m DBusObject
dBusObjectManagerGetObject _obj object_path = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
object_path' <- textToCString object_path
result <- g_dbus_object_manager_get_object _obj' object_path'
checkUnexpectedReturnNULL "g_dbus_object_manager_get_object" result
result' <- (wrapObject DBusObject) result
touchManagedPtr _obj
freeMem object_path'
return result'
foreign import ccall "g_dbus_object_manager_get_object_path" g_dbus_object_manager_get_object_path ::
Ptr DBusObjectManager ->
IO CString
dBusObjectManagerGetObjectPath ::
(MonadIO m, DBusObjectManagerK a) =>
a ->
m T.Text
dBusObjectManagerGetObjectPath _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_dbus_object_manager_get_object_path _obj'
checkUnexpectedReturnNULL "g_dbus_object_manager_get_object_path" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "g_dbus_object_manager_get_objects" g_dbus_object_manager_get_objects ::
Ptr DBusObjectManager ->
IO (Ptr (GList (Ptr DBusObject)))
dBusObjectManagerGetObjects ::
(MonadIO m, DBusObjectManagerK a) =>
a ->
m [DBusObject]
dBusObjectManagerGetObjects _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_dbus_object_manager_get_objects _obj'
checkUnexpectedReturnNULL "g_dbus_object_manager_get_objects" result
result' <- unpackGList result
result'' <- mapM (wrapObject DBusObject) result'
g_list_free result
touchManagedPtr _obj
return result''