{-# LANGUAGE TypeApplications #-}
#if !defined(__HADDOCK_VERSION__)
#define ENABLE_OVERLOADING
#endif
module GI.Pango.Structs.LayoutLine
(
LayoutLine(..) ,
newZeroLayoutLine ,
#if defined(ENABLE_OVERLOADING)
ResolveLayoutLineMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
LayoutLineGetExtentsMethodInfo ,
#endif
layoutLineGetExtents ,
#if defined(ENABLE_OVERLOADING)
LayoutLineGetHeightMethodInfo ,
#endif
layoutLineGetHeight ,
#if defined(ENABLE_OVERLOADING)
LayoutLineGetLengthMethodInfo ,
#endif
layoutLineGetLength ,
#if defined(ENABLE_OVERLOADING)
LayoutLineGetPixelExtentsMethodInfo ,
#endif
layoutLineGetPixelExtents ,
#if defined(ENABLE_OVERLOADING)
LayoutLineGetResolvedDirectionMethodInfo,
#endif
layoutLineGetResolvedDirection ,
#if defined(ENABLE_OVERLOADING)
LayoutLineGetStartIndexMethodInfo ,
#endif
layoutLineGetStartIndex ,
#if defined(ENABLE_OVERLOADING)
LayoutLineGetXRangesMethodInfo ,
#endif
layoutLineGetXRanges ,
#if defined(ENABLE_OVERLOADING)
LayoutLineIndexToXMethodInfo ,
#endif
layoutLineIndexToX ,
#if defined(ENABLE_OVERLOADING)
LayoutLineIsParagraphStartMethodInfo ,
#endif
layoutLineIsParagraphStart ,
#if defined(ENABLE_OVERLOADING)
LayoutLineRefMethodInfo ,
#endif
layoutLineRef ,
#if defined(ENABLE_OVERLOADING)
LayoutLineUnrefMethodInfo ,
#endif
layoutLineUnref ,
#if defined(ENABLE_OVERLOADING)
LayoutLineXToIndexMethodInfo ,
#endif
layoutLineXToIndex ,
getLayoutLineIsParagraphStart ,
#if defined(ENABLE_OVERLOADING)
layoutLine_isParagraphStart ,
#endif
setLayoutLineIsParagraphStart ,
clearLayoutLineLayout ,
getLayoutLineLayout ,
#if defined(ENABLE_OVERLOADING)
layoutLine_layout ,
#endif
setLayoutLineLayout ,
getLayoutLineLength ,
#if defined(ENABLE_OVERLOADING)
layoutLine_length ,
#endif
setLayoutLineLength ,
getLayoutLineResolvedDir ,
#if defined(ENABLE_OVERLOADING)
layoutLine_resolvedDir ,
#endif
setLayoutLineResolvedDir ,
clearLayoutLineRuns ,
getLayoutLineRuns ,
#if defined(ENABLE_OVERLOADING)
layoutLine_runs ,
#endif
setLayoutLineRuns ,
getLayoutLineStartIndex ,
#if defined(ENABLE_OVERLOADING)
layoutLine_startIndex ,
#endif
setLayoutLineStartIndex ,
) 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 qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.HarfBuzz.Structs.FeatureT as HarfBuzz.FeatureT
import qualified GI.Pango.Callbacks as Pango.Callbacks
import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
import {-# SOURCE #-} qualified GI.Pango.Flags as Pango.Flags
import {-# SOURCE #-} qualified GI.Pango.Objects.Context as Pango.Context
import {-# SOURCE #-} qualified GI.Pango.Objects.Coverage as Pango.Coverage
import {-# SOURCE #-} qualified GI.Pango.Objects.Font as Pango.Font
import {-# SOURCE #-} qualified GI.Pango.Objects.FontFace as Pango.FontFace
import {-# SOURCE #-} qualified GI.Pango.Objects.FontFamily as Pango.FontFamily
import {-# SOURCE #-} qualified GI.Pango.Objects.FontMap as Pango.FontMap
import {-# SOURCE #-} qualified GI.Pango.Objects.Fontset as Pango.Fontset
import {-# SOURCE #-} qualified GI.Pango.Objects.Layout as Pango.Layout
import {-# SOURCE #-} qualified GI.Pango.Structs.Analysis as Pango.Analysis
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrClass as Pango.AttrClass
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrColor as Pango.AttrColor
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrFloat as Pango.AttrFloat
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrFontDesc as Pango.AttrFontDesc
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrFontFeatures as Pango.AttrFontFeatures
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrInt as Pango.AttrInt
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrIterator as Pango.AttrIterator
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrLanguage as Pango.AttrLanguage
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrList as Pango.AttrList
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrShape as Pango.AttrShape
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrSize as Pango.AttrSize
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrString as Pango.AttrString
import {-# SOURCE #-} qualified GI.Pango.Structs.Attribute as Pango.Attribute
import {-# SOURCE #-} qualified GI.Pango.Structs.Color as Pango.Color
import {-# SOURCE #-} qualified GI.Pango.Structs.FontDescription as Pango.FontDescription
import {-# SOURCE #-} qualified GI.Pango.Structs.FontMetrics as Pango.FontMetrics
import {-# SOURCE #-} qualified GI.Pango.Structs.GlyphItem as Pango.GlyphItem
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.Language as Pango.Language
import {-# SOURCE #-} qualified GI.Pango.Structs.LayoutIter as Pango.LayoutIter
import {-# SOURCE #-} qualified GI.Pango.Structs.LogAttr as Pango.LogAttr
import {-# SOURCE #-} qualified GI.Pango.Structs.Matrix as Pango.Matrix
import {-# SOURCE #-} qualified GI.Pango.Structs.Rectangle as Pango.Rectangle
import {-# SOURCE #-} qualified GI.Pango.Structs.TabArray as Pango.TabArray
#else
import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
import {-# SOURCE #-} qualified GI.Pango.Objects.Layout as Pango.Layout
import {-# SOURCE #-} qualified GI.Pango.Structs.GlyphItem as Pango.GlyphItem
import {-# SOURCE #-} qualified GI.Pango.Structs.Rectangle as Pango.Rectangle
#endif
newtype LayoutLine = LayoutLine (SP.ManagedPtr LayoutLine)
deriving (LayoutLine -> LayoutLine -> Bool
(LayoutLine -> LayoutLine -> Bool)
-> (LayoutLine -> LayoutLine -> Bool) -> Eq LayoutLine
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LayoutLine -> LayoutLine -> Bool
== :: LayoutLine -> LayoutLine -> Bool
$c/= :: LayoutLine -> LayoutLine -> Bool
/= :: LayoutLine -> LayoutLine -> Bool
Eq)
instance SP.ManagedPtrNewtype LayoutLine where
toManagedPtr :: LayoutLine -> ManagedPtr LayoutLine
toManagedPtr (LayoutLine ManagedPtr LayoutLine
p) = ManagedPtr LayoutLine
p
foreign import ccall "pango_layout_line_get_type" c_pango_layout_line_get_type ::
IO GType
type instance O.ParentTypes LayoutLine = '[]
instance O.HasParentTypes LayoutLine
instance B.Types.TypedObject LayoutLine where
glibType :: IO GType
glibType = IO GType
c_pango_layout_line_get_type
instance B.Types.GBoxed LayoutLine
instance B.GValue.IsGValue (Maybe LayoutLine) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_pango_layout_line_get_type
gvalueSet_ :: Ptr GValue -> Maybe LayoutLine -> IO ()
gvalueSet_ Ptr GValue
gv Maybe LayoutLine
P.Nothing = Ptr GValue -> Ptr LayoutLine -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr LayoutLine
forall a. Ptr a
FP.nullPtr :: FP.Ptr LayoutLine)
gvalueSet_ Ptr GValue
gv (P.Just LayoutLine
obj) = LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr LayoutLine
obj (Ptr GValue -> Ptr LayoutLine -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe LayoutLine)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr LayoutLine)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr LayoutLine)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newBoxed LayoutLine ptr
else return P.Nothing
newZeroLayoutLine :: MonadIO m => m LayoutLine
newZeroLayoutLine :: forall (m :: * -> *). MonadIO m => m LayoutLine
newZeroLayoutLine = IO LayoutLine -> m LayoutLine
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LayoutLine -> m LayoutLine) -> IO LayoutLine -> m LayoutLine
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr LayoutLine)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
32 IO (Ptr LayoutLine)
-> (Ptr LayoutLine -> IO LayoutLine) -> IO LayoutLine
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr LayoutLine -> LayoutLine)
-> Ptr LayoutLine -> IO LayoutLine
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr LayoutLine -> LayoutLine
LayoutLine
instance tag ~ 'AttrSet => Constructible LayoutLine tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr LayoutLine -> LayoutLine)
-> [AttrOp LayoutLine tag] -> m LayoutLine
new ManagedPtr LayoutLine -> LayoutLine
_ [AttrOp LayoutLine tag]
attrs = do
o <- m LayoutLine
forall (m :: * -> *). MonadIO m => m LayoutLine
newZeroLayoutLine
GI.Attributes.set o attrs
return o
getLayoutLineLayout :: MonadIO m => LayoutLine -> m (Maybe Pango.Layout.Layout)
getLayoutLineLayout :: forall (m :: * -> *). MonadIO m => LayoutLine -> m (Maybe Layout)
getLayoutLineLayout LayoutLine
s = IO (Maybe Layout) -> m (Maybe Layout)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Layout) -> m (Maybe Layout))
-> IO (Maybe Layout) -> m (Maybe Layout)
forall a b. (a -> b) -> a -> b
$ LayoutLine
-> (Ptr LayoutLine -> IO (Maybe Layout)) -> IO (Maybe Layout)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO (Maybe Layout)) -> IO (Maybe Layout))
-> (Ptr LayoutLine -> IO (Maybe Layout)) -> IO (Maybe Layout)
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
val <- Ptr (Ptr Layout) -> IO (Ptr Layout)
forall a. Storable a => Ptr a -> IO a
peek (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr (Ptr Layout)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (Ptr Pango.Layout.Layout)
result <- SP.convertIfNonNull val $ \Ptr Layout
val' -> do
val'' <- ((ManagedPtr Layout -> Layout) -> Ptr Layout -> IO Layout
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Layout -> Layout
Pango.Layout.Layout) Ptr Layout
val'
return val''
return result
setLayoutLineLayout :: MonadIO m => LayoutLine -> Ptr Pango.Layout.Layout -> m ()
setLayoutLineLayout :: forall (m :: * -> *). MonadIO m => LayoutLine -> Ptr Layout -> m ()
setLayoutLineLayout LayoutLine
s Ptr Layout
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO ()) -> IO ())
-> (Ptr LayoutLine -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
Ptr (Ptr Layout) -> Ptr Layout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr (Ptr Layout)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr Layout
val :: Ptr Pango.Layout.Layout)
clearLayoutLineLayout :: MonadIO m => LayoutLine -> m ()
clearLayoutLineLayout :: forall (m :: * -> *). MonadIO m => LayoutLine -> m ()
clearLayoutLineLayout LayoutLine
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO ()) -> IO ())
-> (Ptr LayoutLine -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
Ptr (Ptr Layout) -> Ptr Layout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr (Ptr Layout)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr Layout
forall a. Ptr a
FP.nullPtr :: Ptr Pango.Layout.Layout)
#if defined(ENABLE_OVERLOADING)
data LayoutLineLayoutFieldInfo
instance AttrInfo LayoutLineLayoutFieldInfo where
type AttrBaseTypeConstraint LayoutLineLayoutFieldInfo = (~) LayoutLine
type AttrAllowedOps LayoutLineLayoutFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint LayoutLineLayoutFieldInfo = (~) (Ptr Pango.Layout.Layout)
type AttrTransferTypeConstraint LayoutLineLayoutFieldInfo = (~)(Ptr Pango.Layout.Layout)
type AttrTransferType LayoutLineLayoutFieldInfo = (Ptr Pango.Layout.Layout)
type AttrGetType LayoutLineLayoutFieldInfo = Maybe Pango.Layout.Layout
type AttrLabel LayoutLineLayoutFieldInfo = "layout"
type AttrOrigin LayoutLineLayoutFieldInfo = LayoutLine
attrGet = getLayoutLineLayout
attrSet = setLayoutLineLayout
attrConstruct = undefined
attrClear = clearLayoutLineLayout
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layout"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#g:attr:layout"
})
layoutLine_layout :: AttrLabelProxy "layout"
layoutLine_layout = AttrLabelProxy
#endif
getLayoutLineStartIndex :: MonadIO m => LayoutLine -> m Int32
getLayoutLineStartIndex :: forall (m :: * -> *). MonadIO m => LayoutLine -> m Int32
getLayoutLineStartIndex LayoutLine
s = IO Int32 -> m Int32
forall a. IO a -> m a
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
$ LayoutLine -> (Ptr LayoutLine -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO Int32) -> IO Int32)
-> (Ptr LayoutLine -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO Int32
return val
setLayoutLineStartIndex :: MonadIO m => LayoutLine -> Int32 -> m ()
setLayoutLineStartIndex :: forall (m :: * -> *). MonadIO m => LayoutLine -> Int32 -> m ()
setLayoutLineStartIndex LayoutLine
s Int32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO ()) -> IO ())
-> (Ptr LayoutLine -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data LayoutLineStartIndexFieldInfo
instance AttrInfo LayoutLineStartIndexFieldInfo where
type AttrBaseTypeConstraint LayoutLineStartIndexFieldInfo = (~) LayoutLine
type AttrAllowedOps LayoutLineStartIndexFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint LayoutLineStartIndexFieldInfo = (~) Int32
type AttrTransferTypeConstraint LayoutLineStartIndexFieldInfo = (~)Int32
type AttrTransferType LayoutLineStartIndexFieldInfo = Int32
type AttrGetType LayoutLineStartIndexFieldInfo = Int32
type AttrLabel LayoutLineStartIndexFieldInfo = "start_index"
type AttrOrigin LayoutLineStartIndexFieldInfo = LayoutLine
attrGet = getLayoutLineStartIndex
attrSet = setLayoutLineStartIndex
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.startIndex"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#g:attr:startIndex"
})
layoutLine_startIndex :: AttrLabelProxy "startIndex"
layoutLine_startIndex = AttrLabelProxy
#endif
getLayoutLineLength :: MonadIO m => LayoutLine -> m Int32
getLayoutLineLength :: forall (m :: * -> *). MonadIO m => LayoutLine -> m Int32
getLayoutLineLength LayoutLine
s = IO Int32 -> m Int32
forall a. IO a -> m a
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
$ LayoutLine -> (Ptr LayoutLine -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO Int32) -> IO Int32)
-> (Ptr LayoutLine -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) :: IO Int32
return val
setLayoutLineLength :: MonadIO m => LayoutLine -> Int32 -> m ()
setLayoutLineLength :: forall (m :: * -> *). MonadIO m => LayoutLine -> Int32 -> m ()
setLayoutLineLength LayoutLine
s Int32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO ()) -> IO ())
-> (Ptr LayoutLine -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data LayoutLineLengthFieldInfo
instance AttrInfo LayoutLineLengthFieldInfo where
type AttrBaseTypeConstraint LayoutLineLengthFieldInfo = (~) LayoutLine
type AttrAllowedOps LayoutLineLengthFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint LayoutLineLengthFieldInfo = (~) Int32
type AttrTransferTypeConstraint LayoutLineLengthFieldInfo = (~)Int32
type AttrTransferType LayoutLineLengthFieldInfo = Int32
type AttrGetType LayoutLineLengthFieldInfo = Int32
type AttrLabel LayoutLineLengthFieldInfo = "length"
type AttrOrigin LayoutLineLengthFieldInfo = LayoutLine
attrGet = getLayoutLineLength
attrSet = setLayoutLineLength
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.length"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#g:attr:length"
})
layoutLine_length :: AttrLabelProxy "length"
layoutLine_length = AttrLabelProxy
#endif
getLayoutLineRuns :: MonadIO m => LayoutLine -> m [Pango.GlyphItem.GlyphItem]
getLayoutLineRuns :: forall (m :: * -> *). MonadIO m => LayoutLine -> m [GlyphItem]
getLayoutLineRuns LayoutLine
s = IO [GlyphItem] -> m [GlyphItem]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GlyphItem] -> m [GlyphItem])
-> IO [GlyphItem] -> m [GlyphItem]
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO [GlyphItem]) -> IO [GlyphItem]
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO [GlyphItem]) -> IO [GlyphItem])
-> (Ptr LayoutLine -> IO [GlyphItem]) -> IO [GlyphItem]
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
val <- Ptr (Ptr (GSList (Ptr GlyphItem)))
-> IO (Ptr (GSList (Ptr GlyphItem)))
forall a. Storable a => Ptr a -> IO a
peek (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr (Ptr (GSList (Ptr GlyphItem)))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO (Ptr (GSList (Ptr Pango.GlyphItem.GlyphItem)))
val' <- unpackGSList val
val'' <- mapM (newBoxed Pango.GlyphItem.GlyphItem) val'
return val''
setLayoutLineRuns :: MonadIO m => LayoutLine -> Ptr (GSList (Ptr Pango.GlyphItem.GlyphItem)) -> m ()
setLayoutLineRuns :: forall (m :: * -> *).
MonadIO m =>
LayoutLine -> Ptr (GSList (Ptr GlyphItem)) -> m ()
setLayoutLineRuns LayoutLine
s Ptr (GSList (Ptr GlyphItem))
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO ()) -> IO ())
-> (Ptr LayoutLine -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
Ptr (Ptr (GSList (Ptr GlyphItem)))
-> Ptr (GSList (Ptr GlyphItem)) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr (Ptr (GSList (Ptr GlyphItem)))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Ptr (GSList (Ptr GlyphItem))
val :: Ptr (GSList (Ptr Pango.GlyphItem.GlyphItem)))
clearLayoutLineRuns :: MonadIO m => LayoutLine -> m ()
clearLayoutLineRuns :: forall (m :: * -> *). MonadIO m => LayoutLine -> m ()
clearLayoutLineRuns LayoutLine
s = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO ()) -> IO ())
-> (Ptr LayoutLine -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
Ptr (Ptr (GSList (Ptr GlyphItem)))
-> Ptr (GSList (Ptr GlyphItem)) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr (Ptr (GSList (Ptr GlyphItem)))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Ptr (GSList (Ptr GlyphItem))
forall a. Ptr a
FP.nullPtr :: Ptr (GSList (Ptr Pango.GlyphItem.GlyphItem)))
#if defined(ENABLE_OVERLOADING)
data LayoutLineRunsFieldInfo
instance AttrInfo LayoutLineRunsFieldInfo where
type AttrBaseTypeConstraint LayoutLineRunsFieldInfo = (~) LayoutLine
type AttrAllowedOps LayoutLineRunsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint LayoutLineRunsFieldInfo = (~) (Ptr (GSList (Ptr Pango.GlyphItem.GlyphItem)))
type AttrTransferTypeConstraint LayoutLineRunsFieldInfo = (~)(Ptr (GSList (Ptr Pango.GlyphItem.GlyphItem)))
type AttrTransferType LayoutLineRunsFieldInfo = (Ptr (GSList (Ptr Pango.GlyphItem.GlyphItem)))
type AttrGetType LayoutLineRunsFieldInfo = [Pango.GlyphItem.GlyphItem]
type AttrLabel LayoutLineRunsFieldInfo = "runs"
type AttrOrigin LayoutLineRunsFieldInfo = LayoutLine
attrGet = getLayoutLineRuns
attrSet = setLayoutLineRuns
attrConstruct = undefined
attrClear = clearLayoutLineRuns
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.runs"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#g:attr:runs"
})
layoutLine_runs :: AttrLabelProxy "runs"
layoutLine_runs = AttrLabelProxy
#endif
getLayoutLineIsParagraphStart :: MonadIO m => LayoutLine -> m Word32
getLayoutLineIsParagraphStart :: forall (m :: * -> *). MonadIO m => LayoutLine -> m Word32
getLayoutLineIsParagraphStart LayoutLine
s = IO Word32 -> m Word32
forall a. IO a -> m a
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
$ LayoutLine -> (Ptr LayoutLine -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO Word32) -> IO Word32)
-> (Ptr LayoutLine -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO Word32
return val
setLayoutLineIsParagraphStart :: MonadIO m => LayoutLine -> Word32 -> m ()
setLayoutLineIsParagraphStart :: forall (m :: * -> *). MonadIO m => LayoutLine -> Word32 -> m ()
setLayoutLineIsParagraphStart LayoutLine
s Word32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO ()) -> IO ())
-> (Ptr LayoutLine -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data LayoutLineIsParagraphStartFieldInfo
instance AttrInfo LayoutLineIsParagraphStartFieldInfo where
type AttrBaseTypeConstraint LayoutLineIsParagraphStartFieldInfo = (~) LayoutLine
type AttrAllowedOps LayoutLineIsParagraphStartFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint LayoutLineIsParagraphStartFieldInfo = (~) Word32
type AttrTransferTypeConstraint LayoutLineIsParagraphStartFieldInfo = (~)Word32
type AttrTransferType LayoutLineIsParagraphStartFieldInfo = Word32
type AttrGetType LayoutLineIsParagraphStartFieldInfo = Word32
type AttrLabel LayoutLineIsParagraphStartFieldInfo = "is_paragraph_start"
type AttrOrigin LayoutLineIsParagraphStartFieldInfo = LayoutLine
attrGet = getLayoutLineIsParagraphStart
attrSet = setLayoutLineIsParagraphStart
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.isParagraphStart"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#g:attr:isParagraphStart"
})
layoutLine_isParagraphStart :: AttrLabelProxy "isParagraphStart"
layoutLine_isParagraphStart = AttrLabelProxy
#endif
getLayoutLineResolvedDir :: MonadIO m => LayoutLine -> m Word32
getLayoutLineResolvedDir :: forall (m :: * -> *). MonadIO m => LayoutLine -> m Word32
getLayoutLineResolvedDir LayoutLine
s = IO Word32 -> m Word32
forall a. IO a -> m a
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
$ LayoutLine -> (Ptr LayoutLine -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO Word32) -> IO Word32)
-> (Ptr LayoutLine -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28) :: IO Word32
return val
setLayoutLineResolvedDir :: MonadIO m => LayoutLine -> Word32 -> m ()
setLayoutLineResolvedDir :: forall (m :: * -> *). MonadIO m => LayoutLine -> Word32 -> m ()
setLayoutLineResolvedDir LayoutLine
s Word32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ LayoutLine -> (Ptr LayoutLine -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr LayoutLine
s ((Ptr LayoutLine -> IO ()) -> IO ())
-> (Ptr LayoutLine -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr LayoutLine
ptr Ptr LayoutLine -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data LayoutLineResolvedDirFieldInfo
instance AttrInfo LayoutLineResolvedDirFieldInfo where
type AttrBaseTypeConstraint LayoutLineResolvedDirFieldInfo = (~) LayoutLine
type AttrAllowedOps LayoutLineResolvedDirFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint LayoutLineResolvedDirFieldInfo = (~) Word32
type AttrTransferTypeConstraint LayoutLineResolvedDirFieldInfo = (~)Word32
type AttrTransferType LayoutLineResolvedDirFieldInfo = Word32
type AttrGetType LayoutLineResolvedDirFieldInfo = Word32
type AttrLabel LayoutLineResolvedDirFieldInfo = "resolved_dir"
type AttrOrigin LayoutLineResolvedDirFieldInfo = LayoutLine
attrGet = getLayoutLineResolvedDir
attrSet = setLayoutLineResolvedDir
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.resolvedDir"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#g:attr:resolvedDir"
})
layoutLine_resolvedDir :: AttrLabelProxy "resolvedDir"
layoutLine_resolvedDir = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList LayoutLine
type instance O.AttributeList LayoutLine = LayoutLineAttributeList
type LayoutLineAttributeList = ('[ '("layout", LayoutLineLayoutFieldInfo), '("startIndex", LayoutLineStartIndexFieldInfo), '("length", LayoutLineLengthFieldInfo), '("runs", LayoutLineRunsFieldInfo), '("isParagraphStart", LayoutLineIsParagraphStartFieldInfo), '("resolvedDir", LayoutLineResolvedDirFieldInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "pango_layout_line_get_extents" pango_layout_line_get_extents ::
Ptr LayoutLine ->
Ptr Pango.Rectangle.Rectangle ->
Ptr Pango.Rectangle.Rectangle ->
IO ()
layoutLineGetExtents ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))
layoutLineGetExtents :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> m (Rectangle, Rectangle)
layoutLineGetExtents LayoutLine
line = IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle))
-> IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle)
forall a b. (a -> b) -> a -> b
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
inkRect <- SP.callocBytes 16 :: IO (Ptr Pango.Rectangle.Rectangle)
logicalRect <- SP.callocBytes 16 :: IO (Ptr Pango.Rectangle.Rectangle)
pango_layout_line_get_extents line' inkRect logicalRect
inkRect' <- (wrapPtr Pango.Rectangle.Rectangle) inkRect
logicalRect' <- (wrapPtr Pango.Rectangle.Rectangle) logicalRect
touchManagedPtr line
return (inkRect', logicalRect')
#if defined(ENABLE_OVERLOADING)
data LayoutLineGetExtentsMethodInfo
instance (signature ~ (m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))), MonadIO m) => O.OverloadedMethod LayoutLineGetExtentsMethodInfo LayoutLine signature where
overloadedMethod = layoutLineGetExtents
instance O.OverloadedMethodInfo LayoutLineGetExtentsMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineGetExtents",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineGetExtents"
})
#endif
foreign import ccall "pango_layout_line_get_height" pango_layout_line_get_height ::
Ptr LayoutLine ->
Ptr Int32 ->
IO ()
layoutLineGetHeight ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> m (Int32)
layoutLineGetHeight :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> m Int32
layoutLineGetHeight LayoutLine
line = IO Int32 -> m Int32
forall a. IO a -> m a
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
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
height <- allocMem :: IO (Ptr Int32)
pango_layout_line_get_height line' height
height' <- peek height
touchManagedPtr line
freeMem height
return height'
#if defined(ENABLE_OVERLOADING)
data LayoutLineGetHeightMethodInfo
instance (signature ~ (m (Int32)), MonadIO m) => O.OverloadedMethod LayoutLineGetHeightMethodInfo LayoutLine signature where
overloadedMethod = layoutLineGetHeight
instance O.OverloadedMethodInfo LayoutLineGetHeightMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineGetHeight",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineGetHeight"
})
#endif
foreign import ccall "pango_layout_line_get_length" pango_layout_line_get_length ::
Ptr LayoutLine ->
IO Int32
layoutLineGetLength ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> m Int32
layoutLineGetLength :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> m Int32
layoutLineGetLength LayoutLine
line = IO Int32 -> m Int32
forall a. IO a -> m a
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
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
result <- pango_layout_line_get_length line'
touchManagedPtr line
return result
#if defined(ENABLE_OVERLOADING)
data LayoutLineGetLengthMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.OverloadedMethod LayoutLineGetLengthMethodInfo LayoutLine signature where
overloadedMethod = layoutLineGetLength
instance O.OverloadedMethodInfo LayoutLineGetLengthMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineGetLength",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineGetLength"
})
#endif
foreign import ccall "pango_layout_line_get_pixel_extents" pango_layout_line_get_pixel_extents ::
Ptr LayoutLine ->
Ptr Pango.Rectangle.Rectangle ->
Ptr Pango.Rectangle.Rectangle ->
IO ()
layoutLineGetPixelExtents ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))
layoutLineGetPixelExtents :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> m (Rectangle, Rectangle)
layoutLineGetPixelExtents LayoutLine
layoutLine = IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle))
-> IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle)
forall a b. (a -> b) -> a -> b
$ do
layoutLine' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
layoutLine
inkRect <- SP.callocBytes 16 :: IO (Ptr Pango.Rectangle.Rectangle)
logicalRect <- SP.callocBytes 16 :: IO (Ptr Pango.Rectangle.Rectangle)
pango_layout_line_get_pixel_extents layoutLine' inkRect logicalRect
inkRect' <- (wrapPtr Pango.Rectangle.Rectangle) inkRect
logicalRect' <- (wrapPtr Pango.Rectangle.Rectangle) logicalRect
touchManagedPtr layoutLine
return (inkRect', logicalRect')
#if defined(ENABLE_OVERLOADING)
data LayoutLineGetPixelExtentsMethodInfo
instance (signature ~ (m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))), MonadIO m) => O.OverloadedMethod LayoutLineGetPixelExtentsMethodInfo LayoutLine signature where
overloadedMethod = layoutLineGetPixelExtents
instance O.OverloadedMethodInfo LayoutLineGetPixelExtentsMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineGetPixelExtents",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineGetPixelExtents"
})
#endif
foreign import ccall "pango_layout_line_get_resolved_direction" pango_layout_line_get_resolved_direction ::
Ptr LayoutLine ->
IO CUInt
layoutLineGetResolvedDirection ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> m Pango.Enums.Direction
layoutLineGetResolvedDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> m Direction
layoutLineGetResolvedDirection LayoutLine
line = IO Direction -> m Direction
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Direction -> m Direction) -> IO Direction -> m Direction
forall a b. (a -> b) -> a -> b
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
result <- pango_layout_line_get_resolved_direction line'
let result' = (Int -> Direction
forall a. Enum a => Int -> a
toEnum (Int -> Direction) -> (CUInt -> Int) -> CUInt -> Direction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr line
return result'
#if defined(ENABLE_OVERLOADING)
data LayoutLineGetResolvedDirectionMethodInfo
instance (signature ~ (m Pango.Enums.Direction), MonadIO m) => O.OverloadedMethod LayoutLineGetResolvedDirectionMethodInfo LayoutLine signature where
overloadedMethod = layoutLineGetResolvedDirection
instance O.OverloadedMethodInfo LayoutLineGetResolvedDirectionMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineGetResolvedDirection",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineGetResolvedDirection"
})
#endif
foreign import ccall "pango_layout_line_get_start_index" pango_layout_line_get_start_index ::
Ptr LayoutLine ->
IO Int32
layoutLineGetStartIndex ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> m Int32
layoutLineGetStartIndex :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> m Int32
layoutLineGetStartIndex LayoutLine
line = IO Int32 -> m Int32
forall a. IO a -> m a
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
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
result <- pango_layout_line_get_start_index line'
touchManagedPtr line
return result
#if defined(ENABLE_OVERLOADING)
data LayoutLineGetStartIndexMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.OverloadedMethod LayoutLineGetStartIndexMethodInfo LayoutLine signature where
overloadedMethod = layoutLineGetStartIndex
instance O.OverloadedMethodInfo LayoutLineGetStartIndexMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineGetStartIndex",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineGetStartIndex"
})
#endif
foreign import ccall "pango_layout_line_get_x_ranges" pango_layout_line_get_x_ranges ::
Ptr LayoutLine ->
Int32 ->
Int32 ->
Ptr (Ptr Int32) ->
Ptr Int32 ->
IO ()
layoutLineGetXRanges ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> Int32
-> Int32
-> m ([Int32])
layoutLineGetXRanges :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> Int32 -> Int32 -> m [Int32]
layoutLineGetXRanges LayoutLine
line Int32
startIndex Int32
endIndex = IO [Int32] -> m [Int32]
forall a. IO a -> m a
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
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
ranges <- callocMem :: IO (Ptr (Ptr Int32))
nRanges <- allocMem :: IO (Ptr Int32)
pango_layout_line_get_x_ranges line' startIndex endIndex ranges nRanges
nRanges' <- peek nRanges
ranges' <- peek ranges
ranges'' <- (unpackStorableArrayWithLength nRanges') ranges'
freeMem ranges'
touchManagedPtr line
freeMem ranges
freeMem nRanges
return ranges''
#if defined(ENABLE_OVERLOADING)
data LayoutLineGetXRangesMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ([Int32])), MonadIO m) => O.OverloadedMethod LayoutLineGetXRangesMethodInfo LayoutLine signature where
overloadedMethod = layoutLineGetXRanges
instance O.OverloadedMethodInfo LayoutLineGetXRangesMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineGetXRanges",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineGetXRanges"
})
#endif
foreign import ccall "pango_layout_line_index_to_x" pango_layout_line_index_to_x ::
Ptr LayoutLine ->
Int32 ->
CInt ->
Ptr Int32 ->
IO ()
layoutLineIndexToX ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> Int32
-> Bool
-> m (Int32)
layoutLineIndexToX :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> Int32 -> Bool -> m Int32
layoutLineIndexToX LayoutLine
line Int32
index_ Bool
trailing = IO Int32 -> m Int32
forall a. IO a -> m a
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
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
let trailing' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
trailing
xPos <- allocMem :: IO (Ptr Int32)
pango_layout_line_index_to_x line' index_ trailing' xPos
xPos' <- peek xPos
touchManagedPtr line
freeMem xPos
return xPos'
#if defined(ENABLE_OVERLOADING)
data LayoutLineIndexToXMethodInfo
instance (signature ~ (Int32 -> Bool -> m (Int32)), MonadIO m) => O.OverloadedMethod LayoutLineIndexToXMethodInfo LayoutLine signature where
overloadedMethod = layoutLineIndexToX
instance O.OverloadedMethodInfo LayoutLineIndexToXMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineIndexToX",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineIndexToX"
})
#endif
foreign import ccall "pango_layout_line_is_paragraph_start" pango_layout_line_is_paragraph_start ::
Ptr LayoutLine ->
IO CInt
layoutLineIsParagraphStart ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> m Bool
layoutLineIsParagraphStart :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> m Bool
layoutLineIsParagraphStart LayoutLine
line = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
result <- pango_layout_line_is_paragraph_start line'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr line
return result'
#if defined(ENABLE_OVERLOADING)
data LayoutLineIsParagraphStartMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod LayoutLineIsParagraphStartMethodInfo LayoutLine signature where
overloadedMethod = layoutLineIsParagraphStart
instance O.OverloadedMethodInfo LayoutLineIsParagraphStartMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineIsParagraphStart",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineIsParagraphStart"
})
#endif
foreign import ccall "pango_layout_line_ref" pango_layout_line_ref ::
Ptr LayoutLine ->
IO (Ptr LayoutLine)
layoutLineRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (LayoutLine)
-> m (Maybe LayoutLine)
layoutLineRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe LayoutLine -> m (Maybe LayoutLine)
layoutLineRef Maybe LayoutLine
line = IO (Maybe LayoutLine) -> m (Maybe LayoutLine)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe LayoutLine) -> m (Maybe LayoutLine))
-> IO (Maybe LayoutLine) -> m (Maybe LayoutLine)
forall a b. (a -> b) -> a -> b
$ do
maybeLine <- case Maybe LayoutLine
line of
Maybe LayoutLine
Nothing -> Ptr LayoutLine -> IO (Ptr LayoutLine)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr LayoutLine
forall a. Ptr a
FP.nullPtr
Just LayoutLine
jLine -> do
jLine' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
jLine
return jLine'
result <- pango_layout_line_ref maybeLine
maybeResult <- convertIfNonNull result $ \Ptr LayoutLine
result' -> do
result'' <- ((ManagedPtr LayoutLine -> LayoutLine)
-> Ptr LayoutLine -> IO LayoutLine
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr LayoutLine -> LayoutLine
LayoutLine) Ptr LayoutLine
result'
return result''
whenJust line touchManagedPtr
return maybeResult
#if defined(ENABLE_OVERLOADING)
data LayoutLineRefMethodInfo
instance (signature ~ (m (Maybe LayoutLine)), MonadIO m) => O.OverloadedMethod LayoutLineRefMethodInfo LayoutLine signature where
overloadedMethod i = layoutLineRef (Just i)
instance O.OverloadedMethodInfo LayoutLineRefMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineRef"
})
#endif
foreign import ccall "pango_layout_line_unref" pango_layout_line_unref ::
Ptr LayoutLine ->
IO ()
layoutLineUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> m ()
layoutLineUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> m ()
layoutLineUnref LayoutLine
line = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
pango_layout_line_unref line'
touchManagedPtr line
return ()
#if defined(ENABLE_OVERLOADING)
data LayoutLineUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod LayoutLineUnrefMethodInfo LayoutLine signature where
overloadedMethod = layoutLineUnref
instance O.OverloadedMethodInfo LayoutLineUnrefMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineUnref"
})
#endif
foreign import ccall "pango_layout_line_x_to_index" pango_layout_line_x_to_index ::
Ptr LayoutLine ->
Int32 ->
Ptr Int32 ->
Ptr Int32 ->
IO CInt
layoutLineXToIndex ::
(B.CallStack.HasCallStack, MonadIO m) =>
LayoutLine
-> Int32
-> m ((Bool, Int32, Int32))
layoutLineXToIndex :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LayoutLine -> Int32 -> m (Bool, Int32, Int32)
layoutLineXToIndex LayoutLine
line Int32
xPos = IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32))
-> IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
index_ <- allocMem :: IO (Ptr Int32)
trailing <- allocMem :: IO (Ptr Int32)
result <- pango_layout_line_x_to_index line' xPos index_ trailing
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
index_' <- peek index_
trailing' <- peek trailing
touchManagedPtr line
freeMem index_
freeMem trailing
return (result', index_', trailing')
#if defined(ENABLE_OVERLOADING)
data LayoutLineXToIndexMethodInfo
instance (signature ~ (Int32 -> m ((Bool, Int32, Int32))), MonadIO m) => O.OverloadedMethod LayoutLineXToIndexMethodInfo LayoutLine signature where
overloadedMethod = layoutLineXToIndex
instance O.OverloadedMethodInfo LayoutLineXToIndexMethodInfo LayoutLine where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.LayoutLine.layoutLineXToIndex",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-LayoutLine.html#v:layoutLineXToIndex"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveLayoutLineMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveLayoutLineMethod "indexToX" o = LayoutLineIndexToXMethodInfo
ResolveLayoutLineMethod "isParagraphStart" o = LayoutLineIsParagraphStartMethodInfo
ResolveLayoutLineMethod "ref" o = LayoutLineRefMethodInfo
ResolveLayoutLineMethod "unref" o = LayoutLineUnrefMethodInfo
ResolveLayoutLineMethod "xToIndex" o = LayoutLineXToIndexMethodInfo
ResolveLayoutLineMethod "getExtents" o = LayoutLineGetExtentsMethodInfo
ResolveLayoutLineMethod "getHeight" o = LayoutLineGetHeightMethodInfo
ResolveLayoutLineMethod "getLength" o = LayoutLineGetLengthMethodInfo
ResolveLayoutLineMethod "getPixelExtents" o = LayoutLineGetPixelExtentsMethodInfo
ResolveLayoutLineMethod "getResolvedDirection" o = LayoutLineGetResolvedDirectionMethodInfo
ResolveLayoutLineMethod "getStartIndex" o = LayoutLineGetStartIndexMethodInfo
ResolveLayoutLineMethod "getXRanges" o = LayoutLineGetXRangesMethodInfo
ResolveLayoutLineMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveLayoutLineMethod t LayoutLine, O.OverloadedMethod info LayoutLine p) => OL.IsLabel t (LayoutLine -> 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 ~ ResolveLayoutLineMethod t LayoutLine, O.OverloadedMethod info LayoutLine p, R.HasField t LayoutLine p) => R.HasField t LayoutLine p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveLayoutLineMethod t LayoutLine, O.OverloadedMethodInfo info LayoutLine) => OL.IsLabel t (O.MethodProxy info LayoutLine) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif