{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The t'GI.Pango.Objects.Layout.Layout' structure represents an entire paragraph
-- of text. It is initialized with a t'GI.Pango.Objects.Context.Context', UTF-8 string
-- and set of attributes for that string. Once that is done, the
-- set of formatted lines can be extracted from the object,
-- the layout can be rendered, and conversion between logical
-- character positions within the layout\'s text, and the physical
-- position of the resulting glyphs can be made.
-- 
-- There are also a number of parameters to adjust the formatting
-- of a t'GI.Pango.Objects.Layout.Layout', which are illustrated in \<xref linkend=\"parameters\"\/>.
-- It is possible, as well, to ignore the 2-D setup, and simply
-- treat the results of a t'GI.Pango.Objects.Layout.Layout' as a list of lines.
-- 
-- \<figure id=\"parameters\">
-- \<title>Adjustable parameters (on the left) and font metrics (on the right) for a PangoLayout\<\/title>
-- \<graphic fileref=\"layout.png\" format=\"PNG\">\<\/graphic>
-- \<\/figure>
-- 
-- The t'GI.Pango.Objects.Layout.Layout' structure is opaque, and has no user-visible
-- fields.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Pango.Objects.Layout
    ( 
#if defined(ENABLE_OVERLOADING)
    LayoutSetMarkupWithAccelMethodInfo      ,
#endif

-- * Exported types
    Layout(..)                              ,
    IsLayout                                ,
    toLayout                                ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveLayoutMethod                     ,
#endif


-- ** contextChanged #method:contextChanged#

#if defined(ENABLE_OVERLOADING)
    LayoutContextChangedMethodInfo          ,
#endif
    layoutContextChanged                    ,


-- ** copy #method:copy#

#if defined(ENABLE_OVERLOADING)
    LayoutCopyMethodInfo                    ,
#endif
    layoutCopy                              ,


-- ** getAlignment #method:getAlignment#

#if defined(ENABLE_OVERLOADING)
    LayoutGetAlignmentMethodInfo            ,
#endif
    layoutGetAlignment                      ,


-- ** getAttributes #method:getAttributes#

#if defined(ENABLE_OVERLOADING)
    LayoutGetAttributesMethodInfo           ,
#endif
    layoutGetAttributes                     ,


-- ** getAutoDir #method:getAutoDir#

#if defined(ENABLE_OVERLOADING)
    LayoutGetAutoDirMethodInfo              ,
#endif
    layoutGetAutoDir                        ,


-- ** getBaseline #method:getBaseline#

#if defined(ENABLE_OVERLOADING)
    LayoutGetBaselineMethodInfo             ,
#endif
    layoutGetBaseline                       ,


-- ** getCharacterCount #method:getCharacterCount#

#if defined(ENABLE_OVERLOADING)
    LayoutGetCharacterCountMethodInfo       ,
#endif
    layoutGetCharacterCount                 ,


-- ** getContext #method:getContext#

#if defined(ENABLE_OVERLOADING)
    LayoutGetContextMethodInfo              ,
#endif
    layoutGetContext                        ,


-- ** getCursorPos #method:getCursorPos#

#if defined(ENABLE_OVERLOADING)
    LayoutGetCursorPosMethodInfo            ,
#endif
    layoutGetCursorPos                      ,


-- ** getEllipsize #method:getEllipsize#

#if defined(ENABLE_OVERLOADING)
    LayoutGetEllipsizeMethodInfo            ,
#endif
    layoutGetEllipsize                      ,


-- ** getExtents #method:getExtents#

#if defined(ENABLE_OVERLOADING)
    LayoutGetExtentsMethodInfo              ,
#endif
    layoutGetExtents                        ,


-- ** getFontDescription #method:getFontDescription#

#if defined(ENABLE_OVERLOADING)
    LayoutGetFontDescriptionMethodInfo      ,
#endif
    layoutGetFontDescription                ,


-- ** getHeight #method:getHeight#

#if defined(ENABLE_OVERLOADING)
    LayoutGetHeightMethodInfo               ,
#endif
    layoutGetHeight                         ,


-- ** getIndent #method:getIndent#

#if defined(ENABLE_OVERLOADING)
    LayoutGetIndentMethodInfo               ,
#endif
    layoutGetIndent                         ,


-- ** getIter #method:getIter#

#if defined(ENABLE_OVERLOADING)
    LayoutGetIterMethodInfo                 ,
#endif
    layoutGetIter                           ,


-- ** getJustify #method:getJustify#

#if defined(ENABLE_OVERLOADING)
    LayoutGetJustifyMethodInfo              ,
#endif
    layoutGetJustify                        ,


-- ** getLine #method:getLine#

#if defined(ENABLE_OVERLOADING)
    LayoutGetLineMethodInfo                 ,
#endif
    layoutGetLine                           ,


-- ** getLineCount #method:getLineCount#

#if defined(ENABLE_OVERLOADING)
    LayoutGetLineCountMethodInfo            ,
#endif
    layoutGetLineCount                      ,


-- ** getLineReadonly #method:getLineReadonly#

#if defined(ENABLE_OVERLOADING)
    LayoutGetLineReadonlyMethodInfo         ,
#endif
    layoutGetLineReadonly                   ,


-- ** getLineSpacing #method:getLineSpacing#

#if defined(ENABLE_OVERLOADING)
    LayoutGetLineSpacingMethodInfo          ,
#endif
    layoutGetLineSpacing                    ,


-- ** getLines #method:getLines#

#if defined(ENABLE_OVERLOADING)
    LayoutGetLinesMethodInfo                ,
#endif
    layoutGetLines                          ,


-- ** getLinesReadonly #method:getLinesReadonly#

#if defined(ENABLE_OVERLOADING)
    LayoutGetLinesReadonlyMethodInfo        ,
#endif
    layoutGetLinesReadonly                  ,


-- ** getLogAttrs #method:getLogAttrs#

#if defined(ENABLE_OVERLOADING)
    LayoutGetLogAttrsMethodInfo             ,
#endif
    layoutGetLogAttrs                       ,


-- ** getLogAttrsReadonly #method:getLogAttrsReadonly#

#if defined(ENABLE_OVERLOADING)
    LayoutGetLogAttrsReadonlyMethodInfo     ,
#endif
    layoutGetLogAttrsReadonly               ,


-- ** getPixelExtents #method:getPixelExtents#

#if defined(ENABLE_OVERLOADING)
    LayoutGetPixelExtentsMethodInfo         ,
#endif
    layoutGetPixelExtents                   ,


-- ** getPixelSize #method:getPixelSize#

#if defined(ENABLE_OVERLOADING)
    LayoutGetPixelSizeMethodInfo            ,
#endif
    layoutGetPixelSize                      ,


-- ** getSerial #method:getSerial#

#if defined(ENABLE_OVERLOADING)
    LayoutGetSerialMethodInfo               ,
#endif
    layoutGetSerial                         ,


-- ** getSingleParagraphMode #method:getSingleParagraphMode#

#if defined(ENABLE_OVERLOADING)
    LayoutGetSingleParagraphModeMethodInfo  ,
#endif
    layoutGetSingleParagraphMode            ,


-- ** getSize #method:getSize#

#if defined(ENABLE_OVERLOADING)
    LayoutGetSizeMethodInfo                 ,
#endif
    layoutGetSize                           ,


-- ** getSpacing #method:getSpacing#

#if defined(ENABLE_OVERLOADING)
    LayoutGetSpacingMethodInfo              ,
#endif
    layoutGetSpacing                        ,


-- ** getTabs #method:getTabs#

#if defined(ENABLE_OVERLOADING)
    LayoutGetTabsMethodInfo                 ,
#endif
    layoutGetTabs                           ,


-- ** getText #method:getText#

#if defined(ENABLE_OVERLOADING)
    LayoutGetTextMethodInfo                 ,
#endif
    layoutGetText                           ,


-- ** getUnknownGlyphsCount #method:getUnknownGlyphsCount#

#if defined(ENABLE_OVERLOADING)
    LayoutGetUnknownGlyphsCountMethodInfo   ,
#endif
    layoutGetUnknownGlyphsCount             ,


-- ** getWidth #method:getWidth#

#if defined(ENABLE_OVERLOADING)
    LayoutGetWidthMethodInfo                ,
#endif
    layoutGetWidth                          ,


-- ** getWrap #method:getWrap#

#if defined(ENABLE_OVERLOADING)
    LayoutGetWrapMethodInfo                 ,
#endif
    layoutGetWrap                           ,


-- ** indexToLineX #method:indexToLineX#

#if defined(ENABLE_OVERLOADING)
    LayoutIndexToLineXMethodInfo            ,
#endif
    layoutIndexToLineX                      ,


-- ** indexToPos #method:indexToPos#

#if defined(ENABLE_OVERLOADING)
    LayoutIndexToPosMethodInfo              ,
#endif
    layoutIndexToPos                        ,


-- ** isEllipsized #method:isEllipsized#

#if defined(ENABLE_OVERLOADING)
    LayoutIsEllipsizedMethodInfo            ,
#endif
    layoutIsEllipsized                      ,


-- ** isWrapped #method:isWrapped#

#if defined(ENABLE_OVERLOADING)
    LayoutIsWrappedMethodInfo               ,
#endif
    layoutIsWrapped                         ,


-- ** moveCursorVisually #method:moveCursorVisually#

#if defined(ENABLE_OVERLOADING)
    LayoutMoveCursorVisuallyMethodInfo      ,
#endif
    layoutMoveCursorVisually                ,


-- ** new #method:new#

    layoutNew                               ,


-- ** setAlignment #method:setAlignment#

#if defined(ENABLE_OVERLOADING)
    LayoutSetAlignmentMethodInfo            ,
#endif
    layoutSetAlignment                      ,


-- ** setAttributes #method:setAttributes#

#if defined(ENABLE_OVERLOADING)
    LayoutSetAttributesMethodInfo           ,
#endif
    layoutSetAttributes                     ,


-- ** setAutoDir #method:setAutoDir#

#if defined(ENABLE_OVERLOADING)
    LayoutSetAutoDirMethodInfo              ,
#endif
    layoutSetAutoDir                        ,


-- ** setEllipsize #method:setEllipsize#

#if defined(ENABLE_OVERLOADING)
    LayoutSetEllipsizeMethodInfo            ,
#endif
    layoutSetEllipsize                      ,


-- ** setFontDescription #method:setFontDescription#

#if defined(ENABLE_OVERLOADING)
    LayoutSetFontDescriptionMethodInfo      ,
#endif
    layoutSetFontDescription                ,


-- ** setHeight #method:setHeight#

#if defined(ENABLE_OVERLOADING)
    LayoutSetHeightMethodInfo               ,
#endif
    layoutSetHeight                         ,


-- ** setIndent #method:setIndent#

#if defined(ENABLE_OVERLOADING)
    LayoutSetIndentMethodInfo               ,
#endif
    layoutSetIndent                         ,


-- ** setJustify #method:setJustify#

#if defined(ENABLE_OVERLOADING)
    LayoutSetJustifyMethodInfo              ,
#endif
    layoutSetJustify                        ,


-- ** setLineSpacing #method:setLineSpacing#

#if defined(ENABLE_OVERLOADING)
    LayoutSetLineSpacingMethodInfo          ,
#endif
    layoutSetLineSpacing                    ,


-- ** setMarkup #method:setMarkup#

#if defined(ENABLE_OVERLOADING)
    LayoutSetMarkupMethodInfo               ,
#endif
    layoutSetMarkup                         ,


-- ** setSingleParagraphMode #method:setSingleParagraphMode#

#if defined(ENABLE_OVERLOADING)
    LayoutSetSingleParagraphModeMethodInfo  ,
#endif
    layoutSetSingleParagraphMode            ,


-- ** setSpacing #method:setSpacing#

#if defined(ENABLE_OVERLOADING)
    LayoutSetSpacingMethodInfo              ,
#endif
    layoutSetSpacing                        ,


-- ** setTabs #method:setTabs#

#if defined(ENABLE_OVERLOADING)
    LayoutSetTabsMethodInfo                 ,
#endif
    layoutSetTabs                           ,


-- ** setText #method:setText#

#if defined(ENABLE_OVERLOADING)
    LayoutSetTextMethodInfo                 ,
#endif
    layoutSetText                           ,


-- ** setWidth #method:setWidth#

#if defined(ENABLE_OVERLOADING)
    LayoutSetWidthMethodInfo                ,
#endif
    layoutSetWidth                          ,


-- ** setWrap #method:setWrap#

#if defined(ENABLE_OVERLOADING)
    LayoutSetWrapMethodInfo                 ,
#endif
    layoutSetWrap                           ,


-- ** xyToIndex #method:xyToIndex#

#if defined(ENABLE_OVERLOADING)
    LayoutXyToIndexMethodInfo               ,
#endif
    layoutXyToIndex                         ,




    ) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
import {-# SOURCE #-} qualified GI.Pango.Objects.Context as Pango.Context
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrList as Pango.AttrList
import {-# SOURCE #-} qualified GI.Pango.Structs.FontDescription as Pango.FontDescription
import {-# SOURCE #-} qualified GI.Pango.Structs.LayoutIter as Pango.LayoutIter
import {-# SOURCE #-} qualified GI.Pango.Structs.LayoutLine as Pango.LayoutLine
import {-# SOURCE #-} qualified GI.Pango.Structs.LogAttr as Pango.LogAttr
import {-# SOURCE #-} qualified GI.Pango.Structs.Rectangle as Pango.Rectangle
import {-# SOURCE #-} qualified GI.Pango.Structs.TabArray as Pango.TabArray

-- | Memory-managed wrapper type.
newtype Layout = Layout (SP.ManagedPtr Layout)
    deriving (Layout -> Layout -> Bool
(Layout -> Layout -> Bool)
-> (Layout -> Layout -> Bool) -> Eq Layout
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Layout -> Layout -> Bool
$c/= :: Layout -> Layout -> Bool
== :: Layout -> Layout -> Bool
$c== :: Layout -> Layout -> Bool
Eq)

instance SP.ManagedPtrNewtype Layout where
    toManagedPtr :: Layout -> ManagedPtr Layout
toManagedPtr (Layout ManagedPtr Layout
p) = ManagedPtr Layout
p

foreign import ccall "pango_layout_get_type"
    c_pango_layout_get_type :: IO B.Types.GType

instance B.Types.TypedObject Layout where
    glibType :: IO GType
glibType = IO GType
c_pango_layout_get_type

instance B.Types.GObject Layout

-- | Convert 'Layout' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue Layout where
    toGValue :: Layout -> IO GValue
toGValue Layout
o = do
        GType
gtype <- IO GType
c_pango_layout_get_type
        Layout -> (Ptr Layout -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Layout
o (GType -> (GValue -> Ptr Layout -> IO ()) -> Ptr Layout -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Layout -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO Layout
fromGValue GValue
gv = do
        Ptr Layout
ptr <- GValue -> IO (Ptr Layout)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Layout)
        (ManagedPtr Layout -> Layout) -> Ptr Layout -> IO Layout
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Layout -> Layout
Layout Ptr Layout
ptr
        
    

-- | Type class for types which can be safely cast to `Layout`, for instance with `toLayout`.
class (SP.GObject o, O.IsDescendantOf Layout o) => IsLayout o
instance (SP.GObject o, O.IsDescendantOf Layout o) => IsLayout o

instance O.HasParentTypes Layout
type instance O.ParentTypes Layout = '[GObject.Object.Object]

-- | Cast to `Layout`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toLayout :: (MonadIO m, IsLayout o) => o -> m Layout
toLayout :: o -> m Layout
toLayout = IO Layout -> m Layout
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Layout -> m Layout) -> (o -> IO Layout) -> o -> m Layout
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Layout -> Layout) -> o -> IO Layout
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Layout -> Layout
Layout

#if defined(ENABLE_OVERLOADING)
type family ResolveLayoutMethod (t :: Symbol) (o :: *) :: * where
    ResolveLayoutMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveLayoutMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveLayoutMethod "contextChanged" o = LayoutContextChangedMethodInfo
    ResolveLayoutMethod "copy" o = LayoutCopyMethodInfo
    ResolveLayoutMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveLayoutMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveLayoutMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveLayoutMethod "indexToLineX" o = LayoutIndexToLineXMethodInfo
    ResolveLayoutMethod "indexToPos" o = LayoutIndexToPosMethodInfo
    ResolveLayoutMethod "isEllipsized" o = LayoutIsEllipsizedMethodInfo
    ResolveLayoutMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveLayoutMethod "isWrapped" o = LayoutIsWrappedMethodInfo
    ResolveLayoutMethod "moveCursorVisually" o = LayoutMoveCursorVisuallyMethodInfo
    ResolveLayoutMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveLayoutMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveLayoutMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveLayoutMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveLayoutMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveLayoutMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveLayoutMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveLayoutMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveLayoutMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveLayoutMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveLayoutMethod "xyToIndex" o = LayoutXyToIndexMethodInfo
    ResolveLayoutMethod "getAlignment" o = LayoutGetAlignmentMethodInfo
    ResolveLayoutMethod "getAttributes" o = LayoutGetAttributesMethodInfo
    ResolveLayoutMethod "getAutoDir" o = LayoutGetAutoDirMethodInfo
    ResolveLayoutMethod "getBaseline" o = LayoutGetBaselineMethodInfo
    ResolveLayoutMethod "getCharacterCount" o = LayoutGetCharacterCountMethodInfo
    ResolveLayoutMethod "getContext" o = LayoutGetContextMethodInfo
    ResolveLayoutMethod "getCursorPos" o = LayoutGetCursorPosMethodInfo
    ResolveLayoutMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveLayoutMethod "getEllipsize" o = LayoutGetEllipsizeMethodInfo
    ResolveLayoutMethod "getExtents" o = LayoutGetExtentsMethodInfo
    ResolveLayoutMethod "getFontDescription" o = LayoutGetFontDescriptionMethodInfo
    ResolveLayoutMethod "getHeight" o = LayoutGetHeightMethodInfo
    ResolveLayoutMethod "getIndent" o = LayoutGetIndentMethodInfo
    ResolveLayoutMethod "getIter" o = LayoutGetIterMethodInfo
    ResolveLayoutMethod "getJustify" o = LayoutGetJustifyMethodInfo
    ResolveLayoutMethod "getLine" o = LayoutGetLineMethodInfo
    ResolveLayoutMethod "getLineCount" o = LayoutGetLineCountMethodInfo
    ResolveLayoutMethod "getLineReadonly" o = LayoutGetLineReadonlyMethodInfo
    ResolveLayoutMethod "getLineSpacing" o = LayoutGetLineSpacingMethodInfo
    ResolveLayoutMethod "getLines" o = LayoutGetLinesMethodInfo
    ResolveLayoutMethod "getLinesReadonly" o = LayoutGetLinesReadonlyMethodInfo
    ResolveLayoutMethod "getLogAttrs" o = LayoutGetLogAttrsMethodInfo
    ResolveLayoutMethod "getLogAttrsReadonly" o = LayoutGetLogAttrsReadonlyMethodInfo
    ResolveLayoutMethod "getPixelExtents" o = LayoutGetPixelExtentsMethodInfo
    ResolveLayoutMethod "getPixelSize" o = LayoutGetPixelSizeMethodInfo
    ResolveLayoutMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveLayoutMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveLayoutMethod "getSerial" o = LayoutGetSerialMethodInfo
    ResolveLayoutMethod "getSingleParagraphMode" o = LayoutGetSingleParagraphModeMethodInfo
    ResolveLayoutMethod "getSize" o = LayoutGetSizeMethodInfo
    ResolveLayoutMethod "getSpacing" o = LayoutGetSpacingMethodInfo
    ResolveLayoutMethod "getTabs" o = LayoutGetTabsMethodInfo
    ResolveLayoutMethod "getText" o = LayoutGetTextMethodInfo
    ResolveLayoutMethod "getUnknownGlyphsCount" o = LayoutGetUnknownGlyphsCountMethodInfo
    ResolveLayoutMethod "getWidth" o = LayoutGetWidthMethodInfo
    ResolveLayoutMethod "getWrap" o = LayoutGetWrapMethodInfo
    ResolveLayoutMethod "setAlignment" o = LayoutSetAlignmentMethodInfo
    ResolveLayoutMethod "setAttributes" o = LayoutSetAttributesMethodInfo
    ResolveLayoutMethod "setAutoDir" o = LayoutSetAutoDirMethodInfo
    ResolveLayoutMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveLayoutMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveLayoutMethod "setEllipsize" o = LayoutSetEllipsizeMethodInfo
    ResolveLayoutMethod "setFontDescription" o = LayoutSetFontDescriptionMethodInfo
    ResolveLayoutMethod "setHeight" o = LayoutSetHeightMethodInfo
    ResolveLayoutMethod "setIndent" o = LayoutSetIndentMethodInfo
    ResolveLayoutMethod "setJustify" o = LayoutSetJustifyMethodInfo
    ResolveLayoutMethod "setLineSpacing" o = LayoutSetLineSpacingMethodInfo
    ResolveLayoutMethod "setMarkup" o = LayoutSetMarkupMethodInfo
    ResolveLayoutMethod "setMarkupWithAccel" o = LayoutSetMarkupWithAccelMethodInfo
    ResolveLayoutMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveLayoutMethod "setSingleParagraphMode" o = LayoutSetSingleParagraphModeMethodInfo
    ResolveLayoutMethod "setSpacing" o = LayoutSetSpacingMethodInfo
    ResolveLayoutMethod "setTabs" o = LayoutSetTabsMethodInfo
    ResolveLayoutMethod "setText" o = LayoutSetTextMethodInfo
    ResolveLayoutMethod "setWidth" o = LayoutSetWidthMethodInfo
    ResolveLayoutMethod "setWrap" o = LayoutSetWrapMethodInfo
    ResolveLayoutMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveLayoutMethod t Layout, O.MethodInfo info Layout p) => OL.IsLabel t (Layout -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Layout
type instance O.AttributeList Layout = LayoutAttributeList
type LayoutAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Layout = LayoutSignalList
type LayoutSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method Layout::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Pango" , name = "Layout" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_new" pango_layout_new :: 
    Ptr Pango.Context.Context ->            -- context : TInterface (Name {namespace = "Pango", name = "Context"})
    IO (Ptr Layout)

-- | Create a new t'GI.Pango.Objects.Layout.Layout' object with attributes initialized to
-- default values for a particular t'GI.Pango.Objects.Context.Context'.
layoutNew ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Context.IsContext a) =>
    a
    -- ^ /@context@/: a t'GI.Pango.Objects.Context.Context'
    -> m Layout
    -- ^ __Returns:__ the newly allocated t'GI.Pango.Objects.Layout.Layout', with a reference
    --               count of one, which should be freed with
    --               'GI.GObject.Objects.Object.objectUnref'.
layoutNew :: a -> m Layout
layoutNew a
context = IO Layout -> m Layout
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Layout -> m Layout) -> IO Layout -> m Layout
forall a b. (a -> b) -> a -> b
$ do
    Ptr Context
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Layout
result <- Ptr Context -> IO (Ptr Layout)
pango_layout_new Ptr Context
context'
    Text -> Ptr Layout -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"layoutNew" Ptr Layout
result
    Layout
result' <- ((ManagedPtr Layout -> Layout) -> Ptr Layout -> IO Layout
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Layout -> Layout
Layout) Ptr Layout
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Layout -> IO Layout
forall (m :: * -> *) a. Monad m => a -> m a
return Layout
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Layout::context_changed
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_context_changed" pango_layout_context_changed :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO ()

-- | Forces recomputation of any state in the t'GI.Pango.Objects.Layout.Layout' that
-- might depend on the layout\'s context. This function should
-- be called if you make changes to the context subsequent
-- to creating the layout.
layoutContextChanged ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m ()
layoutContextChanged :: a -> m ()
layoutContextChanged a
layout = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Layout -> IO ()
pango_layout_context_changed Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutContextChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutContextChangedMethodInfo a signature where
    overloadedMethod = layoutContextChanged

#endif

-- method Layout::copy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Pango" , name = "Layout" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_copy" pango_layout_copy :: 
    Ptr Layout ->                           -- src : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO (Ptr Layout)

-- | Does a deep copy-by-value of the /@src@/ layout. The attribute list,
-- tab array, and text from the original layout are all copied by
-- value.
layoutCopy ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@src@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Layout
    -- ^ __Returns:__ the newly allocated t'GI.Pango.Objects.Layout.Layout',
    --               with a reference count of one, which should be freed
    --               with 'GI.GObject.Objects.Object.objectUnref'.
layoutCopy :: a -> m Layout
layoutCopy a
src = IO Layout -> m Layout
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Layout -> m Layout) -> IO Layout -> m Layout
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
src' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
src
    Ptr Layout
result <- Ptr Layout -> IO (Ptr Layout)
pango_layout_copy Ptr Layout
src'
    Text -> Ptr Layout -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"layoutCopy" Ptr Layout
result
    Layout
result' <- ((ManagedPtr Layout -> Layout) -> Ptr Layout -> IO Layout
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Layout -> Layout
Layout) Ptr Layout
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
src
    Layout -> IO Layout
forall (m :: * -> *) a. Monad m => a -> m a
return Layout
result'

#if defined(ENABLE_OVERLOADING)
data LayoutCopyMethodInfo
instance (signature ~ (m Layout), MonadIO m, IsLayout a) => O.MethodInfo LayoutCopyMethodInfo a signature where
    overloadedMethod = layoutCopy

#endif

-- method Layout::get_alignment
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Pango" , name = "Alignment" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_alignment" pango_layout_get_alignment :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CUInt

-- | Gets the alignment for the layout: how partial lines are
-- positioned within the horizontal space available.
layoutGetAlignment ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Pango.Enums.Alignment
    -- ^ __Returns:__ the alignment.
layoutGetAlignment :: a -> m Alignment
layoutGetAlignment a
layout = IO Alignment -> m Alignment
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Alignment -> m Alignment) -> IO Alignment -> m Alignment
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CUInt
result <- Ptr Layout -> IO CUInt
pango_layout_get_alignment Ptr Layout
layout'
    let result' :: Alignment
result' = (Int -> Alignment
forall a. Enum a => Int -> a
toEnum (Int -> Alignment) -> (CUInt -> Int) -> CUInt -> Alignment
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Alignment -> IO Alignment
forall (m :: * -> *) a. Monad m => a -> m a
return Alignment
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetAlignmentMethodInfo
instance (signature ~ (m Pango.Enums.Alignment), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetAlignmentMethodInfo a signature where
    overloadedMethod = layoutGetAlignment

#endif

-- method Layout::get_attributes
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Pango" , name = "AttrList" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_attributes" pango_layout_get_attributes :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO (Ptr Pango.AttrList.AttrList)

-- | Gets the attribute list for the layout, if any.
layoutGetAttributes ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Pango.AttrList.AttrList
    -- ^ __Returns:__ a t'GI.Pango.Structs.AttrList.AttrList'.
layoutGetAttributes :: a -> m AttrList
layoutGetAttributes a
layout = IO AttrList -> m AttrList
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AttrList -> m AttrList) -> IO AttrList -> m AttrList
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr AttrList
result <- Ptr Layout -> IO (Ptr AttrList)
pango_layout_get_attributes Ptr Layout
layout'
    Text -> Ptr AttrList -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"layoutGetAttributes" Ptr AttrList
result
    AttrList
result' <- ((ManagedPtr AttrList -> AttrList) -> Ptr AttrList -> IO AttrList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr AttrList -> AttrList
Pango.AttrList.AttrList) Ptr AttrList
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    AttrList -> IO AttrList
forall (m :: * -> *) a. Monad m => a -> m a
return AttrList
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetAttributesMethodInfo
instance (signature ~ (m Pango.AttrList.AttrList), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetAttributesMethodInfo a signature where
    overloadedMethod = layoutGetAttributes

#endif

-- method Layout::get_auto_dir
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_auto_dir" pango_layout_get_auto_dir :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CInt

-- | Gets whether to calculate the bidirectional base direction
-- for the layout according to the contents of the layout.
-- See 'GI.Pango.Objects.Layout.layoutSetAutoDir'.
-- 
-- /Since: 1.4/
layoutGetAutoDir ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the bidirectional base direction
    --   is computed from the layout\'s contents, 'P.False' otherwise.
layoutGetAutoDir :: a -> m Bool
layoutGetAutoDir a
layout = IO Bool -> m Bool
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CInt
result <- Ptr Layout -> IO CInt
pango_layout_get_auto_dir Ptr Layout
layout'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetAutoDirMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetAutoDirMethodInfo a signature where
    overloadedMethod = layoutGetAutoDir

#endif

-- method Layout::get_baseline
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_baseline" pango_layout_get_baseline :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Int32

-- | Gets the Y position of baseline of the first line in /@layout@/.
-- 
-- /Since: 1.22/
layoutGetBaseline ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Int32
    -- ^ __Returns:__ baseline of first line, from top of /@layout@/.
layoutGetBaseline :: a -> m Int32
layoutGetBaseline a
layout = 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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Int32
result <- Ptr Layout -> IO Int32
pango_layout_get_baseline Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetBaselineMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetBaselineMethodInfo a signature where
    overloadedMethod = layoutGetBaseline

#endif

-- method Layout::get_character_count
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_character_count" pango_layout_get_character_count :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Int32

-- | Returns the number of Unicode characters in the
-- the text of /@layout@/.
-- 
-- /Since: 1.30/
layoutGetCharacterCount ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Int32
    -- ^ __Returns:__ the number of Unicode characters
    --     in the text of /@layout@/
layoutGetCharacterCount :: a -> m Int32
layoutGetCharacterCount a
layout = 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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Int32
result <- Ptr Layout -> IO Int32
pango_layout_get_character_count Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetCharacterCountMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetCharacterCountMethodInfo a signature where
    overloadedMethod = layoutGetCharacterCount

#endif

-- method Layout::get_context
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Pango" , name = "Context" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_context" pango_layout_get_context :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO (Ptr Pango.Context.Context)

-- | Retrieves the t'GI.Pango.Objects.Context.Context' used for this layout.
layoutGetContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Pango.Context.Context
    -- ^ __Returns:__ the t'GI.Pango.Objects.Context.Context' for the layout.
    -- This does not have an additional refcount added, so if you want to
    -- keep a copy of this around, you must reference it yourself.
layoutGetContext :: a -> m Context
layoutGetContext a
layout = IO Context -> m Context
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Context -> m Context) -> IO Context -> m Context
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Context
result <- Ptr Layout -> IO (Ptr Context)
pango_layout_get_context Ptr Layout
layout'
    Text -> Ptr Context -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"layoutGetContext" Ptr Context
