{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.OptionEntry
(
OptionEntry(..) ,
newZeroOptionEntry ,
#if defined(ENABLE_OVERLOADING)
ResolveOptionEntryMethod ,
#endif
getOptionEntryArg ,
#if defined(ENABLE_OVERLOADING)
optionEntry_arg ,
#endif
setOptionEntryArg ,
clearOptionEntryArgData ,
getOptionEntryArgData ,
#if defined(ENABLE_OVERLOADING)
optionEntry_argData ,
#endif
setOptionEntryArgData ,
clearOptionEntryArgDescription ,
getOptionEntryArgDescription ,
#if defined(ENABLE_OVERLOADING)
optionEntry_argDescription ,
#endif
setOptionEntryArgDescription ,
clearOptionEntryDescription ,
getOptionEntryDescription ,
#if defined(ENABLE_OVERLOADING)
optionEntry_description ,
#endif
setOptionEntryDescription ,
getOptionEntryFlags ,
#if defined(ENABLE_OVERLOADING)
optionEntry_flags ,
#endif
setOptionEntryFlags ,
clearOptionEntryLongName ,
getOptionEntryLongName ,
#if defined(ENABLE_OVERLOADING)
optionEntry_longName ,
#endif
setOptionEntryLongName ,
getOptionEntryShortName ,
#if defined(ENABLE_OVERLOADING)
optionEntry_shortName ,
#endif
setOptionEntryShortName ,
) 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
import {-# SOURCE #-} qualified GI.GLib.Enums as GLib.Enums
newtype OptionEntry = OptionEntry (SP.ManagedPtr OptionEntry)
deriving (OptionEntry -> OptionEntry -> Bool
(OptionEntry -> OptionEntry -> Bool)
-> (OptionEntry -> OptionEntry -> Bool) -> Eq OptionEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OptionEntry -> OptionEntry -> Bool
$c/= :: OptionEntry -> OptionEntry -> Bool
== :: OptionEntry -> OptionEntry -> Bool
$c== :: OptionEntry -> OptionEntry -> Bool
Eq)
instance SP.ManagedPtrNewtype OptionEntry where
toManagedPtr :: OptionEntry -> ManagedPtr OptionEntry
toManagedPtr (OptionEntry ManagedPtr OptionEntry
p) = ManagedPtr OptionEntry
p
instance BoxedPtr OptionEntry where
boxedPtrCopy :: OptionEntry -> IO OptionEntry
boxedPtrCopy = \OptionEntry
p -> OptionEntry
-> (Ptr OptionEntry -> IO OptionEntry) -> IO OptionEntry
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr OptionEntry
p (Int -> Ptr OptionEntry -> IO (Ptr OptionEntry)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
48 (Ptr OptionEntry -> IO (Ptr OptionEntry))
-> (Ptr OptionEntry -> IO OptionEntry)
-> Ptr OptionEntry
-> IO OptionEntry
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr OptionEntry -> OptionEntry)
-> Ptr OptionEntry -> IO OptionEntry
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr OptionEntry -> OptionEntry
OptionEntry)
boxedPtrFree :: OptionEntry -> IO ()
boxedPtrFree = \OptionEntry
x -> OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr OptionEntry
x Ptr OptionEntry -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr OptionEntry where
boxedPtrCalloc :: IO (Ptr OptionEntry)
boxedPtrCalloc = Int -> IO (Ptr OptionEntry)
forall a. Int -> IO (Ptr a)
callocBytes Int
48
newZeroOptionEntry :: MonadIO m => m OptionEntry
newZeroOptionEntry :: forall (m :: * -> *). MonadIO m => m OptionEntry
newZeroOptionEntry = IO OptionEntry -> m OptionEntry
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO OptionEntry -> m OptionEntry)
-> IO OptionEntry -> m OptionEntry
forall a b. (a -> b) -> a -> b
$ IO (Ptr OptionEntry)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr OptionEntry)
-> (Ptr OptionEntry -> IO OptionEntry) -> IO OptionEntry
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr OptionEntry -> OptionEntry)
-> Ptr OptionEntry -> IO OptionEntry
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr OptionEntry -> OptionEntry
OptionEntry
instance tag ~ 'AttrSet => Constructible OptionEntry tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr OptionEntry -> OptionEntry)
-> [AttrOp OptionEntry tag] -> m OptionEntry
new ManagedPtr OptionEntry -> OptionEntry
_ [AttrOp OptionEntry tag]
attrs = do
OptionEntry
o <- m OptionEntry
forall (m :: * -> *). MonadIO m => m OptionEntry
newZeroOptionEntry
OptionEntry -> [AttrOp OptionEntry 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set OptionEntry
o [AttrOp OptionEntry tag]
[AttrOp OptionEntry 'AttrSet]
attrs
OptionEntry -> m OptionEntry
forall (m :: * -> *) a. Monad m => a -> m a
return OptionEntry
o
getOptionEntryLongName :: MonadIO m => OptionEntry -> m (Maybe T.Text)
getOptionEntryLongName :: forall (m :: * -> *). MonadIO m => OptionEntry -> m (Maybe Text)
getOptionEntryLongName OptionEntry
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
$ OptionEntry
-> (Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr OptionEntry
ptr Ptr OptionEntry -> 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
setOptionEntryLongName :: MonadIO m => OptionEntry -> CString -> m ()
setOptionEntryLongName :: forall (m :: * -> *). MonadIO m => OptionEntry -> CString -> m ()
setOptionEntryLongName OptionEntry
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
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
val :: CString)
clearOptionEntryLongName :: MonadIO m => OptionEntry -> m ()
clearOptionEntryLongName :: forall (m :: * -> *). MonadIO m => OptionEntry -> m ()
clearOptionEntryLongName OptionEntry
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> 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 OptionEntryLongNameFieldInfo
instance AttrInfo OptionEntryLongNameFieldInfo where
type AttrBaseTypeConstraint OptionEntryLongNameFieldInfo = (~) OptionEntry
type AttrAllowedOps OptionEntryLongNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint OptionEntryLongNameFieldInfo = (~) CString
type AttrTransferTypeConstraint OptionEntryLongNameFieldInfo = (~)CString
type AttrTransferType OptionEntryLongNameFieldInfo = CString
type AttrGetType OptionEntryLongNameFieldInfo = Maybe T.Text
type AttrLabel OptionEntryLongNameFieldInfo = "long_name"
type AttrOrigin OptionEntryLongNameFieldInfo = OptionEntry
attrGet = getOptionEntryLongName
attrSet = setOptionEntryLongName
attrConstruct = undefined
attrClear = clearOptionEntryLongName
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionEntry.longName"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionEntry.html#g:attr:longName"
})
optionEntry_longName :: AttrLabelProxy "longName"
optionEntry_longName = AttrLabelProxy
#endif
getOptionEntryShortName :: MonadIO m => OptionEntry -> m Int8
getOptionEntryShortName :: forall (m :: * -> *). MonadIO m => OptionEntry -> m Int8
getOptionEntryShortName OptionEntry
s = IO Int8 -> m Int8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int8 -> m Int8) -> IO Int8 -> m Int8
forall a b. (a -> b) -> a -> b
$ OptionEntry -> (Ptr OptionEntry -> IO Int8) -> IO Int8
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO Int8) -> IO Int8)
-> (Ptr OptionEntry -> IO Int8) -> IO Int8
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Int8
val <- Ptr Int8 -> IO Int8
forall a. Storable a => Ptr a -> IO a
peek (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr Int8
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO Int8
Int8 -> IO Int8
forall (m :: * -> *) a. Monad m => a -> m a
return Int8
val
setOptionEntryShortName :: MonadIO m => OptionEntry -> Int8 -> m ()
setOptionEntryShortName :: forall (m :: * -> *). MonadIO m => OptionEntry -> Int8 -> m ()
setOptionEntryShortName OptionEntry
s Int8
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr Int8 -> Int8 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr Int8
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Int8
val :: Int8)
#if defined(ENABLE_OVERLOADING)
data OptionEntryShortNameFieldInfo
instance AttrInfo OptionEntryShortNameFieldInfo where
type AttrBaseTypeConstraint OptionEntryShortNameFieldInfo = (~) OptionEntry
type AttrAllowedOps OptionEntryShortNameFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint OptionEntryShortNameFieldInfo = (~) Int8
type AttrTransferTypeConstraint OptionEntryShortNameFieldInfo = (~)Int8
type AttrTransferType OptionEntryShortNameFieldInfo = Int8
type AttrGetType OptionEntryShortNameFieldInfo = Int8
type AttrLabel OptionEntryShortNameFieldInfo = "short_name"
type AttrOrigin OptionEntryShortNameFieldInfo = OptionEntry
attrGet = getOptionEntryShortName
attrSet = setOptionEntryShortName
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionEntry.shortName"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionEntry.html#g:attr:shortName"
})
optionEntry_shortName :: AttrLabelProxy "shortName"
optionEntry_shortName = AttrLabelProxy
#endif
getOptionEntryFlags :: MonadIO m => OptionEntry -> m Int32
getOptionEntryFlags :: forall (m :: * -> *). MonadIO m => OptionEntry -> m Int32
getOptionEntryFlags OptionEntry
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
$ OptionEntry -> (Ptr OptionEntry -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO Int32) -> IO Int32)
-> (Ptr OptionEntry -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr OptionEntry
ptr Ptr OptionEntry -> 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
setOptionEntryFlags :: MonadIO m => OptionEntry -> Int32 -> m ()
setOptionEntryFlags :: forall (m :: * -> *). MonadIO m => OptionEntry -> Int32 -> m ()
setOptionEntryFlags OptionEntry
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
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data OptionEntryFlagsFieldInfo
instance AttrInfo OptionEntryFlagsFieldInfo where
type AttrBaseTypeConstraint OptionEntryFlagsFieldInfo = (~) OptionEntry
type AttrAllowedOps OptionEntryFlagsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint OptionEntryFlagsFieldInfo = (~) Int32
type AttrTransferTypeConstraint OptionEntryFlagsFieldInfo = (~)Int32
type AttrTransferType OptionEntryFlagsFieldInfo = Int32
type AttrGetType OptionEntryFlagsFieldInfo = Int32
type AttrLabel OptionEntryFlagsFieldInfo = "flags"
type AttrOrigin OptionEntryFlagsFieldInfo = OptionEntry
attrGet = getOptionEntryFlags
attrSet = setOptionEntryFlags
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionEntry.flags"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionEntry.html#g:attr:flags"
})
optionEntry_flags :: AttrLabelProxy "flags"
optionEntry_flags = AttrLabelProxy
#endif
getOptionEntryArg :: MonadIO m => OptionEntry -> m GLib.Enums.OptionArg
getOptionEntryArg :: forall (m :: * -> *). MonadIO m => OptionEntry -> m OptionArg
getOptionEntryArg OptionEntry
s = IO OptionArg -> m OptionArg
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO OptionArg -> m OptionArg) -> IO OptionArg -> m OptionArg
forall a b. (a -> b) -> a -> b
$ OptionEntry -> (Ptr OptionEntry -> IO OptionArg) -> IO OptionArg
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO OptionArg) -> IO OptionArg)
-> (Ptr OptionEntry -> IO OptionArg) -> IO OptionArg
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
CUInt
val <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO CUInt
let val' :: OptionArg
val' = (Int -> OptionArg
forall a. Enum a => Int -> a
toEnum (Int -> OptionArg) -> (CUInt -> Int) -> CUInt -> OptionArg
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
val
OptionArg -> IO OptionArg
forall (m :: * -> *) a. Monad m => a -> m a
return OptionArg
val'
setOptionEntryArg :: MonadIO m => OptionEntry -> GLib.Enums.OptionArg -> m ()
setOptionEntryArg :: forall (m :: * -> *). MonadIO m => OptionEntry -> OptionArg -> m ()
setOptionEntryArg OptionEntry
s OptionArg
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
let val' :: CUInt
val' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OptionArg -> Int) -> OptionArg -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OptionArg -> Int
forall a. Enum a => a -> Int
fromEnum) OptionArg
val
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (CUInt
val' :: CUInt)
#if defined(ENABLE_OVERLOADING)
data OptionEntryArgFieldInfo
instance AttrInfo OptionEntryArgFieldInfo where
type AttrBaseTypeConstraint OptionEntryArgFieldInfo = (~) OptionEntry
type AttrAllowedOps OptionEntryArgFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint OptionEntryArgFieldInfo = (~) GLib.Enums.OptionArg
type AttrTransferTypeConstraint OptionEntryArgFieldInfo = (~)GLib.Enums.OptionArg
type AttrTransferType OptionEntryArgFieldInfo = GLib.Enums.OptionArg
type AttrGetType OptionEntryArgFieldInfo = GLib.Enums.OptionArg
type AttrLabel OptionEntryArgFieldInfo = "arg"
type AttrOrigin OptionEntryArgFieldInfo = OptionEntry
attrGet = getOptionEntryArg
attrSet = setOptionEntryArg
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionEntry.arg"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionEntry.html#g:attr:arg"
})
optionEntry_arg :: AttrLabelProxy "arg"
optionEntry_arg = AttrLabelProxy
#endif
getOptionEntryArgData :: MonadIO m => OptionEntry -> m (Ptr ())
getOptionEntryArgData :: forall (m :: * -> *). MonadIO m => OptionEntry -> m (Ptr ())
getOptionEntryArgData OptionEntry
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
$ OptionEntry -> (Ptr OptionEntry -> IO (Ptr ())) -> IO (Ptr ())
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr OptionEntry -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr ()
val <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO (Ptr ())
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
val
setOptionEntryArgData :: MonadIO m => OptionEntry -> Ptr () -> m ()
setOptionEntryArgData :: forall (m :: * -> *). MonadIO m => OptionEntry -> Ptr () -> m ()
setOptionEntryArgData OptionEntry
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
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Ptr ()
val :: Ptr ())
clearOptionEntryArgData :: MonadIO m => OptionEntry -> m ()
clearOptionEntryArgData :: forall (m :: * -> *). MonadIO m => OptionEntry -> m ()
clearOptionEntryArgData OptionEntry
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Ptr ()
forall a. Ptr a
FP.nullPtr :: Ptr ())
#if defined(ENABLE_OVERLOADING)
data OptionEntryArgDataFieldInfo
instance AttrInfo OptionEntryArgDataFieldInfo where
type AttrBaseTypeConstraint OptionEntryArgDataFieldInfo = (~) OptionEntry
type AttrAllowedOps OptionEntryArgDataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint OptionEntryArgDataFieldInfo = (~) (Ptr ())
type AttrTransferTypeConstraint OptionEntryArgDataFieldInfo = (~)(Ptr ())
type AttrTransferType OptionEntryArgDataFieldInfo = (Ptr ())
type AttrGetType OptionEntryArgDataFieldInfo = Ptr ()
type AttrLabel OptionEntryArgDataFieldInfo = "arg_data"
type AttrOrigin OptionEntryArgDataFieldInfo = OptionEntry
attrGet = getOptionEntryArgData
attrSet = setOptionEntryArgData
attrConstruct = undefined
attrClear = clearOptionEntryArgData
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionEntry.argData"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionEntry.html#g:attr:argData"
})
optionEntry_argData :: AttrLabelProxy "argData"
optionEntry_argData = AttrLabelProxy
#endif
getOptionEntryDescription :: MonadIO m => OptionEntry -> m (Maybe T.Text)
getOptionEntryDescription :: forall (m :: * -> *). MonadIO m => OptionEntry -> m (Maybe Text)
getOptionEntryDescription OptionEntry
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
$ OptionEntry
-> (Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) :: 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
setOptionEntryDescription :: MonadIO m => OptionEntry -> CString -> m ()
setOptionEntryDescription :: forall (m :: * -> *). MonadIO m => OptionEntry -> CString -> m ()
setOptionEntryDescription OptionEntry
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
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (CString
val :: CString)
clearOptionEntryDescription :: MonadIO m => OptionEntry -> m ()
clearOptionEntryDescription :: forall (m :: * -> *). MonadIO m => OptionEntry -> m ()
clearOptionEntryDescription OptionEntry
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data OptionEntryDescriptionFieldInfo
instance AttrInfo OptionEntryDescriptionFieldInfo where
type AttrBaseTypeConstraint OptionEntryDescriptionFieldInfo = (~) OptionEntry
type AttrAllowedOps OptionEntryDescriptionFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint OptionEntryDescriptionFieldInfo = (~) CString
type AttrTransferTypeConstraint OptionEntryDescriptionFieldInfo = (~)CString
type AttrTransferType OptionEntryDescriptionFieldInfo = CString
type AttrGetType OptionEntryDescriptionFieldInfo = Maybe T.Text
type AttrLabel OptionEntryDescriptionFieldInfo = "description"
type AttrOrigin OptionEntryDescriptionFieldInfo = OptionEntry
attrGet = getOptionEntryDescription
attrSet = setOptionEntryDescription
attrConstruct = undefined
attrClear = clearOptionEntryDescription
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionEntry.description"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionEntry.html#g:attr:description"
})
optionEntry_description :: AttrLabelProxy "description"
optionEntry_description = AttrLabelProxy
#endif
getOptionEntryArgDescription :: MonadIO m => OptionEntry -> m (Maybe T.Text)
getOptionEntryArgDescription :: forall (m :: * -> *). MonadIO m => OptionEntry -> m (Maybe Text)
getOptionEntryArgDescription OptionEntry
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
$ OptionEntry
-> (Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr OptionEntry -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) :: 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
setOptionEntryArgDescription :: MonadIO m => OptionEntry -> CString -> m ()
setOptionEntryArgDescription :: forall (m :: * -> *). MonadIO m => OptionEntry -> CString -> m ()
setOptionEntryArgDescription OptionEntry
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
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (CString
val :: CString)
clearOptionEntryArgDescription :: MonadIO m => OptionEntry -> m ()
clearOptionEntryArgDescription :: forall (m :: * -> *). MonadIO m => OptionEntry -> m ()
clearOptionEntryArgDescription OptionEntry
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ OptionEntry -> (Ptr OptionEntry -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr OptionEntry
s ((Ptr OptionEntry -> IO ()) -> IO ())
-> (Ptr OptionEntry -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr OptionEntry
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr OptionEntry
ptr Ptr OptionEntry -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data OptionEntryArgDescriptionFieldInfo
instance AttrInfo OptionEntryArgDescriptionFieldInfo where
type AttrBaseTypeConstraint OptionEntryArgDescriptionFieldInfo = (~) OptionEntry
type AttrAllowedOps OptionEntryArgDescriptionFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint OptionEntryArgDescriptionFieldInfo = (~) CString
type AttrTransferTypeConstraint OptionEntryArgDescriptionFieldInfo = (~)CString
type AttrTransferType OptionEntryArgDescriptionFieldInfo = CString
type AttrGetType OptionEntryArgDescriptionFieldInfo = Maybe T.Text
type AttrLabel OptionEntryArgDescriptionFieldInfo = "arg_description"
type AttrOrigin OptionEntryArgDescriptionFieldInfo = OptionEntry
attrGet = getOptionEntryArgDescription
attrSet = setOptionEntryArgDescription
attrConstruct = undefined
attrClear = clearOptionEntryArgDescription
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionEntry.argDescription"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionEntry.html#g:attr:argDescription"
})
optionEntry_argDescription :: AttrLabelProxy "argDescription"
optionEntry_argDescription = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList OptionEntry
type instance O.AttributeList OptionEntry = OptionEntryAttributeList
type OptionEntryAttributeList = ('[ '("longName", OptionEntryLongNameFieldInfo), '("shortName", OptionEntryShortNameFieldInfo), '("flags", OptionEntryFlagsFieldInfo), '("arg", OptionEntryArgFieldInfo), '("argData", OptionEntryArgDataFieldInfo), '("description", OptionEntryDescriptionFieldInfo), '("argDescription", OptionEntryArgDescriptionFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveOptionEntryMethod (t :: Symbol) (o :: *) :: * where
ResolveOptionEntryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveOptionEntryMethod t OptionEntry, O.OverloadedMethod info OptionEntry p) => OL.IsLabel t (OptionEntry -> 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 ~ ResolveOptionEntryMethod t OptionEntry, O.OverloadedMethod info OptionEntry p, R.HasField t OptionEntry p) => R.HasField t OptionEntry p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveOptionEntryMethod t OptionEntry, O.OverloadedMethodInfo info OptionEntry) => OL.IsLabel t (O.MethodProxy info OptionEntry) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif