gdk.drawing_context

Module for [DrawingContext] class

Types 3

#GdkDrawingContext is an object that represents the current drawing state of a #GdkWindow.

It's possible to use a #GdkDrawingContext to draw on a #GdkWindow via rendering API like Cairo or OpenGL.

A #GdkDrawingContext can only be created by calling [gdk.window.Window.beginDrawFrame] and will be valid until a call to [gdk.window.Window.endDrawFrame].

#GdkDrawingContext is available since GDK 3.22

Methods
GType _gType() @property
DrawingContext self()Returns `this`, for use in `with` statements.
DrawingContextGidBuilder builder()Get builder for [gdk.drawing_context.DrawingContext] Returns: New builder object
cairo.region.Region clip() @propertyGet `clip` property. Returns: The clip region applied to the drawing context.
gdk.window.Window window() @propertyGet `window` property. Returns: The #GdkWindow that created the drawing context.
cairo.context.Context getCairoContext()Retrieves a Cairo context to be used to draw on the #GdkWindow that created the #GdkDrawingContext.
cairo.region.Region getClip()Retrieves a copy of the clip region used when creating the context. Returns: a Cairo region
gdk.window.Window getWindow()Retrieves the window that created the drawing context. Returns: a #GdkWindow
bool isValid()Checks whether the given #GdkDrawingContext is valid. Returns: true if the context is valid
Constructors
this(void * ptr, Flag!"Take" take)
Methods
T clip(cairo.region.Region propval)Set `clip` property. Params: propval = The clip region applied to the drawing context. Returns: Builder instance for fluent chaining
T window(gdk.window.Window propval)Set `window` property. Params: propval = The #GdkWindow that created the drawing context. Returns: Builder instance for fluent chaining

Fluent builder for [gdk.drawing_context.DrawingContext]