{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

A 'GI.Gio.Objects.PropertyAction.PropertyAction' is a way to get a 'GI.Gio.Interfaces.Action.Action' with a state value
reflecting and controlling the value of a 'GI.GObject.Objects.Object.Object' property.

The state of the action will correspond to the value of the property.
Changing it will change the property (assuming the requested value
matches the requirements as specified in the 'GI.GObject.Objects.ParamSpec.ParamSpec').

Only the most common types are presently supported.  Booleans are
mapped to booleans, strings to strings, signed\/unsigned integers to
int32\/uint32 and floats and doubles to doubles.

If the property is an enum then the state will be string-typed and
conversion will automatically be performed between the enum value and
\"nick\" string as per the 'GI.GObject.Structs.EnumValue.EnumValue' table.

Flags types are not currently supported.

Properties of object types, boxed types and pointer types are not
supported and probably never will be.

Properties of 'GVariant' types are not currently supported.

If the property is boolean-valued then the action will have a NULL
parameter type, and activating the action (with no parameter) will
toggle the value of the property.

In all other cases, the parameter type will correspond to the type of
the property.

The general idea here is to reduce the number of locations where a
particular piece of state is kept (and therefore has to be synchronised
between). 'GI.Gio.Objects.PropertyAction.PropertyAction' does not have a separate state that is kept
in sync with the property value -- its state is the property value.

For example, it might be useful to create a 'GI.Gio.Interfaces.Action.Action' corresponding to
the \"visible-child-name\" property of a @/GtkStack/@ so that the current
page can be switched from a menu.  The active radio indication in the
menu is then directly determined from the active page of the
@/GtkStack/@.

An anti-example would be binding the \"active-id\" property on a
@/GtkComboBox/@.  This is because the state of the combobox itself is
probably uninteresting and is actually being used to control
something else.

Another anti-example would be to bind to the \"visible-child-name\"
property of a @/GtkStack/@ if this value is actually stored in
'GI.Gio.Objects.Settings.Settings'.  In that case, the real source of the value is
'GI.Gio.Objects.Settings.Settings'.  If you want a 'GI.Gio.Interfaces.Action.Action' to control a setting stored in
'GI.Gio.Objects.Settings.Settings', see 'GI.Gio.Objects.Settings.settingsCreateAction' instead, and possibly
combine its use with 'GI.Gio.Objects.Settings.settingsBind'.
-}

module GI.Gio.Objects.PropertyAction
    ( 

-- * Exported types
    PropertyAction(..)                      ,
    IsPropertyAction                        ,
    toPropertyAction                        ,
    noPropertyAction                        ,


 -- * Methods
-- ** new #method:new#
    propertyActionNew                       ,




 -- * Properties
-- ** enabled #attr:enabled#
    PropertyActionEnabledPropertyInfo       ,
    getPropertyActionEnabled                ,
    propertyActionEnabled                   ,


-- ** invertBoolean #attr:invertBoolean#
    PropertyActionInvertBooleanPropertyInfo ,
    constructPropertyActionInvertBoolean    ,
    getPropertyActionInvertBoolean          ,
    propertyActionInvertBoolean             ,


-- ** name #attr:name#
    PropertyActionNamePropertyInfo          ,
    constructPropertyActionName             ,
    getPropertyActionName                   ,
    propertyActionName                      ,


-- ** object #attr:object#
    PropertyActionObjectPropertyInfo        ,
    constructPropertyActionObject           ,
    propertyActionObject                    ,


-- ** parameterType #attr:parameterType#
    PropertyActionParameterTypePropertyInfo ,
    getPropertyActionParameterType          ,
    propertyActionParameterType             ,


-- ** propertyName #attr:propertyName#
    PropertyActionPropertyNamePropertyInfo  ,
    constructPropertyActionPropertyName     ,
    propertyActionPropertyName              ,


-- ** state #attr:state#
    PropertyActionStatePropertyInfo         ,
    getPropertyActionState                  ,
    propertyActionState                     ,


-- ** stateType #attr:stateType#
    PropertyActionStateTypePropertyInfo     ,
    getPropertyActionStateType              ,
    propertyActionStateType                 ,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 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 => IsPropertyAction o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError PropertyAction a) =>
    IsPropertyAction a
#endif
instance IsPropertyAction PropertyAction
instance GObject.Object.IsObject PropertyAction
instance Gio.Action.IsAction PropertyAction

toPropertyAction :: IsPropertyAction o => o -> IO PropertyAction
toPropertyAction = unsafeCastTo PropertyAction

