{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc) 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'. /Since: 2.38/ -} #define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \ && !defined(__HADDOCK_VERSION__)) module GI.Gio.Objects.PropertyAction ( -- * Exported types PropertyAction(..) , IsPropertyAction , toPropertyAction , noPropertyAction , -- * Methods -- ** new #method:new# propertyActionNew , -- * Properties -- ** enabled #attr:enabled# {- | If /@action@/ is currently enabled. If the action is disabled then calls to 'GI.Gio.Interfaces.Action.actionActivate' and 'GI.Gio.Interfaces.Action.actionChangeState' have no effect. /Since: 2.38/ -} #if ENABLE_OVERLOADING PropertyActionEnabledPropertyInfo , #endif getPropertyActionEnabled , #if ENABLE_OVERLOADING propertyActionEnabled , #endif -- ** invertBoolean #attr:invertBoolean# {- | If 'True', the state of the action will be the negation of the property value, provided the property is boolean. /Since: 2.46/ -} #if ENABLE_OVERLOADING PropertyActionInvertBooleanPropertyInfo , #endif constructPropertyActionInvertBoolean , getPropertyActionInvertBoolean , #if ENABLE_OVERLOADING propertyActionInvertBoolean , #endif -- ** name #attr:name# {- | The name of the action. This is mostly meaningful for identifying the action once it has been added to a 'GI.Gio.Interfaces.ActionMap.ActionMap'. /Since: 2.38/ -} #if ENABLE_OVERLOADING PropertyActionNamePropertyInfo , #endif constructPropertyActionName , getPropertyActionName , #if ENABLE_OVERLOADING propertyActionName , #endif -- ** object #attr:object# {- | The object to wrap a property on. The object must be a non-'Nothing' 'GI.GObject.Objects.Object.Object' with properties. /Since: 2.38/ -} #if ENABLE_OVERLOADING PropertyActionObjectPropertyInfo , #endif constructPropertyActionObject , #if ENABLE_OVERLOADING propertyActionObject , #endif -- ** parameterType #attr:parameterType# {- | The type of the parameter that must be given when activating the action. /Since: 2.38/ -} #if ENABLE_OVERLOADING PropertyActionParameterTypePropertyInfo , #endif getPropertyActionParameterType , #if ENABLE_OVERLOADING propertyActionParameterType , #endif -- ** propertyName #attr:propertyName# {- | The name of the property to wrap on the object. The property must exist on the passed-in object and it must be readable and writable (and not construct-only). /Since: 2.38/ -} #if ENABLE_OVERLOADING PropertyActionPropertyNamePropertyInfo , #endif constructPropertyActionPropertyName , #if ENABLE_OVERLOADING propertyActionPropertyName , #endif -- ** state #attr:state# {- | The state of the action, or 'Nothing' if the action is stateless. /Since: 2.38/ -} #if ENABLE_OVERLOADING PropertyActionStatePropertyInfo , #endif getPropertyActionState , #if ENABLE_OVERLOADING propertyActionState , #endif -- ** stateType #attr:stateType# {- | The 'GI.GLib.Structs.VariantType.VariantType' of the state that the action has, or 'Nothing' if the action is stateless. /Since: 2.38/ -} #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 -- | Memory-managed wrapper type. 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 -- | Type class for types which can be safely cast to `PropertyAction`, for instance with `toPropertyAction`. 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] -- | Cast to `PropertyAction`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`. toPropertyAction :: (MonadIO m, IsPropertyAction o) => o -> m PropertyAction toPropertyAction = liftIO . unsafeCastTo PropertyAction -- | A convenience alias for `Nothing` :: `Maybe` `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 "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 --- XXX Duplicated object with different types: --- Name {namespace = "Gio", name = "PropertyAction"} -> Property {propName = "enabled", propType = TBasicType TBoolean, propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "If @action is currently enabled.\n\nIf the action is disabled then calls to g_action_activate() and\ng_action_change_state() have no effect.", sinceVersion = Just "2.38"}, propDeprecated = Nothing} --- Name {namespace = "Gio", name = "Action"} -> Property {propName = "enabled", propType = TBasicType TBoolean, propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "If @action is currently enabled.\n\nIf the action is disabled then calls to g_action_activate() and\ng_action_change_state() have no effect.", sinceVersion = Just "2.28"}, propDeprecated = Nothing} --- 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, propDoc = Documentation {rawDocText = Just "The name of the action. This is mostly meaningful for identifying\nthe action once it has been added to a #GActionMap.", sinceVersion = Just "2.38"}, propDeprecated = Nothing} --- Name {namespace = "Gio", name = "Action"} -> Property {propName = "name", propType = TBasicType TUTF8, propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The name of the action. This is mostly meaningful for identifying\nthe action once it has been added to a #GActionGroup. It is immutable.", sinceVersion = Just "2.28"}, propDeprecated = Nothing} --- XXX Duplicated object with different types: --- Name {namespace = "Gio", name = "PropertyAction"} -> Property {propName = "parameter-type", propType = TInterface (Name {namespace = "GLib", name = "VariantType"}), propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The type of the parameter that must be given when activating the\naction.", sinceVersion = Just "2.38"}, propDeprecated = Nothing} --- Name {namespace = "Gio", name = "Action"} -> Property {propName = "parameter-type", propType = TInterface (Name {namespace = "GLib", name = "VariantType"}), propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The type of the parameter that must be given when activating the\naction. This is immutable, and may be %NULL if no parameter is needed when\nactivating the action.", sinceVersion = Just "2.28"}, propDeprecated = Nothing} --- XXX Duplicated object with different types: --- Name {namespace = "Gio", name = "PropertyAction"} -> Property {propName = "state", propType = TVariant, propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The state of the action, or %NULL if the action is stateless.", sinceVersion = Just "2.38"}, propDeprecated = Nothing} --- Name {namespace = "Gio", name = "Action"} -> Property {propName = "state", propType = TVariant, propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The state of the action, or %NULL if the action is stateless.", sinceVersion = Just "2.28"}, propDeprecated = Nothing} --- XXX Duplicated object with different types: --- Name {namespace = "Gio", name = "PropertyAction"} -> Property {propName = "state-type", propType = TInterface (Name {namespace = "GLib", name = "VariantType"}), propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The #GVariantType of the state that the action has, or %NULL if the\naction is stateless.", sinceVersion = Just "2.38"}, propDeprecated = Nothing} --- Name {namespace = "Gio", name = "Action"} -> Property {propName = "state-type", propType = TInterface (Name {namespace = "GLib", name = "VariantType"}), propFlags = [PropertyReadable], propReadNullable = Nothing, propWriteNullable = Nothing, propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The #GVariantType of the state that the action has, or %NULL if the\naction is stateless. This is immutable.", sinceVersion = Just "2.28"}, propDeprecated = Nothing} -- VVV Prop "enabled" -- Type: TBasicType TBoolean -- Flags: [PropertyReadable] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@enabled@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' propertyAction #enabled @ -} 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 -- VVV Prop "invert-boolean" -- Type: TBasicType TBoolean -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@invert-boolean@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' propertyAction #invertBoolean @ -} getPropertyActionInvertBoolean :: (MonadIO m, IsPropertyAction o) => o -> m Bool getPropertyActionInvertBoolean obj = liftIO $ B.Properties.getObjectPropertyBool obj "invert-boolean" {- | Construct a `GValueConstruct` with valid value for the “@invert-boolean@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`. -} 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 -- VVV Prop "name" -- Type: TBasicType TUTF8 -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@name@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' propertyAction #name @ -} getPropertyActionName :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe T.Text) getPropertyActionName obj = liftIO $ B.Properties.getObjectPropertyString obj "name" {- | Construct a `GValueConstruct` with valid value for the “@name@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`. -} 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 -- VVV Prop "object" -- Type: TInterface (Name {namespace = "GObject", name = "Object"}) -- Flags: [PropertyWritable,PropertyConstructOnly] -- Nullable: (Nothing,Nothing) {- | Construct a `GValueConstruct` with valid value for the “@object@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`. -} 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 -- VVV Prop "parameter-type" -- Type: TInterface (Name {namespace = "GLib", name = "VariantType"}) -- Flags: [PropertyReadable] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@parameter-type@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' propertyAction #parameterType @ -} 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 -- VVV Prop "property-name" -- Type: TBasicType TUTF8 -- Flags: [PropertyWritable,PropertyConstructOnly] -- Nullable: (Nothing,Nothing) {- | Construct a `GValueConstruct` with valid value for the “@property-name@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`. -} 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 -- VVV Prop "state" -- Type: TVariant -- Flags: [PropertyReadable] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@state@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' propertyAction #state @ -} 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 -- VVV Prop "state-type" -- Type: TInterface (Name {namespace = "GLib", name = "VariantType"}) -- Flags: [PropertyReadable] -- Nullable: (Nothing,Nothing) {- | Get the value of the “@state-type@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' propertyAction #stateType @ -} 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 -- 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' #if ENABLE_OVERLOADING #endif