Base class for objects implementing different rendering methods.
GdkDrawContext is the base object used by contexts implementing different rendering methods, such as [classGdk.CairoContext] or [classGdk.GLContext]. It provides shared functionality between those contexts.
You will always interact with one of those subclasses.
A GdkDrawContext is always associated with a single toplevel surface.
procedure Begin_Frame
(Self : not null access Gdk_Draw_Context_Record;
Region : Cairo.Region.Cairo_Region)
Indicates that you are beginning the process of redrawing Region on the Context's surface. Calling this function begins a drawing operation using Context on the surface that Context was created from. The actual requirements and guarantees for the drawing operation vary for different implementations of drawing, so a [classGdk.CairoContext] and a [classGdk.GLContext] need to be treated differently. A call to this function is a requirement for drawing and must be followed by a call to [methodGdk.DrawContext.end_frame], which will complete the drawing operation and ensure the contents become visible on screen. Note that the Region passed to this function is the minimum region that needs to be drawn and depending on implementation, windowing system and hardware in use, it might be necessary to draw a larger region. Drawing implementation must use [methodGdk.DrawContext.get_frame_region] to query the region that must be drawn. When using GTK, the widget system automatically places calls to Gdk.Draw_Context.Begin_Frame and Gdk.Draw_Context.End_Frame via the use of GskRenderers, so application code does not need to call these functions explicitly. Deprecated since 4.16, 1
minimum region that should be drawn
Display_Property : constant Glib.Properties.Property_Boxed;
Type: Display The GdkDisplay used to create the GdkDrawContext.
procedure End_Frame (Self : not null access Gdk_Draw_Context_Record)
Ends a drawing operation started with Gdk.Draw_Context.Begin_Frame. This makes the drawing available on screen. See [methodGdk.DrawContext.begin_frame] for more details about drawing. When using a [classGdk.GLContext], this function may call glFlush implicitly before returning; it is not recommended to call glFlush explicitly before calling this function. Deprecated since 4.16, 1
type Gdk_Draw_Context is access all Gdk_Draw_Context_Record'Class;
type Gdk_Draw_Context_Record is new GObject_Record with null record;
function Get_Display
(Self : not null access Gdk_Draw_Context_Record)
return Gdk.Gdk_Display
Retrieves the GdkDisplay the Context is created for
the GdkDisplay. Has transfer-ownership='none'.
function Get_Frame_Region
(Self : not null access Gdk_Draw_Context_Record)
return Cairo.Region.Cairo_Region
Retrieves the region that is currently being repainted. After a call to [methodGdk.DrawContext.begin_frame] this function will return a union of the region passed to that function and the area of the surface that the Context determined needs to be repainted. If Context is not in between calls to [methodGdk.DrawContext.begin_frame] and [methodGdk.DrawContext.end_frame], null will be returned. Deprecated since 4.16, 1
a Cairo region
function Get_Surface
(Self : not null access Gdk_Draw_Context_Record)
return Gdk.Gdk_Surface
Retrieves the surface that Context is bound to.
a GdkSurface. Has transfer-ownership='none'.
function Get_Type return Glib.GType
function Is_In_Frame
(Self : not null access Gdk_Draw_Context_Record) return Boolean
Returns True if Context is in the process of drawing to its surface. This is the case between calls to [methodGdk.DrawContext.begin_frame] and [methodGdk.DrawContext.end_frame]. In this situation, drawing commands may be effecting the contents of the Context's surface. Deprecated since 4.16, 1
True if the context is between [methodGdk.DrawContext.begin_frame] and [methodGdk.DrawContext.end_frame] calls.
Surface_Property : constant Glib.Properties.Property_Boxed;
Type: Surface The GdkSurface the context is bound to.