|
Blender V5.3
|
#include <GHOST_WindowWayland.hh>
Inherits GHOST_Window.
GHOST Implementation | |
WAYLAND specific implementation of the GHOST_Window interface. | |
| GHOST_TSuccess | hasCursorShape (GHOST_TStandardCursor cursor_shape) override |
| GHOST_WindowWayland (GHOST_SystemWayland *system, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, const GHOST_IWindow *parent_window, GHOST_TDrawingContextType type, const bool is_dialog, const GHOST_ContextParams &context_params, const bool exclusive, const GHOST_GPUDevice &preferred_device) | |
| ~GHOST_WindowWayland () override | |
| GHOST_TSuccess | swapBufferRelease () override |
| uint16_t | getDPIHint () override |
| GHOST_TWindowTiledFlag | getTiledEdges () const override |
| GHOST_TSuccess | setWindowCursorGrab (GHOST_TGrabCursorMode mode) override |
| GHOST_TSuccess | setWindowCursorShape (GHOST_TStandardCursor shape) override |
| GHOST_TSuccess | setWindowCustomCursorGenerator (GHOST_CursorGenerator *cursor_generator) override |
| GHOST_TSuccess | setWindowCustomCursorShape (const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color) override |
| bool | getCursorGrabUseSoftwareDisplay () override |
| GHOST_TSuccess | getCursorBitmap (GHOST_CursorBitmapRef *bitmap) override |
| bool | getValid () const override |
| void | setTitle (const char *title) override |
| std::string | getTitle () const override |
| void | getWindowBounds (GHOST_Rect &bounds) const override |
| void | getClientBounds (GHOST_Rect &bounds) const override |
| GHOST_TSuccess | setClientWidth (uint32_t width) override |
| GHOST_TSuccess | setClientHeight (uint32_t height) override |
| GHOST_TSuccess | setClientSize (uint32_t width, uint32_t height) override |
| void | screenToClient (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override |
| void | clientToScreen (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override |
| GHOST_TSuccess | setWindowCursorVisibility (bool visible) override |
| GHOST_TSuccess | setState (GHOST_TWindowState state) override |
| GHOST_TWindowState | getState () const override |
| GHOST_TSuccess | invalidate () override |
| GHOST_TSuccess | setOrder (GHOST_TWindowOrder order) override |
| bool | isDialog () const override |
Additional Inherited Members | |
| Protected Member Functions inherited from GHOST_Window | |
| virtual bool | getModifiedState () |
| GHOST_TSuccess | releaseNativeHandles () |
| Protected Attributes inherited from GHOST_Window | |
| GHOST_TDrawingContextType | drawing_context_type_ |
| GHOST_TUserDataPtr | user_data_ |
| bool | cursor_visible_ |
| GHOST_TGrabCursorMode | cursor_grab_ |
| GHOST_TAxisFlag | cursor_grab_axis_ |
| int32_t | cursor_grab_init_pos_ [2] |
| int32_t | cursor_grab_accum_pos_ [2] |
| GHOST_Rect | cursor_grab_bounds_ |
| GHOST_TStandardCursor | cursor_shape_ |
| bool | progress_bar_visible_ |
| bool | can_accept_drag_operation_ |
| bool | is_unsaved_changes_ |
| bool | full_screen_ |
| GHOST_TWindowDecorationStyleFlags | window_decoration_style_flags_ |
| GHOST_WindowDecorationStyleSettings | window_decoration_style_settings_ |
| GHOST_ContextParams | want_context_params_ |
| uint32_t | full_screen_width_ |
| uint32_t | full_screen_height_ |
| float | native_pixel_size_ |
| GHOST_WindowHDRInfo | hdr_info_ = GHOST_WINDOW_HDR_INFO_NONE |
Definition at line 105 of file GHOST_WindowWayland.hh.
| GHOST_WindowWayland::GHOST_WindowWayland | ( | GHOST_SystemWayland * | system, |
| const char * | title, | ||
| int32_t | left, | ||
| int32_t | top, | ||
| uint32_t | width, | ||
| uint32_t | height, | ||
| GHOST_TWindowState | state, | ||
| const GHOST_IWindow * | parent_window, | ||
| GHOST_TDrawingContextType | type, | ||
| const bool | is_dialog, | ||
| const GHOST_ContextParams & | context_params, | ||
| const bool | exclusive, | ||
| const GHOST_GPUDevice & | preferred_device ) |
Definition at line 1774 of file GHOST_WindowWayland.cc.
References GWL_ImageDescriptionWait::done, FRACTIONAL_DENOMINATOR, GHOST_ASSERT, GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowStateFullScreen, GHOST_PRINT, GHOST_Window::GHOST_Window(), GHOST_WindowWayland(), ghost_wl_display_report_error_if_set(), ghost_wl_surface_tag(), gwl_round_int2_by(), gwl_round_int_test(), gwl_window_frame_pending_fractional_scale_set_notest(), gwl_window_state_set(), gwl_window_title_set(), GHOST_WindowHDRInfo::hdr_enabled, GHOST_Window::hdr_info_, image_description_listener, GWL_XDG_Decor_Window::initial_bounds, GWL_XDG_Decor_Window::initial_configure_seen, outputs_changed_update_scale(), outputs_uniform_scale_or_default(), GWL_ImageDescriptionWait::ready, GHOST_WindowHDRInfo::sdr_white_level, GHOST_SystemWayland::server_mutex, GHOST_Window::setDrawingContextType(), GHOST_Window::setSwapInterval(), GHOST_ContextVK_WindowInfo::size, state, GHOST_SystemWayland::supports_color_manager_extended_srgb_linear(), GHOST_SystemWayland::supports_color_manager_feature_windows_scrgb(), GWL_XDG_Decor_Window::surface, GWL_XDG_Decor_Window::toplevel, GWL_XDG_Decor_Window::toplevel_decor, UNPACK2, GHOST_ContextParams::use_alpha, GHOST_Window::want_context_params_, GHOST_WindowHDRInfo::wide_gamut_enabled, wl_display, wl_display_dispatch, wl_display_dispatch_queue, wl_display_flush, GHOST_SystemWayland::wl_display_get(), wl_egl_window_create, wl_proxy_set_queue, wl_surface_listener, GHOST_SystemWayland::wp_color_manager_get(), GHOST_SystemWayland::wp_color_manager_queue_get(), wp_fractional_scale_listener, GHOST_SystemWayland::wp_fractional_scale_manager_get(), GHOST_SystemWayland::xdg_app_id_get(), xdg_surface_listener, xdg_toplevel_decoration_v1_listener, and xdg_toplevel_listener.
Referenced by GHOST_SystemWayland::createWindow(), GHOST_WindowWayland(), and setWindowCursorShape().
|
override |
Definition at line 2177 of file GHOST_WindowWayland.cc.
References gwl_window_cursor_custom_free(), gwl_xdg_decor_window_destroy(), gwl_xdg_window_icon_free(), GHOST_Window::releaseNativeHandles(), wl_display_flush, and wl_egl_window_destroy.
| GHOST_TSuccess GHOST_WindowWayland::activate | ( | ) |
Set the window as active and send an GHOST_kEventWindowActivate event.
Definition at line 2715 of file GHOST_WindowWayland.cc.
References GHOST_kEventWindowActivate, and GHOST_kFailure.
Referenced by gwl_window_frame_update_from_pending_no_lock().
|
overridevirtual |
Converts a point in client rectangle coordinates to screen coordinates.
| inX | The x-coordinate in the client rectangle. |
| inY | The y-coordinate in the client rectangle. |
| outX | The x-coordinate on the screen. |
| outY | The y-coordinate on the screen. |
Implements GHOST_IWindow.
Definition at line 2474 of file GHOST_WindowWayland.cc.
| GHOST_TSuccess GHOST_WindowWayland::close | ( | ) |
Definition at line 2709 of file GHOST_WindowWayland.cc.
References GHOST_kEventWindowClose.
Referenced by xdg_toplevel_handle_close().
| GHOST_TSuccess GHOST_WindowWayland::cursor_shape_refresh | ( | ) |
Refresh the cursor using the cursor assigned to this window.
Definition at line 2778 of file GHOST_WindowWayland.cc.
References GHOST_Window::cursor_shape_, GHOST_kSuccess, gwl_window_cursor_shape_refresh(), gwl_window_pending_actions_tag(), and PENDING_WINDOW_CURSOR_SHAPE_REFRESH.
Referenced by cursor_shape_refresh_for_pointer(), pointer_handle_enter(), setWindowCustomCursorGenerator(), tablet_tool_handle_frame(), tablet_tool_handle_proximity_in(), and touch_seat_handle_down().
| GHOST_TSuccess GHOST_WindowWayland::deactivate | ( | ) |
De-activate the window and send a GHOST_kEventWindowDeactivate event.
Definition at line 2737 of file GHOST_WindowWayland.cc.
References GHOST_kEventWindowDeactivate.
Referenced by gwl_window_frame_update_from_pending_no_lock().
|
overridevirtual |
Returns the client rectangle dimensions. The left and top members of the rectangle are always zero.
| bounds | The bounding rectangle of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 2431 of file GHOST_WindowWayland.cc.
References GHOST_Rect::set(), and UNPACK2.
Referenced by getCursorPositionClientRelative_impl(), getWindowBounds(), relative_pointer_handle_relative_motion_impl(), and setWindowCursorGrab().
|
overridevirtual |
Reimplemented from GHOST_Window.
Definition at line 2399 of file GHOST_WindowWayland.cc.
|
overridevirtual |
Return true when a software cursor should be used.
Reimplemented from GHOST_Window.
Definition at line 2347 of file GHOST_WindowWayland.cc.
References GHOST_Window::cursor_grab_.
|
overridevirtual |
Returns the recommended DPI for this window.
Reimplemented from GHOST_Window.
Definition at line 2488 of file GHOST_WindowWayland.cc.
References base_dpi, and gwl_window_fractional_to_viewport().
|
overridevirtual |
Returns the state of the window (normal, minimized, maximized).
Implements GHOST_IWindow.
Definition at line 2530 of file GHOST_WindowWayland.cc.
References gwl_window_state_get().
|
overridevirtual |
Returns which of the window's edges the compositor has tiled, as a bit-mask of GHOST_TWindowTiledFlag. Zero when the window is free floating, or on backends that don't report tiling.
Reimplemented from GHOST_IWindow.
Definition at line 2483 of file GHOST_WindowWayland.cc.
|
overridevirtual |
Returns the title displayed in the title bar.
Implements GHOST_IWindow.
Definition at line 2420 of file GHOST_WindowWayland.cc.
|
overridevirtual |
Returns indication as to whether the window is valid.
Reimplemented from GHOST_Window.
Definition at line 2407 of file GHOST_WindowWayland.cc.
References GHOST_Window::getValid().
Referenced by GHOST_SystemWayland::createWindow().
|
overridevirtual |
Returns the window rectangle dimensions. These are screen coordinates.
| bounds | The bounding rectangle of the window. |
Implements GHOST_IWindow.
Definition at line 2426 of file GHOST_WindowWayland.cc.
References getClientBounds().
| GWL_XDG_WindowIcon & GHOST_WindowWayland::gwl_xdg_icon_get | ( | ) |
Definition at line 2659 of file GHOST_WindowWayland.cc.
Referenced by GHOST_SystemWayland::xdg_toplevel_icon_update().
|
overridevirtual |
Test if the standard cursor shape is supported by current platform.
Implements GHOST_IWindow.
Definition at line 2269 of file GHOST_WindowWayland.cc.
|
overridevirtual |
Invalidates the contents of this window.
Implements GHOST_IWindow.
Definition at line 2538 of file GHOST_WindowWayland.cc.
References GHOST_kSuccess.
|
overridevirtual |
Reimplemented from GHOST_Window.
Definition at line 2556 of file GHOST_WindowWayland.cc.
| GHOST_TSuccess GHOST_WindowWayland::notify_decor_redraw | ( | ) |
Definition at line 2762 of file GHOST_WindowWayland.cc.
References GHOST_kEventWindowUpdateDecor.
Referenced by gwl_window_frame_update_from_pending_no_lock().
| GHOST_TSuccess GHOST_WindowWayland::notify_size | ( | ) |
Definition at line 2756 of file GHOST_WindowWayland.cc.
References GHOST_kEventWindowSize.
Referenced by gwl_window_frame_pending_size_set().
| bool GHOST_WindowWayland::outputs_changed_update_scale | ( | ) |
Return true when the windows scale or DPI changes.
Definition at line 2801 of file GHOST_WindowWayland.cc.
References ARRAY_SIZE(), FRACTIONAL_DENOMINATOR, gwl_round_int_by(), gwl_window_frame_update_from_pending_no_lock(), gwl_window_pending_actions_tag(), outputs_get(), outputs_max_scale_or_default(), and PENDING_OUTPUT_SCALE_UPDATE.
Referenced by GHOST_WindowWayland(), gwl_window_pending_actions_handle(), and outputs_changed_update_scale_tag().
| void GHOST_WindowWayland::outputs_changed_update_scale_tag | ( | ) |
Definition at line 2789 of file GHOST_WindowWayland.cc.
References gwl_window_pending_actions_tag(), outputs_changed_update_scale(), and PENDING_OUTPUT_SCALE_UPDATE_DEFERRED.
Referenced by GHOST_SystemWayland::output_scale_update(), GHOST_SystemWayland::output_unref(), surface_handle_enter(), surface_handle_leave(), and wp_fractional_scale_handle_preferred_scale().
| bool GHOST_WindowWayland::outputs_enter | ( | GWL_Output * | output | ) |
Definition at line 2928 of file GHOST_WindowWayland.cc.
References output.
Referenced by surface_handle_enter().
| const std::span< GWL_Output *const > GHOST_WindowWayland::outputs_get | ( | ) | const |
Definition at line 2696 of file GHOST_WindowWayland.cc.
Referenced by GHOST_SystemWayland::output_scale_update(), and outputs_changed_update_scale().
| bool GHOST_WindowWayland::outputs_leave | ( | GWL_Output * | output | ) |
Definition at line 2938 of file GHOST_WindowWayland.cc.
References output.
Referenced by GHOST_SystemWayland::output_unref(), and surface_handle_leave().
| void GHOST_WindowWayland::pending_actions_handle | ( | ) |
Definition at line 2945 of file GHOST_WindowWayland.cc.
References GHOST_ASSERT, GWL_Window::ghost_system, gwl_window_pending_actions_handle(), and GHOST_SystemWayland::main_thread_id.
Referenced by GHOST_SystemWayland::processEvents().
| int GHOST_WindowWayland::scale_get | ( | ) | const |
Definition at line 2645 of file GHOST_WindowWayland.cc.
Referenced by setCursorGrab_use_software_confine().
| const GWL_WindowScaleParams & GHOST_WindowWayland::scale_params_get | ( | ) | const |
Definition at line 2664 of file GHOST_WindowWayland.cc.
References GWL_WindowScaleParams::is_fractional, and GWL_WindowScaleParams::scale.
Referenced by GHOST_SystemWayland::xdg_toplevel_icon_update().
|
overridevirtual |
Converts a point in screen coordinates to client rectangle coordinates
| inX | The x-coordinate on the screen. |
| inY | The y-coordinate on the screen. |
| outX | The x-coordinate in the client rectangle. |
| outY | The y-coordinate in the client rectangle. |
Implements GHOST_IWindow.
Definition at line 2465 of file GHOST_WindowWayland.cc.
|
overridevirtual |
Resizes client rectangle height.
| height | The new height of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 2442 of file GHOST_WindowWayland.cc.
References setClientSize().
|
overridevirtual |
Resizes client rectangle.
| width | The new width of the client area of the window. |
| height | The new height of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 2447 of file GHOST_WindowWayland.cc.
References GWL_WindowFrame::buffer_scale, GHOST_kSuccess, gwl_round_int2_by(), gwl_window_frame_pending_size_set(), and GWL_WindowFrame::size.
Referenced by setClientHeight(), and setClientWidth().
|
overridevirtual |
Resizes client rectangle width.
| width | The new width of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 2437 of file GHOST_WindowWayland.cc.
References setClientSize().
|
overridevirtual |
Sets the order of the window (bottom, top).
| order | The order of the window. |
Implements GHOST_IWindow.
Definition at line 2543 of file GHOST_WindowWayland.cc.
References GHOST_kSuccess, GHOST_kWindowOrderTop, and gwl_window_activate().
|
overridevirtual |
Sets the state of the window (normal, minimized, maximized).
| state | The state of the window. |
Implements GHOST_IWindow.
Definition at line 2522 of file GHOST_WindowWayland.cc.
References GHOST_kFailure, GHOST_kSuccess, gwl_window_state_set(), and state.
|
overridevirtual |
Sets the title displayed in the title bar.
| title | The title to display in the title bar. |
Implements GHOST_IWindow.
Definition at line 2412 of file GHOST_WindowWayland.cc.
References gwl_window_title_set().
|
overridevirtual |
Sets the cursor grab on the window using native window system calls.
Reimplemented from GHOST_Window.
Definition at line 2274 of file GHOST_WindowWayland.cc.
References GHOST_Window::cursor_grab_, GHOST_Window::cursor_grab_axis_, GHOST_Window::cursor_grab_init_pos_, getClientBounds(), GHOST_Window::getCursorGrabBounds(), GHOST_kFailure, GHOST_kGrabWrap, and GHOST_kSuccess.
|
overridevirtual |
Implements GHOST_Window.
Definition at line 2303 of file GHOST_WindowWayland.cc.
References GHOST_Window::cursor_shape_, GHOST_kFailure, GHOST_kStandardCursorDefault, GHOST_kSuccess, GHOST_WindowWayland(), gwl_window_cursor_custom_clear(), wl_display, wl_display_dispatch_pending, and wl_display_flush.
|
overridevirtual |
Sets the cursor visibility on the window using native window system calls.
Implements GHOST_Window.
Definition at line 2505 of file GHOST_WindowWayland.cc.
References GHOST_kSuccess, wl_display, wl_display_dispatch_pending, and wl_display_flush.
|
overridevirtual |
Reimplemented from GHOST_Window.
Definition at line 2355 of file GHOST_WindowWayland.cc.
References GHOST_Window::cursor_shape_, cursor_shape_refresh(), GHOST_kStandardCursorCustom, GHOST_kSuccess, gwl_window_cursor_custom_free(), wl_display, wl_display_dispatch_pending, and wl_display_flush.
|
overridevirtual |
Implements GHOST_Window.
Definition at line 2382 of file GHOST_WindowWayland.cc.
References GHOST_ASSERT, GHOST_kFailure, and mask().
|
overridevirtual |
Reimplemented from GHOST_Window.
Definition at line 2262 of file GHOST_WindowWayland.cc.
References GHOST_ASSERT, and GHOST_Window::swapBufferRelease().
| wl_fixed_t GHOST_WindowWayland::wl_fixed_from_window | ( | wl_fixed_t | value | ) | const |
Definition at line 2675 of file GHOST_WindowWayland.cc.
References gwl_window_fractional_from_viewport().
Referenced by getCursorPositionClientRelative_impl(), relative_pointer_handle_relative_motion_impl(), and setCursorPositionClientRelative_impl().
| wl_fixed_t GHOST_WindowWayland::wl_fixed_to_window | ( | wl_fixed_t | value | ) | const |
Definition at line 2683 of file GHOST_WindowWayland.cc.
References gwl_window_fractional_to_viewport().
Referenced by getCursorPositionClientRelative_impl().
| wl_surface * GHOST_WindowWayland::wl_surface_get | ( | ) | const |
Definition at line 2691 of file GHOST_WindowWayland.cc.
References wl_surface.
Referenced by gwl_window_activate().