{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.PropertyAction
(
PropertyAction(..) ,
IsPropertyAction ,
toPropertyAction ,
noPropertyAction ,
#if defined(ENABLE_OVERLOADING)
ResolvePropertyActionMethod ,
#endif
propertyActionNew ,
#if defined(ENABLE_OVERLOADING)
PropertyActionEnabledPropertyInfo ,
#endif
getPropertyActionEnabled ,
#if defined(ENABLE_OVERLOADING)
propertyActionEnabled ,
#endif
#if defined(ENABLE_OVERLOADING)
PropertyActionInvertBooleanPropertyInfo ,
#endif
constructPropertyActionInvertBoolean ,
getPropertyActionInvertBoolean ,
#if defined(ENABLE_OVERLOADING)
propertyActionInvertBoolean ,
#endif
#if defined(ENABLE_OVERLOADING)
PropertyActionNamePropertyInfo ,
#endif
constructPropertyActionName ,
getPropertyActionName ,
#if defined(ENABLE_OVERLOADING)
propertyActionName ,
#endif
#if defined(ENABLE_OVERLOADING)
PropertyActionObjectPropertyInfo ,
#endif
constructPropertyActionObject ,
#if defined(ENABLE_OVERLOADING)
propertyActionObject ,
#endif
#if defined(ENABLE_OVERLOADING)
PropertyActionParameterTypePropertyInfo ,
#endif
getPropertyActionParameterType ,
#if defined(ENABLE_OVERLOADING)
propertyActionParameterType ,
#endif
#if defined(ENABLE_OVERLOADING)
PropertyActionPropertyNamePropertyInfo ,
#endif
constructPropertyActionPropertyName ,
#if defined(ENABLE_OVERLOADING)
propertyActionPropertyName ,
#endif
#if defined(ENABLE_OVERLOADING)
PropertyActionStatePropertyInfo ,
#endif
getPropertyActionState ,
#if defined(ENABLE_OVERLOADING)
propertyActionState ,
#endif
#if defined(ENABLE_OVERLOADING)
PropertyActionStateTypePropertyInfo ,
#endif
getPropertyActionStateType ,
#if defined(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.GI.Base.Signals as B.Signals
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)
deriving (Eq)
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
instance B.GValue.IsGValue PropertyAction where
toGValue o = do
gtype <- c_g_property_action_get_type
B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)
fromGValue gv = do
ptr <- B.GValue.get_object gv :: IO (Ptr PropertyAction)
B.ManagedPtr.newObject PropertyAction ptr
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 defined(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 @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getPropertyActionEnabled :: (MonadIO m, IsPropertyAction o) => o -> m Bool
getPropertyActionEnabled obj = liftIO $ B.Properties.getObjectPropertyBool obj "enabled"
#if defined(ENABLE_OVERLOADING)
data PropertyActionEnabledPropertyInfo
instance AttrInfo PropertyActionEnabledPropertyInfo where
type AttrAllowedOps PropertyActionEnabledPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint PropertyActionEnabledPropertyInfo = IsPropertyAction
type AttrSetTypeConstraint PropertyActionEnabledPropertyInfo = (~) ()
type AttrTransferTypeConstraint PropertyActionEnabledPropertyInfo = (~) ()
type AttrTransferType PropertyActionEnabledPropertyInfo = ()
type AttrGetType PropertyActionEnabledPropertyInfo = Bool
type AttrLabel PropertyActionEnabledPropertyInfo = "enabled"
type AttrOrigin PropertyActionEnabledPropertyInfo = PropertyAction
attrGet = getPropertyActionEnabled
attrSet = undefined
attrTransfer _ = 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 defined(ENABLE_OVERLOADING)
data PropertyActionInvertBooleanPropertyInfo
instance AttrInfo PropertyActionInvertBooleanPropertyInfo where
type AttrAllowedOps PropertyActionInvertBooleanPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint PropertyActionInvertBooleanPropertyInfo = IsPropertyAction
type AttrSetTypeConstraint PropertyActionInvertBooleanPropertyInfo = (~) Bool
type AttrTransferTypeConstraint PropertyActionInvertBooleanPropertyInfo = (~) Bool
type AttrTransferType PropertyActionInvertBooleanPropertyInfo = Bool
type AttrGetType PropertyActionInvertBooleanPropertyInfo = Bool
type AttrLabel PropertyActionInvertBooleanPropertyInfo = "invert-boolean"
type AttrOrigin PropertyActionInvertBooleanPropertyInfo = PropertyAction
attrGet = getPropertyActionInvertBoolean
attrSet = undefined
attrTransfer _ v = do
return v
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 defined(ENABLE_OVERLOADING)
data PropertyActionNamePropertyInfo
instance AttrInfo PropertyActionNamePropertyInfo where
type AttrAllowedOps PropertyActionNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint PropertyActionNamePropertyInfo = IsPropertyAction
type AttrSetTypeConstraint PropertyActionNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint PropertyActionNamePropertyInfo = (~) T.Text
type AttrTransferType PropertyActionNamePropertyInfo = T.Text
type AttrGetType PropertyActionNamePropertyInfo = (Maybe T.Text)
type AttrLabel PropertyActionNamePropertyInfo = "name"
type AttrOrigin PropertyActionNamePropertyInfo = PropertyAction
attrGet = getPropertyActionName
attrSet = undefined
attrTransfer _ v = do
return v
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 defined(ENABLE_OVERLOADING)
data PropertyActionObjectPropertyInfo
instance AttrInfo PropertyActionObjectPropertyInfo where
type AttrAllowedOps PropertyActionObjectPropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrBaseTypeConstraint PropertyActionObjectPropertyInfo = IsPropertyAction
type AttrSetTypeConstraint PropertyActionObjectPropertyInfo = GObject.Object.IsObject
type AttrTransferTypeConstraint PropertyActionObjectPropertyInfo = GObject.Object.IsObject
type AttrTransferType PropertyActionObjectPropertyInfo = GObject.Object.Object
type AttrGetType PropertyActionObjectPropertyInfo = ()
type AttrLabel PropertyActionObjectPropertyInfo = "object"
type AttrOrigin PropertyActionObjectPropertyInfo = PropertyAction
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo GObject.Object.Object v
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 defined(ENABLE_OVERLOADING)
data PropertyActionParameterTypePropertyInfo
instance AttrInfo PropertyActionParameterTypePropertyInfo where
type AttrAllowedOps PropertyActionParameterTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint PropertyActionParameterTypePropertyInfo = IsPropertyAction
type AttrSetTypeConstraint PropertyActionParameterTypePropertyInfo = (~) ()
type AttrTransferTypeConstraint PropertyActionParameterTypePropertyInfo = (~) ()
type AttrTransferType PropertyActionParameterTypePropertyInfo = ()
type AttrGetType PropertyActionParameterTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel PropertyActionParameterTypePropertyInfo = "parameter-type"
type AttrOrigin PropertyActionParameterTypePropertyInfo = PropertyAction
attrGet = getPropertyActionParameterType
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
constructPropertyActionPropertyName :: (IsPropertyAction o) => T.Text -> IO (GValueConstruct o)
constructPropertyActionPropertyName val = B.Properties.constructObjectPropertyString "property-name" (Just val)
#if defined(ENABLE_OVERLOADING)
data PropertyActionPropertyNamePropertyInfo
instance AttrInfo PropertyActionPropertyNamePropertyInfo where
type AttrAllowedOps PropertyActionPropertyNamePropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrBaseTypeConstraint PropertyActionPropertyNamePropertyInfo = IsPropertyAction
type AttrSetTypeConstraint PropertyActionPropertyNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint PropertyActionPropertyNamePropertyInfo = (~) T.Text
type AttrTransferType PropertyActionPropertyNamePropertyInfo = T.Text
type AttrGetType PropertyActionPropertyNamePropertyInfo = ()
type AttrLabel PropertyActionPropertyNamePropertyInfo = "property-name"
type AttrOrigin PropertyActionPropertyNamePropertyInfo = PropertyAction
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructPropertyActionPropertyName
attrClear = undefined
#endif
getPropertyActionState :: (MonadIO m, IsPropertyAction o) => o -> m (Maybe GVariant)
getPropertyActionState obj = liftIO $ B.Properties.getObjectPropertyVariant obj "state"
#if defined(ENABLE_OVERLOADING)
data PropertyActionStatePropertyInfo
instance AttrInfo PropertyActionStatePropertyInfo where
type AttrAllowedOps PropertyActionStatePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint PropertyActionStatePropertyInfo = IsPropertyAction
type AttrSetTypeConstraint PropertyActionStatePropertyInfo = (~) ()
type AttrTransferTypeConstraint PropertyActionStatePropertyInfo = (~) ()
type AttrTransferType PropertyActionStatePropertyInfo = ()
type AttrGetType PropertyActionStatePropertyInfo = (Maybe GVariant)
type AttrLabel PropertyActionStatePropertyInfo = "state"
type AttrOrigin PropertyActionStatePropertyInfo = PropertyAction
attrGet = getPropertyActionState
attrSet = undefined
attrTransfer _ = 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 defined(ENABLE_OVERLOADING)
data PropertyActionStateTypePropertyInfo
instance AttrInfo PropertyActionStateTypePropertyInfo where
type AttrAllowedOps PropertyActionStateTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint PropertyActionStateTypePropertyInfo = IsPropertyAction
type AttrSetTypeConstraint PropertyActionStateTypePropertyInfo = (~) ()
type AttrTransferTypeConstraint PropertyActionStateTypePropertyInfo = (~) ()
type AttrTransferType PropertyActionStateTypePropertyInfo = ()
type AttrGetType PropertyActionStateTypePropertyInfo = (Maybe GLib.VariantType.VariantType)
type AttrLabel PropertyActionStateTypePropertyInfo = "state-type"
type AttrOrigin PropertyActionStateTypePropertyInfo = PropertyAction
attrGet = getPropertyActionStateType
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(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 defined(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 defined(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 defined(ENABLE_OVERLOADING)
#endif