#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Interfaces.DBusObject
(
DBusObject(..) ,
noDBusObject ,
IsDBusObject ,
toDBusObject ,
#if ENABLE_OVERLOADING
DBusObjectGetInterfaceMethodInfo ,
#endif
dBusObjectGetInterface ,
#if ENABLE_OVERLOADING
DBusObjectGetInterfacesMethodInfo ,
#endif
dBusObjectGetInterfaces ,
#if ENABLE_OVERLOADING
DBusObjectGetObjectPathMethodInfo ,
#endif
dBusObjectGetObjectPath ,
C_DBusObjectInterfaceAddedCallback ,
DBusObjectInterfaceAddedCallback ,
#if ENABLE_OVERLOADING
DBusObjectInterfaceAddedSignalInfo ,
#endif
afterDBusObjectInterfaceAdded ,
genClosure_DBusObjectInterfaceAdded ,
mk_DBusObjectInterfaceAddedCallback ,
noDBusObjectInterfaceAddedCallback ,
onDBusObjectInterfaceAdded ,
wrap_DBusObjectInterfaceAddedCallback ,
C_DBusObjectInterfaceRemovedCallback ,
DBusObjectInterfaceRemovedCallback ,
#if ENABLE_OVERLOADING
DBusObjectInterfaceRemovedSignalInfo ,
#endif
afterDBusObjectInterfaceRemoved ,
genClosure_DBusObjectInterfaceRemoved ,
mk_DBusObjectInterfaceRemovedCallback ,
noDBusObjectInterfaceRemovedCallback ,
onDBusObjectInterfaceRemoved ,
wrap_DBusObjectInterfaceRemovedCallback ,
) 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.Gio.Interfaces.DBusInterface as Gio.DBusInterface
newtype DBusObject = DBusObject (ManagedPtr DBusObject)
noDBusObject :: Maybe DBusObject
noDBusObject = Nothing
type DBusObjectInterfaceAddedCallback =
Gio.DBusInterface.DBusInterface
-> IO ()
noDBusObjectInterfaceAddedCallback :: Maybe DBusObjectInterfaceAddedCallback
noDBusObjectInterfaceAddedCallback = Nothing
type C_DBusObjectInterfaceAddedCallback =
Ptr () ->
Ptr Gio.DBusInterface.DBusInterface ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DBusObjectInterfaceAddedCallback :: C_DBusObjectInterfaceAddedCallback -> IO (FunPtr C_DBusObjectInterfaceAddedCallback)
genClosure_DBusObjectInterfaceAdded :: MonadIO m => DBusObjectInterfaceAddedCallback -> m (GClosure C_DBusObjectInterfaceAddedCallback)
genClosure_DBusObjectInterfaceAdded cb = liftIO $ do
let cb' = wrap_DBusObjectInterfaceAddedCallback cb
mk_DBusObjectInterfaceAddedCallback cb' >>= B.GClosure.newGClosure
wrap_DBusObjectInterfaceAddedCallback ::
DBusObjectInterfaceAddedCallback ->
C_DBusObjectInterfaceAddedCallback
wrap_DBusObjectInterfaceAddedCallback _cb _ interface _ = do
interface' <- (newObject Gio.DBusInterface.DBusInterface) interface
_cb interface'
onDBusObjectInterfaceAdded :: (IsDBusObject a, MonadIO m) => a -> DBusObjectInterfaceAddedCallback -> m SignalHandlerId
onDBusObjectInterfaceAdded obj cb = liftIO $ do
let cb' = wrap_DBusObjectInterfaceAddedCallback cb
cb'' <- mk_DBusObjectInterfaceAddedCallback cb'
connectSignalFunPtr obj "interface-added" cb'' SignalConnectBefore
afterDBusObjectInterfaceAdded :: (IsDBusObject a, MonadIO m) => a -> DBusObjectInterfaceAddedCallback -> m SignalHandlerId
afterDBusObjectInterfaceAdded obj cb = liftIO $ do
let cb' = wrap_DBusObjectInterfaceAddedCallback cb
cb'' <- mk_DBusObjectInterfaceAddedCallback cb'
connectSignalFunPtr obj "interface-added" cb'' SignalConnectAfter
type DBusObjectInterfaceRemovedCallback =
Gio.DBusInterface.DBusInterface
-> IO ()
noDBusObjectInterfaceRemovedCallback :: Maybe DBusObjectInterfaceRemovedCallback
noDBusObjectInterfaceRemovedCallback = Nothing
type C_DBusObjectInterfaceRemovedCallback =
Ptr () ->
Ptr Gio.DBusInterface.DBusInterface ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DBusObjectInterfaceRemovedCallback :: C_DBusObjectInterfaceRemovedCallback -> IO (FunPtr C_DBusObjectInterfaceRemovedCallback)
genClosure_DBusObjectInterfaceRemoved :: MonadIO m => DBusObjectInterfaceRemovedCallback -> m (GClosure C_DBusObjectInterfaceRemovedCallback)
genClosure_DBusObjectInterfaceRemoved cb = liftIO $ do
let cb' = wrap_DBusObjectInterfaceRemovedCallback cb
mk_DBusObjectInterfaceRemovedCallback cb' >>= B.GClosure.newGClosure
wrap_DBusObjectInterfaceRemovedCallback ::
DBusObjectInterfaceRemovedCallback ->
C_DBusObjectInterfaceRemovedCallback
wrap_DBusObjectInterfaceRemovedCallback _cb _ interface _ = do
interface' <- (newObject Gio.DBusInterface.DBusInterface) interface
_cb interface'
onDBusObjectInterfaceRemoved :: (IsDBusObject a, MonadIO m) => a -> DBusObjectInterfaceRemovedCallback -> m SignalHandlerId
onDBusObjectInterfaceRemoved obj cb = liftIO $ do
let cb' = wrap_DBusObjectInterfaceRemovedCallback cb
cb'' <- mk_DBusObjectInterfaceRemovedCallback cb'
connectSignalFunPtr obj "interface-removed" cb'' SignalConnectBefore
afterDBusObjectInterfaceRemoved :: (IsDBusObject a, MonadIO m) => a -> DBusObjectInterfaceRemovedCallback -> m SignalHandlerId
afterDBusObjectInterfaceRemoved obj cb = liftIO $ do
let cb' = wrap_DBusObjectInterfaceRemovedCallback cb
cb'' <- mk_DBusObjectInterfaceRemovedCallback cb'
connectSignalFunPtr obj "interface-removed" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
data DBusObjectInterfaceAddedSignalInfo
instance SignalInfo DBusObjectInterfaceAddedSignalInfo where
type HaskellCallbackType DBusObjectInterfaceAddedSignalInfo = DBusObjectInterfaceAddedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DBusObjectInterfaceAddedCallback cb
cb'' <- mk_DBusObjectInterfaceAddedCallback cb'
connectSignalFunPtr obj "interface-added" cb'' connectMode
data DBusObjectInterfaceRemovedSignalInfo
instance SignalInfo DBusObjectInterfaceRemovedSignalInfo where
type HaskellCallbackType DBusObjectInterfaceRemovedSignalInfo = DBusObjectInterfaceRemovedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DBusObjectInterfaceRemovedCallback cb
cb'' <- mk_DBusObjectInterfaceRemovedCallback cb'
connectSignalFunPtr obj "interface-removed" cb'' connectMode
type instance O.SignalList DBusObject = DBusObjectSignalList
type DBusObjectSignalList = ('[ '("interfaceAdded", DBusObjectInterfaceAddedSignalInfo), '("interfaceRemoved", DBusObjectInterfaceRemovedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_object_get_type"
c_g_dbus_object_get_type :: IO GType
instance GObject DBusObject where
gobjectType = c_g_dbus_object_get_type
class (GObject o, O.IsDescendantOf DBusObject o) => IsDBusObject o
instance (GObject o, O.IsDescendantOf DBusObject o) => IsDBusObject o
instance O.HasParentTypes DBusObject
type instance O.ParentTypes DBusObject = '[GObject.Object.Object]
toDBusObject :: (MonadIO m, IsDBusObject o) => o -> m DBusObject
toDBusObject = liftIO . unsafeCastTo DBusObject
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusObject
type instance O.AttributeList DBusObject = DBusObjectAttributeList
type DBusObjectAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type family ResolveDBusObjectMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusObjectMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDBusObjectMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDBusObjectMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDBusObjectMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDBusObjectMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDBusObjectMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDBusObjectMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDBusObjectMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDBusObjectMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDBusObjectMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDBusObjectMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDBusObjectMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDBusObjectMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDBusObjectMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDBusObjectMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDBusObjectMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDBusObjectMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDBusObjectMethod "getInterface" o = DBusObjectGetInterfaceMethodInfo
ResolveDBusObjectMethod "getInterfaces" o = DBusObjectGetInterfacesMethodInfo
ResolveDBusObjectMethod "getObjectPath" o = DBusObjectGetObjectPathMethodInfo
ResolveDBusObjectMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDBusObjectMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDBusObjectMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDBusObjectMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDBusObjectMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDBusObjectMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusObjectMethod t DBusObject, O.MethodInfo info DBusObject p) => OL.IsLabel t (DBusObject -> 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
foreign import ccall "g_dbus_object_get_interface" g_dbus_object_get_interface ::
Ptr DBusObject ->
CString ->
IO (Ptr Gio.DBusInterface.DBusInterface)
dBusObjectGetInterface ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusObject a) =>
a
-> T.Text
-> m Gio.DBusInterface.DBusInterface
dBusObjectGetInterface object interfaceName = liftIO $ do
object' <- unsafeManagedPtrCastPtr object
interfaceName' <- textToCString interfaceName
result <- g_dbus_object_get_interface object' interfaceName'
checkUnexpectedReturnNULL "dBusObjectGetInterface" result
result' <- (wrapObject Gio.DBusInterface.DBusInterface) result
touchManagedPtr object
freeMem interfaceName'
return result'
#if ENABLE_OVERLOADING
data DBusObjectGetInterfaceMethodInfo
instance (signature ~ (T.Text -> m Gio.DBusInterface.DBusInterface), MonadIO m, IsDBusObject a) => O.MethodInfo DBusObjectGetInterfaceMethodInfo a signature where
overloadedMethod _ = dBusObjectGetInterface
#endif
foreign import ccall "g_dbus_object_get_interfaces" g_dbus_object_get_interfaces ::
Ptr DBusObject ->
IO (Ptr (GList (Ptr Gio.DBusInterface.DBusInterface)))
dBusObjectGetInterfaces ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusObject a) =>
a
-> m [Gio.DBusInterface.DBusInterface]
dBusObjectGetInterfaces object = liftIO $ do
object' <- unsafeManagedPtrCastPtr object
result <- g_dbus_object_get_interfaces object'
result' <- unpackGList result
result'' <- mapM (wrapObject Gio.DBusInterface.DBusInterface) result'
g_list_free result
touchManagedPtr object
return result''
#if ENABLE_OVERLOADING
data DBusObjectGetInterfacesMethodInfo
instance (signature ~ (m [Gio.DBusInterface.DBusInterface]), MonadIO m, IsDBusObject a) => O.MethodInfo DBusObjectGetInterfacesMethodInfo a signature where
overloadedMethod _ = dBusObjectGetInterfaces
#endif
foreign import ccall "g_dbus_object_get_object_path" g_dbus_object_get_object_path ::
Ptr DBusObject ->
IO CString
dBusObjectGetObjectPath ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusObject a) =>
a
-> m T.Text
dBusObjectGetObjectPath object = liftIO $ do
object' <- unsafeManagedPtrCastPtr object
result <- g_dbus_object_get_object_path object'
checkUnexpectedReturnNULL "dBusObjectGetObjectPath" result
result' <- cstringToText result
touchManagedPtr object
return result'
#if ENABLE_OVERLOADING
data DBusObjectGetObjectPathMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDBusObject a) => O.MethodInfo DBusObjectGetObjectPathMethodInfo a signature where
overloadedMethod _ = dBusObjectGetObjectPath
#endif