{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Unions.TokenValue
(
TokenValue(..) ,
newZeroTokenValue ,
#if defined(ENABLE_OVERLOADING)
ResolveTokenValueMethod ,
#endif
getTokenValueVBinary ,
setTokenValueVBinary ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vBinary ,
#endif
getTokenValueVChar ,
setTokenValueVChar ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vChar ,
#endif
clearTokenValueVComment ,
getTokenValueVComment ,
setTokenValueVComment ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vComment ,
#endif
getTokenValueVError ,
setTokenValueVError ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vError ,
#endif
getTokenValueVFloat ,
setTokenValueVFloat ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vFloat ,
#endif
getTokenValueVHex ,
setTokenValueVHex ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vHex ,
#endif
clearTokenValueVIdentifier ,
getTokenValueVIdentifier ,
setTokenValueVIdentifier ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vIdentifier ,
#endif
getTokenValueVInt ,
setTokenValueVInt ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vInt ,
#endif
getTokenValueVInt64 ,
setTokenValueVInt64 ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vInt64 ,
#endif
getTokenValueVOctal ,
setTokenValueVOctal ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vOctal ,
#endif
clearTokenValueVString ,
getTokenValueVString ,
setTokenValueVString ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vString ,
#endif
clearTokenValueVSymbol ,
getTokenValueVSymbol ,
setTokenValueVSymbol ,
#if defined(ENABLE_OVERLOADING)
tokenValue_vSymbol ,
#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.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.Coerce as Coerce
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 GHC.Records as R
newtype TokenValue = TokenValue (SP.ManagedPtr TokenValue)
deriving (TokenValue -> TokenValue -> Bool
(TokenValue -> TokenValue -> Bool)
-> (TokenValue -> TokenValue -> Bool) -> Eq TokenValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TokenValue -> TokenValue -> Bool
$c/= :: TokenValue -> TokenValue -> Bool
== :: TokenValue -> TokenValue -> Bool
$c== :: TokenValue -> TokenValue -> Bool
Eq)
instance SP.ManagedPtrNewtype TokenValue where
toManagedPtr :: TokenValue -> ManagedPtr TokenValue
toManagedPtr (TokenValue ManagedPtr TokenValue
p) = ManagedPtr TokenValue
p
instance BoxedPtr TokenValue where
boxedPtrCopy :: TokenValue -> IO TokenValue
boxedPtrCopy = \TokenValue
p -> TokenValue -> (Ptr TokenValue -> IO TokenValue) -> IO TokenValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TokenValue
p (Int -> Ptr TokenValue -> IO (Ptr TokenValue)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
8 (Ptr TokenValue -> IO (Ptr TokenValue))
-> (Ptr TokenValue -> IO TokenValue)
-> Ptr TokenValue
-> IO TokenValue
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr TokenValue -> TokenValue)
-> Ptr TokenValue -> IO TokenValue
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr TokenValue -> TokenValue
TokenValue)
boxedPtrFree :: TokenValue -> IO ()
boxedPtrFree = \TokenValue
x -> TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr TokenValue
x Ptr TokenValue -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr TokenValue where
boxedPtrCalloc :: IO (Ptr TokenValue)
boxedPtrCalloc = Int -> IO (Ptr TokenValue)
forall a. Int -> IO (Ptr a)
callocBytes Int
8
newZeroTokenValue :: MonadIO m => m TokenValue
newZeroTokenValue :: forall (m :: * -> *). MonadIO m => m TokenValue
newZeroTokenValue = IO TokenValue -> m TokenValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TokenValue -> m TokenValue) -> IO TokenValue -> m TokenValue
forall a b. (a -> b) -> a -> b
$ IO (Ptr TokenValue)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr TokenValue)
-> (Ptr TokenValue -> IO TokenValue) -> IO TokenValue
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr TokenValue -> TokenValue)
-> Ptr TokenValue -> IO TokenValue
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr TokenValue -> TokenValue
TokenValue
instance tag ~ 'AttrSet => Constructible TokenValue tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr TokenValue -> TokenValue)
-> [AttrOp TokenValue tag] -> m TokenValue
new ManagedPtr TokenValue -> TokenValue
_ [AttrOp TokenValue tag]
attrs = do
TokenValue
o <- m TokenValue
forall (m :: * -> *). MonadIO m => m TokenValue
newZeroTokenValue
TokenValue -> [AttrOp TokenValue 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set TokenValue
o [AttrOp TokenValue tag]
[AttrOp TokenValue 'AttrSet]
attrs
TokenValue -> m TokenValue
forall (m :: * -> *) a. Monad m => a -> m a
return TokenValue
o
getTokenValueVSymbol :: MonadIO m => TokenValue -> m (Ptr ())
getTokenValueVSymbol :: forall (m :: * -> *). MonadIO m => TokenValue -> m (Ptr ())
getTokenValueVSymbol TokenValue
s = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO (Ptr ())) -> IO (Ptr ())
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr TokenValue -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr ()
val <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (Ptr ())
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
val
setTokenValueVSymbol :: MonadIO m => TokenValue -> Ptr () -> m ()
setTokenValueVSymbol :: forall (m :: * -> *). MonadIO m => TokenValue -> Ptr () -> m ()
setTokenValueVSymbol TokenValue
s Ptr ()
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr ()
val :: Ptr ())
clearTokenValueVSymbol :: MonadIO m => TokenValue -> m ()
clearTokenValueVSymbol :: forall (m :: * -> *). MonadIO m => TokenValue -> m ()
clearTokenValueVSymbol TokenValue
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr ()
forall a. Ptr a
FP.nullPtr :: Ptr ())
#if defined(ENABLE_OVERLOADING)
data TokenValueVSymbolFieldInfo
instance AttrInfo TokenValueVSymbolFieldInfo where
type AttrBaseTypeConstraint TokenValueVSymbolFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVSymbolFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint TokenValueVSymbolFieldInfo = (~) (Ptr ())
type AttrTransferTypeConstraint TokenValueVSymbolFieldInfo = (~)(Ptr ())
type AttrTransferType TokenValueVSymbolFieldInfo = (Ptr ())
type AttrGetType TokenValueVSymbolFieldInfo = Ptr ()
type AttrLabel TokenValueVSymbolFieldInfo = "v_symbol"
type AttrOrigin TokenValueVSymbolFieldInfo = TokenValue
attrGet = getTokenValueVSymbol
attrSet = setTokenValueVSymbol
attrConstruct = undefined
attrClear = clearTokenValueVSymbol
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vSymbol"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vSymbol"
})
tokenValue_vSymbol :: AttrLabelProxy "vSymbol"
tokenValue_vSymbol = AttrLabelProxy
#endif
getTokenValueVIdentifier :: MonadIO m => TokenValue -> m (Maybe T.Text)
getTokenValueVIdentifier :: forall (m :: * -> *). MonadIO m => TokenValue -> m (Maybe Text)
getTokenValueVIdentifier TokenValue
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ TokenValue
-> (Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setTokenValueVIdentifier :: MonadIO m => TokenValue -> CString -> m ()
setTokenValueVIdentifier :: forall (m :: * -> *). MonadIO m => TokenValue -> CString -> m ()
setTokenValueVIdentifier TokenValue
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
val :: CString)
clearTokenValueVIdentifier :: MonadIO m => TokenValue -> m ()
clearTokenValueVIdentifier :: forall (m :: * -> *). MonadIO m => TokenValue -> m ()
clearTokenValueVIdentifier TokenValue
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data TokenValueVIdentifierFieldInfo
instance AttrInfo TokenValueVIdentifierFieldInfo where
type AttrBaseTypeConstraint TokenValueVIdentifierFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVIdentifierFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint TokenValueVIdentifierFieldInfo = (~) CString
type AttrTransferTypeConstraint TokenValueVIdentifierFieldInfo = (~)CString
type AttrTransferType TokenValueVIdentifierFieldInfo = CString
type AttrGetType TokenValueVIdentifierFieldInfo = Maybe T.Text
type AttrLabel TokenValueVIdentifierFieldInfo = "v_identifier"
type AttrOrigin TokenValueVIdentifierFieldInfo = TokenValue
attrGet = getTokenValueVIdentifier
attrSet = setTokenValueVIdentifier
attrConstruct = undefined
attrClear = clearTokenValueVIdentifier
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vIdentifier"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vIdentifier"
})
tokenValue_vIdentifier :: AttrLabelProxy "vIdentifier"
tokenValue_vIdentifier = AttrLabelProxy
#endif
getTokenValueVBinary :: MonadIO m => TokenValue -> m CULong
getTokenValueVBinary :: forall (m :: * -> *). MonadIO m => TokenValue -> m CULong
getTokenValueVBinary TokenValue
s = IO CULong -> m CULong
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO CULong) -> IO CULong
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO CULong) -> IO CULong)
-> (Ptr TokenValue -> IO CULong) -> IO CULong
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
CULong
val <- Ptr CULong -> IO CULong
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CULong
CULong -> IO CULong
forall (m :: * -> *) a. Monad m => a -> m a
return CULong
val
setTokenValueVBinary :: MonadIO m => TokenValue -> CULong -> m ()
setTokenValueVBinary :: forall (m :: * -> *). MonadIO m => TokenValue -> CULong -> m ()
setTokenValueVBinary TokenValue
s CULong
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CULong -> CULong -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CULong
val :: CULong)
#if defined(ENABLE_OVERLOADING)
data TokenValueVBinaryFieldInfo
instance AttrInfo TokenValueVBinaryFieldInfo where
type AttrBaseTypeConstraint TokenValueVBinaryFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVBinaryFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TokenValueVBinaryFieldInfo = (~) CULong
type AttrTransferTypeConstraint TokenValueVBinaryFieldInfo = (~)CULong
type AttrTransferType TokenValueVBinaryFieldInfo = CULong
type AttrGetType TokenValueVBinaryFieldInfo = CULong
type AttrLabel TokenValueVBinaryFieldInfo = "v_binary"
type AttrOrigin TokenValueVBinaryFieldInfo = TokenValue
attrGet = getTokenValueVBinary
attrSet = setTokenValueVBinary
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vBinary"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vBinary"
})
tokenValue_vBinary :: AttrLabelProxy "vBinary"
tokenValue_vBinary = AttrLabelProxy
#endif
getTokenValueVOctal :: MonadIO m => TokenValue -> m CULong
getTokenValueVOctal :: forall (m :: * -> *). MonadIO m => TokenValue -> m CULong
getTokenValueVOctal TokenValue
s = IO CULong -> m CULong
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO CULong) -> IO CULong
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO CULong) -> IO CULong)
-> (Ptr TokenValue -> IO CULong) -> IO CULong
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
CULong
val <- Ptr CULong -> IO CULong
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CULong
CULong -> IO CULong
forall (m :: * -> *) a. Monad m => a -> m a
return CULong
val
setTokenValueVOctal :: MonadIO m => TokenValue -> CULong -> m ()
setTokenValueVOctal :: forall (m :: * -> *). MonadIO m => TokenValue -> CULong -> m ()
setTokenValueVOctal TokenValue
s CULong
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CULong -> CULong -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CULong
val :: CULong)
#if defined(ENABLE_OVERLOADING)
data TokenValueVOctalFieldInfo
instance AttrInfo TokenValueVOctalFieldInfo where
type AttrBaseTypeConstraint TokenValueVOctalFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVOctalFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TokenValueVOctalFieldInfo = (~) CULong
type AttrTransferTypeConstraint TokenValueVOctalFieldInfo = (~)CULong
type AttrTransferType TokenValueVOctalFieldInfo = CULong
type AttrGetType TokenValueVOctalFieldInfo = CULong
type AttrLabel TokenValueVOctalFieldInfo = "v_octal"
type AttrOrigin TokenValueVOctalFieldInfo = TokenValue
attrGet = getTokenValueVOctal
attrSet = setTokenValueVOctal
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vOctal"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vOctal"
})
tokenValue_vOctal :: AttrLabelProxy "vOctal"
tokenValue_vOctal = AttrLabelProxy
#endif
getTokenValueVInt :: MonadIO m => TokenValue -> m CULong
getTokenValueVInt :: forall (m :: * -> *). MonadIO m => TokenValue -> m CULong
getTokenValueVInt TokenValue
s = IO CULong -> m CULong
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO CULong) -> IO CULong
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO CULong) -> IO CULong)
-> (Ptr TokenValue -> IO CULong) -> IO CULong
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
CULong
val <- Ptr CULong -> IO CULong
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CULong
CULong -> IO CULong
forall (m :: * -> *) a. Monad m => a -> m a
return CULong
val
setTokenValueVInt :: MonadIO m => TokenValue -> CULong -> m ()
setTokenValueVInt :: forall (m :: * -> *). MonadIO m => TokenValue -> CULong -> m ()
setTokenValueVInt TokenValue
s CULong
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CULong -> CULong -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CULong
val :: CULong)
#if defined(ENABLE_OVERLOADING)
data TokenValueVIntFieldInfo
instance AttrInfo TokenValueVIntFieldInfo where
type AttrBaseTypeConstraint TokenValueVIntFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVIntFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TokenValueVIntFieldInfo = (~) CULong
type AttrTransferTypeConstraint TokenValueVIntFieldInfo = (~)CULong
type AttrTransferType TokenValueVIntFieldInfo = CULong
type AttrGetType TokenValueVIntFieldInfo = CULong
type AttrLabel TokenValueVIntFieldInfo = "v_int"
type AttrOrigin TokenValueVIntFieldInfo = TokenValue
attrGet = getTokenValueVInt
attrSet = setTokenValueVInt
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vInt"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vInt"
})
tokenValue_vInt :: AttrLabelProxy "vInt"
tokenValue_vInt = AttrLabelProxy
#endif
getTokenValueVInt64 :: MonadIO m => TokenValue -> m Word64
getTokenValueVInt64 :: forall (m :: * -> *). MonadIO m => TokenValue -> m Word64
getTokenValueVInt64 TokenValue
s = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO Word64) -> IO Word64
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO Word64) -> IO Word64)
-> (Ptr TokenValue -> IO Word64) -> IO Word64
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Word64
val <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO Word64
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
val
setTokenValueVInt64 :: MonadIO m => TokenValue -> Word64 -> m ()
setTokenValueVInt64 :: forall (m :: * -> *). MonadIO m => TokenValue -> Word64 -> m ()
setTokenValueVInt64 TokenValue
s Word64
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Word64
val :: Word64)
#if defined(ENABLE_OVERLOADING)
data TokenValueVInt64FieldInfo
instance AttrInfo TokenValueVInt64FieldInfo where
type AttrBaseTypeConstraint TokenValueVInt64FieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVInt64FieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TokenValueVInt64FieldInfo = (~) Word64
type AttrTransferTypeConstraint TokenValueVInt64FieldInfo = (~)Word64
type AttrTransferType TokenValueVInt64FieldInfo = Word64
type AttrGetType TokenValueVInt64FieldInfo = Word64
type AttrLabel TokenValueVInt64FieldInfo = "v_int64"
type AttrOrigin TokenValueVInt64FieldInfo = TokenValue
attrGet = getTokenValueVInt64
attrSet = setTokenValueVInt64
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vInt64"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vInt64"
})
tokenValue_vInt64 :: AttrLabelProxy "vInt64"
tokenValue_vInt64 = AttrLabelProxy
#endif
getTokenValueVFloat :: MonadIO m => TokenValue -> m Double
getTokenValueVFloat :: forall (m :: * -> *). MonadIO m => TokenValue -> m Double
getTokenValueVFloat TokenValue
s = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO Double) -> IO Double
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO Double) -> IO Double)
-> (Ptr TokenValue -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
CDouble
val <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CDouble
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CDouble
let val' :: Double
val' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
val
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
val'
setTokenValueVFloat :: MonadIO m => TokenValue -> Double -> m ()
setTokenValueVFloat :: forall (m :: * -> *). MonadIO m => TokenValue -> Double -> m ()
setTokenValueVFloat TokenValue
s Double
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
let val' :: CDouble
val' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
val
Ptr CDouble -> CDouble -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CDouble
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CDouble
val' :: CDouble)
#if defined(ENABLE_OVERLOADING)
data TokenValueVFloatFieldInfo
instance AttrInfo TokenValueVFloatFieldInfo where
type AttrBaseTypeConstraint TokenValueVFloatFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVFloatFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TokenValueVFloatFieldInfo = (~) Double
type AttrTransferTypeConstraint TokenValueVFloatFieldInfo = (~)Double
type AttrTransferType TokenValueVFloatFieldInfo = Double
type AttrGetType TokenValueVFloatFieldInfo = Double
type AttrLabel TokenValueVFloatFieldInfo = "v_float"
type AttrOrigin TokenValueVFloatFieldInfo = TokenValue
attrGet = getTokenValueVFloat
attrSet = setTokenValueVFloat
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vFloat"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vFloat"
})
tokenValue_vFloat :: AttrLabelProxy "vFloat"
tokenValue_vFloat = AttrLabelProxy
#endif
getTokenValueVHex :: MonadIO m => TokenValue -> m CULong
getTokenValueVHex :: forall (m :: * -> *). MonadIO m => TokenValue -> m CULong
getTokenValueVHex TokenValue
s = IO CULong -> m CULong
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO CULong) -> IO CULong
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO CULong) -> IO CULong)
-> (Ptr TokenValue -> IO CULong) -> IO CULong
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
CULong
val <- Ptr CULong -> IO CULong
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CULong
CULong -> IO CULong
forall (m :: * -> *) a. Monad m => a -> m a
return CULong
val
setTokenValueVHex :: MonadIO m => TokenValue -> CULong -> m ()
setTokenValueVHex :: forall (m :: * -> *). MonadIO m => TokenValue -> CULong -> m ()
setTokenValueVHex TokenValue
s CULong
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CULong -> CULong -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CULong
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CULong
val :: CULong)
#if defined(ENABLE_OVERLOADING)
data TokenValueVHexFieldInfo
instance AttrInfo TokenValueVHexFieldInfo where
type AttrBaseTypeConstraint TokenValueVHexFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVHexFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TokenValueVHexFieldInfo = (~) CULong
type AttrTransferTypeConstraint TokenValueVHexFieldInfo = (~)CULong
type AttrTransferType TokenValueVHexFieldInfo = CULong
type AttrGetType TokenValueVHexFieldInfo = CULong
type AttrLabel TokenValueVHexFieldInfo = "v_hex"
type AttrOrigin TokenValueVHexFieldInfo = TokenValue
attrGet = getTokenValueVHex
attrSet = setTokenValueVHex
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vHex"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vHex"
})
tokenValue_vHex :: AttrLabelProxy "vHex"
tokenValue_vHex = AttrLabelProxy
#endif
getTokenValueVString :: MonadIO m => TokenValue -> m (Maybe T.Text)
getTokenValueVString :: forall (m :: * -> *). MonadIO m => TokenValue -> m (Maybe Text)
getTokenValueVString TokenValue
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ TokenValue
-> (Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setTokenValueVString :: MonadIO m => TokenValue -> CString -> m ()
setTokenValueVString :: forall (m :: * -> *). MonadIO m => TokenValue -> CString -> m ()
setTokenValueVString TokenValue
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
val :: CString)
clearTokenValueVString :: MonadIO m => TokenValue -> m ()
clearTokenValueVString :: forall (m :: * -> *). MonadIO m => TokenValue -> m ()
clearTokenValueVString TokenValue
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data TokenValueVStringFieldInfo
instance AttrInfo TokenValueVStringFieldInfo where
type AttrBaseTypeConstraint TokenValueVStringFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVStringFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint TokenValueVStringFieldInfo = (~) CString
type AttrTransferTypeConstraint TokenValueVStringFieldInfo = (~)CString
type AttrTransferType TokenValueVStringFieldInfo = CString
type AttrGetType TokenValueVStringFieldInfo = Maybe T.Text
type AttrLabel TokenValueVStringFieldInfo = "v_string"
type AttrOrigin TokenValueVStringFieldInfo = TokenValue
attrGet = getTokenValueVString
attrSet = setTokenValueVString
attrConstruct = undefined
attrClear = clearTokenValueVString
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vString"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vString"
})
tokenValue_vString :: AttrLabelProxy "vString"
tokenValue_vString = AttrLabelProxy
#endif
getTokenValueVComment :: MonadIO m => TokenValue -> m (Maybe T.Text)
TokenValue
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ TokenValue
-> (Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr TokenValue -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setTokenValueVComment :: MonadIO m => TokenValue -> CString -> m ()
TokenValue
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
val :: CString)
clearTokenValueVComment :: MonadIO m => TokenValue -> m ()
TokenValue
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data TokenValueVCommentFieldInfo
instance AttrInfo TokenValueVCommentFieldInfo where
type AttrBaseTypeConstraint TokenValueVCommentFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVCommentFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint TokenValueVCommentFieldInfo = (~) CString
type AttrTransferTypeConstraint TokenValueVCommentFieldInfo = (~)CString
type AttrTransferType TokenValueVCommentFieldInfo = CString
type AttrGetType TokenValueVCommentFieldInfo = Maybe T.Text
type AttrLabel TokenValueVCommentFieldInfo = "v_comment"
type AttrOrigin TokenValueVCommentFieldInfo = TokenValue
attrGet = getTokenValueVComment
attrSet = setTokenValueVComment
attrConstruct = undefined
attrClear = clearTokenValueVComment
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vComment"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vComment"
})
tokenValue_vComment :: AttrLabelProxy "vComment"
tokenValue_vComment = AttrLabelProxy
#endif
getTokenValueVChar :: MonadIO m => TokenValue -> m Word8
getTokenValueVChar :: forall (m :: * -> *). MonadIO m => TokenValue -> m Word8
getTokenValueVChar TokenValue
s = IO Word8 -> m Word8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO Word8) -> IO Word8
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO Word8) -> IO Word8)
-> (Ptr TokenValue -> IO Word8) -> IO Word8
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Word8
val <- Ptr Word8 -> IO Word8
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr Word8
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO Word8
Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
val
setTokenValueVChar :: MonadIO m => TokenValue -> Word8 -> m ()
setTokenValueVChar :: forall (m :: * -> *). MonadIO m => TokenValue -> Word8 -> m ()
setTokenValueVChar TokenValue
s Word8
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr Word8 -> Word8 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr Word8
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Word8
val :: Word8)
#if defined(ENABLE_OVERLOADING)
data TokenValueVCharFieldInfo
instance AttrInfo TokenValueVCharFieldInfo where
type AttrBaseTypeConstraint TokenValueVCharFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVCharFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TokenValueVCharFieldInfo = (~) Word8
type AttrTransferTypeConstraint TokenValueVCharFieldInfo = (~)Word8
type AttrTransferType TokenValueVCharFieldInfo = Word8
type AttrGetType TokenValueVCharFieldInfo = Word8
type AttrLabel TokenValueVCharFieldInfo = "v_char"
type AttrOrigin TokenValueVCharFieldInfo = TokenValue
attrGet = getTokenValueVChar
attrSet = setTokenValueVChar
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vChar"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vChar"
})
tokenValue_vChar :: AttrLabelProxy "vChar"
tokenValue_vChar = AttrLabelProxy
#endif
getTokenValueVError :: MonadIO m => TokenValue -> m Word32
getTokenValueVError :: forall (m :: * -> *). MonadIO m => TokenValue -> m Word32
getTokenValueVError TokenValue
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
$ TokenValue -> (Ptr TokenValue -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO Word32) -> IO Word32)
-> (Ptr TokenValue -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setTokenValueVError :: MonadIO m => TokenValue -> Word32 -> m ()
setTokenValueVError :: forall (m :: * -> *). MonadIO m => TokenValue -> Word32 -> m ()
setTokenValueVError TokenValue
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
$ TokenValue -> (Ptr TokenValue -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TokenValue
s ((Ptr TokenValue -> IO ()) -> IO ())
-> (Ptr TokenValue -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TokenValue
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TokenValue
ptr Ptr TokenValue -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data TokenValueVErrorFieldInfo
instance AttrInfo TokenValueVErrorFieldInfo where
type AttrBaseTypeConstraint TokenValueVErrorFieldInfo = (~) TokenValue
type AttrAllowedOps TokenValueVErrorFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TokenValueVErrorFieldInfo = (~) Word32
type AttrTransferTypeConstraint TokenValueVErrorFieldInfo = (~)Word32
type AttrTransferType TokenValueVErrorFieldInfo = Word32
type AttrGetType TokenValueVErrorFieldInfo = Word32
type AttrLabel TokenValueVErrorFieldInfo = "v_error"
type AttrOrigin TokenValueVErrorFieldInfo = TokenValue
attrGet = getTokenValueVError
attrSet = setTokenValueVError
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Unions.TokenValue.vError"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Unions-TokenValue.html#g:attr:vError"
})
tokenValue_vError :: AttrLabelProxy "vError"
tokenValue_vError = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TokenValue
type instance O.AttributeList TokenValue = TokenValueAttributeList
type TokenValueAttributeList = ('[ '("vSymbol", TokenValueVSymbolFieldInfo), '("vIdentifier", TokenValueVIdentifierFieldInfo), '("vBinary", TokenValueVBinaryFieldInfo), '("vOctal", TokenValueVOctalFieldInfo), '("vInt", TokenValueVIntFieldInfo), '("vInt64", TokenValueVInt64FieldInfo), '("vFloat", TokenValueVFloatFieldInfo), '("vHex", TokenValueVHexFieldInfo), '("vString", TokenValueVStringFieldInfo), '("vComment", TokenValueVCommentFieldInfo), '("vChar", TokenValueVCharFieldInfo), '("vError", TokenValueVErrorFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTokenValueMethod (t :: Symbol) (o :: *) :: * where
ResolveTokenValueMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTokenValueMethod t TokenValue, O.OverloadedMethod info TokenValue p) => OL.IsLabel t (TokenValue -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveTokenValueMethod t TokenValue, O.OverloadedMethod info TokenValue p, R.HasField t TokenValue p) => R.HasField t TokenValue p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveTokenValueMethod t TokenValue, O.OverloadedMethodInfo info TokenValue) => OL.IsLabel t (O.MethodProxy info TokenValue) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif