-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

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

module GI.PangoCairo.Functions
    ( 

 -- * Methods


-- ** contextGetFontOptions #method:contextGetFontOptions#

    contextGetFontOptions                   ,


-- ** contextGetResolution #method:contextGetResolution#

    contextGetResolution                    ,


-- ** contextSetFontOptions #method:contextSetFontOptions#

    contextSetFontOptions                   ,


-- ** contextSetResolution #method:contextSetResolution#

    contextSetResolution                    ,


-- ** contextSetShapeRenderer #method:contextSetShapeRenderer#

    contextSetShapeRenderer                 ,


-- ** createContext #method:createContext#

    createContext                           ,


-- ** createLayout #method:createLayout#

    createLayout                            ,


-- ** errorUnderlinePath #method:errorUnderlinePath#

    errorUnderlinePath                      ,


-- ** glyphStringPath #method:glyphStringPath#

    glyphStringPath                         ,


-- ** layoutLinePath #method:layoutLinePath#

    layoutLinePath                          ,


-- ** layoutPath #method:layoutPath#

    layoutPath                              ,


-- ** showErrorUnderline #method:showErrorUnderline#

    showErrorUnderline                      ,


-- ** showGlyphItem #method:showGlyphItem#

    showGlyphItem                           ,


-- ** showGlyphString #method:showGlyphString#

    showGlyphString                         ,


-- ** showLayout #method:showLayout#

    showLayout                              ,


-- ** showLayoutLine #method:showLayoutLine#

    showLayoutLine                          ,


-- ** updateContext #method:updateContext#

    updateContext                           ,


-- ** updateLayout #method:updateLayout#

    updateLayout                            ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.FontOptions as Cairo.FontOptions
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.Pango.Objects.Context as Pango.Context
import qualified GI.Pango.Objects.Font as Pango.Font
import qualified GI.Pango.Objects.Layout as Pango.Layout
import qualified GI.Pango.Structs.GlyphItem as Pango.GlyphItem
import qualified GI.Pango.Structs.GlyphString as Pango.GlyphString
import qualified GI.Pango.Structs.LayoutLine as Pango.LayoutLine
import qualified GI.PangoCairo.Callbacks as PangoCairo.Callbacks

-- function update_layout
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #PangoLayout, from pango_cairo_create_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_cairo_update_layout" pango_cairo_update_layout :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Pango.Layout.Layout ->              -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO ()

-- | Updates the private t'GI.Pango.Objects.Context.Context' of a t'GI.Pango.Objects.Layout.Layout' created with
-- 'GI.PangoCairo.Functions.createLayout' to match the current transformation
-- and target surface of a Cairo context.
-- 
-- /Since: 1.10/
updateLayout ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Layout.IsLayout a) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> a
    -- ^ /@layout@/: a t'GI.Pango.Objects.Layout.Layout', from 'GI.PangoCairo.Functions.createLayout'
    -> m ()
updateLayout :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLayout a) =>
Context -> a -> m ()
updateLayout Context
cr 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Context -> Ptr Layout -> IO ()
pango_cairo_update_layout Ptr Context
cr' Ptr Layout
layout'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function update_context
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoContext, from a pangocairo font map"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_update_context" pango_cairo_update_context :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Pango.Context.Context ->            -- context : TInterface (Name {namespace = "Pango", name = "Context"})
    IO ()

-- | Updates a t'GI.Pango.Objects.Context.Context' previously created for use with Cairo to
-- match the current transformation and target surface of a Cairo
-- context. If any layouts have been created for the context,
-- it\'s necessary to call 'GI.Pango.Objects.Layout.layoutContextChanged' on those
-- layouts.
-- 
-- /Since: 1.10/
updateContext ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Context.IsContext a) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> a
    -- ^ /@context@/: a t'GI.Pango.Objects.Context.Context', from a pangocairo font map
    -> m ()
