From 593c571d6a1b8922a24ac383fde43d6573b0dd7a Mon Sep 17 00:00:00 2001 From: Riteo Date: Wed, 2 Nov 2022 20:11:55 +0100 Subject: [PATCH] linuxbsd: move all X11 stuff in its own directory This allows implementing `DisplayServer`s like Wayland without making a mess in the source tree. --- platform/linuxbsd/SCsub | 10 +-------- platform/linuxbsd/os_linuxbsd.cpp | 2 +- platform/linuxbsd/x11/SCsub | 21 +++++++++++++++++++ .../linuxbsd/{ => x11}/detect_prime_x11.cpp | 0 .../linuxbsd/{ => x11}/detect_prime_x11.h | 0 .../linuxbsd/{ => x11}/display_server_x11.cpp | 0 .../linuxbsd/{ => x11}/display_server_x11.h | 8 +++---- .../linuxbsd/{ => x11}/gl_manager_x11.cpp | 0 platform/linuxbsd/{ => x11}/gl_manager_x11.h | 0 .../linuxbsd/{ => x11}/key_mapping_x11.cpp | 0 platform/linuxbsd/{ => x11}/key_mapping_x11.h | 0 .../linuxbsd/{ => x11}/vulkan_context_x11.cpp | 0 .../linuxbsd/{ => x11}/vulkan_context_x11.h | 0 13 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 platform/linuxbsd/x11/SCsub rename platform/linuxbsd/{ => x11}/detect_prime_x11.cpp (100%) rename platform/linuxbsd/{ => x11}/detect_prime_x11.h (100%) rename platform/linuxbsd/{ => x11}/display_server_x11.cpp (100%) rename platform/linuxbsd/{ => x11}/display_server_x11.h (99%) rename platform/linuxbsd/{ => x11}/gl_manager_x11.cpp (100%) rename platform/linuxbsd/{ => x11}/gl_manager_x11.h (100%) rename platform/linuxbsd/{ => x11}/key_mapping_x11.cpp (100%) rename platform/linuxbsd/{ => x11}/key_mapping_x11.h (100%) rename platform/linuxbsd/{ => x11}/vulkan_context_x11.cpp (100%) rename platform/linuxbsd/{ => x11}/vulkan_context_x11.h (100%) diff --git a/platform/linuxbsd/SCsub b/platform/linuxbsd/SCsub index 91d45627b9d..fcd739cdc97 100644 --- a/platform/linuxbsd/SCsub +++ b/platform/linuxbsd/SCsub @@ -14,15 +14,7 @@ common_linuxbsd = [ ] if env["x11"]: - common_linuxbsd += [ - "gl_manager_x11.cpp", - "detect_prime_x11.cpp", - "display_server_x11.cpp", - "key_mapping_x11.cpp", - ] - - if env["vulkan"]: - common_linuxbsd.append("vulkan_context_x11.cpp") + common_linuxbsd += SConscript("x11/SCsub") if env["speechd"]: common_linuxbsd.append(["speechd-so_wrap.c", "tts_linux.cpp"]) diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp index 11b667fcef6..98ffa1113f0 100644 --- a/platform/linuxbsd/os_linuxbsd.cpp +++ b/platform/linuxbsd/os_linuxbsd.cpp @@ -40,7 +40,7 @@ #endif #ifdef X11_ENABLED -#include "display_server_x11.h" +#include "x11/display_server_x11.h" #endif #ifdef HAVE_MNTENT diff --git a/platform/linuxbsd/x11/SCsub b/platform/linuxbsd/x11/SCsub new file mode 100644 index 00000000000..974ad98fb93 --- /dev/null +++ b/platform/linuxbsd/x11/SCsub @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +Import("env") + +source_files = [ + "display_server_x11.cpp", + "key_mapping_x11.cpp", +] + +if env["vulkan"]: + source_files.append("vulkan_context_x11.cpp") + +if env["opengl3"]: + source_files.append(["gl_manager_x11.cpp", "detect_prime_x11.cpp"]) + +objects = [] + +for source_file in source_files: + objects.append(env.Object(source_file)) + +Return("objects") diff --git a/platform/linuxbsd/detect_prime_x11.cpp b/platform/linuxbsd/x11/detect_prime_x11.cpp similarity index 100% rename from platform/linuxbsd/detect_prime_x11.cpp rename to platform/linuxbsd/x11/detect_prime_x11.cpp diff --git a/platform/linuxbsd/detect_prime_x11.h b/platform/linuxbsd/x11/detect_prime_x11.h similarity index 100% rename from platform/linuxbsd/detect_prime_x11.h rename to platform/linuxbsd/x11/detect_prime_x11.h diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp similarity index 100% rename from platform/linuxbsd/display_server_x11.cpp rename to platform/linuxbsd/x11/display_server_x11.cpp diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/x11/display_server_x11.h similarity index 99% rename from platform/linuxbsd/display_server_x11.h rename to platform/linuxbsd/x11/display_server_x11.h index 9ef8f71c051..861eced88ba 100644 --- a/platform/linuxbsd/display_server_x11.h +++ b/platform/linuxbsd/x11/display_server_x11.h @@ -47,7 +47,7 @@ #include "servers/rendering_server.h" #if defined(SPEECHD_ENABLED) -#include "tts_linux.h" +#include "../tts_linux.h" #endif #if defined(GLES3_ENABLED) @@ -56,12 +56,12 @@ #if defined(VULKAN_ENABLED) #include "drivers/vulkan/rendering_device_vulkan.h" -#include "platform/linuxbsd/vulkan_context_x11.h" +#include "vulkan_context_x11.h" #endif #if defined(DBUS_ENABLED) -#include "freedesktop_portal_desktop.h" -#include "freedesktop_screensaver.h" +#include "../freedesktop_portal_desktop.h" +#include "../freedesktop_screensaver.h" #endif #include diff --git a/platform/linuxbsd/gl_manager_x11.cpp b/platform/linuxbsd/x11/gl_manager_x11.cpp similarity index 100% rename from platform/linuxbsd/gl_manager_x11.cpp rename to platform/linuxbsd/x11/gl_manager_x11.cpp diff --git a/platform/linuxbsd/gl_manager_x11.h b/platform/linuxbsd/x11/gl_manager_x11.h similarity index 100% rename from platform/linuxbsd/gl_manager_x11.h rename to platform/linuxbsd/x11/gl_manager_x11.h diff --git a/platform/linuxbsd/key_mapping_x11.cpp b/platform/linuxbsd/x11/key_mapping_x11.cpp similarity index 100% rename from platform/linuxbsd/key_mapping_x11.cpp rename to platform/linuxbsd/x11/key_mapping_x11.cpp diff --git a/platform/linuxbsd/key_mapping_x11.h b/platform/linuxbsd/x11/key_mapping_x11.h similarity index 100% rename from platform/linuxbsd/key_mapping_x11.h rename to platform/linuxbsd/x11/key_mapping_x11.h diff --git a/platform/linuxbsd/vulkan_context_x11.cpp b/platform/linuxbsd/x11/vulkan_context_x11.cpp similarity index 100% rename from platform/linuxbsd/vulkan_context_x11.cpp rename to platform/linuxbsd/x11/vulkan_context_x11.cpp diff --git a/platform/linuxbsd/vulkan_context_x11.h b/platform/linuxbsd/x11/vulkan_context_x11.h similarity index 100% rename from platform/linuxbsd/vulkan_context_x11.h rename to platform/linuxbsd/x11/vulkan_context_x11.h