Class: Gdk::Surface
- Inherits:
-
Object
- Object
- Gdk::Surface
- Extended by:
- GLib::Deprecatable
- Defined in:
- lib/gdk4/deprecated.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#beep ⇒ nil
Emits a short beep associated to surface.
-
#create_cairo_context ⇒ Gdk::CairoContext
Creates a new
GdkCairoContextfor rendering on surface. -
#create_gl_context ⇒ Gdk::GLContext
Creates a new
GdkGLContextfor theGdkSurface. -
#create_similar_surface(content, width, height) ⇒ cairo::Surface
Create a new Cairo surface that is as compatible as possible with the given surface.
-
#create_vulkan_context ⇒ Gdk::VulkanContext
Sets an error and returns nil.
-
#cursor ⇒ Gdk::Cursor
The mouse pointer for the
GdkSurface. -
#cursor=(cursor) ⇒ Gdk::Cursor
The mouse pointer for the
GdkSurface. -
#destroy ⇒ nil
Destroys the window system resources associated with surface and decrements surface's reference count.
-
#display ⇒ Gdk::Display
The
GdkDisplayconnection of the surface. -
#display=(display) ⇒ Gdk::Display
The
GdkDisplayconnection of the surface. -
#frame_clock ⇒ Gdk::FrameClock
The
GdkFrameClockof the surface. -
#frame_clock=(frame_clock) ⇒ Gdk::FrameClock
The
GdkFrameClockof the surface. -
#get_device_cursor(device) ⇒ Gdk::Cursor
Retrieves a
GdkCursorpointer for the device currently set on the specifiedGdkSurface. -
#get_device_position(device, x, y, mask) ⇒ Boolean
Obtains the current device position and modifier state.
-
#height ⇒ Integer
The height of the surface, in pixels.
-
#height=(height) ⇒ Integer
The height of the surface, in pixels.
-
#hide ⇒ nil
Hide the surface.
-
#initialize(display) ⇒ Gdk::Surface
constructor
Creates a new toplevel surface.
-
#input_region=(region) ⇒ nil
Apply the region to the surface for the purpose of event handling.
-
#is_destroyed ⇒ Boolean
Check to see if a surface is destroyed.
-
#mapped ⇒ Boolean
Checks whether the surface has been mapped.
-
#mapped=(mapped) ⇒ Boolean
Whether the surface is mapped.
-
#mapped? ⇒ Boolean
Whether the surface is mapped.
-
#opaque_region=(region) ⇒ nil
Marks a region of the
GdkSurfaceas opaque. -
#queue_render ⇒ nil
Forces a [signalGdk.Surface::render] signal emission for surface to be scheduled.
-
#request_layout ⇒ nil
Request a layout phase from the surface's frame clock.
-
#scale ⇒ Float
The scale of the surface.
-
#scale=(scale) ⇒ Float
The scale of the surface.
-
#scale_factor ⇒ Integer
The scale factor of the surface.
-
#scale_factor=(scale_factor) ⇒ Integer
The scale factor of the surface.
-
#set_device_cursor(device, cursor) ⇒ nil
Sets a specific
GdkCursorfor a given device when it gets inside surface. -
#translate_coordinates(to, x, y) ⇒ Boolean
Translates coordinates between two surfaces.
-
#width ⇒ Integer
The width of the surface in pixels.
-
#width=(width) ⇒ Integer
The width of the surface in pixels.
Constructor Details
#initialize(display) ⇒ Gdk::Surface
Creates a new toplevel surface.
Instance Method Details
#beep ⇒ nil
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 [methodGdk.Display.beep].
#create_cairo_context ⇒ Gdk::CairoContext
Creates a new GdkCairoContext for rendering on surface.
#create_gl_context ⇒ Gdk::GLContext
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 [methodGdk.GLContext.make_current] or [methodGdk.GLContext.realize].
#create_similar_surface(content, width, height) ⇒ cairo::Surface
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.
#create_vulkan_context ⇒ Gdk::VulkanContext
Sets an error and returns nil.
#cursor ⇒ Gdk::Cursor
The mouse pointer for the GdkSurface.
#cursor=(cursor) ⇒ Gdk::Cursor
The mouse pointer for the GdkSurface.
#destroy ⇒ nil
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.
#display ⇒ Gdk::Display
The GdkDisplay connection of the surface.
#display=(display) ⇒ Gdk::Display
The GdkDisplay connection of the surface.
#frame_clock ⇒ Gdk::FrameClock
The GdkFrameClock of the surface.
#frame_clock=(frame_clock) ⇒ Gdk::FrameClock
The GdkFrameClock of the surface.
#get_device_cursor(device) ⇒ Gdk::Cursor
Retrieves a GdkCursor pointer for the device currently set on the
specified GdkSurface.
If the return value is nil then there is no custom cursor set on the specified surface, and it is using the cursor for its parent surface.
Use [methodGdk.Surface.set_cursor] to unset the cursor of the surface.
#get_device_position(device, x, y, mask) ⇒ Boolean
Obtains the current device position and modifier state.
The position is given in coordinates relative to the upper left corner of surface.
#height ⇒ Integer
The height of the surface, in pixels.
#height=(height) ⇒ Integer
The height of the surface, in pixels.
#hide ⇒ nil
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().
#input_region=(region) ⇒ nil
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 [methodGdk.Display.supports_input_shapes] to find out if a particular backend supports input regions.
#is_destroyed ⇒ Boolean
Check to see if a surface is destroyed.
#mapped ⇒ Boolean
Checks whether the surface has been mapped.
A surface is mapped with [methodGdk.Toplevel.present] or [methodGdk.Popup.present].
#mapped=(mapped) ⇒ Boolean
Whether the surface is mapped.
#mapped? ⇒ Boolean
Whether the surface is mapped.
#opaque_region=(region) ⇒ nil
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 handler.
#queue_render ⇒ nil
Forces a [signalGdk.Surface::render] signal emission for surface to be scheduled.
This function is useful for implementations that track invalid regions on their own.
#request_layout ⇒ nil
Request a layout phase from the surface's frame clock.
See [methodGdk.FrameClock.request_phase].
#scale ⇒ Float
The scale of the surface.
#scale=(scale) ⇒ Float
The scale of the surface.
#scale_factor ⇒ Integer
The scale factor of the surface.
The scale factor is the next larger integer, compared to [propertyGdk.Surface:scale].
#scale_factor=(scale_factor) ⇒ Integer
The scale factor of the surface.
The scale factor is the next larger integer, compared to [propertyGdk.Surface:scale].
#set_device_cursor(device, cursor) ⇒ nil
Sets a specific GdkCursor for a given device when it gets inside surface.
Passing nil for the cursor argument means that surface will use the cursor of its parent surface. Most surfaces should use this default.
Use [ctorGdk.Cursor.new_from_name] or [ctorGdk.Cursor.new_from_texture] to create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR.
#translate_coordinates(to, x, y) ⇒ Boolean
Translates coordinates between two surfaces.
Note that this only works if to and from are popups or transient-for to the same toplevel (directly or indirectly).
#width ⇒ Integer
The width of the surface in pixels.
#width=(width) ⇒ Integer
The width of the surface in pixels.