result
    Context
result' <- ((ManagedPtr Context -> Context) -> Ptr Context -> IO Context
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Context -> Context
Pango.Context.Context) Ptr Context
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Context -> IO Context
forall (m :: * -> *) a. Monad m => a -> m a
return Context
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetContextMethodInfo
instance (signature ~ (m Pango.Context.Context), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetContextMethodInfo a signature where
    overloadedMethod = layoutGetContext

#endif

-- method Layout::get_cursor_pos
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index_"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the byte index of the cursor"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "strong_pos"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Rectangle" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "location to store the strong cursor position\n                    (may be %NULL)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "weak_pos"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Rectangle" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "location to store the weak cursor position (may be %NULL)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_cursor_pos" pango_layout_get_cursor_pos :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- index_ : TBasicType TInt
    Ptr Pango.Rectangle.Rectangle ->        -- strong_pos : TInterface (Name {namespace = "Pango", name = "Rectangle"})
    Ptr Pango.Rectangle.Rectangle ->        -- weak_pos : TInterface (Name {namespace = "Pango", name = "Rectangle"})
    IO ()

-- | Given an index within a layout, determines the positions that of the
-- strong and weak cursors if the insertion point is at that
-- index. The position of each cursor is stored as a zero-width
-- rectangle. The strong cursor location is the location where
-- characters of the directionality equal to the base direction of the
-- layout are inserted.  The weak cursor location is the location
-- where characters of the directionality opposite to the base
-- direction of the layout are inserted.
layoutGetCursorPos ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Int32
    -- ^ /@index_@/: the byte index of the cursor
    -> m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))
layoutGetCursorPos :: a -> Int32 -> m (Rectangle, Rectangle)
layoutGetCursorPos a
layout Int32
index_ = IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle)
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Rectangle
strongPos <- Int -> IO (Ptr Rectangle)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr Pango.Rectangle.Rectangle)
    Ptr Rectangle
weakPos <- Int -> IO (Ptr Rectangle)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr Pango.Rectangle.Rectangle)
    Ptr Layout -> Int32 -> Ptr Rectangle -> Ptr Rectangle -> IO ()
pango_layout_get_cursor_pos Ptr Layout
layout' Int32
index_ Ptr Rectangle
strongPos Ptr Rectangle
weakPos
    Rectangle
strongPos' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Rectangle -> Rectangle
Pango.Rectangle.Rectangle) Ptr Rectangle
strongPos
    Rectangle
weakPos' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Rectangle -> Rectangle
Pango.Rectangle.Rectangle) Ptr Rectangle
weakPos
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    (Rectangle, Rectangle) -> IO (Rectangle, Rectangle)
forall (m :: * -> *) a. Monad m => a -> m a
return (Rectangle
strongPos', Rectangle
weakPos')

#if defined(ENABLE_OVERLOADING)
data LayoutGetCursorPosMethodInfo
instance (signature ~ (Int32 -> m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetCursorPosMethodInfo a signature where
    overloadedMethod = layoutGetCursorPos

#endif

-- method Layout::get_ellipsize
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Pango" , name = "EllipsizeMode" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_ellipsize" pango_layout_get_ellipsize :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CUInt

-- | Gets the type of ellipsization being performed for /@layout@/.
-- See 'GI.Pango.Objects.Layout.layoutSetEllipsize'
-- 
-- /Since: 1.6/
layoutGetEllipsize ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Pango.Enums.EllipsizeMode
    -- ^ __Returns:__ the current ellipsization mode for /@layout@/.
    -- 
    -- Use 'GI.Pango.Objects.Layout.layoutIsEllipsized' to query whether any paragraphs
    -- were actually ellipsized.
layoutGetEllipsize :: a -> m EllipsizeMode
layoutGetEllipsize a
layout = IO EllipsizeMode -> m EllipsizeMode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EllipsizeMode -> m EllipsizeMode)
-> IO EllipsizeMode -> m EllipsizeMode
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CUInt
result <- Ptr Layout -> IO CUInt
pango_layout_get_ellipsize Ptr Layout
layout'
    let result' :: EllipsizeMode
result' = (Int -> EllipsizeMode
forall a. Enum a => Int -> a
toEnum (Int -> EllipsizeMode) -> (CUInt -> Int) -> CUInt -> EllipsizeMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    EllipsizeMode -> IO EllipsizeMode
forall (m :: * -> *) a. Monad m => a -> m a
return EllipsizeMode
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetEllipsizeMethodInfo
instance (signature ~ (m Pango.Enums.EllipsizeMode), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetEllipsizeMethodInfo a signature where
    overloadedMethod = layoutGetEllipsize

#endif

-- method Layout::get_extents
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ink_rect"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Rectangle" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "rectangle used to store the extents of the\n                  layout as drawn or %NULL to indicate that the result is\n                  not needed."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "logical_rect"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Rectangle" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "rectangle used to store the logical\n                     extents of the layout or %NULL to indicate that the\n                     result is not needed."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_extents" pango_layout_get_extents :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr Pango.Rectangle.Rectangle ->        -- ink_rect : TInterface (Name {namespace = "Pango", name = "Rectangle"})
    Ptr Pango.Rectangle.Rectangle ->        -- logical_rect : TInterface (Name {namespace = "Pango", name = "Rectangle"})
    IO ()

-- | Computes the logical and ink extents of /@layout@/. Logical extents
-- are usually what you want for positioning things.  Note that both extents
-- may have non-zero x and y.  You may want to use those to offset where you
-- render the layout.  Not doing that is a very typical bug that shows up as
-- right-to-left layouts not being correctly positioned in a layout with
-- a set width.
-- 
-- The extents are given in layout coordinates and in Pango units; layout
-- coordinates begin at the top left corner of the layout.
layoutGetExtents ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))
layoutGetExtents :: a -> m (Rectangle, Rectangle)
layoutGetExtents a
layout = IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle)
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Rectangle
inkRect <- Int -> IO (Ptr Rectangle)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr Pango.Rectangle.Rectangle)
    Ptr Rectangle
logicalRect <- Int -> IO (Ptr Rectangle)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr Pango.Rectangle.Rectangle)
    Ptr Layout -> Ptr Rectangle -> Ptr Rectangle -> IO ()
pango_layout_get_extents Ptr Layout
layout' Ptr Rectangle
inkRect Ptr Rectangle
logicalRect
    Rectangle
inkRect' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Rectangle -> Rectangle
Pango.Rectangle.Rectangle) Ptr Rectangle
inkRect
    Rectangle
logicalRect' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Rectangle -> Rectangle
Pango.Rectangle.Rectangle) Ptr Rectangle
logicalRect
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    (Rectangle, Rectangle) -> IO (Rectangle, Rectangle)
forall (m :: * -> *) a. Monad m => a -> m a
return (Rectangle
inkRect', Rectangle
logicalRect')

#if defined(ENABLE_OVERLOADING)
data LayoutGetExtentsMethodInfo
instance (signature ~ (m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetExtentsMethodInfo a signature where
    overloadedMethod = layoutGetExtents

#endif

-- method Layout::get_font_description
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Pango" , name = "FontDescription" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_font_description" pango_layout_get_font_description :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO (Ptr Pango.FontDescription.FontDescription)

-- | Gets the font description for the layout, if any.
-- 
-- /Since: 1.8/
layoutGetFontDescription ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m (Maybe Pango.FontDescription.FontDescription)
    -- ^ __Returns:__ a pointer to the layout\'s font
    --  description, or 'P.Nothing' if the font description from the layout\'s
    --  context is inherited. This value is owned by the layout and must
    --  not be modified or freed.
layoutGetFontDescription :: a -> m (Maybe FontDescription)
layoutGetFontDescription a
layout = IO (Maybe FontDescription) -> m (Maybe FontDescription)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe FontDescription) -> m (Maybe FontDescription))
-> IO (Maybe FontDescription) -> m (Maybe FontDescription)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr FontDescription
result <- Ptr Layout -> IO (Ptr FontDescription)
pango_layout_get_font_description Ptr Layout
layout'
    Maybe FontDescription
maybeResult <- Ptr FontDescription
-> (Ptr FontDescription -> IO FontDescription)
-> IO (Maybe FontDescription)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr FontDescription
result ((Ptr FontDescription -> IO FontDescription)
 -> IO (Maybe FontDescription))
-> (Ptr FontDescription -> IO FontDescription)
-> IO (Maybe FontDescription)
forall a b. (a -> b) -> a -> b
$ \Ptr FontDescription
result' -> do
        FontDescription
result'' <- ((ManagedPtr FontDescription -> FontDescription)
-> Ptr FontDescription -> IO FontDescription
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr FontDescription -> FontDescription
Pango.FontDescription.FontDescription) Ptr FontDescription
result'
        FontDescription -> IO FontDescription
forall (m :: * -> *) a. Monad m => a -> m a
return FontDescription
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Maybe FontDescription -> IO (Maybe FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FontDescription
maybeResult

#if defined(ENABLE_OVERLOADING)
data LayoutGetFontDescriptionMethodInfo
instance (signature ~ (m (Maybe Pango.FontDescription.FontDescription)), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetFontDescriptionMethodInfo a signature where
    overloadedMethod = layoutGetFontDescription

#endif

-- method Layout::get_height
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_height" pango_layout_get_height :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Int32

-- | Gets the height of layout used for ellipsization.  See
-- 'GI.Pango.Objects.Layout.layoutSetHeight' for details.
-- 
-- /Since: 1.20/
layoutGetHeight ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Int32
    -- ^ __Returns:__ the height, in Pango units if positive, or
    -- number of lines if negative.
layoutGetHeight :: a -> m Int32
layoutGetHeight a
layout = 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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Int32
result <- Ptr Layout -> IO Int32
pango_layout_get_height Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetHeightMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetHeightMethodInfo a signature where
    overloadedMethod = layoutGetHeight

#endif

-- method Layout::get_indent
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_indent" pango_layout_get_indent :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Int32

-- | Gets the paragraph indent width in Pango units. A negative value
-- indicates a hanging indentation.
layoutGetIndent ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Int32
    -- ^ __Returns:__ the indent in Pango units.
layoutGetIndent :: a -> m Int32
layoutGetIndent a
layout = 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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Int32
result <- Ptr Layout -> IO Int32
pango_layout_get_indent Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetIndentMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetIndentMethodInfo a signature where
    overloadedMethod = layoutGetIndent

#endif

-- method Layout::get_iter
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Pango" , name = "LayoutIter" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_iter" pango_layout_get_iter :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO (Ptr Pango.LayoutIter.LayoutIter)

-- | Returns an iterator to iterate over the visual extents of the layout.
layoutGetIter ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Pango.LayoutIter.LayoutIter
    -- ^ __Returns:__ the new t'GI.Pango.Structs.LayoutIter.LayoutIter' that should be freed using
    --               'GI.Pango.Structs.LayoutIter.layoutIterFree'.
layoutGetIter :: a -> m LayoutIter
layoutGetIter a
layout = IO LayoutIter -> m LayoutIter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LayoutIter -> m LayoutIter) -> IO LayoutIter -> m LayoutIter
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr LayoutIter
result <- Ptr Layout -> IO (Ptr LayoutIter)
pango_layout_get_iter Ptr Layout
layout'
    Text -> Ptr LayoutIter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"layoutGetIter" Ptr LayoutIter
result
    LayoutIter
result' <- ((ManagedPtr LayoutIter -> LayoutIter)
-> Ptr LayoutIter -> IO LayoutIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr LayoutIter -> LayoutIter
Pango.LayoutIter.LayoutIter) Ptr LayoutIter
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    LayoutIter -> IO LayoutIter
forall (m :: * -> *) a. Monad m => a -> m a
return LayoutIter
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetIterMethodInfo
instance (signature ~ (m Pango.LayoutIter.LayoutIter), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetIterMethodInfo a signature where
    overloadedMethod = layoutGetIter

#endif

-- method Layout::get_justify
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_justify" pango_layout_get_justify :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CInt

-- | Gets whether each complete line should be stretched to fill the entire
-- width of the layout.
layoutGetJustify ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Bool
    -- ^ __Returns:__ the justify.
layoutGetJustify :: a -> m Bool
layoutGetJustify a
layout = IO Bool -> m Bool
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CInt
result <- Ptr Layout -> IO CInt
pango_layout_get_justify Ptr Layout
layout'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetJustifyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetJustifyMethodInfo a signature where
    overloadedMethod = layoutGetJustify

#endif

-- method Layout::get_line
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the index of a line, which must be between 0 and\n       <literal>pango_layout_get_line_count(layout) - 1</literal>, inclusive."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Pango" , name = "LayoutLine" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_line" pango_layout_get_line :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- line : TBasicType TInt
    IO (Ptr Pango.LayoutLine.LayoutLine)

-- | Retrieves a particular line from a t'GI.Pango.Objects.Layout.Layout'.
-- 
-- Use the faster 'GI.Pango.Objects.Layout.layoutGetLineReadonly' if you do not plan
-- to modify the contents of the line (glyphs, glyph widths, etc.).
layoutGetLine ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Int32
    -- ^ /@line@/: the index of a line, which must be between 0 and
    --        \<literal>pango_layout_get_line_count(layout) - 1\<\/literal>, inclusive.
    -> m (Maybe Pango.LayoutLine.LayoutLine)
    -- ^ __Returns:__ the requested
    --               t'GI.Pango.Structs.LayoutLine.LayoutLine', or 'P.Nothing' if the index is out of
    --               range. This layout line can be ref\'ed and retained,
    --               but will become invalid if changes are made to the
    --               t'GI.Pango.Objects.Layout.Layout'.
layoutGetLine :: a -> Int32 -> m (Maybe LayoutLine)
layoutGetLine a
layout Int32
line = IO (Maybe LayoutLine) -> m (Maybe LayoutLine)
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr LayoutLine
result <- Ptr Layout -> Int32 -> IO (Ptr LayoutLine)
pango_layout_get_line Ptr Layout
layout' Int32
line
    Maybe LayoutLine
maybeResult <- Ptr LayoutLine
-> (Ptr LayoutLine -> IO LayoutLine) -> IO (Maybe LayoutLine)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr LayoutLine
result ((Ptr LayoutLine -> IO LayoutLine) -> IO (Maybe LayoutLine))
-> (Ptr LayoutLine -> IO LayoutLine) -> IO (Maybe LayoutLine)
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
result' -> do
        LayoutLine
result'' <- ((ManagedPtr LayoutLine -> LayoutLine)
-> Ptr LayoutLine -> IO LayoutLine
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr LayoutLine -> LayoutLine
Pango.LayoutLine.LayoutLine) Ptr LayoutLine
result'
        LayoutLine -> IO LayoutLine
forall (m :: * -> *) a. Monad m => a -> m a
return LayoutLine
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Maybe LayoutLine -> IO (Maybe LayoutLine)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe LayoutLine
maybeResult

#if defined(ENABLE_OVERLOADING)
data LayoutGetLineMethodInfo
instance (signature ~ (Int32 -> m (Maybe Pango.LayoutLine.LayoutLine)), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetLineMethodInfo a signature where
    overloadedMethod = layoutGetLine

#endif

-- method Layout::get_line_count
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_line_count" pango_layout_get_line_count :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Int32

-- | Retrieves the count of lines for the /@layout@/.
layoutGetLineCount ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: t'GI.Pango.Objects.Layout.Layout'
    -> m Int32
    -- ^ __Returns:__ the line count.
layoutGetLineCount :: a -> m Int32
layoutGetLineCount a
layout = 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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Int32
result <- Ptr Layout -> IO Int32
pango_layout_get_line_count Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetLineCountMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetLineCountMethodInfo a signature where
    overloadedMethod = layoutGetLineCount

#endif

-- method Layout::get_line_readonly
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the index of a line, which must be between 0 and\n       <literal>pango_layout_get_line_count(layout) - 1</literal>, inclusive."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Pango" , name = "LayoutLine" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_line_readonly" pango_layout_get_line_readonly :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- line : TBasicType TInt
    IO (Ptr Pango.LayoutLine.LayoutLine)

-- | Retrieves a particular line from a t'GI.Pango.Objects.Layout.Layout'.
-- 
-- This is a faster alternative to 'GI.Pango.Objects.Layout.layoutGetLine',
-- but the user is not expected
-- to modify the contents of the line (glyphs, glyph widths, etc.).
-- 
-- /Since: 1.16/
layoutGetLineReadonly ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Int32
    -- ^ /@line@/: the index of a line, which must be between 0 and
    --        \<literal>pango_layout_get_line_count(layout) - 1\<\/literal>, inclusive.
    -> m (Maybe Pango.LayoutLine.LayoutLine)
    -- ^ __Returns:__ the requested
    --               t'GI.Pango.Structs.LayoutLine.LayoutLine', or 'P.Nothing' if the index is out of
    --               range. This layout line can be ref\'ed and retained,
    --               but will become invalid if changes are made to the
    --               t'GI.Pango.Objects.Layout.Layout'.  No changes should be made to the line.
layoutGetLineReadonly :: a -> Int32 -> m (Maybe LayoutLine)
layoutGetLineReadonly a
layout Int32
line = IO (Maybe LayoutLine) -> m (Maybe LayoutLine)
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr LayoutLine
result <- Ptr Layout -> Int32 -> IO (Ptr LayoutLine)
pango_layout_get_line_readonly Ptr Layout
layout' Int32
line
    Maybe LayoutLine
maybeResult <- Ptr LayoutLine
-> (Ptr LayoutLine -> IO LayoutLine) -> IO (Maybe LayoutLine)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr LayoutLine
result ((Ptr LayoutLine -> IO LayoutLine) -> IO (Maybe LayoutLine))
-> (Ptr LayoutLine -> IO LayoutLine) -> IO (Maybe LayoutLine)
forall a b. (a -> b) -> a -> b
$ \Ptr LayoutLine
result' -> do
        LayoutLine
result'' <- ((ManagedPtr LayoutLine -> LayoutLine)
-> Ptr LayoutLine -> IO LayoutLine
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr LayoutLine -> LayoutLine
Pango.LayoutLine.LayoutLine) Ptr LayoutLine
result'
        LayoutLine -> IO LayoutLine
forall (m :: * -> *) a. Monad m => a -> m a
return LayoutLine
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Maybe LayoutLine -> IO (Maybe LayoutLine)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe LayoutLine
maybeResult

#if defined(ENABLE_OVERLOADING)
data LayoutGetLineReadonlyMethodInfo
instance (signature ~ (Int32 -> m (Maybe Pango.LayoutLine.LayoutLine)), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetLineReadonlyMethodInfo a signature where
    overloadedMethod = layoutGetLineReadonly

#endif

-- method Layout::get_line_spacing
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_line_spacing" pango_layout_get_line_spacing :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CFloat

-- | Gets the value that has been
-- set with 'GI.Pango.Objects.Layout.layoutSetLineSpacing'.
-- 
-- /Since: 1.44/
layoutGetLineSpacing ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Float
layoutGetLineSpacing :: a -> m Float
layoutGetLineSpacing a
layout = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CFloat
result <- Ptr Layout -> IO CFloat
pango_layout_get_line_spacing Ptr Layout
layout'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetLineSpacingMethodInfo
instance (signature ~ (m Float), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetLineSpacingMethodInfo a signature where
    overloadedMethod = layoutGetLineSpacing

#endif

-- method Layout::get_lines
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGSList
--                  (TInterface Name { namespace = "Pango" , name = "LayoutLine" }))
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_lines" pango_layout_get_lines :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO (Ptr (GSList (Ptr Pango.LayoutLine.LayoutLine)))

-- | Returns the lines of the /@layout@/ as a list.
-- 
-- Use the faster 'GI.Pango.Objects.Layout.layoutGetLinesReadonly' if you do not plan
-- to modify the contents of the lines (glyphs, glyph widths, etc.).
layoutGetLines ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m [Pango.LayoutLine.LayoutLine]
    -- ^ __Returns:__ a t'GI.GLib.Structs.SList.SList' containing
    -- the lines in the layout. This points to internal data of the t'GI.Pango.Objects.Layout.Layout'
    -- and must be used with care. It will become invalid on any change to the layout\'s
    -- text or properties.
layoutGetLines :: a -> m [LayoutLine]
layoutGetLines a
layout = IO [LayoutLine] -> m [LayoutLine]
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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr (GSList (Ptr LayoutLine))
result <- Ptr Layout -> IO (Ptr (GSList (Ptr LayoutLine)))
pango_layout_get_lines Ptr Layout
layout'
    [Ptr LayoutLine]
result' <- Ptr (GSList (Ptr LayoutLine)) -> IO [Ptr LayoutLine]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr LayoutLine))
result
    [LayoutLine]
result'' <- (Ptr LayoutLine -> IO LayoutLine)
-> [Ptr LayoutLine] -> IO [LayoutLine]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr LayoutLine -> LayoutLine)
-> Ptr LayoutLine -> IO LayoutLine
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr LayoutLine -> LayoutLine
Pango.LayoutLine.LayoutLine) [Ptr LayoutLine]
result'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    [LayoutLine] -> IO [LayoutLine]
forall (m :: * -> *) a. Monad m => a -> m a
return [LayoutLine]
result''

#if defined(ENABLE_OVERLOADING)
data LayoutGetLinesMethodInfo
instance (signature ~ (m [Pango.LayoutLine.LayoutLine]), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetLinesMethodInfo a signature where
    overloadedMethod = layoutGetLines

#endif

-- method Layout::get_lines_readonly
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGSList
--                  (TInterface Name { namespace = "Pango" , name = "LayoutLine" }))
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_lines_readonly" pango_layout_get_lines_readonly :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO (Ptr (GSList (Ptr Pango.LayoutLine.LayoutLine)))

-- | Returns the lines of the /@layout@/ as a list.
-- 
-- This is a faster alternative to 'GI.Pango.Objects.Layout.layoutGetLines',
-- but the user is not expected
-- to modify the contents of the lines (glyphs, glyph widths, etc.).
-- 
-- /Since: 1.16/
layoutGetLinesReadonly ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m [Pango.LayoutLine.LayoutLine]
    -- ^ __Returns:__ a t'GI.GLib.Structs.SList.SList' containing
    -- the lines in the layout. This points to internal data of the t'GI.Pango.Objects.Layout.Layout' and
    -- must be used with care. It will become invalid on any change to the layout\'s
    -- text or properties.  No changes should be made to the lines.
layoutGetLinesReadonly :: a -> m [LayoutLine]
layoutGetLinesReadonly a
layout = IO [LayoutLine] -> m [LayoutLine]
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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr (GSList (Ptr LayoutLine))
result <- Ptr Layout -> IO (Ptr (GSList (Ptr LayoutLine)))
pango_layout_get_lines_readonly Ptr Layout
layout'
    [Ptr LayoutLine]
result' <- Ptr (GSList (Ptr LayoutLine)) -> IO [Ptr LayoutLine]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr LayoutLine))
result
    [LayoutLine]
result'' <- (Ptr LayoutLine -> IO LayoutLine)
-> [Ptr LayoutLine] -> IO [LayoutLine]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr LayoutLine -> LayoutLine)
-> Ptr LayoutLine -> IO LayoutLine
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr LayoutLine -> LayoutLine
Pango.LayoutLine.LayoutLine) [Ptr LayoutLine]
result'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    [LayoutLine] -> IO [LayoutLine]
forall (m :: * -> *) a. Monad m => a -> m a
return [LayoutLine]
result''

#if defined(ENABLE_OVERLOADING)
data LayoutGetLinesReadonlyMethodInfo
instance (signature ~ (m [Pango.LayoutLine.LayoutLine]), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetLinesReadonlyMethodInfo a signature where
    overloadedMethod = layoutGetLinesReadonly

#endif

-- method Layout::get_log_attrs
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "attrs"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 2
--                 (TInterface Name { namespace = "Pango" , name = "LogAttr" })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "\n        location to store a pointer to an array of logical attributes\n        This value must be freed with g_free()."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferContainer
--           }
--       , Arg
--           { argCName = "n_attrs"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "location to store the number of the attributes in the\n          array. (The stored value will be one more than the total number\n          of characters in the layout, since there need to be attributes\n          corresponding to both the position before the first character\n          and the position after the last character.)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "n_attrs"
--              , argType = TBasicType TInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "location to store the number of the attributes in the\n          array. (The stored value will be one more than the total number\n          of characters in the layout, since there need to be attributes\n          corresponding to both the position before the first character\n          and the position after the last character.)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_log_attrs" pango_layout_get_log_attrs :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr (Ptr Pango.LogAttr.LogAttr) ->      -- attrs : TCArray False (-1) 2 (TInterface (Name {namespace = "Pango", name = "LogAttr"}))
    Ptr Int32 ->                            -- n_attrs : TBasicType TInt
    IO ()

-- | Retrieves an array of logical attributes for each character in
-- the /@layout@/.
layoutGetLogAttrs ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m ([Pango.LogAttr.LogAttr])
layoutGetLogAttrs :: a -> m [LogAttr]
layoutGetLogAttrs a
layout = IO [LogAttr] -> m [LogAttr]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [LogAttr] -> m [LogAttr]) -> IO [LogAttr] -> m [LogAttr]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr (Ptr LogAttr)
attrs <- IO (Ptr (Ptr LogAttr))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Pango.LogAttr.LogAttr))
    Ptr Int32
nAttrs <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Layout -> Ptr (Ptr LogAttr) -> Ptr Int32 -> IO ()
pango_layout_get_log_attrs Ptr Layout
layout' Ptr (Ptr LogAttr)
attrs Ptr Int32
nAttrs
    Int32
nAttrs' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
nAttrs
    Ptr LogAttr
attrs' <- Ptr (Ptr LogAttr) -> IO (Ptr LogAttr)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr LogAttr)
attrs
    [Ptr LogAttr]
attrs'' <- (Int -> Int32 -> Ptr LogAttr -> IO [Ptr LogAttr]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
52 Int32
nAttrs') Ptr LogAttr
attrs'
    [LogAttr]
attrs''' <- (Ptr LogAttr -> IO LogAttr) -> [Ptr LogAttr] -> IO [LogAttr]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr LogAttr -> LogAttr) -> Ptr LogAttr -> IO LogAttr
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr LogAttr -> LogAttr
Pango.LogAttr.LogAttr) [Ptr LogAttr]
attrs''
    Ptr LogAttr -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr LogAttr
attrs'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Ptr (Ptr LogAttr) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr LogAttr)
attrs
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
nAttrs
    [LogAttr] -> IO [LogAttr]
forall (m :: * -> *) a. Monad m => a -> m a
return [LogAttr]
attrs'''

#if defined(ENABLE_OVERLOADING)
data LayoutGetLogAttrsMethodInfo
instance (signature ~ (m ([Pango.LogAttr.LogAttr])), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetLogAttrsMethodInfo a signature where
    overloadedMethod = layoutGetLogAttrs

#endif

-- method Layout::get_log_attrs_readonly
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "n_attrs"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "location to store the number of the attributes in\n  the array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "n_attrs"
--              , argType = TBasicType TInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "location to store the number of the attributes in\n  the array"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just
--               (TCArray
--                  False
--                  (-1)
--                  1
--                  (TInterface Name { namespace = "Pango" , name = "LogAttr" }))
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_log_attrs_readonly" pango_layout_get_log_attrs_readonly :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr Int32 ->                            -- n_attrs : TBasicType TInt
    IO (Ptr Pango.LogAttr.LogAttr)

-- | Retrieves an array of logical attributes for each character in
-- the /@layout@/.
-- 
-- This is a faster alternative to 'GI.Pango.Objects.Layout.layoutGetLogAttrs'.
-- The returned array is part of /@layout@/ and must not be modified.
-- Modifying the layout will invalidate the returned array.
-- 
-- The number of attributes returned in /@nAttrs@/ will be one more
-- than the total number of characters in the layout, since there
-- need to be attributes corresponding to both the position before
-- the first character and the position after the last character.
-- 
-- /Since: 1.30/
layoutGetLogAttrsReadonly ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m [Pango.LogAttr.LogAttr]
    -- ^ __Returns:__ an array of logical attributes
layoutGetLogAttrsReadonly :: a -> m [LogAttr]
layoutGetLogAttrsReadonly a
layout = IO [LogAttr] -> m [LogAttr]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [LogAttr] -> m [LogAttr]) -> IO [LogAttr] -> m [LogAttr]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Int32
nAttrs <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr LogAttr
result <- Ptr Layout -> Ptr Int32 -> IO (Ptr LogAttr)
pango_layout_get_log_attrs_readonly Ptr Layout
layout' Ptr Int32
nAttrs
    Int32
nAttrs' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
nAttrs
    Text -> Ptr LogAttr -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"layoutGetLogAttrsReadonly" Ptr LogAttr
result
    [Ptr LogAttr]
result' <- (Int -> Int32 -> Ptr LogAttr -> IO [Ptr LogAttr]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
52 Int32
nAttrs') Ptr LogAttr
result
    [LogAttr]
result'' <- (Ptr LogAttr -> IO LogAttr) -> [Ptr LogAttr] -> IO [LogAttr]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr LogAttr -> LogAttr) -> Ptr LogAttr -> IO LogAttr
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr LogAttr -> LogAttr
Pango.LogAttr.LogAttr) [Ptr LogAttr]
result'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
nAttrs
    [LogAttr] -> IO [LogAttr]
forall (m :: * -> *) a. Monad m => a -> m a
return [LogAttr]
result''

#if defined(ENABLE_OVERLOADING)
data LayoutGetLogAttrsReadonlyMethodInfo
instance (signature ~ (m [Pango.LogAttr.LogAttr]), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetLogAttrsReadonlyMethodInfo a signature where
    overloadedMethod = layoutGetLogAttrsReadonly

#endif

-- method Layout::get_pixel_extents
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ink_rect"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Rectangle" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "rectangle used to store the extents of the\n                  layout as drawn or %NULL to indicate that the result is\n                  not needed."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "logical_rect"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Rectangle" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "rectangle used to store the logical\n                      extents of the layout or %NULL to indicate that the\n                      result is not needed."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_pixel_extents" pango_layout_get_pixel_extents :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr Pango.Rectangle.Rectangle ->        -- ink_rect : TInterface (Name {namespace = "Pango", name = "Rectangle"})
    Ptr Pango.Rectangle.Rectangle ->        -- logical_rect : TInterface (Name {namespace = "Pango", name = "Rectangle"})
    IO ()

-- | Computes the logical and ink extents of /@layout@/ in device units.
-- This function just calls 'GI.Pango.Objects.Layout.layoutGetExtents' followed by
-- two 'GI.Pango.Functions.extentsToPixels' calls, rounding /@inkRect@/ and /@logicalRect@/
-- such that the rounded rectangles fully contain the unrounded one (that is,
-- passes them as first argument to 'GI.Pango.Functions.extentsToPixels').
layoutGetPixelExtents ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))
layoutGetPixelExtents :: a -> m (Rectangle, Rectangle)
layoutGetPixelExtents a
layout = IO (Rectangle, Rectangle) -> m (Rectangle, Rectangle)
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Rectangle
inkRect <- Int -> IO (Ptr Rectangle)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr Pango.Rectangle.Rectangle)
    Ptr Rectangle
logicalRect <- Int -> IO (Ptr Rectangle)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr Pango.Rectangle.Rectangle)
    Ptr Layout -> Ptr Rectangle -> Ptr Rectangle -> IO ()
pango_layout_get_pixel_extents Ptr Layout
layout' Ptr Rectangle
inkRect Ptr Rectangle
logicalRect
    Rectangle
inkRect' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Rectangle -> Rectangle
Pango.Rectangle.Rectangle) Ptr Rectangle
inkRect
    Rectangle
logicalRect' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Rectangle -> Rectangle
Pango.Rectangle.Rectangle) Ptr Rectangle
logicalRect
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    (Rectangle, Rectangle) -> IO (Rectangle, Rectangle)
forall (m :: * -> *) a. Monad m => a -> m a
return (Rectangle
inkRect', Rectangle
logicalRect')

#if defined(ENABLE_OVERLOADING)
data LayoutGetPixelExtentsMethodInfo
instance (signature ~ (m ((Pango.Rectangle.Rectangle, Pango.Rectangle.Rectangle))), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetPixelExtentsMethodInfo a signature where
    overloadedMethod = layoutGetPixelExtents

#endif

-- method Layout::get_pixel_size
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the logical width, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "location to store the logical height, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_pixel_size" pango_layout_get_pixel_size :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr Int32 ->                            -- width : TBasicType TInt
    Ptr Int32 ->                            -- height : TBasicType TInt
    IO ()

-- | Determines the logical width and height of a t'GI.Pango.Objects.Layout.Layout'
-- in device units. ('GI.Pango.Objects.Layout.layoutGetSize' returns the width
-- and height scaled by 'GI.Pango.Constants.SCALE'.) This
-- is simply a convenience function around
-- 'GI.Pango.Objects.Layout.layoutGetPixelExtents'.
layoutGetPixelSize ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m ((Int32, Int32))
layoutGetPixelSize :: a -> m (Int32, Int32)
layoutGetPixelSize a
layout = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Int32
width <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
height <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Layout -> Ptr Int32 -> Ptr Int32 -> IO ()
pango_layout_get_pixel_size Ptr Layout
layout' Ptr Int32
width Ptr Int32
height
    Int32
width' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
width
    Int32
height' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
height
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
width
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
height
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
width', Int32
height')

#if defined(ENABLE_OVERLOADING)
data LayoutGetPixelSizeMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetPixelSizeMethodInfo a signature where
    overloadedMethod = layoutGetPixelSize

#endif

-- method Layout::get_serial
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_serial" pango_layout_get_serial :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Word32

-- | Returns the current serial number of /@layout@/.  The serial number is
-- initialized to an small number  larger than zero when a new layout
-- is created and is increased whenever the layout is changed using any
-- of the setter functions, or the t'GI.Pango.Objects.Context.Context' it uses has changed.
-- The serial may wrap, but will never have the value 0. Since it
-- can wrap, never compare it with \"less than\", always use \"not equals\".
-- 
-- This can be used to automatically detect changes to a t'GI.Pango.Objects.Layout.Layout', and
-- is useful for example to decide whether a layout needs redrawing.
-- To force the serial to be increased, use 'GI.Pango.Objects.Layout.layoutContextChanged'.
-- 
-- /Since: 1.32.4/
layoutGetSerial ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Word32
    -- ^ __Returns:__ The current serial number of /@layout@/.
layoutGetSerial :: a -> m Word32
layoutGetSerial a
layout = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Word32
result <- Ptr Layout -> IO Word32
pango_layout_get_serial Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetSerialMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetSerialMethodInfo a signature where
    overloadedMethod = layoutGetSerial

#endif

-- method Layout::get_single_paragraph_mode
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_single_paragraph_mode" pango_layout_get_single_paragraph_mode :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CInt

-- | Obtains the value set by 'GI.Pango.Objects.Layout.layoutSetSingleParagraphMode'.
layoutGetSingleParagraphMode ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the layout does not break paragraphs at
    -- paragraph separator characters, 'P.False' otherwise.
layoutGetSingleParagraphMode :: a -> m Bool
layoutGetSingleParagraphMode a
layout = IO Bool -> m Bool
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CInt
result <- Ptr Layout -> IO CInt
pango_layout_get_single_paragraph_mode Ptr Layout
layout'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetSingleParagraphModeMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetSingleParagraphModeMethodInfo a signature where
    overloadedMethod = layoutGetSingleParagraphMode

#endif

-- method Layout::get_size
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the logical width, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "location to store the logical height, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_size" pango_layout_get_size :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr Int32 ->                            -- width : TBasicType TInt
    Ptr Int32 ->                            -- height : TBasicType TInt
    IO ()

-- | Determines the logical width and height of a t'GI.Pango.Objects.Layout.Layout'
-- in Pango units (device units scaled by 'GI.Pango.Constants.SCALE'). This
-- is simply a convenience function around 'GI.Pango.Objects.Layout.layoutGetExtents'.
layoutGetSize ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m ((Int32, Int32))
layoutGetSize :: a -> m (Int32, Int32)
layoutGetSize a
layout = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Int32
width <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
height <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Layout -> Ptr Int32 -> Ptr Int32 -> IO ()
pango_layout_get_size Ptr Layout
layout' Ptr Int32
width Ptr Int32
height
    Int32
width' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
width
    Int32
height' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
height
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
width
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
height
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
width', Int32
height')

#if defined(ENABLE_OVERLOADING)
data LayoutGetSizeMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetSizeMethodInfo a signature where
    overloadedMethod = layoutGetSize

#endif

-- method Layout::get_spacing
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_spacing" pango_layout_get_spacing :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Int32

-- | Gets the amount of spacing between the lines of the layout.
layoutGetSpacing ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Int32
    -- ^ __Returns:__ the spacing in Pango units.
layoutGetSpacing :: a -> m Int32
layoutGetSpacing a
layout = 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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Int32
result <- Ptr Layout -> IO Int32
pango_layout_get_spacing Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetSpacingMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetSpacingMethodInfo a signature where
    overloadedMethod = layoutGetSpacing

#endif

-- method Layout::get_tabs
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Pango" , name = "TabArray" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_tabs" pango_layout_get_tabs :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO (Ptr Pango.TabArray.TabArray)

-- | Gets the current t'GI.Pango.Structs.TabArray.TabArray' used by this layout. If no
-- t'GI.Pango.Structs.TabArray.TabArray' has been set, then the default tabs are in use
-- and 'P.Nothing' is returned. Default tabs are every 8 spaces.
-- The return value should be freed with 'GI.Pango.Structs.TabArray.tabArrayFree'.
layoutGetTabs ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m (Maybe Pango.TabArray.TabArray)
    -- ^ __Returns:__ a copy of the tabs for this layout, or
    -- 'P.Nothing'.
layoutGetTabs :: a -> m (Maybe TabArray)
layoutGetTabs a
layout = IO (Maybe TabArray) -> m (Maybe TabArray)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe TabArray) -> m (Maybe TabArray))
-> IO (Maybe TabArray) -> m (Maybe TabArray)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr TabArray
result <- Ptr Layout -> IO (Ptr TabArray)
pango_layout_get_tabs Ptr Layout
layout'
    Maybe TabArray
maybeResult <- Ptr TabArray
-> (Ptr TabArray -> IO TabArray) -> IO (Maybe TabArray)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr TabArray
result ((Ptr TabArray -> IO TabArray) -> IO (Maybe TabArray))
-> (Ptr TabArray -> IO TabArray) -> IO (Maybe TabArray)
forall a b. (a -> b) -> a -> b
$ \Ptr TabArray
result' -> do
        TabArray
result'' <- ((ManagedPtr TabArray -> TabArray) -> Ptr TabArray -> IO TabArray
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TabArray -> TabArray
Pango.TabArray.TabArray) Ptr TabArray
result'
        TabArray -> IO TabArray
forall (m :: * -> *) a. Monad m => a -> m a
return TabArray
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Maybe TabArray -> IO (Maybe TabArray)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TabArray
maybeResult

#if defined(ENABLE_OVERLOADING)
data LayoutGetTabsMethodInfo
instance (signature ~ (m (Maybe Pango.TabArray.TabArray)), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetTabsMethodInfo a signature where
    overloadedMethod = layoutGetTabs

#endif

-- method Layout::get_text
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_text" pango_layout_get_text :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CString

-- | Gets the text in the layout. The returned text should not
-- be freed or modified.
layoutGetText ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m T.Text
    -- ^ __Returns:__ the text in the /@layout@/.
layoutGetText :: a -> m Text
layoutGetText a
layout = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CString
result <- Ptr Layout -> IO CString
pango_layout_get_text Ptr Layout
layout'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"layoutGetText" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetTextMethodInfo a signature where
    overloadedMethod = layoutGetText

#endif

-- method Layout::get_unknown_glyphs_count
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_unknown_glyphs_count" pango_layout_get_unknown_glyphs_count :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Int32

-- | Counts the number unknown glyphs in /@layout@/.  That is, zero if
-- glyphs for all characters in the layout text were found, or more
-- than zero otherwise.
-- 
-- This function can be used to determine if there are any fonts
-- available to render all characters in a certain string, or when
-- used in combination with 'GI.Pango.Enums.AttrTypeFallback', to check if a
-- certain font supports all the characters in the string.
-- 
-- /Since: 1.16/
layoutGetUnknownGlyphsCount ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Int32
    -- ^ __Returns:__ The number of unknown glyphs in /@layout@/.
layoutGetUnknownGlyphsCount :: a -> m Int32
layoutGetUnknownGlyphsCount a
layout = 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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Int32
result <- Ptr Layout -> IO Int32
pango_layout_get_unknown_glyphs_count Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetUnknownGlyphsCountMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetUnknownGlyphsCountMethodInfo a signature where
    overloadedMethod = layoutGetUnknownGlyphsCount

#endif

-- method Layout::get_width
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_width" pango_layout_get_width :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO Int32

-- | Gets the width to which the lines of the t'GI.Pango.Objects.Layout.Layout' should wrap.
layoutGetWidth ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Int32
    -- ^ __Returns:__ the width in Pango units, or -1 if no width set.
layoutGetWidth :: a -> m Int32
layoutGetWidth a
layout = 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
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Int32
result <- Ptr Layout -> IO Int32
pango_layout_get_width Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data LayoutGetWidthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetWidthMethodInfo a signature where
    overloadedMethod = layoutGetWidth

#endif

-- method Layout::get_wrap
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Pango" , name = "WrapMode" })
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_get_wrap" pango_layout_get_wrap :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CUInt

-- | Gets the wrap mode for the layout.
-- 
-- Use 'GI.Pango.Objects.Layout.layoutIsWrapped' to query whether any paragraphs
-- were actually wrapped.
layoutGetWrap ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Pango.Enums.WrapMode
    -- ^ __Returns:__ active wrap mode.
layoutGetWrap :: a -> m WrapMode
layoutGetWrap a
layout = IO WrapMode -> m WrapMode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WrapMode -> m WrapMode) -> IO WrapMode -> m WrapMode
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CUInt
result <- Ptr Layout -> IO CUInt
pango_layout_get_wrap Ptr Layout
layout'
    let result' :: WrapMode
result' = (Int -> WrapMode
forall a. Enum a => Int -> a
toEnum (Int -> WrapMode) -> (CUInt -> Int) -> CUInt -> WrapMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    WrapMode -> IO WrapMode
forall (m :: * -> *) a. Monad m => a -> m a
return WrapMode
result'

#if defined(ENABLE_OVERLOADING)
data LayoutGetWrapMethodInfo
instance (signature ~ (m Pango.Enums.WrapMode), MonadIO m, IsLayout a) => O.MethodInfo LayoutGetWrapMethodInfo a signature where
    overloadedMethod = layoutGetWrap

#endif

-- method Layout::index_to_line_x
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index_"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the byte index of a grapheme within the layout."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "trailing"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "an integer indicating the edge of the grapheme to retrieve the\n            position of. If > 0, the trailing edge of the grapheme, if 0,\n            the leading of the grapheme."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "location to store resulting line index. (which will\n              between 0 and pango_layout_get_line_count(layout) - 1), or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "x_pos"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "location to store resulting position within line\n             (%PANGO_SCALE units per device unit), or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_index_to_line_x" pango_layout_index_to_line_x :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- index_ : TBasicType TInt
    CInt ->                                 -- trailing : TBasicType TBoolean
    Ptr Int32 ->                            -- line : TBasicType TInt
    Ptr Int32 ->                            -- x_pos : TBasicType TInt
    IO ()

-- | Converts from byte /@index_@/ within the /@layout@/ to line and X position.
-- (X position is measured from the left edge of the line)
layoutIndexToLineX ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Int32
    -- ^ /@index_@/: the byte index 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, Int32))
layoutIndexToLineX :: a -> Int32 -> Bool -> m (Int32, Int32)
layoutIndexToLineX a
layout Int32
index_ Bool
trailing = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let trailing' :: CInt
trailing' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
trailing
    Ptr Int32
line <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
xPos <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Layout -> Int32 -> CInt -> Ptr Int32 -> Ptr Int32 -> IO ()
pango_layout_index_to_line_x Ptr Layout
layout' Int32
index_ CInt
trailing' Ptr Int32
line Ptr Int32
xPos
    Int32
line' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
line
    Int32
xPos' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
xPos
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
line
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
xPos
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
line', Int32
xPos')

#if defined(ENABLE_OVERLOADING)
data LayoutIndexToLineXMethodInfo
instance (signature ~ (Int32 -> Bool -> m ((Int32, Int32))), MonadIO m, IsLayout a) => O.MethodInfo LayoutIndexToLineXMethodInfo a signature where
    overloadedMethod = layoutIndexToLineX

#endif

-- method Layout::index_to_pos
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index_"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "byte index within @layout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "pos"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Rectangle" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "rectangle in which to store the position of the grapheme"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_index_to_pos" pango_layout_index_to_pos :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- index_ : TBasicType TInt
    Ptr Pango.Rectangle.Rectangle ->        -- pos : TInterface (Name {namespace = "Pango", name = "Rectangle"})
    IO ()

-- | Converts from an index within a t'GI.Pango.Objects.Layout.Layout' to the onscreen position
-- corresponding to the grapheme at that index, which is represented
-- as rectangle.  Note that \<literal>pos->x\<\/literal> is always the leading
-- edge of the grapheme and \<literal>pos->x + pos->width\<\/literal> the trailing
-- edge of the grapheme. If the directionality of the grapheme is right-to-left,
-- then \<literal>pos->width\<\/literal> will be negative.
layoutIndexToPos ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Int32
    -- ^ /@index_@/: byte index within /@layout@/
    -> m (Pango.Rectangle.Rectangle)
layoutIndexToPos :: a -> Int32 -> m Rectangle
layoutIndexToPos a
layout Int32
index_ = IO Rectangle -> m Rectangle
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Rectangle -> m Rectangle) -> IO Rectangle -> m Rectangle
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Rectangle
pos <- Int -> IO (Ptr Rectangle)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr Pango.Rectangle.Rectangle)
    Ptr Layout -> Int32 -> Ptr Rectangle -> IO ()
pango_layout_index_to_pos Ptr Layout
layout' Int32
index_ Ptr Rectangle
pos
    Rectangle
pos' <- ((ManagedPtr Rectangle -> Rectangle)
-> Ptr Rectangle -> IO Rectangle
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Rectangle -> Rectangle
Pango.Rectangle.Rectangle) Ptr Rectangle
pos
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Rectangle -> IO Rectangle
forall (m :: * -> *) a. Monad m => a -> m a
return Rectangle
pos'

#if defined(ENABLE_OVERLOADING)
data LayoutIndexToPosMethodInfo
instance (signature ~ (Int32 -> m (Pango.Rectangle.Rectangle)), MonadIO m, IsLayout a) => O.MethodInfo LayoutIndexToPosMethodInfo a signature where
    overloadedMethod = layoutIndexToPos

#endif

-- method Layout::is_ellipsized
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_is_ellipsized" pango_layout_is_ellipsized :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CInt

-- | Queries whether the layout had to ellipsize any paragraphs.
-- 
-- This returns 'P.True' if the ellipsization mode for /@layout@/
-- is not 'GI.Pango.Enums.EllipsizeModeNone', a positive width is set on /@layout@/,
-- and there are paragraphs exceeding that width that have to be
-- ellipsized.
-- 
-- /Since: 1.16/
layoutIsEllipsized ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if any paragraphs had to be ellipsized, 'P.False'
    -- otherwise.
layoutIsEllipsized :: a -> m Bool
layoutIsEllipsized a
layout = IO Bool -> m Bool
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CInt
result <- Ptr Layout -> IO CInt
pango_layout_is_ellipsized Ptr Layout
layout'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data LayoutIsEllipsizedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsLayout a) => O.MethodInfo LayoutIsEllipsizedMethodInfo a signature where
    overloadedMethod = layoutIsEllipsized

#endif

-- method Layout::is_wrapped
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_is_wrapped" pango_layout_is_wrapped :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO CInt

-- | Queries whether the layout had to wrap any paragraphs.
-- 
-- This returns 'P.True' if a positive width is set on /@layout@/,
-- ellipsization mode of /@layout@/ is set to 'GI.Pango.Enums.EllipsizeModeNone',
-- and there are paragraphs exceeding the layout width that have
-- to be wrapped.
-- 
-- /Since: 1.16/
layoutIsWrapped ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if any paragraphs had to be wrapped, 'P.False'
    -- otherwise.
layoutIsWrapped :: a -> m Bool
layoutIsWrapped a
layout = IO Bool -> m Bool
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CInt
result <- Ptr Layout -> IO CInt
pango_layout_is_wrapped Ptr Layout
layout'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data LayoutIsWrappedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsLayout a) => O.MethodInfo LayoutIsWrappedMethodInfo a signature where
    overloadedMethod = layoutIsWrapped

#endif

-- method Layout::move_cursor_visually
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "strong"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "whether the moving cursor is the strong cursor or the\n               weak cursor. The strong cursor is the cursor corresponding\n               to text insertion in the base direction for the layout."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "old_index"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the byte index of the grapheme for the old index"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "old_trailing"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if 0, the cursor was at the leading edge of the\n               grapheme indicated by @old_index, if > 0, the cursor\n               was at the trailing edge."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "direction to move cursor. A negative\n               value indicates motion to the left."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "new_index"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "location to store the new cursor byte index. A value of -1\n               indicates that the cursor has been moved off the beginning\n               of the layout. A value of %G_MAXINT indicates that\n               the cursor has been moved off the end of the layout."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "new_trailing"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "number of characters to move forward from the\n               location returned for @new_index to get the position\n               where the cursor should be displayed. This allows\n               distinguishing the position at the beginning of one\n               line from the position at the end of the preceding\n               line. @new_index is always on the line where the\n               cursor should be displayed."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_move_cursor_visually" pango_layout_move_cursor_visually :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CInt ->                                 -- strong : TBasicType TBoolean
    Int32 ->                                -- old_index : TBasicType TInt
    Int32 ->                                -- old_trailing : TBasicType TInt
    Int32 ->                                -- direction : TBasicType TInt
    Ptr Int32 ->                            -- new_index : TBasicType TInt
    Ptr Int32 ->                            -- new_trailing : TBasicType TInt
    IO ()

-- | Computes a new cursor position from an old position and
-- a count of positions to move visually. If /@direction@/ is positive,
-- then the new strong cursor position will be one position
-- to the right of the old cursor position. If /@direction@/ is negative,
-- then the new strong cursor position will be one position
-- to the left of the old cursor position.
-- 
-- In the presence of bidirectional text, the correspondence
-- between logical and visual order will depend on the direction
-- of the current run, and there may be jumps when the cursor
-- is moved off of the end of a run.
-- 
-- Motion here is in cursor positions, not in characters, so a
-- single call to 'GI.Pango.Objects.Layout.layoutMoveCursorVisually' may move the
-- cursor over multiple characters when multiple characters combine
-- to form a single grapheme.
layoutMoveCursorVisually ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'.
    -> Bool
    -- ^ /@strong@/: whether the moving cursor is the strong cursor or the
    --                weak cursor. The strong cursor is the cursor corresponding
    --                to text insertion in the base direction for the layout.
    -> Int32
    -- ^ /@oldIndex@/: the byte index of the grapheme for the old index
    -> Int32
    -- ^ /@oldTrailing@/: if 0, the cursor was at the leading edge of the
    --                grapheme indicated by /@oldIndex@/, if > 0, the cursor
    --                was at the trailing edge.
    -> Int32
    -- ^ /@direction@/: direction to move cursor. A negative
    --                value indicates motion to the left.
    -> m ((Int32, Int32))
layoutMoveCursorVisually :: a -> Bool -> Int32 -> Int32 -> Int32 -> m (Int32, Int32)
layoutMoveCursorVisually a
layout Bool
strong Int32
oldIndex Int32
oldTrailing Int32
direction = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let strong' :: CInt
strong' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
strong
    Ptr Int32
newIndex <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
newTrailing <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Layout
-> CInt
-> Int32
-> Int32
-> Int32
-> Ptr Int32
-> Ptr Int32
-> IO ()
pango_layout_move_cursor_visually Ptr Layout
layout' CInt
strong' Int32
oldIndex Int32
oldTrailing Int32
direction Ptr Int32
newIndex Ptr Int32
newTrailing
    Int32
newIndex' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
newIndex
    Int32
newTrailing' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
newTrailing
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
newIndex
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
newTrailing
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
newIndex', Int32
newTrailing')

#if defined(ENABLE_OVERLOADING)
data LayoutMoveCursorVisuallyMethodInfo
instance (signature ~ (Bool -> Int32 -> Int32 -> Int32 -> m ((Int32, Int32))), MonadIO m, IsLayout a) => O.MethodInfo LayoutMoveCursorVisuallyMethodInfo a signature where
    overloadedMethod = layoutMoveCursorVisually

#endif

-- method Layout::set_alignment
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "alignment"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Alignment" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the alignment" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_alignment" pango_layout_set_alignment :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CUInt ->                                -- alignment : TInterface (Name {namespace = "Pango", name = "Alignment"})
    IO ()

-- | Sets the alignment for the layout: how partial lines are
-- positioned within the horizontal space available.
layoutSetAlignment ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Pango.Enums.Alignment
    -- ^ /@alignment@/: the alignment
    -> m ()
layoutSetAlignment :: a -> Alignment -> m ()
layoutSetAlignment a
layout Alignment
alignment = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let alignment' :: CUInt
alignment' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Alignment -> Int) -> Alignment -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Alignment -> Int
forall a. Enum a => a -> Int
fromEnum) Alignment
alignment
    Ptr Layout -> CUInt -> IO ()
