Package ch.bailu.gtk.gdk
Class DrawContext
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gdk.DrawContext
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
CairoContext
,GLContext
,VulkanContext
Base class for objects implementing different rendering methods.
`GdkDrawContext` is the base object used by contexts implementing different
rendering methods, such as [class@Gdk.CairoContext] or [class@Gdk.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.
`GdkDrawContext` is the base object used by contexts implementing different
rendering methods, such as [class@Gdk.CairoContext] or [class@Gdk.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.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beginFrame
(Region region) Indicates that you are beginning the process of redrawing @region
on the @context's surface.void
endFrame()
Ends a drawing operation started with gdk_draw_context_begin_frame().static ClassHandler
Retrieves the `GdkDisplay` the @context is created forRetrieves the region that is currently being repainted.static int
static long
static TypeSystem.TypeSize
Retrieves the surface that @context is bound to.static long
static TypeSystem.TypeSize
boolean
Returns %TRUE if @context is in the process of drawing to its surface.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
DrawContext
-
-
Method Details
-
getClassHandler
-
beginFrame
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 [class@Gdk.CairoContext] and a [class@Gdk.GLContext]
need to be treated differently.
A call to this function is a requirement for drawing and must be
followed by a call to [method@Gdk.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 [method@Gdk.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 [class@Gsk.Renderer]s, so application code does not need to call
these functions explicitly.- Parameters:
region
- minimum region that should be drawn
-
endFrame
public void endFrame()Ends a drawing operation started with gdk_draw_context_begin_frame().
This makes the drawing available on screen.
See [method@Gdk.DrawContext.begin_frame] for more details about drawing.
When using a [class@Gdk.GLContext], this function may call `glFlush()`
implicitly before returning; it is not recommended to call `glFlush()`
explicitly before calling this function. -
getDisplay
Retrieves the `GdkDisplay` the @context is created for- Returns:
- the `GdkDisplay`
-
getFrameRegion
Retrieves the region that is currently being repainted.
After a call to [method@Gdk.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 [method@Gdk.DrawContext.begin_frame]
and [method@Gdk.DrawContext.end_frame], %NULL will be returned.- Returns:
- a Cairo region
-
getSurface
Retrieves the surface that @context is bound to.- Returns:
- a `GdkSurface`
-
isInFrame
public boolean isInFrame()Returns %TRUE if @context is in the process of drawing to its surface.
This is the case between calls to [method@Gdk.DrawContext.begin_frame]
and [method@Gdk.DrawContext.end_frame]. In this situation, drawing commands
may be effecting the contents of the @context's surface.- Returns:
- %TRUE if the context is between [method@Gdk.DrawContext.begin_frame] and [method@Gdk.DrawContext.end_frame] calls.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-