{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Pango.Structs.GlyphItem
(
GlyphItem(..) ,
newZeroGlyphItem ,
#if defined(ENABLE_OVERLOADING)
ResolveGlyphItemMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
GlyphItemApplyAttrsMethodInfo ,
#endif
glyphItemApplyAttrs ,
#if defined(ENABLE_OVERLOADING)
GlyphItemCopyMethodInfo ,
#endif
glyphItemCopy ,
#if defined(ENABLE_OVERLOADING)
GlyphItemFreeMethodInfo ,
#endif
glyphItemFree ,
#if defined(ENABLE_OVERLOADING)
GlyphItemGetLogicalWidthsMethodInfo ,
#endif
glyphItemGetLogicalWidths ,
#if defined(ENABLE_OVERLOADING)
GlyphItemLetterSpaceMethodInfo ,
#endif
glyphItemLetterSpace ,
#if defined(ENABLE_OVERLOADING)
GlyphItemSplitMethodInfo ,
#endif
glyphItemSplit ,
getGlyphItemEndXOffset ,
#if defined(ENABLE_OVERLOADING)
glyphItem_endXOffset ,
#endif
setGlyphItemEndXOffset ,
clearGlyphItemGlyphs ,
getGlyphItemGlyphs ,
#if defined(ENABLE_OVERLOADING)
glyphItem_glyphs ,
#endif
setGlyphItemGlyphs ,
clearGlyphItemItem ,
getGlyphItemItem ,
#if defined(ENABLE_OVERLOADING)
glyphItem_item ,
#endif
setGlyphItemItem ,
getGlyphItemStartXOffset ,
#if defined(ENABLE_OVERLOADING)
glyphItem_startXOffset ,
#endif
setGlyphItemStartXOffset ,
getGlyphItemYOffset ,
#if defined(ENABLE_OVERLOADING)
glyphItem_yOffset ,
#endif
setGlyphItemYOffset ,
) 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.GHashTable as B.GHT
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.Kind as DK
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.Pango.Structs.AttrList as Pango.AttrList
import {-# SOURCE #-} qualified GI.Pango.Structs.GlyphString as Pango.GlyphString
import {-# SOURCE #-} qualified GI.Pango.Structs.Item as Pango.Item
import {-# SOURCE #-} qualified GI.Pango.Structs.LogAttr as Pango.LogAttr
newtype GlyphItem = GlyphItem (SP.ManagedPtr GlyphItem)
deriving (GlyphItem -> GlyphItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlyphItem -> GlyphItem -> Bool
$c/= :: GlyphItem -> GlyphItem -> Bool
== :: GlyphItem -> GlyphItem -> Bool
$c== :: GlyphItem -> GlyphItem -> Bool
Eq)
instance SP.ManagedPtrNewtype GlyphItem where
toManagedPtr :: GlyphItem -> ManagedPtr GlyphItem
toManagedPtr (GlyphItem ManagedPtr GlyphItem
p) = ManagedPtr GlyphItem
p
foreign import ccall "pango_glyph_item_get_type" c_pango_glyph_item_get_type ::
IO GType
type instance O.ParentTypes GlyphItem = '[]
instance O.HasParentTypes GlyphItem
instance B.Types.TypedObject GlyphItem where
glibType :: IO GType
glibType = IO GType
c_pango_glyph_item_get_type
instance B.Types.GBoxed GlyphItem
instance B.GValue.IsGValue (Maybe GlyphItem) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_pango_glyph_item_get_type
gvalueSet_ :: Ptr GValue -> Maybe GlyphItem -> IO ()
gvalueSet_ Ptr GValue
gv Maybe GlyphItem
P.Nothing = forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr GlyphItem)
gvalueSet_ Ptr GValue
gv (P.Just GlyphItem
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr GlyphItem
obj (forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe GlyphItem)
gvalueGet_ Ptr GValue
gv = do
Ptr GlyphItem
ptr <- forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr GlyphItem)
if Ptr GlyphItem
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr GlyphItem -> GlyphItem
GlyphItem Ptr GlyphItem
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
newZeroGlyphItem :: MonadIO m => m GlyphItem
newZeroGlyphItem :: forall (m :: * -> *). MonadIO m => m GlyphItem
newZeroGlyphItem = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
32 forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr GlyphItem -> GlyphItem
GlyphItem
instance tag ~ 'AttrSet => Constructible GlyphItem tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr GlyphItem -> GlyphItem)
-> [AttrOp GlyphItem tag] -> m GlyphItem
new ManagedPtr GlyphItem -> GlyphItem
_ [AttrOp GlyphItem tag]
attrs = do
GlyphItem
o <- forall (m :: * -> *). MonadIO m => m GlyphItem
newZeroGlyphItem
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set GlyphItem
o [AttrOp GlyphItem tag]
attrs
forall (m :: * -> *) a. Monad m => a -> m a
return GlyphItem
o
getGlyphItemItem :: MonadIO m => GlyphItem -> m (Maybe Pango.Item.Item)
getGlyphItemItem :: forall (m :: * -> *). MonadIO m => GlyphItem -> m (Maybe Item)
getGlyphItemItem GlyphItem
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
Ptr Item
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (Ptr Pango.Item.Item)
Maybe Item
result <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr Item
val forall a b. (a -> b) -> a -> b
$ \Ptr Item
val' -> do
Item
val'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Item -> Item
Pango.Item.Item) Ptr Item
val'
forall (m :: * -> *) a. Monad m => a -> m a
return Item
val''
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Item
result
setGlyphItemItem :: MonadIO m => GlyphItem -> Ptr Pango.Item.Item -> m ()
setGlyphItemItem :: forall (m :: * -> *). MonadIO m => GlyphItem -> Ptr Item -> m ()
setGlyphItemItem GlyphItem
s Ptr Item
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr Item
val :: Ptr Pango.Item.Item)
clearGlyphItemItem :: MonadIO m => GlyphItem -> m ()
clearGlyphItemItem :: forall (m :: * -> *). MonadIO m => GlyphItem -> m ()
clearGlyphItemItem GlyphItem
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (forall a. Ptr a
FP.nullPtr :: Ptr Pango.Item.Item)
#if defined(ENABLE_OVERLOADING)
data GlyphItemItemFieldInfo
instance AttrInfo GlyphItemItemFieldInfo where
type AttrBaseTypeConstraint GlyphItemItemFieldInfo = (~) GlyphItem
type AttrAllowedOps GlyphItemItemFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint GlyphItemItemFieldInfo = (~) (Ptr Pango.Item.Item)
type AttrTransferTypeConstraint GlyphItemItemFieldInfo = (~)(Ptr Pango.Item.Item)
type AttrTransferType GlyphItemItemFieldInfo = (Ptr Pango.Item.Item)
type AttrGetType GlyphItemItemFieldInfo = Maybe Pango.Item.Item
type AttrLabel GlyphItemItemFieldInfo = "item"
type AttrOrigin GlyphItemItemFieldInfo = GlyphItem
attrGet = getGlyphItemItem
attrSet = setGlyphItemItem
attrConstruct = undefined
attrClear = clearGlyphItemItem
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.item"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#g:attr:item"
})
glyphItem_item :: AttrLabelProxy "item"
glyphItem_item = AttrLabelProxy
#endif
getGlyphItemGlyphs :: MonadIO m => GlyphItem -> m (Maybe Pango.GlyphString.GlyphString)
getGlyphItemGlyphs :: forall (m :: * -> *).
MonadIO m =>
GlyphItem -> m (Maybe GlyphString)
getGlyphItemGlyphs GlyphItem
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
Ptr GlyphString
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO (Ptr Pango.GlyphString.GlyphString)
Maybe GlyphString
result <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr GlyphString
val forall a b. (a -> b) -> a -> b
$ \Ptr GlyphString
val' -> do
GlyphString
val'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GlyphString -> GlyphString
Pango.GlyphString.GlyphString) Ptr GlyphString
val'
forall (m :: * -> *) a. Monad m => a -> m a
return GlyphString
val''
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GlyphString
result
setGlyphItemGlyphs :: MonadIO m => GlyphItem -> Ptr Pango.GlyphString.GlyphString -> m ()
setGlyphItemGlyphs :: forall (m :: * -> *).
MonadIO m =>
GlyphItem -> Ptr GlyphString -> m ()
setGlyphItemGlyphs GlyphItem
s Ptr GlyphString
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Ptr GlyphString
val :: Ptr Pango.GlyphString.GlyphString)
clearGlyphItemGlyphs :: MonadIO m => GlyphItem -> m ()
clearGlyphItemGlyphs :: forall (m :: * -> *). MonadIO m => GlyphItem -> m ()
clearGlyphItemGlyphs GlyphItem
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (forall a. Ptr a
FP.nullPtr :: Ptr Pango.GlyphString.GlyphString)
#if defined(ENABLE_OVERLOADING)
data GlyphItemGlyphsFieldInfo
instance AttrInfo GlyphItemGlyphsFieldInfo where
type AttrBaseTypeConstraint GlyphItemGlyphsFieldInfo = (~) GlyphItem
type AttrAllowedOps GlyphItemGlyphsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint GlyphItemGlyphsFieldInfo = (~) (Ptr Pango.GlyphString.GlyphString)
type AttrTransferTypeConstraint GlyphItemGlyphsFieldInfo = (~)(Ptr Pango.GlyphString.GlyphString)
type AttrTransferType GlyphItemGlyphsFieldInfo = (Ptr Pango.GlyphString.GlyphString)
type AttrGetType GlyphItemGlyphsFieldInfo = Maybe Pango.GlyphString.GlyphString
type AttrLabel GlyphItemGlyphsFieldInfo = "glyphs"
type AttrOrigin GlyphItemGlyphsFieldInfo = GlyphItem
attrGet = getGlyphItemGlyphs
attrSet = setGlyphItemGlyphs
attrConstruct = undefined
attrClear = clearGlyphItemGlyphs
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.glyphs"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#g:attr:glyphs"
})
glyphItem_glyphs :: AttrLabelProxy "glyphs"
glyphItem_glyphs = AttrLabelProxy
#endif
getGlyphItemYOffset :: MonadIO m => GlyphItem -> m Int32
getGlyphItemYOffset :: forall (m :: * -> *). MonadIO m => GlyphItem -> m Int32
getGlyphItemYOffset GlyphItem
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
Int32
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setGlyphItemYOffset :: MonadIO m => GlyphItem -> Int32 -> m ()
setGlyphItemYOffset :: forall (m :: * -> *). MonadIO m => GlyphItem -> Int32 -> m ()
setGlyphItemYOffset GlyphItem
s Int32
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data GlyphItemYOffsetFieldInfo
instance AttrInfo GlyphItemYOffsetFieldInfo where
type AttrBaseTypeConstraint GlyphItemYOffsetFieldInfo = (~) GlyphItem
type AttrAllowedOps GlyphItemYOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint GlyphItemYOffsetFieldInfo = (~) Int32
type AttrTransferTypeConstraint GlyphItemYOffsetFieldInfo = (~)Int32
type AttrTransferType GlyphItemYOffsetFieldInfo = Int32
type AttrGetType GlyphItemYOffsetFieldInfo = Int32
type AttrLabel GlyphItemYOffsetFieldInfo = "y_offset"
type AttrOrigin GlyphItemYOffsetFieldInfo = GlyphItem
attrGet = getGlyphItemYOffset
attrSet = setGlyphItemYOffset
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.yOffset"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#g:attr:yOffset"
})
glyphItem_yOffset :: AttrLabelProxy "yOffset"
glyphItem_yOffset = AttrLabelProxy
#endif
getGlyphItemStartXOffset :: MonadIO m => GlyphItem -> m Int32
getGlyphItemStartXOffset :: forall (m :: * -> *). MonadIO m => GlyphItem -> m Int32
getGlyphItemStartXOffset GlyphItem
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
Int32
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20) :: IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setGlyphItemStartXOffset :: MonadIO m => GlyphItem -> Int32 -> m ()
setGlyphItemStartXOffset :: forall (m :: * -> *). MonadIO m => GlyphItem -> Int32 -> m ()
setGlyphItemStartXOffset GlyphItem
s Int32
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data GlyphItemStartXOffsetFieldInfo
instance AttrInfo GlyphItemStartXOffsetFieldInfo where
type AttrBaseTypeConstraint GlyphItemStartXOffsetFieldInfo = (~) GlyphItem
type AttrAllowedOps GlyphItemStartXOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint GlyphItemStartXOffsetFieldInfo = (~) Int32
type AttrTransferTypeConstraint GlyphItemStartXOffsetFieldInfo = (~)Int32
type AttrTransferType GlyphItemStartXOffsetFieldInfo = Int32
type AttrGetType GlyphItemStartXOffsetFieldInfo = Int32
type AttrLabel GlyphItemStartXOffsetFieldInfo = "start_x_offset"
type AttrOrigin GlyphItemStartXOffsetFieldInfo = GlyphItem
attrGet = getGlyphItemStartXOffset
attrSet = setGlyphItemStartXOffset
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.startXOffset"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#g:attr:startXOffset"
})
glyphItem_startXOffset :: AttrLabelProxy "startXOffset"
glyphItem_startXOffset = AttrLabelProxy
#endif
getGlyphItemEndXOffset :: MonadIO m => GlyphItem -> m Int32
getGlyphItemEndXOffset :: forall (m :: * -> *). MonadIO m => GlyphItem -> m Int32
getGlyphItemEndXOffset GlyphItem
s = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
Int32
val <- forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setGlyphItemEndXOffset :: MonadIO m => GlyphItem -> Int32 -> m ()
setGlyphItemEndXOffset :: forall (m :: * -> *). MonadIO m => GlyphItem -> Int32 -> m ()
setGlyphItemEndXOffset GlyphItem
s Int32
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphItem
s forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
ptr -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphItem
ptr forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data GlyphItemEndXOffsetFieldInfo
instance AttrInfo GlyphItemEndXOffsetFieldInfo where
type AttrBaseTypeConstraint GlyphItemEndXOffsetFieldInfo = (~) GlyphItem
type AttrAllowedOps GlyphItemEndXOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint GlyphItemEndXOffsetFieldInfo = (~) Int32
type AttrTransferTypeConstraint GlyphItemEndXOffsetFieldInfo = (~)Int32
type AttrTransferType GlyphItemEndXOffsetFieldInfo = Int32
type AttrGetType GlyphItemEndXOffsetFieldInfo = Int32
type AttrLabel GlyphItemEndXOffsetFieldInfo = "end_x_offset"
type AttrOrigin GlyphItemEndXOffsetFieldInfo = GlyphItem
attrGet = getGlyphItemEndXOffset
attrSet = setGlyphItemEndXOffset
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.endXOffset"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#g:attr:endXOffset"
})
glyphItem_endXOffset :: AttrLabelProxy "endXOffset"
glyphItem_endXOffset = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList GlyphItem
type instance O.AttributeList GlyphItem = GlyphItemAttributeList
type GlyphItemAttributeList = ('[ '("item", GlyphItemItemFieldInfo), '("glyphs", GlyphItemGlyphsFieldInfo), '("yOffset", GlyphItemYOffsetFieldInfo), '("startXOffset", GlyphItemStartXOffsetFieldInfo), '("endXOffset", GlyphItemEndXOffsetFieldInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "pango_glyph_item_apply_attrs" pango_glyph_item_apply_attrs ::
Ptr GlyphItem ->
CString ->
Ptr Pango.AttrList.AttrList ->
IO (Ptr (GSList (Ptr GlyphItem)))
glyphItemApplyAttrs ::
(B.CallStack.HasCallStack, MonadIO m) =>
GlyphItem
-> T.Text
-> Pango.AttrList.AttrList
-> m [GlyphItem]
glyphItemApplyAttrs :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GlyphItem -> Text -> AttrList -> m [GlyphItem]
glyphItemApplyAttrs GlyphItem
glyphItem Text
text AttrList
list = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GlyphItem
glyphItem' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphItem
glyphItem
CString
text' <- Text -> IO CString
textToCString Text
text
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr (GSList (Ptr GlyphItem))
result <- Ptr GlyphItem
-> CString -> Ptr AttrList -> IO (Ptr (GSList (Ptr GlyphItem)))
pango_glyph_item_apply_attrs Ptr GlyphItem
glyphItem' CString
text' Ptr AttrList
list'
[Ptr GlyphItem]
result' <- forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr GlyphItem))
result
[GlyphItem]
result'' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr GlyphItem -> GlyphItem
GlyphItem) [Ptr GlyphItem]
result'
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr GlyphItem))
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphItem
glyphItem
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall a. Ptr a -> IO ()
freeMem CString
text'
forall (m :: * -> *) a. Monad m => a -> m a
return [GlyphItem]
result''
#if defined(ENABLE_OVERLOADING)
data GlyphItemApplyAttrsMethodInfo
instance (signature ~ (T.Text -> Pango.AttrList.AttrList -> m [GlyphItem]), MonadIO m) => O.OverloadedMethod GlyphItemApplyAttrsMethodInfo GlyphItem signature where
overloadedMethod = glyphItemApplyAttrs
instance O.OverloadedMethodInfo GlyphItemApplyAttrsMethodInfo GlyphItem where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.glyphItemApplyAttrs",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#v:glyphItemApplyAttrs"
})
#endif
foreign import ccall "pango_glyph_item_copy" pango_glyph_item_copy ::
Ptr GlyphItem ->
IO (Ptr GlyphItem)
glyphItemCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
GlyphItem
-> m (Maybe GlyphItem)
glyphItemCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GlyphItem -> m (Maybe GlyphItem)
glyphItemCopy GlyphItem
orig = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GlyphItem
orig' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphItem
orig
Ptr GlyphItem
result <- Ptr GlyphItem -> IO (Ptr GlyphItem)
pango_glyph_item_copy Ptr GlyphItem
orig'
Maybe GlyphItem
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr GlyphItem
result forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
result' -> do
GlyphItem
result'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr GlyphItem -> GlyphItem
GlyphItem) Ptr GlyphItem
result'
forall (m :: * -> *) a. Monad m => a -> m a
return GlyphItem
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphItem
orig
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GlyphItem
maybeResult
#if defined(ENABLE_OVERLOADING)
data GlyphItemCopyMethodInfo
instance (signature ~ (m (Maybe GlyphItem)), MonadIO m) => O.OverloadedMethod GlyphItemCopyMethodInfo GlyphItem signature where
overloadedMethod = glyphItemCopy
instance O.OverloadedMethodInfo GlyphItemCopyMethodInfo GlyphItem where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.glyphItemCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#v:glyphItemCopy"
})
#endif
foreign import ccall "pango_glyph_item_free" pango_glyph_item_free ::
Ptr GlyphItem ->
IO ()
glyphItemFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
GlyphItem
-> m ()
glyphItemFree :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GlyphItem -> m ()
glyphItemFree GlyphItem
glyphItem = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GlyphItem
glyphItem' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphItem
glyphItem
Ptr GlyphItem -> IO ()
pango_glyph_item_free Ptr GlyphItem
glyphItem'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphItem
glyphItem
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GlyphItemFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod GlyphItemFreeMethodInfo GlyphItem signature where
overloadedMethod = glyphItemFree
instance O.OverloadedMethodInfo GlyphItemFreeMethodInfo GlyphItem where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.glyphItemFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#v:glyphItemFree"
})
#endif
foreign import ccall "pango_glyph_item_get_logical_widths" pango_glyph_item_get_logical_widths ::
Ptr GlyphItem ->
CString ->
Ptr Int32 ->
IO ()
glyphItemGetLogicalWidths ::
(B.CallStack.HasCallStack, MonadIO m) =>
GlyphItem
-> T.Text
-> [Int32]
-> m ()
glyphItemGetLogicalWidths :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GlyphItem -> Text -> [Int32] -> m ()
glyphItemGetLogicalWidths GlyphItem
glyphItem Text
text [Int32]
logicalWidths = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GlyphItem
glyphItem' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphItem
glyphItem
CString
text' <- Text -> IO CString
textToCString Text
text
Ptr Int32
logicalWidths' <- forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Int32]
logicalWidths
Ptr GlyphItem -> CString -> Ptr Int32 -> IO ()
pango_glyph_item_get_logical_widths Ptr GlyphItem
glyphItem' CString
text' Ptr Int32
logicalWidths'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphItem
glyphItem
forall a. Ptr a -> IO ()
freeMem CString
text'
forall a. Ptr a -> IO ()
freeMem Ptr Int32
logicalWidths'
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GlyphItemGetLogicalWidthsMethodInfo
instance (signature ~ (T.Text -> [Int32] -> m ()), MonadIO m) => O.OverloadedMethod GlyphItemGetLogicalWidthsMethodInfo GlyphItem signature where
overloadedMethod = glyphItemGetLogicalWidths
instance O.OverloadedMethodInfo GlyphItemGetLogicalWidthsMethodInfo GlyphItem where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.glyphItemGetLogicalWidths",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#v:glyphItemGetLogicalWidths"
})
#endif
foreign import ccall "pango_glyph_item_letter_space" pango_glyph_item_letter_space ::
Ptr GlyphItem ->
CString ->
Ptr Pango.LogAttr.LogAttr ->
Int32 ->
IO ()
glyphItemLetterSpace ::
(B.CallStack.HasCallStack, MonadIO m) =>
GlyphItem
-> T.Text
-> [Pango.LogAttr.LogAttr]
-> Int32
-> m ()
glyphItemLetterSpace :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GlyphItem -> Text -> [LogAttr] -> Int32 -> m ()
glyphItemLetterSpace GlyphItem
glyphItem Text
text [LogAttr]
logAttrs Int32
letterSpacing = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GlyphItem
glyphItem' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphItem
glyphItem
CString
text' <- Text -> IO CString
textToCString Text
text
[Ptr LogAttr]
logAttrs' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [LogAttr]
logAttrs
Ptr LogAttr
logAttrs'' <- forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
64 [Ptr LogAttr]
logAttrs'
Ptr GlyphItem -> CString -> Ptr LogAttr -> Int32 -> IO ()
pango_glyph_item_letter_space Ptr GlyphItem
glyphItem' CString
text' Ptr LogAttr
logAttrs'' Int32
letterSpacing
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphItem
glyphItem
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [LogAttr]
logAttrs
forall a. Ptr a -> IO ()
freeMem CString
text'
forall a. Ptr a -> IO ()
freeMem Ptr LogAttr
logAttrs''
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GlyphItemLetterSpaceMethodInfo
instance (signature ~ (T.Text -> [Pango.LogAttr.LogAttr] -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod GlyphItemLetterSpaceMethodInfo GlyphItem signature where
overloadedMethod = glyphItemLetterSpace
instance O.OverloadedMethodInfo GlyphItemLetterSpaceMethodInfo GlyphItem where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.glyphItemLetterSpace",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#v:glyphItemLetterSpace"
})
#endif
foreign import ccall "pango_glyph_item_split" pango_glyph_item_split ::
Ptr GlyphItem ->
CString ->
Int32 ->
IO (Ptr GlyphItem)
glyphItemSplit ::
(B.CallStack.HasCallStack, MonadIO m) =>
GlyphItem
-> T.Text
-> Int32
-> m (Maybe GlyphItem)
glyphItemSplit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GlyphItem -> Text -> Int32 -> m (Maybe GlyphItem)
glyphItemSplit GlyphItem
orig Text
text Int32
splitIndex = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GlyphItem
orig' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphItem
orig
CString
text' <- Text -> IO CString
textToCString Text
text
Ptr GlyphItem
result <- Ptr GlyphItem -> CString -> Int32 -> IO (Ptr GlyphItem)
pango_glyph_item_split Ptr GlyphItem
orig' CString
text' Int32
splitIndex
Maybe GlyphItem
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr GlyphItem
result forall a b. (a -> b) -> a -> b
$ \Ptr GlyphItem
result' -> do
GlyphItem
result'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr GlyphItem -> GlyphItem
GlyphItem) Ptr GlyphItem
result'
forall (m :: * -> *) a. Monad m => a -> m a
return GlyphItem
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphItem
orig
forall a. Ptr a -> IO ()
freeMem CString
text'
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GlyphItem
maybeResult
#if defined(ENABLE_OVERLOADING)
data GlyphItemSplitMethodInfo
instance (signature ~ (T.Text -> Int32 -> m (Maybe GlyphItem)), MonadIO m) => O.OverloadedMethod GlyphItemSplitMethodInfo GlyphItem signature where
overloadedMethod = glyphItemSplit
instance O.OverloadedMethodInfo GlyphItemSplitMethodInfo GlyphItem where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.GlyphItem.glyphItemSplit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-GlyphItem.html#v:glyphItemSplit"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveGlyphItemMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveGlyphItemMethod "applyAttrs" o = GlyphItemApplyAttrsMethodInfo
ResolveGlyphItemMethod "copy" o = GlyphItemCopyMethodInfo
ResolveGlyphItemMethod "free" o = GlyphItemFreeMethodInfo
ResolveGlyphItemMethod "letterSpace" o = GlyphItemLetterSpaceMethodInfo
ResolveGlyphItemMethod "split" o = GlyphItemSplitMethodInfo
ResolveGlyphItemMethod "getLogicalWidths" o = GlyphItemGetLogicalWidthsMethodInfo
ResolveGlyphItemMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveGlyphItemMethod t GlyphItem, O.OverloadedMethod info GlyphItem p) => OL.IsLabel t (GlyphItem -> 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 ~ ResolveGlyphItemMethod t GlyphItem, O.OverloadedMethod info GlyphItem p, R.HasField t GlyphItem p) => R.HasField t GlyphItem p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveGlyphItemMethod t GlyphItem, O.OverloadedMethodInfo info GlyphItem) => OL.IsLabel t (O.MethodProxy info GlyphItem) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif