|
Blender V5.3
|
#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) |
Declaration of GHOST_SystemWayland class.
Definition in file GHOST_SystemWayland.hh.
| #define FRACTIONAL_DENOMINATOR 120 |
Definition at line 109 of file GHOST_SystemWayland.hh.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland(), gwl_window_fractional_from_viewport(), gwl_window_fractional_from_viewport_round(), gwl_window_fractional_to_viewport(), gwl_window_fractional_to_viewport_round(), gwl_window_scale_wl_fixed_from(), gwl_window_scale_wl_fixed_to(), output_handle_done(), output_scale_cmp(), GHOST_WindowWayland::outputs_changed_update_scale(), outputs_max_scale_or_default(), outputs_uniform_scale_or_default(), wp_fractional_scale_handle_preferred_scale(), and xdg_output_handle_logical_size().
|
strong |
The current desktop (Gnome, KDE etc..).
| Enumerator | |
|---|---|
| Other | |
| Gnome | |
| KDE | |
Definition at line 116 of file GHOST_SystemWayland.hh.
| 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().
| bool ghost_wl_display_report_error_if_set | ( | wl_display * | display | ) |
Definition at line 2190 of file GHOST_SystemWayland.cc.
References ghost_wl_display_report_error_from_code(), ghost_wl_display_report_error_if_set(), wl_display, and wl_display_get_error.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland(), and ghost_wl_display_report_error_if_set().
| bool ghost_wl_output_own | ( | const struct wl_output * | wl_output | ) |
References ghost_wl_output_own(), ghost_wl_output_tag(), and ghost_wl_output_user_data().
Referenced by GHOST_SystemWayland::output_unref().
| void ghost_wl_output_tag | ( | struct wl_output * | wl_output | ) |
Definition at line 10760 of file GHOST_SystemWayland.cc.
References ghost_wl_output_tag(), ghost_wl_output_tag_id, and wl_proxy_set_tag.
Referenced by ghost_wl_output_own(), ghost_wl_output_tag(), and gwl_registry_wl_output_add().
| struct GWL_Output * ghost_wl_output_user_data | ( | struct wl_output * | wl_output | ) |
Definition at line 11103 of file GHOST_SystemWayland.cc.
References GHOST_ASSERT, ghost_wl_output_own(), ghost_wl_output_user_data(), and output.
Referenced by cursor_surface_handle_enter(), cursor_surface_handle_leave(), ghost_wl_output_own(), ghost_wl_output_user_data(), GHOST_SystemWayland::output_unref(), surface_handle_enter(), and surface_handle_leave().
| bool ghost_wl_surface_own | ( | const struct wl_surface * | wl_surface | ) |
References ghost_wl_surface_own(), ghost_wl_surface_tag(), ghost_wl_surface_user_data(), and wl_surface.
| bool ghost_wl_surface_own_cursor_pointer | ( | const struct wl_surface * | wl_surface | ) |
| bool ghost_wl_surface_own_cursor_tablet | ( | const struct wl_surface * | wl_surface | ) |
| 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.
| void ghost_wl_surface_tag | ( | struct wl_surface * | wl_surface | ) |
Definition at line 10766 of file GHOST_SystemWayland.cc.
References ghost_wl_surface_tag(), ghost_wl_surface_tag_id, wl_proxy_set_tag, and wl_surface.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland(), ghost_wl_surface_own(), and ghost_wl_surface_tag().
| void ghost_wl_surface_tag_cursor_pointer | ( | struct wl_surface * | wl_surface | ) |
Definition at line 10772 of file GHOST_SystemWayland.cc.
References ghost_wl_surface_cursor_pointer_tag_id, ghost_wl_surface_tag_cursor_pointer(), wl_proxy_set_tag, and wl_surface.
Referenced by ghost_wl_surface_own_cursor_pointer(), ghost_wl_surface_tag_cursor_pointer(), and gwl_seat_capability_pointer_enable().
| void ghost_wl_surface_tag_cursor_tablet | ( | struct wl_surface * | wl_surface | ) |
Definition at line 10778 of file GHOST_SystemWayland.cc.
References ghost_wl_surface_cursor_tablet_tag_id, ghost_wl_surface_tag_cursor_tablet(), wl_proxy_set_tag, and wl_surface.
Referenced by ghost_wl_surface_own_cursor_tablet(), ghost_wl_surface_tag_cursor_tablet(), and tablet_seat_handle_tool_added().
| GHOST_WindowWayland * ghost_wl_surface_user_data | ( | struct wl_surface * | wl_surface | ) |
Definition at line 11111 of file GHOST_SystemWayland.cc.
References GHOST_ASSERT, ghost_wl_surface_own(), ghost_wl_surface_user_data(), and wl_surface.
Referenced by cursor_shape_refresh_for_pointer(), data_device_handle_drop(), dnd_events(), GHOST_SystemWayland::getCursorPosition(), ghost_wl_surface_own(), ghost_wl_surface_user_data(), gwl_seat_key_repeat_timer_fn(), keyboard_handle_enter(), keyboard_handle_key(), pointer_handle_enter(), pointer_handle_frame(), pointer_handle_leave(), relative_pointer_handle_relative_motion(), setCursorGrab_use_software_confine(), GHOST_SystemWayland::setCursorPosition(), tablet_tool_handle_frame(), tablet_tool_handle_proximity_in(), touch_seat_handle_down(), touch_seat_handle_frame(), and GHOST_SystemWayland::window_cursor_grab_set().
| 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().
| int gwl_window_scale_int_from | ( | const GWL_WindowScaleParams & | scale_params, |
| int | value ) |
Definition at line 208 of file GHOST_WindowWayland.cc.
References gwl_window_scale_int_from(), and gwl_window_scale_wl_fixed_from().
Referenced by ghost_wl_surface_own_cursor_tablet(), and gwl_window_scale_int_from().
| int gwl_window_scale_int_to | ( | const GWL_WindowScaleParams & | scale_params, |
| int | value ) |
Definition at line 204 of file GHOST_WindowWayland.cc.
References gwl_window_scale_int_to(), and gwl_window_scale_wl_fixed_to().
Referenced by ghost_wl_surface_own_cursor_tablet(), gwl_window_scale_buffer_size_to(), and gwl_window_scale_int_to().
| wl_fixed_t gwl_window_scale_wl_fixed_from | ( | const GWL_WindowScaleParams & | scale_params, |
| wl_fixed_t | value ) |
Definition at line 195 of file GHOST_WindowWayland.cc.
References FRACTIONAL_DENOMINATOR, gwl_window_scale_wl_fixed_from(), GWL_WindowScaleParams::is_fractional, and GWL_WindowScaleParams::scale.
Referenced by ghost_wl_surface_own_cursor_tablet(), gwl_window_scale_int_from(), gwl_window_scale_wl_fixed_from(), and GHOST_SystemWayland::window_cursor_grab_set().
| wl_fixed_t gwl_window_scale_wl_fixed_to | ( | const GWL_WindowScaleParams & | scale_params, |
| wl_fixed_t | value ) |
Definition at line 187 of file GHOST_WindowWayland.cc.
References FRACTIONAL_DENOMINATOR, gwl_window_scale_wl_fixed_to(), GWL_WindowScaleParams::is_fractional, and GWL_WindowScaleParams::scale.
Referenced by ghost_wl_surface_own_cursor_tablet(), gwl_window_scale_int_to(), gwl_window_scale_wl_fixed_to(), and GHOST_SystemWayland::window_cursor_grab_set().