{-# LANGUAGE TypeApplications #-}
#if !defined(__HADDOCK_VERSION__)
#define ENABLE_OVERLOADING
#endif
module GI.HarfBuzz.Structs.GlyphPositionT
(
GlyphPositionT(..) ,
newZeroGlyphPositionT ,
#if defined(ENABLE_OVERLOADING)
ResolveGlyphPositionTMethod ,
#endif
getGlyphPositionTXAdvance ,
#if defined(ENABLE_OVERLOADING)
glyphPositionT_xAdvance ,
#endif
setGlyphPositionTXAdvance ,
getGlyphPositionTXOffset ,
#if defined(ENABLE_OVERLOADING)
glyphPositionT_xOffset ,
#endif
setGlyphPositionTXOffset ,
getGlyphPositionTYAdvance ,
#if defined(ENABLE_OVERLOADING)
glyphPositionT_yAdvance ,
#endif
setGlyphPositionTYAdvance ,
getGlyphPositionTYOffset ,
#if defined(ENABLE_OVERLOADING)
glyphPositionT_yOffset ,
#endif
setGlyphPositionTYOffset ,
) 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
newtype GlyphPositionT = GlyphPositionT (SP.ManagedPtr GlyphPositionT)
deriving (GlyphPositionT -> GlyphPositionT -> Bool
(GlyphPositionT -> GlyphPositionT -> Bool)
-> (GlyphPositionT -> GlyphPositionT -> Bool) -> Eq GlyphPositionT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlyphPositionT -> GlyphPositionT -> Bool
$c/= :: GlyphPositionT -> GlyphPositionT -> Bool
== :: GlyphPositionT -> GlyphPositionT -> Bool
$c== :: GlyphPositionT -> GlyphPositionT -> Bool
Eq)
instance SP.ManagedPtrNewtype GlyphPositionT where
toManagedPtr :: GlyphPositionT -> ManagedPtr GlyphPositionT
toManagedPtr (GlyphPositionT p :: ManagedPtr GlyphPositionT
p) = ManagedPtr GlyphPositionT
p
foreign import ccall "hb_gobject_glyph_position_get_type" c_hb_gobject_glyph_position_get_type ::
IO GType
type instance O.ParentTypes GlyphPositionT = '[]
instance O.HasParentTypes GlyphPositionT
instance B.Types.TypedObject GlyphPositionT where
glibType :: IO GType
glibType = IO GType
c_hb_gobject_glyph_position_get_type
instance B.Types.GBoxed GlyphPositionT
instance B.GValue.IsGValue GlyphPositionT where
toGValue :: GlyphPositionT -> IO GValue
toGValue o :: GlyphPositionT
o = do
GType
gtype <- IO GType
c_hb_gobject_glyph_position_get_type
GlyphPositionT -> (Ptr GlyphPositionT -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr GlyphPositionT
o (GType
-> (GValue -> Ptr GlyphPositionT -> IO ())
-> Ptr GlyphPositionT
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr GlyphPositionT -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO GlyphPositionT
fromGValue gv :: GValue
gv = do
Ptr GlyphPositionT
ptr <- GValue -> IO (Ptr GlyphPositionT)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr GlyphPositionT)
(ManagedPtr GlyphPositionT -> GlyphPositionT)
-> Ptr GlyphPositionT -> IO GlyphPositionT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr GlyphPositionT -> GlyphPositionT
GlyphPositionT Ptr GlyphPositionT
ptr
newZeroGlyphPositionT :: MonadIO m => m GlyphPositionT
newZeroGlyphPositionT :: m GlyphPositionT
newZeroGlyphPositionT = IO GlyphPositionT -> m GlyphPositionT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GlyphPositionT -> m GlyphPositionT)
-> IO GlyphPositionT -> m GlyphPositionT
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr GlyphPositionT)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes 20 IO (Ptr GlyphPositionT)
-> (Ptr GlyphPositionT -> IO GlyphPositionT) -> IO GlyphPositionT
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr GlyphPositionT -> GlyphPositionT)
-> Ptr GlyphPositionT -> IO GlyphPositionT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr GlyphPositionT -> GlyphPositionT
GlyphPositionT
instance tag ~ 'AttrSet => Constructible GlyphPositionT tag where
new :: (ManagedPtr GlyphPositionT -> GlyphPositionT)
-> [AttrOp GlyphPositionT tag] -> m GlyphPositionT
new _ attrs :: [AttrOp GlyphPositionT tag]
attrs = do
GlyphPositionT
o <- m GlyphPositionT
forall (m :: * -> *). MonadIO m => m GlyphPositionT
newZeroGlyphPositionT
GlyphPositionT -> [AttrOp GlyphPositionT 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set GlyphPositionT
o [AttrOp GlyphPositionT tag]
[AttrOp GlyphPositionT 'AttrSet]
attrs
GlyphPositionT -> m GlyphPositionT
forall (m :: * -> *) a. Monad m => a -> m a
return GlyphPositionT
o
getGlyphPositionTXAdvance :: MonadIO m => GlyphPositionT -> m Int32
getGlyphPositionTXAdvance :: GlyphPositionT -> m Int32
getGlyphPositionTXAdvance s :: GlyphPositionT
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
$ GlyphPositionT -> (Ptr GlyphPositionT -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphPositionT
s ((Ptr GlyphPositionT -> IO Int32) -> IO Int32)
-> (Ptr GlyphPositionT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr GlyphPositionT
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphPositionT
ptr Ptr GlyphPositionT -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) :: IO Int32
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setGlyphPositionTXAdvance :: MonadIO m => GlyphPositionT -> Int32 -> m ()
setGlyphPositionTXAdvance :: GlyphPositionT -> Int32 -> m ()
setGlyphPositionTXAdvance s :: GlyphPositionT
s val :: 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
$ GlyphPositionT -> (Ptr GlyphPositionT -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphPositionT
s ((Ptr GlyphPositionT -> IO ()) -> IO ())
-> (Ptr GlyphPositionT -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr GlyphPositionT
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphPositionT
ptr Ptr GlyphPositionT -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data GlyphPositionTXAdvanceFieldInfo
instance AttrInfo GlyphPositionTXAdvanceFieldInfo where
type AttrBaseTypeConstraint GlyphPositionTXAdvanceFieldInfo = (~) GlyphPositionT
type AttrAllowedOps GlyphPositionTXAdvanceFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint GlyphPositionTXAdvanceFieldInfo = (~) Int32
type AttrTransferTypeConstraint GlyphPositionTXAdvanceFieldInfo = (~)Int32
type AttrTransferType GlyphPositionTXAdvanceFieldInfo = Int32
type AttrGetType GlyphPositionTXAdvanceFieldInfo = Int32
type AttrLabel GlyphPositionTXAdvanceFieldInfo = "x_advance"
type AttrOrigin GlyphPositionTXAdvanceFieldInfo = GlyphPositionT
attrGet = getGlyphPositionTXAdvance
attrSet = setGlyphPositionTXAdvance
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
glyphPositionT_xAdvance :: AttrLabelProxy "xAdvance"
glyphPositionT_xAdvance = AttrLabelProxy
#endif
getGlyphPositionTYAdvance :: MonadIO m => GlyphPositionT -> m Int32
getGlyphPositionTYAdvance :: GlyphPositionT -> m Int32
getGlyphPositionTYAdvance s :: GlyphPositionT
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
$ GlyphPositionT -> (Ptr GlyphPositionT -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphPositionT
s ((Ptr GlyphPositionT -> IO Int32) -> IO Int32)
-> (Ptr GlyphPositionT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr GlyphPositionT
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphPositionT
ptr Ptr GlyphPositionT -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4) :: IO Int32
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setGlyphPositionTYAdvance :: MonadIO m => GlyphPositionT -> Int32 -> m ()
setGlyphPositionTYAdvance :: GlyphPositionT -> Int32 -> m ()
setGlyphPositionTYAdvance s :: GlyphPositionT
s val :: 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
$ GlyphPositionT -> (Ptr GlyphPositionT -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphPositionT
s ((Ptr GlyphPositionT -> IO ()) -> IO ())
-> (Ptr GlyphPositionT -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr GlyphPositionT
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphPositionT
ptr Ptr GlyphPositionT -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data GlyphPositionTYAdvanceFieldInfo
instance AttrInfo GlyphPositionTYAdvanceFieldInfo where
type AttrBaseTypeConstraint GlyphPositionTYAdvanceFieldInfo = (~) GlyphPositionT
type AttrAllowedOps GlyphPositionTYAdvanceFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint GlyphPositionTYAdvanceFieldInfo = (~) Int32
type AttrTransferTypeConstraint GlyphPositionTYAdvanceFieldInfo = (~)Int32
type AttrTransferType GlyphPositionTYAdvanceFieldInfo = Int32
type AttrGetType GlyphPositionTYAdvanceFieldInfo = Int32
type AttrLabel GlyphPositionTYAdvanceFieldInfo = "y_advance"
type AttrOrigin GlyphPositionTYAdvanceFieldInfo = GlyphPositionT
attrGet = getGlyphPositionTYAdvance
attrSet = setGlyphPositionTYAdvance
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
glyphPositionT_yAdvance :: AttrLabelProxy "yAdvance"
glyphPositionT_yAdvance = AttrLabelProxy
#endif
getGlyphPositionTXOffset :: MonadIO m => GlyphPositionT -> m Int32
getGlyphPositionTXOffset :: GlyphPositionT -> m Int32
getGlyphPositionTXOffset s :: GlyphPositionT
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
$ GlyphPositionT -> (Ptr GlyphPositionT -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphPositionT
s ((Ptr GlyphPositionT -> IO Int32) -> IO Int32)
-> (Ptr GlyphPositionT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr GlyphPositionT
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphPositionT
ptr Ptr GlyphPositionT -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) :: IO Int32
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setGlyphPositionTXOffset :: MonadIO m => GlyphPositionT -> Int32 -> m ()
setGlyphPositionTXOffset :: GlyphPositionT -> Int32 -> m ()
setGlyphPositionTXOffset s :: GlyphPositionT
s val :: 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
$ GlyphPositionT -> (Ptr GlyphPositionT -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphPositionT
s ((Ptr GlyphPositionT -> IO ()) -> IO ())
-> (Ptr GlyphPositionT -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr GlyphPositionT
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphPositionT
ptr Ptr GlyphPositionT -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data GlyphPositionTXOffsetFieldInfo
instance AttrInfo GlyphPositionTXOffsetFieldInfo where
type AttrBaseTypeConstraint GlyphPositionTXOffsetFieldInfo = (~) GlyphPositionT
type AttrAllowedOps GlyphPositionTXOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint GlyphPositionTXOffsetFieldInfo = (~) Int32
type AttrTransferTypeConstraint GlyphPositionTXOffsetFieldInfo = (~)Int32
type AttrTransferType GlyphPositionTXOffsetFieldInfo = Int32
type AttrGetType GlyphPositionTXOffsetFieldInfo = Int32
type AttrLabel GlyphPositionTXOffsetFieldInfo = "x_offset"
type AttrOrigin GlyphPositionTXOffsetFieldInfo = GlyphPositionT
attrGet = getGlyphPositionTXOffset
attrSet = setGlyphPositionTXOffset
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
glyphPositionT_xOffset :: AttrLabelProxy "xOffset"
glyphPositionT_xOffset = AttrLabelProxy
#endif
getGlyphPositionTYOffset :: MonadIO m => GlyphPositionT -> m Int32
getGlyphPositionTYOffset :: GlyphPositionT -> m Int32
getGlyphPositionTYOffset s :: GlyphPositionT
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
$ GlyphPositionT -> (Ptr GlyphPositionT -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphPositionT
s ((Ptr GlyphPositionT -> IO Int32) -> IO Int32)
-> (Ptr GlyphPositionT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr GlyphPositionT
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr GlyphPositionT
ptr Ptr GlyphPositionT -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12) :: IO Int32
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setGlyphPositionTYOffset :: MonadIO m => GlyphPositionT -> Int32 -> m ()
setGlyphPositionTYOffset :: GlyphPositionT -> Int32 -> m ()
setGlyphPositionTYOffset s :: GlyphPositionT
s val :: 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
$ GlyphPositionT -> (Ptr GlyphPositionT -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr GlyphPositionT
s ((Ptr GlyphPositionT -> IO ()) -> IO ())
-> (Ptr GlyphPositionT -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr GlyphPositionT
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr GlyphPositionT
ptr Ptr GlyphPositionT -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data GlyphPositionTYOffsetFieldInfo
instance AttrInfo GlyphPositionTYOffsetFieldInfo where
type AttrBaseTypeConstraint GlyphPositionTYOffsetFieldInfo = (~) GlyphPositionT
type AttrAllowedOps GlyphPositionTYOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint GlyphPositionTYOffsetFieldInfo = (~) Int32
type AttrTransferTypeConstraint GlyphPositionTYOffsetFieldInfo = (~)Int32
type AttrTransferType GlyphPositionTYOffsetFieldInfo = Int32
type AttrGetType GlyphPositionTYOffsetFieldInfo = Int32
type AttrLabel GlyphPositionTYOffsetFieldInfo = "y_offset"
type AttrOrigin GlyphPositionTYOffsetFieldInfo = GlyphPositionT
attrGet = getGlyphPositionTYOffset
attrSet = setGlyphPositionTYOffset
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
glyphPositionT_yOffset :: AttrLabelProxy "yOffset"
glyphPositionT_yOffset = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList GlyphPositionT
type instance O.AttributeList GlyphPositionT = GlyphPositionTAttributeList
type GlyphPositionTAttributeList = ('[ '("xAdvance", GlyphPositionTXAdvanceFieldInfo), '("yAdvance", GlyphPositionTYAdvanceFieldInfo), '("xOffset", GlyphPositionTXOffsetFieldInfo), '("yOffset", GlyphPositionTYOffsetFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveGlyphPositionTMethod (t :: Symbol) (o :: *) :: * where
ResolveGlyphPositionTMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveGlyphPositionTMethod t GlyphPositionT, O.MethodInfo info GlyphPositionT p) => OL.IsLabel t (GlyphPositionT -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif