Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GI.Gdk.Objects.DrawingContext
Description
DrawingContext
is an object that represents the current drawing
state of a Window
.
It's possible to use a DrawingContext
to draw on a Window
via rendering API like Cairo or OpenGL.
A DrawingContext
can only be created by calling windowBeginDrawFrame
and will be valid until a call to windowEndDrawFrame
.
DrawingContext
is available since GDK 3.22
- newtype DrawingContext = DrawingContext (ManagedPtr DrawingContext)
- class GObject o => IsDrawingContext o
- toDrawingContext :: (MonadIO m, IsDrawingContext o) => o -> m DrawingContext
- noDrawingContext :: Maybe DrawingContext
- drawingContextGetCairoContext :: (HasCallStack, MonadIO m, IsDrawingContext a) => a -> m Context
- drawingContextGetClip :: (HasCallStack, MonadIO m, IsDrawingContext a) => a -> m (Maybe Region)
- drawingContextGetWindow :: (HasCallStack, MonadIO m, IsDrawingContext a) => a -> m Window
- drawingContextIsValid :: (HasCallStack, MonadIO m, IsDrawingContext a) => a -> m Bool
- constructDrawingContextClip :: IsDrawingContext o => Region -> IO (GValueConstruct o)
- getDrawingContextClip :: (MonadIO m, IsDrawingContext o) => o -> m (Maybe Region)
- constructDrawingContextWindow :: (IsDrawingContext o, IsWindow a) => a -> IO (GValueConstruct o)
- getDrawingContextWindow :: (MonadIO m, IsDrawingContext o) => o -> m Window
Exported types
newtype DrawingContext Source #
Constructors
DrawingContext (ManagedPtr DrawingContext) |
class GObject o => IsDrawingContext o Source #
Instances
toDrawingContext :: (MonadIO m, IsDrawingContext o) => o -> m DrawingContext Source #
Methods
getCairoContext
drawingContextGetCairoContext Source #
Arguments
:: (HasCallStack, MonadIO m, IsDrawingContext a) | |
=> a | |
-> m Context | Returns: a Cairo context to be used to draw
the contents of the |
Retrieves a Cairo context to be used to draw on the Window
that created the DrawingContext
.
The returned context is guaranteed to be valid as long as the
DrawingContext
is valid, that is between a call to
windowBeginDrawFrame
and windowEndDrawFrame
.
Since: 3.22
getClip
drawingContextGetClip Source #
Arguments
:: (HasCallStack, MonadIO m, IsDrawingContext a) | |
=> a |
|
-> m (Maybe Region) | Returns: a Cairo region |
Retrieves a copy of the clip region used when creating the context
.
Since: 3.22
getWindow
drawingContextGetWindow Source #
Arguments
:: (HasCallStack, MonadIO m, IsDrawingContext a) | |
=> a |
|
-> m Window | Returns: a |
Retrieves the window that created the drawing context
.
Since: 3.22
isValid
drawingContextIsValid Source #
Arguments
:: (HasCallStack, MonadIO m, IsDrawingContext a) | |
=> a |
|
-> m Bool | Returns: |
Checks whether the given DrawingContext
is valid.
Since: 3.22
Properties
clip
constructDrawingContextClip :: IsDrawingContext o => Region -> IO (GValueConstruct o) Source #
getDrawingContextClip :: (MonadIO m, IsDrawingContext o) => o -> m (Maybe Region) Source #
window
constructDrawingContextWindow :: (IsDrawingContext o, IsWindow a) => a -> IO (GValueConstruct o) Source #
getDrawingContextWindow :: (MonadIO m, IsDrawingContext o) => o -> m Window Source #