{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GObject.Structs.EnumClass
(
EnumClass(..) ,
newZeroEnumClass ,
#if defined(ENABLE_OVERLOADING)
ResolveEnumClassMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
enumClass_gTypeClass ,
#endif
getEnumClassGTypeClass ,
#if defined(ENABLE_OVERLOADING)
enumClass_maximum ,
#endif
getEnumClassMaximum ,
setEnumClassMaximum ,
#if defined(ENABLE_OVERLOADING)
enumClass_minimum ,
#endif
getEnumClassMinimum ,
setEnumClassMinimum ,
#if defined(ENABLE_OVERLOADING)
enumClass_nValues ,
#endif
getEnumClassNValues ,
setEnumClassNValues ,
clearEnumClassValues ,
#if defined(ENABLE_OVERLOADING)
enumClass_values ,
#endif
getEnumClassValues ,
setEnumClassValues ,
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
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 Control.Monad.IO.Class as MIO
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 {-# SOURCE #-} qualified GI.GObject.Structs.EnumValue as GObject.EnumValue
import {-# SOURCE #-} qualified GI.GObject.Structs.TypeClass as GObject.TypeClass
newtype EnumClass = EnumClass (SP.ManagedPtr EnumClass)
deriving (EnumClass -> EnumClass -> Bool
(EnumClass -> EnumClass -> Bool)
-> (EnumClass -> EnumClass -> Bool) -> Eq EnumClass
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnumClass -> EnumClass -> Bool
$c/= :: EnumClass -> EnumClass -> Bool
== :: EnumClass -> EnumClass -> Bool
$c== :: EnumClass -> EnumClass -> Bool
Eq)
instance SP.ManagedPtrNewtype EnumClass where
toManagedPtr :: EnumClass -> ManagedPtr EnumClass
toManagedPtr (EnumClass ManagedPtr EnumClass
p) = ManagedPtr EnumClass
p
instance BoxedPtr EnumClass where
boxedPtrCopy :: EnumClass -> IO EnumClass
boxedPtrCopy = \EnumClass
p -> EnumClass -> (Ptr EnumClass -> IO EnumClass) -> IO EnumClass
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr EnumClass
p (Int -> Ptr EnumClass -> IO (Ptr EnumClass)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
32 (Ptr EnumClass -> IO (Ptr EnumClass))
-> (Ptr EnumClass -> IO EnumClass) -> Ptr EnumClass -> IO EnumClass
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr EnumClass -> EnumClass)
-> Ptr EnumClass -> IO EnumClass
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr EnumClass -> EnumClass
EnumClass)
boxedPtrFree :: EnumClass -> IO ()
boxedPtrFree = \EnumClass
x -> EnumClass -> (Ptr EnumClass -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr EnumClass
x Ptr EnumClass -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr EnumClass where
boxedPtrCalloc :: IO (Ptr EnumClass)
boxedPtrCalloc = Int -> IO (Ptr EnumClass)
forall a. Int -> IO (Ptr a)
callocBytes Int
32
newZeroEnumClass :: MonadIO m => m EnumClass
newZeroEnumClass :: m EnumClass
newZeroEnumClass = IO EnumClass -> m EnumClass
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EnumClass -> m EnumClass) -> IO EnumClass -> m EnumClass
forall a b. (a -> b) -> a -> b
$ IO (Ptr EnumClass)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr EnumClass)
-> (Ptr EnumClass -> IO EnumClass) -> IO EnumClass
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr EnumClass -> EnumClass)
-> Ptr EnumClass -> IO EnumClass
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr EnumClass -> EnumClass
EnumClass
instance tag ~ 'AttrSet => Constructible EnumClass tag where
new :: (ManagedPtr EnumClass -> EnumClass)
-> [AttrOp EnumClass tag] -> m EnumClass
new ManagedPtr EnumClass -> EnumClass
_ [AttrOp EnumClass tag]
attrs = do
EnumClass
o <- m EnumClass
forall (m :: * -> *). MonadIO m => m EnumClass
newZeroEnumClass
EnumClass -> [AttrOp EnumClass 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set EnumClass
o [AttrOp EnumClass tag]
[AttrOp EnumClass 'AttrSet]
attrs
EnumClass -> m EnumClass
forall (m :: * -> *) a. Monad m => a -> m a
return EnumClass
o
getEnumClassGTypeClass :: MonadIO m => EnumClass -> m GObject.TypeClass.TypeClass
getEnumClassGTypeClass :: EnumClass -> m TypeClass
getEnumClassGTypeClass EnumClass
s = IO TypeClass -> m TypeClass
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TypeClass -> m TypeClass) -> IO TypeClass -> m TypeClass
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO TypeClass) -> IO TypeClass
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO TypeClass) -> IO TypeClass)
-> (Ptr EnumClass -> IO TypeClass) -> IO TypeClass
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
let val :: Ptr TypeClass
val = Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr TypeClass
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr GObject.TypeClass.TypeClass)
TypeClass
val' <- ((ManagedPtr TypeClass -> TypeClass)
-> Ptr TypeClass -> IO TypeClass
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TypeClass -> TypeClass
GObject.TypeClass.TypeClass) Ptr TypeClass
val
TypeClass -> IO TypeClass
forall (m :: * -> *) a. Monad m => a -> m a
return TypeClass
val'
#if defined(ENABLE_OVERLOADING)
data EnumClassGTypeClassFieldInfo
instance AttrInfo EnumClassGTypeClassFieldInfo where
type AttrBaseTypeConstraint EnumClassGTypeClassFieldInfo = (~) EnumClass
type AttrAllowedOps EnumClassGTypeClassFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint EnumClassGTypeClassFieldInfo = (~) (Ptr GObject.TypeClass.TypeClass)
type AttrTransferTypeConstraint EnumClassGTypeClassFieldInfo = (~)(Ptr GObject.TypeClass.TypeClass)
type AttrTransferType EnumClassGTypeClassFieldInfo = (Ptr GObject.TypeClass.TypeClass)
type AttrGetType EnumClassGTypeClassFieldInfo = GObject.TypeClass.TypeClass
type AttrLabel EnumClassGTypeClassFieldInfo = "g_type_class"
type AttrOrigin EnumClassGTypeClassFieldInfo = EnumClass
attrGet = getEnumClassGTypeClass
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
attrTransfer = undefined
enumClass_gTypeClass :: AttrLabelProxy "gTypeClass"
enumClass_gTypeClass = AttrLabelProxy
#endif
getEnumClassMinimum :: MonadIO m => EnumClass -> m Int32
getEnumClassMinimum :: EnumClass -> m Int32
getEnumClassMinimum EnumClass
s = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO Int32) -> IO Int32)
-> (Ptr EnumClass -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO Int32
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setEnumClassMinimum :: MonadIO m => EnumClass -> Int32 -> m ()
setEnumClassMinimum :: EnumClass -> Int32 -> m ()
setEnumClassMinimum EnumClass
s Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO ()) -> IO ())
-> (Ptr EnumClass -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data EnumClassMinimumFieldInfo
instance AttrInfo EnumClassMinimumFieldInfo where
type AttrBaseTypeConstraint EnumClassMinimumFieldInfo = (~) EnumClass
type AttrAllowedOps EnumClassMinimumFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EnumClassMinimumFieldInfo = (~) Int32
type AttrTransferTypeConstraint EnumClassMinimumFieldInfo = (~)Int32
type AttrTransferType EnumClassMinimumFieldInfo = Int32
type AttrGetType EnumClassMinimumFieldInfo = Int32
type AttrLabel EnumClassMinimumFieldInfo = "minimum"
type AttrOrigin EnumClassMinimumFieldInfo = EnumClass
attrGet = getEnumClassMinimum
attrSet = setEnumClassMinimum
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
enumClass_minimum :: AttrLabelProxy "minimum"
enumClass_minimum = AttrLabelProxy
#endif
getEnumClassMaximum :: MonadIO m => EnumClass -> m Int32
getEnumClassMaximum :: EnumClass -> m Int32
getEnumClassMaximum EnumClass
s = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO Int32) -> IO Int32)
-> (Ptr EnumClass -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) :: IO Int32
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setEnumClassMaximum :: MonadIO m => EnumClass -> Int32 -> m ()
setEnumClassMaximum :: EnumClass -> Int32 -> m ()
setEnumClassMaximum EnumClass
s Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO ()) -> IO ())
-> (Ptr EnumClass -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data EnumClassMaximumFieldInfo
instance AttrInfo EnumClassMaximumFieldInfo where
type AttrBaseTypeConstraint EnumClassMaximumFieldInfo = (~) EnumClass
type AttrAllowedOps EnumClassMaximumFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EnumClassMaximumFieldInfo = (~) Int32
type AttrTransferTypeConstraint EnumClassMaximumFieldInfo = (~)Int32
type AttrTransferType EnumClassMaximumFieldInfo = Int32
type AttrGetType EnumClassMaximumFieldInfo = Int32
type AttrLabel EnumClassMaximumFieldInfo = "maximum"
type AttrOrigin EnumClassMaximumFieldInfo = EnumClass
attrGet = getEnumClassMaximum
attrSet = setEnumClassMaximum
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
enumClass_maximum :: AttrLabelProxy "maximum"
enumClass_maximum = AttrLabelProxy
#endif
getEnumClassNValues :: MonadIO m => EnumClass -> m Word32
getEnumClassNValues :: EnumClass -> m Word32
getEnumClassNValues EnumClass
s = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO Word32) -> IO Word32)
-> (Ptr EnumClass -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setEnumClassNValues :: MonadIO m => EnumClass -> Word32 -> m ()
setEnumClassNValues :: EnumClass -> Word32 -> m ()
setEnumClassNValues EnumClass
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO ()) -> IO ())
-> (Ptr EnumClass -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data EnumClassNValuesFieldInfo
instance AttrInfo EnumClassNValuesFieldInfo where
type AttrBaseTypeConstraint EnumClassNValuesFieldInfo = (~) EnumClass
type AttrAllowedOps EnumClassNValuesFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint EnumClassNValuesFieldInfo = (~) Word32
type AttrTransferTypeConstraint EnumClassNValuesFieldInfo = (~)Word32
type AttrTransferType EnumClassNValuesFieldInfo = Word32
type AttrGetType EnumClassNValuesFieldInfo = Word32
type AttrLabel EnumClassNValuesFieldInfo = "n_values"
type AttrOrigin EnumClassNValuesFieldInfo = EnumClass
attrGet = getEnumClassNValues
attrSet = setEnumClassNValues
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
enumClass_nValues :: AttrLabelProxy "nValues"
enumClass_nValues = AttrLabelProxy
#endif
getEnumClassValues :: MonadIO m => EnumClass -> m (Maybe GObject.EnumValue.EnumValue)
getEnumClassValues :: EnumClass -> m (Maybe EnumValue)
getEnumClassValues EnumClass
s = IO (Maybe EnumValue) -> m (Maybe EnumValue)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe EnumValue) -> m (Maybe EnumValue))
-> IO (Maybe EnumValue) -> m (Maybe EnumValue)
forall a b. (a -> b) -> a -> b
$ EnumClass
-> (Ptr EnumClass -> IO (Maybe EnumValue)) -> IO (Maybe EnumValue)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO (Maybe EnumValue)) -> IO (Maybe EnumValue))
-> (Ptr EnumClass -> IO (Maybe EnumValue)) -> IO (Maybe EnumValue)
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Ptr EnumValue
val <- Ptr (Ptr EnumValue) -> IO (Ptr EnumValue)
forall a. Storable a => Ptr a -> IO a
peek (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr (Ptr EnumValue)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO (Ptr GObject.EnumValue.EnumValue)
Maybe EnumValue
result <- Ptr EnumValue
-> (Ptr EnumValue -> IO EnumValue) -> IO (Maybe EnumValue)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr EnumValue
val ((Ptr EnumValue -> IO EnumValue) -> IO (Maybe EnumValue))
-> (Ptr EnumValue -> IO EnumValue) -> IO (Maybe EnumValue)
forall a b. (a -> b) -> a -> b
$ \Ptr EnumValue
val' -> do
EnumValue
val'' <- ((ManagedPtr EnumValue -> EnumValue)
-> Ptr EnumValue -> IO EnumValue
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EnumValue -> EnumValue
GObject.EnumValue.EnumValue) Ptr EnumValue
val'
EnumValue -> IO EnumValue
forall (m :: * -> *) a. Monad m => a -> m a
return EnumValue
val''
Maybe EnumValue -> IO (Maybe EnumValue)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe EnumValue
result
setEnumClassValues :: MonadIO m => EnumClass -> Ptr GObject.EnumValue.EnumValue -> m ()
setEnumClassValues :: EnumClass -> Ptr EnumValue -> m ()
setEnumClassValues EnumClass
s Ptr EnumValue
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO ()) -> IO ())
-> (Ptr EnumClass -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Ptr (Ptr EnumValue) -> Ptr EnumValue -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr (Ptr EnumValue)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Ptr EnumValue
val :: Ptr GObject.EnumValue.EnumValue)
clearEnumClassValues :: MonadIO m => EnumClass -> m ()
clearEnumClassValues :: EnumClass -> m ()
clearEnumClassValues EnumClass
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ EnumClass -> (Ptr EnumClass -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr EnumClass
s ((Ptr EnumClass -> IO ()) -> IO ())
-> (Ptr EnumClass -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr EnumClass
ptr -> do
Ptr (Ptr EnumValue) -> Ptr EnumValue -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr EnumClass
ptr Ptr EnumClass -> Int -> Ptr (Ptr EnumValue)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Ptr EnumValue
forall a. Ptr a
FP.nullPtr :: Ptr GObject.EnumValue.EnumValue)
#if defined(ENABLE_OVERLOADING)
data EnumClassValuesFieldInfo
instance AttrInfo EnumClassValuesFieldInfo where
type AttrBaseTypeConstraint EnumClassValuesFieldInfo = (~) EnumClass
type AttrAllowedOps EnumClassValuesFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EnumClassValuesFieldInfo = (~) (Ptr GObject.EnumValue.EnumValue)
type AttrTransferTypeConstraint EnumClassValuesFieldInfo = (~)(Ptr GObject.EnumValue.EnumValue)
type AttrTransferType EnumClassValuesFieldInfo = (Ptr GObject.EnumValue.EnumValue)
type AttrGetType EnumClassValuesFieldInfo = Maybe GObject.EnumValue.EnumValue
type AttrLabel EnumClassValuesFieldInfo = "values"
type AttrOrigin EnumClassValuesFieldInfo = EnumClass
attrGet = getEnumClassValues
attrSet = setEnumClassValues
attrConstruct = undefined
attrClear = clearEnumClassValues
attrTransfer _ v = do
return v
enumClass_values :: AttrLabelProxy "values"
enumClass_values = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList EnumClass
type instance O.AttributeList EnumClass = EnumClassAttributeList
type EnumClassAttributeList = ('[ '("gTypeClass", EnumClassGTypeClassFieldInfo), '("minimum", EnumClassMinimumFieldInfo), '("maximum", EnumClassMaximumFieldInfo), '("nValues", EnumClassNValuesFieldInfo), '("values", EnumClassValuesFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveEnumClassMethod (t :: Symbol) (o :: *) :: * where
ResolveEnumClassMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEnumClassMethod t EnumClass, O.MethodInfo info EnumClass p) => OL.IsLabel t (EnumClass -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif