Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
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
Synopsis
- newtype DrawingContext = DrawingContext (ManagedPtr DrawingContext)
- class (GObject o, IsDescendantOf DrawingContext o) => IsDrawingContext o
- toDrawingContext :: (MonadIO m, IsDrawingContext o) => o -> m 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, MonadIO m) => Region -> m (GValueConstruct o)
- getDrawingContextClip :: (MonadIO m, IsDrawingContext o) => o -> m (Maybe Region)
- constructDrawingContextWindow :: (IsDrawingContext o, MonadIO m, IsWindow a) => a -> m (GValueConstruct o)
- getDrawingContextWindow :: (MonadIO m, IsDrawingContext o) => o -> m Window
Exported types
newtype DrawingContext Source #
Memory-managed wrapper type.
DrawingContext (ManagedPtr DrawingContext) |
Instances
Eq DrawingContext Source # | |
Defined in GI.Gdk.Objects.DrawingContext (==) :: DrawingContext -> DrawingContext -> Bool (/=) :: DrawingContext -> DrawingContext -> Bool | |
GObject DrawingContext Source # | |
Defined in GI.Gdk.Objects.DrawingContext | |
ManagedPtrNewtype DrawingContext Source # | |
Defined in GI.Gdk.Objects.DrawingContext toManagedPtr :: DrawingContext -> ManagedPtr DrawingContext | |
TypedObject DrawingContext Source # | |
Defined in GI.Gdk.Objects.DrawingContext glibType :: IO GType | |
IsGValue DrawingContext Source # | Convert |
Defined in GI.Gdk.Objects.DrawingContext toGValue :: DrawingContext -> IO GValue fromGValue :: GValue -> IO DrawingContext | |
HasParentTypes DrawingContext Source # | |
Defined in GI.Gdk.Objects.DrawingContext | |
type ParentTypes DrawingContext Source # | |
Defined in GI.Gdk.Objects.DrawingContext type ParentTypes DrawingContext = '[Object] |
class (GObject o, IsDescendantOf DrawingContext o) => IsDrawingContext o Source #
Type class for types which can be safely cast to DrawingContext
, for instance with toDrawingContext
.
Instances
(GObject o, IsDescendantOf DrawingContext o) => IsDrawingContext o Source # | |
Defined in GI.Gdk.Objects.DrawingContext |
toDrawingContext :: (MonadIO m, IsDrawingContext o) => o -> m DrawingContext Source #
Cast to DrawingContext
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
getCairoContext
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
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
drawingContextGetWindow Source #
:: (HasCallStack, MonadIO m, IsDrawingContext a) | |
=> a |
|
-> m Window | Returns: a |
Retrieves the window that created the drawing context
.
Since: 3.22
isValid
drawingContextIsValid Source #
:: (HasCallStack, MonadIO m, IsDrawingContext a) | |
=> a |
|
-> m Bool | Returns: |
Checks whether the given DrawingContext
is valid.
Since: 3.22
Properties
clip
The clip region applied to the drawing context.
Since: 3.22
constructDrawingContextClip :: (IsDrawingContext o, MonadIO m) => Region -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “clip
” property. This is rarely needed directly, but it is used by new
.
getDrawingContextClip :: (MonadIO m, IsDrawingContext o) => o -> m (Maybe Region) Source #
Get the value of the “clip
” property.
When overloading is enabled, this is equivalent to
get
drawingContext #clip
window
The Window
that created the drawing context.
Since: 3.22
constructDrawingContextWindow :: (IsDrawingContext o, MonadIO m, IsWindow a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “window
” property. This is rarely needed directly, but it is used by new
.
getDrawingContextWindow :: (MonadIO m, IsDrawingContext o) => o -> m Window Source #
Get the value of the “window
” property.
When overloading is enabled, this is equivalent to
get
drawingContext #window