#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.DBusObjectProxy
(
DBusObjectProxy(..) ,
IsDBusObjectProxy ,
toDBusObjectProxy ,
noDBusObjectProxy ,
#if ENABLE_OVERLOADING
DBusObjectProxyGetConnectionMethodInfo ,
#endif
dBusObjectProxyGetConnection ,
dBusObjectProxyNew ,
#if ENABLE_OVERLOADING
DBusObjectProxyGConnectionPropertyInfo ,
#endif
constructDBusObjectProxyGConnection ,
#if ENABLE_OVERLOADING
dBusObjectProxyGConnection ,
#endif
getDBusObjectProxyGConnection ,
#if ENABLE_OVERLOADING
DBusObjectProxyGObjectPathPropertyInfo ,
#endif
constructDBusObjectProxyGObjectPath ,
#if ENABLE_OVERLOADING
dBusObjectProxyGObjectPath ,
#endif
getDBusObjectProxyGObjectPath ,
) 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.Objects.DBusConnection as Gio.DBusConnection
newtype DBusObjectProxy = DBusObjectProxy (ManagedPtr DBusObjectProxy)
foreign import ccall "g_dbus_object_proxy_get_type"
c_g_dbus_object_proxy_get_type :: IO GType
instance GObject DBusObjectProxy where
gobjectType = c_g_dbus_object_proxy_get_type
class (GObject o, O.IsDescendantOf DBusObjectProxy o) => IsDBusObjectProxy o
instance (GObject o, O.IsDescendantOf DBusObjectProxy o) => IsDBusObjectProxy o
instance O.HasParentTypes DBusObjectProxy
type instance O.ParentTypes DBusObjectProxy = '[GObject.Object.Object, Gio.DBusObject.DBusObject]
toDBusObjectProxy :: (MonadIO m, IsDBusObjectProxy o) => o -> m DBusObjectProxy
toDBusObjectProxy = liftIO . unsafeCastTo DBusObjectProxy
noDBusObjectProxy :: Maybe DBusObjectProxy
noDBusObjectProxy = Nothing
#if ENABLE_OVERLOADING
type family ResolveDBusObjectProxyMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusObjectProxyMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDBusObjectProxyMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDBusObjectProxyMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDBusObjectProxyMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDBusObjectProxyMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDBusObjectProxyMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDBusObjectProxyMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDBusObjectProxyMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDBusObjectProxyMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDBusObjectProxyMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDBusObjectProxyMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDBusObjectProxyMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDBusObjectProxyMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDBusObjectProxyMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDBusObjectProxyMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDBusObjectProxyMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDBusObjectProxyMethod "getConnection" o = DBusObjectProxyGetConnectionMethodInfo
ResolveDBusObjectProxyMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDBusObjectProxyMethod "getInterface" o = Gio.DBusObject.DBusObjectGetInterfaceMethodInfo
ResolveDBusObjectProxyMethod "getInterfaces" o = Gio.DBusObject.DBusObjectGetInterfacesMethodInfo
ResolveDBusObjectProxyMethod "getObjectPath" o = Gio.DBusObject.DBusObjectGetObjectPathMethodInfo
ResolveDBusObjectProxyMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDBusObjectProxyMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDBusObjectProxyMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDBusObjectProxyMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDBusObjectProxyMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDBusObjectProxyMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusObjectProxyMethod t DBusObjectProxy, O.MethodInfo info DBusObjectProxy p) => OL.IsLabel t (DBusObjectProxy -> 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
getDBusObjectProxyGConnection :: (MonadIO m, IsDBusObjectProxy o) => o -> m (Maybe Gio.DBusConnection.DBusConnection)
getDBusObjectProxyGConnection obj = liftIO $ B.Properties.getObjectPropertyObject obj "g-connection" Gio.DBusConnection.DBusConnection
constructDBusObjectProxyGConnection :: (IsDBusObjectProxy o, Gio.DBusConnection.IsDBusConnection a) => a -> IO (GValueConstruct o)
constructDBusObjectProxyGConnection val = B.Properties.constructObjectPropertyObject "g-connection" (Just val)
#if ENABLE_OVERLOADING
data DBusObjectProxyGConnectionPropertyInfo
instance AttrInfo DBusObjectProxyGConnectionPropertyInfo where
type AttrAllowedOps DBusObjectProxyGConnectionPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusObjectProxyGConnectionPropertyInfo = Gio.DBusConnection.IsDBusConnection
type AttrBaseTypeConstraint DBusObjectProxyGConnectionPropertyInfo = IsDBusObjectProxy
type AttrGetType DBusObjectProxyGConnectionPropertyInfo = (Maybe Gio.DBusConnection.DBusConnection)
type AttrLabel DBusObjectProxyGConnectionPropertyInfo = "g-connection"
type AttrOrigin DBusObjectProxyGConnectionPropertyInfo = DBusObjectProxy
attrGet _ = getDBusObjectProxyGConnection
attrSet _ = undefined
attrConstruct _ = constructDBusObjectProxyGConnection
attrClear _ = undefined
#endif
getDBusObjectProxyGObjectPath :: (MonadIO m, IsDBusObjectProxy o) => o -> m (Maybe T.Text)
getDBusObjectProxyGObjectPath obj = liftIO $ B.Properties.getObjectPropertyString obj "g-object-path"
constructDBusObjectProxyGObjectPath :: (IsDBusObjectProxy o) => T.Text -> IO (GValueConstruct o)
constructDBusObjectProxyGObjectPath val = B.Properties.constructObjectPropertyString "g-object-path" (Just val)
#if ENABLE_OVERLOADING
data DBusObjectProxyGObjectPathPropertyInfo
instance AttrInfo DBusObjectProxyGObjectPathPropertyInfo where
type AttrAllowedOps DBusObjectProxyGObjectPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusObjectProxyGObjectPathPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint DBusObjectProxyGObjectPathPropertyInfo = IsDBusObjectProxy
type AttrGetType DBusObjectProxyGObjectPathPropertyInfo = (Maybe T.Text)
type AttrLabel DBusObjectProxyGObjectPathPropertyInfo = "g-object-path"
type AttrOrigin DBusObjectProxyGObjectPathPropertyInfo = DBusObjectProxy
attrGet _ = getDBusObjectProxyGObjectPath
attrSet _ = undefined
attrConstruct _ = constructDBusObjectProxyGObjectPath
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusObjectProxy
type instance O.AttributeList DBusObjectProxy = DBusObjectProxyAttributeList
type DBusObjectProxyAttributeList = ('[ '("gConnection", DBusObjectProxyGConnectionPropertyInfo), '("gObjectPath", DBusObjectProxyGObjectPathPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
dBusObjectProxyGConnection :: AttrLabelProxy "gConnection"
dBusObjectProxyGConnection = AttrLabelProxy
dBusObjectProxyGObjectPath :: AttrLabelProxy "gObjectPath"
dBusObjectProxyGObjectPath = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList DBusObjectProxy = DBusObjectProxySignalList
type DBusObjectProxySignalList = ('[ '("interfaceAdded", Gio.DBusObject.DBusObjectInterfaceAddedSignalInfo), '("interfaceRemoved", Gio.DBusObject.DBusObjectInterfaceRemovedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_object_proxy_new" g_dbus_object_proxy_new ::
Ptr Gio.DBusConnection.DBusConnection ->
CString ->
IO (Ptr DBusObjectProxy)
dBusObjectProxyNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
a
-> T.Text
-> m DBusObjectProxy
dBusObjectProxyNew connection objectPath = liftIO $ do
connection' <- unsafeManagedPtrCastPtr connection
objectPath' <- textToCString objectPath
result <- g_dbus_object_proxy_new connection' objectPath'
checkUnexpectedReturnNULL "dBusObjectProxyNew" result
result' <- (wrapObject DBusObjectProxy) result
touchManagedPtr connection
freeMem objectPath'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_dbus_object_proxy_get_connection" g_dbus_object_proxy_get_connection ::
Ptr DBusObjectProxy ->
IO (Ptr Gio.DBusConnection.DBusConnection)
dBusObjectProxyGetConnection ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusObjectProxy a) =>
a
-> m Gio.DBusConnection.DBusConnection
dBusObjectProxyGetConnection proxy = liftIO $ do
proxy' <- unsafeManagedPtrCastPtr proxy
result <- g_dbus_object_proxy_get_connection proxy'
checkUnexpectedReturnNULL "dBusObjectProxyGetConnection" result
result' <- (newObject Gio.DBusConnection.DBusConnection) result
touchManagedPtr proxy
return result'
#if ENABLE_OVERLOADING
data DBusObjectProxyGetConnectionMethodInfo
instance (signature ~ (m Gio.DBusConnection.DBusConnection), MonadIO m, IsDBusObjectProxy a) => O.MethodInfo DBusObjectProxyGetConnectionMethodInfo a signature where
overloadedMethod _ = dBusObjectProxyGetConnection
#endif