| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /*  display_server_x11.h                                                  */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /*                         This file is part of:                          */ | 
					
						
							|  |  |  | /*                             GODOT ENGINE                               */ | 
					
						
							|  |  |  | /*                        https://godotengine.org                         */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ | 
					
						
							|  |  |  | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* Permission is hereby granted, free of charge, to any person obtaining  */ | 
					
						
							|  |  |  | /* a copy of this software and associated documentation files (the        */ | 
					
						
							|  |  |  | /* "Software"), to deal in the Software without restriction, including    */ | 
					
						
							|  |  |  | /* without limitation the rights to use, copy, modify, merge, publish,    */ | 
					
						
							|  |  |  | /* distribute, sublicense, and/or sell copies of the Software, and to     */ | 
					
						
							|  |  |  | /* permit persons to whom the Software is furnished to do so, subject to  */ | 
					
						
							|  |  |  | /* the following conditions:                                              */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* The above copyright notice and this permission notice shall be         */ | 
					
						
							|  |  |  | /* included in all copies or substantial portions of the Software.        */ | 
					
						
							|  |  |  | /*                                                                        */ | 
					
						
							|  |  |  | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */ | 
					
						
							|  |  |  | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */ | 
					
						
							|  |  |  | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ | 
					
						
							|  |  |  | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */ | 
					
						
							|  |  |  | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */ | 
					
						
							|  |  |  | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */ | 
					
						
							|  |  |  | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */ | 
					
						
							|  |  |  | /**************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef DISPLAY_SERVER_X11_H
 | 
					
						
							|  |  |  | #define DISPLAY_SERVER_X11_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef X11_ENABLED
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "joypad_linux.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-28 15:19:37 +02:00
										 |  |  | #include "core/input/input.h"
 | 
					
						
							| 
									
										
										
										
											2023-02-15 14:13:56 +02:00
										 |  |  | #include "core/os/mutex.h"
 | 
					
						
							|  |  |  | #include "core/os/thread.h"
 | 
					
						
							| 
									
										
										
										
											2020-11-07 19:33:38 -03:00
										 |  |  | #include "core/templates/local_vector.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | #include "drivers/alsa/audio_driver_alsa.h"
 | 
					
						
							|  |  |  | #include "drivers/alsamidi/midi_driver_alsamidi.h"
 | 
					
						
							|  |  |  | #include "drivers/pulseaudio/audio_driver_pulseaudio.h"
 | 
					
						
							|  |  |  | #include "drivers/unix/os_unix.h"
 | 
					
						
							|  |  |  | #include "servers/audio_server.h"
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "servers/display_server.h"
 | 
					
						
							| 
									
										
										
										
											2020-12-04 15:26:24 -03:00
										 |  |  | #include "servers/rendering/renderer_compositor.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-27 15:21:27 -03:00
										 |  |  | #include "servers/rendering_server.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-04 14:33:37 +02:00
										 |  |  | #if defined(SPEECHD_ENABLED)
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "tts_linux.h"
 | 
					
						
							| 
									
										
										
										
											2021-11-04 14:33:37 +02:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-26 08:18:39 -07:00
										 |  |  | #if defined(GLES3_ENABLED)
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "x11/gl_manager_x11.h"
 | 
					
						
							| 
									
										
										
										
											2023-09-22 10:55:55 +03:00
										 |  |  | #include "x11/gl_manager_x11_egl.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(VULKAN_ENABLED)
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "x11/vulkan_context_x11.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | #include "drivers/vulkan/rendering_device_vulkan.h"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-02 23:46:34 +02:00
										 |  |  | #if defined(DBUS_ENABLED)
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "freedesktop_portal_desktop.h"
 | 
					
						
							|  |  |  | #include "freedesktop_screensaver.h"
 | 
					
						
							| 
									
										
										
										
											2020-04-02 23:46:34 +02:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-29 12:03:06 +01:00
										 |  |  | #include <X11/Xatom.h>
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | #include <X11/Xlib.h>
 | 
					
						
							| 
									
										
										
										
											2022-11-29 12:03:06 +01:00
										 |  |  | #include <X11/Xutil.h>
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | #include <X11/keysym.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-15 14:13:56 +02:00
										 |  |  | #ifdef SOWRAP_ENABLED
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "x11/dynwrappers/xlib-so_wrap.h"
 | 
					
						
							| 
									
										
										
										
											2022-11-29 12:03:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "x11/dynwrappers/xcursor-so_wrap.h"
 | 
					
						
							|  |  |  | #include "x11/dynwrappers/xext-so_wrap.h"
 | 
					
						
							|  |  |  | #include "x11/dynwrappers/xinerama-so_wrap.h"
 | 
					
						
							|  |  |  | #include "x11/dynwrappers/xinput2-so_wrap.h"
 | 
					
						
							|  |  |  | #include "x11/dynwrappers/xrandr-so_wrap.h"
 | 
					
						
							|  |  |  | #include "x11/dynwrappers/xrender-so_wrap.h"
 | 
					
						
							| 
									
										
										
										
											2022-11-29 12:03:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #include "xkbcommon-so_wrap.h"
 | 
					
						
							| 
									
										
										
										
											2023-02-15 14:13:56 +02:00
										 |  |  | #else
 | 
					
						
							|  |  |  | #include <X11/XKBlib.h>
 | 
					
						
							|  |  |  | #include <X11/Xlib.h>
 | 
					
						
							|  |  |  | #include <X11/Xutil.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <X11/Xcursor/Xcursor.h>
 | 
					
						
							|  |  |  | #include <X11/extensions/XInput2.h>
 | 
					
						
							|  |  |  | #include <X11/extensions/Xext.h>
 | 
					
						
							|  |  |  | #include <X11/extensions/Xinerama.h>
 | 
					
						
							|  |  |  | #include <X11/extensions/Xrandr.h>
 | 
					
						
							|  |  |  | #include <X11/extensions/Xrender.h>
 | 
					
						
							|  |  |  | #include <X11/extensions/shape.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef XKB_ENABLED
 | 
					
						
							|  |  |  | #include <xkbcommon/xkbcommon-compose.h>
 | 
					
						
							|  |  |  | #include <xkbcommon/xkbcommon-keysyms.h>
 | 
					
						
							|  |  |  | #include <xkbcommon/xkbcommon.h>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2023-01-23 20:37:19 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | typedef struct _xrr_monitor_info { | 
					
						
							|  |  |  | 	Atom name; | 
					
						
							| 
									
										
										
										
											2020-11-24 10:12:55 +01:00
										 |  |  | 	Bool primary = false; | 
					
						
							|  |  |  | 	Bool automatic = false; | 
					
						
							|  |  |  | 	int noutput = 0; | 
					
						
							|  |  |  | 	int x = 0; | 
					
						
							|  |  |  | 	int y = 0; | 
					
						
							|  |  |  | 	int width = 0; | 
					
						
							|  |  |  | 	int height = 0; | 
					
						
							|  |  |  | 	int mwidth = 0; | 
					
						
							|  |  |  | 	int mheight = 0; | 
					
						
							|  |  |  | 	RROutput *outputs = nullptr; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | } xrr_monitor_info; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #undef CursorShape
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DisplayServerX11 : public DisplayServer { | 
					
						
							| 
									
										
										
										
											2023-05-08 20:32:56 +02:00
										 |  |  | 	// No need to register with GDCLASS, it's platform-specific and nothing is added.
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-07 12:46:50 -03:00
										 |  |  | 	_THREAD_SAFE_CLASS_ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	Atom wm_delete; | 
					
						
							|  |  |  | 	Atom xdnd_enter; | 
					
						
							|  |  |  | 	Atom xdnd_position; | 
					
						
							|  |  |  | 	Atom xdnd_status; | 
					
						
							|  |  |  | 	Atom xdnd_action_copy; | 
					
						
							|  |  |  | 	Atom xdnd_drop; | 
					
						
							|  |  |  | 	Atom xdnd_finished; | 
					
						
							|  |  |  | 	Atom xdnd_selection; | 
					
						
							|  |  |  | 	Atom xdnd_aware; | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	Atom requested = None; | 
					
						
							|  |  |  | 	int xdnd_version = 5; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-26 08:18:39 -07:00
										 |  |  | #if defined(GLES3_ENABLED)
 | 
					
						
							| 
									
										
										
										
											2020-11-18 18:11:30 +00:00
										 |  |  | 	GLManager_X11 *gl_manager = nullptr; | 
					
						
							| 
									
										
										
										
											2023-09-22 10:55:55 +03:00
										 |  |  | 	GLManagerEGL_X11 *gl_manager_egl = nullptr; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | #if defined(VULKAN_ENABLED)
 | 
					
						
							| 
									
										
										
										
											2020-11-18 18:11:30 +00:00
										 |  |  | 	VulkanContextX11 *context_vulkan = nullptr; | 
					
						
							|  |  |  | 	RenderingDeviceVulkan *rendering_device_vulkan = nullptr; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-02 23:46:34 +02:00
										 |  |  | #if defined(DBUS_ENABLED)
 | 
					
						
							| 
									
										
										
										
											2022-04-04 15:06:57 +02:00
										 |  |  | 	FreeDesktopScreenSaver *screensaver = nullptr; | 
					
						
							| 
									
										
										
										
											2020-04-02 23:46:34 +02:00
										 |  |  | 	bool keep_screen_on = false; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-04 14:33:37 +02:00
										 |  |  | #ifdef SPEECHD_ENABLED
 | 
					
						
							|  |  |  | 	TTS_Linux *tts = nullptr; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-30 17:04:17 +02:00
										 |  |  | #if defined(DBUS_ENABLED)
 | 
					
						
							|  |  |  | 	FreeDesktopPortalDesktop *portal_desktop = nullptr; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	struct WindowData { | 
					
						
							|  |  |  | 		Window x11_window; | 
					
						
							| 
									
										
										
										
											2022-12-11 01:21:22 +02:00
										 |  |  | 		Window x11_xim_window; | 
					
						
							| 
									
										
										
										
											2023-04-13 23:36:43 +05:30
										 |  |  | 		Window parent; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 		::XIC xic; | 
					
						
							| 
									
										
										
										
											2022-12-11 01:21:22 +02:00
										 |  |  | 		bool ime_active = false; | 
					
						
							|  |  |  | 		bool ime_in_progress = false; | 
					
						
							|  |  |  | 		bool ime_suppress_next_keyup = false; | 
					
						
							| 
									
										
										
										
											2023-02-15 14:13:56 +02:00
										 |  |  | #ifdef XKB_ENABLED
 | 
					
						
							| 
									
										
										
										
											2023-01-30 10:59:49 +02:00
										 |  |  | 		xkb_compose_state *xkb_state = nullptr; | 
					
						
							| 
									
										
										
										
											2023-02-15 14:13:56 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2020-03-03 22:51:12 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 		Size2i min_size; | 
					
						
							|  |  |  | 		Size2i max_size; | 
					
						
							| 
									
										
										
										
											2020-03-25 11:16:19 -03:00
										 |  |  | 		Point2i position; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 		Size2i size; | 
					
						
							| 
									
										
										
										
											2020-03-14 13:06:39 -03:00
										 |  |  | 		Callable rect_changed_callback; | 
					
						
							| 
									
										
										
										
											2020-03-04 13:36:09 -03:00
										 |  |  | 		Callable event_callback; | 
					
						
							|  |  |  | 		Callable input_event_callback; | 
					
						
							|  |  |  | 		Callable input_text_callback; | 
					
						
							|  |  |  | 		Callable drop_files_callback; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-15 12:05:25 +02:00
										 |  |  | 		Vector<Vector2> mpath; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-04 16:03:30 -03:00
										 |  |  | 		WindowID transient_parent = INVALID_WINDOW_ID; | 
					
						
							| 
									
										
										
										
											2022-05-19 17:00:06 +02:00
										 |  |  | 		HashSet<WindowID> transient_children; | 
					
						
							| 
									
										
										
										
											2020-03-04 16:03:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-24 20:15:35 -03:00
										 |  |  | 		ObjectID instance_id; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-22 13:01:49 +02:00
										 |  |  | 		bool no_focus = false; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 		//better to guess on the fly, given WM can change it
 | 
					
						
							|  |  |  | 		//WindowMode mode;
 | 
					
						
							|  |  |  | 		bool fullscreen = false; //OS can't exit from this mode
 | 
					
						
							| 
									
										
										
										
											2022-12-07 09:54:02 +02:00
										 |  |  | 		bool exclusive_fullscreen = false; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 		bool on_top = false; | 
					
						
							|  |  |  | 		bool borderless = false; | 
					
						
							|  |  |  | 		bool resize_disabled = false; | 
					
						
							|  |  |  | 		Vector2i last_position_before_fs; | 
					
						
							| 
									
										
										
										
											2022-01-06 08:04:59 +00:00
										 |  |  | 		bool focused = true; | 
					
						
							| 
									
										
										
										
											2020-07-01 09:27:43 -03:00
										 |  |  | 		bool minimized = false; | 
					
						
							| 
									
										
										
										
											2022-08-30 12:52:24 -06:00
										 |  |  | 		bool maximized = false; | 
					
						
							| 
									
										
										
										
											2022-02-24 11:21:23 +02:00
										 |  |  | 		bool is_popup = false; | 
					
						
							| 
									
										
										
										
											2022-09-03 13:40:53 +03:00
										 |  |  | 		bool layered_window = false; | 
					
						
							| 
									
										
										
										
											2023-01-15 12:05:25 +02:00
										 |  |  | 		bool mpass = false; | 
					
						
							| 
									
										
										
										
											2022-02-24 11:21:23 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		Rect2i parent_safe_rect; | 
					
						
							| 
									
										
										
										
											2020-08-29 12:00:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		unsigned int focus_order = 0; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-11 01:21:22 +02:00
										 |  |  | 	Point2i im_selection; | 
					
						
							|  |  |  | 	String im_text; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-15 14:13:56 +02:00
										 |  |  | #ifdef XKB_ENABLED
 | 
					
						
							| 
									
										
										
										
											2023-03-16 10:44:47 +02:00
										 |  |  | 	bool xkb_loaded_v05p = false; | 
					
						
							|  |  |  | 	bool xkb_loaded_v08p = false; | 
					
						
							| 
									
										
										
										
											2023-01-30 10:59:49 +02:00
										 |  |  | 	xkb_context *xkb_ctx = nullptr; | 
					
						
							|  |  |  | 	xkb_compose_table *dead_tbl = nullptr; | 
					
						
							| 
									
										
										
										
											2023-02-15 14:13:56 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2023-01-30 10:59:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-13 15:04:37 +02:00
										 |  |  | 	HashMap<WindowID, WindowData> windows; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-24 11:21:23 +02:00
										 |  |  | 	unsigned int last_mouse_monitor_mask = 0; | 
					
						
							|  |  |  | 	uint64_t time_since_popup = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	List<WindowID> popup_list; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-05 01:52:59 +02:00
										 |  |  | 	WindowID window_mouseover_id = INVALID_WINDOW_ID; | 
					
						
							| 
									
										
										
										
											2022-02-01 03:49:51 +01:00
										 |  |  | 	WindowID last_focused_window = INVALID_WINDOW_ID; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	WindowID window_id_counter = MAIN_WINDOW_ID; | 
					
						
							| 
									
										
										
										
											2023-01-05 00:00:02 +02:00
										 |  |  | 	WindowID _create_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect); | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	String internal_clipboard; | 
					
						
							| 
									
										
										
										
											2021-10-12 09:43:50 +02:00
										 |  |  | 	String internal_clipboard_primary; | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	Window xdnd_source_window = 0; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	::Display *x11_display; | 
					
						
							| 
									
										
										
										
											2022-04-04 15:06:57 +02:00
										 |  |  | 	char *xmbstring = nullptr; | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	int xmblen = 0; | 
					
						
							|  |  |  | 	unsigned long last_timestamp = 0; | 
					
						
							|  |  |  | 	::Time last_keyrelease_time = 0; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	::XIM xim; | 
					
						
							|  |  |  | 	::XIMStyle xim_style; | 
					
						
							| 
									
										
										
										
											2022-12-11 01:21:22 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	static int _xim_preedit_start_callback(::XIM xim, ::XPointer client_data, | 
					
						
							|  |  |  | 			::XPointer call_data); | 
					
						
							|  |  |  | 	static void _xim_preedit_done_callback(::XIM xim, ::XPointer client_data, | 
					
						
							|  |  |  | 			::XPointer call_data); | 
					
						
							|  |  |  | 	static void _xim_preedit_draw_callback(::XIM xim, ::XPointer client_data, | 
					
						
							|  |  |  | 			::XIMPreeditDrawCallbackStruct *call_data); | 
					
						
							|  |  |  | 	static void _xim_preedit_caret_callback(::XIM xim, ::XPointer client_data, | 
					
						
							|  |  |  | 			::XIMPreeditCaretCallbackStruct *call_data); | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	static void _xim_destroy_callback(::XIM im, ::XPointer client_data, | 
					
						
							|  |  |  | 			::XPointer call_data); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Point2i last_mouse_pos; | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	bool last_mouse_pos_valid = false; | 
					
						
							|  |  |  | 	Point2i last_click_pos = Point2i(-100, -100); | 
					
						
							|  |  |  | 	uint64_t last_click_ms = 0; | 
					
						
							| 
									
										
										
										
											2021-08-13 16:31:57 -05:00
										 |  |  | 	MouseButton last_click_button_index = MouseButton::NONE; | 
					
						
							| 
									
										
										
										
											2023-01-08 00:55:54 +01:00
										 |  |  | 	BitField<MouseButtonMask> last_button_state; | 
					
						
							| 
									
										
										
										
											2020-07-01 09:27:43 -03:00
										 |  |  | 	bool app_focused = false; | 
					
						
							| 
									
										
										
										
											2020-07-01 16:14:46 -03:00
										 |  |  | 	uint64_t time_since_no_focus = 0; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	struct { | 
					
						
							|  |  |  | 		int opcode; | 
					
						
							|  |  |  | 		Vector<int> touch_devices; | 
					
						
							| 
									
										
										
										
											2022-05-13 15:04:37 +02:00
										 |  |  | 		HashMap<int, Vector2> absolute_devices; | 
					
						
							|  |  |  | 		HashMap<int, Vector2> pen_pressure_range; | 
					
						
							|  |  |  | 		HashMap<int, Vector2> pen_tilt_x_range; | 
					
						
							|  |  |  | 		HashMap<int, Vector2> pen_tilt_y_range; | 
					
						
							| 
									
										
										
										
											2022-06-19 02:58:24 -07:00
										 |  |  | 		HashMap<int, bool> pen_inverted_devices; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 		XIEventMask all_event_mask; | 
					
						
							| 
									
										
										
										
											2022-05-13 15:04:37 +02:00
										 |  |  | 		HashMap<int, Vector2> state; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 		double pressure; | 
					
						
							| 
									
										
										
										
											2020-05-03 15:38:58 +03:00
										 |  |  | 		bool pressure_supported; | 
					
						
							| 
									
										
										
										
											2022-06-19 02:58:24 -07:00
										 |  |  | 		bool pen_inverted; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 		Vector2 tilt; | 
					
						
							|  |  |  | 		Vector2 mouse_pos_to_filter; | 
					
						
							|  |  |  | 		Vector2 relative_motion; | 
					
						
							|  |  |  | 		Vector2 raw_pos; | 
					
						
							|  |  |  | 		Vector2 old_raw_pos; | 
					
						
							|  |  |  | 		::Time last_relative_time; | 
					
						
							|  |  |  | 	} xi; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	bool _refresh_device_info(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-16 16:33:33 +02:00
										 |  |  | 	Rect2i _screen_get_rect(int p_screen) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-08 00:55:54 +01:00
										 |  |  | 	BitField<MouseButtonMask> _get_mouse_button_state(MouseButton p_x11_button, int p_x11_type); | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	void _get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state); | 
					
						
							|  |  |  | 	void _flush_mouse_motion(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	MouseMode mouse_mode = MOUSE_MODE_VISIBLE; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	Point2i center; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-09 12:43:20 +02:00
										 |  |  | 	void _handle_key_event(WindowID p_window, XKeyEvent *p_event, LocalVector<XEvent> &p_events, uint32_t &p_event_index, bool p_echo = false); | 
					
						
							| 
									
										
										
										
											2020-10-08 17:57:54 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-12 09:43:50 +02:00
										 |  |  | 	Atom _process_selection_request_target(Atom p_target, Window p_requestor, Atom p_property, Atom p_selection) const; | 
					
						
							| 
									
										
										
										
											2020-10-08 17:57:54 +02:00
										 |  |  | 	void _handle_selection_request_event(XSelectionRequestEvent *p_event) const; | 
					
						
							| 
									
										
										
										
											2023-01-15 12:05:25 +02:00
										 |  |  | 	void _update_window_mouse_passthrough(WindowID p_window); | 
					
						
							| 
									
										
										
										
											2020-09-09 12:43:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	String _clipboard_get_impl(Atom p_source, Window x11_window, Atom target) const; | 
					
						
							|  |  |  | 	String _clipboard_get(Atom p_source, Window x11_window) const; | 
					
						
							| 
									
										
										
										
											2023-09-14 19:58:13 -05:00
										 |  |  | 	Atom _clipboard_get_image_target(Atom p_source, Window x11_window) const; | 
					
						
							| 
									
										
										
										
											2020-10-08 17:57:54 +02:00
										 |  |  | 	void _clipboard_transfer_ownership(Atom p_source, Window x11_window) const; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	bool do_mouse_warp = false; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	const char *cursor_theme = nullptr; | 
					
						
							|  |  |  | 	int cursor_size = 0; | 
					
						
							| 
									
										
										
										
											2023-05-11 12:32:23 +02:00
										 |  |  | 	XcursorImage *cursor_img[CURSOR_MAX]; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	Cursor cursors[CURSOR_MAX]; | 
					
						
							|  |  |  | 	Cursor null_cursor; | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	CursorShape current_cursor = CURSOR_ARROW; | 
					
						
							| 
									
										
										
										
											2022-05-13 15:04:37 +02:00
										 |  |  | 	HashMap<CursorShape, Vector<Variant>> cursors_cache; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-03 10:36:29 -03:00
										 |  |  | 	String rendering_driver; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	void set_wm_fullscreen(bool p_enabled); | 
					
						
							|  |  |  | 	void set_wm_above(bool p_enabled); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	typedef xrr_monitor_info *(*xrr_get_monitors_t)(Display *dpy, Window window, Bool get_active, int *nmonitors); | 
					
						
							|  |  |  | 	typedef void (*xrr_free_monitors_t)(xrr_monitor_info *monitors); | 
					
						
							| 
									
										
										
										
											2022-05-02 16:28:25 +02:00
										 |  |  | 	xrr_get_monitors_t xrr_get_monitors = nullptr; | 
					
						
							|  |  |  | 	xrr_free_monitors_t xrr_free_monitors = nullptr; | 
					
						
							| 
									
										
										
										
											2022-04-04 15:06:57 +02:00
										 |  |  | 	void *xrandr_handle = nullptr; | 
					
						
							| 
									
										
										
										
											2023-08-04 10:58:14 +03:00
										 |  |  | 	bool xrandr_ext_ok = true; | 
					
						
							|  |  |  | 	bool xinerama_ext_ok = true; | 
					
						
							|  |  |  | 	bool xshaped_ext_ok = true; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	struct Property { | 
					
						
							|  |  |  | 		unsigned char *data; | 
					
						
							|  |  |  | 		int format, nitems; | 
					
						
							|  |  |  | 		Atom type; | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 	static Property _read_property(Display *p_display, Window p_window, Atom p_property); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void _update_real_mouse_position(const WindowData &wd); | 
					
						
							| 
									
										
										
										
											2020-06-29 13:29:31 +02:00
										 |  |  | 	bool _window_maximize_check(WindowID p_window, const char *p_atom_name) const; | 
					
						
							| 
									
										
										
										
											2022-06-29 21:55:40 -04:00
										 |  |  | 	bool _window_fullscreen_check(WindowID p_window) const; | 
					
						
							| 
									
										
										
										
											2022-08-30 12:52:24 -06:00
										 |  |  | 	bool _window_minimize_check(WindowID p_window) const; | 
					
						
							|  |  |  | 	void _validate_mode_on_map(WindowID p_window); | 
					
						
							| 
									
										
										
										
											2020-07-31 17:27:16 +02:00
										 |  |  | 	void _update_size_hints(WindowID p_window); | 
					
						
							| 
									
										
										
										
											2022-12-07 09:54:02 +02:00
										 |  |  | 	void _set_wm_fullscreen(WindowID p_window, bool p_enabled, bool p_exclusive); | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	void _set_wm_maximized(WindowID p_window, bool p_enabled); | 
					
						
							| 
									
										
										
										
											2022-08-30 12:52:24 -06:00
										 |  |  | 	void _set_wm_minimized(WindowID p_window, bool p_enabled); | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-03 10:36:29 -03:00
										 |  |  | 	void _update_context(WindowData &wd); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Context context = CONTEXT_ENGINE; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-07 19:31:57 +02:00
										 |  |  | 	WindowID _get_focused_window_or_popup() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-04 13:36:09 -03:00
										 |  |  | 	void _send_window_event(const WindowData &wd, WindowEvent p_event); | 
					
						
							|  |  |  | 	static void _dispatch_input_events(const Ref<InputEvent> &p_event); | 
					
						
							|  |  |  | 	void _dispatch_input_event(const Ref<InputEvent> &p_event); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-09 12:43:20 +02:00
										 |  |  | 	mutable Mutex events_mutex; | 
					
						
							| 
									
										
										
										
											2021-01-19 13:29:41 +01:00
										 |  |  | 	Thread events_thread; | 
					
						
							| 
									
										
										
										
											2021-02-10 19:22:13 +01:00
										 |  |  | 	SafeFlag events_thread_done; | 
					
						
							| 
									
										
										
										
											2020-09-09 12:43:20 +02:00
										 |  |  | 	LocalVector<XEvent> polled_events; | 
					
						
							|  |  |  | 	static void _poll_events_thread(void *ud); | 
					
						
							| 
									
										
										
										
											2020-10-08 17:57:54 +02:00
										 |  |  | 	bool _wait_for_events() const; | 
					
						
							| 
									
										
										
										
											2020-09-09 12:43:20 +02:00
										 |  |  | 	void _poll_events(); | 
					
						
							| 
									
										
										
										
											2021-10-27 15:23:40 -07:00
										 |  |  | 	void _check_pending_events(LocalVector<XEvent> &r_events); | 
					
						
							| 
									
										
										
										
											2020-09-09 12:43:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	static Bool _predicate_all_events(Display *display, XEvent *event, XPointer arg); | 
					
						
							|  |  |  | 	static Bool _predicate_clipboard_selection(Display *display, XEvent *event, XPointer arg); | 
					
						
							| 
									
										
										
										
											2020-10-09 16:54:36 +02:00
										 |  |  | 	static Bool _predicate_clipboard_incr(Display *display, XEvent *event, XPointer arg); | 
					
						
							| 
									
										
										
										
											2020-10-08 17:57:54 +02:00
										 |  |  | 	static Bool _predicate_clipboard_save_targets(Display *display, XEvent *event, XPointer arg); | 
					
						
							| 
									
										
										
										
											2020-09-09 12:43:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | protected: | 
					
						
							|  |  |  | 	void _window_changed(XEvent *event); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-05-30 11:06:08 +03:00
										 |  |  | 	bool mouse_process_popups(); | 
					
						
							| 
									
										
										
										
											2022-02-24 11:21:23 +02:00
										 |  |  | 	void popup_open(WindowID p_window); | 
					
						
							|  |  |  | 	void popup_close(WindowID p_window); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual bool has_feature(Feature p_feature) const override; | 
					
						
							|  |  |  | 	virtual String get_name() const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-04 14:33:37 +02:00
										 |  |  | #ifdef SPEECHD_ENABLED
 | 
					
						
							|  |  |  | 	virtual bool tts_is_speaking() const override; | 
					
						
							|  |  |  | 	virtual bool tts_is_paused() const override; | 
					
						
							| 
									
										
										
										
											2022-08-05 03:41:48 +02:00
										 |  |  | 	virtual TypedArray<Dictionary> tts_get_voices() const override; | 
					
						
							| 
									
										
										
										
											2021-11-04 14:33:37 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override; | 
					
						
							|  |  |  | 	virtual void tts_pause() override; | 
					
						
							|  |  |  | 	virtual void tts_resume() override; | 
					
						
							|  |  |  | 	virtual void tts_stop() override; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-30 17:04:17 +02:00
										 |  |  | #if defined(DBUS_ENABLED)
 | 
					
						
							|  |  |  | 	virtual bool is_dark_mode_supported() const override; | 
					
						
							|  |  |  | 	virtual bool is_dark_mode() const override; | 
					
						
							| 
									
										
										
										
											2023-08-01 10:18:41 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	virtual Error file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback) override; | 
					
						
							| 
									
										
										
										
											2022-08-30 17:04:17 +02:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void mouse_set_mode(MouseMode p_mode) override; | 
					
						
							|  |  |  | 	virtual MouseMode mouse_get_mode() const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-27 11:17:36 +02:00
										 |  |  | 	virtual void warp_mouse(const Point2i &p_position) override; | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual Point2i mouse_get_position() const override; | 
					
						
							| 
									
										
										
										
											2023-01-08 00:55:54 +01:00
										 |  |  | 	virtual BitField<MouseButtonMask> mouse_get_button_state() const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void clipboard_set(const String &p_text) override; | 
					
						
							|  |  |  | 	virtual String clipboard_get() const override; | 
					
						
							| 
									
										
										
										
											2023-09-14 19:58:13 -05:00
										 |  |  | 	virtual Ref<Image> clipboard_get_image() const override; | 
					
						
							|  |  |  | 	virtual bool clipboard_has_image() const override; | 
					
						
							| 
									
										
										
										
											2021-10-12 09:43:50 +02:00
										 |  |  | 	virtual void clipboard_set_primary(const String &p_text) override; | 
					
						
							|  |  |  | 	virtual String clipboard_get_primary() const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual int get_screen_count() const override; | 
					
						
							| 
									
										
										
										
											2023-01-05 00:00:02 +02:00
										 |  |  | 	virtual int get_primary_screen() const override; | 
					
						
							| 
									
										
										
										
											2023-03-21 13:08:46 +02:00
										 |  |  | 	virtual int get_keyboard_focus_screen() const override; | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual Point2i screen_get_position(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; | 
					
						
							|  |  |  | 	virtual Size2i screen_get_size(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; | 
					
						
							|  |  |  | 	virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; | 
					
						
							|  |  |  | 	virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; | 
					
						
							| 
									
										
										
										
											2022-01-27 13:46:57 -06:00
										 |  |  | 	virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; | 
					
						
							| 
									
										
										
										
											2023-02-27 20:36:13 +02:00
										 |  |  | 	virtual Color screen_get_pixel(const Point2i &p_position) const override; | 
					
						
							| 
									
										
										
										
											2023-03-16 23:26:09 +02:00
										 |  |  | 	virtual Ref<Image> screen_get_image(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-02 23:46:34 +02:00
										 |  |  | #if defined(DBUS_ENABLED)
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void screen_set_keep_on(bool p_enable) override; | 
					
						
							|  |  |  | 	virtual bool screen_is_kept_on() const override; | 
					
						
							| 
									
										
										
										
											2020-04-02 23:46:34 +02:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual Vector<DisplayServer::WindowID> get_window_list() const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-05 00:00:02 +02:00
										 |  |  | 	virtual WindowID create_sub_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect = Rect2i()) override; | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void show_window(WindowID p_id) override; | 
					
						
							|  |  |  | 	virtual void delete_sub_window(WindowID p_id) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-24 11:21:23 +02:00
										 |  |  | 	virtual WindowID window_get_active_popup() const override; | 
					
						
							|  |  |  | 	virtual void window_set_popup_safe_rect(WindowID p_window, const Rect2i &p_rect) override; | 
					
						
							|  |  |  | 	virtual Rect2i window_get_popup_safe_rect(WindowID p_window) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual WindowID get_window_at_screen_position(const Point2i &p_position) const override; | 
					
						
							| 
									
										
										
										
											2020-03-24 20:15:35 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-14 12:41:04 +02:00
										 |  |  | 	virtual int64_t window_get_native_handle(HandleType p_handle_type, WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_attach_instance_id(ObjectID p_instance, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual ObjectID window_get_attached_instance_id(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2020-03-24 20:15:35 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_title(const String &p_title, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual void window_set_mouse_passthrough(const Vector<Vector2> &p_region, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							| 
									
										
										
										
											2020-06-29 12:31:36 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual void window_set_window_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual void window_set_input_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual void window_set_input_text_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual void window_set_drop_files_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual int window_get_current_screen(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							|  |  |  | 	virtual void window_set_current_screen(int p_screen, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual Point2i window_get_position(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2022-11-30 10:28:16 +02:00
										 |  |  | 	virtual Point2i window_get_position_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_position(const Point2i &p_position, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2021-09-27 01:07:10 +02:00
										 |  |  | 	virtual void gl_window_make_current(DisplayServer::WindowID p_window_id) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_transient(WindowID p_window, WindowID p_parent) override; | 
					
						
							| 
									
										
										
										
											2020-03-04 16:03:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_min_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual Size2i window_get_min_size(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual Size2i window_get_size(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2022-11-30 10:28:16 +02:00
										 |  |  | 	virtual Size2i window_get_size_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_mode(WindowMode p_mode, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual WindowMode window_get_mode(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual bool window_is_maximize_allowed(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual bool window_get_flag(WindowFlags p_flag, WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_request_attention(WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							| 
									
										
										
										
											2023-06-15 10:53:31 +03:00
										 |  |  | 	virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual bool can_any_window_draw() const override; | 
					
						
							| 
									
										
										
										
											2020-03-03 10:36:29 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void window_set_ime_active(const bool p_active, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual void window_set_ime_position(const Point2i &p_pos, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-11 01:21:22 +02:00
										 |  |  | 	virtual Point2i ime_get_selection() const override; | 
					
						
							|  |  |  | 	virtual String ime_get_text() const override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-19 17:44:59 +02:00
										 |  |  | 	virtual void window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window = MAIN_WINDOW_ID) override; | 
					
						
							|  |  |  | 	virtual DisplayServer::VSyncMode window_get_vsync_mode(WindowID p_vsync_mode) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void cursor_set_shape(CursorShape p_shape) override; | 
					
						
							|  |  |  | 	virtual CursorShape cursor_get_shape() const override; | 
					
						
							| 
									
										
										
										
											2022-05-03 01:43:50 +02:00
										 |  |  | 	virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual int keyboard_get_layout_count() const override; | 
					
						
							|  |  |  | 	virtual int keyboard_get_current_layout() const override; | 
					
						
							|  |  |  | 	virtual void keyboard_set_current_layout(int p_index) override; | 
					
						
							|  |  |  | 	virtual String keyboard_get_layout_language(int p_index) const override; | 
					
						
							|  |  |  | 	virtual String keyboard_get_layout_name(int p_index) const override; | 
					
						
							| 
									
										
										
										
											2021-09-17 03:07:59 +02:00
										 |  |  | 	virtual Key keyboard_get_keycode_from_physical(Key p_keycode) const override; | 
					
						
							| 
									
										
										
										
											2023-06-08 09:26:48 +03:00
										 |  |  | 	virtual Key keyboard_get_label_from_physical(Key p_keycode) const override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void process_events() override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void release_rendering_thread() override; | 
					
						
							|  |  |  | 	virtual void make_rendering_thread() override; | 
					
						
							|  |  |  | 	virtual void swap_buffers() override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void set_context(Context p_context) override; | 
					
						
							| 
									
										
										
										
											2020-03-03 10:36:29 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 21:39:13 +02:00
										 |  |  | 	virtual void set_native_icon(const String &p_filename) override; | 
					
						
							|  |  |  | 	virtual void set_icon(const Ref<Image> &p_icon) override; | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-05 00:00:02 +02:00
										 |  |  | 	static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error); | 
					
						
							| 
									
										
										
										
											2020-03-03 10:36:29 -03:00
										 |  |  | 	static Vector<String> get_rendering_drivers_func(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	static void register_x11_driver(); | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-05 00:00:02 +02:00
										 |  |  | 	DisplayServerX11(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error); | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 	~DisplayServerX11(); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-08 14:51:32 +02:00
										 |  |  | #endif // X11_ENABLED
 | 
					
						
							| 
									
										
										
										
											2020-03-01 19:14:37 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif // DISPLAY_SERVER_X11_H
 |