#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GObject.Objects.Binding
(
Binding(..) ,
IsBinding ,
toBinding ,
noBinding ,
#if ENABLE_OVERLOADING
BindingGetFlagsMethodInfo ,
#endif
bindingGetFlags ,
#if ENABLE_OVERLOADING
BindingGetSourceMethodInfo ,
#endif
bindingGetSource ,
#if ENABLE_OVERLOADING
BindingGetSourcePropertyMethodInfo ,
#endif
bindingGetSourceProperty ,
#if ENABLE_OVERLOADING
BindingGetTargetMethodInfo ,
#endif
bindingGetTarget ,
#if ENABLE_OVERLOADING
BindingGetTargetPropertyMethodInfo ,
#endif
bindingGetTargetProperty ,
#if ENABLE_OVERLOADING
BindingUnbindMethodInfo ,
#endif
bindingUnbind ,
#if ENABLE_OVERLOADING
BindingFlagsPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
bindingFlags ,
#endif
constructBindingFlags ,
getBindingFlags ,
#if ENABLE_OVERLOADING
BindingSourcePropertyInfo ,
#endif
#if ENABLE_OVERLOADING
bindingSource ,
#endif
constructBindingSource ,
getBindingSource ,
#if ENABLE_OVERLOADING
BindingSourcePropertyPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
bindingSourceProperty ,
#endif
constructBindingSourceProperty ,
getBindingSourceProperty ,
#if ENABLE_OVERLOADING
BindingTargetPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
bindingTarget ,
#endif
constructBindingTarget ,
getBindingTarget ,
#if ENABLE_OVERLOADING
BindingTargetPropertyPropertyInfo ,
#endif
#if 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.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 {-# SOURCE #-} qualified GI.GObject.Flags as GObject.Flags
import {-# SOURCE #-} qualified GI.GObject.Objects.Object as GObject.Object
newtype Binding = Binding (ManagedPtr Binding)
foreign import ccall "g_binding_get_type"
c_g_binding_get_type :: IO GType
instance GObject Binding where
gobjectType = c_g_binding_get_type
class (GObject o, O.IsDescendantOf Binding o) => IsBinding o
instance (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 = liftIO . unsafeCastTo Binding
noBinding :: Maybe Binding
noBinding = Nothing
#if 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getBindingFlags :: (MonadIO m, IsBinding o) => o -> m [GObject.Flags.BindingFlags]
getBindingFlags obj = liftIO $ B.Properties.getObjectPropertyFlags obj "flags"
constructBindingFlags :: (IsBinding o) => [GObject.Flags.BindingFlags] -> IO (GValueConstruct o)
constructBindingFlags val = B.Properties.constructObjectPropertyFlags "flags" val
#if ENABLE_OVERLOADING
data BindingFlagsPropertyInfo
instance AttrInfo BindingFlagsPropertyInfo where
type AttrAllowedOps BindingFlagsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint BindingFlagsPropertyInfo = (~) [GObject.Flags.BindingFlags]
type AttrBaseTypeConstraint BindingFlagsPropertyInfo = IsBinding
type AttrGetType BindingFlagsPropertyInfo = [GObject.Flags.BindingFlags]
type AttrLabel BindingFlagsPropertyInfo = "flags"
type AttrOrigin BindingFlagsPropertyInfo = Binding
attrGet _ = getBindingFlags
attrSet _ = undefined
attrConstruct _ = constructBindingFlags
attrClear _ = undefined
#endif
getBindingSource :: (MonadIO m, IsBinding o) => o -> m GObject.Object.Object
getBindingSource obj = liftIO $ checkUnexpectedNothing "getBindingSource" $ B.Properties.getObjectPropertyObject obj "source" GObject.Object.Object
constructBindingSource :: (IsBinding o, GObject.Object.IsObject a) => a -> IO (GValueConstruct o)
constructBindingSource val = B.Properties.constructObjectPropertyObject "source" (Just val)
#if ENABLE_OVERLOADING
data BindingSourcePropertyInfo
instance AttrInfo BindingSourcePropertyInfo where
type AttrAllowedOps BindingSourcePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint BindingSourcePropertyInfo = GObject.Object.IsObject
type AttrBaseTypeConstraint BindingSourcePropertyInfo = IsBinding
type AttrGetType BindingSourcePropertyInfo = GObject.Object.Object
type AttrLabel BindingSourcePropertyInfo = "source"
type AttrOrigin BindingSourcePropertyInfo = Binding
attrGet _ = getBindingSource
attrSet _ = undefined
attrConstruct _ = constructBindingSource
attrClear _ = undefined
#endif
getBindingSourceProperty :: (MonadIO m, IsBinding o) => o -> m T.Text
getBindingSourceProperty obj = liftIO $ checkUnexpectedNothing "getBindingSourceProperty" $ B.Properties.getObjectPropertyString obj "source-property"
constructBindingSourceProperty :: (IsBinding o) => T.Text -> IO (GValueConstruct o)
constructBindingSourceProperty val = B.Properties.constructObjectPropertyString "source-property" (Just val)
#if ENABLE_OVERLOADING
data BindingSourcePropertyPropertyInfo
instance AttrInfo BindingSourcePropertyPropertyInfo where
type AttrAllowedOps BindingSourcePropertyPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint BindingSourcePropertyPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint BindingSourcePropertyPropertyInfo = IsBinding
type AttrGetType BindingSourcePropertyPropertyInfo = T.Text
type AttrLabel BindingSourcePropertyPropertyInfo = "source-property"
type AttrOrigin BindingSourcePropertyPropertyInfo = Binding
attrGet _ = getBindingSourceProperty
attrSet _ = undefined
attrConstruct _ = constructBindingSourceProperty
attrClear _ = undefined
#endif
getBindingTarget :: (MonadIO m, IsBinding o) => o -> m GObject.Object.Object
getBindingTarget obj = liftIO $ checkUnexpectedNothing "getBindingTarget" $ B.Properties.getObjectPropertyObject obj "target" GObject.Object.Object
constructBindingTarget :: (IsBinding o, GObject.Object.IsObject a) => a -> IO (GValueConstruct o)
constructBindingTarget val = B.Properties.constructObjectPropertyObject "target" (Just val)
#if ENABLE_OVERLOADING
data BindingTargetPropertyInfo
instance AttrInfo BindingTargetPropertyInfo where
type AttrAllowedOps BindingTargetPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint BindingTargetPropertyInfo = GObject.Object.IsObject
type AttrBaseTypeConstraint BindingTargetPropertyInfo = IsBinding
type AttrGetType BindingTargetPropertyInfo = GObject.Object.Object
type AttrLabel BindingTargetPropertyInfo = "target"
type AttrOrigin BindingTargetPropertyInfo = Binding
attrGet _ = getBindingTarget
attrSet _ = undefined
attrConstruct _ = constructBindingTarget
attrClear _ = undefined
#endif
getBindingTargetProperty :: (MonadIO m, IsBinding o) => o -> m T.Text
getBindingTargetProperty obj = liftIO $ checkUnexpectedNothing "getBindingTargetProperty" $ B.Properties.getObjectPropertyString obj "target-property"
constructBindingTargetProperty :: (IsBinding o) => T.Text -> IO (GValueConstruct o)
constructBindingTargetProperty val = B.Properties.constructObjectPropertyString "target-property" (Just val)
#if ENABLE_OVERLOADING
data BindingTargetPropertyPropertyInfo
instance AttrInfo BindingTargetPropertyPropertyInfo where
type AttrAllowedOps BindingTargetPropertyPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint BindingTargetPropertyPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint BindingTargetPropertyPropertyInfo = IsBinding
type AttrGetType BindingTargetPropertyPropertyInfo = T.Text
type AttrLabel BindingTargetPropertyPropertyInfo = "target-property"
type AttrOrigin BindingTargetPropertyPropertyInfo = Binding
attrGet _ = getBindingTargetProperty
attrSet _ = undefined
attrConstruct _ = constructBindingTargetProperty
attrClear _ = undefined
#endif
#if 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 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 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 binding = liftIO $ do
binding' <- unsafeManagedPtrCastPtr binding
result <- g_binding_get_flags binding'
let result' = wordToGFlags result
touchManagedPtr binding
return result'
#if 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 binding = liftIO $ do
binding' <- unsafeManagedPtrCastPtr binding
result <- g_binding_get_source binding'
checkUnexpectedReturnNULL "bindingGetSource" result
result' <- (newObject GObject.Object.Object) result
touchManagedPtr binding
return result'
#if 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 binding = liftIO $ do
binding' <- unsafeManagedPtrCastPtr binding
result <- g_binding_get_source_property binding'
checkUnexpectedReturnNULL "bindingGetSourceProperty" result
result' <- cstringToText result
touchManagedPtr binding
return result'
#if 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 binding = liftIO $ do
binding' <- unsafeManagedPtrCastPtr binding
result <- g_binding_get_target binding'
checkUnexpectedReturnNULL "bindingGetTarget" result
result' <- (newObject GObject.Object.Object) result
touchManagedPtr binding
return result'
#if 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 binding = liftIO $ do
binding' <- unsafeManagedPtrCastPtr binding
result <- g_binding_get_target_property binding'
checkUnexpectedReturnNULL "bindingGetTargetProperty" result
result' <- cstringToText result
touchManagedPtr binding
return result'
#if 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 binding = liftIO $ do
binding' <- unsafeManagedPtrCastPtr binding
g_binding_unbind binding'
touchManagedPtr binding
return ()
#if ENABLE_OVERLOADING
data BindingUnbindMethodInfo
instance (signature ~ (m ()), MonadIO m, IsBinding a) => O.MethodInfo BindingUnbindMethodInfo a signature where
overloadedMethod _ = bindingUnbind
#endif