Package ch.bailu.gtk.gdk
Klasse Surface
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gdk.Surface
- Alle implementierten Schnittstellen:
PointerInterface
Represents a rectangular region on the screen.
It’s a low-level object, used to implement high-level objects
such as [GtkWindow](../gtk4/class.Window.html).
The surfaces you see in practice are either [iface@Gdk.Toplevel] or
[iface@Gdk.Popup], and those interfaces provide much of the required
API to interact with these surfaces. Other, more specialized surface
types exist, but you will rarely interact with them directly.
It’s a low-level object, used to implement high-level objects
such as [GtkWindow](../gtk4/class.Window.html).
The surfaces you see in practice are either [iface@Gdk.Toplevel] or
[iface@Gdk.Popup], and those interfaces provide much of the required
API to interact with these surfaces. Other, more specialized surface
types exist, but you will rarely interact with them directly.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
static final String
static final String
static final String
static final String
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
beep()
Emits a short beep associated to @surface.Creates a new `GdkCairoContext` for rendering on @surface.Creates a new `GdkGLContext` for the `GdkSurface`.createSimilarSurface
(int content, int width, int height) Veraltet.Veraltet.void
destroy()
Destroys the window system resources associated with @surface and
decrements @surface's reference count.static ClassHandler
Retrieves a `GdkCursor` pointer for the cursor currently set on the
`GdkSurface`.getDeviceCursor
(Device device) Retrieves a `GdkCursor` pointer for the @device currently set on the
specified `GdkSurface`.Gets the `GdkDisplay` associated with a `GdkSurface`.Gets the frame clock for the surface.int
Returns the height of the given @surface.static int
boolean
Checks whether the surface has been mapped.static long
static TypeSystem.TypeSize
double
getScale()
Returns the internal scale that maps from surface coordinates
to the actual device pixels.int
Returns the internal scale factor that maps from surface coordinates
to the actual device pixels.static long
static TypeSystem.TypeSize
int
getWidth()
Returns the width of the given @surface.void
hide()
Hide the surface.boolean
Check to see if a surface is destroyed.static Surface
newPopupSurface
(Surface parent, boolean autohide) Create a new popup surface.static Surface
newToplevelSurface
(Display display) Creates a new toplevel surface.onEnterMonitor
(Surface.OnEnterMonitor signal) Connect to signal "enter-monitor".onEvent
(Surface.OnEvent signal) Connect to signal "event".onLayout
(Surface.OnLayout signal) Connect to signal "layout".onLeaveMonitor
(Surface.OnLeaveMonitor signal) Connect to signal "leave-monitor".onRender
(Surface.OnRender signal) Connect to signal "render".void
Forces a [signal@Gdk.Surface::render] signal emission for @surface
to be scheduled.void
Request a layout phase from the surface's frame clock.void
Sets the default mouse pointer for a `GdkSurface`.void
setDeviceCursor
(Device device, Cursor cursor) Sets a specific `GdkCursor` for a given device when it gets inside @surface.void
setInputRegion
(Region region) Apply the region to the surface for the purpose of event
handling.void
setOpaqueRegion
(Region region) Veraltet.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden 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
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_ENTER_MONITOR
- Siehe auch:
-
SIGNAL_ON_EVENT
- Siehe auch:
-
SIGNAL_ON_LAYOUT
- Siehe auch:
-
SIGNAL_ON_LEAVE_MONITOR
- Siehe auch:
-
SIGNAL_ON_RENDER
- Siehe auch:
-
-
Konstruktordetails
-
Surface
-
-
Methodendetails
-
getClassHandler
-
newPopupSurface
Create a new popup surface.
The surface will be attached to @parent and can be positioned
relative to it using [method@Gdk.Popup.present].- Parameter:
parent
- the parent surface to attach the surface toautohide
- whether to hide the surface on outside clicks- Gibt zurück:
- a new `GdkSurface`
-
newToplevelSurface
Creates a new toplevel surface.- Parameter:
display
- the display to create the surface on- Gibt zurück:
- the new `GdkSurface`
-
beep
public void beep()Emits a short beep associated to @surface.
If the display of @surface does not support per-surface beeps,
emits a short beep on the display just as [method@Gdk.Display.beep]. -
createCairoContext
Creates a new `GdkCairoContext` for rendering on @surface.- Gibt zurück:
- the newly created `GdkCairoContext`
-
createGlContext
Creates a new `GdkGLContext` for the `GdkSurface`.
The context is disconnected from any particular surface or surface.
If the creation of the `GdkGLContext` failed, @error will be set.
Before using the returned `GdkGLContext`, you will need to
call [method@Gdk.GLContext.make_current] or [method@Gdk.GLContext.realize].- Gibt zurück:
- the newly created `GdkGLContext`
- Löst aus:
AllocationError
-
createSimilarSurface
Veraltet.Create a new Cairo surface that is as compatible as possible with the
given @surface.
For example the new surface will have the same fallback resolution
and font options as @surface. Generally, the new surface will also
use the same backend as @surface, unless that is not possible for
some reason. The type of the returned surface may be examined with
cairo_surface_get_type().
Initially the surface contents are all 0 (transparent if contents
have transparency, black otherwise.)
This function always returns a valid pointer, but it will return a
pointer to a “nil” surface if @other is already in an error state
or any other error occurs.- Parameter:
content
- the content for the new surfacewidth
- width of the new surfaceheight
- height of the new surface- Gibt zurück:
- a pointer to the newly allocated surface. The caller owns the surface and should call cairo_surface_destroy() when done with it.
-
createVulkanContext
Veraltet.Sets an error and returns %NULL.- Gibt zurück:
- %NULL
- Löst aus:
AllocationError
-
destroy
public void destroy()Destroys the window system resources associated with @surface and
decrements @surface's reference count.
The window system resources for all children of @surface are also
destroyed, but the children’s reference counts are not decremented.
Note that a surface will not be destroyed automatically when its
reference count reaches zero. You must call this function yourself
before that happens. -
getCursor
Retrieves a `GdkCursor` pointer for the cursor currently set on the
`GdkSurface`.
If the return value is %NULL then there is no custom cursor set on
the surface, and it is using the cursor for its parent surface.
Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface.- Gibt zurück:
- a `GdkCursor`
-
getDeviceCursor
Retrieves a `GdkCursor` pointer for the @device currently set on the
specified `GdkSurface`.
If the return value is %NULL then there is no custom cursor set on the
specified surface, and it is using the cursor for its parent surface.
Use [method@Gdk.Surface.set_cursor] to unset the cursor of the surface.- Parameter:
device
- a pointer `GdkDevice`- Gibt zurück:
- a `GdkCursor`
-
getDisplay
Gets the `GdkDisplay` associated with a `GdkSurface`.- Gibt zurück:
- the `GdkDisplay` associated with @surface
-
getFrameClock
Gets the frame clock for the surface.
The frame clock for a surface never changes unless the surface is
reparented to a new toplevel surface.- Gibt zurück:
- the frame clock
-
getHeight
public int getHeight()Returns the height of the given @surface.
Surface size is reported in ”application pixels”, not
”device pixels” (see [method@Gdk.Surface.get_scale_factor]).- Gibt zurück:
- The height of @surface
-
getMapped
public boolean getMapped()Checks whether the surface has been mapped.
A surface is mapped with [method@Gdk.Toplevel.present]
or [method@Gdk.Popup.present].- Gibt zurück:
- %TRUE if the surface is mapped
-
getScale
public double getScale()Returns the internal scale that maps from surface coordinates
to the actual device pixels.
When the scale is bigger than 1, the windowing system prefers to get
buffers with a resolution that is bigger than the surface size (e.g.
to show the surface on a high-resolution display, or in a magnifier).
Compare with [method@Gdk.Surface.get_scale_factor], which returns the
next larger integer.
The scale may change during the lifetime of the surface.- Gibt zurück:
- the scale
-
getScaleFactor
public int getScaleFactor()Returns the internal scale factor that maps from surface coordinates
to the actual device pixels.
On traditional systems this is 1, but on very high density outputs
this can be a higher value (often 2). A higher value means that drawing
is automatically scaled up to a higher resolution, so any code doing
drawing will automatically look nicer. However, if you are supplying
pixel-based data the scale value can be used to determine whether to
use a pixel resource with higher resolution data.
The scale factor may change during the lifetime of the surface.- Gibt zurück:
- the scale factor
-
getWidth
public int getWidth()Returns the width of the given @surface.
Surface size is reported in ”application pixels”, not
”device pixels” (see [method@Gdk.Surface.get_scale_factor]).- Gibt zurück:
- The width of @surface
-
hide
public void hide()Hide the surface.
For toplevel surfaces, withdraws them, so they will no longer be
known to the window manager; for all surfaces, unmaps them, so
they won’t be displayed. Normally done automatically as
part of [gtk_widget_hide()](../gtk4/method.Widget.hide.html). -
isDestroyed
public boolean isDestroyed()Check to see if a surface is destroyed.- Gibt zurück:
- %TRUE if the surface is destroyed
-
queueRender
public void queueRender()Forces a [signal@Gdk.Surface::render] signal emission for @surface
to be scheduled.
This function is useful for implementations that track invalid
regions on their own. -
requestLayout
public void requestLayout()Request a layout phase from the surface's frame clock.
See [method@Gdk.FrameClock.request_phase]. -
setCursor
Sets the default mouse pointer for a `GdkSurface`.
Passing %NULL for the @cursor argument means that @surface will use
the cursor of its parent surface. Most surfaces should use this default.
Note that @cursor must be for the same display as @surface.
Use [ctor@Gdk.Cursor.new_from_name] or [ctor@Gdk.Cursor.new_from_texture]
to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR.- Parameter:
cursor
- a `GdkCursor`
-
setDeviceCursor
Sets a specific `GdkCursor` for a given device when it gets inside @surface.
Passing %NULL for the @cursor argument means that @surface will use the
cursor of its parent surface. Most surfaces should use this default.
Use [ctor@Gdk.Cursor.new_from_name] or [ctor@Gdk.Cursor.new_from_texture]
to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR.- Parameter:
device
- a pointer `GdkDevice`cursor
- a `GdkCursor`
-
setInputRegion
Apply the region to the surface for the purpose of event
handling.
Mouse events which happen while the pointer position corresponds
to an unset bit in the mask will be passed on the surface below
@surface.
An input region is typically used with RGBA surfaces. The alpha
channel of the surface defines which pixels are invisible and
allows for nicely antialiased borders, and the input region
controls where the surface is “clickable”.
Use [method@Gdk.Display.supports_input_shapes] to find out if
a particular backend supports input regions.- Parameter:
region
- region of surface to be reactive
-
setOpaqueRegion
Veraltet.Marks a region of the `GdkSurface` as opaque.
For optimisation purposes, compositing window managers may
like to not draw obscured regions of surfaces, or turn off blending
during for these regions. With RGB windows with no transparency,
this is just the shape of the window, but with ARGB32 windows, the
compositor does not know what regions of the window are transparent
or not.
This function only works for toplevel surfaces.
GTK will update this property automatically if the @surface background
is opaque, as we know where the opaque regions are. If your surface
background is not opaque, please update this property in your
[GtkWidgetClass.css_changed](../gtk4/vfunc.Widget.css_changed.html) handler.- Parameter:
region
- a region, or %NULL to make the entire surface opaque
-
onEnterMonitor
Connect to signal "enter-monitor".
SeeSurface.OnEnterMonitor.onEnterMonitor(ch.bailu.gtk.gdk.Monitor)
for signal description.
FieldSIGNAL_ON_ENTER_MONITOR
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onEvent
Connect to signal "event".
SeeSurface.OnEvent.onEvent(ch.bailu.gtk.type.Pointer)
for signal description.
FieldSIGNAL_ON_EVENT
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onLayout
Connect to signal "layout".
SeeSurface.OnLayout.onLayout(int, int)
for signal description.
FieldSIGNAL_ON_LAYOUT
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onLeaveMonitor
Connect to signal "leave-monitor".
SeeSurface.OnLeaveMonitor.onLeaveMonitor(ch.bailu.gtk.gdk.Monitor)
for signal description.
FieldSIGNAL_ON_LEAVE_MONITOR
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onRender
Connect to signal "render".
SeeSurface.OnRender.onRender(ch.bailu.gtk.cairo.Region)
for signal description.
FieldSIGNAL_ON_RENDER
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-