gi-pango-1.0.11: Pango bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Pango.Structs.LayoutLine

Contents

Description

The LayoutLine structure represents one of the lines resulting from laying out a paragraph via Layout. LayoutLine structures are obtained by calling layoutGetLine and are only valid until the text, attributes, or settings of the parent Layout are modified.

Routines for rendering PangoLayout objects are provided in code specific to each rendering system.

Synopsis

Exported types

newtype LayoutLine Source #

Instances

BoxedObject LayoutLine Source # 
(~) AttrOpTag tag AttrSet => Constructible LayoutLine tag Source # 
((~) * info (ResolveLayoutLineMethod t LayoutLine), MethodInfo * info LayoutLine p) => IsLabel t (LayoutLine -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> LayoutLine -> p #

((~) * info (ResolveLayoutLineMethod t LayoutLine), MethodInfo * info LayoutLine p) => IsLabelProxy t (LayoutLine -> p) Source # 

Methods

fromLabelProxy :: Proxy Symbol t -> LayoutLine -> p #

HasAttributeList * LayoutLine Source # 
((~) * signature (Int32 -> m (Bool, Int32, Int32)), MonadIO m) => MethodInfo * LayoutLineXToIndexMethodInfo LayoutLine signature Source # 
((~) * signature (m ()), MonadIO m) => MethodInfo * LayoutLineUnrefMethodInfo LayoutLine signature Source # 
((~) * signature (m LayoutLine), MonadIO m) => MethodInfo * LayoutLineRefMethodInfo LayoutLine signature Source # 
((~) * signature (Int32 -> Bool -> m Int32), MonadIO m) => MethodInfo * LayoutLineIndexToXMethodInfo LayoutLine signature Source # 
((~) * signature (Int32 -> Int32 -> m [Int32]), MonadIO m) => MethodInfo * LayoutLineGetXRangesMethodInfo LayoutLine signature Source # 
((~) * signature (m (Rectangle, Rectangle)), MonadIO m) => MethodInfo * LayoutLineGetPixelExtentsMethodInfo LayoutLine signature Source # 
((~) * signature (m (Rectangle, Rectangle)), MonadIO m) => MethodInfo * LayoutLineGetExtentsMethodInfo LayoutLine signature Source # 
type AttributeList LayoutLine Source # 

newZeroLayoutLine :: MonadIO m => m LayoutLine Source #

Construct a LayoutLine struct initialized to zero.

Methods

getExtents

layoutLineGetExtents Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> LayoutLine

line: a LayoutLine

-> m (Rectangle, Rectangle) 

Computes the logical and ink extents of a layout line. See fontGetGlyphExtents for details about the interpretation of the rectangles.

getPixelExtents

layoutLineGetPixelExtents Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> LayoutLine

layoutLine: a LayoutLine

-> m (Rectangle, Rectangle) 

Computes the logical and ink extents of layoutLine in device units. This function just calls layoutLineGetExtents followed by two extentsToPixels calls, rounding inkRect and logicalRect such that the rounded rectangles fully contain the unrounded one (that is, passes them as first argument to extentsToPixels).

getXRanges

layoutLineGetXRanges Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> LayoutLine

line: a LayoutLine

-> Int32

startIndex: Start byte index of the logical range. If this value is less than the start index for the line, then the first range will extend all the way to the leading edge of the layout. Otherwise it will start at the leading edge of the first character.

-> Int32

endIndex: Ending byte index of the logical range. If this value is greater than the end index for the line, then the last range will extend all the way to the trailing edge of the layout. Otherwise, it will end at the trailing edge of the last character.

-> m [Int32] 

Gets a list of visual ranges corresponding to a given logical range. This list is not necessarily minimal - there may be consecutive ranges which are adjacent. The ranges will be sorted from left to right. The ranges are with respect to the left edge of the entire layout, not with respect to the line.

indexToX

layoutLineIndexToX Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> LayoutLine

line: a LayoutLine

-> Int32

index_: byte offset of a grapheme within the layout

-> Bool

trailing: an integer indicating the edge of the grapheme to retrieve the position of. If > 0, the trailing edge of the grapheme, if 0, the leading of the grapheme.

-> m Int32 

Converts an index within a line to a X position.

ref

layoutLineRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> LayoutLine

line: a LayoutLine, may be Nothing

-> m LayoutLine

Returns: the line passed in.

Increase the reference count of a LayoutLine by one.

Since: 1.10

unref

layoutLineUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> LayoutLine

line: a LayoutLine

-> m () 

Decrease the reference count of a LayoutLine by one. If the result is zero, the line and all associated memory will be freed.

xToIndex

layoutLineXToIndex Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> LayoutLine

line: a LayoutLine

-> Int32

xPos: the X offset (in Pango units) from the left edge of the line.

-> m (Bool, Int32, Int32)

Returns: False if xPos was outside the line, True if inside

Converts from x offset to the byte index of the corresponding character within the text of the layout. If xPos is outside the line, index_ and trailing will point to the very first or very last position in the line. This determination is based on the resolved direction of the paragraph; for example, if the resolved direction is right-to-left, then an X position to the right of the line (after it) results in 0 being stored in index_ and trailing. An X position to the left of the line results in index_ pointing to the (logical) last grapheme in the line and trailing being set to the number of characters in that grapheme. The reverse is true for a left-to-right line.

Properties

isParagraphStart

layout

length

resolvedDir

runs

startIndex