Atlas - SDL_waylandvideo.h

Home / ext / SDL / src / video / wayland Lines: 1 | Size: 5180 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21 22#include "SDL_internal.h" 23 24#ifndef SDL_waylandvideo_h_ 25#define SDL_waylandvideo_h_ 26 27#include <EGL/egl.h> 28#include "wayland-util.h" 29 30#include "../SDL_sysvideo.h" 31#include "../../core/linux/SDL_dbus.h" 32#include "../../core/linux/SDL_ime.h" 33 34struct xkb_context; 35struct SDL_WaylandSeat; 36 37typedef struct 38{ 39 struct wl_cursor_theme *theme; 40 int size; 41} SDL_WaylandCursorTheme; 42 43typedef struct 44{ 45 struct wl_list link; 46 char wl_output_name[]; 47} SDL_WaylandConnectorName; 48 49struct SDL_VideoData 50{ 51 struct wl_display *display; 52 struct wl_registry *registry; 53 struct wl_compositor *compositor; 54 struct wl_shm *shm; 55 SDL_WaylandCursorTheme *cursor_themes; 56 int num_cursor_themes; 57 struct 58 { 59 struct xdg_wm_base *xdg; 60#ifdef HAVE_LIBDECOR_H 61 struct libdecor *libdecor; 62#endif 63 } shell; 64 struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; 65 struct zwp_pointer_constraints_v1 *pointer_constraints; 66 struct wp_pointer_warp_v1 *wp_pointer_warp_v1; 67 struct wp_cursor_shape_manager_v1 *cursor_shape_manager; 68 struct wl_data_device_manager *data_device_manager; 69 struct zwp_primary_selection_device_manager_v1 *primary_selection_device_manager; 70 struct zxdg_decoration_manager_v1 *decoration_manager; 71 struct zwp_keyboard_shortcuts_inhibit_manager_v1 *key_inhibitor_manager; 72 struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager; 73 struct xdg_activation_v1 *activation_manager; 74 struct zwp_text_input_manager_v3 *text_input_manager; 75 struct zxdg_output_manager_v1 *xdg_output_manager; 76 struct wp_viewporter *viewporter; 77 struct wp_fractional_scale_manager_v1 *fractional_scale_manager; 78 struct zwp_input_timestamps_manager_v1 *input_timestamps_manager; 79 struct zxdg_exporter_v2 *zxdg_exporter_v2; 80 struct xdg_wm_dialog_v1 *xdg_wm_dialog_v1; 81 struct wp_alpha_modifier_v1 *wp_alpha_modifier_v1; 82 struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1; 83 struct frog_color_management_factory_v1 *frog_color_management_factory_v1; 84 struct wp_color_manager_v1 *wp_color_manager_v1; 85 struct zwp_tablet_manager_v2 *tablet_manager; 86 struct wl_fixes *wl_fixes; 87 struct zwp_pointer_gestures_v1 *zwp_pointer_gestures; 88 89 struct xkb_context *xkb_context; 90 91 struct wl_list seat_list; 92 struct SDL_WaylandSeat *last_implicit_grab_seat; 93 struct SDL_WaylandSeat *last_incoming_data_offer_seat; 94 struct SDL_WaylandSeat *last_incoming_primary_selection_seat; 95 96 SDL_DisplayData **output_list; 97 int output_count; 98 int output_max; 99 100 bool initializing; 101 bool display_disconnected; 102 bool display_externally_owned; 103 bool scale_to_display_enabled; 104}; 105 106struct SDL_DisplayData 107{ 108 SDL_VideoData *videodata; 109 struct wl_output *output; 110 struct zxdg_output_v1 *xdg_output; 111 struct wp_color_management_output_v1 *wp_color_management_output; 112 char *wl_output_name; 113 double scale_factor; 114 uint32_t registry_id; 115 int logical_width, logical_height; 116 int pixel_width, pixel_height; 117 int x, y, refresh, transform; 118 SDL_DisplayOrientation orientation; 119 int physical_width_mm, physical_height_mm; 120 bool has_logical_position, has_logical_size; 121 SDL_HDROutputProperties HDR; 122 SDL_DisplayID display; 123 SDL_VideoDisplay placeholder; 124 int wl_output_done_count; 125 struct Wayland_ColorInfoState *color_info_state; 126}; 127 128// Needed here to get wl_surface declaration, fixes GitHub#4594 129#include "SDL_waylanddyn.h" 130 131extern void SDL_WAYLAND_register_surface(struct wl_surface *surface); 132extern void SDL_WAYLAND_register_output(struct wl_output *output); 133extern bool SDL_WAYLAND_own_surface(struct wl_surface *surface); 134extern bool SDL_WAYLAND_own_output(struct wl_output *output); 135 136extern SDL_WindowData *Wayland_GetWindowDataForOwnedSurface(struct wl_surface *surface); 137void Wayland_AddWindowDataToExternalList(SDL_WindowData *data); 138void Wayland_RemoveWindowDataFromExternalList(SDL_WindowData *data); 139struct wl_event_queue *Wayland_DisplayCreateQueue(struct wl_display *display, const char *name); 140 141extern bool Wayland_LoadLibdecor(SDL_VideoData *data, bool ignore_xdg); 142 143extern bool Wayland_HandleDisplayDisconnected(SDL_VideoDevice *_this); 144 145#endif // SDL_waylandvideo_h_ 146
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.