#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.PropertyAction
(
PropertyAction(..) ,
IsPropertyAction ,
toPropertyAction ,
noPropertyAction ,
propertyActionNew ,
#if ENABLE_OVERLOADING
PropertyActionEnabledPropertyInfo ,
#endif
getPropertyActionEnabled ,
#if ENABLE_OVERLOADING
propertyActionEnabled ,
#endif
#if ENABLE_OVERLOADING
PropertyActionInvertBooleanPropertyInfo ,
#endif
constructPropertyActionInvertBoolean ,
getPropertyActionInvertBoolean ,
#if ENABLE_OVERLOADING
propertyActionInvertBoolean ,
#endif
#if ENABLE_OVERLOADING
PropertyActionNamePropertyInfo ,
#endif
constructPropertyActionName ,
getPropertyActionName ,
#if ENABLE_OVERLOADING
propertyActionName ,
#endif
#if ENABLE_OVERLOADING
PropertyActionObjectPropertyInfo ,
#endif
constructPropertyActionObject ,
#if ENABLE_OVERLOADING
propertyActionObject ,
#endif
#if ENABLE_OVERLOADING
PropertyActionParameterTypePropertyInfo ,
#endif
getPropertyActionParameterType ,
#if ENABLE_OVERLOADING
propertyActionParameterType ,
#endif
#if ENABLE_OVERLOADING
PropertyActionPropertyNamePropertyInfo ,
#endif
constructPropertyActionPropertyName ,
#if ENABLE_OVERLOADING
propertyActionPropertyName ,
#endif
#if ENABLE_OVERLOADING
PropertyActionStatePropertyInfo ,
#endif
getPropertyActionState ,
#if ENABLE_OVERLOADING
propertyActionState ,
#endif
#if ENABLE_OVERLOADING
PropertyActionStateTypePropertyInfo ,
#endif
getPropertyActionStateType ,
#if ENABLE_OVERLOADING
propertyActionStateType ,
#endif
) 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.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Action as Gio.Action
newtype PropertyAction = PropertyAction (ManagedPtr PropertyAction)
foreign import ccall "g_property_action_get_type"
c_g_property_action_get_type :: IO GType
instance GObject PropertyAction where
gobjectType = c_g_property_action_get_type
class (GObject o, O.IsDescendantOf PropertyAction o) => IsPropertyAction o
instance (GObject o, O.IsDescendantOf PropertyAction o) => IsPropertyAction o
instance O.HasParentTypes PropertyAction
type instance O.ParentTypes PropertyAction = '[GObject.Object.Object, Gio.Action.Action]
toPropertyAction :: (MonadIO m, IsPropertyAction o) => o -> m PropertyAction
toPropertyAction = liftIO . unsafeCastTo PropertyAction
noPropertyAction :: Maybe PropertyAction
noPropertyAction = Nothing
#if ENABLE_OVERLOADING
type family ResolvePropertyActionMethod (t :: Symbol) (o :: *) :: * where
ResolvePropertyActionMethod "activate" o = Gio.Action.ActionActivateMethodInfo
ResolvePropertyActionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePropertyActionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePropertyActionMethod "changeState" o = Gio.Action.ActionChangeStateMethodInfo
ResolvePropertyActionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePropertyActionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePropertyActionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePropertyActionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePropertyActionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePropertyActionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePropertyActionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePropertyActionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePropertyActionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePropertyActionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePropertyActionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePropertyActionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePropertyActionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePropertyActionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePropertyActionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePropertyActionMethod "getEnabled" o = Gio.Action.ActionGetEnabledMethodInfo
ResolvePropertyActionMethod "getName" o = Gio.Action.ActionGetNameMethodInfo
ResolvePropertyActionMethod "getParameterType" o = Gio.Action.ActionGetParameterTypeMethodInfo
ResolvePropertyActionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePropertyActionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePropertyActionMethod "getState" o = Gio.Action.ActionGetStateMethodInfo
ResolvePropertyActionMethod "getStateHint" o = Gio.Action.ActionGetStateHintMethodInfo
ResolvePropertyActionMethod "getStateType" o = Gio.Action.ActionGetStateTypeMethodInfo
ResolvePropertyActionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePropertyActionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePropertyActionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePropertyActionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePropertyActionMethod t PropertyAction, O.MethodInfo info PropertyAction p) => OL.IsLabel t (PropertyAction -> 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
getPropertyActionEnabled :: (MonadIO m, IsPropertyAction o) => o -> m Bool
getPropertyActionEnabled obj = liftIO $ B.Properties.getObjectPropertyBool obj "enabled"
#if ENABLE_OVERLOADING
data PropertyActionEnabledPropertyInfo
instance AttrInfo PropertyActionEnabledPropertyInfo where
type AttrAllowedOps PropertyActionEnabledPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint PropertyActionEnabledPropertyInfo = (~) ()
type AttrBaseTypeConstraint PropertyActionEnabledPropertyInfo = IsPropertyAction
type AttrGetType PropertyActionEnabledPropertyInfo = Bool
type AttrLabel PropertyActionEnabledPropertyInfo = "enabled"
type AttrOrigin PropertyActionEnabledPropertyInfo = PropertyAction
attrGet _ = getPropertyActionEnabled
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getPropertyActionInvertBoolean :: (MonadIO m, IsPropertyAction o) => o -> m Bool
getPropertyActionInvertBoolean obj = liftIO $ B.Properties.getObjectPropertyBool obj "invert-boolean"
constructPropertyActionInvertBoolean :: (IsPropertyAction o) => Bool -> IO (GValueConstruct o)
constructPropertyActionInvertBoolean val = B.Properties.constructObjectPropertyBool "invert-boolean" val
#if ENABLE_OVERLOADING
data PropertyActionInvertBooleanPropertyInfo
instance AttrInfo PropertyActionInvertBooleanPropertyInfo where
type AttrAllowedOps PropertyActionInvertBooleanPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint PropertyActionInvertBooleanPropertyInfo = (~) Bool
type AttrBaseTypeConstraint PropertyActionInvertBooleanPropertyInfo = IsPropertyAction
type AttrGetType PropertyActionInvertBooleanPropertyInfo = Bool
type AttrLabel PropertyActionInvertBooleanPropertyInfo = "invert-boolean"
type AttrOrigin PropertyActionInvertBooleanPropertyInfo = PropertyAction
attrGet _ = getPropertyActionInvertBoolean
attrSet _ = undefined
attrConstruct _ = constructPropertyActionInvertBoolean
attrClear _ = undefined
#endif
getPropertyActionName :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe T.Text)
getPropertyActionName obj = liftIO $ B.Properties.getObjectPropertyString obj "name"
constructPropertyActionName :: (IsPropertyAction o) => T.Text -> IO (GValueConstruct o)
constructPropertyActionName val = B.Properties.constructObjectPropertyString "name" (Just val)
#if ENABLE_OVERLOADING
data PropertyActionNamePropertyInfo
instance AttrInfo PropertyActionNamePropertyInfo where
type AttrAllowedOps PropertyActionNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint PropertyActionNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint PropertyActionNamePropertyInfo = IsPropertyAction
type AttrGetType PropertyActionNamePropertyInfo = (Maybe T.Text)
type AttrLabel PropertyActionNamePropertyInfo = "name"
type AttrOrigin PropertyActionNamePropertyInfo = PropertyAction
attrGet _ = getPropertyActionName
attrSet _ = undefined
attrConstruct _ = constructPropertyActionName
attrClear _ = undefined
#endif
constructPropertyActionObject :: (IsPropertyAction o, GObject.Object.IsObject a) => a -> IO (GValueConstruct o)
constructPropertyActionObject val = B.Properties.constructObjectPropertyObject "object" (Just val)
#if ENABLE_OVERLOADING
data PropertyActionObjectPropertyInfo
instance AttrInfo PropertyActionObjectPropertyInfo where
type AttrAllowedOps PropertyActionObjectPropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrSetTypeConstraint PropertyActionObjectPropertyInfo = GObject.Object.IsObject
type AttrBaseTypeConstraint PropertyActionObjectPropertyInfo = IsPropertyAction
type AttrGetType PropertyActionObjectPropertyInfo = ()
type AttrLabel PropertyActionObjectPropertyInfo = "object"
type AttrOrigin PropertyActionObjectPropertyInfo = PropertyAction
attrGet _ = undefined
attrSet _ = undefined
attrConstruct _ = constructPropertyActionObject
attrClear _ = undefined
#endif
getPropertyActionParameterType :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getPropertyActionParameterType obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "parameter-type" GLib.VariantType.VariantType
#if ENABLE_OVERLOADING
data PropertyActionParameterTypePropertyInfo
instance AttrInfo PropertyActionParameterTypePropertyInfo where
type AttrAllowedOps PropertyActionParameterTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint PropertyActionParameterTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint PropertyActionParameterTypePropertyInfo = IsPropertyAction
type AttrGetType PropertyActionParameterTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel PropertyActionParameterTypePropertyInfo = "parameter-type"
type AttrOrigin PropertyActionParameterTypePropertyInfo = PropertyAction
attrGet _ = getPropertyActionParameterType
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
constructPropertyActionPropertyName :: (IsPropertyAction o) => T.Text -> IO (GValueConstruct o)
constructPropertyActionPropertyName val = B.Properties.constructObjectPropertyString "property-name" (Just val)
#if ENABLE_OVERLOADING
data PropertyActionPropertyNamePropertyInfo
instance AttrInfo PropertyActionPropertyNamePropertyInfo where
type AttrAllowedOps PropertyActionPropertyNamePropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrSetTypeConstraint PropertyActionPropertyNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint PropertyActionPropertyNamePropertyInfo = IsPropertyAction
type AttrGetType PropertyActionPropertyNamePropertyInfo = ()
type AttrLabel PropertyActionPropertyNamePropertyInfo = "property-name"
type AttrOrigin PropertyActionPropertyNamePropertyInfo = PropertyAction
attrGet _ = undefined
attrSet _ = undefined
attrConstruct _ = constructPropertyActionPropertyName
attrClear _ = undefined
#endif
getPropertyActionState :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe GVariant)
getPropertyActionState obj = liftIO $ B.Properties.getObjectPropertyVariant obj "state"
#if ENABLE_OVERLOADING
data PropertyActionStatePropertyInfo
instance AttrInfo PropertyActionStatePropertyInfo where
type AttrAllowedOps PropertyActionStatePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint PropertyActionStatePropertyInfo = (~) ()
type AttrBaseTypeConstraint PropertyActionStatePropertyInfo = IsPropertyAction
type AttrGetType PropertyActionStatePropertyInfo = (Maybe GVariant)
type AttrLabel PropertyActionStatePropertyInfo = "state"
type AttrOrigin PropertyActionStatePropertyInfo = PropertyAction
attrGet _ = getPropertyActionState
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getPropertyActionStateType :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getPropertyActionStateType obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "state-type" GLib.VariantType.VariantType
#if ENABLE_OVERLOADING
data PropertyActionStateTypePropertyInfo
instance AttrInfo PropertyActionStateTypePropertyInfo where
type AttrAllowedOps PropertyActionStateTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint PropertyActionStateTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint PropertyActionStateTypePropertyInfo = IsPropertyAction
type AttrGetType PropertyActionStateTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel PropertyActionStateTypePropertyInfo = "state-type"
type AttrOrigin PropertyActionStateTypePropertyInfo = PropertyAction
attrGet _ = getPropertyActionStateType
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList PropertyAction
type instance O.AttributeList PropertyAction = PropertyActionAttributeList
type PropertyActionAttributeList = ('[ '("enabled", PropertyActionEnabledPropertyInfo), '("invertBoolean", PropertyActionInvertBooleanPropertyInfo), '("name", PropertyActionNamePropertyInfo), '("object", PropertyActionObjectPropertyInfo), '("parameterType", PropertyActionParameterTypePropertyInfo), '("propertyName", PropertyActionPropertyNamePropertyInfo), '("state", PropertyActionStatePropertyInfo), '("stateType", PropertyActionStateTypePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
propertyActionEnabled :: AttrLabelProxy "enabled"
propertyActionEnabled = AttrLabelProxy
propertyActionInvertBoolean :: AttrLabelProxy "invertBoolean"
propertyActionInvertBoolean = AttrLabelProxy
propertyActionName :: AttrLabelProxy "name"
propertyActionName = AttrLabelProxy
propertyActionObject :: AttrLabelProxy "object"
propertyActionObject = AttrLabelProxy
propertyActionParameterType :: AttrLabelProxy "parameterType"
propertyActionParameterType = AttrLabelProxy
propertyActionPropertyName :: AttrLabelProxy "propertyName"
propertyActionPropertyName = AttrLabelProxy
propertyActionState :: AttrLabelProxy "state"
propertyActionState = AttrLabelProxy
propertyActionStateType :: AttrLabelProxy "stateType"
propertyActionStateType = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList PropertyAction = PropertyActionSignalList
type PropertyActionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_property_action_new" g_property_action_new ::
CString ->
Ptr GObject.Object.Object ->
CString ->
IO (Ptr PropertyAction)
propertyActionNew ::
(B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
T.Text
-> a
-> T.Text
-> m PropertyAction
propertyActionNew name object propertyName = liftIO $ do
name' <- textToCString name
object' <- unsafeManagedPtrCastPtr object
propertyName' <- textToCString propertyName
result <- g_property_action_new name' object' propertyName'
checkUnexpectedReturnNULL "propertyActionNew" result
result' <- (wrapObject PropertyAction) result
touchManagedPtr object
freeMem name'
freeMem propertyName'
return result'
#if ENABLE_OVERLOADING
#endif