pango_layout_set_alignment Ptr Layout
layout' CUInt
alignment'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetAlignmentMethodInfo
instance (signature ~ (Pango.Enums.Alignment -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetAlignmentMethodInfo a signature where
    overloadedMethod = layoutSetAlignment

#endif

-- method Layout::set_attributes
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "attrs"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "AttrList" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoAttrList, can be %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_attributes" pango_layout_set_attributes :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr Pango.AttrList.AttrList ->          -- attrs : TInterface (Name {namespace = "Pango", name = "AttrList"})
    IO ()

-- | Sets the text attributes for a layout object.
-- References /@attrs@/, so the caller can unref its reference.
layoutSetAttributes ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Maybe (Pango.AttrList.AttrList)
    -- ^ /@attrs@/: a t'GI.Pango.Structs.AttrList.AttrList', can be 'P.Nothing'
    -> m ()
layoutSetAttributes :: a -> Maybe AttrList -> m ()
layoutSetAttributes a
layout Maybe AttrList
attrs = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr AttrList
maybeAttrs <- case Maybe AttrList
attrs of
        Maybe AttrList
Nothing -> Ptr AttrList -> IO (Ptr AttrList)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AttrList
forall a. Ptr a
nullPtr
        Just AttrList
jAttrs -> do
            Ptr AttrList
jAttrs' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
jAttrs
            Ptr AttrList -> IO (Ptr AttrList)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AttrList
jAttrs'
    Ptr Layout -> Ptr AttrList -> IO ()
pango_layout_set_attributes Ptr Layout
layout' Ptr AttrList
maybeAttrs
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Maybe AttrList -> (AttrList -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe AttrList
attrs AttrList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetAttributesMethodInfo
instance (signature ~ (Maybe (Pango.AttrList.AttrList) -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetAttributesMethodInfo a signature where
    overloadedMethod = layoutSetAttributes

#endif

-- method Layout::set_auto_dir
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "auto_dir"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if %TRUE, compute the bidirectional base direction\n  from the layout's contents."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_auto_dir" pango_layout_set_auto_dir :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CInt ->                                 -- auto_dir : TBasicType TBoolean
    IO ()

-- | Sets whether to calculate the bidirectional base direction
-- for the layout according to the contents of the layout;
-- when this flag is on (the default), then paragraphs in
--    /@layout@/ that begin with strong right-to-left characters
-- (Arabic and Hebrew principally), will have right-to-left
-- layout, paragraphs with letters from other scripts will
-- have left-to-right layout. Paragraphs with only neutral
-- characters get their direction from the surrounding paragraphs.
-- 
-- When 'P.False', the choice between left-to-right and
-- right-to-left layout is done according to the base direction
-- of the layout\'s t'GI.Pango.Objects.Context.Context'. (See 'GI.Pango.Objects.Context.contextSetBaseDir').
-- 
-- When the auto-computed direction of a paragraph differs from the
-- base direction of the context, the interpretation of
-- 'GI.Pango.Enums.AlignmentLeft' and 'GI.Pango.Enums.AlignmentRight' are swapped.
-- 
-- /Since: 1.4/
layoutSetAutoDir ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Bool
    -- ^ /@autoDir@/: if 'P.True', compute the bidirectional base direction
    --   from the layout\'s contents.
    -> m ()
layoutSetAutoDir :: a -> Bool -> m ()
layoutSetAutoDir a
layout Bool
autoDir = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let autoDir' :: CInt
autoDir' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
autoDir
    Ptr Layout -> CInt -> IO ()
pango_layout_set_auto_dir Ptr Layout
layout' CInt
autoDir'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetAutoDirMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetAutoDirMethodInfo a signature where
    overloadedMethod = layoutSetAutoDir

#endif

-- method Layout::set_ellipsize
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ellipsize"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "EllipsizeMode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the new ellipsization mode for @layout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_ellipsize" pango_layout_set_ellipsize :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CUInt ->                                -- ellipsize : TInterface (Name {namespace = "Pango", name = "EllipsizeMode"})
    IO ()

-- | Sets the type of ellipsization being performed for /@layout@/.
-- Depending on the ellipsization mode /@ellipsize@/ text is
-- removed from the start, middle, or end of text so they
-- fit within the width and height of layout set with
-- 'GI.Pango.Objects.Layout.layoutSetWidth' and 'GI.Pango.Objects.Layout.layoutSetHeight'.
-- 
-- If the layout contains characters such as newlines that
-- force it to be layed out in multiple paragraphs, then whether
-- each paragraph is ellipsized separately or the entire layout
-- is ellipsized as a whole depends on the set height of the layout.
-- See 'GI.Pango.Objects.Layout.layoutSetHeight' for details.
-- 
-- /Since: 1.6/
layoutSetEllipsize ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Pango.Enums.EllipsizeMode
    -- ^ /@ellipsize@/: the new ellipsization mode for /@layout@/
    -> m ()
layoutSetEllipsize :: a -> EllipsizeMode -> m ()
layoutSetEllipsize a
layout EllipsizeMode
ellipsize = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let ellipsize' :: CUInt
ellipsize' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (EllipsizeMode -> Int) -> EllipsizeMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EllipsizeMode -> Int
forall a. Enum a => a -> Int
fromEnum) EllipsizeMode
ellipsize
    Ptr Layout -> CUInt -> IO ()
pango_layout_set_ellipsize Ptr Layout
layout' CUInt
ellipsize'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetEllipsizeMethodInfo
instance (signature ~ (Pango.Enums.EllipsizeMode -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetEllipsizeMethodInfo a signature where
    overloadedMethod = layoutSetEllipsize

#endif

-- method Layout::set_font_description
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "desc"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "FontDescription" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the new #PangoFontDescription, or %NULL to unset the\n       current font description"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_font_description" pango_layout_set_font_description :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr Pango.FontDescription.FontDescription -> -- desc : TInterface (Name {namespace = "Pango", name = "FontDescription"})
    IO ()

-- | Sets the default font description for the layout. If no font
-- description is set on the layout, the font description from
-- the layout\'s context is used.
layoutSetFontDescription ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Maybe (Pango.FontDescription.FontDescription)
    -- ^ /@desc@/: the new t'GI.Pango.Structs.FontDescription.FontDescription', or 'P.Nothing' to unset the
    --        current font description
    -> m ()
layoutSetFontDescription :: a -> Maybe FontDescription -> m ()
layoutSetFontDescription a
layout Maybe FontDescription
desc = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr FontDescription
maybeDesc <- case Maybe FontDescription
desc of
        Maybe FontDescription
Nothing -> Ptr FontDescription -> IO (Ptr FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontDescription
forall a. Ptr a
nullPtr
        Just FontDescription
jDesc -> do
            Ptr FontDescription
jDesc' <- FontDescription -> IO (Ptr FontDescription)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontDescription
jDesc
            Ptr FontDescription -> IO (Ptr FontDescription)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontDescription
jDesc'
    Ptr Layout -> Ptr FontDescription -> IO ()
pango_layout_set_font_description Ptr Layout
layout' Ptr FontDescription
maybeDesc
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Maybe FontDescription -> (FontDescription -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe FontDescription
desc FontDescription -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetFontDescriptionMethodInfo
instance (signature ~ (Maybe (Pango.FontDescription.FontDescription) -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetFontDescriptionMethodInfo a signature where
    overloadedMethod = layoutSetFontDescription

#endif

-- method Layout::set_height
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the desired height of the layout in Pango units if positive,\n         or desired number of lines if negative."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_height" pango_layout_set_height :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- height : TBasicType TInt
    IO ()

-- | Sets the height to which the t'GI.Pango.Objects.Layout.Layout' should be ellipsized at.  There
-- are two different behaviors, based on whether /@height@/ is positive or
-- negative.
-- 
-- If /@height@/ is positive, it will be the maximum height of the layout.  Only
-- lines would be shown that would fit, and if there is any text omitted,
-- an ellipsis added.  At least one line is included in each paragraph regardless
-- of how small the height value is.  A value of zero will render exactly one
-- line for the entire layout.
-- 
-- If /@height@/ is negative, it will be the (negative of) maximum number of lines per
-- paragraph.  That is, the total number of lines shown may well be more than
-- this value if the layout contains multiple paragraphs of text.
-- The default value of -1 means that first line of each paragraph is ellipsized.
-- This behvaior may be changed in the future to act per layout instead of per
-- paragraph.  File a bug against pango at \<ulink
-- url=\"http:\/\/bugzilla.gnome.org\/\">http:\/\/bugzilla.gnome.org\/\<\/ulink> if your
-- code relies on this behavior.
-- 
-- Height setting only has effect if a positive width is set on
-- /@layout@/ and ellipsization mode of /@layout@/ is not 'GI.Pango.Enums.EllipsizeModeNone'.
-- The behavior is undefined if a height other than -1 is set and
-- ellipsization mode is set to 'GI.Pango.Enums.EllipsizeModeNone', and may change in the
-- future.
-- 
-- /Since: 1.20/
layoutSetHeight ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'.
    -> Int32
    -- ^ /@height@/: the desired height of the layout in Pango units if positive,
    --          or desired number of lines if negative.
    -> m ()
layoutSetHeight :: a -> Int32 -> m ()
layoutSetHeight a
layout Int32
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Layout -> Int32 -> IO ()
pango_layout_set_height Ptr Layout
layout' Int32
height
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetHeightMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetHeightMethodInfo a signature where
    overloadedMethod = layoutSetHeight

#endif

-- method Layout::set_indent
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "indent"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the amount by which to indent."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_indent" pango_layout_set_indent :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- indent : TBasicType TInt
    IO ()

-- | Sets the width in Pango units to indent each paragraph. A negative value
-- of /@indent@/ will produce a hanging indentation. That is, the first line will
-- have the full width, and subsequent lines will be indented by the
-- absolute value of /@indent@/.
-- 
-- The indent setting is ignored if layout alignment is set to
-- 'GI.Pango.Enums.AlignmentCenter'.
layoutSetIndent ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'.
    -> Int32
    -- ^ /@indent@/: the amount by which to indent.
    -> m ()
layoutSetIndent :: a -> Int32 -> m ()
layoutSetIndent a
layout Int32
indent = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Layout -> Int32 -> IO ()
pango_layout_set_indent Ptr Layout
layout' Int32
indent
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetIndentMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetIndentMethodInfo a signature where
    overloadedMethod = layoutSetIndent

#endif

-- method Layout::set_justify
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "justify"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "whether the lines in the layout should be justified."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_justify" pango_layout_set_justify :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CInt ->                                 -- justify : TBasicType TBoolean
    IO ()

-- | Sets whether each complete line should be stretched to
-- fill the entire width of the layout. This stretching is typically
-- done by adding whitespace, but for some scripts (such as Arabic),
-- the justification may be done in more complex ways, like extending
-- the characters.
-- 
-- Note that this setting is not implemented and so is ignored in Pango
-- older than 1.18.
layoutSetJustify ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Bool
    -- ^ /@justify@/: whether the lines in the layout should be justified.
    -> m ()
layoutSetJustify :: a -> Bool -> m ()
layoutSetJustify a
layout Bool
justify = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let justify' :: CInt
justify' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
justify
    Ptr Layout -> CInt -> IO ()
pango_layout_set_justify Ptr Layout
layout' CInt
justify'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetJustifyMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetJustifyMethodInfo a signature where
    overloadedMethod = layoutSetJustify

#endif

-- method Layout::set_line_spacing
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "factor"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the new line spacing factor"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_line_spacing" pango_layout_set_line_spacing :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CFloat ->                               -- factor : TBasicType TFloat
    IO ()

-- | Sets a factor for line spacing.
-- Typical values are: 0, 1, 1.5, 2.
-- The default values is 0.
-- 
-- If /@factor@/ is non-zero, lines are placed
-- so that
-- 
-- baseline2 = baseline1 + factor * height2
-- 
-- where height2 is the line height of the
-- second line (as determined by the font(s)).
-- In this case, the spacing set with
-- 'GI.Pango.Objects.Layout.layoutSetSpacing' is ignored.
-- 
-- If /@factor@/ is zero, spacing is applied as
-- before.
-- 
-- /Since: 1.44/
layoutSetLineSpacing ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Float
    -- ^ /@factor@/: the new line spacing factor
    -> m ()
layoutSetLineSpacing :: a -> Float -> m ()
layoutSetLineSpacing a
layout Float
factor = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let factor' :: CFloat
factor' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factor
    Ptr Layout -> CFloat -> IO ()
pango_layout_set_line_spacing Ptr Layout
layout' CFloat
factor'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetLineSpacingMethodInfo
instance (signature ~ (Float -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetLineSpacingMethodInfo a signature where
    overloadedMethod = layoutSetLineSpacing

#endif

-- method Layout::set_markup
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "markup"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "marked-up text" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "length of marked-up text in bytes, or -1 if @markup is\n         null-terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_markup" pango_layout_set_markup :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CString ->                              -- markup : TBasicType TUTF8
    Int32 ->                                -- length : TBasicType TInt
    IO ()

-- | Same as 'GI.Pango.Objects.Layout.layoutSetMarkupWithAccel', but
-- the markup text isn\'t scanned for accelerators.
layoutSetMarkup ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> T.Text
    -- ^ /@markup@/: marked-up text
    -> Int32
    -- ^ /@length@/: length of marked-up text in bytes, or -1 if /@markup@/ is
    --          null-terminated
    -> m ()
layoutSetMarkup :: a -> Text -> Int32 -> m ()
layoutSetMarkup a
layout Text
markup Int32
length_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CString
markup' <- Text -> IO CString
textToCString Text
markup
    Ptr Layout -> CString -> Int32 -> IO ()
pango_layout_set_markup Ptr Layout
layout' CString
markup' Int32
length_
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
markup'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetMarkupMethodInfo
instance (signature ~ (T.Text -> Int32 -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetMarkupMethodInfo a signature where
    overloadedMethod = layoutSetMarkup

#endif

-- XXX Could not generate method Layout::set_markup_with_accel
-- Not implemented: Don't know how to allocate "accel_char" of type TBasicType TUniChar
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data LayoutSetMarkupWithAccelMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "setMarkupWithAccel" Layout) => O.MethodInfo LayoutSetMarkupWithAccelMethodInfo o p where
    overloadedMethod = undefined
#endif

-- method Layout::set_single_paragraph_mode
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "setting"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "new setting" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_single_paragraph_mode" pango_layout_set_single_paragraph_mode :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CInt ->                                 -- setting : TBasicType TBoolean
    IO ()

-- | If /@setting@/ is 'P.True', do not treat newlines and similar characters
-- as paragraph separators; instead, keep all text in a single paragraph,
-- and display a glyph for paragraph separator characters. Used when
-- you want to allow editing of newlines on a single text line.
layoutSetSingleParagraphMode ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Bool
    -- ^ /@setting@/: new setting
    -> m ()
layoutSetSingleParagraphMode :: a -> Bool -> m ()
layoutSetSingleParagraphMode a
layout Bool
setting = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let setting' :: CInt
setting' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
setting
    Ptr Layout -> CInt -> IO ()
pango_layout_set_single_paragraph_mode Ptr Layout
layout' CInt
setting'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetSingleParagraphModeMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetSingleParagraphModeMethodInfo a signature where
    overloadedMethod = layoutSetSingleParagraphMode

#endif

-- method Layout::set_spacing
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "spacing"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the amount of spacing"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_spacing" pango_layout_set_spacing :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- spacing : TBasicType TInt
    IO ()

-- | Sets the amount of spacing in Pango unit between
-- the lines of the layout. When placing lines with
-- spacing, Pango arranges things so that
-- 
-- line2.top = line1.bottom + spacing
-- 
-- Note: Since 1.44, Pango defaults to using the
-- line height (as determined by the font) for placing
-- lines. The /@spacing@/ set with this function is only
-- taken into account when the line-height factor is
-- set to zero with 'GI.Pango.Objects.Layout.layoutSetLineSpacing'.
layoutSetSpacing ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'.
    -> Int32
    -- ^ /@spacing@/: the amount of spacing
    -> m ()
layoutSetSpacing :: a -> Int32 -> m ()
layoutSetSpacing a
layout Int32
spacing = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Layout -> Int32 -> IO ()
pango_layout_set_spacing Ptr Layout
layout' Int32
spacing
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetSpacingMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetSpacingMethodInfo a signature where
    overloadedMethod = layoutSetSpacing

#endif

-- method Layout::set_tabs
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tabs"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "TabArray" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoTabArray, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_tabs" pango_layout_set_tabs :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Ptr Pango.TabArray.TabArray ->          -- tabs : TInterface (Name {namespace = "Pango", name = "TabArray"})
    IO ()

-- | Sets the tabs to use for /@layout@/, overriding the default tabs
-- (by default, tabs are every 8 spaces). If /@tabs@/ is 'P.Nothing', the default
-- tabs are reinstated. /@tabs@/ is copied into the layout; you must
-- free your copy of /@tabs@/ yourself.
layoutSetTabs ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Maybe (Pango.TabArray.TabArray)
    -- ^ /@tabs@/: a t'GI.Pango.Structs.TabArray.TabArray', or 'P.Nothing'
    -> m ()
layoutSetTabs :: a -> Maybe TabArray -> m ()
layoutSetTabs a
layout Maybe TabArray
tabs = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr TabArray
maybeTabs <- case Maybe TabArray
tabs of
        Maybe TabArray
Nothing -> Ptr TabArray -> IO (Ptr TabArray)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TabArray
forall a. Ptr a
nullPtr
        Just TabArray
jTabs -> do
            Ptr TabArray
jTabs' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
jTabs
            Ptr TabArray -> IO (Ptr TabArray)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TabArray
jTabs'
    Ptr Layout -> Ptr TabArray -> IO ()
pango_layout_set_tabs Ptr Layout
layout' Ptr TabArray
maybeTabs
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Maybe TabArray -> (TabArray -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TabArray
tabs TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetTabsMethodInfo
instance (signature ~ (Maybe (Pango.TabArray.TabArray) -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetTabsMethodInfo a signature where
    overloadedMethod = layoutSetTabs

#endif

-- method Layout::set_text
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the text" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "maximum length of @text, in bytes. -1 indicates that\n         the string is nul-terminated and the length should be\n         calculated.  The text will also be truncated on\n         encountering a nul-termination even when @length is\n         positive."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_text" pango_layout_set_text :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CString ->                              -- text : TBasicType TUTF8
    Int32 ->                                -- length : TBasicType TInt
    IO ()

-- | Sets the text of the layout.
-- 
-- This function validates /@text@/ and renders invalid UTF-8
-- with a placeholder glyph.
-- 
-- Note that if you have used 'GI.Pango.Objects.Layout.layoutSetMarkup' or
-- 'GI.Pango.Objects.Layout.layoutSetMarkupWithAccel' on /@layout@/ before, you may
-- want to call 'GI.Pango.Objects.Layout.layoutSetAttributes' to clear the attributes
-- set on the layout from the markup as this function does not clear
-- attributes.
layoutSetText ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> T.Text
    -- ^ /@text@/: the text
    -> Int32
    -- ^ /@length@/: maximum length of /@text@/, in bytes. -1 indicates that
    --          the string is nul-terminated and the length should be
    --          calculated.  The text will also be truncated on
    --          encountering a nul-termination even when /@length@/ is
    --          positive.
    -> m ()
layoutSetText :: a -> Text -> Int32 -> m ()
layoutSetText a
layout Text
text Int32
length_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    CString
text' <- Text -> IO CString
textToCString Text
text
    Ptr Layout -> CString -> Int32 -> IO ()
pango_layout_set_text Ptr Layout
layout' CString
text' Int32
length_
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetTextMethodInfo
instance (signature ~ (T.Text -> Int32 -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetTextMethodInfo a signature where
    overloadedMethod = layoutSetText

#endif

-- method Layout::set_width
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the desired width in Pango units, or -1 to indicate that no\n        wrapping or ellipsization should be performed."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_width" pango_layout_set_width :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- width : TBasicType TInt
    IO ()

-- | Sets the width to which the lines of the t'GI.Pango.Objects.Layout.Layout' should wrap or
-- ellipsized.  The default value is -1: no width set.
layoutSetWidth ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'.
    -> Int32
    -- ^ /@width@/: the desired width in Pango units, or -1 to indicate that no
    --         wrapping or ellipsization should be performed.
    -> m ()
layoutSetWidth :: a -> Int32 -> m ()
layoutSetWidth a
layout Int32
width = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Layout -> Int32 -> IO ()
pango_layout_set_width Ptr Layout
layout' Int32
width
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetWidthMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetWidthMethodInfo a signature where
    overloadedMethod = layoutSetWidth

#endif

-- method Layout::set_wrap
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "wrap"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "WrapMode" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the wrap mode" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_set_wrap" pango_layout_set_wrap :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    CUInt ->                                -- wrap : TInterface (Name {namespace = "Pango", name = "WrapMode"})
    IO ()

-- | Sets the wrap mode; the wrap mode only has effect if a width
-- is set on the layout with 'GI.Pango.Objects.Layout.layoutSetWidth'.
-- To turn off wrapping, set the width to -1.
layoutSetWrap ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Pango.Enums.WrapMode
    -- ^ /@wrap@/: the wrap mode
    -> m ()
layoutSetWrap :: a -> WrapMode -> m ()
layoutSetWrap a
layout WrapMode
wrap = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    let wrap' :: CUInt
wrap' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (WrapMode -> Int) -> WrapMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WrapMode -> Int
forall a. Enum a => a -> Int
fromEnum) WrapMode
wrap
    Ptr Layout -> CUInt -> IO ()
pango_layout_set_wrap Ptr Layout
layout' CUInt
wrap'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LayoutSetWrapMethodInfo
instance (signature ~ (Pango.Enums.WrapMode -> m ()), MonadIO m, IsLayout a) => O.MethodInfo LayoutSetWrapMethodInfo a signature where
    overloadedMethod = layoutSetWrap

#endif

-- method Layout::xy_to_index
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayout" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the X offset (in Pango units)\n            from the left edge of the layout."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the Y offset (in Pango units)\n            from the top edge of the layout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index_"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store calculated byte index"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "trailing"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "location to store a integer indicating where\n            in the grapheme the user clicked. It will either\n            be zero, or the number of characters in the\n            grapheme. 0 represents the leading edge of the grapheme."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "pango_layout_xy_to_index" pango_layout_xy_to_index :: 
    Ptr Layout ->                           -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Ptr Int32 ->                            -- index_ : TBasicType TInt
    Ptr Int32 ->                            -- trailing : TBasicType TInt
    IO CInt

-- | Converts from X and Y position within a layout to the byte
-- index to the character at that logical position. If the
-- Y position is not inside the layout, the closest position is chosen
-- (the position will be clamped inside the layout). If the
-- X position is not within the layout, then the start or the
-- end of the line is chosen as described for 'GI.Pango.Structs.LayoutLine.layoutLineXToIndex'.
-- If either the X or Y positions were not inside the layout, then the
-- function returns 'P.False'; on an exact hit, it returns 'P.True'.
layoutXyToIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsLayout a) =>
    a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout'
    -> Int32
    -- ^ /@x@/: the X offset (in Pango units)
    --             from the left edge of the layout.
    -> Int32
    -- ^ /@y@/: the Y offset (in Pango units)
    --             from the top edge of the layout
    -> m ((Bool, Int32, Int32))
    -- ^ __Returns:__ 'P.True' if the coordinates were inside text, 'P.False' otherwise.
layoutXyToIndex :: a -> Int32 -> Int32 -> m (Bool, Int32, Int32)
layoutXyToIndex a
layout Int32
x Int32
y = IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
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
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Int32
index_ <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
trailing <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    CInt
result <- Ptr Layout -> Int32 -> Int32 -> Ptr Int32 -> Ptr Int32 -> IO CInt
pango_layout_xy_to_index Ptr Layout
layout' Int32
x Int32
y Ptr Int32
index_ Ptr Int32
trailing
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Int32
index_' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
index_
    Int32
trailing' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
trailing
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
index_
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
trailing
    (Bool, Int32, Int32) -> IO (Bool, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
index_', Int32
trailing')

#if defined(ENABLE_OVERLOADING)
data LayoutXyToIndexMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ((Bool, Int32, Int32))), MonadIO m, IsLayout a) => O.MethodInfo LayoutXyToIndexMethodInfo a signature where
    overloadedMethod = layoutXyToIndex

#endif