#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Interfaces.DBusInterface
(
DBusInterface(..) ,
noDBusInterface ,
IsDBusInterface ,
toDBusInterface ,
#if ENABLE_OVERLOADING
DBusInterfaceGetInfoMethodInfo ,
#endif
dBusInterfaceGetInfo ,
#if ENABLE_OVERLOADING
DBusInterfaceGetObjectMethodInfo ,
#endif
dBusInterfaceGetObject ,
#if ENABLE_OVERLOADING
DBusInterfaceSetObjectMethodInfo ,
#endif
dBusInterfaceSetObject ,
) 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.DBusObject as Gio.DBusObject
import {-# SOURCE #-} qualified GI.Gio.Structs.DBusInterfaceInfo as Gio.DBusInterfaceInfo
newtype DBusInterface = DBusInterface (ManagedPtr DBusInterface)
noDBusInterface :: Maybe DBusInterface
noDBusInterface = Nothing
#if ENABLE_OVERLOADING
type instance O.SignalList DBusInterface = DBusInterfaceSignalList
type DBusInterfaceSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_interface_get_type"
c_g_dbus_interface_get_type :: IO GType
instance GObject DBusInterface where
gobjectType = c_g_dbus_interface_get_type
class (GObject o, O.IsDescendantOf DBusInterface o) => IsDBusInterface o
instance (GObject o, O.IsDescendantOf DBusInterface o) => IsDBusInterface o
instance O.HasParentTypes DBusInterface
type instance O.ParentTypes DBusInterface = '[GObject.Object.Object]
toDBusInterface :: (MonadIO m, IsDBusInterface o) => o -> m DBusInterface
toDBusInterface = liftIO . unsafeCastTo DBusInterface
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusInterface
type instance O.AttributeList DBusInterface = DBusInterfaceAttributeList
type DBusInterfaceAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type family ResolveDBusInterfaceMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusInterfaceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDBusInterfaceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDBusInterfaceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDBusInterfaceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDBusInterfaceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDBusInterfaceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDBusInterfaceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDBusInterfaceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDBusInterfaceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDBusInterfaceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDBusInterfaceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDBusInterfaceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDBusInterfaceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDBusInterfaceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDBusInterfaceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDBusInterfaceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDBusInterfaceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDBusInterfaceMethod "getInfo" o = DBusInterfaceGetInfoMethodInfo
ResolveDBusInterfaceMethod "getObject" o = DBusInterfaceGetObjectMethodInfo
ResolveDBusInterfaceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDBusInterfaceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDBusInterfaceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDBusInterfaceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDBusInterfaceMethod "setObject" o = DBusInterfaceSetObjectMethodInfo
ResolveDBusInterfaceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDBusInterfaceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusInterfaceMethod t DBusInterface, O.MethodInfo info DBusInterface p) => OL.IsLabel t (DBusInterface -> 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_interface_dup_object" g_dbus_interface_dup_object ::
Ptr DBusInterface ->
IO (Ptr Gio.DBusObject.DBusObject)
dBusInterfaceGetObject ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusInterface a) =>
a
-> m Gio.DBusObject.DBusObject
dBusInterfaceGetObject interface_ = liftIO $ do
interface_' <- unsafeManagedPtrCastPtr interface_
result <- g_dbus_interface_dup_object interface_'
checkUnexpectedReturnNULL "dBusInterfaceGetObject" result
result' <- (wrapObject Gio.DBusObject.DBusObject) result
touchManagedPtr interface_
return result'
#if ENABLE_OVERLOADING
data DBusInterfaceGetObjectMethodInfo
instance (signature ~ (m Gio.DBusObject.DBusObject), MonadIO m, IsDBusInterface a) => O.MethodInfo DBusInterfaceGetObjectMethodInfo a signature where
overloadedMethod _ = dBusInterfaceGetObject
#endif
foreign import ccall "g_dbus_interface_get_info" g_dbus_interface_get_info ::
Ptr DBusInterface ->
IO (Ptr Gio.DBusInterfaceInfo.DBusInterfaceInfo)
dBusInterfaceGetInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusInterface a) =>
a
-> m Gio.DBusInterfaceInfo.DBusInterfaceInfo
dBusInterfaceGetInfo interface_ = liftIO $ do
interface_' <- unsafeManagedPtrCastPtr interface_
result <- g_dbus_interface_get_info interface_'
checkUnexpectedReturnNULL "dBusInterfaceGetInfo" result
result' <- (newBoxed Gio.DBusInterfaceInfo.DBusInterfaceInfo) result
touchManagedPtr interface_
return result'
#if ENABLE_OVERLOADING
data DBusInterfaceGetInfoMethodInfo
instance (signature ~ (m Gio.DBusInterfaceInfo.DBusInterfaceInfo), MonadIO m, IsDBusInterface a) => O.MethodInfo DBusInterfaceGetInfoMethodInfo a signature where
overloadedMethod _ = dBusInterfaceGetInfo
#endif
foreign import ccall "g_dbus_interface_set_object" g_dbus_interface_set_object ::
Ptr DBusInterface ->
Ptr Gio.DBusObject.DBusObject ->
IO ()
dBusInterfaceSetObject ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusInterface a, Gio.DBusObject.IsDBusObject b) =>
a
-> Maybe (b)
-> m ()
dBusInterfaceSetObject interface_ object = liftIO $ do
interface_' <- unsafeManagedPtrCastPtr interface_
maybeObject <- case object of
Nothing -> return nullPtr
Just jObject -> do
jObject' <- unsafeManagedPtrCastPtr jObject
return jObject'
g_dbus_interface_set_object interface_' maybeObject
touchManagedPtr interface_
whenJust object touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data DBusInterfaceSetObjectMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsDBusInterface a, Gio.DBusObject.IsDBusObject b) => O.MethodInfo DBusInterfaceSetObjectMethodInfo a signature where
overloadedMethod _ = dBusInterfaceSetObject
#endif