Surface

open class Surface(pointer: <Error class: unknown class><<Error class: unknown class>>)

A GdkSurface is a rectangular region on the screen.

It’s a low-level object, used to implement high-level objects such as ../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.

Skipped during bindings generation

  • method create_similar_surface: Return type cairo.Surface is unsupported

  • parameter x: x: Out parameter is not supported

  • parameter region: cairo.Region

  • parameter region: cairo.Region

  • method translate_coordinates: In/Out parameter is not supported

  • signal render: Signal render is ignored

Constructors

Link copied to clipboard
constructor(parent: Surface, autohide: Boolean)

Create a new popup surface.

constructor(display: Display)

Creates a new toplevel surface.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open var cursor: Cursor?

The mouse pointer for the GdkSurface.

Link copied to clipboard
open val display: Display

The GdkDisplay connection of the surface.

Link copied to clipboard

The GdkFrameClock of the surface.

Link copied to clipboard
val gdkSurfacePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val height: <Error class: unknown class>

The height of the surface, in pixels.

Link copied to clipboard
open val mapped: Boolean

Whether the surface is mapped.

Link copied to clipboard
open val scale: <Error class: unknown class>

The scale of the surface.

Link copied to clipboard
open val scaleFactor: <Error class: unknown class>

The scale factor of the surface.

Link copied to clipboard
open val width: <Error class: unknown class>

The width of the surface in pixels.

Functions

Link copied to clipboard
open fun beep()

Emits a short beep associated to @surface.

Link copied to clipboard
fun connectEnterMonitor(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (monitor: Monitor) -> Unit): <Error class: unknown class>

Emitted when @surface starts being present on the monitor.

Link copied to clipboard
fun connectEvent(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (event: Event) -> Boolean): <Error class: unknown class>

Emitted when GDK receives an input event for @surface.

Link copied to clipboard
fun connectLayout(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>) -> Unit): <Error class: unknown class>

Emitted when the size of @surface is changed, or when relayout should be performed.

Link copied to clipboard
fun connectLeaveMonitor(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (monitor: Monitor) -> Unit): <Error class: unknown class>

Emitted when @surface stops being present on the monitor.

Link copied to clipboard

Creates a new GdkCairoContext for rendering on @surface.

Link copied to clipboard
open fun createGlContext(): <Error class: unknown class><GlContext>

Creates a new GdkGLContext for the GdkSurface.

Link copied to clipboard
open fun createVulkanContext(): <Error class: unknown class><VulkanContext>

Sets an error and returns null.

Link copied to clipboard
open fun destroy()

Destroys the window system resources associated with @surface and decrements @surface's reference count.

Link copied to clipboard
open fun getDeviceCursor(device: Device): Cursor?

Retrieves a GdkCursor pointer for the @device currently set on the specified GdkSurface.

Link copied to clipboard
open fun hide()

Hide the surface.

Link copied to clipboard
open fun isDestroyed(): Boolean

Check to see if a surface is destroyed.

Link copied to clipboard
open fun queueRender()

Forces a signal@Gdk.Surface::render signal emission for @surface to be scheduled.

Link copied to clipboard
open fun requestLayout()

Request a layout phase from the surface's frame clock.

Link copied to clipboard
open fun setDeviceCursor(device: Device, cursor: Cursor)

Sets a specific GdkCursor for a given device when it gets inside @surface.