updateContext :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
Context -> a -> m ()
updateContext Context
cr a
context = 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Context
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context -> Ptr Context -> IO ()
pango_cairo_update_context Ptr Context
cr' Ptr Context
context'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function show_layout_line
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "LayoutLine" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayoutLine" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_show_layout_line" pango_cairo_show_layout_line :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Pango.LayoutLine.LayoutLine ->      -- line : TInterface (Name {namespace = "Pango", name = "LayoutLine"})
    IO ()

-- | Draws a t'GI.Pango.Structs.LayoutLine.LayoutLine' in the specified cairo context.
-- The origin of the glyphs (the left edge of the line) will
-- be drawn at the current point of the cairo context.
-- 
-- /Since: 1.10/
showLayoutLine ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> Pango.LayoutLine.LayoutLine
    -- ^ /@line@/: a t'GI.Pango.Structs.LayoutLine.LayoutLine'
    -> m ()
showLayoutLine :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Context -> LayoutLine -> m ()
showLayoutLine Context
cr LayoutLine
line = 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr LayoutLine
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
    Ptr Context -> Ptr LayoutLine -> IO ()
pango_cairo_show_layout_line Ptr Context
cr' Ptr LayoutLine
line'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    LayoutLine -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LayoutLine
line
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function show_layout
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Pango 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_cairo_show_layout" pango_cairo_show_layout :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Pango.Layout.Layout ->              -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO ()

-- | Draws a t'GI.Pango.Objects.Layout.Layout' in the specified cairo context.
-- The top-left corner of the t'GI.Pango.Objects.Layout.Layout' will be drawn
-- at the current point of the cairo context.
-- 
-- /Since: 1.10/
showLayout ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Layout.IsLayout a) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> a
    -- ^ /@layout@/: a Pango layout
    -> m ()
showLayout :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLayout a) =>
Context -> a -> m ()
showLayout Context
cr 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Context -> Ptr Layout -> IO ()
pango_cairo_show_layout Ptr Context
cr' Ptr Layout
layout'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function show_glyph_string
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font"
--           , argType = TInterface Name { namespace = "Pango" , name = "Font" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoFont from a #PangoCairoFontMap"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyphs"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "GlyphString" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoGlyphString"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_show_glyph_string" pango_cairo_show_glyph_string :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Pango.Font.Font ->                  -- font : TInterface (Name {namespace = "Pango", name = "Font"})
    Ptr Pango.GlyphString.GlyphString ->    -- glyphs : TInterface (Name {namespace = "Pango", name = "GlyphString"})
    IO ()

-- | Draws the glyphs in /@glyphs@/ in the specified cairo context.
-- The origin of the glyphs (the left edge of the baseline) will
-- be drawn at the current point of the cairo context.
-- 
-- /Since: 1.10/
showGlyphString ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Font.IsFont a) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> a
    -- ^ /@font@/: a t'GI.Pango.Objects.Font.Font' from a t'GI.PangoCairo.Interfaces.FontMap.FontMap'
    -> Pango.GlyphString.GlyphString
    -- ^ /@glyphs@/: a t'GI.Pango.Structs.GlyphString.GlyphString'
    -> m ()
showGlyphString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFont a) =>
Context -> a -> GlyphString -> m ()
showGlyphString Context
cr a
font GlyphString
glyphs = 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Font
font' <- a -> IO (Ptr Font)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
font
    Ptr GlyphString
glyphs' <- GlyphString -> IO (Ptr GlyphString)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphString
glyphs
    Ptr Context -> Ptr Font -> Ptr GlyphString -> IO ()
pango_cairo_show_glyph_string Ptr Context
cr' Ptr Font
font' Ptr GlyphString
glyphs'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
font
    GlyphString -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphString
glyphs
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function show_glyph_item
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , 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 UTF-8 text that @glyph_item refers to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph_item"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "GlyphItem" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoGlyphItem" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_show_glyph_item" pango_cairo_show_glyph_item :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CString ->                              -- text : TBasicType TUTF8
    Ptr Pango.GlyphItem.GlyphItem ->        -- glyph_item : TInterface (Name {namespace = "Pango", name = "GlyphItem"})
    IO ()

-- | Draws the glyphs in /@glyphItem@/ in the specified cairo context,
-- embedding the text associated with the glyphs in the output if the
-- output format supports it (PDF for example), otherwise it acts
-- similar to 'GI.PangoCairo.Functions.showGlyphString'.
-- 
-- The origin of the glyphs (the left edge of the baseline) will
-- be drawn at the current point of the cairo context.
-- 
-- Note that /@text@/ is the start of the text for layout, which is then
-- indexed by \<literal>/@glyphItem@/->item->offset\<\/literal>.
-- 
-- /Since: 1.22/
showGlyphItem ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> T.Text
    -- ^ /@text@/: the UTF-8 text that /@glyphItem@/ refers to
    -> Pango.GlyphItem.GlyphItem
    -- ^ /@glyphItem@/: a t'GI.Pango.Structs.GlyphItem.GlyphItem'
    -> m ()
showGlyphItem :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Context -> Text -> GlyphItem -> m ()
showGlyphItem Context
cr Text
text GlyphItem
glyphItem = 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    CString
text' <- Text -> IO CString
textToCString Text
text
    Ptr GlyphItem
glyphItem' <- GlyphItem -> IO (Ptr GlyphItem)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphItem
glyphItem
    Ptr Context -> CString -> Ptr GlyphItem -> IO ()
pango_cairo_show_glyph_item Ptr Context
cr' CString
text' Ptr GlyphItem
glyphItem'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    GlyphItem -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphItem
glyphItem
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function show_error_underline
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The X coordinate of one corner of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The Y coordinate of one corner of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Non-negative width of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Non-negative height of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_show_error_underline" pango_cairo_show_error_underline :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Draw a squiggly line in the specified cairo context that approximately
-- covers the given rectangle in the style of an underline used to indicate a
-- spelling error.  (The width of the underline is rounded to an integer
-- number of up\/down segments and the resulting rectangle is centered in the
-- original rectangle)
-- 
-- /Since: 1.14/
showErrorUnderline ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> Double
    -- ^ /@x@/: The X coordinate of one corner of the rectangle
    -> Double
    -- ^ /@y@/: The Y coordinate of one corner of the rectangle
    -> Double
    -- ^ /@width@/: Non-negative width of the rectangle
    -> Double
    -- ^ /@height@/: Non-negative height of the rectangle
    -> m ()
showErrorUnderline :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Context -> Double -> Double -> Double -> Double -> m ()
showErrorUnderline Context
cr Double
x Double
y Double
width Double
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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
pango_cairo_show_error_underline Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function layout_path
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Pango 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_cairo_layout_path" pango_cairo_layout_path :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Pango.Layout.Layout ->              -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO ()

-- | Adds the text in a t'GI.Pango.Objects.Layout.Layout' to the current path in the
-- specified cairo context.  The top-left corner of the t'GI.Pango.Objects.Layout.Layout'
-- will be at the current point of the cairo context.
-- 
-- /Since: 1.10/
layoutPath ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Layout.IsLayout a) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> a
    -- ^ /@layout@/: a Pango layout
    -> m ()
layoutPath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLayout a) =>
Context -> a -> m ()
layoutPath Context
cr 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Layout
layout' <- a -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layout
    Ptr Context -> Ptr Layout -> IO ()
pango_cairo_layout_path Ptr Context
cr' Ptr Layout
layout'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function layout_line_path
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "LayoutLine" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoLayoutLine" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_layout_line_path" pango_cairo_layout_line_path :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Pango.LayoutLine.LayoutLine ->      -- line : TInterface (Name {namespace = "Pango", name = "LayoutLine"})
    IO ()

-- | Adds the text in t'GI.Pango.Structs.LayoutLine.LayoutLine' to the current path in the
-- specified cairo context.  The origin of the glyphs (the left edge
-- of the line) will be at the current point of the cairo context.
-- 
-- /Since: 1.10/
layoutLinePath ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> Pango.LayoutLine.LayoutLine
    -- ^ /@line@/: a t'GI.Pango.Structs.LayoutLine.LayoutLine'
    -> m ()
layoutLinePath :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Context -> LayoutLine -> m ()
layoutLinePath Context
cr LayoutLine
line = 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr LayoutLine
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
    Ptr Context -> Ptr LayoutLine -> IO ()
pango_cairo_layout_line_path Ptr Context
cr' Ptr LayoutLine
line'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    LayoutLine -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LayoutLine
line
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function glyph_string_path
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font"
--           , argType = TInterface Name { namespace = "Pango" , name = "Font" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoFont from a #PangoCairoFontMap"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyphs"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "GlyphString" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoGlyphString"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_glyph_string_path" pango_cairo_glyph_string_path :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Pango.Font.Font ->                  -- font : TInterface (Name {namespace = "Pango", name = "Font"})
    Ptr Pango.GlyphString.GlyphString ->    -- glyphs : TInterface (Name {namespace = "Pango", name = "GlyphString"})
    IO ()

-- | Adds the glyphs in /@glyphs@/ to the current path in the specified
-- cairo context. The origin of the glyphs (the left edge of the baseline)
-- will be at the current point of the cairo context.
-- 
-- /Since: 1.10/
glyphStringPath ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Font.IsFont a) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> a
    -- ^ /@font@/: a t'GI.Pango.Objects.Font.Font' from a t'GI.PangoCairo.Interfaces.FontMap.FontMap'
    -> Pango.GlyphString.GlyphString
    -- ^ /@glyphs@/: a t'GI.Pango.Structs.GlyphString.GlyphString'
    -> m ()
glyphStringPath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFont a) =>
Context -> a -> GlyphString -> m ()
glyphStringPath Context
cr a
font GlyphString
glyphs = 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Font
font' <- a -> IO (Ptr Font)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
font
    Ptr GlyphString
glyphs' <- GlyphString -> IO (Ptr GlyphString)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphString
glyphs
    Ptr Context -> Ptr Font -> Ptr GlyphString -> IO ()
pango_cairo_glyph_string_path Ptr Context
cr' Ptr Font
font' Ptr GlyphString
glyphs'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
font
    GlyphString -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphString
glyphs
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function error_underline_path
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The X coordinate of one corner of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The Y coordinate of one corner of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Non-negative width of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Non-negative height of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_error_underline_path" pango_cairo_error_underline_path :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Add a squiggly line to the current path in the specified cairo context that
-- approximately covers the given rectangle in the style of an underline used
-- to indicate a spelling error.  (The width of the underline is rounded to an
-- integer number of up\/down segments and the resulting rectangle is centered
-- in the original rectangle)
-- 
-- /Since: 1.14/
errorUnderlinePath ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> Double
    -- ^ /@x@/: The X coordinate of one corner of the rectangle
    -> Double
    -- ^ /@y@/: The Y coordinate of one corner of the rectangle
    -> Double
    -- ^ /@width@/: Non-negative width of the rectangle
    -> Double
    -- ^ /@height@/: Non-negative height of the rectangle
    -> m ()
errorUnderlinePath :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Context -> Double -> Double -> Double -> Double -> m ()
errorUnderlinePath Context
cr Double
x Double
y Double
width Double
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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
pango_cairo_error_underline_path Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function create_layout
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , 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_cairo_create_layout" pango_cairo_create_layout :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    IO (Ptr Pango.Layout.Layout)

-- | Creates a layout object set up to match the current transformation
-- and target surface of the Cairo context.  This layout can then be
-- used for text measurement with functions like
-- 'GI.Pango.Objects.Layout.layoutGetSize' or drawing with functions like
-- 'GI.PangoCairo.Functions.showLayout'. If you change the transformation
-- or target surface for /@cr@/, you need to call 'GI.PangoCairo.Functions.updateLayout'
-- 
-- This function is the most convenient way to use Cairo with Pango,
-- however it is slightly inefficient since it creates a separate
-- t'GI.Pango.Objects.Context.Context' object for each layout. This might matter in an
-- application that was laying out large amounts of text.
-- 
-- /Since: 1.10/
createLayout ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> m Pango.Layout.Layout
    -- ^ __Returns:__ the newly created t'GI.Pango.Objects.Layout.Layout'. Free with
    --   'GI.GObject.Objects.Object.objectUnref'.
createLayout :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Context -> m Layout
createLayout Context
cr = 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
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Layout
result <- Ptr Context -> IO (Ptr Layout)
pango_cairo_create_layout Ptr Context
cr'
    Text -> Ptr Layout -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"createLayout" 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
Pango.Layout.Layout) Ptr Layout
result
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    Layout -> IO Layout
forall (m :: * -> *) a. Monad m => a -> m a
return Layout
result'


-- function create_context
-- Args: [ Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Cairo context" , 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_cairo_create_context" pango_cairo_create_context :: 
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    IO (Ptr Pango.Context.Context)

-- | Creates a context object set up to match the current transformation
-- and target surface of the Cairo context.  This context can then be
-- used to create a layout using 'GI.Pango.Objects.Layout.layoutNew'.
-- 
-- This function is a convenience function that creates a context using
-- the default font map, then updates it to /@cr@/.  If you just need to
-- create a layout for use with /@cr@/ and do not need to access t'GI.Pango.Objects.Context.Context'
-- directly, you can use 'GI.PangoCairo.Functions.createLayout' instead.
-- 
-- /Since: 1.22/
createContext ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Cairo.Context.Context
    -- ^ /@cr@/: a Cairo context
    -> m Pango.Context.Context
    -- ^ __Returns:__ the newly created t'GI.Pango.Objects.Context.Context'. Free with
    --   'GI.GObject.Objects.Object.objectUnref'.
createContext :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Context -> m Context
createContext Context
cr = 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 Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Context
result <- Ptr Context -> IO (Ptr Context)
pango_cairo_create_context Ptr Context
cr'
    Text -> Ptr Context -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"createContext" 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
wrapObject ManagedPtr Context -> Context
Pango.Context.Context) Ptr Context
result
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    Context -> IO Context
forall (m :: * -> *) a. Monad m => a -> m a
return Context
result'


-- function context_set_shape_renderer
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoContext, from a pangocairo font map"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "func"
--           , argType =
--               TInterface
--                 Name { namespace = "PangoCairo" , name = "ShapeRendererFunc" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Callback function for rendering attributes of\n       type %PANGO_ATTR_SHAPE, or %NULL to disable shape rendering."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = 2
--           , argDestroy = 3
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data that will be passed to @func."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dnotify"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DestroyNotify" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Callback that will be called when the\n          context is freed to release @data, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_context_set_shape_renderer" pango_cairo_context_set_shape_renderer :: 
    Ptr Pango.Context.Context ->            -- context : TInterface (Name {namespace = "Pango", name = "Context"})
    FunPtr PangoCairo.Callbacks.C_ShapeRendererFunc -> -- func : TInterface (Name {namespace = "PangoCairo", name = "ShapeRendererFunc"})
    Ptr () ->                               -- data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- dnotify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

-- | Sets callback function for context to use for rendering attributes
-- of type 'GI.Pango.Enums.AttrTypeShape'.  See t'GI.PangoCairo.Callbacks.ShapeRendererFunc' for
-- details.
-- 
-- /Since: 1.18/
contextSetShapeRenderer ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Context.IsContext a) =>
    a
    -- ^ /@context@/: a t'GI.Pango.Objects.Context.Context', from a pangocairo font map
    -> Maybe (PangoCairo.Callbacks.ShapeRendererFunc)
    -- ^ /@func@/: Callback function for rendering attributes of
    --        type 'GI.Pango.Enums.AttrTypeShape', or 'P.Nothing' to disable shape rendering.
    -> m ()
contextSetShapeRenderer :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Maybe ShapeRendererFunc -> m ()
contextSetShapeRenderer a
context Maybe ShapeRendererFunc
func = 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 Context
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    FunPtr C_ShapeRendererFunc
maybeFunc <- case Maybe ShapeRendererFunc
func of
        Maybe ShapeRendererFunc