noPropertyAction :: Maybe PropertyAction
noPropertyAction = Nothing

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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolvePropertyActionMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    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 "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolvePropertyActionMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolvePropertyActionMethod t PropertyAction, O.MethodInfo info PropertyAction p) => O.IsLabelProxy t (PropertyAction -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolvePropertyActionMethod t PropertyAction, O.MethodInfo info PropertyAction p) => O.IsLabel t (PropertyAction -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

--- XXX Duplicated object with different types:
  --- Name {namespace = "Gio", name = "PropertyAction"} -> Property {propName = "name", propType = TBasicType TUTF8, propFlags = [PropertyReadable,PropertyWritable,PropertyConstructOnly], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDeprecated = Nothing}
  --- Name {namespace = "Gio", name = "Action"} -> Property {propName = "name", propType = TBasicType TUTF8, propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDeprecated = Nothing}
-- VVV Prop "enabled"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getPropertyActionEnabled :: (MonadIO m, IsPropertyAction 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 = IsPropertyAction
    type AttrGetType PropertyActionEnabledPropertyInfo = Bool
    type AttrLabel PropertyActionEnabledPropertyInfo = "enabled"
    type AttrOrigin PropertyActionEnabledPropertyInfo = PropertyAction
    attrGet _ = getPropertyActionEnabled
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "invert-boolean"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getPropertyActionInvertBoolean :: (MonadIO m, IsPropertyAction o) => o -> m Bool
getPropertyActionInvertBoolean obj = liftIO $ getObjectPropertyBool obj "invert-boolean"

constructPropertyActionInvertBoolean :: (IsPropertyAction o) => Bool -> IO (GValueConstruct o)
constructPropertyActionInvertBoolean val = constructObjectPropertyBool "invert-boolean" val

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

-- VVV Prop "name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getPropertyActionName :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe T.Text)
getPropertyActionName obj = liftIO $ getObjectPropertyString obj "name"

constructPropertyActionName :: (IsPropertyAction o) => T.Text -> IO (GValueConstruct o)
constructPropertyActionName val = constructObjectPropertyString "name" (Just val)

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

-- VVV Prop "object"
   -- Type: TInterface (Name {namespace = "GObject", name = "Object"})
   -- Flags: [PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

constructPropertyActionObject :: (IsPropertyAction o, GObject.Object.IsObject a) => a -> IO (GValueConstruct o)
constructPropertyActionObject val = constructObjectPropertyObject "object" (Just val)

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

-- VVV Prop "parameter-type"
   -- Type: TInterface (Name {namespace = "GLib", name = "VariantType"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getPropertyActionParameterType :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getPropertyActionParameterType obj = liftIO $ getObjectPropertyBoxed obj "parameter-type" GLib.VariantType.VariantType

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

-- VVV Prop "property-name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

constructPropertyActionPropertyName :: (IsPropertyAction o) => T.Text -> IO (GValueConstruct o)
constructPropertyActionPropertyName val = constructObjectPropertyString "property-name" (Just val)

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

-- VVV Prop "state"
   -- Type: TVariant
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getPropertyActionState :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe GVariant)
getPropertyActionState obj = liftIO $ getObjectPropertyVariant obj "state"

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

-- VVV Prop "state-type"
   -- Type: TInterface (Name {namespace = "GLib", name = "VariantType"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getPropertyActionStateType :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe GLib.VariantType.VariantType)
getPropertyActionStateType obj = liftIO $ getObjectPropertyBoxed obj "state-type" GLib.VariantType.VariantType

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

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, *)])

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

type instance O.SignalList PropertyAction = PropertyActionSignalList
type PropertyActionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method PropertyAction::new
-- method type : Constructor
-- Args : [Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the action to create", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object", argType = TInterface (Name {namespace = "GObject", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the object that has the property\n  to wrap", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "property_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the property", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "PropertyAction"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_property_action_new" g_property_action_new :: 
    CString ->                              -- name : TBasicType TUTF8
    Ptr GObject.Object.Object ->            -- object : TInterface (Name {namespace = "GObject", name = "Object"})
    CString ->                              -- property_name : TBasicType TUTF8
    IO (Ptr PropertyAction)

{- |
Creates a 'GI.Gio.Interfaces.Action.Action' corresponding to the value of property
/@propertyName@/ on /@object@/.

The property must be existent and readable and writable (and not
construct-only).

This function takes a reference on /@object@/ and doesn\'t release it
until the action is destroyed.

@since 2.38
-}
propertyActionNew ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
    T.Text
    {- ^ /@name@/: the name of the action to create -}
    -> a
    {- ^ /@object@/: the object that has the property
  to wrap -}
    -> T.Text
    {- ^ /@propertyName@/: the name of the property -}
    -> m PropertyAction
    {- ^ __Returns:__ a new 'GI.Gio.Objects.PropertyAction.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'