#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Structs.ToggleActionEntry
(
ToggleActionEntry(..) ,
newZeroToggleActionEntry ,
noToggleActionEntry ,
clearToggleActionEntryAccelerator ,
getToggleActionEntryAccelerator ,
setToggleActionEntryAccelerator ,
#if ENABLE_OVERLOADING
toggleActionEntry_accelerator ,
#endif
clearToggleActionEntryCallback ,
getToggleActionEntryCallback ,
setToggleActionEntryCallback ,
#if ENABLE_OVERLOADING
toggleActionEntry_callback ,
#endif
getToggleActionEntryIsActive ,
setToggleActionEntryIsActive ,
#if ENABLE_OVERLOADING
toggleActionEntry_isActive ,
#endif
clearToggleActionEntryLabel ,
getToggleActionEntryLabel ,
setToggleActionEntryLabel ,
#if ENABLE_OVERLOADING
toggleActionEntry_label ,
#endif
clearToggleActionEntryName ,
getToggleActionEntryName ,
setToggleActionEntryName ,
#if ENABLE_OVERLOADING
toggleActionEntry_name ,
#endif
clearToggleActionEntryStockId ,
getToggleActionEntryStockId ,
setToggleActionEntryStockId ,
#if ENABLE_OVERLOADING
toggleActionEntry_stockId ,
#endif
clearToggleActionEntryTooltip ,
getToggleActionEntryTooltip ,
setToggleActionEntryTooltip ,
#if ENABLE_OVERLOADING
toggleActionEntry_tooltip ,
#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.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 qualified GI.GObject.Callbacks as GObject.Callbacks
newtype ToggleActionEntry = ToggleActionEntry (ManagedPtr ToggleActionEntry)
instance WrappedPtr ToggleActionEntry where
wrappedPtrCalloc = callocBytes 56
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 56 >=> wrapPtr ToggleActionEntry)
wrappedPtrFree = Just ptr_to_g_free
newZeroToggleActionEntry :: MonadIO m => m ToggleActionEntry
newZeroToggleActionEntry = liftIO $ wrappedPtrCalloc >>= wrapPtr ToggleActionEntry
instance tag ~ 'AttrSet => Constructible ToggleActionEntry tag where
new _ attrs = do
o <- newZeroToggleActionEntry
GI.Attributes.set o attrs
return o
noToggleActionEntry :: Maybe ToggleActionEntry
noToggleActionEntry = Nothing
getToggleActionEntryName :: MonadIO m => ToggleActionEntry -> m (Maybe T.Text)
getToggleActionEntryName s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setToggleActionEntryName :: MonadIO m => ToggleActionEntry -> CString -> m ()
setToggleActionEntryName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: CString)
clearToggleActionEntryName :: MonadIO m => ToggleActionEntry -> m ()
clearToggleActionEntryName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data ToggleActionEntryNameFieldInfo
instance AttrInfo ToggleActionEntryNameFieldInfo where
type AttrAllowedOps ToggleActionEntryNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ToggleActionEntryNameFieldInfo = (~) CString
type AttrBaseTypeConstraint ToggleActionEntryNameFieldInfo = (~) ToggleActionEntry
type AttrGetType ToggleActionEntryNameFieldInfo = Maybe T.Text
type AttrLabel ToggleActionEntryNameFieldInfo = "name"
type AttrOrigin ToggleActionEntryNameFieldInfo = ToggleActionEntry
attrGet _ = getToggleActionEntryName
attrSet _ = setToggleActionEntryName
attrConstruct = undefined
attrClear _ = clearToggleActionEntryName
toggleActionEntry_name :: AttrLabelProxy "name"
toggleActionEntry_name = AttrLabelProxy
#endif
getToggleActionEntryStockId :: MonadIO m => ToggleActionEntry -> m (Maybe T.Text)
getToggleActionEntryStockId s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setToggleActionEntryStockId :: MonadIO m => ToggleActionEntry -> CString -> m ()
setToggleActionEntryStockId s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearToggleActionEntryStockId :: MonadIO m => ToggleActionEntry -> m ()
clearToggleActionEntryStockId s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data ToggleActionEntryStockIdFieldInfo
instance AttrInfo ToggleActionEntryStockIdFieldInfo where
type AttrAllowedOps ToggleActionEntryStockIdFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ToggleActionEntryStockIdFieldInfo = (~) CString
type AttrBaseTypeConstraint ToggleActionEntryStockIdFieldInfo = (~) ToggleActionEntry
type AttrGetType ToggleActionEntryStockIdFieldInfo = Maybe T.Text
type AttrLabel ToggleActionEntryStockIdFieldInfo = "stock_id"
type AttrOrigin ToggleActionEntryStockIdFieldInfo = ToggleActionEntry
attrGet _ = getToggleActionEntryStockId
attrSet _ = setToggleActionEntryStockId
attrConstruct = undefined
attrClear _ = clearToggleActionEntryStockId
toggleActionEntry_stockId :: AttrLabelProxy "stockId"
toggleActionEntry_stockId = AttrLabelProxy
#endif
getToggleActionEntryLabel :: MonadIO m => ToggleActionEntry -> m (Maybe T.Text)
getToggleActionEntryLabel 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
setToggleActionEntryLabel :: MonadIO m => ToggleActionEntry -> CString -> m ()
setToggleActionEntryLabel s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: CString)
clearToggleActionEntryLabel :: MonadIO m => ToggleActionEntry -> m ()
clearToggleActionEntryLabel s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data ToggleActionEntryLabelFieldInfo
instance AttrInfo ToggleActionEntryLabelFieldInfo where
type AttrAllowedOps ToggleActionEntryLabelFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ToggleActionEntryLabelFieldInfo = (~) CString
type AttrBaseTypeConstraint ToggleActionEntryLabelFieldInfo = (~) ToggleActionEntry
type AttrGetType ToggleActionEntryLabelFieldInfo = Maybe T.Text
type AttrLabel ToggleActionEntryLabelFieldInfo = "label"
type AttrOrigin ToggleActionEntryLabelFieldInfo = ToggleActionEntry
attrGet _ = getToggleActionEntryLabel
attrSet _ = setToggleActionEntryLabel
attrConstruct = undefined
attrClear _ = clearToggleActionEntryLabel
toggleActionEntry_label :: AttrLabelProxy "label"
toggleActionEntry_label = AttrLabelProxy
#endif
getToggleActionEntryAccelerator :: MonadIO m => ToggleActionEntry -> m (Maybe T.Text)
getToggleActionEntryAccelerator 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
setToggleActionEntryAccelerator :: MonadIO m => ToggleActionEntry -> CString -> m ()
setToggleActionEntryAccelerator s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: CString)
clearToggleActionEntryAccelerator :: MonadIO m => ToggleActionEntry -> m ()
clearToggleActionEntryAccelerator s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data ToggleActionEntryAcceleratorFieldInfo
instance AttrInfo ToggleActionEntryAcceleratorFieldInfo where
type AttrAllowedOps ToggleActionEntryAcceleratorFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ToggleActionEntryAcceleratorFieldInfo = (~) CString
type AttrBaseTypeConstraint ToggleActionEntryAcceleratorFieldInfo = (~) ToggleActionEntry
type AttrGetType ToggleActionEntryAcceleratorFieldInfo = Maybe T.Text
type AttrLabel ToggleActionEntryAcceleratorFieldInfo = "accelerator"
type AttrOrigin ToggleActionEntryAcceleratorFieldInfo = ToggleActionEntry
attrGet _ = getToggleActionEntryAccelerator
attrSet _ = setToggleActionEntryAccelerator
attrConstruct = undefined
attrClear _ = clearToggleActionEntryAccelerator
toggleActionEntry_accelerator :: AttrLabelProxy "accelerator"
toggleActionEntry_accelerator = AttrLabelProxy
#endif
getToggleActionEntryTooltip :: MonadIO m => ToggleActionEntry -> m (Maybe T.Text)
getToggleActionEntryTooltip s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setToggleActionEntryTooltip :: MonadIO m => ToggleActionEntry -> CString -> m ()
setToggleActionEntryTooltip s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: CString)
clearToggleActionEntryTooltip :: MonadIO m => ToggleActionEntry -> m ()
clearToggleActionEntryTooltip s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data ToggleActionEntryTooltipFieldInfo
instance AttrInfo ToggleActionEntryTooltipFieldInfo where
type AttrAllowedOps ToggleActionEntryTooltipFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ToggleActionEntryTooltipFieldInfo = (~) CString
type AttrBaseTypeConstraint ToggleActionEntryTooltipFieldInfo = (~) ToggleActionEntry
type AttrGetType ToggleActionEntryTooltipFieldInfo = Maybe T.Text
type AttrLabel ToggleActionEntryTooltipFieldInfo = "tooltip"
type AttrOrigin ToggleActionEntryTooltipFieldInfo = ToggleActionEntry
attrGet _ = getToggleActionEntryTooltip
attrSet _ = setToggleActionEntryTooltip
attrConstruct = undefined
attrClear _ = clearToggleActionEntryTooltip
toggleActionEntry_tooltip :: AttrLabelProxy "tooltip"
toggleActionEntry_tooltip = AttrLabelProxy
#endif
getToggleActionEntryCallback :: MonadIO m => ToggleActionEntry -> m (Maybe GObject.Callbacks.Callback)
getToggleActionEntryCallback s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 40) :: IO (FunPtr GObject.Callbacks.C_Callback)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = GObject.Callbacks.dynamic_Callback val'
return val''
return result
setToggleActionEntryCallback :: MonadIO m => ToggleActionEntry -> FunPtr GObject.Callbacks.C_Callback -> m ()
setToggleActionEntryCallback s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 40) (val :: FunPtr GObject.Callbacks.C_Callback)
clearToggleActionEntryCallback :: MonadIO m => ToggleActionEntry -> m ()
clearToggleActionEntryCallback s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 40) (FP.nullFunPtr :: FunPtr GObject.Callbacks.C_Callback)
#if ENABLE_OVERLOADING
data ToggleActionEntryCallbackFieldInfo
instance AttrInfo ToggleActionEntryCallbackFieldInfo where
type AttrAllowedOps ToggleActionEntryCallbackFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ToggleActionEntryCallbackFieldInfo = (~) (FunPtr GObject.Callbacks.C_Callback)
type AttrBaseTypeConstraint ToggleActionEntryCallbackFieldInfo = (~) ToggleActionEntry
type AttrGetType ToggleActionEntryCallbackFieldInfo = Maybe GObject.Callbacks.Callback
type AttrLabel ToggleActionEntryCallbackFieldInfo = "callback"
type AttrOrigin ToggleActionEntryCallbackFieldInfo = ToggleActionEntry
attrGet _ = getToggleActionEntryCallback
attrSet _ = setToggleActionEntryCallback
attrConstruct = undefined
attrClear _ = clearToggleActionEntryCallback
toggleActionEntry_callback :: AttrLabelProxy "callback"
toggleActionEntry_callback = AttrLabelProxy
#endif
getToggleActionEntryIsActive :: MonadIO m => ToggleActionEntry -> m Bool
getToggleActionEntryIsActive s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 48) :: IO CInt
let val' = (/= 0) val
return val'
setToggleActionEntryIsActive :: MonadIO m => ToggleActionEntry -> Bool -> m ()
setToggleActionEntryIsActive s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 48) (val' :: CInt)
#if ENABLE_OVERLOADING
data ToggleActionEntryIsActiveFieldInfo
instance AttrInfo ToggleActionEntryIsActiveFieldInfo where
type AttrAllowedOps ToggleActionEntryIsActiveFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ToggleActionEntryIsActiveFieldInfo = (~) Bool
type AttrBaseTypeConstraint ToggleActionEntryIsActiveFieldInfo = (~) ToggleActionEntry
type AttrGetType ToggleActionEntryIsActiveFieldInfo = Bool
type AttrLabel ToggleActionEntryIsActiveFieldInfo = "is_active"
type AttrOrigin ToggleActionEntryIsActiveFieldInfo = ToggleActionEntry
attrGet _ = getToggleActionEntryIsActive
attrSet _ = setToggleActionEntryIsActive
attrConstruct = undefined
attrClear _ = undefined
toggleActionEntry_isActive :: AttrLabelProxy "isActive"
toggleActionEntry_isActive = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList ToggleActionEntry
type instance O.AttributeList ToggleActionEntry = ToggleActionEntryAttributeList
type ToggleActionEntryAttributeList = ('[ '("name", ToggleActionEntryNameFieldInfo), '("stockId", ToggleActionEntryStockIdFieldInfo), '("label", ToggleActionEntryLabelFieldInfo), '("accelerator", ToggleActionEntryAcceleratorFieldInfo), '("tooltip", ToggleActionEntryTooltipFieldInfo), '("callback", ToggleActionEntryCallbackFieldInfo), '("isActive", ToggleActionEntryIsActiveFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveToggleActionEntryMethod (t :: Symbol) (o :: *) :: * where
ResolveToggleActionEntryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveToggleActionEntryMethod t ToggleActionEntry, O.MethodInfo info ToggleActionEntry p) => O.IsLabelProxy t (ToggleActionEntry -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveToggleActionEntryMethod t ToggleActionEntry, O.MethodInfo info ToggleActionEntry p) => O.IsLabel t (ToggleActionEntry -> 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