Nothing -> FunPtr C_ShapeRendererFunc -> IO (FunPtr C_ShapeRendererFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_ShapeRendererFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just ShapeRendererFunc
jFunc -> do
            FunPtr C_ShapeRendererFunc
jFunc' <- C_ShapeRendererFunc -> IO (FunPtr C_ShapeRendererFunc)
PangoCairo.Callbacks.mk_ShapeRendererFunc (Maybe (Ptr (FunPtr C_ShapeRendererFunc))
-> ShapeRendererFunc_WithClosures -> C_ShapeRendererFunc
PangoCairo.Callbacks.wrap_ShapeRendererFunc Maybe (Ptr (FunPtr C_ShapeRendererFunc))
forall a. Maybe a
Nothing (ShapeRendererFunc -> ShapeRendererFunc_WithClosures
PangoCairo.Callbacks.drop_closures_ShapeRendererFunc ShapeRendererFunc
jFunc))
            FunPtr C_ShapeRendererFunc -> IO (FunPtr C_ShapeRendererFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_ShapeRendererFunc
jFunc'
    let data_ :: Ptr ()
data_ = FunPtr C_ShapeRendererFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_ShapeRendererFunc
maybeFunc
    let dnotify :: FunPtr (Ptr a -> IO ())
dnotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
    Ptr Context
-> FunPtr C_ShapeRendererFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO ()
pango_cairo_context_set_shape_renderer Ptr Context
context' FunPtr C_ShapeRendererFunc
maybeFunc Ptr ()
data_ FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
dnotify
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function context_set_resolution
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoContext, from a pangocairo font map"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dpi"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the resolution in \"dots per inch\". (Physical inches aren't actually\n  involved; the terminology is conventional.) A 0 or negative value\n  means to use the resolution from the font map."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_context_set_resolution" pango_cairo_context_set_resolution :: 
    Ptr Pango.Context.Context ->            -- context : TInterface (Name {namespace = "Pango", name = "Context"})
    CDouble ->                              -- dpi : TBasicType TDouble
    IO ()

-- | Sets the resolution for the context. This is a scale factor between
-- points specified in a t'GI.Pango.Structs.FontDescription.FontDescription' and Cairo units. The
-- default value is 96, meaning that a 10 point font will be 13
-- units high. (10 * 96. \/ 72. = 13.3).
-- 
-- /Since: 1.10/
contextSetResolution ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Context.IsContext a) =>
    a
    -- ^ /@context@/: a t'GI.Pango.Objects.Context.Context', from a pangocairo font map
    -> Double
    -- ^ /@dpi@/: the resolution in \"dots per inch\". (Physical inches aren\'t actually
    --   involved; the terminology is conventional.) A 0 or negative value
    --   means to use the resolution from the font map.
    -> m ()
contextSetResolution :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Double -> m ()
contextSetResolution a
context Double
dpi = 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 Context
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    let dpi' :: CDouble
dpi' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
dpi
    Ptr Context -> CDouble -> IO ()
pango_cairo_context_set_resolution Ptr Context
context' CDouble
dpi'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function context_set_font_options
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoContext, from a pangocairo font map"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "FontOptions" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #cairo_font_options_t, or %NULL to unset\n          any previously set options. A copy is made."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "pango_cairo_context_set_font_options" pango_cairo_context_set_font_options :: 
    Ptr Pango.Context.Context ->            -- context : TInterface (Name {namespace = "Pango", name = "Context"})
    Ptr Cairo.FontOptions.FontOptions ->    -- options : TInterface (Name {namespace = "cairo", name = "FontOptions"})
    IO ()

-- | Sets the font options used when rendering text with this context.
-- These options override any options that 'GI.PangoCairo.Functions.updateContext'
-- derives from the target surface.
-- 
-- /Since: 1.10/
contextSetFontOptions ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Context.IsContext a) =>
    a
    -- ^ /@context@/: a t'GI.Pango.Objects.Context.Context', from a pangocairo font map
    -> Maybe (Cairo.FontOptions.FontOptions)
    -- ^ /@options@/: a t'GI.Cairo.Structs.FontOptions.FontOptions', or 'P.Nothing' to unset
    --           any previously set options. A copy is made.
    -> m ()
