#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Structs.PadActionEntry
(
PadActionEntry(..) ,
newZeroPadActionEntry ,
noPadActionEntry ,
clearPadActionEntryActionName ,
getPadActionEntryActionName ,
#if ENABLE_OVERLOADING
padActionEntry_actionName ,
#endif
setPadActionEntryActionName ,
getPadActionEntryIndex ,
#if ENABLE_OVERLOADING
padActionEntry_index ,
#endif
setPadActionEntryIndex ,
clearPadActionEntryLabel ,
getPadActionEntryLabel ,
#if ENABLE_OVERLOADING
padActionEntry_label ,
#endif
setPadActionEntryLabel ,
getPadActionEntryMode ,
#if ENABLE_OVERLOADING
padActionEntry_mode ,
#endif
setPadActionEntryMode ,
getPadActionEntryType ,
#if ENABLE_OVERLOADING
padActionEntry_type ,
#endif
setPadActionEntryType ,
) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
newtype PadActionEntry = PadActionEntry (ManagedPtr PadActionEntry)
instance WrappedPtr PadActionEntry where
wrappedPtrCalloc = callocBytes 32
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 32 >=> wrapPtr PadActionEntry)
wrappedPtrFree = Just ptr_to_g_free
newZeroPadActionEntry :: MonadIO m => m PadActionEntry
newZeroPadActionEntry = liftIO $ wrappedPtrCalloc >>= wrapPtr PadActionEntry
instance tag ~ 'AttrSet => Constructible PadActionEntry tag where
new _ attrs = do
o <- newZeroPadActionEntry
GI.Attributes.set o attrs
return o
noPadActionEntry :: Maybe PadActionEntry
noPadActionEntry = Nothing
getPadActionEntryType :: MonadIO m => PadActionEntry -> m Gtk.Enums.PadActionType
getPadActionEntryType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
setPadActionEntryType :: MonadIO m => PadActionEntry -> Gtk.Enums.PadActionType -> m ()
setPadActionEntryType s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 0) (val' :: CUInt)
#if ENABLE_OVERLOADING
data PadActionEntryTypeFieldInfo
instance AttrInfo PadActionEntryTypeFieldInfo where
type AttrAllowedOps PadActionEntryTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint PadActionEntryTypeFieldInfo = (~) Gtk.Enums.PadActionType
type AttrBaseTypeConstraint PadActionEntryTypeFieldInfo = (~) PadActionEntry
type AttrGetType PadActionEntryTypeFieldInfo = Gtk.Enums.PadActionType
type AttrLabel PadActionEntryTypeFieldInfo = "type"
type AttrOrigin PadActionEntryTypeFieldInfo = PadActionEntry
attrGet _ = getPadActionEntryType
attrSet _ = setPadActionEntryType
attrConstruct = undefined
attrClear _ = undefined
padActionEntry_type :: AttrLabelProxy "type"
padActionEntry_type = AttrLabelProxy
#endif
getPadActionEntryIndex :: MonadIO m => PadActionEntry -> m Int32
getPadActionEntryIndex s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 4) :: IO Int32
return val
setPadActionEntryIndex :: MonadIO m => PadActionEntry -> Int32 -> m ()
setPadActionEntryIndex s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 4) (val :: Int32)
#if ENABLE_OVERLOADING
data PadActionEntryIndexFieldInfo
instance AttrInfo PadActionEntryIndexFieldInfo where
type AttrAllowedOps PadActionEntryIndexFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint PadActionEntryIndexFieldInfo = (~) Int32
type AttrBaseTypeConstraint PadActionEntryIndexFieldInfo = (~) PadActionEntry
type AttrGetType PadActionEntryIndexFieldInfo = Int32
type AttrLabel PadActionEntryIndexFieldInfo = "index"
type AttrOrigin PadActionEntryIndexFieldInfo = PadActionEntry
attrGet _ = getPadActionEntryIndex
attrSet _ = setPadActionEntryIndex
attrConstruct = undefined
attrClear _ = undefined
padActionEntry_index :: AttrLabelProxy "index"
padActionEntry_index = AttrLabelProxy
#endif
getPadActionEntryMode :: MonadIO m => PadActionEntry -> m Int32
getPadActionEntryMode s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO Int32
return val
setPadActionEntryMode :: MonadIO m => PadActionEntry -> Int32 -> m ()
setPadActionEntryMode s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Int32)
#if ENABLE_OVERLOADING
data PadActionEntryModeFieldInfo
instance AttrInfo PadActionEntryModeFieldInfo where
type AttrAllowedOps PadActionEntryModeFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint PadActionEntryModeFieldInfo = (~) Int32
type AttrBaseTypeConstraint PadActionEntryModeFieldInfo = (~) PadActionEntry
type AttrGetType PadActionEntryModeFieldInfo = Int32
type AttrLabel PadActionEntryModeFieldInfo = "mode"
type AttrOrigin PadActionEntryModeFieldInfo = PadActionEntry
attrGet _ = getPadActionEntryMode
attrSet _ = setPadActionEntryMode
attrConstruct = undefined
attrClear _ = undefined
padActionEntry_mode :: AttrLabelProxy "mode"
padActionEntry_mode = AttrLabelProxy
#endif
getPadActionEntryLabel :: MonadIO m => PadActionEntry -> m (Maybe T.Text)
getPadActionEntryLabel s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setPadActionEntryLabel :: MonadIO m => PadActionEntry -> CString -> m ()
setPadActionEntryLabel s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: CString)
clearPadActionEntryLabel :: MonadIO m => PadActionEntry -> m ()
clearPadActionEntryLabel s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data PadActionEntryLabelFieldInfo
instance AttrInfo PadActionEntryLabelFieldInfo where
type AttrAllowedOps PadActionEntryLabelFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint PadActionEntryLabelFieldInfo = (~) CString
type AttrBaseTypeConstraint PadActionEntryLabelFieldInfo = (~) PadActionEntry
type AttrGetType PadActionEntryLabelFieldInfo = Maybe T.Text
type AttrLabel PadActionEntryLabelFieldInfo = "label"
type AttrOrigin PadActionEntryLabelFieldInfo = PadActionEntry
attrGet _ = getPadActionEntryLabel
attrSet _ = setPadActionEntryLabel
attrConstruct = undefined
attrClear _ = clearPadActionEntryLabel
padActionEntry_label :: AttrLabelProxy "label"
padActionEntry_label = AttrLabelProxy
#endif
getPadActionEntryActionName :: MonadIO m => PadActionEntry -> m (Maybe T.Text)
getPadActionEntryActionName s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setPadActionEntryActionName :: MonadIO m => PadActionEntry -> CString -> m ()
setPadActionEntryActionName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: CString)
clearPadActionEntryActionName :: MonadIO m => PadActionEntry -> m ()
clearPadActionEntryActionName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data PadActionEntryActionNameFieldInfo
instance AttrInfo PadActionEntryActionNameFieldInfo where
type AttrAllowedOps PadActionEntryActionNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint PadActionEntryActionNameFieldInfo = (~) CString
type AttrBaseTypeConstraint PadActionEntryActionNameFieldInfo = (~) PadActionEntry
type AttrGetType PadActionEntryActionNameFieldInfo = Maybe T.Text
type AttrLabel PadActionEntryActionNameFieldInfo = "action_name"
type AttrOrigin PadActionEntryActionNameFieldInfo = PadActionEntry
attrGet _ = getPadActionEntryActionName
attrSet _ = setPadActionEntryActionName
attrConstruct = undefined
attrClear _ = clearPadActionEntryActionName
padActionEntry_actionName :: AttrLabelProxy "actionName"
padActionEntry_actionName = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList PadActionEntry
type instance O.AttributeList PadActionEntry = PadActionEntryAttributeList
type PadActionEntryAttributeList = ('[ '("type", PadActionEntryTypeFieldInfo), '("index", PadActionEntryIndexFieldInfo), '("mode", PadActionEntryModeFieldInfo), '("label", PadActionEntryLabelFieldInfo), '("actionName", PadActionEntryActionNameFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolvePadActionEntryMethod (t :: Symbol) (o :: *) :: * where
ResolvePadActionEntryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePadActionEntryMethod t PadActionEntry, O.MethodInfo info PadActionEntry p) => O.IsLabelProxy t (PadActionEntry -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolvePadActionEntryMethod t PadActionEntry, O.MethodInfo info PadActionEntry p) => O.IsLabel t (PadActionEntry -> 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
#endif