|
Blender V5.3
|
#include <GHOST_SystemWayland.hh>
Inherits GHOST_System.
Public Member Functions | |
| GHOST_SystemWayland () | |
| void | ime_begin (const GHOST_WindowWayland *win, int32_t x, int32_t y, int32_t w, int32_t h, bool completed) const |
| void | ime_end (const GHOST_WindowWayland *win) const |
Public WAYLAND Utility Functions | |
Functionality only used for the WAYLAND implementation. | |
| uint64_t | ms_from_input_time (const uint32_t timestamp_as_uint) |
| GHOST_TSuccess | pushEvent_maybe_pending (std::unique_ptr< const GHOST_IEvent > event) |
| void | seat_active_set (const struct GWL_Seat *seat) |
| struct wl_seat * | wl_seat_active_get_with_input_serial (uint32_t &serial) |
| bool | output_unref (struct wl_output *wl_output) |
| void | output_scale_update (GWL_Output *output) |
| bool | window_surface_unref (const wl_surface *wl_surface) |
| bool | window_cursor_grab_set (const GHOST_TGrabCursorMode mode, const GHOST_TGrabCursorMode mode_current, int32_t init_grab_xy[2], const GHOST_Rect *wrap_bounds, GHOST_TAxisFlag wrap_axis, wl_surface *wl_surface, const struct GWL_WindowScaleParams &scale_params, const GHOST_TDrawingContextType context_type) |
| Public Member Functions inherited from GHOST_System | |
| GHOST_ITimerTask * | installTimer (uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timer_proc, GHOST_TUserDataPtr user_data=nullptr) override |
| GHOST_TSuccess | removeTimer (GHOST_ITimerTask *timerTask) override |
| GHOST_TSuccess | disposeWindow (GHOST_IWindow *window) override |
| bool | validWindow (GHOST_IWindow *window) override |
| bool | useNativePixel () override |
| void | useWindowFocus (const bool use_focus) override |
| void | setAutoFocus (const bool auto_focus) override |
| GHOST_IWindow * | getWindowUnderCursor (int32_t x, int32_t y) override |
| void | dispatchEvents () override |
| GHOST_TSuccess | addEventConsumer (GHOST_IEventConsumer *consumer) override |
| GHOST_TSuccess | removeEventConsumer (GHOST_IEventConsumer *consumer) override |
| GHOST_TSuccess | getModifierKeyState (GHOST_TModifierKey mask, bool &is_down) const override |
| GHOST_TSuccess | getButtonState (GHOST_TButton mask, bool &is_down) const override |
| void | setTabletAPI (GHOST_TTabletAPI api) override |
| GHOST_TTabletAPI | getTabletAPI () |
| GHOST_TSuccess | getPixelAtCursor (float r_color[3]) const override |
| void | setWindowCSD (const GHOST_CSD_Params ¶ms) override |
| const GHOST_CSD_Params & | getWindowCSD () const |
| void | setWindowCSD_Layout (const GHOST_CSD_Layout &csd_layout) |
| const GHOST_CSD_Layout & | getWindowCSD_Layout () const override |
| void | setIconGenerator (const GHOST_IconGenerator *icon_generator) override |
| GHOST_TSuccess | showMessageBox (const char *, const char *, const char *, const char *, const char *, GHOST_DialogOptions) const override |
| GHOST_TSuccess | pushEvent (std::unique_ptr< const GHOST_IEvent > event) |
| GHOST_TimerManager * | getTimerManager () const |
| GHOST_EventManager * | getEventManager () const |
| GHOST_WindowManager * | getWindowManager () const |
| void | initDebug (GHOST_Debug debug) override |
| bool | isDebugEnabled () override |
Public Attributes | |
| std::mutex * | server_mutex = nullptr |
| std::mutex * | timer_mutex = nullptr |
| std::thread::id | main_thread_id |
| std::atomic< bool > | has_pending_actions_for_window = false |
| Public Attributes inherited from GHOST_System | |
| bool | native_pixel_ |
| bool | window_focus_ |
| bool | auto_focus_ |
| GHOST_CSD_Params | window_csd_params_ |
| GHOST_CSD_Layout | window_csd_layout_ |
| const GHOST_IconGenerator * | icon_generator_ = nullptr |
Public WAYLAND Direct Data Access | |
Expose some members via methods. | |
| GHOST_TimerManager * | key_repeat_timer_manager () |
| void | xdg_toplevel_icon_update (GHOST_WindowWayland *window, struct xdg_toplevel *toplevel) |
| struct wl_display * | wl_display_get () |
| struct wl_compositor * | wl_compositor_get () |
| struct wl_subcompositor * | wl_subcompositor_get () |
| struct zwp_primary_selection_device_manager_v1 * | wp_primary_selection_manager_get () |
| struct xdg_activation_v1 * | xdg_activation_manager_get () |
| struct zwp_pointer_gestures_v1 * | wp_pointer_gestures_get () |
| struct wp_fractional_scale_manager_v1 * | wp_fractional_scale_manager_get () |
| struct wp_viewporter * | wp_viewporter_get () |
| struct wp_color_manager_v1 * | wp_color_manager_get () |
| struct wl_event_queue * | wp_color_manager_queue_get () |
| bool | supports_color_manager_feature_windows_scrgb () const |
| bool | supports_color_manager_extended_srgb_linear () const |
| struct xdg_wm_base * | xdg_decor_shell_get () |
| struct zxdg_decoration_manager_v1 * | xdg_decor_manager_get () |
| const std::span< GWL_Output *const > | outputs_get () const |
| struct wl_shm * | wl_shm_get () const |
| bool | use_window_frame_get () const |
| bool | use_window_frame_csd_get () const |
| int | preferences_cursor_size_get () const |
| static const char * | xdg_app_id_get () |
Additional Inherited Members | |
| Static Public Member Functions inherited from GHOST_ISystem | |
| static GHOST_TSuccess | createSystem (bool verbose=true, bool background=false) |
| static GHOST_TSuccess | createSystemBackground () |
| static GHOST_TSuccess | disposeSystem () |
| static GHOST_ISystem * | getSystem () |
| static const char * | getSystemBackend () |
| static GHOST_TBacktraceFn | getBacktraceFn () |
| static void | setBacktraceFn (GHOST_TBacktraceFn backtrace_fn) |
| static bool | getUseWindowFrame () |
| static void | setUseWindowFrame (bool use_window_frame) |
| Protected Member Functions inherited from GHOST_System | |
| GHOST_System () | |
| ~GHOST_System () override | |
| GHOST_TSuccess | exit () override |
| Protected Member Functions inherited from GHOST_ISystem | |
| GHOST_ISystem () | |
| virtual | ~GHOST_ISystem ()=default |
| Protected Attributes inherited from GHOST_System | |
| GHOST_TimerManager * | timer_manager_ |
| GHOST_WindowManager * | window_manager_ |
| GHOST_EventManager * | event_manager_ |
| bool | multitouch_gestures_ |
| GHOST_TTabletAPI | tablet_api_ |
| bool | is_debug_enabled_ |
| Static Protected Attributes inherited from GHOST_ISystem | |
| static GHOST_ISystem * | system_ = nullptr |
| static const char * | system_backend_id_ = nullptr |
| static GHOST_TBacktraceFn | backtrace_fn_ = nullptr |
| static bool | use_window_frame_ = true |
Definition at line 199 of file GHOST_SystemWayland.hh.
| GHOST_SystemWayland::GHOST_SystemWayland | ( | bool | background | ) |
Definition at line 9073 of file GHOST_SystemWayland.cc.
References cursor_size_from_env(), default_cursor_size, GHOST_ISystem::getUseWindowFrame(), GHOST_ASSERT, GHOST_System::GHOST_System(), GHOST_TimerManager::GHOST_TimerManager(), ghost_wayland_current_desktop(), ghost_wayland_log_handler(), ghost_wayland_log_handler_background(), GHOST_WindowCSD_Check(), GHOST_WindowCSD_LayoutDefault(), Gnome, gwl_display_event_thread_create(), gwl_registry_entry_update_all(), KDE, main_thread_id, registry_listener, server_mutex, GHOST_System::setWindowCSD_Layout(), GWL_XDG_Decor_System::shell, timer_mutex, USE_EVENT_BACKGROUND_THREAD, use_gnome_motion_missing_time_hack, use_kde_tablet_hidden_cursor_hack, wl_display_connect, wl_display_roundtrip, and wl_log_set_handler_client.
Referenced by GHOST_SystemWayland().
|
inline |
Definition at line 202 of file GHOST_SystemWayland.hh.
References GHOST_SystemWayland().
Referenced by GHOST_ISystem::createSystem().
|
override |
Definition at line 9212 of file GHOST_SystemWayland.cc.
|
overridevirtual |
Create a new off-screen context. Never explicitly delete the context, use disposeContext() instead.
Implements GHOST_System.
Definition at line 10093 of file GHOST_SystemWayland.cc.
References GHOST_GPUSettings::context_type, GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS_OFFSCREEN, GHOST_ContextEGL::GHOST_ContextEGL(), GHOST_ContextVK::GHOST_ContextVK(), GHOST_OPENGL_EGL_CONTEXT_FLAGS, GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY, GHOST_PRINT, GHOST_ContextParams::is_debug, GHOST_GPUSettings::preferred_device, server_mutex, wl_compositor_get(), wl_egl_window_create, wl_egl_window_destroy, and wl_surface.
|
overridevirtual |
Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.
| title | The name of the window (displayed in the title bar of the window if the OS supports it). |
| left | The coordinate of the left edge of the window. |
| top | The coordinate of the top edge of the window. |
| width | The width the window. |
| height | The height the window. |
| state | The state of the window when opened. |
| gpu_settings | Misc GPU settings. |
| exclusive | Use to show the window on top and ignore others (used full-screen). |
| is_dialog | Stay on top of parent window, no icon in taskbar, can't be minimized. |
| parent_window | Parent (embedder) window |
Implements GHOST_ISystem.
Definition at line 10221 of file GHOST_SystemWayland.cc.
References GHOST_WindowManager::addWindow(), GHOST_GPUSettings::context_type, getMilliSeconds(), GHOST_WindowWayland::getValid(), GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS, GHOST_kEventWindowSize, GHOST_WindowWayland::GHOST_WindowWayland(), GHOST_GPUSettings::preferred_device, GHOST_System::pushEvent(), GHOST_WindowManager::setActiveWindow(), state, and GHOST_System::window_manager_.
| GHOST_TSuccess GHOST_SystemWayland::cursor_bitmap_get | ( | GHOST_CursorBitmapRef * | bitmap | ) |
Definition at line 10544 of file GHOST_SystemWayland.cc.
References GWL_Seat::cursor, GWL_Cursor::custom_data, GHOST_CursorBitmapRef::data, GHOST_CursorBitmapRef::data_size, GHOST_kFailure, GHOST_kSuccess, gwl_display_seat_active_get(), GHOST_CursorBitmapRef::hot_spot, GWL_Cursor::is_custom, and GWL_Cursor::wl.
| bool GHOST_SystemWayland::cursor_grab_use_software_display_get | ( | const GHOST_TGrabCursorMode | mode | ) |
Definition at line 10630 of file GHOST_SystemWayland.cc.
References cursor_is_software(), gwl_display_seat_active_get(), and GWL_Seat::use_pointer_software_confine.
| GHOST_TSuccess GHOST_SystemWayland::cursor_shape_check | ( | GHOST_TStandardCursor | cursor_shape | ) |
Definition at line 10350 of file GHOST_SystemWayland.cc.
References GHOST_kFailure, GHOST_kSuccess, gwl_display_seat_active_get(), and gwl_seat_cursor_find_wl_shape_from_ghost().
| GHOST_TSuccess GHOST_SystemWayland::cursor_shape_custom_set | ( | const GHOST_CursorGenerator & | cg | ) |
Definition at line 10474 of file GHOST_SystemWayland.cc.
References GWL_Seat::cursor, cursor_buffer_listener, GWL_Cursor::custom_data, GWL_Cursor::custom_data_size, GWL_CursorShape::device, GHOST_kFailure, GHOST_kSuccess, ghost_wl_buffer_from_cursor_generator(), gwl_display_seat_active_get(), gwl_seat_cursor_buffer_scale_calc(), gwl_seat_cursor_buffer_set_current(), GWL_Cursor::is_custom, scale(), GWL_Cursor::shape, GWL_TabletTool::shape, GWL_Cursor::theme_size, GWL_Cursor::use_dark_theme, GWL_Cursor::visible, GWL_Cursor::wl, and GWL_Seat::wp.
Referenced by gwl_window_cursor_custom_load().
| GHOST_TSuccess GHOST_SystemWayland::cursor_shape_set | ( | GHOST_TStandardCursor | shape | ) |
Definition at line 10291 of file GHOST_SystemWayland.cc.
References GWL_Seat::cursor, GWL_CursorShape::device, GWL_CursorShape::enum_id, GHOST_kFailure, GHOST_kSuccess, gwl_display_seat_active_get(), gwl_seat_cursor_find_wl_shape_from_ghost(), GWL_Cursor::is_custom, GWL_Cursor::is_hardware, GWL_Seat::pointer, GWL_SeatStatePointer::serial, GWL_TabletTool::serial, GWL_Cursor::shape, GWL_TabletTool::shape, GWL_Cursor::visible, GWL_Seat::wl, and GWL_Seat::wp.
Referenced by gwl_window_cursor_shape_refresh().
| GHOST_TSuccess GHOST_SystemWayland::cursor_visibility_set | ( | bool | visible | ) |
Definition at line 10571 of file GHOST_SystemWayland.cc.
References GWL_Seat::cursor, CURSOR_VISIBLE_ALWAYS_SET, GHOST_kFailure, GHOST_kSuccess, gwl_display_seat_active_get(), gwl_seat_cursor_visible_set(), and GWL_Cursor::is_hardware.
|
overridevirtual |
Dispose of a context.
| context | Pointer to the context to be disposed. |
Implements GHOST_ISystem.
Definition at line 10180 of file GHOST_SystemWayland.cc.
References GHOST_kDrawingContextTypeNone, GHOST_kSuccess, server_mutex, wl_egl_window_destroy, and wl_surface.
|
overridevirtual |
Returns the combine dimensions of all monitors.
Implements GHOST_ISystem.
Definition at line 10063 of file GHOST_SystemWayland.cc.
References INT32_MAX, INT32_MIN, output, server_mutex, and UNPACK2.
|
overridevirtual |
Returns the state of the mouse buttons (outside the message queue).
| buttons | The state of the buttons. |
Implements GHOST_System.
Definition at line 9434 of file GHOST_SystemWayland.cc.
References GWL_SeatStatePointer::buttons, GHOST_kFailure, GHOST_kSuccess, gwl_display_seat_active_get(), gwl_seat_state_pointer_active(), and server_mutex.
|
overridevirtual |
Return features supported by the system back-end.
The resulting value doesn't change at run-time.
Implements GHOST_ISystem.
Definition at line 10583 of file GHOST_SystemWayland.cc.
References GHOST_ASSERT, GHOST_CAPABILITY_FLAG_ALL, GHOST_kCapabilityCursorWarp, GHOST_kCapabilityDesktopSample, GHOST_kCapabilityGPUReadFrontBuffer, GHOST_kCapabilityMultiMonitorPlacement, GHOST_kCapabilityTrackpadPhysicalDirection, GHOST_kCapabilityWindowDecorationServerSide, GHOST_kCapabilityWindowDecorationStyles, GHOST_kCapabilityWindowPath, GHOST_kCapabilityWindowPosition, gwl_display_seat_active_get(), has_wl_trackpad_physical_direction, and use_window_frame_csd_get().
|
overridevirtual |
Return the clipboard buffer or null.
| selection | Use the "primary" selection. Check the GHOST_kCapabilityClipboardPrimary for backends that support this. |
Implements GHOST_System.
Definition at line 9592 of file GHOST_SystemWayland.cc.
References server_mutex, system_clipboard_get(), and system_clipboard_get_primary_selection().
|
overridevirtual |
Get image data from the Clipboard
| r_width | the returned image width in pixels. |
| r_height | the returned image height in pixels. |
Reimplemented from GHOST_System.
Definition at line 9742 of file GHOST_SystemWayland.cc.
References blender::ImBuf::byte_data(), blender::ByteData, GWL_Seat::data_offer_copy_paste, GHOST_URL_decode_alloc(), ghost_wl_mime_img_png, ghost_wl_mime_text_uri_list, gwl_clipboard_uri_ranges(), gwl_display_seat_active_get(), blender::IMB_freeImBuf(), blender::IMB_load_image_from_filepath(), blender::IMB_load_image_from_memory(), server_mutex, system_clipboard_get(), GWL_DataOffer::types, blender::ImBuf::x, and blender::ImBuf::y.
|
overridevirtual |
Returns the current location of the cursor (location in screen coordinates)
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Implements GHOST_ISystem.
Definition at line 9991 of file GHOST_SystemWayland.cc.
References getCursorPositionClientRelative_impl(), GHOST_kFailure, ghost_wl_surface_user_data(), gwl_display_seat_active_get(), gwl_seat_state_pointer_active(), server_mutex, GWL_SeatStatePointer::wl, wl_surface, x, and y.
|
overridevirtual |
Returns the current location of the cursor (location in window coordinates)
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Reimplemented from GHOST_System.
Definition at line 9955 of file GHOST_SystemWayland.cc.
References getCursorPositionClientRelative_impl(), GHOST_kFailure, gwl_display_seat_active_get(), gwl_seat_state_pointer_active(), server_mutex, GWL_SeatStatePointer::wl, x, and y.
|
overridevirtual |
Reimplemented from GHOST_System.
Definition at line 10036 of file GHOST_SystemWayland.cc.
References GWL_Seat::cursor, gwl_display_seat_active_get(), server_mutex, and GWL_Cursor::theme_size.
|
overridevirtual |
Returns the dimensions of the main display on this system.
Implements GHOST_ISystem.
Definition at line 10045 of file GHOST_SystemWayland.cc.
References output, server_mutex, and UNPACK2.
|
overridevirtual |
Returns the system time. Returns the number of milliseconds since the start of the system.
Implements GHOST_ISystem.
Definition at line 9864 of file GHOST_SystemWayland.cc.
Referenced by createWindow(), data_device_handle_drop(), data_device_handle_enter(), data_device_handle_leave(), gwl_seat_key_repeat_timer_add(), gwl_window_frame_update_from_pending_no_lock(), keyboard_handle_enter(), ms_from_input_time(), pointer_handle_enter(), pointer_handle_frame(), processEvents(), setCursorPositionClientRelative_impl(), and window_cursor_grab_set().
|
overridevirtual |
Returns the state of all modifier keys.
| keys | The state of all modifier keys (true == pressed). |
Implements GHOST_System.
Definition at line 9347 of file GHOST_SystemWayland.cc.
References CLOG_WARN, GWL_ModifierInfo::display_name, g_modifier_info_table, GHOST_KEY_MODIFIER_TO_INDEX, GHOST_kFailure, GHOST_kSuccess, gwl_display_seat_active_get(), GWL_Seat::key_depressed, GWL_ModifierInfo::key_l, GWL_ModifierInfo::key_r, GWL_Seat::keyboard, LOG_WL_KEYBOARD_DEPRESSED_STATE, MOD_INDEX_NUM, GWL_ModifierInfo::mod_l, GWL_ModifierInfo::mod_r, GWL_KeyboardDepressedState::mods, server_mutex, GHOST_ModifierKeys::set(), state, GWL_SeatStateKeyboard::wl, GWL_Seat::xkb, and GWL_Seat::xkb_keymap_mod_index.
|
overridevirtual |
Returns the number of displays on this system.
Implements GHOST_ISystem.
Definition at line 9855 of file GHOST_SystemWayland.cc.
References server_mutex.
|
overridevirtual |
Returns GHOST_kSuccess if the clipboard contains an image.
Reimplemented from GHOST_System.
Definition at line 9694 of file GHOST_SystemWayland.cc.
References GWL_Seat::data_offer_copy_paste, GWL_Seat::data_offer_copy_paste_has_image, GHOST_kFailure, GHOST_kSuccess, GHOST_URL_decode_alloc(), ghost_wl_mime_img_png, ghost_wl_mime_text_uri_list, gwl_clipboard_uri_ranges(), gwl_display_seat_active_get(), blender::IMB_test_image(), server_mutex, system_clipboard_get(), and GWL_DataOffer::types.
| void GHOST_SystemWayland::ime_begin | ( | const GHOST_WindowWayland * | win, |
| int32_t | x, | ||
| int32_t | y, | ||
| int32_t | w, | ||
| int32_t | h, | ||
| bool | completed ) const |
| void GHOST_SystemWayland::ime_end | ( | const GHOST_WindowWayland * | win | ) | const |
References ms_from_input_time(), output, output_scale_update(), output_unref(), preferences_cursor_size_get(), pushEvent_maybe_pending(), seat_active_set(), use_window_frame_csd_get(), use_window_frame_get(), window_cursor_grab_set(), window_surface_unref(), wl_seat_active_get_with_input_serial(), wl_surface, and xdg_app_id_get().
|
overridevirtual |
Initialize the system.
Reimplemented from GHOST_System.
Definition at line 9217 of file GHOST_SystemWayland.cc.
References GHOST_kFailure, GHOST_kSuccess, GHOST_NDOFManagerUnix::GHOST_NDOFManagerUnix(), and GHOST_System::init().
| GHOST_TimerManager * GHOST_SystemWayland::key_repeat_timer_manager | ( | ) |
Return a separate WAYLAND local timer manager to GHOST_System::getTimerManager Manipulation & access must lock with #GHOST_WaylandSystem::server_mutex.
See GWL_Display::key_repeat_timer_manager docstring for details on why this is needed.
Definition at line 10897 of file GHOST_SystemWayland.cc.
Referenced by gwl_seat_key_repeat_timer_add(), gwl_seat_key_repeat_timer_remove(), and processEvents().
| uint64_t GHOST_SystemWayland::ms_from_input_time | ( | const uint32_t | timestamp_as_uint | ) |
Use this function instead of GHOST_System::getMilliSeconds, passing in the time-stamp from WAYLAND input to get the event time-stamp with an offset applied to make it compatible with getMilliSeconds.
Definition at line 11249 of file GHOST_SystemWayland.cc.
References GWL_DisplayTimeStamp::exact_match, getMilliSeconds(), GWL_DisplayTimeStamp::last, GWL_DisplayTimeStamp::offset, and sub_abs_u64().
Referenced by data_device_handle_motion(), ime_end(), keyboard_handle_key(), pointer_handle_axis(), pointer_handle_axis_stop(), pointer_handle_button(), pointer_handle_motion(), relative_pointer_handle_relative_motion(), tablet_tool_handle_frame(), touch_seat_handle_down(), touch_seat_handle_motion(), and touch_seat_handle_up().
| void GHOST_SystemWayland::output_scale_update | ( | GWL_Output * | output | ) |
Definition at line 11402 of file GHOST_SystemWayland.cc.
References GWL_Seat::cursor, GHOST_System::getWindowManager(), GHOST_WindowManager::getWindows(), output, GWL_SeatStatePointer::outputs, GHOST_WindowWayland::outputs_changed_update_scale_tag(), GHOST_WindowWayland::outputs_get(), GWL_Seat::pointer, GWL_Seat::tablet, and update_cursor_scale().
Referenced by ime_end().
| bool GHOST_SystemWayland::output_unref | ( | struct wl_output * | wl_output | ) |
Clear all references to this output.
Definition at line 11372 of file GHOST_SystemWayland.cc.
References GHOST_System::getWindowManager(), GHOST_WindowManager::getWindows(), ghost_wl_output_own(), ghost_wl_output_user_data(), output, GWL_SeatStatePointer::outputs, GHOST_WindowWayland::outputs_changed_update_scale_tag(), GHOST_WindowWayland::outputs_leave(), GWL_Seat::pointer, and GWL_Seat::tablet.
Referenced by ime_end().
| const std::span< GWL_Output *const > GHOST_SystemWayland::outputs_get | ( | ) | const |
Definition at line 10887 of file GHOST_SystemWayland.cc.
| int GHOST_SystemWayland::preferences_cursor_size_get | ( | ) | const |
Definition at line 10978 of file GHOST_SystemWayland.cc.
Referenced by gwl_seat_capability_pointer_enable(), and ime_end().
|
overridevirtual |
Retrieves events from the system and stores them in the queue.
| waitForEvent | Flag to wait for an event (or return immediately). |
Implements GHOST_ISystem.
Definition at line 9233 of file GHOST_SystemWayland.cc.
References events_pending_default_size, GHOST_System::getEventManager(), getMilliSeconds(), GHOST_System::getTimerManager(), GHOST_System::getWindowManager(), GHOST_kEventWindowActivate, GHOST_kEventWindowDeactivate, ghost_wl_display_event_pump(), ghost_wl_display_report_error(), has_pending_actions_for_window, key_repeat_timer_manager(), lock, GHOST_WindowWayland::pending_actions_handle(), processEvents(), GHOST_System::pushEvent(), server_mutex, GHOST_WindowManager::setActiveWindow(), GHOST_WindowManager::setWindowInactive(), and wl_display_dispatch.
Referenced by processEvents().
| GHOST_TSuccess GHOST_SystemWayland::pushEvent_maybe_pending | ( | std::unique_ptr< const GHOST_IEvent > | event | ) |
Push an event, with support for calling from a thread. NOTE: only needed for USE_EVENT_BACKGROUND_THREAD.
Definition at line 11311 of file GHOST_SystemWayland.cc.
References GHOST_ASSERT, GHOST_kSuccess, lock, main_thread_id, and GHOST_System::pushEvent().
Referenced by data_device_handle_drop(), dnd_events(), gwl_seat_key_repeat_timer_fn(), ime_end(), keyboard_depressed_state_push_events_from_change(), keyboard_handle_key(), pointer_handle_enter(), pointer_handle_frame(), relative_pointer_handle_relative_motion_impl(), tablet_tool_handle_frame(), touch_seat_handle_frame(), and window_cursor_grab_set().
|
overridevirtual |
Put data to the Clipboard
| buffer | The buffer to copy to the clipboard. |
| selection | The clipboard to copy too only used on X11. |
Implements GHOST_System.
Definition at line 9678 of file GHOST_SystemWayland.cc.
References server_mutex, system_clipboard_put(), and system_clipboard_put_primary_selection().
|
overridevirtual |
Put image data to the Clipboard
| rgba | uint array in RGBA byte order. |
| width | the image width in pixels. |
| height | the image height in pixels. |
Reimplemented from GHOST_System.
Definition at line 9804 of file GHOST_SystemWayland.cc.
References GWL_DataSource::buffer_out, blender::ByteData, blender::Vector< T, InlineBufferCapacity, Allocator >::data(), GWL_SimpleBuffer::data, GWL_SimpleBuffer::data_size, GWL_Seat::data_source, data_source_listener, GWL_Seat::data_source_mutex, GWL_Seat::data_source_serial, blender::ImBuf::foptions, blender::ImBuf::ftype, GHOST_kFailure, GHOST_kSuccess, ghost_wl_mime_img_png, gwl_display_seat_active_get(), gwl_simple_buffer_free_data(), blender::IMB_allocFromBuffer(), blender::IMB_freeImBuf(), blender::IMB_FTYPE_PNG, blender::IMB_save_image_to_buffer(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), lock, blender::ImbFormatOptions::quality, server_mutex, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), GWL_DataSource::wl, and GWL_Seat::wl.
| void GHOST_SystemWayland::seat_active_set | ( | const struct GWL_Seat * | seat | ) |
Set this seat to be active.
Definition at line 11325 of file GHOST_SystemWayland.cc.
References gwl_display_seat_active_set().
Referenced by data_device_handle_enter(), ime_end(), keyboard_handle_enter(), pointer_handle_enter(), and tablet_tool_handle_proximity_in().
|
overridevirtual |
Set the Console State
| action | console state |
Implements GHOST_ISystem.
Definition at line 9342 of file GHOST_SystemWayland.cc.
|
overridevirtual |
Updates the location of the cursor (location in screen coordinates). Not all operating systems allow the cursor to be moved (without the input device being moved).
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Implements GHOST_ISystem.
Definition at line 10013 of file GHOST_SystemWayland.cc.
References GHOST_kFailure, ghost_wl_surface_user_data(), gwl_display_seat_active_get(), GWL_Seat::pointer, server_mutex, setCursorPositionClientRelative_impl(), GWL_SeatStatePointer::wl, wl_surface, x, and y.
|
overridevirtual |
Updates the location of the cursor (location in window coordinates).
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Reimplemented from GHOST_System.
Definition at line 9975 of file GHOST_SystemWayland.cc.
References GHOST_kFailure, gwl_display_seat_active_get(), server_mutex, setCursorPositionClientRelative_impl(), x, and y.
|
overridevirtual |
Enable multi-touch gestures if supported.
| use | Enable or disable. |
Reimplemented from GHOST_System.
Definition at line 10684 of file GHOST_SystemWayland.cc.
References gwl_seat_capability_pointer_multitouch_check(), gwl_seat_capability_pointer_multitouch_disable(), gwl_seat_capability_pointer_multitouch_enable(), GHOST_System::multitouch_gestures_, and server_mutex.
| bool GHOST_SystemWayland::supports_color_manager_extended_srgb_linear | ( | ) | const |
Definition at line 10845 of file GHOST_SystemWayland.cc.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland().
| bool GHOST_SystemWayland::supports_color_manager_feature_windows_scrgb | ( | ) | const |
Definition at line 10841 of file GHOST_SystemWayland.cc.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland().
| bool GHOST_SystemWayland::use_window_frame_csd_get | ( | ) | const |
Definition at line 10973 of file GHOST_SystemWayland.cc.
Referenced by getCapabilities(), ime_end(), pointer_handle_enter(), pointer_handle_frame(), pointer_handle_leave(), tablet_tool_handle_frame(), and touch_seat_handle_frame().
| bool GHOST_SystemWayland::use_window_frame_get | ( | ) | const |
Definition at line 10968 of file GHOST_SystemWayland.cc.
Referenced by ime_end().
| bool GHOST_SystemWayland::window_cursor_grab_set | ( | const GHOST_TGrabCursorMode | mode, |
| const GHOST_TGrabCursorMode | mode_current, | ||
| int32_t | init_grab_xy[2], | ||
| const GHOST_Rect * | wrap_bounds, | ||
| GHOST_TAxisFlag | wrap_axis, | ||
| wl_surface * | wl_surface, | ||
| const struct GWL_WindowScaleParams & | scale_params, | ||
| const GHOST_TDrawingContextType | context_type ) |
Definition at line 11426 of file GHOST_SystemWayland.cc.
References GHOST_Rect::b_, cursor_is_software(), CURSOR_VISIBLE_ONLY_HIDE, CURSOR_VISIBLE_ONLY_SHOW, ELEM, getMilliSeconds(), GHOST_kEventCursorMove, GHOST_kGrabDisable, GHOST_kGrabHide, GHOST_kGrabNormal, GHOST_kGrabWrap, ghost_wl_surface_user_data(), GWL_Seat::grab_lock_xy, gwl_display_seat_active_get(), gwl_seat_cursor_visible_set(), gwl_window_scale_wl_fixed_from(), gwl_window_scale_wl_fixed_to(), GHOST_Rect::l_, GWL_Seat::pointer, pushEvent_maybe_pending(), GHOST_Rect::r_, relative_pointer_listener, seat_grab_state_from_mode(), setCursorGrab_use_software_confine(), GWL_Seat::system, GHOST_Rect::t_, UNPACK2, GWL_SeatStateGrab::use_confine, GWL_SeatStateGrab::use_lock, GWL_Seat::use_pointer_software_confine, GWL_Seat::wl, wl_surface, GWL_Seat::wp, GHOST_Rect::wrapPoint(), and GWL_SeatStatePointer::xy.
Referenced by ime_end().
| bool GHOST_SystemWayland::window_surface_unref | ( | const wl_surface * | wl_surface | ) |
Clear all references to this surface to prevent accessing nullptr pointers.
Definition at line 11341 of file GHOST_SystemWayland.cc.
References GWL_Seat::keyboard, GWL_Seat::pointer, SURFACE_CLEAR_PTR, GWL_Seat::tablet, GWL_Seat::touch, GWL_Seat::wl, GWL_SeatStateKeyboard::wl, GWL_SeatStatePointer::wl, and wl_surface.
Referenced by ime_end().
| wl_compositor * GHOST_SystemWayland::wl_compositor_get | ( | ) |
Definition at line 10805 of file GHOST_SystemWayland.cc.
Referenced by createOffscreenContext(), gwl_seat_capability_pointer_enable(), and tablet_seat_handle_tool_added().
| wl_display * GHOST_SystemWayland::wl_display_get | ( | ) |
Definition at line 10800 of file GHOST_SystemWayland.cc.
References wl_display.
Referenced by data_device_handle_drop(), and GHOST_WindowWayland::GHOST_WindowWayland().
| wl_seat * GHOST_SystemWayland::wl_seat_active_get_with_input_serial | ( | uint32_t & | serial | ) |
Definition at line 11330 of file GHOST_SystemWayland.cc.
References GWL_Seat::data_source_serial, gwl_display_seat_active_get(), and GWL_Seat::wl.
Referenced by gwl_window_activate(), and ime_end().
| wl_shm * GHOST_SystemWayland::wl_shm_get | ( | ) | const |
Definition at line 10892 of file GHOST_SystemWayland.cc.
| wl_subcompositor * GHOST_SystemWayland::wl_subcompositor_get | ( | ) |
Definition at line 10810 of file GHOST_SystemWayland.cc.
| wp_color_manager_v1 * GHOST_SystemWayland::wp_color_manager_get | ( | ) |
Definition at line 10833 of file GHOST_SystemWayland.cc.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland().
| wl_event_queue * GHOST_SystemWayland::wp_color_manager_queue_get | ( | ) |
Definition at line 10837 of file GHOST_SystemWayland.cc.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland().
| wp_fractional_scale_manager_v1 * GHOST_SystemWayland::wp_fractional_scale_manager_get | ( | ) |
Definition at line 10825 of file GHOST_SystemWayland.cc.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland().
| zwp_pointer_gestures_v1 * GHOST_SystemWayland::wp_pointer_gestures_get | ( | ) |
Definition at line 10850 of file GHOST_SystemWayland.cc.
Referenced by gwl_seat_capability_pointer_multitouch_check(), gwl_seat_capability_pointer_multitouch_disable(), and gwl_seat_capability_pointer_multitouch_enable().
| zwp_primary_selection_device_manager_v1 * GHOST_SystemWayland::wp_primary_selection_manager_get | ( | ) |
Definition at line 10815 of file GHOST_SystemWayland.cc.
| wp_viewporter * GHOST_SystemWayland::wp_viewporter_get | ( | ) |
Definition at line 10829 of file GHOST_SystemWayland.cc.
Referenced by gwl_window_viewport_set().
| xdg_activation_v1 * GHOST_SystemWayland::xdg_activation_manager_get | ( | ) |
Definition at line 10820 of file GHOST_SystemWayland.cc.
Referenced by gwl_window_activate(), and xdg_activation_handle_done().
|
static |
Definition at line 10870 of file GHOST_SystemWayland.cc.
References ghost_wl_app_id.
Referenced by GHOST_WindowWayland::GHOST_WindowWayland(), gwl_window_activate(), and ime_end().
| zxdg_decoration_manager_v1 * GHOST_SystemWayland::xdg_decor_manager_get | ( | ) |
Definition at line 10880 of file GHOST_SystemWayland.cc.
| xdg_wm_base * GHOST_SystemWayland::xdg_decor_shell_get | ( | ) |
Definition at line 10875 of file GHOST_SystemWayland.cc.
| void GHOST_SystemWayland::xdg_toplevel_icon_update | ( | GHOST_WindowWayland * | window, |
| struct xdg_toplevel * | toplevel ) |
Definition at line 10902 of file GHOST_SystemWayland.cc.
References GWL_XDG_WindowIcon::buffer, GWL_XDG_WindowIcon::buffer_data, GWL_XDG_WindowIcon::buffer_size, GHOST_IconGenerator::generate_fn, GHOST_ASSERT, ghost_wl_buffer_create_for_image(), gwl_window_scale_buffer_size_to(), GHOST_WindowWayland::gwl_xdg_icon_get(), gwl_xdg_window_icon_free(), GHOST_System::icon_generator_, GWL_XDG_WindowIcon::icon_pixel_size, rgba_straight_to_premul(), and GHOST_WindowWayland::scale_params_get().
Referenced by gwl_window_frame_update_from_pending_no_lock().
| std::atomic<bool> GHOST_SystemWayland::has_pending_actions_for_window = false |
Definition at line 414 of file GHOST_SystemWayland.hh.
Referenced by gwl_window_pending_actions_tag(), and processEvents().
| std::thread::id GHOST_SystemWayland::main_thread_id |
Definition at line 412 of file GHOST_SystemWayland.hh.
Referenced by GHOST_SystemWayland(), gwl_window_cursor_shape_refresh(), gwl_window_frame_update_from_pending_no_lock(), GHOST_WindowWayland::pending_actions_handle(), pushEvent_maybe_pending(), and xdg_surface_handle_configure().
| std::mutex* GHOST_SystemWayland::server_mutex = nullptr |
Lock to prevent wl_display_dispatch / wl_display_roundtrip / wl_display_flush from running at the same time.
Definition at line 400 of file GHOST_SystemWayland.hh.
Referenced by createOffscreenContext(), disposeContext(), getAllDisplayDimensions(), getButtons(), getClipboard(), getClipboardImage(), getCursorPosition(), getCursorPositionClientRelative(), getCursorPreferredLogicalSize(), getMainDisplayDimensions(), getModifierKeys(), getNumDisplays(), GHOST_SystemWayland(), GHOST_WindowWayland::GHOST_WindowWayland(), gwl_display_event_thread_fn(), hasClipboardImage(), processEvents(), putClipboard(), putClipboardImage(), setCursorPosition(), setCursorPositionClientRelative(), and setMultitouchGestures().
| std::mutex* GHOST_SystemWayland::timer_mutex = nullptr |
Threads must lock this before manipulating #GWL_Display::ghost_timer_manager.
Definition at line 410 of file GHOST_SystemWayland.hh.
Referenced by GHOST_SystemWayland(), gwl_seat_capability_keyboard_disable(), keyboard_handle_enter(), keyboard_handle_key(), keyboard_handle_leave(), keyboard_handle_modifiers(), and keyboard_handle_repeat_info().