{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Pango.Objects.Renderer
(
Renderer(..) ,
IsRenderer ,
toRenderer ,
#if defined(ENABLE_OVERLOADING)
ResolveRendererMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RendererActivateMethodInfo ,
#endif
rendererActivate ,
#if defined(ENABLE_OVERLOADING)
RendererDeactivateMethodInfo ,
#endif
rendererDeactivate ,
#if defined(ENABLE_OVERLOADING)
RendererDrawErrorUnderlineMethodInfo ,
#endif
rendererDrawErrorUnderline ,
#if defined(ENABLE_OVERLOADING)
RendererDrawGlyphMethodInfo ,
#endif
rendererDrawGlyph ,
#if defined(ENABLE_OVERLOADING)
RendererDrawGlyphItemMethodInfo ,
#endif
rendererDrawGlyphItem ,
#if defined(ENABLE_OVERLOADING)
RendererDrawGlyphsMethodInfo ,
#endif
rendererDrawGlyphs ,
#if defined(ENABLE_OVERLOADING)
RendererDrawLayoutMethodInfo ,
#endif
rendererDrawLayout ,
#if defined(ENABLE_OVERLOADING)
RendererDrawLayoutLineMethodInfo ,
#endif
rendererDrawLayoutLine ,
#if defined(ENABLE_OVERLOADING)
RendererDrawRectangleMethodInfo ,
#endif
rendererDrawRectangle ,
#if defined(ENABLE_OVERLOADING)
RendererDrawTrapezoidMethodInfo ,
#endif
rendererDrawTrapezoid ,
#if defined(ENABLE_OVERLOADING)
RendererGetAlphaMethodInfo ,
#endif
rendererGetAlpha ,
#if defined(ENABLE_OVERLOADING)
RendererGetColorMethodInfo ,
#endif
rendererGetColor ,
#if defined(ENABLE_OVERLOADING)
RendererGetLayoutMethodInfo ,
#endif
rendererGetLayout ,
#if defined(ENABLE_OVERLOADING)
RendererGetLayoutLineMethodInfo ,
#endif
rendererGetLayoutLine ,
#if defined(ENABLE_OVERLOADING)
RendererGetMatrixMethodInfo ,
#endif
rendererGetMatrix ,
#if defined(ENABLE_OVERLOADING)
RendererPartChangedMethodInfo ,
#endif
rendererPartChanged ,
#if defined(ENABLE_OVERLOADING)
RendererSetAlphaMethodInfo ,
#endif
rendererSetAlpha ,
#if defined(ENABLE_OVERLOADING)
RendererSetColorMethodInfo ,
#endif
rendererSetColor ,
#if defined(ENABLE_OVERLOADING)
RendererSetMatrixMethodInfo ,
#endif
rendererSetMatrix ,
) 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.Coerce as Coerce
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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
import {-# SOURCE #-} qualified GI.Pango.Objects.Font as Pango.Font
import {-# SOURCE #-} qualified GI.Pango.Objects.Layout as Pango.Layout
import {-# SOURCE #-} qualified GI.Pango.Structs.Color as Pango.Color
import {-# SOURCE #-} qualified GI.Pango.Structs.GlyphItem as Pango.GlyphItem
import {-# SOURCE #-} qualified GI.Pango.Structs.GlyphString as Pango.GlyphString
import {-# SOURCE #-} qualified GI.Pango.Structs.LayoutLine as Pango.LayoutLine
import {-# SOURCE #-} qualified GI.Pango.Structs.Matrix as Pango.Matrix
newtype Renderer = Renderer (SP.ManagedPtr Renderer)
deriving (Renderer -> Renderer -> Bool
(Renderer -> Renderer -> Bool)
-> (Renderer -> Renderer -> Bool) -> Eq Renderer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Renderer -> Renderer -> Bool
$c/= :: Renderer -> Renderer -> Bool
== :: Renderer -> Renderer -> Bool
$c== :: Renderer -> Renderer -> Bool
Eq)
instance SP.ManagedPtrNewtype Renderer where
toManagedPtr :: Renderer -> ManagedPtr Renderer
toManagedPtr (Renderer ManagedPtr Renderer
p) = ManagedPtr Renderer
p
foreign import ccall "pango_renderer_get_type"
c_pango_renderer_get_type :: IO B.Types.GType
instance B.Types.TypedObject Renderer where
glibType :: IO GType
glibType = IO GType
c_pango_renderer_get_type
instance B.Types.GObject Renderer
class (SP.GObject o, O.IsDescendantOf Renderer o) => IsRenderer o
instance (SP.GObject o, O.IsDescendantOf Renderer o) => IsRenderer o
instance O.HasParentTypes Renderer
type instance O.ParentTypes Renderer = '[GObject.Object.Object]
toRenderer :: (MIO.MonadIO m, IsRenderer o) => o -> m Renderer
toRenderer :: forall (m :: * -> *) o.
(MonadIO m, IsRenderer o) =>
o -> m Renderer
toRenderer = IO Renderer -> m Renderer
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Renderer -> m Renderer)
-> (o -> IO Renderer) -> o -> m Renderer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Renderer -> Renderer) -> o -> IO Renderer
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Renderer -> Renderer
Renderer
instance B.GValue.IsGValue (Maybe Renderer) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_pango_renderer_get_type
gvalueSet_ :: Ptr GValue -> Maybe Renderer -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Renderer
P.Nothing = Ptr GValue -> Ptr Renderer -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Renderer
forall a. Ptr a
FP.nullPtr :: FP.Ptr Renderer)
gvalueSet_ Ptr GValue
gv (P.Just Renderer
obj) = Renderer -> (Ptr Renderer -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Renderer
obj (Ptr GValue -> Ptr Renderer -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Renderer)
gvalueGet_ Ptr GValue
gv = do
Ptr Renderer
ptr <- Ptr GValue -> IO (Ptr Renderer)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Renderer)
if Ptr Renderer
ptr Ptr Renderer -> Ptr Renderer -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Renderer
forall a. Ptr a
FP.nullPtr
then Renderer -> Maybe Renderer
forall a. a -> Maybe a
P.Just (Renderer -> Maybe Renderer) -> IO Renderer -> IO (Maybe Renderer)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Renderer -> Renderer) -> Ptr Renderer -> IO Renderer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Renderer -> Renderer
Renderer Ptr Renderer
ptr
else Maybe Renderer -> IO (Maybe Renderer)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Renderer
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveRendererMethod (t :: Symbol) (o :: *) :: * where
ResolveRendererMethod "activate" o = RendererActivateMethodInfo
ResolveRendererMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveRendererMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveRendererMethod "deactivate" o = RendererDeactivateMethodInfo
ResolveRendererMethod "drawErrorUnderline" o = RendererDrawErrorUnderlineMethodInfo
ResolveRendererMethod "drawGlyph" o = RendererDrawGlyphMethodInfo
ResolveRendererMethod "drawGlyphItem" o = RendererDrawGlyphItemMethodInfo
ResolveRendererMethod "drawGlyphs" o = RendererDrawGlyphsMethodInfo
ResolveRendererMethod "drawLayout" o = RendererDrawLayoutMethodInfo
ResolveRendererMethod "drawLayoutLine" o = RendererDrawLayoutLineMethodInfo
ResolveRendererMethod "drawRectangle" o = RendererDrawRectangleMethodInfo
ResolveRendererMethod "drawTrapezoid" o = RendererDrawTrapezoidMethodInfo
ResolveRendererMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveRendererMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveRendererMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveRendererMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveRendererMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveRendererMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveRendererMethod "partChanged" o = RendererPartChangedMethodInfo
ResolveRendererMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveRendererMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveRendererMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveRendererMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveRendererMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveRendererMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveRendererMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveRendererMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveRendererMethod "getAlpha" o = RendererGetAlphaMethodInfo
ResolveRendererMethod "getColor" o = RendererGetColorMethodInfo
ResolveRendererMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveRendererMethod "getLayout" o = RendererGetLayoutMethodInfo
ResolveRendererMethod "getLayoutLine" o = RendererGetLayoutLineMethodInfo
ResolveRendererMethod "getMatrix" o = RendererGetMatrixMethodInfo
ResolveRendererMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveRendererMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveRendererMethod "setAlpha" o = RendererSetAlphaMethodInfo
ResolveRendererMethod "setColor" o = RendererSetColorMethodInfo
ResolveRendererMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveRendererMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveRendererMethod "setMatrix" o = RendererSetMatrixMethodInfo
ResolveRendererMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveRendererMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRendererMethod t Renderer, O.OverloadedMethod info Renderer p) => OL.IsLabel t (Renderer -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveRendererMethod t Renderer, O.OverloadedMethod info Renderer p, R.HasField t Renderer p) => R.HasField t Renderer p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveRendererMethod t Renderer, O.OverloadedMethodInfo info Renderer) => OL.IsLabel t (O.MethodProxy info Renderer) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Renderer
type instance O.AttributeList Renderer = RendererAttributeList
type RendererAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Renderer = RendererSignalList
type RendererSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "pango_renderer_activate" pango_renderer_activate ::
Ptr Renderer ->
IO ()
rendererActivate ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> m ()
rendererActivate :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> m ()
rendererActivate a
renderer = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Renderer -> IO ()
pango_renderer_activate Ptr Renderer
renderer'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererActivateMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererActivateMethodInfo a signature where
overloadedMethod = rendererActivate
instance O.OverloadedMethodInfo RendererActivateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererActivate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererActivate"
})
#endif
foreign import ccall "pango_renderer_deactivate" pango_renderer_deactivate ::
Ptr Renderer ->
IO ()
rendererDeactivate ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> m ()
rendererDeactivate :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> m ()
rendererDeactivate a
renderer = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Renderer -> IO ()
pango_renderer_deactivate Ptr Renderer
renderer'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDeactivateMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererDeactivateMethodInfo a signature where
overloadedMethod = rendererDeactivate
instance O.OverloadedMethodInfo RendererDeactivateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDeactivate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDeactivate"
})
#endif
foreign import ccall "pango_renderer_draw_error_underline" pango_renderer_draw_error_underline ::
Ptr Renderer ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
IO ()
rendererDrawErrorUnderline ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Int32
-> Int32
-> Int32
-> Int32
-> m ()
rendererDrawErrorUnderline :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
rendererDrawErrorUnderline a
renderer Int32
x Int32
y Int32
width 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Renderer -> Int32 -> Int32 -> Int32 -> Int32 -> IO ()
pango_renderer_draw_error_underline Ptr Renderer
renderer' Int32
x Int32
y Int32
width Int32
height
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDrawErrorUnderlineMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererDrawErrorUnderlineMethodInfo a signature where
overloadedMethod = rendererDrawErrorUnderline
instance O.OverloadedMethodInfo RendererDrawErrorUnderlineMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDrawErrorUnderline",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDrawErrorUnderline"
})
#endif
foreign import ccall "pango_renderer_draw_glyph" pango_renderer_draw_glyph ::
Ptr Renderer ->
Ptr Pango.Font.Font ->
Word32 ->
CDouble ->
CDouble ->
IO ()
rendererDrawGlyph ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a, Pango.Font.IsFont b) =>
a
-> b
-> Word32
-> Double
-> Double
-> m ()
rendererDrawGlyph :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRenderer a, IsFont b) =>
a -> b -> Word32 -> Double -> Double -> m ()
rendererDrawGlyph a
renderer b
font Word32
glyph Double
x Double
y = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Font
font' <- b -> IO (Ptr Font)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
font
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
Ptr Renderer -> Ptr Font -> Word32 -> CDouble -> CDouble -> IO ()
pango_renderer_draw_glyph Ptr Renderer
renderer' Ptr Font
font' Word32
glyph CDouble
x' CDouble
y'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
font
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDrawGlyphMethodInfo
instance (signature ~ (b -> Word32 -> Double -> Double -> m ()), MonadIO m, IsRenderer a, Pango.Font.IsFont b) => O.OverloadedMethod RendererDrawGlyphMethodInfo a signature where
overloadedMethod = rendererDrawGlyph
instance O.OverloadedMethodInfo RendererDrawGlyphMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDrawGlyph",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDrawGlyph"
})
#endif
foreign import ccall "pango_renderer_draw_glyph_item" pango_renderer_draw_glyph_item ::
Ptr Renderer ->
CString ->
Ptr Pango.GlyphItem.GlyphItem ->
Int32 ->
Int32 ->
IO ()
rendererDrawGlyphItem ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Maybe (T.Text)
-> Pango.GlyphItem.GlyphItem
-> Int32
-> Int32
-> m ()
rendererDrawGlyphItem :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> Maybe Text -> GlyphItem -> Int32 -> Int32 -> m ()
rendererDrawGlyphItem a
renderer Maybe Text
text GlyphItem
glyphItem Int32
x Int32
y = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr CChar
maybeText <- case Maybe Text
text of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jText -> do
Ptr CChar
jText' <- Text -> IO (Ptr CChar)
textToCString Text
jText
Ptr CChar -> IO (Ptr CChar)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jText'
Ptr GlyphItem
glyphItem' <- GlyphItem -> IO (Ptr GlyphItem)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphItem
glyphItem
Ptr Renderer
-> Ptr CChar -> Ptr GlyphItem -> Int32 -> Int32 -> IO ()
pango_renderer_draw_glyph_item Ptr Renderer
renderer' Ptr CChar
maybeText Ptr GlyphItem
glyphItem' Int32
x Int32
y
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
GlyphItem -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphItem
glyphItem
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeText
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDrawGlyphItemMethodInfo
instance (signature ~ (Maybe (T.Text) -> Pango.GlyphItem.GlyphItem -> Int32 -> Int32 -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererDrawGlyphItemMethodInfo a signature where
overloadedMethod = rendererDrawGlyphItem
instance O.OverloadedMethodInfo RendererDrawGlyphItemMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDrawGlyphItem",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDrawGlyphItem"
})
#endif
foreign import ccall "pango_renderer_draw_glyphs" pango_renderer_draw_glyphs ::
Ptr Renderer ->
Ptr Pango.Font.Font ->
Ptr Pango.GlyphString.GlyphString ->
Int32 ->
Int32 ->
IO ()
rendererDrawGlyphs ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a, Pango.Font.IsFont b) =>
a
-> b
-> Pango.GlyphString.GlyphString
-> Int32
-> Int32
-> m ()
rendererDrawGlyphs :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRenderer a, IsFont b) =>
a -> b -> GlyphString -> Int32 -> Int32 -> m ()
rendererDrawGlyphs a
renderer b
font GlyphString
glyphs Int32
x Int32
y = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Font
font' <- b -> IO (Ptr Font)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
font
Ptr GlyphString
glyphs' <- GlyphString -> IO (Ptr GlyphString)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphString
glyphs
Ptr Renderer
-> Ptr Font -> Ptr GlyphString -> Int32 -> Int32 -> IO ()
pango_renderer_draw_glyphs Ptr Renderer
renderer' Ptr Font
font' Ptr GlyphString
glyphs' Int32
x Int32
y
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
font
GlyphString -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphString
glyphs
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDrawGlyphsMethodInfo
instance (signature ~ (b -> Pango.GlyphString.GlyphString -> Int32 -> Int32 -> m ()), MonadIO m, IsRenderer a, Pango.Font.IsFont b) => O.OverloadedMethod RendererDrawGlyphsMethodInfo a signature where
overloadedMethod = rendererDrawGlyphs
instance O.OverloadedMethodInfo RendererDrawGlyphsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDrawGlyphs",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDrawGlyphs"
})
#endif
foreign import ccall "pango_renderer_draw_layout" pango_renderer_draw_layout ::
Ptr Renderer ->
Ptr Pango.Layout.Layout ->
Int32 ->
Int32 ->
IO ()
rendererDrawLayout ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a, Pango.Layout.IsLayout b) =>
a
-> b
-> Int32
-> Int32
-> m ()
rendererDrawLayout :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRenderer a, IsLayout b) =>
a -> b -> Int32 -> Int32 -> m ()
rendererDrawLayout a
renderer b
layout Int32
x Int32
y = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Layout
layout' <- b -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
layout
Ptr Renderer -> Ptr Layout -> Int32 -> Int32 -> IO ()
pango_renderer_draw_layout Ptr Renderer
renderer' Ptr Layout
layout' Int32
x Int32
y
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
layout
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDrawLayoutMethodInfo
instance (signature ~ (b -> Int32 -> Int32 -> m ()), MonadIO m, IsRenderer a, Pango.Layout.IsLayout b) => O.OverloadedMethod RendererDrawLayoutMethodInfo a signature where
overloadedMethod = rendererDrawLayout
instance O.OverloadedMethodInfo RendererDrawLayoutMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDrawLayout",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDrawLayout"
})
#endif
foreign import ccall "pango_renderer_draw_layout_line" pango_renderer_draw_layout_line ::
Ptr Renderer ->
Ptr Pango.LayoutLine.LayoutLine ->
Int32 ->
Int32 ->
IO ()
rendererDrawLayoutLine ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Pango.LayoutLine.LayoutLine
-> Int32
-> Int32
-> m ()
rendererDrawLayoutLine :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> LayoutLine -> Int32 -> Int32 -> m ()
rendererDrawLayoutLine a
renderer LayoutLine
line Int32
x Int32
y = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr LayoutLine
line' <- LayoutLine -> IO (Ptr LayoutLine)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LayoutLine
line
Ptr Renderer -> Ptr LayoutLine -> Int32 -> Int32 -> IO ()
pango_renderer_draw_layout_line Ptr Renderer
renderer' Ptr LayoutLine
line' Int32
x Int32
y
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
LayoutLine -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LayoutLine
line
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDrawLayoutLineMethodInfo
instance (signature ~ (Pango.LayoutLine.LayoutLine -> Int32 -> Int32 -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererDrawLayoutLineMethodInfo a signature where
overloadedMethod = rendererDrawLayoutLine
instance O.OverloadedMethodInfo RendererDrawLayoutLineMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDrawLayoutLine",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDrawLayoutLine"
})
#endif
foreign import ccall "pango_renderer_draw_rectangle" pango_renderer_draw_rectangle ::
Ptr Renderer ->
CUInt ->
Int32 ->
Int32 ->
Int32 ->
Int32 ->
IO ()
rendererDrawRectangle ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Pango.Enums.RenderPart
-> Int32
-> Int32
-> Int32
-> Int32
-> m ()
rendererDrawRectangle :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> RenderPart -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
rendererDrawRectangle a
renderer RenderPart
part Int32
x Int32
y Int32
width 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
let part' :: CUInt
part' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RenderPart -> Int) -> RenderPart -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RenderPart -> Int
forall a. Enum a => a -> Int
fromEnum) RenderPart
part
Ptr Renderer -> CUInt -> Int32 -> Int32 -> Int32 -> Int32 -> IO ()
pango_renderer_draw_rectangle Ptr Renderer
renderer' CUInt
part' Int32
x Int32
y Int32
width Int32
height
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDrawRectangleMethodInfo
instance (signature ~ (Pango.Enums.RenderPart -> Int32 -> Int32 -> Int32 -> Int32 -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererDrawRectangleMethodInfo a signature where
overloadedMethod = rendererDrawRectangle
instance O.OverloadedMethodInfo RendererDrawRectangleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDrawRectangle",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDrawRectangle"
})
#endif
foreign import ccall "pango_renderer_draw_trapezoid" pango_renderer_draw_trapezoid ::
Ptr Renderer ->
CUInt ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
CDouble ->
IO ()
rendererDrawTrapezoid ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Pango.Enums.RenderPart
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> m ()
rendererDrawTrapezoid :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a
-> RenderPart
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> m ()
rendererDrawTrapezoid a
renderer RenderPart
part Double
y1_ Double
x11 Double
x21 Double
y2 Double
x12 Double
x22 = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
let part' :: CUInt
part' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RenderPart -> Int) -> RenderPart -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RenderPart -> Int
forall a. Enum a => a -> Int
fromEnum) RenderPart
part
let y1_' :: CDouble
y1_' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y1_
let x11' :: CDouble
x11' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x11
let x21' :: CDouble
x21' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x21
let y2' :: CDouble
y2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y2
let x12' :: CDouble
x12' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x12
let x22' :: CDouble
x22' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x22
Ptr Renderer
-> CUInt
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> CDouble
-> IO ()
pango_renderer_draw_trapezoid Ptr Renderer
renderer' CUInt
part' CDouble
y1_' CDouble
x11' CDouble
x21' CDouble
y2' CDouble
x12' CDouble
x22'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererDrawTrapezoidMethodInfo
instance (signature ~ (Pango.Enums.RenderPart -> Double -> Double -> Double -> Double -> Double -> Double -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererDrawTrapezoidMethodInfo a signature where
overloadedMethod = rendererDrawTrapezoid
instance O.OverloadedMethodInfo RendererDrawTrapezoidMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererDrawTrapezoid",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererDrawTrapezoid"
})
#endif
foreign import ccall "pango_renderer_get_alpha" pango_renderer_get_alpha ::
Ptr Renderer ->
CUInt ->
IO Word16
rendererGetAlpha ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Pango.Enums.RenderPart
-> m Word16
rendererGetAlpha :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> RenderPart -> m Word16
rendererGetAlpha a
renderer RenderPart
part = IO Word16 -> m Word16
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word16 -> m Word16) -> IO Word16 -> m Word16
forall a b. (a -> b) -> a -> b
$ do
Ptr Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
let part' :: CUInt
part' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RenderPart -> Int) -> RenderPart -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RenderPart -> Int
forall a. Enum a => a -> Int
fromEnum) RenderPart
part
Word16
result <- Ptr Renderer -> CUInt -> IO Word16
pango_renderer_get_alpha Ptr Renderer
renderer' CUInt
part'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
Word16 -> IO Word16
forall (m :: * -> *) a. Monad m => a -> m a
return Word16
result
#if defined(ENABLE_OVERLOADING)
data RendererGetAlphaMethodInfo
instance (signature ~ (Pango.Enums.RenderPart -> m Word16), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererGetAlphaMethodInfo a signature where
overloadedMethod = rendererGetAlpha
instance O.OverloadedMethodInfo RendererGetAlphaMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererGetAlpha",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererGetAlpha"
})
#endif
foreign import ccall "pango_renderer_get_color" pango_renderer_get_color ::
Ptr Renderer ->
CUInt ->
IO (Ptr Pango.Color.Color)
rendererGetColor ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Pango.Enums.RenderPart
-> m (Maybe Pango.Color.Color)
rendererGetColor :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> RenderPart -> m (Maybe Color)
rendererGetColor a
renderer RenderPart
part = IO (Maybe Color) -> m (Maybe Color)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Color) -> m (Maybe Color))
-> IO (Maybe Color) -> m (Maybe Color)
forall a b. (a -> b) -> a -> b
$ do
Ptr Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
let part' :: CUInt
part' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RenderPart -> Int) -> RenderPart -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RenderPart -> Int
forall a. Enum a => a -> Int
fromEnum) RenderPart
part
Ptr Color
result <- Ptr Renderer -> CUInt -> IO (Ptr Color)
pango_renderer_get_color Ptr Renderer
renderer' CUInt
part'
Maybe Color
maybeResult <- Ptr Color -> (Ptr Color -> IO Color) -> IO (Maybe Color)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Color
result ((Ptr Color -> IO Color) -> IO (Maybe Color))
-> (Ptr Color -> IO Color) -> IO (Maybe Color)
forall a b. (a -> b) -> a -> b
$ \Ptr Color
result' -> do
Color
result'' <- ((ManagedPtr Color -> Color) -> Ptr Color -> IO Color
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Color -> Color
Pango.Color.Color) Ptr Color
result'
Color -> IO Color
forall (m :: * -> *) a. Monad m => a -> m a
return Color
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
Maybe Color -> IO (Maybe Color)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Color
maybeResult
#if defined(ENABLE_OVERLOADING)
data RendererGetColorMethodInfo
instance (signature ~ (Pango.Enums.RenderPart -> m (Maybe Pango.Color.Color)), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererGetColorMethodInfo a signature where
overloadedMethod = rendererGetColor
instance O.OverloadedMethodInfo RendererGetColorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererGetColor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererGetColor"
})
#endif
foreign import ccall "pango_renderer_get_layout" pango_renderer_get_layout ::
Ptr Renderer ->
IO (Ptr Pango.Layout.Layout)
rendererGetLayout ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> m (Maybe Pango.Layout.Layout)
rendererGetLayout :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> m (Maybe Layout)
rendererGetLayout a
renderer = IO (Maybe Layout) -> m (Maybe Layout)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Layout) -> m (Maybe Layout))
-> IO (Maybe Layout) -> m (Maybe Layout)
forall a b. (a -> b) -> a -> b
$ do
Ptr Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Layout
result <- Ptr Renderer -> IO (Ptr Layout)
pango_renderer_get_layout Ptr Renderer
renderer'
Maybe Layout
maybeResult <- Ptr Layout -> (Ptr Layout -> IO Layout) -> IO (Maybe Layout)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Layout
result ((Ptr Layout -> IO Layout) -> IO (Maybe Layout))
-> (Ptr Layout -> IO Layout) -> IO (Maybe Layout)
forall a b. (a -> b) -> a -> b
$ \Ptr Layout
result' -> do
Layout
result'' <- ((ManagedPtr Layout -> Layout) -> Ptr Layout -> IO Layout
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Layout -> Layout
Pango.Layout.Layout) Ptr Layout
result'
Layout -> IO Layout
forall (m :: * -> *) a. Monad m => a -> m a
return Layout
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
Maybe Layout -> IO (Maybe Layout)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Layout
maybeResult
#if defined(ENABLE_OVERLOADING)
data RendererGetLayoutMethodInfo
instance (signature ~ (m (Maybe Pango.Layout.Layout)), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererGetLayoutMethodInfo a signature where
overloadedMethod = rendererGetLayout
instance O.OverloadedMethodInfo RendererGetLayoutMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererGetLayout",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererGetLayout"
})
#endif
foreign import ccall "pango_renderer_get_layout_line" pango_renderer_get_layout_line ::
Ptr Renderer ->
IO (Ptr Pango.LayoutLine.LayoutLine)
rendererGetLayoutLine ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> m (Maybe Pango.LayoutLine.LayoutLine)
rendererGetLayoutLine :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> m (Maybe LayoutLine)
rendererGetLayoutLine a
renderer = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr LayoutLine
result <- Ptr Renderer -> IO (Ptr LayoutLine)
pango_renderer_get_layout_line Ptr Renderer
renderer'
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
renderer
Maybe LayoutLine -> IO (Maybe LayoutLine)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe LayoutLine
maybeResult
#if defined(ENABLE_OVERLOADING)
data RendererGetLayoutLineMethodInfo
instance (signature ~ (m (Maybe Pango.LayoutLine.LayoutLine)), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererGetLayoutLineMethodInfo a signature where
overloadedMethod = rendererGetLayoutLine
instance O.OverloadedMethodInfo RendererGetLayoutLineMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererGetLayoutLine",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererGetLayoutLine"
})
#endif
foreign import ccall "pango_renderer_get_matrix" pango_renderer_get_matrix ::
Ptr Renderer ->
IO (Ptr Pango.Matrix.Matrix)
rendererGetMatrix ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> m (Maybe Pango.Matrix.Matrix)
rendererGetMatrix :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> m (Maybe Matrix)
rendererGetMatrix a
renderer = IO (Maybe Matrix) -> m (Maybe Matrix)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Matrix) -> m (Maybe Matrix))
-> IO (Maybe Matrix) -> m (Maybe Matrix)
forall a b. (a -> b) -> a -> b
$ do
Ptr Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Matrix
result <- Ptr Renderer -> IO (Ptr Matrix)
pango_renderer_get_matrix Ptr Renderer
renderer'
Maybe Matrix
maybeResult <- Ptr Matrix -> (Ptr Matrix -> IO Matrix) -> IO (Maybe Matrix)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Matrix
result ((Ptr Matrix -> IO Matrix) -> IO (Maybe Matrix))
-> (Ptr Matrix -> IO Matrix) -> IO (Maybe Matrix)
forall a b. (a -> b) -> a -> b
$ \Ptr Matrix
result' -> do
Matrix
result'' <- ((ManagedPtr Matrix -> Matrix) -> Ptr Matrix -> IO Matrix
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Matrix -> Matrix
Pango.Matrix.Matrix) Ptr Matrix
result'
Matrix -> IO Matrix
forall (m :: * -> *) a. Monad m => a -> m a
return Matrix
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
Maybe Matrix -> IO (Maybe Matrix)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Matrix
maybeResult
#if defined(ENABLE_OVERLOADING)
data RendererGetMatrixMethodInfo
instance (signature ~ (m (Maybe Pango.Matrix.Matrix)), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererGetMatrixMethodInfo a signature where
overloadedMethod = rendererGetMatrix
instance O.OverloadedMethodInfo RendererGetMatrixMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererGetMatrix",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererGetMatrix"
})
#endif
foreign import ccall "pango_renderer_part_changed" pango_renderer_part_changed ::
Ptr Renderer ->
CUInt ->
IO ()
rendererPartChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Pango.Enums.RenderPart
-> m ()
rendererPartChanged :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> RenderPart -> m ()
rendererPartChanged a
renderer RenderPart
part = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
let part' :: CUInt
part' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RenderPart -> Int) -> RenderPart -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RenderPart -> Int
forall a. Enum a => a -> Int
fromEnum) RenderPart
part
Ptr Renderer -> CUInt -> IO ()
pango_renderer_part_changed Ptr Renderer
renderer' CUInt
part'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererPartChangedMethodInfo
instance (signature ~ (Pango.Enums.RenderPart -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererPartChangedMethodInfo a signature where
overloadedMethod = rendererPartChanged
instance O.OverloadedMethodInfo RendererPartChangedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererPartChanged",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererPartChanged"
})
#endif
foreign import ccall "pango_renderer_set_alpha" pango_renderer_set_alpha ::
Ptr Renderer ->
CUInt ->
Word16 ->
IO ()
rendererSetAlpha ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Pango.Enums.RenderPart
-> Word16
-> m ()
rendererSetAlpha :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> RenderPart -> Word16 -> m ()
rendererSetAlpha a
renderer RenderPart
part Word16
alpha = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
let part' :: CUInt
part' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RenderPart -> Int) -> RenderPart -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RenderPart -> Int
forall a. Enum a => a -> Int
fromEnum) RenderPart
part
Ptr Renderer -> CUInt -> Word16 -> IO ()
pango_renderer_set_alpha Ptr Renderer
renderer' CUInt
part' Word16
alpha
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererSetAlphaMethodInfo
instance (signature ~ (Pango.Enums.RenderPart -> Word16 -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererSetAlphaMethodInfo a signature where
overloadedMethod = rendererSetAlpha
instance O.OverloadedMethodInfo RendererSetAlphaMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererSetAlpha",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererSetAlpha"
})
#endif
foreign import ccall "pango_renderer_set_color" pango_renderer_set_color ::
Ptr Renderer ->
CUInt ->
Ptr Pango.Color.Color ->
IO ()
rendererSetColor ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Pango.Enums.RenderPart
-> Maybe (Pango.Color.Color)
-> m ()
rendererSetColor :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> RenderPart -> Maybe Color -> m ()
rendererSetColor a
renderer RenderPart
part Maybe Color
color = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
let part' :: CUInt
part' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RenderPart -> Int) -> RenderPart -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RenderPart -> Int
forall a. Enum a => a -> Int
fromEnum) RenderPart
part
Ptr Color
maybeColor <- case Maybe Color
color of
Maybe Color
Nothing -> Ptr Color -> IO (Ptr Color)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Color
forall a. Ptr a
nullPtr
Just Color
jColor -> do
Ptr Color
jColor' <- Color -> IO (Ptr Color)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Color
jColor
Ptr Color -> IO (Ptr Color)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Color
jColor'
Ptr Renderer -> CUInt -> Ptr Color -> IO ()
pango_renderer_set_color Ptr Renderer
renderer' CUInt
part' Ptr Color
maybeColor
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
Maybe Color -> (Color -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Color
color Color -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererSetColorMethodInfo
instance (signature ~ (Pango.Enums.RenderPart -> Maybe (Pango.Color.Color) -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererSetColorMethodInfo a signature where
overloadedMethod = rendererSetColor
instance O.OverloadedMethodInfo RendererSetColorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererSetColor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererSetColor"
})
#endif
foreign import ccall "pango_renderer_set_matrix" pango_renderer_set_matrix ::
Ptr Renderer ->
Ptr Pango.Matrix.Matrix ->
IO ()
rendererSetMatrix ::
(B.CallStack.HasCallStack, MonadIO m, IsRenderer a) =>
a
-> Maybe (Pango.Matrix.Matrix)
-> m ()
rendererSetMatrix :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRenderer a) =>
a -> Maybe Matrix -> m ()
rendererSetMatrix a
renderer Maybe Matrix
matrix = 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 Renderer
renderer' <- a -> IO (Ptr Renderer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
renderer
Ptr Matrix
maybeMatrix <- case Maybe Matrix
matrix of
Maybe Matrix
Nothing -> Ptr Matrix -> IO (Ptr Matrix)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Matrix
forall a. Ptr a
nullPtr
Just Matrix
jMatrix -> do
Ptr Matrix
jMatrix' <- Matrix -> IO (Ptr Matrix)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Matrix
jMatrix
Ptr Matrix -> IO (Ptr Matrix)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Matrix
jMatrix'
Ptr Renderer -> Ptr Matrix -> IO ()
pango_renderer_set_matrix Ptr Renderer
renderer' Ptr Matrix
maybeMatrix
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
renderer
Maybe Matrix -> (Matrix -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Matrix
matrix Matrix -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RendererSetMatrixMethodInfo
instance (signature ~ (Maybe (Pango.Matrix.Matrix) -> m ()), MonadIO m, IsRenderer a) => O.OverloadedMethod RendererSetMatrixMethodInfo a signature where
overloadedMethod = rendererSetMatrix
instance O.OverloadedMethodInfo RendererSetMatrixMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Objects.Renderer.rendererSetMatrix",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Objects-Renderer.html#v:rendererSetMatrix"
})
#endif