module GI.Gio.Objects.PropertyAction
(
PropertyAction(..) ,
PropertyActionK ,
toPropertyAction ,
noPropertyAction ,
propertyActionNew ,
PropertyActionEnabledPropertyInfo ,
getPropertyActionEnabled ,
PropertyActionNamePropertyInfo ,
constructPropertyActionName ,
getPropertyActionName ,
PropertyActionObjectPropertyInfo ,
constructPropertyActionObject ,
PropertyActionParameterTypePropertyInfo ,
getPropertyActionParameterType ,
PropertyActionPropertyNamePropertyInfo ,
constructPropertyActionPropertyName ,
PropertyActionStatePropertyInfo ,
getPropertyActionState ,
PropertyActionStateTypePropertyInfo ,
getPropertyActionStateType ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Gio.Types
import GI.Gio.Callbacks
import qualified GI.GLib as GLib
import qualified GI.GObject as GObject
newtype PropertyAction = PropertyAction (ForeignPtr PropertyAction)
foreign import ccall "g_property_action_get_type"
c_g_property_action_get_type :: IO GType
type instance ParentTypes PropertyAction = PropertyActionParentTypes
type PropertyActionParentTypes = '[GObject.Object, Action]
instance GObject PropertyAction where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_g_property_action_get_type
class GObject o => PropertyActionK o
instance (GObject o, IsDescendantOf PropertyAction o) => PropertyActionK o
toPropertyAction :: PropertyActionK o => o -> IO PropertyAction
toPropertyAction = unsafeCastTo PropertyAction
noPropertyAction :: Maybe PropertyAction
noPropertyAction = Nothing
getPropertyActionEnabled :: (MonadIO m, PropertyActionK o) => o -> m Bool
getPropertyActionEnabled obj = liftIO $ getObjectPropertyBool obj "enabled"
data PropertyActionEnabledPropertyInfo
instance AttrInfo PropertyActionEnabledPropertyInfo where
type AttrAllowedOps PropertyActionEnabledPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint PropertyActionEnabledPropertyInfo = (~) ()
type AttrBaseTypeConstraint PropertyActionEnabledPropertyInfo = PropertyActionK
type AttrGetType PropertyActionEnabledPropertyInfo = Bool
type AttrLabel PropertyActionEnabledPropertyInfo = "PropertyAction::enabled"
attrGet _ = getPropertyActionEnabled
attrSet _ = undefined
attrConstruct _ = undefined
getPropertyActionName :: (MonadIO m, PropertyActionK o) => o -> m T.Text
getPropertyActionName obj = liftIO $ getObjectPropertyString obj "name"
constructPropertyActionName :: T.Text -> IO ([Char], GValue)
constructPropertyActionName val = constructObjectPropertyString "name" val
data PropertyActionNamePropertyInfo
instance AttrInfo PropertyActionNamePropertyInfo where
type AttrAllowedOps PropertyActionNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint PropertyActionNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint PropertyActionNamePropertyInfo = PropertyActionK
type AttrGetType PropertyActionNamePropertyInfo = T.Text
type AttrLabel PropertyActionNamePropertyInfo = "PropertyAction::name"
attrGet _ = getPropertyActionName
attrSet _ = undefined
attrConstruct _ = constructPropertyActionName
constructPropertyActionObject :: (GObject.ObjectK a) => a -> IO ([Char], GValue)
constructPropertyActionObject val = constructObjectPropertyObject "object" val
data PropertyActionObjectPropertyInfo
instance AttrInfo PropertyActionObjectPropertyInfo where
type AttrAllowedOps PropertyActionObjectPropertyInfo = '[ 'AttrConstruct]
type AttrSetTypeConstraint PropertyActionObjectPropertyInfo = GObject.ObjectK
type AttrBaseTypeConstraint PropertyActionObjectPropertyInfo = PropertyActionK
type AttrGetType PropertyActionObjectPropertyInfo = ()
type AttrLabel PropertyActionObjectPropertyInfo = "PropertyAction::object"
attrGet _ = undefined
attrSet _ = undefined
attrConstruct _ = constructPropertyActionObject
getPropertyActionParameterType :: (MonadIO m, PropertyActionK o) => o -> m GLib.VariantType
getPropertyActionParameterType obj = liftIO $ getObjectPropertyBoxed obj "parameter-type" GLib.VariantType
data PropertyActionParameterTypePropertyInfo
instance AttrInfo PropertyActionParameterTypePropertyInfo where
type AttrAllowedOps PropertyActionParameterTypePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint PropertyActionParameterTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint PropertyActionParameterTypePropertyInfo = PropertyActionK
type AttrGetType PropertyActionParameterTypePropertyInfo = GLib.VariantType
type AttrLabel PropertyActionParameterTypePropertyInfo = "PropertyAction::parameter-type"
attrGet _ = getPropertyActionParameterType
attrSet _ = undefined
attrConstruct _ = undefined
constructPropertyActionPropertyName :: T.Text -> IO ([Char], GValue)
constructPropertyActionPropertyName val = constructObjectPropertyString "property-name" val
data PropertyActionPropertyNamePropertyInfo
instance AttrInfo PropertyActionPropertyNamePropertyInfo where
type AttrAllowedOps PropertyActionPropertyNamePropertyInfo = '[ 'AttrConstruct]
type AttrSetTypeConstraint PropertyActionPropertyNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint PropertyActionPropertyNamePropertyInfo = PropertyActionK
type AttrGetType PropertyActionPropertyNamePropertyInfo = ()
type AttrLabel PropertyActionPropertyNamePropertyInfo = "PropertyAction::property-name"
attrGet _ = undefined
attrSet _ = undefined
attrConstruct _ = constructPropertyActionPropertyName
getPropertyActionState :: (MonadIO m, PropertyActionK o) => o -> m GVariant
getPropertyActionState obj = liftIO $ getObjectPropertyVariant obj "state"
data PropertyActionStatePropertyInfo
instance AttrInfo PropertyActionStatePropertyInfo where
type AttrAllowedOps PropertyActionStatePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint PropertyActionStatePropertyInfo = (~) ()
type AttrBaseTypeConstraint PropertyActionStatePropertyInfo = PropertyActionK
type AttrGetType PropertyActionStatePropertyInfo = GVariant
type AttrLabel PropertyActionStatePropertyInfo = "PropertyAction::state"
attrGet _ = getPropertyActionState
attrSet _ = undefined
attrConstruct _ = undefined
getPropertyActionStateType :: (MonadIO m, PropertyActionK o) => o -> m GLib.VariantType
getPropertyActionStateType obj = liftIO $ getObjectPropertyBoxed obj "state-type" GLib.VariantType
data PropertyActionStateTypePropertyInfo
instance AttrInfo PropertyActionStateTypePropertyInfo where
type AttrAllowedOps PropertyActionStateTypePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint PropertyActionStateTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint PropertyActionStateTypePropertyInfo = PropertyActionK
type AttrGetType PropertyActionStateTypePropertyInfo = GLib.VariantType
type AttrLabel PropertyActionStateTypePropertyInfo = "PropertyAction::state-type"
attrGet _ = getPropertyActionStateType
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList PropertyAction = PropertyActionAttributeList
type PropertyActionAttributeList = ('[ '("enabled", PropertyActionEnabledPropertyInfo), '("object", PropertyActionObjectPropertyInfo), '("parameter-type", PropertyActionParameterTypePropertyInfo), '("property-name", PropertyActionPropertyNamePropertyInfo), '("state", PropertyActionStatePropertyInfo), '("state-type", PropertyActionStateTypePropertyInfo)] :: [(Symbol, *)])
type instance SignalList PropertyAction = PropertyActionSignalList
type PropertyActionSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "g_property_action_new" g_property_action_new ::
CString ->
Ptr GObject.Object ->
CString ->
IO (Ptr PropertyAction)
propertyActionNew ::
(MonadIO m, GObject.ObjectK a) =>
T.Text ->
a ->
T.Text ->
m PropertyAction
propertyActionNew name object property_name = liftIO $ do
name' <- textToCString name
let object' = unsafeManagedPtrCastPtr object
property_name' <- textToCString property_name
result <- g_property_action_new name' object' property_name'
checkUnexpectedReturnNULL "g_property_action_new" result
result' <- (wrapObject PropertyAction) result
touchManagedPtr object
freeMem name'
freeMem property_name'
return result'