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 |
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 :: IsDrawingContext o => o -> IO DrawingContext
- noDrawingContext :: Maybe DrawingContext
- data DrawingContextGetCairoContextMethodInfo
- drawingContextGetCairoContext :: (HasCallStack, MonadIO m, IsDrawingContext a) => a -> m Context
- data DrawingContextGetClipMethodInfo
- drawingContextGetClip :: (HasCallStack, MonadIO m, IsDrawingContext a) => a -> m (Maybe Region)
- data DrawingContextGetWindowMethodInfo
- drawingContextGetWindow :: (HasCallStack, MonadIO m, IsDrawingContext a) => a -> m Window
- data DrawingContextIsValidMethodInfo
- drawingContextIsValid :: (HasCallStack, MonadIO m, IsDrawingContext a) => a -> m Bool
- data DrawingContextClipPropertyInfo
- constructDrawingContextClip :: IsDrawingContext o => Region -> IO (GValueConstruct o)
- drawingContextClip :: AttrLabelProxy "clip"
- getDrawingContextClip :: (MonadIO m, IsDrawingContext o) => o -> m (Maybe Region)
- data DrawingContextWindowPropertyInfo
- constructDrawingContextWindow :: (IsDrawingContext o, IsWindow a) => a -> IO (GValueConstruct o)
- drawingContextWindow :: AttrLabelProxy "window"
- getDrawingContextWindow :: (MonadIO m, IsDrawingContext o) => o -> m Window
Exported types
newtype DrawingContext Source #
GObject DrawingContext Source # | |
IsObject DrawingContext Source # | |
IsDrawingContext DrawingContext Source # | |
((~) * info (ResolveDrawingContextMethod t DrawingContext), MethodInfo * info DrawingContext p) => IsLabel t (DrawingContext -> p) Source # | |
((~) * info (ResolveDrawingContextMethod t DrawingContext), MethodInfo * info DrawingContext p) => IsLabelProxy t (DrawingContext -> p) Source # | |
HasAttributeList * DrawingContext Source # | |
type AttributeList DrawingContext Source # | |
type SignalList DrawingContext Source # | |
class GObject o => IsDrawingContext o Source #
toDrawingContext :: IsDrawingContext o => o -> IO DrawingContext Source #
Methods
getCairoContext
data DrawingContextGetCairoContextMethodInfo Source #
((~) * signature (m Context), MonadIO m, IsDrawingContext a) => MethodInfo * DrawingContextGetCairoContextMethodInfo a signature Source # | |
drawingContextGetCairoContext Source #
:: (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
data DrawingContextGetClipMethodInfo Source #
((~) * signature (m (Maybe Region)), MonadIO m, IsDrawingContext a) => MethodInfo * DrawingContextGetClipMethodInfo a signature Source # | |
drawingContextGetClip Source #
:: (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
data DrawingContextGetWindowMethodInfo Source #
((~) * signature (m Window), MonadIO m, IsDrawingContext a) => MethodInfo * DrawingContextGetWindowMethodInfo a signature Source # | |
drawingContextGetWindow Source #
:: (HasCallStack, MonadIO m, IsDrawingContext a) | |
=> a |
|
-> m Window | Returns: a |
Retrieves the window that created the drawing context
.
Since: 3.22
isValid
data DrawingContextIsValidMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsDrawingContext a) => MethodInfo * DrawingContextIsValidMethodInfo a signature Source # | |
drawingContextIsValid Source #
:: (HasCallStack, MonadIO m, IsDrawingContext a) | |
=> a |
|
-> m Bool | Returns: |
Checks whether the given DrawingContext
is valid.
Since: 3.22
Properties
clip
data DrawingContextClipPropertyInfo Source #
constructDrawingContextClip :: IsDrawingContext o => Region -> IO (GValueConstruct o) Source #
drawingContextClip :: AttrLabelProxy "clip" Source #
getDrawingContextClip :: (MonadIO m, IsDrawingContext o) => o -> m (Maybe Region) Source #
window
data DrawingContextWindowPropertyInfo Source #
constructDrawingContextWindow :: (IsDrawingContext o, IsWindow a) => a -> IO (GValueConstruct o) Source #
drawingContextWindow :: AttrLabelProxy "window" Source #
getDrawingContextWindow :: (MonadIO m, IsDrawingContext o) => o -> m Window Source #