contextSetFontOptions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> Maybe FontOptions -> m ()
contextSetFontOptions a
context Maybe FontOptions
options = 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 Context
context' <- a -> IO (Ptr Context)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr FontOptions
maybeOptions <- case Maybe FontOptions
options of
        Maybe FontOptions
Nothing -> Ptr FontOptions -> IO (Ptr FontOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontOptions
forall a. Ptr a
nullPtr
        Just FontOptions
jOptions -> do
            Ptr FontOptions
jOptions' <- FontOptions -> IO (Ptr FontOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontOptions
jOptions
            Ptr FontOptions -> IO (Ptr FontOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontOptions
jOptions'
    Ptr Context -> Ptr FontOptions -> IO ()
pango_cairo_context_set_font_options Ptr Context
context' Ptr FontOptions
maybeOptions
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Maybe FontOptions -> (FontOptions -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe FontOptions
options FontOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function context_get_resolution
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoContext, from a pangocairo font map"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TDouble)
-- throws : False
-- Skip return : False

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

-- | Gets the resolution for the context. See 'GI.PangoCairo.Functions.contextSetResolution'
-- 
-- /Since: 1.10/
contextGetResolution ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Context.IsContext a) =>
    a
    -- ^ /@context@/: a t'GI.Pango.Objects.Context.Context', from a pangocairo font map
    -> m Double
    -- ^ __Returns:__ the resolution in \"dots per inch\". A negative value will
    --  be returned if no resolution has previously been set.
contextGetResolution :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m Double
contextGetResolution a
context = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
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
    CDouble
result <- Ptr Context -> IO CDouble
pango_cairo_context_get_resolution Ptr Context
context'
    let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'


-- function context_get_font_options
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #PangoContext, from a pangocairo font map"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "cairo" , name = "FontOptions" })
-- throws : False
-- Skip return : False

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

-- | Retrieves any font rendering options previously set with
-- 'GI.PangoCairo.Functions.contextSetFontOptions'. This function does not report options
-- that are derived from the target surface by 'GI.PangoCairo.Functions.updateContext'
-- 
-- /Since: 1.10/
contextGetFontOptions ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Context.IsContext a) =>
    a
    -- ^ /@context@/: a t'GI.Pango.Objects.Context.Context', from a pangocairo font map
    -> m (Maybe Cairo.FontOptions.FontOptions)
    -- ^ __Returns:__ the font options previously set on the
    --   context, or 'P.Nothing' if no options have been set. This value is
    --   owned by the context and must not be modified or freed.
contextGetFontOptions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContext a) =>
a -> m (Maybe FontOptions)
contextGetFontOptions a
context = IO (Maybe FontOptions) -> m (Maybe FontOptions)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe FontOptions) -> m (Maybe FontOptions))
-> IO (Maybe FontOptions) -> m (Maybe FontOptions)
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 FontOptions
result <- Ptr Context -> IO (Ptr FontOptions)
pango_cairo_context_get_font_options Ptr Context
context'
    Maybe FontOptions
maybeResult <- Ptr FontOptions
-> (Ptr FontOptions -> IO FontOptions) -> IO (Maybe FontOptions)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr FontOptions
result ((Ptr FontOptions -> IO FontOptions) -> IO (Maybe FontOptions))
-> (Ptr FontOptions -> IO FontOptions) -> IO (Maybe FontOptions)
forall a b. (a -> b) -> a -> b
$ \Ptr FontOptions
result' -> do
        FontOptions
result'' <- ((ManagedPtr FontOptions -> FontOptions)
-> Ptr FontOptions -> IO FontOptions
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr FontOptions -> FontOptions
Cairo.FontOptions.FontOptions) Ptr FontOptions
result'
        FontOptions -> IO FontOptions
forall (m :: * -> *) a. Monad m => a -> m a
return FontOptions
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Maybe FontOptions -> IO (Maybe FontOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FontOptions
maybeResult