{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.StockItem
(
StockItem(..) ,
newZeroStockItem ,
#if defined(ENABLE_OVERLOADING)
ResolveStockItemMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
StockItemFreeMethodInfo ,
#endif
stockItemFree ,
getStockItemKeyval ,
setStockItemKeyval ,
#if defined(ENABLE_OVERLOADING)
stockItem_keyval ,
#endif
clearStockItemLabel ,
getStockItemLabel ,
setStockItemLabel ,
#if defined(ENABLE_OVERLOADING)
stockItem_label ,
#endif
getStockItemModifier ,
setStockItemModifier ,
#if defined(ENABLE_OVERLOADING)
stockItem_modifier ,
#endif
clearStockItemStockId ,
getStockItemStockId ,
setStockItemStockId ,
#if defined(ENABLE_OVERLOADING)
stockItem_stockId ,
#endif
clearStockItemTranslationDomain ,
getStockItemTranslationDomain ,
setStockItemTranslationDomain ,
#if defined(ENABLE_OVERLOADING)
stockItem_translationDomain ,
#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.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 GI.Gdk.Flags as Gdk.Flags
newtype StockItem = StockItem (SP.ManagedPtr StockItem)
deriving (StockItem -> StockItem -> Bool
(StockItem -> StockItem -> Bool)
-> (StockItem -> StockItem -> Bool) -> Eq StockItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StockItem -> StockItem -> Bool
$c/= :: StockItem -> StockItem -> Bool
== :: StockItem -> StockItem -> Bool
$c== :: StockItem -> StockItem -> Bool
Eq)
instance SP.ManagedPtrNewtype StockItem where
toManagedPtr :: StockItem -> ManagedPtr StockItem
toManagedPtr (StockItem ManagedPtr StockItem
p) = ManagedPtr StockItem
p
instance BoxedPtr StockItem where
boxedPtrCopy :: StockItem -> IO StockItem
boxedPtrCopy = \StockItem
p -> StockItem -> (Ptr StockItem -> IO StockItem) -> IO StockItem
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr StockItem
p (Int -> Ptr StockItem -> IO (Ptr StockItem)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
32 (Ptr StockItem -> IO (Ptr StockItem))
-> (Ptr StockItem -> IO StockItem) -> Ptr StockItem -> IO StockItem
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr StockItem -> StockItem)
-> Ptr StockItem -> IO StockItem
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr StockItem -> StockItem
StockItem)
boxedPtrFree :: StockItem -> IO ()
boxedPtrFree = \StockItem
x -> StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr StockItem
x Ptr StockItem -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr StockItem where
boxedPtrCalloc :: IO (Ptr StockItem)
boxedPtrCalloc = Int -> IO (Ptr StockItem)
forall a. Int -> IO (Ptr a)
callocBytes Int
32
newZeroStockItem :: MonadIO m => m StockItem
newZeroStockItem :: m StockItem
newZeroStockItem = IO StockItem -> m StockItem
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO StockItem -> m StockItem) -> IO StockItem -> m StockItem
forall a b. (a -> b) -> a -> b
$ IO (Ptr StockItem)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr StockItem)
-> (Ptr StockItem -> IO StockItem) -> IO StockItem
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr StockItem -> StockItem)
-> Ptr StockItem -> IO StockItem
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr StockItem -> StockItem
StockItem
instance tag ~ 'AttrSet => Constructible StockItem tag where
new :: (ManagedPtr StockItem -> StockItem)
-> [AttrOp StockItem tag] -> m StockItem
new ManagedPtr StockItem -> StockItem
_ [AttrOp StockItem tag]
attrs = do
StockItem
o <- m StockItem
forall (m :: * -> *). MonadIO m => m StockItem
newZeroStockItem
StockItem -> [AttrOp StockItem 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set StockItem
o [AttrOp StockItem tag]
[AttrOp StockItem 'AttrSet]
attrs
StockItem -> m StockItem
forall (m :: * -> *) a. Monad m => a -> m a
return StockItem
o
getStockItemStockId :: MonadIO m => StockItem -> m (Maybe T.Text)
getStockItemStockId :: StockItem -> m (Maybe Text)
getStockItemStockId StockItem
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
$ StockItem -> (Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr StockItem
ptr Ptr StockItem -> 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
setStockItemStockId :: MonadIO m => StockItem -> CString -> m ()
setStockItemStockId :: StockItem -> CString -> m ()
setStockItemStockId StockItem
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
$ StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO ()) -> IO ())
-> (Ptr StockItem -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
val :: CString)
clearStockItemStockId :: MonadIO m => StockItem -> m ()
clearStockItemStockId :: StockItem -> m ()
clearStockItemStockId StockItem
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO ()) -> IO ())
-> (Ptr StockItem -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr StockItem
ptr Ptr StockItem -> 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 StockItemStockIdFieldInfo
instance AttrInfo StockItemStockIdFieldInfo where
type AttrBaseTypeConstraint StockItemStockIdFieldInfo = (~) StockItem
type AttrAllowedOps StockItemStockIdFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StockItemStockIdFieldInfo = (~) CString
type AttrTransferTypeConstraint StockItemStockIdFieldInfo = (~)CString
type AttrTransferType StockItemStockIdFieldInfo = CString
type AttrGetType StockItemStockIdFieldInfo = Maybe T.Text
type AttrLabel StockItemStockIdFieldInfo = "stock_id"
type AttrOrigin StockItemStockIdFieldInfo = StockItem
attrGet = getStockItemStockId
attrSet = setStockItemStockId
attrConstruct = undefined
attrClear = clearStockItemStockId
attrTransfer _ v = do
return v
stockItem_stockId :: AttrLabelProxy "stockId"
stockItem_stockId = AttrLabelProxy
#endif
getStockItemLabel :: MonadIO m => StockItem -> m (Maybe T.Text)
getStockItemLabel :: StockItem -> m (Maybe Text)
getStockItemLabel StockItem
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
$ StockItem -> (Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: 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
setStockItemLabel :: MonadIO m => StockItem -> CString -> m ()
setStockItemLabel :: StockItem -> CString -> m ()
setStockItemLabel StockItem
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
$ StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO ()) -> IO ())
-> (Ptr StockItem -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CString
val :: CString)
clearStockItemLabel :: MonadIO m => StockItem -> m ()
clearStockItemLabel :: StockItem -> m ()
clearStockItemLabel StockItem
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO ()) -> IO ())
-> (Ptr StockItem -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data StockItemLabelFieldInfo
instance AttrInfo StockItemLabelFieldInfo where
type AttrBaseTypeConstraint StockItemLabelFieldInfo = (~) StockItem
type AttrAllowedOps StockItemLabelFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StockItemLabelFieldInfo = (~) CString
type AttrTransferTypeConstraint StockItemLabelFieldInfo = (~)CString
type AttrTransferType StockItemLabelFieldInfo = CString
type AttrGetType StockItemLabelFieldInfo = Maybe T.Text
type AttrLabel StockItemLabelFieldInfo = "label"
type AttrOrigin StockItemLabelFieldInfo = StockItem
attrGet = getStockItemLabel
attrSet = setStockItemLabel
attrConstruct = undefined
attrClear = clearStockItemLabel
attrTransfer _ v = do
return v
stockItem_label :: AttrLabelProxy "label"
stockItem_label = AttrLabelProxy
#endif
getStockItemModifier :: MonadIO m => StockItem -> m [Gdk.Flags.ModifierType]
getStockItemModifier :: StockItem -> m [ModifierType]
getStockItemModifier StockItem
s = IO [ModifierType] -> m [ModifierType]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ModifierType] -> m [ModifierType])
-> IO [ModifierType] -> m [ModifierType]
forall a b. (a -> b) -> a -> b
$ StockItem
-> (Ptr StockItem -> IO [ModifierType]) -> IO [ModifierType]
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO [ModifierType]) -> IO [ModifierType])
-> (Ptr StockItem -> IO [ModifierType]) -> IO [ModifierType]
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
CUInt
val <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO CUInt
let val' :: [ModifierType]
val' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
val
[ModifierType] -> IO [ModifierType]
forall (m :: * -> *) a. Monad m => a -> m a
return [ModifierType]
val'
setStockItemModifier :: MonadIO m => StockItem -> [Gdk.Flags.ModifierType] -> m ()
setStockItemModifier :: StockItem -> [ModifierType] -> m ()
setStockItemModifier StockItem
s [ModifierType]
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO ()) -> IO ())
-> (Ptr StockItem -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
let val' :: CUInt
val' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
val
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (CUInt
val' :: CUInt)
#if defined(ENABLE_OVERLOADING)
data StockItemModifierFieldInfo
instance AttrInfo StockItemModifierFieldInfo where
type AttrBaseTypeConstraint StockItemModifierFieldInfo = (~) StockItem
type AttrAllowedOps StockItemModifierFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint StockItemModifierFieldInfo = (~) [Gdk.Flags.ModifierType]
type AttrTransferTypeConstraint StockItemModifierFieldInfo = (~)[Gdk.Flags.ModifierType]
type AttrTransferType StockItemModifierFieldInfo = [Gdk.Flags.ModifierType]
type AttrGetType StockItemModifierFieldInfo = [Gdk.Flags.ModifierType]
type AttrLabel StockItemModifierFieldInfo = "modifier"
type AttrOrigin StockItemModifierFieldInfo = StockItem
attrGet = getStockItemModifier
attrSet = setStockItemModifier
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
stockItem_modifier :: AttrLabelProxy "modifier"
stockItem_modifier = AttrLabelProxy
#endif
getStockItemKeyval :: MonadIO m => StockItem -> m Word32
getStockItemKeyval :: StockItem -> m Word32
getStockItemKeyval StockItem
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
$ StockItem -> (Ptr StockItem -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO Word32) -> IO Word32)
-> (Ptr StockItem -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setStockItemKeyval :: MonadIO m => StockItem -> Word32 -> m ()
setStockItemKeyval :: StockItem -> Word32 -> m ()
setStockItemKeyval StockItem
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
$ StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO ()) -> IO ())
-> (Ptr StockItem -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data StockItemKeyvalFieldInfo
instance AttrInfo StockItemKeyvalFieldInfo where
type AttrBaseTypeConstraint StockItemKeyvalFieldInfo = (~) StockItem
type AttrAllowedOps StockItemKeyvalFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint StockItemKeyvalFieldInfo = (~) Word32
type AttrTransferTypeConstraint StockItemKeyvalFieldInfo = (~)Word32
type AttrTransferType StockItemKeyvalFieldInfo = Word32
type AttrGetType StockItemKeyvalFieldInfo = Word32
type AttrLabel StockItemKeyvalFieldInfo = "keyval"
type AttrOrigin StockItemKeyvalFieldInfo = StockItem
attrGet = getStockItemKeyval
attrSet = setStockItemKeyval
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
stockItem_keyval :: AttrLabelProxy "keyval"
stockItem_keyval = AttrLabelProxy
#endif
getStockItemTranslationDomain :: MonadIO m => StockItem -> m (Maybe T.Text)
getStockItemTranslationDomain :: StockItem -> m (Maybe Text)
getStockItemTranslationDomain StockItem
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
$ StockItem -> (Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr StockItem -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: 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
setStockItemTranslationDomain :: MonadIO m => StockItem -> CString -> m ()
setStockItemTranslationDomain :: StockItem -> CString -> m ()
setStockItemTranslationDomain StockItem
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
$ StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO ()) -> IO ())
-> (Ptr StockItem -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (CString
val :: CString)
clearStockItemTranslationDomain :: MonadIO m => StockItem -> m ()
clearStockItemTranslationDomain :: StockItem -> m ()
clearStockItemTranslationDomain StockItem
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ StockItem -> (Ptr StockItem -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr StockItem
s ((Ptr StockItem -> IO ()) -> IO ())
-> (Ptr StockItem -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr StockItem
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr StockItem
ptr Ptr StockItem -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data StockItemTranslationDomainFieldInfo
instance AttrInfo StockItemTranslationDomainFieldInfo where
type AttrBaseTypeConstraint StockItemTranslationDomainFieldInfo = (~) StockItem
type AttrAllowedOps StockItemTranslationDomainFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StockItemTranslationDomainFieldInfo = (~) CString
type AttrTransferTypeConstraint StockItemTranslationDomainFieldInfo = (~)CString
type AttrTransferType StockItemTranslationDomainFieldInfo = CString
type AttrGetType StockItemTranslationDomainFieldInfo = Maybe T.Text
type AttrLabel StockItemTranslationDomainFieldInfo = "translation_domain"
type AttrOrigin StockItemTranslationDomainFieldInfo = StockItem
attrGet = getStockItemTranslationDomain
attrSet = setStockItemTranslationDomain
attrConstruct = undefined
attrClear = clearStockItemTranslationDomain
attrTransfer _ v = do
return v
stockItem_translationDomain :: AttrLabelProxy "translationDomain"
stockItem_translationDomain = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList StockItem
type instance O.AttributeList StockItem = StockItemAttributeList
type StockItemAttributeList = ('[ '("stockId", StockItemStockIdFieldInfo), '("label", StockItemLabelFieldInfo), '("modifier", StockItemModifierFieldInfo), '("keyval", StockItemKeyvalFieldInfo), '("translationDomain", StockItemTranslationDomainFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_stock_item_free" gtk_stock_item_free ::
Ptr StockItem ->
IO ()
{-# DEPRECATED stockItemFree ["(Since version 3.10)"] #-}
stockItemFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
StockItem
-> m ()
stockItemFree :: StockItem -> m ()
stockItemFree StockItem
item = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr StockItem
item' <- StockItem -> IO (Ptr StockItem)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr StockItem
item
Ptr StockItem -> IO ()
gtk_stock_item_free Ptr StockItem
item'
StockItem -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr StockItem
item
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data StockItemFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo StockItemFreeMethodInfo StockItem signature where
overloadedMethod = stockItemFree
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveStockItemMethod (t :: Symbol) (o :: *) :: * where
ResolveStockItemMethod "free" o = StockItemFreeMethodInfo
ResolveStockItemMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveStockItemMethod t StockItem, O.MethodInfo info StockItem p) => OL.IsLabel t (StockItem -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif