2022-03-16 20:50:55 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-03-17 15:53:45 +01:00
|
|
|
// because C/C++ VS Code intellisense is stupid with includes, we will suppress them here.
|
|
|
|
// This suppresses all "include file not found" errors.
|
|
|
|
#ifdef __INTELLISENSE__
|
|
|
|
#pragma diag_suppress 1696
|
|
|
|
#endif
|
|
|
|
|
2022-03-16 20:50:55 +01:00
|
|
|
#include <getopt.h>
|
|
|
|
#include <libinput.h>
|
|
|
|
#include <linux/input-event-codes.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <wayland-server-core.h>
|
2022-03-17 15:53:45 +01:00
|
|
|
#include <mutex>
|
|
|
|
#include <thread>
|
2022-04-08 22:07:40 +02:00
|
|
|
#include <filesystem>
|
2022-04-15 18:59:58 +02:00
|
|
|
#include <climits>
|
2022-03-16 20:50:55 +01:00
|
|
|
|
|
|
|
#if true
|
|
|
|
// wlroots uses dumb-ass shit that makes it not compile on C++, let's fix that.
|
|
|
|
// https://github.com/swaywm/wlroots/issues/682
|
|
|
|
// pthread first because it uses class in a C++ way and XWayland includes that...
|
|
|
|
#include <pthread.h>
|
|
|
|
|
2023-12-06 23:54:56 +01:00
|
|
|
#define class _class
|
2022-03-20 10:37:31 +01:00
|
|
|
#define namespace _namespace
|
2022-03-16 20:50:55 +01:00
|
|
|
#define static
|
2022-08-05 13:03:37 +02:00
|
|
|
#define delete delete_
|
2022-03-16 20:50:55 +01:00
|
|
|
|
|
|
|
extern "C" {
|
2022-06-12 22:57:03 +02:00
|
|
|
#include <wlr/backend.h>
|
|
|
|
#include <wlr/backend/libinput.h>
|
2022-08-27 23:10:13 +02:00
|
|
|
#include <wlr/backend/drm.h>
|
2022-06-12 22:57:03 +02:00
|
|
|
#include <wlr/render/allocator.h>
|
|
|
|
#include <wlr/render/wlr_renderer.h>
|
|
|
|
#include <wlr/types/wlr_compositor.h>
|
|
|
|
#include <wlr/types/wlr_cursor.h>
|
|
|
|
#include <wlr/types/wlr_data_control_v1.h>
|
|
|
|
#include <wlr/types/wlr_data_device.h>
|
2022-08-27 23:10:13 +02:00
|
|
|
#include <wlr/types/wlr_drm_lease_v1.h>
|
|
|
|
#include <wlr/types/wlr_drm.h>
|
2022-06-12 22:57:03 +02:00
|
|
|
#include <wlr/types/wlr_export_dmabuf_v1.h>
|
|
|
|
#include <wlr/types/wlr_linux_dmabuf_v1.h>
|
|
|
|
#include <wlr/types/wlr_gamma_control_v1.h>
|
|
|
|
#include <wlr/types/wlr_input_device.h>
|
|
|
|
#include <wlr/types/wlr_keyboard.h>
|
|
|
|
#include <wlr/types/wlr_layer_shell_v1.h>
|
|
|
|
#include <wlr/types/wlr_matrix.h>
|
|
|
|
#include <wlr/types/wlr_output.h>
|
|
|
|
#include <wlr/types/wlr_output_layout.h>
|
|
|
|
#include <wlr/types/wlr_output_management_v1.h>
|
|
|
|
#include <wlr/types/wlr_pointer.h>
|
|
|
|
#include <wlr/types/wlr_presentation_time.h>
|
|
|
|
#include <wlr/types/wlr_primary_selection.h>
|
|
|
|
#include <wlr/types/wlr_primary_selection_v1.h>
|
|
|
|
#include <wlr/types/wlr_screencopy_v1.h>
|
|
|
|
#include <wlr/types/wlr_seat.h>
|
|
|
|
#include <wlr/types/wlr_server_decoration.h>
|
|
|
|
#include <wlr/types/wlr_viewporter.h>
|
|
|
|
#include <wlr/types/wlr_xdg_output_v1.h>
|
|
|
|
#include <wlr/types/wlr_xdg_shell.h>
|
|
|
|
#include <wlr/types/wlr_subcompositor.h>
|
2023-08-30 17:22:55 +02:00
|
|
|
#include <wlr/types/wlr_damage_ring.h>
|
2022-06-12 22:57:03 +02:00
|
|
|
#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
|
|
|
|
#include <wlr/util/log.h>
|
|
|
|
#include <wlr/util/region.h>
|
2024-03-09 17:52:59 +01:00
|
|
|
#include <wlr/util/edges.h>
|
2022-06-12 22:57:03 +02:00
|
|
|
#include <wlr/types/wlr_tablet_pad.h>
|
|
|
|
#include <wlr/types/wlr_tablet_tool.h>
|
|
|
|
#include <wlr/types/wlr_tablet_v2.h>
|
2022-03-16 20:50:55 +01:00
|
|
|
#include <xkbcommon/xkbcommon.h>
|
2022-06-12 22:57:03 +02:00
|
|
|
#include <wlr/render/egl.h>
|
|
|
|
#include <wlr/render/gles2.h>
|
|
|
|
#include <wlr/render/wlr_texture.h>
|
|
|
|
#include <wlr/interfaces/wlr_keyboard.h>
|
2024-05-03 02:27:59 +02:00
|
|
|
#include <wlr/interfaces/wlr_pointer.h>
|
2022-06-29 22:23:51 +02:00
|
|
|
#include <wlr/types/wlr_xdg_foreign_registry.h>
|
|
|
|
#include <wlr/types/wlr_xdg_foreign_v1.h>
|
|
|
|
#include <wlr/types/wlr_xdg_foreign_v2.h>
|
2022-08-07 21:17:03 +02:00
|
|
|
#include <wlr/types/wlr_touch.h>
|
2022-10-04 21:07:21 +02:00
|
|
|
#include <wlr/types/wlr_switch.h>
|
2022-11-05 19:04:44 +01:00
|
|
|
#include <wlr/config.h>
|
|
|
|
#include <wlr/backend/headless.h>
|
|
|
|
#include <wlr/backend/multi.h>
|
|
|
|
#include <wlr/backend/wayland.h>
|
2023-02-16 14:37:46 +01:00
|
|
|
#include <wlr/types/wlr_single_pixel_buffer_v1.h>
|
2023-11-05 18:32:27 +01:00
|
|
|
#include <wlr/util/box.h>
|
2023-11-24 11:54:21 +01:00
|
|
|
#include <wlr/util/transform.h>
|
|
|
|
#include <wlr/render/swapchain.h>
|
|
|
|
#include <wlr/render/egl.h>
|
2022-10-27 12:26:35 +02:00
|
|
|
|
2023-05-07 01:11:01 +02:00
|
|
|
#include <libdrm/drm_fourcc.h>
|
2022-10-27 14:26:47 +02:00
|
|
|
|
2023-01-29 13:43:18 +01:00
|
|
|
#if WLR_HAS_X11_BACKEND
|
2022-11-05 19:04:44 +01:00
|
|
|
#include <wlr/backend/x11.h>
|
2023-01-29 13:43:18 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NO_XWAYLAND
|
2022-10-27 12:26:35 +02:00
|
|
|
#include <wlr/xwayland.h>
|
|
|
|
#endif
|
2022-03-16 20:50:55 +01:00
|
|
|
}
|
|
|
|
|
2022-08-05 13:03:37 +02:00
|
|
|
#undef delete
|
2022-03-16 20:50:55 +01:00
|
|
|
#undef class
|
|
|
|
#undef namespace
|
|
|
|
#undef static
|
2022-03-16 22:21:12 +01:00
|
|
|
#endif
|
|
|
|
|
2022-04-13 17:34:13 +02:00
|
|
|
#ifdef LEGACY_RENDERER
|
|
|
|
#include <GLES2/gl2.h>
|
|
|
|
#include <GLES2/gl2ext.h>
|
|
|
|
#define GLES2
|
|
|
|
#else
|
|
|
|
#define GLES32
|
2022-03-24 16:07:01 +01:00
|
|
|
#include <GLES3/gl32.h>
|
2022-04-11 16:39:48 +02:00
|
|
|
#include <GLES3/gl3ext.h>
|
2022-04-13 17:34:13 +02:00
|
|
|
#endif
|
2022-03-24 16:07:01 +01:00
|
|
|
|
2023-01-29 13:43:18 +01:00
|
|
|
#if !WLR_HAS_X11_BACKEND
|
|
|
|
#include "helpers/X11Stubs.hpp"
|
|
|
|
#endif
|
|
|
|
|
2022-04-20 15:58:02 +02:00
|
|
|
#ifdef NO_XWAYLAND
|
|
|
|
#define XWAYLAND false
|
2022-10-27 12:26:35 +02:00
|
|
|
#include "helpers/XWaylandStubs.hpp"
|
2022-04-20 15:58:02 +02:00
|
|
|
#else
|
|
|
|
#define XWAYLAND true
|
|
|
|
#endif
|
|
|
|
|
2022-03-16 22:21:12 +01:00
|
|
|
#include "helpers/Vector2D.hpp"
|
2023-11-04 18:03:05 +01:00
|
|
|
#include "helpers/Box.hpp"
|
2023-11-04 18:04:10 +01:00
|
|
|
#include "SharedDefs.hpp"
|