Surface
Object Hierarchy:
Gdk.Surface
Gdk.Surface
Gdk.Surface
GLib.Object
GLib.Object
GLib.Object->Gdk.Surface
Description:
[ CCode ( type_id = "gdk_surface_get_type ()" ) ]public class Surface : Object
A `GdkSurface` is a rectangular region on the screen.
It’s a low-level object, used to implement high-level objects such as [[email protected] ] or [[email protected] ] in GTK.
The surfaces you see in practice are either [[email protected] ] or [[email protected] ], 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.
Content:
Properties:
public Cursor cursor { get ; set ; }
The mouse pointer for the `GdkSurface`.
public Display display { get ; construct ; }
The `GdkDisplay` connection of the surface.
public FrameClock frame_clock { get ; construct ; }
The `GdkFrameClock` of the surface.
public int height { get ; }
The height of the surface, in pixels.
public bool mapped { get ; }
Whether the surface is mapped.
public int scale_factor { get ; }
The scale factor of the surface.
public int width { get ; }
The width of the surface in pixels.
Creation methods:
Methods:
public void beep ()
Emits a short beep associated to this
.
public CairoContext create_cairo_context ()
Creates a new `GdkCairoContext` for rendering on
this .
public GLContext create_gl_context () throws Error
Creates a new `GdkGLContext` for the `GdkSurface`.
public Surface create_similar_surface (Content content, int width, int height)
Create a new Cairo surface that is as compatible as possible with the
given this .
public VulkanContext create_vulkan_context () throws Error
Creates a new `GdkVulkanContext` for rendering on
this .
public void destroy ()
Destroys the window system resources associated with
this and decrements this 's reference count.
public unowned Cursor ? get_cursor ()
Retrieves a `GdkCursor` pointer for the cursor currently set on the
`GdkSurface`.
public unowned Cursor ? get_device_cursor (Device device)
Retrieves a `GdkCursor` pointer for the device
currently
set on the specified `GdkSurface`.
public bool get_device_position (Device device, out double x, out double y, out ModifierType mask)
Obtains the current device position and modifier state.
public unowned Display get_display ()
Gets the `GdkDisplay` associated with a `GdkSurface`.
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 ()
Checks whether the surface has been 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 ()
Hide the surface.
public bool is_destroyed ()
Check to see if a surface is destroyed.
public void queue_render ()
Forces a [signal@Gdk.
public void request_layout ()
Request a layout phase from the surface's frame clock.
public void set_cursor (Cursor ? cursor)
Sets the default mouse pointer for a `GdkSurface`.
public void set_device_cursor (Device device, Cursor cursor)
Sets a specific `GdkCursor` 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)
Marks a region of the `GdkSurface` as opaque.
public bool translate_coordinates (Surface to, ref double x, ref double y)
Translates coordinates between two surfaces.
Signals:
public signal void enter_monitor (Monitor monitor)
Emitted when surface
starts being present on the monitor.
public signal bool event (Event event)
Emitted when GDK receives an input event for surface
.
public signal void layout (int width, int height)
Emitted when the size of surface
is changed, or when
relayout should be performed.
public signal void leave_monitor (Monitor monitor)
Emitted when surface
stops being present on the monitor.
public signal bool render (Region region)
Emitted when part of the surface needs to be redrawn.
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref