Blender V5.3
GHOST_SystemWayland.hh File Reference
#include "../GHOST_Types.hh"
#include "GHOST_System.hh"
#include "GHOST_WindowWayland.hh"
#include <wayland-client.h>
#include <mutex>
#include <span>
#include <string>
#include <atomic>
#include <thread>

Go to the source code of this file.

Classes

struct  GWL_Output
class  GHOST_SystemWayland

Macros

#define FRACTIONAL_DENOMINATOR   120

Enumerations

enum class  GWL_CurrentDesktopType { Other = 0 , Gnome , KDE }

Functions

bool ghost_wl_display_report_error_if_set (wl_display *display)
struct wl_buffer * ghost_wl_buffer_create_transparent_pixel (struct wl_shm *shm)
bool ghost_wl_output_own (const struct wl_output *wl_output)
void ghost_wl_output_tag (struct wl_output *wl_output)
struct GWL_Output * ghost_wl_output_user_data (struct wl_output *wl_output)
bool ghost_wl_surface_own_with_null_check (const struct wl_surface *wl_surface)
bool ghost_wl_surface_own (const struct wl_surface *wl_surface)
void ghost_wl_surface_tag (struct wl_surface *wl_surface)
GHOST_WindowWayland * ghost_wl_surface_user_data (struct wl_surface *wl_surface)
bool ghost_wl_surface_own_cursor_pointer (const struct wl_surface *wl_surface)
void ghost_wl_surface_tag_cursor_pointer (struct wl_surface *wl_surface)
bool ghost_wl_surface_own_cursor_tablet (const struct wl_surface *wl_surface)
void ghost_wl_surface_tag_cursor_tablet (struct wl_surface *wl_surface)
wl_fixed_t gwl_window_scale_wl_fixed_to (const GWL_WindowScaleParams &scale_params, wl_fixed_t value)
wl_fixed_t gwl_window_scale_wl_fixed_from (const GWL_WindowScaleParams &scale_params, wl_fixed_t value)
int gwl_window_scale_int_to (const GWL_WindowScaleParams &scale_params, int value)
int gwl_window_scale_int_from (const GWL_WindowScaleParams &scale_params, int value)
int gwl_window_scale_buffer_size_to (const GWL_WindowScaleParams &scale_params, int logical_size, int *r_buffer_scale)

Detailed Description

Declaration of GHOST_SystemWayland class.

Definition in file GHOST_SystemWayland.hh.

Macro Definition Documentation

◆ FRACTIONAL_DENOMINATOR

Enumeration Type Documentation

◆ GWL_CurrentDesktopType

enum class GWL_CurrentDesktopType
strong

The current desktop (Gnome, KDE etc..).

Note
Use this as a last resort, ideally wayland integration would not depend on this.
Enumerator
Other 
Gnome 
KDE 

Definition at line 116 of file GHOST_SystemWayland.hh.

Function Documentation

◆ ghost_wl_buffer_create_transparent_pixel()

struct wl_buffer * ghost_wl_buffer_create_transparent_pixel ( struct wl_shm * shm)

Create a 1x1 transparent buffer, intended for up-scaling via #wp_viewport_set_destination. The caller owns the returned buffer, null on allocation failure.

Definition at line 2924 of file GHOST_SystemWayland.cc.

References ghost_wl_buffer_create_for_image(), and ghost_wl_buffer_create_transparent_pixel().

Referenced by ghost_wl_buffer_create_transparent_pixel().

◆ ghost_wl_display_report_error_if_set()

◆ ghost_wl_output_own()

bool ghost_wl_output_own ( const struct wl_output * wl_output)

◆ ghost_wl_output_tag()

void ghost_wl_output_tag ( struct wl_output * wl_output)

◆ ghost_wl_output_user_data()

◆ ghost_wl_surface_own()

bool ghost_wl_surface_own ( const struct wl_surface * wl_surface)

◆ ghost_wl_surface_own_cursor_pointer()

bool ghost_wl_surface_own_cursor_pointer ( const struct wl_surface * wl_surface)

◆ ghost_wl_surface_own_cursor_tablet()

◆ ghost_wl_surface_own_with_null_check()

bool ghost_wl_surface_own_with_null_check ( const struct wl_surface * wl_surface)

Enter/exit handlers may be called with a null window surface (when the window just closed), so add a version of the function that checks this.

All of the functions could in fact however paranoid null checks make the expected state difficult to reason about, so only use this in cases the surface may be null.

References ghost_wl_surface_own_with_null_check(), and wl_surface.

◆ ghost_wl_surface_tag()

◆ ghost_wl_surface_tag_cursor_pointer()

◆ ghost_wl_surface_tag_cursor_tablet()

◆ ghost_wl_surface_user_data()

◆ gwl_window_scale_buffer_size_to()

int gwl_window_scale_buffer_size_to ( const GWL_WindowScaleParams & scale_params,
int logical_size,
int * r_buffer_scale )

Scale a logical buffer size to physical pixels, returning an integer buffer scale. The buffer scale is rounded up so result / *r_buffer_scale == logical_size.

Definition at line 218 of file GHOST_WindowWayland.cc.

References divide_ceil_uint(), gwl_window_scale_buffer_size_to(), and gwl_window_scale_int_to().

Referenced by ghost_wl_surface_own_cursor_tablet(), gwl_window_scale_buffer_size_to(), and GHOST_SystemWayland::xdg_toplevel_icon_update().

◆ gwl_window_scale_int_from()

int gwl_window_scale_int_from ( const GWL_WindowScaleParams & scale_params,
int value )

◆ gwl_window_scale_int_to()

int gwl_window_scale_int_to ( const GWL_WindowScaleParams & scale_params,
int value )

◆ gwl_window_scale_wl_fixed_from()

◆ gwl_window_scale_wl_fixed_to()