{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GObject.Objects.Binding
(
Binding(..) ,
IsBinding ,
toBinding ,
#if defined(ENABLE_OVERLOADING)
ResolveBindingMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BindingGetFlagsMethodInfo ,
#endif
bindingGetFlags ,
#if defined(ENABLE_OVERLOADING)
BindingGetSourceMethodInfo ,
#endif
bindingGetSource ,
#if defined(ENABLE_OVERLOADING)
BindingGetSourcePropertyMethodInfo ,
#endif
bindingGetSourceProperty ,
#if defined(ENABLE_OVERLOADING)
BindingGetTargetMethodInfo ,
#endif
bindingGetTarget ,
#if defined(ENABLE_OVERLOADING)
BindingGetTargetPropertyMethodInfo ,
#endif
bindingGetTargetProperty ,
#if defined(ENABLE_OVERLOADING)
BindingUnbindMethodInfo ,
#endif
bindingUnbind ,
#if defined(ENABLE_OVERLOADING)
BindingFlagsPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
bindingFlags ,
#endif
constructBindingFlags ,
getBindingFlags ,
#if defined(ENABLE_OVERLOADING)
BindingSourcePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
bindingSource ,
#endif
constructBindingSource ,
getBindingSource ,
#if defined(ENABLE_OVERLOADING)
BindingSourcePropertyPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
bindingSourceProperty ,
#endif
constructBindingSourceProperty ,
getBindingSourceProperty ,
#if defined(ENABLE_OVERLOADING)
BindingTargetPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
bindingTarget ,
#endif
constructBindingTarget ,
getBindingTarget ,
#if defined(ENABLE_OVERLOADING)
BindingTargetPropertyPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
bindingTargetProperty ,
#endif
constructBindingTargetProperty ,
getBindingTargetProperty ,
) 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.GArray as B.GArray
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.GObject.Flags as GObject.Flags
import {-# SOURCE #-} qualified GI.GObject.Objects.Object as GObject.Object
newtype Binding = Binding (SP.ManagedPtr Binding)
deriving (Binding -> Binding -> Bool
(Binding -> Binding -> Bool)
-> (Binding -> Binding -> Bool) -> Eq Binding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Binding -> Binding -> Bool
$c/= :: Binding -> Binding -> Bool
== :: Binding -> Binding -> Bool
$c== :: Binding -> Binding -> Bool
Eq)
instance SP.ManagedPtrNewtype Binding where
toManagedPtr :: Binding -> ManagedPtr Binding
toManagedPtr (Binding ManagedPtr Binding
p) = ManagedPtr Binding
p
foreign import ccall "g_binding_get_type"
c_g_binding_get_type :: IO B.Types.GType
instance B.Types.TypedObject Binding where
glibType :: IO GType
glibType = IO GType
c_g_binding_get_type
instance B.Types.GObject Binding
instance B.GValue.IsGValue Binding where
toGValue :: Binding -> IO GValue
toGValue Binding
o = do
GType
gtype <- IO GType
c_g_binding_get_type
Binding -> (Ptr Binding -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Binding
o (GType
-> (GValue -> Ptr Binding -> IO ()) -> Ptr Binding -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Binding -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Binding
fromGValue GValue
gv = do
Ptr Binding
ptr <- GValue -> IO (Ptr Binding)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Binding)
(ManagedPtr Binding -> Binding) -> Ptr Binding -> IO Binding
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Binding -> Binding
Binding Ptr Binding
ptr
class (SP.GObject o, O.IsDescendantOf Binding o) => IsBinding o
instance (SP.GObject o, O.IsDescendantOf Binding o) => IsBinding o
instance O.HasParentTypes Binding
type instance O.ParentTypes Binding = '[GObject.Object.Object]
toBinding :: (MonadIO m, IsBinding o) => o -> m Binding
toBinding :: o -> m Binding
toBinding = IO Binding -> m Binding
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Binding -> m Binding) -> (o -> IO Binding) -> o -> m Binding
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Binding -> Binding) -> o -> IO Binding
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Binding -> Binding
Binding
#if defined(ENABLE_OVERLOADING)
type family ResolveBindingMethod (t :: Symbol) (o :: *) :: * where
ResolveBindingMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBindingMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBindingMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBindingMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBindingMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBindingMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBindingMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBindingMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBindingMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveBindingMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBindingMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBindingMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBindingMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBindingMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBindingMethod "unbind" o = BindingUnbindMethodInfo
ResolveBindingMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveBindingMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBindingMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBindingMethod "getFlags" o = BindingGetFlagsMethodInfo
ResolveBindingMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBindingMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBindingMethod "getSource" o = BindingGetSourceMethodInfo
ResolveBindingMethod "getSourceProperty" o = BindingGetSourcePropertyMethodInfo
ResolveBindingMethod "getTarget" o = BindingGetTargetMethodInfo
ResolveBindingMethod "getTargetProperty" o = BindingGetTargetPropertyMethodInfo
ResolveBindingMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBindingMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveBindingMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBindingMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBindingMethod t Binding, O.MethodInfo info Binding p) => OL.IsLabel t (Binding -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getBindingFlags :: (MonadIO m, IsBinding o) => o -> m [GObject.Flags.BindingFlags]
getBindingFlags :: o -> m [BindingFlags]
getBindingFlags o
obj = IO [BindingFlags] -> m [BindingFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [BindingFlags] -> m [BindingFlags])
-> IO [BindingFlags] -> m [BindingFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [BindingFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"flags"
constructBindingFlags :: (IsBinding o, MIO.MonadIO m) => [GObject.Flags.BindingFlags] -> m (GValueConstruct o)
constructBindingFlags :: [BindingFlags] -> m (GValueConstruct o)
constructBindingFlags [BindingFlags]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> [BindingFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"flags" [BindingFlags]
val
#if defined(ENABLE_OVERLOADING)
data BindingFlagsPropertyInfo
instance AttrInfo BindingFlagsPropertyInfo where
type AttrAllowedOps BindingFlagsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint BindingFlagsPropertyInfo = IsBinding
type AttrSetTypeConstraint BindingFlagsPropertyInfo = (~) [GObject.Flags.BindingFlags]
type AttrTransferTypeConstraint BindingFlagsPropertyInfo = (~) [GObject.Flags.BindingFlags]
type AttrTransferType BindingFlagsPropertyInfo = [GObject.Flags.BindingFlags]
type AttrGetType BindingFlagsPropertyInfo = [GObject.Flags.BindingFlags]
type AttrLabel BindingFlagsPropertyInfo = "flags"
type AttrOrigin BindingFlagsPropertyInfo = Binding
attrGet = getBindingFlags
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructBindingFlags
attrClear = undefined
#endif
getBindingSource :: (MonadIO m, IsBinding o) => o -> m GObject.Object.Object
getBindingSource :: o -> m Object
getBindingSource o
obj = 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
$ Text -> IO (Maybe Object) -> IO Object
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getBindingSource" (IO (Maybe Object) -> IO Object) -> IO (Maybe Object) -> IO Object
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Object -> Object) -> IO (Maybe Object)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"source" ManagedPtr Object -> Object
GObject.Object.Object
constructBindingSource :: (IsBinding o, MIO.MonadIO m, GObject.Object.IsObject a) => a -> m (GValueConstruct o)
constructBindingSource :: a -> m (GValueConstruct o)
constructBindingSource a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"source" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data BindingSourcePropertyInfo
instance AttrInfo BindingSourcePropertyInfo where
type AttrAllowedOps BindingSourcePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint BindingSourcePropertyInfo = IsBinding
type AttrSetTypeConstraint BindingSourcePropertyInfo = GObject.Object.IsObject
type AttrTransferTypeConstraint BindingSourcePropertyInfo = GObject.Object.IsObject
type AttrTransferType BindingSourcePropertyInfo = GObject.Object.Object
type AttrGetType BindingSourcePropertyInfo = GObject.Object.Object
type AttrLabel BindingSourcePropertyInfo = "source"
type AttrOrigin BindingSourcePropertyInfo = Binding
attrGet = getBindingSource
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo GObject.Object.Object v
attrConstruct = constructBindingSource
attrClear = undefined
#endif
getBindingSourceProperty :: (MonadIO m, IsBinding o) => o -> m T.Text
getBindingSourceProperty :: o -> m Text
getBindingSourceProperty o
obj = 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
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getBindingSourceProperty" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"source-property"
constructBindingSourceProperty :: (IsBinding o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructBindingSourceProperty :: Text -> m (GValueConstruct o)
constructBindingSourceProperty Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"source-property" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data BindingSourcePropertyPropertyInfo
instance AttrInfo BindingSourcePropertyPropertyInfo where
type AttrAllowedOps BindingSourcePropertyPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint BindingSourcePropertyPropertyInfo = IsBinding
type AttrSetTypeConstraint BindingSourcePropertyPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint BindingSourcePropertyPropertyInfo = (~) T.Text
type AttrTransferType BindingSourcePropertyPropertyInfo = T.Text
type AttrGetType BindingSourcePropertyPropertyInfo = T.Text
type AttrLabel BindingSourcePropertyPropertyInfo = "source-property"
type AttrOrigin BindingSourcePropertyPropertyInfo = Binding
attrGet = getBindingSourceProperty
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructBindingSourceProperty
attrClear = undefined
#endif
getBindingTarget :: (MonadIO m, IsBinding o) => o -> m GObject.Object.Object
getBindingTarget :: o -> m Object
getBindingTarget o
obj = 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
$ Text -> IO (Maybe Object) -> IO Object
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getBindingTarget" (IO (Maybe Object) -> IO Object) -> IO (Maybe Object) -> IO Object
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Object -> Object) -> IO (Maybe Object)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"target" ManagedPtr Object -> Object
GObject.Object.Object
constructBindingTarget :: (IsBinding o, MIO.MonadIO m, GObject.Object.IsObject a) => a -> m (GValueConstruct o)
constructBindingTarget :: a -> m (GValueConstruct o)
constructBindingTarget a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"target" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data BindingTargetPropertyInfo
instance AttrInfo BindingTargetPropertyInfo where
type AttrAllowedOps BindingTargetPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint BindingTargetPropertyInfo = IsBinding
type AttrSetTypeConstraint BindingTargetPropertyInfo = GObject.Object.IsObject
type AttrTransferTypeConstraint BindingTargetPropertyInfo = GObject.Object.IsObject
type AttrTransferType BindingTargetPropertyInfo = GObject.Object.Object
type AttrGetType BindingTargetPropertyInfo = GObject.Object.Object
type AttrLabel BindingTargetPropertyInfo = "target"
type AttrOrigin BindingTargetPropertyInfo = Binding
attrGet = getBindingTarget
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo GObject.Object.Object v
attrConstruct = constructBindingTarget
attrClear = undefined
#endif
getBindingTargetProperty :: (MonadIO m, IsBinding o) => o -> m T.Text
getBindingTargetProperty :: o -> m Text
getBindingTargetProperty o
obj = 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
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getBindingTargetProperty" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"target-property"
constructBindingTargetProperty :: (IsBinding o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructBindingTargetProperty :: Text -> m (GValueConstruct o)
constructBindingTargetProperty Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"target-property" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data BindingTargetPropertyPropertyInfo
instance AttrInfo BindingTargetPropertyPropertyInfo where
type AttrAllowedOps BindingTargetPropertyPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint BindingTargetPropertyPropertyInfo = IsBinding
type AttrSetTypeConstraint BindingTargetPropertyPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint BindingTargetPropertyPropertyInfo = (~) T.Text
type AttrTransferType BindingTargetPropertyPropertyInfo = T.Text
type AttrGetType BindingTargetPropertyPropertyInfo = T.Text
type AttrLabel BindingTargetPropertyPropertyInfo = "target-property"
type AttrOrigin BindingTargetPropertyPropertyInfo = Binding
attrGet = getBindingTargetProperty
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructBindingTargetProperty
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Binding
type instance O.AttributeList Binding = BindingAttributeList
type BindingAttributeList = ('[ '("flags", BindingFlagsPropertyInfo), '("source", BindingSourcePropertyInfo), '("sourceProperty", BindingSourcePropertyPropertyInfo), '("target", BindingTargetPropertyInfo), '("targetProperty", BindingTargetPropertyPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
bindingFlags :: AttrLabelProxy "flags"
bindingFlags = AttrLabelProxy
bindingSource :: AttrLabelProxy "source"
bindingSource = AttrLabelProxy
bindingSourceProperty :: AttrLabelProxy "sourceProperty"
bindingSourceProperty = AttrLabelProxy
bindingTarget :: AttrLabelProxy "target"
bindingTarget = AttrLabelProxy
bindingTargetProperty :: AttrLabelProxy "targetProperty"
bindingTargetProperty = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Binding = BindingSignalList
type BindingSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_binding_get_flags" g_binding_get_flags ::
Ptr Binding ->
IO CUInt
bindingGetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsBinding a) =>
a
-> m [GObject.Flags.BindingFlags]
bindingGetFlags :: a -> m [BindingFlags]
bindingGetFlags a
binding = IO [BindingFlags] -> m [BindingFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [BindingFlags] -> m [BindingFlags])
-> IO [BindingFlags] -> m [BindingFlags]
forall a b. (a -> b) -> a -> b
$ do
Ptr Binding
binding' <- a -> IO (Ptr Binding)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
binding
CUInt
result <- Ptr Binding -> IO CUInt
g_binding_get_flags Ptr Binding
binding'
let result' :: [BindingFlags]
result' = CUInt -> [BindingFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
binding
[BindingFlags] -> IO [BindingFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [BindingFlags]
result'
#if defined(ENABLE_OVERLOADING)
data BindingGetFlagsMethodInfo
instance (signature ~ (m [GObject.Flags.BindingFlags]), MonadIO m, IsBinding a) => O.MethodInfo BindingGetFlagsMethodInfo a signature where
overloadedMethod = bindingGetFlags
#endif
foreign import ccall "g_binding_get_source" g_binding_get_source ::
Ptr Binding ->
IO (Ptr GObject.Object.Object)
bindingGetSource ::
(B.CallStack.HasCallStack, MonadIO m, IsBinding a) =>
a
-> m GObject.Object.Object
bindingGetSource :: a -> m Object
bindingGetSource a
binding = 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 Binding
binding' <- a -> IO (Ptr Binding)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
binding
Ptr Object
result <- Ptr Binding -> IO (Ptr Object)
g_binding_get_source Ptr Binding
binding'
Text -> Ptr Object -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bindingGetSource" 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
GObject.Object.Object) Ptr Object
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
binding
Object -> IO Object
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result'
#if defined(ENABLE_OVERLOADING)
data BindingGetSourceMethodInfo
instance (signature ~ (m GObject.Object.Object), MonadIO m, IsBinding a) => O.MethodInfo BindingGetSourceMethodInfo a signature where
overloadedMethod = bindingGetSource
#endif
foreign import ccall "g_binding_get_source_property" g_binding_get_source_property ::
Ptr Binding ->
IO CString
bindingGetSourceProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsBinding a) =>
a
-> m T.Text
bindingGetSourceProperty :: a -> m Text
bindingGetSourceProperty a
binding = 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
Ptr Binding
binding' <- a -> IO (Ptr Binding)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
binding
CString
result <- Ptr Binding -> IO CString
g_binding_get_source_property Ptr Binding
binding'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bindingGetSourceProperty" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
binding
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data BindingGetSourcePropertyMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsBinding a) => O.MethodInfo BindingGetSourcePropertyMethodInfo a signature where
overloadedMethod = bindingGetSourceProperty
#endif
foreign import ccall "g_binding_get_target" g_binding_get_target ::
Ptr Binding ->
IO (Ptr GObject.Object.Object)
bindingGetTarget ::
(B.CallStack.HasCallStack, MonadIO m, IsBinding a) =>
a
-> m GObject.Object.Object
bindingGetTarget :: a -> m Object
bindingGetTarget a
binding = 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 Binding
binding' <- a -> IO (Ptr Binding)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
binding
Ptr Object
result <- Ptr Binding -> IO (Ptr Object)
g_binding_get_target Ptr Binding
binding'
Text -> Ptr Object -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bindingGetTarget" 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
GObject.Object.Object) Ptr Object
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
binding
Object -> IO Object
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result'
#if defined(ENABLE_OVERLOADING)
data BindingGetTargetMethodInfo
instance (signature ~ (m GObject.Object.Object), MonadIO m, IsBinding a) => O.MethodInfo BindingGetTargetMethodInfo a signature where
overloadedMethod = bindingGetTarget
#endif
foreign import ccall "g_binding_get_target_property" g_binding_get_target_property ::
Ptr Binding ->
IO CString
bindingGetTargetProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsBinding a) =>
a
-> m T.Text
bindingGetTargetProperty :: a -> m Text
bindingGetTargetProperty a
binding = 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
Ptr Binding
binding' <- a -> IO (Ptr Binding)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
binding
CString
result <- Ptr Binding -> IO CString
g_binding_get_target_property Ptr Binding
binding'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bindingGetTargetProperty" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
binding
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data BindingGetTargetPropertyMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsBinding a) => O.MethodInfo BindingGetTargetPropertyMethodInfo a signature where
overloadedMethod = bindingGetTargetProperty
#endif
foreign import ccall "g_binding_unbind" g_binding_unbind ::
Ptr Binding ->
IO ()
bindingUnbind ::
(B.CallStack.HasCallStack, MonadIO m, IsBinding a) =>
a
-> m ()
bindingUnbind :: a -> m ()
bindingUnbind a
binding = 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 Binding
binding' <- a -> IO (Ptr Binding)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
binding
Ptr Binding -> IO ()
g_binding_unbind Ptr Binding
binding'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
binding
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BindingUnbindMethodInfo
instance (signature ~ (m ()), MonadIO m, IsBinding a) => O.MethodInfo BindingUnbindMethodInfo a signature where
overloadedMethod = bindingUnbind
#endif