( type_id = "gdk_surface_get_type ()"
) ]public class Surface
A Surface is a (usually) rectangular region on the screen.
It’s a low-level object, used to implement high-level objects such as Window or
Dialog in GTK.
The surfaces you see in practice are either Toplevel or
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.
- public void beep ()
Emits a short beep associated to this in
the appropriate display, if supported.
- public CairoContext create_cairo_context ()
- public GLContext create_gl_context () throws Error
Creates a new
GLContext matching the framebuffer format to the visual of the Surface.
- public Surface create_similar_surface (Content content, int width, int height)
Create a new surface that is as compatible as possible with the given
- public VulkanContext create_vulkan_context () throws Error
- public void destroy ()
Destroys the window system resources associated with
this and decrements this's reference count.
- public unowned Cursor? get_cursor ()
Retrieves a Cursor pointer
for the cursor currently set on the specified Surface, or null.
- public unowned Cursor? get_device_cursor (Device device)
Retrieves a Cursor pointer
device currently set on the specified Surface, or null.
- public bool get_device_position (Device device, out double x, out double y, out ModifierType mask)
Obtains the current device position in doubles and modifier state.
- public unowned Display get_display ()
Gets the Display
associated with a Surface.
- public unowned FrameClock get_frame_clock ()
Gets the frame clock for the surface.
- public int get_height ()
Returns the height of the given this.
- public bool get_mapped ()
- public int get_scale_factor ()
Returns the internal scale factor that maps from surface coordinates to the
actual device pixels.
- public int get_width ()
Returns the width of the given this.
- public void hide ()
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.
- public bool is_destroyed ()
Check to see if a surface is destroyed.
- public void queue_render ()
Forces a render
signal emission for this to be scheduled.
- public void set_cursor (Cursor? cursor)
Sets the default mouse pointer for a Surface.
- public void set_device_cursor (Device device, Cursor cursor)
Sets a specific Cursor for
a given device when it gets inside this.
- public void set_input_region (Region region)
Apply the region to the surface for the purpose of event handling.
- public void set_opaque_region (Region? region)
For optimisation purposes, compositing window managers may like to not draw
obscured regions of surfaces, or turn off blending during for these regions.
- public void set_shadow_width (int left, int right, int top, int bottom)
Newer GTK windows using client-side decorations use extra geometry around
their frames for effects like shadows and invisible borders.
- public bool translate_coordinates (Surface to, double x, double y)
Translates the given coordinates from being relative to the
this surface to being relative to the
- public signal void enter_monitor (Monitor monitor)
surface starts being present on the monitor.
- public signal bool event (Event event)
Emitted when GDK receives an input event for
- public signal void leave_monitor (Monitor monitor)
surface stops being present on the monitor.
- public signal bool render (Region region)
Emitted when part of the surface needs to be redrawn.
- public signal void size_changed (int width, int height)
Emitted when the size of
surface is changed.
All known members inherited from class GLib.Object