Gdk.Drawing_Context

Entities

Tagged Types

Access Types

Constants

Subprograms

Description

Gdk.Drawing_Context.Gdk_Drawing_Context is an object that represents the current drawing state of a Gdk.Gdk_Window.

It's possible to use a Gdk.Drawing_Context.Gdk_Drawing_Context to draw on a Gdk.Gdk_Window via rendering API like Cairo or OpenGL.

A Gdk.Drawing_Context.Gdk_Drawing_Context can only be created by calling Gdk.Window.Begin_Draw_Frame and will be valid until a call to Gdk.Window.End_Draw_Frame.

Gdk.Drawing_Context.Gdk_Drawing_Context is available since GDK 3.22

Clip_Property

Clip_Property : constant Glib.Properties.Property_Boxed;

Type: cairo.Region The clip region applied to the drawing context.

Gdk_Drawing_Context

type Gdk_Drawing_Context is access all Gdk_Drawing_Context_Record'Class;

Gdk_Drawing_Context_Record

type Gdk_Drawing_Context_Record is new GObject_Record with null record;

Get_Cairo_Context

function Get_Cairo_Context
   (Self : not null access Gdk_Drawing_Context_Record)
    return Cairo.Cairo_Context

Retrieves a Cairo context to be used to draw on the Gdk.Gdk_Window that created the Gdk.Drawing_Context.Gdk_Drawing_Context. The returned context is guaranteed to be valid as long as the Gdk.Drawing_Context.Gdk_Drawing_Context is valid, that is between a call to Gdk.Window.Begin_Draw_Frame and Gdk.Window.End_Draw_Frame. Since: gtk+ 3.22

Parameters
Self
Return Value

a Cairo context to be used to draw the contents of the Gdk.Gdk_Window. The context is owned by the Gdk.Drawing_Context.Gdk_Drawing_Context and should not be destroyed

Get_Clip

function Get_Clip
   (Self : not null access Gdk_Drawing_Context_Record)
    return Cairo.Region.Cairo_Region

Retrieves a copy of the clip region used when creating the Context. Since: gtk+ 3.22

Parameters
Self
Return Value

a Cairo region

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Window

function Get_Window
   (Self : not null access Gdk_Drawing_Context_Record)
    return Gdk.Gdk_Window

Retrieves the window that created the drawing Context. Since: gtk+ 3.22

Parameters
Self
Return Value

a Gdk.Gdk_Window

Is_Valid

function Is_Valid
   (Self : not null access Gdk_Drawing_Context_Record) return Boolean

Checks whether the given Gdk.Drawing_Context.Gdk_Drawing_Context is valid. Since: gtk+ 3.22

Parameters
Self
Return Value

True if the context is valid

Window_Property

Window_Property : constant Glib.Properties.Property_Object;

Type: Gtk.Window.Gtk_Window The Gdk.Gdk_Window that created the drawing context.