gdk.surface
Module for [Surface] class
Types 3
classSurface : gobject.object.ObjectWrap
A [gdk.surface.Surface] is a rectangular region on the screen.
It’s a low-level object, used to implement high-level objects such as GtkWindow.
The surfaces you see in practice are either [gdk.toplevel.Toplevel] or [gdk.popup.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.
Methods
Surface self()Returns `this`, for use in `with` statements.SurfaceGidBuilder builder()Get builder for [gdk.surface.Surface] Returns: New builder objectgdk.cursor.Cursor cursor() @propertyGet `cursor` property. Returns: The mouse pointer for the [gdk.surface.Surface].void cursor(gdk.cursor.Cursor propval) @propertySet `cursor` property. Params: propval = The mouse pointer for the [gdk.surface.Surface].gdk.display.Display display() @propertyGet `display` property. Returns: The [gdk.display.Display] connection of the surface.gdk.frame_clock.FrameClock frameClock() @propertyGet `frameClock` property. Returns: The [gdk.frame_clock.FrameClock] of the surface.gdk.surface.Surface newPopup(gdk.surface.Surface parent, bool autohide)Create a new popup surface.gdk.surface.Surface newToplevel(gdk.display.Display display)Creates a new toplevel surface.void beep()Emits a short beep associated to surface.gdk.cairo_context.CairoContext createCairoContext()Creates a new [gdk.cairocontext.CairoContext] for rendering on surface. Returns: the newly created [gdk.cairocontext.CairoContext]gdk.glcontext.GLContext createGlContext()Creates a new [gdk.glcontext.GLContext] for the [gdk.surface.Surface].cairo.surface.Surface createSimilarSurface(cairo.types.Content content, int width, int height)Create a new Cairo surface that is as compatible as possible with the given surface.gdk.vulkan_context.VulkanContext createVulkanContext()Sets an error and returns null. Returns: null Throws: [ErrorWrap]void destroy()Destroys the window system resources associated with surface and decrements surface's reference count.gdk.cursor.Cursor getCursor()Retrieves a [gdk.cursor.Cursor] pointer for the cursor currently set on the [gdk.surface.Surface].gdk.cursor.Cursor getDeviceCursor(gdk.device.Device device)Retrieves a [gdk.cursor.Cursor] pointer for the device currently set on the specified [gdk.surface.Surface].bool getDevicePosition(gdk.device.Device device, out double x, out double y, out gdk.types.ModifierType mask)Obtains the current device position and modifier state.gdk.display.Display getDisplay()Gets the [gdk.display.Display] associated with a [gdk.surface.Surface]. Returns: the [gdk.display.Display] associated with surfacegdk.frame_clock.FrameClock getFrameClock()Gets the frame clock for the surface.int getHeight()Returns the height of the given surface.bool getMapped()Checks whether the surface has been mapped.double getScale()Returns the internal scale that maps from surface coordinates to the actual device pixels.int getScaleFactor()Returns the internal scale factor that maps from surface coordinates to the actual device pixels.int getWidth()Returns the width of the given surface.void hide()Hide the surface.bool isDestroyed()Check to see if a surface is destroyed. Returns: true if the surface is destroyedvoid queueRender()Forces a [gdk.surface.Surface.render] signal emission for surface to be scheduled.void requestLayout()Request a layout phase from the surface's frame clock.void setCursor(gdk.cursor.Cursor cursor = null)Sets the default mouse pointer for a [gdk.surface.Surface].void setDeviceCursor(gdk.device.Device device, gdk.cursor.Cursor cursor)Sets a specific [gdk.cursor.Cursor] for a given device when it gets inside surface.void setInputRegion(cairo.region.Region region)Apply the region to the surface for the purpose of event handling.void setOpaqueRegion(cairo.region.Region region = null)Marks a region of the [gdk.surface.Surface] as opaque.bool translateCoordinates(gdk.surface.Surface to, ref double x, ref double y)Translates coordinates between two surfaces.gulong connectEnterMonitor(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.monitor.MonitorWrap)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.surface.Surface)))
&& Parameters!T.length < 3)Connect to `EnterMonitor` signal.gulong connectEvent(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gdk.event.Event)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.surface.Surface)))
&& Parameters!T.length < 3)Connect to `Event` signal.gulong connectLayout(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == int)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == int)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gdk.surface.Surface)))
&& Parameters!T.length < 4)Connect to `Layout` signal.gulong connectLeaveMonitor(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.monitor.MonitorWrap)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.surface.Surface)))
&& Parameters!T.length < 3)Connect to `LeaveMonitor` signal.gulong connectRender(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == cairo.region.Region)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.surface.Surface)))
&& Parameters!T.length < 3)Connect to `Render` signal.Methods
T cursor(gdk.cursor.Cursor propval)Set `cursor` property. Params: propval = The mouse pointer for the [gdk.surface.Surface]. Returns: Builder instance for fluent chainingT display(gdk.display.Display propval)Set `display` property. Params: propval = The [gdk.display.Display] connection of the surface. Returns: Builder instance for fluent chainingT frameClock(gdk.frame_clock.FrameClock propval)Set `frameClock` property. Params: propval = The [gdk.frame_clock.FrameClock] of the surface. Returns: Builder instance for fluent chainingFluent builder for [gdk.surface.Surface]
Methods
Surface build()