feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *
Import("env")

View file

@ -38,7 +38,7 @@ public:
void initialize();
void disable();
bool is_disabled() const { return disabled; };
bool is_disabled() const { return disabled; }
CrashHandler();
~CrashHandler();

View file

@ -3,8 +3,8 @@ import platform
import sys
from typing import TYPE_CHECKING
from methods import get_compiler_version, print_error, print_warning, using_gcc
from platform_methods import detect_arch
from methods import get_compiler_version, print_error, print_info, print_warning, using_gcc
from platform_methods import detect_arch, validate_arch
if TYPE_CHECKING:
from SCons.Script.SConscript import SConsEnvironment
@ -73,13 +73,8 @@ def get_flags():
def configure(env: "SConsEnvironment"):
# Validate arch.
supported_arches = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64"]
if env["arch"] not in supported_arches:
print_error(
'Unsupported CPU architecture "%s" for Linux / *BSD. Supported architectures are: %s.'
% (env["arch"], ", ".join(supported_arches))
)
sys.exit(255)
supported_arches = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "loongarch64"]
validate_arch(env["arch"], get_name(), supported_arches)
## Build type
@ -128,10 +123,16 @@ def configure(env: "SConsEnvironment"):
found_wrapper = True
break
if not found_wrapper:
print_error(
"Couldn't locate mold installation path. Make sure it's installed in /usr or /usr/local."
)
sys.exit(255)
for path in os.environ["PATH"].split(os.pathsep):
if os.path.isfile(path + "/ld.mold"):
env.Append(LINKFLAGS=["-B" + path])
found_wrapper = True
break
if not found_wrapper:
print_error(
"Couldn't locate mold installation path. Make sure it's installed in /usr, /usr/local or in PATH environment variable."
)
sys.exit(255)
else:
env.Append(LINKFLAGS=["-fuse-ld=mold"])
else:
@ -183,8 +184,8 @@ def configure(env: "SConsEnvironment"):
# LTO
if env["lto"] == "auto": # Full LTO for production.
env["lto"] = "full"
if env["lto"] == "auto": # Enable LTO for production.
env["lto"] = "thin" if env["use_llvm"] else "full"
if env["lto"] != "none":
if env["lto"] == "thin":
@ -221,23 +222,6 @@ def configure(env: "SConsEnvironment"):
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
# freetype depends on libpng and zlib, so bundling one of them while keeping others
# as shared libraries leads to weird issues. And graphite and harfbuzz need freetype.
ft_linked_deps = [
env["builtin_freetype"],
env["builtin_libpng"],
env["builtin_zlib"],
env["builtin_graphite"],
env["builtin_harfbuzz"],
]
if (not all(ft_linked_deps)) and any(ft_linked_deps): # All or nothing.
print_error(
"These libraries should be either all builtin, or all system provided:\n"
"freetype, libpng, zlib, graphite, harfbuzz.\n"
"Please specify `builtin_<name>=no` for all of them, or none."
)
sys.exit(255)
if not env["builtin_freetype"]:
env.ParseConfig("pkg-config freetype2 --cflags --libs")
@ -250,16 +234,17 @@ def configure(env: "SConsEnvironment"):
if not env["builtin_harfbuzz"]:
env.ParseConfig("pkg-config harfbuzz harfbuzz-icu --cflags --libs")
if not env["builtin_icu4c"] or not env["builtin_harfbuzz"]:
print_warning(
"System-provided icu4c or harfbuzz cause known issues for GDExtension (see GH-91401 and GH-100301)."
)
if not env["builtin_libpng"]:
env.ParseConfig("pkg-config libpng16 --cflags --libs")
if not env["builtin_enet"]:
env.ParseConfig("pkg-config libenet --cflags --libs")
if not env["builtin_squish"]:
# libsquish doesn't reliably install its .pc file, so some distros lack it.
env.Append(LIBS=["libsquish"])
if not env["builtin_zstd"]:
env.ParseConfig("pkg-config libzstd --cflags --libs")
@ -288,16 +273,18 @@ def configure(env: "SConsEnvironment"):
env.ParseConfig("pkg-config libwebp --cflags --libs")
if not env["builtin_mbedtls"]:
# mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228
env.Append(LIBS=["mbedtls", "mbedcrypto", "mbedx509"])
# mbedTLS only provides a pkgconfig file since 3.6.0, but we still support 2.28.x,
# so fallback to manually specifying LIBS if it fails.
if os.system("pkg-config --exists mbedtls") == 0: # 0 means found
env.ParseConfig("pkg-config mbedtls mbedcrypto mbedx509 --cflags --libs")
else:
env.Append(LIBS=["mbedtls", "mbedcrypto", "mbedx509"])
if not env["builtin_wslay"]:
env.ParseConfig("pkg-config libwslay --cflags --libs")
if not env["builtin_miniupnpc"]:
# No pkgconfig file so far, hardcode default paths.
env.Prepend(CPPPATH=["/usr/include/miniupnpc"])
env.Append(LIBS=["miniupnpc"])
env.ParseConfig("pkg-config miniupnpc --cflags --libs")
# On Linux wchar_t should be 32-bits
# 16-bit library shouldn't be required due to compiler optimizations
@ -468,11 +455,14 @@ def configure(env: "SConsEnvironment"):
print_error("Wayland EGL library not found. Aborting.")
sys.exit(255)
env.ParseConfig("pkg-config wayland-egl --cflags --libs")
else:
env.Prepend(CPPPATH=["#thirdparty/linuxbsd_headers/wayland/"])
if env["libdecor"]:
env.Prepend(CPPPATH=["#thirdparty/linuxbsd_headers/libdecor-0/"])
if env["libdecor"]:
env.Append(CPPDEFINES=["LIBDECOR_ENABLED"])
env.Prepend(CPPPATH=["#platform/linuxbsd", "#thirdparty/linuxbsd_headers/wayland/"])
env.Append(CPPDEFINES=["WAYLAND_ENABLED"])
env.Append(LIBS=["rt"]) # Needed by glibc, used by _allocate_shm_file
@ -499,7 +489,7 @@ def configure(env: "SConsEnvironment"):
else:
# The default crash handler depends on glibc, so if the host uses
# a different libc (BSD libc, musl), libexecinfo is required.
print("Note: Using `execinfo=no` disables the crash handler on platforms where glibc is missing.")
print_info("Using `execinfo=no` disables the crash handler on platforms where glibc is missing.")
else:
env.Append(CPPDEFINES=["CRASH_HANDLER_ENABLED"])

View file

@ -11,8 +11,8 @@
<members>
<member name="binary_format/architecture" type="String" setter="" getter="">
Application executable architecture.
Supported architectures: [code]x86_32[/code], [code]x86_64[/code], [code]arm64[/code], [code]arm32[/code], [code]rv64[/code], [code]ppc64[/code], and [code]ppc32[/code].
Official export templates include [code]x86_32[/code] and [code]x86_64[/code] binaries only.
Supported architectures: [code]x86_32[/code], [code]x86_64[/code], [code]arm64[/code], [code]arm32[/code], [code]rv64[/code], [code]ppc64[/code], [code]ppc32[/code], and [code]loongarch64[/code].
Official export templates include [code]x86_32[/code], [code]x86_64[/code], [code]arm32[/code], and [code]arm64[/code] binaries only.
</member>
<member name="binary_format/embed_pck" type="bool" setter="" getter="">
If [code]true[/code], project resources are embedded into the executable.

View file

@ -40,10 +40,7 @@
#include "editor/export/editor_export.h"
#include "editor/themes/editor_scale.h"
#include "modules/modules_enabled.gen.h" // For svg.
#ifdef MODULE_SVG_ENABLED
#include "modules/svg/image_loader_svg.h"
#endif
Error EditorExportPlatformLinuxBSD::_export_debug_script(const Ref<EditorExportPreset> &p_preset, const String &p_app_name, const String &p_pkg_name, const String &p_path) {
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::WRITE);
@ -60,7 +57,21 @@ Error EditorExportPlatformLinuxBSD::_export_debug_script(const Ref<EditorExportP
return OK;
}
Error EditorExportPlatformLinuxBSD::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
Error EditorExportPlatformLinuxBSD::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, BitField<EditorExportPlatform::DebugFlags> p_flags) {
String custom_debug = p_preset->get("custom_template/debug");
String custom_release = p_preset->get("custom_template/release");
String arch = p_preset->get("binary_format/architecture");
String template_path = p_debug ? custom_debug : custom_release;
template_path = template_path.strip_edges();
if (!template_path.is_empty()) {
String exe_arch = _get_exe_arch(template_path);
if (arch != exe_arch) {
add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), vformat(TTR("Mismatching custom export template executable architecture, found \"%s\", expected \"%s\"."), exe_arch, arch));
return ERR_CANT_CREATE;
}
}
bool export_as_zip = p_path.ends_with("zip");
String pkg_name;
@ -74,7 +85,7 @@ Error EditorExportPlatformLinuxBSD::export_project(const Ref<EditorExportPreset>
// Setup temp folder.
String path = p_path;
String tmp_dir_path = EditorPaths::get_singleton()->get_cache_dir().path_join(pkg_name);
String tmp_dir_path = EditorPaths::get_singleton()->get_temp_dir().path_join(pkg_name);
Ref<DirAccess> tmp_app_dir = DirAccess::create_for_path(tmp_dir_path);
if (export_as_zip) {
@ -157,7 +168,9 @@ bool EditorExportPlatformLinuxBSD::get_export_option_visibility(const EditorExpo
if (!ssh && p_option != "ssh_remote_deploy/enabled" && p_option.begins_with("ssh_remote_deploy/")) {
return false;
}
if (p_option == "dotnet/embed_build_outputs") {
if (p_option == "dotnet/embed_build_outputs" ||
p_option == "custom_template/debug" ||
p_option == "custom_template/release") {
return advanced_options_enabled;
}
return true;
@ -166,7 +179,7 @@ bool EditorExportPlatformLinuxBSD::get_export_option_visibility(const EditorExpo
void EditorExportPlatformLinuxBSD::get_export_options(List<ExportOption> *r_options) const {
EditorExportPlatformPC::get_export_options(r_options);
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "binary_format/architecture", PROPERTY_HINT_ENUM, "x86_64,x86_32,arm64,arm32,rv64,ppc64,ppc32"), "x86_64"));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "binary_format/architecture", PROPERTY_HINT_ENUM, "x86_64,x86_32,arm64,arm32,rv64,ppc64,ppc32,loongarch64"), "x86_64"));
String run_script = "#!/usr/bin/env bash\n"
"export DISPLAY=:0\n"
@ -205,8 +218,78 @@ bool EditorExportPlatformLinuxBSD::is_executable(const String &p_path) const {
return is_elf(p_path) || is_shebang(p_path);
}
bool EditorExportPlatformLinuxBSD::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const {
String err;
bool valid = EditorExportPlatformPC::has_valid_export_configuration(p_preset, err, r_missing_templates, p_debug);
String custom_debug = p_preset->get("custom_template/debug").operator String().strip_edges();
String custom_release = p_preset->get("custom_template/release").operator String().strip_edges();
String arch = p_preset->get("binary_format/architecture");
if (!custom_debug.is_empty() && FileAccess::exists(custom_debug)) {
String exe_arch = _get_exe_arch(custom_debug);
if (arch != exe_arch) {
err += vformat(TTR("Mismatching custom debug export template executable architecture: found \"%s\", expected \"%s\"."), exe_arch, arch) + "\n";
}
}
if (!custom_release.is_empty() && FileAccess::exists(custom_release)) {
String exe_arch = _get_exe_arch(custom_release);
if (arch != exe_arch) {
err += vformat(TTR("Mismatching custom release export template executable architecture: found \"%s\", expected \"%s\"."), exe_arch, arch) + "\n";
}
}
if (!err.is_empty()) {
r_error = err;
}
return valid;
}
String EditorExportPlatformLinuxBSD::_get_exe_arch(const String &p_path) const {
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ);
if (f.is_null()) {
return "invalid";
}
// Read and check ELF magic number.
{
uint32_t magic = f->get_32();
if (magic != 0x464c457f) { // 0x7F + "ELF"
return "invalid";
}
}
// Process header.
int64_t header_pos = f->get_position();
f->seek(header_pos + 14);
uint16_t machine = f->get_16();
f->close();
switch (machine) {
case 0x0003:
return "x86_32";
case 0x003e:
return "x86_64";
case 0x0014:
return "ppc32";
case 0x0015:
return "ppc64";
case 0x0028:
return "arm32";
case 0x00b7:
return "arm64";
case 0x00f3:
return "rv64";
case 0x0102:
return "loongarch64";
default:
return "unknown";
}
}
Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) {
// Patch the header of the "pck" section in the ELF file so that it corresponds to the embedded data
// Patch the header of the "pck" section in the ELF file so that it corresponds to the embedded data.
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ_WRITE);
if (f.is_null()) {
@ -214,7 +297,7 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
return ERR_CANT_OPEN;
}
// Read and check ELF magic number
// Read and check ELF magic number.
{
uint32_t magic = f->get_32();
if (magic != 0x464c457f) { // 0x7F + "ELF"
@ -223,7 +306,7 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
}
}
// Read program architecture bits from class field
// Read program architecture bits from class field.
int bits = f->get_8() * 32;
@ -231,7 +314,7 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
add_message(EXPORT_MESSAGE_ERROR, TTR("PCK Embedding"), TTR("32-bit executables cannot have embedded data >= 4 GiB."));
}
// Get info about the section header table
// Get info about the section header table.
int64_t section_table_pos;
int64_t section_header_size;
@ -249,13 +332,13 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
int num_sections = f->get_16();
int string_section_idx = f->get_16();
// Load the strings table
// Load the strings table.
uint8_t *strings;
{
// Jump to the strings section header
// Jump to the strings section header.
f->seek(section_table_pos + string_section_idx * section_header_size);
// Read strings data size and offset
// Read strings data size and offset.
int64_t string_data_pos;
int64_t string_data_size;
if (bits == 32) {
@ -268,7 +351,7 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
string_data_size = f->get_64();
}
// Read strings data
// Read strings data.
f->seek(string_data_pos);
strings = (uint8_t *)memalloc(string_data_size);
if (!strings) {
@ -277,7 +360,7 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
f->get_buffer(strings, string_data_size);
}
// Search for the "pck" section
// Search for the "pck" section.
bool found = false;
for (int i = 0; i < num_sections; ++i) {
@ -376,7 +459,7 @@ void EditorExportPlatformLinuxBSD::cleanup() {
cleanup_commands.clear();
}
Error EditorExportPlatformLinuxBSD::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
Error EditorExportPlatformLinuxBSD::run(const Ref<EditorExportPreset> &p_preset, int p_device, BitField<EditorExportPlatform::DebugFlags> p_debug_flags) {
cleanup();
if (p_device) { // Stop command, cleanup only.
return OK;
@ -384,7 +467,7 @@ Error EditorExportPlatformLinuxBSD::run(const Ref<EditorExportPreset> &p_preset,
EditorProgress ep("run", TTR("Running..."), 5);
const String dest = EditorPaths::get_singleton()->get_cache_dir().path_join("linuxbsd");
const String dest = EditorPaths::get_singleton()->get_temp_dir().path_join("linuxbsd");
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
if (!da->dir_exists(dest)) {
Error err = da->make_dir_recursive(dest);
@ -430,8 +513,7 @@ Error EditorExportPlatformLinuxBSD::run(const Ref<EditorExportPreset> &p_preset,
String cmd_args;
{
Vector<String> cmd_args_list;
gen_debug_flags(cmd_args_list, p_debug_flags);
Vector<String> cmd_args_list = gen_export_flags(p_debug_flags);
for (int i = 0; i < cmd_args_list.size(); i++) {
if (i != 0) {
cmd_args += " ";
@ -440,7 +522,7 @@ Error EditorExportPlatformLinuxBSD::run(const Ref<EditorExportPreset> &p_preset,
}
}
const bool use_remote = (p_debug_flags & DEBUG_FLAG_REMOTE_DEBUG) || (p_debug_flags & DEBUG_FLAG_DUMB_CLIENT);
const bool use_remote = p_debug_flags.has_flag(DEBUG_FLAG_REMOTE_DEBUG) || p_debug_flags.has_flag(DEBUG_FLAG_DUMB_CLIENT);
int dbg_port = EditorSettings::get_singleton()->get("network/debug/remote_port");
print_line("Creating temporary directory...");
@ -525,7 +607,6 @@ Error EditorExportPlatformLinuxBSD::run(const Ref<EditorExportPreset> &p_preset,
EditorExportPlatformLinuxBSD::EditorExportPlatformLinuxBSD() {
if (EditorNode::get_singleton()) {
#ifdef MODULE_SVG_ENABLED
Ref<Image> img = memnew(Image);
const bool upsample = !Math::is_equal_approx(Math::round(EDSCALE), EDSCALE);
@ -534,7 +615,6 @@ EditorExportPlatformLinuxBSD::EditorExportPlatformLinuxBSD() {
ImageLoaderSVG::create_image_from_string(img, _linuxbsd_run_icon_svg, EDSCALE, upsample, false);
run_icon = ImageTexture::create_from_image(img);
#endif
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
if (theme.is_valid()) {

View file

@ -48,14 +48,14 @@ class EditorExportPlatformLinuxBSD : public EditorExportPlatformPC {
String cmd_args;
bool wait = false;
SSHCleanupCommand(){};
SSHCleanupCommand() {}
SSHCleanupCommand(const String &p_host, const String &p_port, const Vector<String> &p_ssh_arg, const String &p_cmd_args, bool p_wait = false) {
host = p_host;
port = p_port;
ssh_args = p_ssh_arg;
cmd_args = p_cmd_args;
wait = p_wait;
};
}
};
Ref<ImageTexture> run_icon;
@ -69,12 +69,14 @@ class EditorExportPlatformLinuxBSD : public EditorExportPlatformPC {
bool is_shebang(const String &p_path) const;
Error _export_debug_script(const Ref<EditorExportPreset> &p_preset, const String &p_app_name, const String &p_pkg_name, const String &p_path);
String _get_exe_arch(const String &p_path) const;
public:
virtual void get_export_options(List<ExportOption> *r_options) const override;
virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override;
virtual bool get_export_option_visibility(const EditorExportPreset *p_preset, const String &p_option) const override;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override;
virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, BitField<EditorExportPlatform::DebugFlags> p_flags = 0) override;
virtual String get_template_file_name(const String &p_target, const String &p_arch) const override;
virtual Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) override;
virtual bool is_executable(const String &p_path) const override;
@ -85,7 +87,7 @@ public:
virtual int get_options_count() const override;
virtual String get_option_label(int p_index) const override;
virtual String get_option_tooltip(int p_index) const override;
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) override;
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, BitField<EditorExportPlatform::DebugFlags> p_debug_flags) override;
virtual void cleanup() override;
EditorExportPlatformLinuxBSD();

View file

@ -49,6 +49,7 @@
#define BUS_OBJECT_NAME "org.freedesktop.portal.Desktop"
#define BUS_OBJECT_PATH "/org/freedesktop/portal/desktop"
#define BUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
#define BUS_INTERFACE_SETTINGS "org.freedesktop.portal.Settings"
#define BUS_INTERFACE_FILE_CHOOSER "org.freedesktop.portal.FileChooser"
@ -142,7 +143,7 @@ void FreeDesktopPortalDesktop::append_dbus_string(DBusMessageIter *p_iter, const
}
}
void FreeDesktopPortalDesktop::append_dbus_dict_options(DBusMessageIter *p_iter, const TypedArray<Dictionary> &p_options) {
void FreeDesktopPortalDesktop::append_dbus_dict_options(DBusMessageIter *p_iter, const TypedArray<Dictionary> &p_options, HashMap<String, String> &r_ids) {
DBusMessageIter dict_iter;
DBusMessageIter var_iter;
DBusMessageIter arr_iter;
@ -153,6 +154,7 @@ void FreeDesktopPortalDesktop::append_dbus_dict_options(DBusMessageIter *p_iter,
dbus_message_iter_open_container(&dict_iter, DBUS_TYPE_VARIANT, "a(ssa(ss)s)", &var_iter);
dbus_message_iter_open_container(&var_iter, DBUS_TYPE_ARRAY, "(ss(ss)s)", &arr_iter);
r_ids.clear();
for (int i = 0; i < p_options.size(); i++) {
const Dictionary &item = p_options[i];
if (!item.has("name") || !item.has("values") || !item.has("default")) {
@ -166,8 +168,9 @@ void FreeDesktopPortalDesktop::append_dbus_dict_options(DBusMessageIter *p_iter,
DBusMessageIter array_iter;
DBusMessageIter array_struct_iter;
dbus_message_iter_open_container(&arr_iter, DBUS_TYPE_STRUCT, nullptr, &struct_iter);
append_dbus_string(&struct_iter, name); // ID.
append_dbus_string(&struct_iter, "option_" + itos(i)); // ID.
append_dbus_string(&struct_iter, name); // User visible name.
r_ids["option_" + itos(i)] = name;
dbus_message_iter_open_container(&struct_iter, DBUS_TYPE_ARRAY, "(ss)", &array_iter);
for (int j = 0; j < options.size(); j++) {
@ -190,13 +193,14 @@ void FreeDesktopPortalDesktop::append_dbus_dict_options(DBusMessageIter *p_iter,
dbus_message_iter_close_container(p_iter, &dict_iter);
}
void FreeDesktopPortalDesktop::append_dbus_dict_filters(DBusMessageIter *p_iter, const Vector<String> &p_filter_names, const Vector<String> &p_filter_exts) {
void FreeDesktopPortalDesktop::append_dbus_dict_filters(DBusMessageIter *p_iter, const Vector<String> &p_filter_names, const Vector<String> &p_filter_exts, const Vector<String> &p_filter_mimes) {
DBusMessageIter dict_iter;
DBusMessageIter var_iter;
DBusMessageIter arr_iter;
const char *filters_key = "filters";
ERR_FAIL_COND(p_filter_names.size() != p_filter_exts.size());
ERR_FAIL_COND(p_filter_names.size() != p_filter_mimes.size());
dbus_message_iter_open_container(p_iter, DBUS_TYPE_DICT_ENTRY, nullptr, &dict_iter);
dbus_message_iter_append_basic(&dict_iter, DBUS_TYPE_STRING, &filters_key);
@ -210,14 +214,34 @@ void FreeDesktopPortalDesktop::append_dbus_dict_filters(DBusMessageIter *p_iter,
append_dbus_string(&struct_iter, p_filter_names[i]);
dbus_message_iter_open_container(&struct_iter, DBUS_TYPE_ARRAY, "(us)", &array_iter);
const String &flt = p_filter_exts[i];
const String &flt_orig = p_filter_exts[i];
String flt;
for (int j = 0; j < flt_orig.length(); j++) {
if (is_unicode_letter(flt_orig[j])) {
flt += vformat("[%c%c]", String::char_lowercase(flt_orig[j]), String::char_uppercase(flt_orig[j]));
} else {
flt += flt_orig[j];
}
}
int filter_slice_count = flt.get_slice_count(",");
for (int j = 0; j < filter_slice_count; j++) {
dbus_message_iter_open_container(&array_iter, DBUS_TYPE_STRUCT, nullptr, &array_struct_iter);
String str = (flt.get_slice(",", j).strip_edges());
{
const unsigned nil = 0;
dbus_message_iter_append_basic(&array_struct_iter, DBUS_TYPE_UINT32, &nil);
const unsigned flt_type = 0;
dbus_message_iter_append_basic(&array_struct_iter, DBUS_TYPE_UINT32, &flt_type);
}
append_dbus_string(&array_struct_iter, str);
dbus_message_iter_close_container(&array_iter, &array_struct_iter);
}
const String &mime = p_filter_mimes[i];
filter_slice_count = mime.get_slice_count(",");
for (int j = 0; j < filter_slice_count; j++) {
dbus_message_iter_open_container(&array_iter, DBUS_TYPE_STRUCT, nullptr, &array_struct_iter);
String str = mime.get_slicec(',', j).strip_edges();
{
const unsigned flt_type = 1;
dbus_message_iter_append_basic(&array_struct_iter, DBUS_TYPE_UINT32, &flt_type);
}
append_dbus_string(&array_struct_iter, str);
dbus_message_iter_close_container(&array_iter, &array_struct_iter);
@ -271,7 +295,7 @@ void FreeDesktopPortalDesktop::append_dbus_dict_bool(DBusMessageIter *p_iter, co
dbus_message_iter_close_container(p_iter, &dict_iter);
}
bool FreeDesktopPortalDesktop::file_chooser_parse_response(DBusMessageIter *p_iter, const Vector<String> &p_names, bool &r_cancel, Vector<String> &r_urls, int &r_index, Dictionary &r_options) {
bool FreeDesktopPortalDesktop::file_chooser_parse_response(DBusMessageIter *p_iter, const Vector<String> &p_names, const HashMap<String, String> &p_ids, bool &r_cancel, Vector<String> &r_urls, int &r_index, Dictionary &r_options) {
ERR_FAIL_COND_V(dbus_message_iter_get_arg_type(p_iter) != DBUS_TYPE_UINT32, false);
dbus_uint32_t resp_code;
@ -320,17 +344,20 @@ bool FreeDesktopPortalDesktop::file_chooser_parse_response(DBusMessageIter *p_it
const char *opt_key = nullptr;
dbus_message_iter_get_basic(&opt_iter, &opt_key);
String opt_skey = String::utf8(opt_key);
dbus_message_iter_next(&opt_iter);
const char *opt_val = nullptr;
dbus_message_iter_get_basic(&opt_iter, &opt_val);
String opt_sval = String::utf8(opt_val);
if (opt_sval == "true") {
r_options[opt_skey] = true;
} else if (opt_sval == "false") {
r_options[opt_skey] = false;
} else {
r_options[opt_skey] = opt_sval.to_int();
if (p_ids.has(opt_skey)) {
opt_skey = p_ids[opt_skey];
if (opt_sval == "true") {
r_options[opt_skey] = true;
} else if (opt_sval == "false") {
r_options[opt_skey] = false;
} else {
r_options[opt_skey] = opt_sval.to_int();
}
}
if (!dbus_message_iter_next(&struct_iter)) {
@ -361,6 +388,61 @@ bool FreeDesktopPortalDesktop::file_chooser_parse_response(DBusMessageIter *p_it
return true;
}
bool FreeDesktopPortalDesktop::_is_interface_supported(const char *p_iface) {
bool supported = false;
DBusError err;
dbus_error_init(&err);
DBusConnection *bus = dbus_bus_get(DBUS_BUS_SESSION, &err);
if (dbus_error_is_set(&err)) {
dbus_error_free(&err);
} else {
DBusMessage *message = dbus_message_new_method_call(BUS_OBJECT_NAME, BUS_OBJECT_PATH, BUS_INTERFACE_PROPERTIES, "Get");
if (message) {
const char *name_space = p_iface;
const char *key = "version";
dbus_message_append_args(
message,
DBUS_TYPE_STRING, &name_space,
DBUS_TYPE_STRING, &key,
DBUS_TYPE_INVALID);
DBusMessage *reply = dbus_connection_send_with_reply_and_block(bus, message, 250, &err);
if (dbus_error_is_set(&err)) {
dbus_error_free(&err);
} else if (reply) {
DBusMessageIter iter;
if (dbus_message_iter_init(reply, &iter)) {
DBusMessageIter iter_ver;
dbus_message_iter_recurse(&iter, &iter_ver);
dbus_uint32_t ver_code;
dbus_message_iter_get_basic(&iter_ver, &ver_code);
print_verbose(vformat("PortalDesktop: %s version %d detected.", p_iface, ver_code));
supported = true;
}
dbus_message_unref(reply);
}
dbus_message_unref(message);
}
dbus_connection_unref(bus);
}
return supported;
}
bool FreeDesktopPortalDesktop::is_file_chooser_supported() {
static int supported = -1;
if (supported == -1) {
supported = _is_interface_supported(BUS_INTERFACE_FILE_CHOOSER);
}
return supported;
}
bool FreeDesktopPortalDesktop::is_settings_supported() {
static int supported = -1;
if (supported == -1) {
supported = _is_interface_supported(BUS_INTERFACE_SETTINGS);
}
return supported;
}
Error FreeDesktopPortalDesktop::file_dialog_show(DisplayServer::WindowID p_window_id, const String &p_xid, const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, DisplayServer::FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, bool p_options_in_cb) {
if (unsupported) {
return FAILED;
@ -371,24 +453,38 @@ Error FreeDesktopPortalDesktop::file_dialog_show(DisplayServer::WindowID p_windo
Vector<String> filter_names;
Vector<String> filter_exts;
Vector<String> filter_mimes;
for (int i = 0; i < p_filters.size(); i++) {
Vector<String> tokens = p_filters[i].split(";");
if (tokens.size() >= 1) {
String flt = tokens[0].strip_edges();
if (!flt.is_empty()) {
if (tokens.size() == 2) {
filter_exts.push_back(flt);
String mime = (tokens.size() >= 2) ? tokens[2].strip_edges() : String();
if (!flt.is_empty() || !mime.is_empty()) {
if (tokens.size() >= 2) {
if (flt == "*.*") {
filter_exts.push_back("*");
} else {
filter_exts.push_back(flt);
}
filter_mimes.push_back(mime);
filter_names.push_back(tokens[1]);
} else {
filter_exts.push_back(flt);
filter_names.push_back(flt);
if (flt == "*.*") {
filter_exts.push_back("*");
filter_names.push_back(RTR("All Files") + " (*.*)");
} else {
filter_exts.push_back(flt);
filter_names.push_back(flt);
}
filter_mimes.push_back(mime);
}
}
}
}
if (filter_names.is_empty()) {
filter_exts.push_back("*.*");
filter_names.push_back(RTR("All Files"));
filter_exts.push_back("*");
filter_mimes.push_back("");
filter_names.push_back(RTR("All Files") + " (*.*)");
}
DBusError err;
@ -442,9 +538,9 @@ Error FreeDesktopPortalDesktop::file_dialog_show(DisplayServer::WindowID p_windo
append_dbus_dict_string(&arr_iter, "handle_token", token);
append_dbus_dict_bool(&arr_iter, "multiple", p_mode == DisplayServer::FILE_DIALOG_MODE_OPEN_FILES);
append_dbus_dict_bool(&arr_iter, "directory", p_mode == DisplayServer::FILE_DIALOG_MODE_OPEN_DIR);
append_dbus_dict_filters(&arr_iter, filter_names, filter_exts);
append_dbus_dict_filters(&arr_iter, filter_names, filter_exts, filter_mimes);
append_dbus_dict_options(&arr_iter, p_options);
append_dbus_dict_options(&arr_iter, p_options, fd.option_ids);
append_dbus_dict_string(&arr_iter, "current_folder", p_current_directory, true);
if (p_mode == DisplayServer::FILE_DIALOG_MODE_SAVE_FILE) {
append_dbus_dict_string(&arr_iter, "current_name", p_filename);
@ -559,7 +655,7 @@ void FreeDesktopPortalDesktop::_thread_monitor(void *p_ud) {
Vector<String> uris;
Dictionary options;
int index = 0;
file_chooser_parse_response(&iter, fd.filter_names, cancel, uris, index, options);
file_chooser_parse_response(&iter, fd.filter_names, fd.option_ids, cancel, uris, index, options);
if (fd.callback.is_valid()) {
FileDialogCallback cb;

View file

@ -50,14 +50,15 @@ private:
bool read_setting(const char *p_namespace, const char *p_key, int p_type, void *r_value);
static void append_dbus_string(DBusMessageIter *p_iter, const String &p_string);
static void append_dbus_dict_options(DBusMessageIter *p_iter, const TypedArray<Dictionary> &p_options);
static void append_dbus_dict_filters(DBusMessageIter *p_iter, const Vector<String> &p_filter_names, const Vector<String> &p_filter_exts);
static void append_dbus_dict_options(DBusMessageIter *p_iter, const TypedArray<Dictionary> &p_options, HashMap<String, String> &r_ids);
static void append_dbus_dict_filters(DBusMessageIter *p_iter, const Vector<String> &p_filter_names, const Vector<String> &p_filter_exts, const Vector<String> &p_filter_mimes);
static void append_dbus_dict_string(DBusMessageIter *p_iter, const String &p_key, const String &p_value, bool p_as_byte_array = false);
static void append_dbus_dict_bool(DBusMessageIter *p_iter, const String &p_key, bool p_value);
static bool file_chooser_parse_response(DBusMessageIter *p_iter, const Vector<String> &p_names, bool &r_cancel, Vector<String> &r_urls, int &r_index, Dictionary &r_options);
static bool file_chooser_parse_response(DBusMessageIter *p_iter, const Vector<String> &p_names, const HashMap<String, String> &p_ids, bool &r_cancel, Vector<String> &r_urls, int &r_index, Dictionary &r_options);
struct FileDialogData {
Vector<String> filter_names;
HashMap<String, String> option_ids;
DisplayServer::WindowID prev_focus = DisplayServer::INVALID_WINDOW_ID;
Callable callback;
String filter;
@ -84,6 +85,7 @@ private:
String theme_path;
Callable system_theme_changed;
void _system_theme_changed_callback();
bool _is_interface_supported(const char *p_iface);
static void _thread_monitor(void *p_ud);
@ -92,10 +94,16 @@ public:
~FreeDesktopPortalDesktop();
bool is_supported() { return !unsupported; }
bool is_file_chooser_supported();
bool is_settings_supported();
// org.freedesktop.portal.FileChooser methods.
Error file_dialog_show(DisplayServer::WindowID p_window_id, const String &p_xid, const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, DisplayServer::FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback, bool p_options_in_cb);
void process_file_dialog_callbacks();
// org.freedesktop.portal.Settings methods.
// Retrieve the system's preferred color scheme.
// 0: No preference or unknown.
// 1: Prefer dark appearance.

View file

@ -50,7 +50,7 @@
#define LONG_BITS (sizeof(long) * 8)
#define test_bit(nr, addr) (((1UL << ((nr) % LONG_BITS)) & ((addr)[(nr) / LONG_BITS])) != 0)
#define NBITS(x) ((((x)-1) / LONG_BITS) + 1)
#define NBITS(x) ((((x) - 1) / LONG_BITS) + 1)
#ifdef UDEV_ENABLED
static const char *ignore_str = "/dev/input/js";

View file

@ -184,7 +184,7 @@ String OS_LinuxBSD::get_processor_name() const {
while (!f->eof_reached()) {
const String line = f->get_line();
if (line.contains("model name")) {
if (line.to_lower().contains("model name")) {
return line.split(":")[1].strip_edges();
}
}
@ -771,11 +771,11 @@ Vector<String> OS_LinuxBSD::get_system_font_path_for_text(const String &p_font_n
FcLangSetAdd(lang_set, reinterpret_cast<const FcChar8 *>(p_locale.utf8().get_data()));
FcPatternAddLangSet(pattern, FC_LANG, lang_set);
FcConfigSubstitute(0, pattern, FcMatchPattern);
FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);
FcResult result;
FcPattern *match = FcFontMatch(0, pattern, &result);
FcPattern *match = FcFontMatch(nullptr, pattern, &result);
if (match) {
char *file_name = nullptr;
if (FcPatternGetString(match, FC_FILE, 0, reinterpret_cast<FcChar8 **>(&file_name)) == FcResultMatch) {
@ -816,11 +816,11 @@ String OS_LinuxBSD::get_system_font_path(const String &p_font_name, int p_weight
FcPatternAddInteger(pattern, FC_WIDTH, _stretch_to_fc(p_stretch));
FcPatternAddInteger(pattern, FC_SLANT, p_italic ? FC_SLANT_ITALIC : FC_SLANT_ROMAN);
FcConfigSubstitute(0, pattern, FcMatchPattern);
FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);
FcResult result;
FcPattern *match = FcFontMatch(0, pattern, &result);
FcPattern *match = FcFontMatch(nullptr, pattern, &result);
if (match) {
if (!allow_substitutes) {
char *family_name = nullptr;

View file

@ -5,6 +5,6 @@ import os
def make_debug_linuxbsd(target, source, env):
dst = str(target[0])
os.system("objcopy --only-keep-debug {0} {0}.debugsymbols".format(dst))
os.system("strip --strip-debug --strip-unneeded {0}".format(dst))
os.system("objcopy --add-gnu-debuglink={0}.debugsymbols {0}".format(dst))
os.system('objcopy --only-keep-debug "{0}" "{0}.debugsymbols"'.format(dst))
os.system('strip --strip-debug --strip-unneeded "{0}"'.format(dst))
os.system('objcopy --add-gnu-debuglink="{0}.debugsymbols" "{0}"'.format(dst))

View file

@ -101,7 +101,7 @@ void TTS_Linux::speech_event_callback(size_t p_msg_id, size_t p_client_id, SPDNo
}
}
void TTS_Linux::_load_voices() {
void TTS_Linux::_load_voices() const {
if (!voices_loaded) {
SPDVoice **spd_voices = spd_list_synthesis_voices(synth);
if (spd_voices != nullptr) {
@ -193,7 +193,7 @@ Array TTS_Linux::get_voices() const {
_THREAD_SAFE_METHOD_
ERR_FAIL_NULL_V(synth, Array());
const_cast<TTS_Linux *>(this)->_load_voices();
_load_voices();
Array list;
for (const KeyValue<String, VoiceInfo> &E : voices) {

View file

@ -59,8 +59,8 @@ class TTS_Linux : public Object {
String language;
String variant;
};
bool voices_loaded = false;
HashMap<String, VoiceInfo> voices;
mutable bool voices_loaded = false;
mutable HashMap<String, VoiceInfo> voices;
Thread init_thread;
@ -71,7 +71,7 @@ class TTS_Linux : public Object {
static TTS_Linux *singleton;
protected:
void _load_voices();
void _load_voices() const;
void _speech_event(int p_msg_id, int p_type);
void _speech_index_mark(int p_msg_id, int p_type, const String &p_index_mark);

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *
Import("env")
@ -10,16 +11,16 @@ if env["use_sowrap"]:
WAYLAND_BUILDERS_SOWRAP = {
"WAYLAND_API_HEADER": Builder(
action=Action(
r"wayland-scanner -c client-header < ${SOURCE} | sed 's:wayland-client-core\.h:../dynwrappers/wayland-client-core-so_wrap\.h:' > ${TARGET}",
'Generating Wayland client header: "${TARGET}"',
action=env.Run(
r"wayland-scanner -c client-header < ${SOURCE} | "
r"sed 's:wayland-client-core\.h:../dynwrappers/wayland-client-core-so_wrap\.h:' > ${TARGET}",
),
single_source=True,
),
"WAYLAND_API_CODE": Builder(
action=Action(
r"wayland-scanner -c private-code < ${SOURCE} | sed 's:wayland-util\.h:../dynwrappers/wayland-client-core-so_wrap\.h:' > ${TARGET}",
'Generating Wayland protocol marshaling code: "${TARGET}"',
action=env.Run(
r"wayland-scanner -c private-code < ${SOURCE} | "
r"sed 's:wayland-util\.h:../dynwrappers/wayland-client-core-so_wrap\.h:' > ${TARGET}",
),
single_source=True,
),
@ -28,155 +29,140 @@ if env["use_sowrap"]:
else:
WAYLAND_BUILDERS = {
"WAYLAND_API_HEADER": Builder(
action=Action(
r"wayland-scanner -c client-header < ${SOURCE} > ${TARGET}",
'Generating Wayland client header: "${TARGET}"',
),
action=env.Run(r"wayland-scanner -c client-header < ${SOURCE} > ${TARGET}"),
single_source=True,
),
"WAYLAND_API_CODE": Builder(
action=Action(
r"wayland-scanner -c private-code < ${SOURCE} > ${TARGET}",
'Generating Wayland protocol marshaling code: "${TARGET}"',
),
action=env.Run(r"wayland-scanner -c private-code < ${SOURCE} > ${TARGET}"),
single_source=True,
),
}
env.Append(BUILDERS=WAYLAND_BUILDERS)
env.WAYLAND_API_HEADER(target="protocol/wayland.gen.h", source="#thirdparty/wayland/protocol/wayland.xml")
env.WAYLAND_API_CODE(target="protocol/wayland.gen.c", source="#thirdparty/wayland/protocol/wayland.xml")
env.WAYLAND_API_HEADER(
target="protocol/viewporter.gen.h", source="#thirdparty/wayland-protocols/stable/viewporter/viewporter.xml"
)
env.WAYLAND_API_CODE(
target="protocol/viewporter.gen.c", source="#thirdparty/wayland-protocols/stable/viewporter/viewporter.xml"
env.NoCache(
env.WAYLAND_API_HEADER("protocol/wayland.gen.h", "#thirdparty/wayland/protocol/wayland.xml"),
env.WAYLAND_API_CODE("protocol/wayland.gen.c", "#thirdparty/wayland/protocol/wayland.xml"),
env.WAYLAND_API_HEADER(
"protocol/viewporter.gen.h", "#thirdparty/wayland-protocols/stable/viewporter/viewporter.xml"
),
env.WAYLAND_API_CODE("protocol/viewporter.gen.c", "#thirdparty/wayland-protocols/stable/viewporter/viewporter.xml"),
env.WAYLAND_API_HEADER(
"protocol/fractional_scale.gen.h",
"#thirdparty/wayland-protocols/staging/fractional-scale/fractional-scale-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/fractional_scale.gen.c",
"#thirdparty/wayland-protocols/staging/fractional-scale/fractional-scale-v1.xml",
),
env.WAYLAND_API_HEADER("protocol/xdg_shell.gen.h", "#thirdparty/wayland-protocols/stable/xdg-shell/xdg-shell.xml"),
env.WAYLAND_API_CODE("protocol/xdg_shell.gen.c", "#thirdparty/wayland-protocols/stable/xdg-shell/xdg-shell.xml"),
env.WAYLAND_API_HEADER(
"protocol/xdg_decoration.gen.h",
"#thirdparty/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/xdg_decoration.gen.c",
"#thirdparty/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml",
),
env.WAYLAND_API_HEADER(
"protocol/xdg_activation.gen.h",
"#thirdparty/wayland-protocols/staging/xdg-activation/xdg-activation-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/xdg_activation.gen.c",
"#thirdparty/wayland-protocols/staging/xdg-activation/xdg-activation-v1.xml",
),
env.WAYLAND_API_HEADER(
"protocol/relative_pointer.gen.h",
"#thirdparty/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/relative_pointer.gen.c",
"#thirdparty/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml",
),
env.WAYLAND_API_HEADER(
"protocol/pointer_constraints.gen.h",
"#thirdparty/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/pointer_constraints.gen.c",
"#thirdparty/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml",
),
env.WAYLAND_API_HEADER(
"protocol/pointer_gestures.gen.h",
"#thirdparty/wayland-protocols/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/pointer_gestures.gen.c",
"#thirdparty/wayland-protocols/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml",
),
env.WAYLAND_API_HEADER(
"protocol/primary_selection.gen.h",
"#thirdparty/wayland-protocols/unstable/primary-selection/primary-selection-unstable-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/primary_selection.gen.c",
"#thirdparty/wayland-protocols/unstable/primary-selection/primary-selection-unstable-v1.xml",
),
env.WAYLAND_API_HEADER(
"protocol/idle_inhibit.gen.h",
"#thirdparty/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/idle_inhibit.gen.c",
"#thirdparty/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml",
),
env.WAYLAND_API_HEADER(
"protocol/tablet.gen.h",
"#thirdparty/wayland-protocols/unstable/tablet/tablet-unstable-v2.xml",
),
env.WAYLAND_API_CODE(
"protocol/tablet.gen.c",
"#thirdparty/wayland-protocols/unstable/tablet/tablet-unstable-v2.xml",
),
env.WAYLAND_API_HEADER(
"protocol/text_input.gen.h",
"#thirdparty/wayland-protocols/unstable/text-input/text-input-unstable-v3.xml",
),
env.WAYLAND_API_CODE(
"protocol/text_input.gen.c",
"#thirdparty/wayland-protocols/unstable/text-input/text-input-unstable-v3.xml",
),
env.WAYLAND_API_HEADER(
"protocol/xdg_foreign_v1.gen.h",
"#thirdparty/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/xdg_foreign_v1.gen.c",
"#thirdparty/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml",
),
env.WAYLAND_API_HEADER(
"protocol/xdg_foreign_v2.gen.h",
"#thirdparty/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml",
),
env.WAYLAND_API_CODE(
"protocol/xdg_foreign_v2.gen.c",
"#thirdparty/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml",
),
env.WAYLAND_API_HEADER(
"protocol/xdg_system_bell.gen.h",
"#thirdparty/wayland-protocols/staging/xdg-system-bell/xdg-system-bell-v1.xml",
),
env.WAYLAND_API_CODE(
"protocol/xdg_system_bell.gen.c",
"#thirdparty/wayland-protocols/staging/xdg-system-bell/xdg-system-bell-v1.xml",
),
)
env.WAYLAND_API_HEADER(
target="protocol/fractional_scale.gen.h",
source="#thirdparty/wayland-protocols/staging/fractional-scale/fractional-scale-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/fractional_scale.gen.c",
source="#thirdparty/wayland-protocols/staging/fractional-scale/fractional-scale-v1.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/xdg_shell.gen.h", source="#thirdparty/wayland-protocols/stable/xdg-shell/xdg-shell.xml"
)
env.WAYLAND_API_CODE(
target="protocol/xdg_shell.gen.c", source="#thirdparty/wayland-protocols/stable/xdg-shell/xdg-shell.xml"
)
env.WAYLAND_API_HEADER(
target="protocol/xdg_decoration.gen.h",
source="#thirdparty/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/xdg_decoration.gen.c",
source="#thirdparty/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/xdg_activation.gen.h",
source="#thirdparty/wayland-protocols/staging/xdg-activation/xdg-activation-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/xdg_activation.gen.c",
source="#thirdparty/wayland-protocols/staging/xdg-activation/xdg-activation-v1.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/relative_pointer.gen.h",
source="#thirdparty/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/relative_pointer.gen.c",
source="#thirdparty/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/pointer_constraints.gen.h",
source="#thirdparty/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/pointer_constraints.gen.c",
source="#thirdparty/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/pointer_gestures.gen.h",
source="#thirdparty/wayland-protocols/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/pointer_gestures.gen.c",
source="#thirdparty/wayland-protocols/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/primary_selection.gen.h",
source="#thirdparty/wayland-protocols/unstable/primary-selection/primary-selection-unstable-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/primary_selection.gen.c",
source="#thirdparty/wayland-protocols/unstable/primary-selection/primary-selection-unstable-v1.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/idle_inhibit.gen.h",
source="#thirdparty/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/idle_inhibit.gen.c",
source="#thirdparty/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/tablet.gen.h",
source="#thirdparty/wayland-protocols/unstable/tablet/tablet-unstable-v2.xml",
)
env.WAYLAND_API_CODE(
target="protocol/tablet.gen.c",
source="#thirdparty/wayland-protocols/unstable/tablet/tablet-unstable-v2.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/text_input.gen.h",
source="#thirdparty/wayland-protocols/unstable/text-input/text-input-unstable-v3.xml",
)
env.WAYLAND_API_CODE(
target="protocol/text_input.gen.c",
source="#thirdparty/wayland-protocols/unstable/text-input/text-input-unstable-v3.xml",
)
env.WAYLAND_API_HEADER(
target="protocol/xdg_foreign.gen.h",
source="#thirdparty/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml",
)
env.WAYLAND_API_CODE(
target="protocol/xdg_foreign.gen.c",
source="#thirdparty/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml",
)
source_files = [
"protocol/wayland.gen.c",
"protocol/viewporter.gen.c",
"protocol/fractional_scale.gen.c",
"protocol/xdg_shell.gen.c",
"protocol/xdg_foreign.gen.c",
"protocol/xdg_system_bell.gen.c",
"protocol/xdg_foreign_v1.gen.c",
"protocol/xdg_foreign_v2.gen.c",
"protocol/xdg_decoration.gen.c",
"protocol/xdg_activation.gen.c",
"protocol/relative_pointer.gen.c",

View file

@ -209,6 +209,7 @@ bool DisplayServerWayland::has_feature(Feature p_feature) const {
case FEATURE_SWAP_BUFFERS:
case FEATURE_KEEP_SCREEN_ON:
case FEATURE_IME:
case FEATURE_WINDOW_DRAG:
case FEATURE_CLIPBOARD_PRIMARY: {
return true;
} break;
@ -216,8 +217,10 @@ bool DisplayServerWayland::has_feature(Feature p_feature) const {
//case FEATURE_NATIVE_DIALOG:
//case FEATURE_NATIVE_DIALOG_INPUT:
#ifdef DBUS_ENABLED
case FEATURE_NATIVE_DIALOG_FILE: {
return true;
case FEATURE_NATIVE_DIALOG_FILE:
case FEATURE_NATIVE_DIALOG_FILE_EXTRA:
case FEATURE_NATIVE_DIALOG_FILE_MIME: {
return (portal_desktop && portal_desktop->is_supported() && portal_desktop->is_file_chooser_supported());
} break;
#endif
@ -279,10 +282,13 @@ void DisplayServerWayland::tts_stop() {
#ifdef DBUS_ENABLED
bool DisplayServerWayland::is_dark_mode_supported() const {
return portal_desktop->is_supported();
return portal_desktop && portal_desktop->is_supported() && portal_desktop->is_settings_supported();
}
bool DisplayServerWayland::is_dark_mode() const {
if (!is_dark_mode_supported()) {
return false;
}
switch (portal_desktop->get_appearance_color_scheme()) {
case 1:
// Prefers dark theme.
@ -318,28 +324,28 @@ Error DisplayServerWayland::file_dialog_with_options_show(const String &p_title,
#endif
void DisplayServerWayland::mouse_set_mode(MouseMode p_mode) {
if (p_mode == mouse_mode) {
void DisplayServerWayland::beep() const {
wayland_thread.beep();
}
void DisplayServerWayland::_mouse_update_mode() {
MouseMode wanted_mouse_mode = mouse_mode_override_enabled
? mouse_mode_override
: mouse_mode_base;
if (wanted_mouse_mode == mouse_mode) {
return;
}
MutexLock mutex_lock(wayland_thread.mutex);
bool show_cursor = (p_mode == MOUSE_MODE_VISIBLE || p_mode == MOUSE_MODE_CONFINED);
bool show_cursor = (wanted_mouse_mode == MOUSE_MODE_VISIBLE || wanted_mouse_mode == MOUSE_MODE_CONFINED);
if (show_cursor) {
if (custom_cursors.has(cursor_shape)) {
wayland_thread.cursor_set_custom_shape(cursor_shape);
} else {
wayland_thread.cursor_set_shape(cursor_shape);
}
} else {
wayland_thread.cursor_hide();
}
wayland_thread.cursor_set_visible(show_cursor);
WaylandThread::PointerConstraint constraint = WaylandThread::PointerConstraint::NONE;
switch (p_mode) {
switch (wanted_mouse_mode) {
case DisplayServer::MOUSE_MODE_CAPTURED: {
constraint = WaylandThread::PointerConstraint::LOCKED;
} break;
@ -355,13 +361,47 @@ void DisplayServerWayland::mouse_set_mode(MouseMode p_mode) {
wayland_thread.pointer_set_constraint(constraint);
mouse_mode = p_mode;
mouse_mode = wanted_mouse_mode;
}
void DisplayServerWayland::mouse_set_mode(MouseMode p_mode) {
ERR_FAIL_INDEX(p_mode, MouseMode::MOUSE_MODE_MAX);
if (p_mode == mouse_mode_base) {
return;
}
mouse_mode_base = p_mode;
_mouse_update_mode();
}
DisplayServerWayland::MouseMode DisplayServerWayland::mouse_get_mode() const {
return mouse_mode;
}
void DisplayServerWayland::mouse_set_mode_override(MouseMode p_mode) {
ERR_FAIL_INDEX(p_mode, MouseMode::MOUSE_MODE_MAX);
if (p_mode == mouse_mode_override) {
return;
}
mouse_mode_override = p_mode;
_mouse_update_mode();
}
DisplayServerWayland::MouseMode DisplayServerWayland::mouse_get_mode_override() const {
return mouse_mode_override;
}
void DisplayServerWayland::mouse_set_mode_override_enabled(bool p_override_enabled) {
if (p_override_enabled == mouse_mode_override_enabled) {
return;
}
mouse_mode_override_enabled = p_override_enabled;
_mouse_update_mode();
}
bool DisplayServerWayland::mouse_is_mode_override_enabled() const {
return mouse_mode_override_enabled;
}
// NOTE: This is hacked together (and not guaranteed to work in the first place)
// as for some reason the there's no proper way to ask the compositor to warp
// the pointer, although, at the time of writing, there's a proposal for a
@ -480,7 +520,7 @@ String DisplayServerWayland::clipboard_get_primary() const {
for (String mime : text_mimes) {
if (wayland_thread.primary_has_mime(mime)) {
print_verbose(vformat("Selecting media type \"%s\" from offered types.", mime));
wayland_thread.primary_get_mime(mime);
data = wayland_thread.primary_get_mime(mime);
break;
}
}
@ -635,6 +675,18 @@ int64_t DisplayServerWayland::window_get_native_handle(HandleType p_handle_type,
}
return 0;
} break;
case EGL_DISPLAY: {
if (egl_manager) {
return (int64_t)egl_manager->get_display(p_window);
}
return 0;
}
case EGL_CONFIG: {
if (egl_manager) {
return (int64_t)egl_manager->get_config(p_window);
}
return 0;
}
#endif // GLES3_ENABLED
default: {
@ -896,11 +948,11 @@ bool DisplayServerWayland::window_is_focused(WindowID p_window_id) const {
}
bool DisplayServerWayland::window_can_draw(DisplayServer::WindowID p_window_id) const {
return !suspended;
return suspend_state == SuspendState::NONE;
}
bool DisplayServerWayland::can_any_window_draw() const {
return !suspended;
return suspend_state == SuspendState::NONE;
}
void DisplayServerWayland::window_set_ime_active(const bool p_active, DisplayServer::WindowID p_window_id) {
@ -977,6 +1029,19 @@ DisplayServer::VSyncMode DisplayServerWayland::window_get_vsync_mode(DisplayServ
return DisplayServer::VSYNC_ENABLED;
}
void DisplayServerWayland::window_start_drag(WindowID p_window) {
MutexLock mutex_lock(wayland_thread.mutex);
wayland_thread.window_start_drag(p_window);
}
void DisplayServerWayland::window_start_resize(WindowResizeEdge p_edge, WindowID p_window) {
MutexLock mutex_lock(wayland_thread.mutex);
ERR_FAIL_INDEX(int(p_edge), WINDOW_EDGE_MAX);
wayland_thread.window_start_resize(p_edge, p_window);
}
void DisplayServerWayland::cursor_set_shape(CursorShape p_shape) {
ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
@ -993,11 +1058,7 @@ void DisplayServerWayland::cursor_set_shape(CursorShape p_shape) {
return;
}
if (custom_cursors.has(p_shape)) {
wayland_thread.cursor_set_custom_shape(p_shape);
} else {
wayland_thread.cursor_set_shape(p_shape);
}
wayland_thread.cursor_set_shape(p_shape);
}
DisplayServerWayland::CursorShape DisplayServerWayland::cursor_get_shape() const {
@ -1009,18 +1070,13 @@ DisplayServerWayland::CursorShape DisplayServerWayland::cursor_get_shape() const
void DisplayServerWayland::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
MutexLock mutex_lock(wayland_thread.mutex);
bool visible = (mouse_mode == MOUSE_MODE_VISIBLE || mouse_mode == MOUSE_MODE_CONFINED);
if (p_cursor.is_valid()) {
HashMap<CursorShape, CustomCursor>::Iterator cursor_c = custom_cursors.find(p_shape);
if (cursor_c) {
if (cursor_c->value.rid == p_cursor->get_rid() && cursor_c->value.hotspot == p_hotspot) {
if (cursor_c->value.resource == p_cursor && cursor_c->value.hotspot == p_hotspot) {
// We have a cached cursor. Nice.
if (visible) {
wayland_thread.cursor_set_custom_shape(p_shape);
}
wayland_thread.cursor_set_shape(p_shape);
return;
}
@ -1034,25 +1090,23 @@ void DisplayServerWayland::cursor_set_custom_image(const Ref<Resource> &p_cursor
CustomCursor &cursor = custom_cursors[p_shape];
cursor.rid = p_cursor->get_rid();
cursor.resource = p_cursor;
cursor.hotspot = p_hotspot;
wayland_thread.cursor_shape_set_custom_image(p_shape, image, p_hotspot);
if (visible) {
wayland_thread.cursor_set_custom_shape(p_shape);
}
wayland_thread.cursor_set_shape(p_shape);
} else {
// Clear cache and reset to default system cursor.
if (cursor_shape == p_shape && visible) {
wayland_thread.cursor_shape_clear_custom_image(p_shape);
if (cursor_shape == p_shape) {
wayland_thread.cursor_set_shape(p_shape);
}
if (custom_cursors.has(p_shape)) {
custom_cursors.erase(p_shape);
}
wayland_thread.cursor_shape_clear_custom_image(p_shape);
}
}
@ -1120,16 +1174,21 @@ void DisplayServerWayland::try_suspend() {
if (emulate_vsync) {
bool frame = wayland_thread.wait_frame_suspend_ms(1000);
if (!frame) {
suspended = true;
}
} else {
if (wayland_thread.is_suspended()) {
suspended = true;
suspend_state = SuspendState::TIMEOUT;
}
}
if (suspended) {
DEBUG_LOG_WAYLAND("Window suspended.");
// If we suspended by capability, we'll know with this check. We must do this
// after `wait_frame_suspend_ms` as it progressively dispatches the event queue
// during the "timeout".
if (wayland_thread.is_suspended()) {
suspend_state = SuspendState::CAPABILITY;
}
if (suspend_state == SuspendState::TIMEOUT) {
DEBUG_LOG_WAYLAND("Suspending. Reason: timeout.");
} else if (suspend_state == SuspendState::CAPABILITY) {
DEBUG_LOG_WAYLAND("Suspending. Reason: capability.");
}
}
@ -1156,6 +1215,7 @@ void DisplayServerWayland::process_events() {
if (OS::get_singleton()->get_main_loop()) {
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_OUT);
}
Input::get_singleton()->release_pressed_events();
}
}
@ -1205,16 +1265,18 @@ void DisplayServerWayland::process_events() {
Ref<WaylandThread::IMEUpdateEventMessage> ime_update_msg = msg;
if (ime_update_msg.is_valid()) {
ime_text = ime_update_msg->text;
ime_selection = ime_update_msg->selection;
if (ime_text != ime_update_msg->text || ime_selection != ime_update_msg->selection) {
ime_text = ime_update_msg->text;
ime_selection = ime_update_msg->selection;
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE);
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE);
}
}
}
wayland_thread.keyboard_echo_keys();
if (!suspended) {
if (suspend_state == SuspendState::NONE) {
// Due to the way legacy suspension works, we have to treat low processor
// usage mode very differently than the regular one.
if (OS::get_singleton()->is_in_low_processor_usage_mode()) {
@ -1238,9 +1300,27 @@ void DisplayServerWayland::process_events() {
} else {
try_suspend();
}
} else if (!wayland_thread.is_suspended() || wayland_thread.get_reset_frame()) {
// At last, a sign of life! We're no longer suspended.
suspended = false;
} else {
if (suspend_state == SuspendState::CAPABILITY) {
// If we suspended by capability we can assume that it will be reset when
// the compositor wants us to repaint.
if (!wayland_thread.is_suspended()) {
suspend_state = SuspendState::NONE;
DEBUG_LOG_WAYLAND("Unsuspending from capability.");
}
} else if (suspend_state == SuspendState::TIMEOUT) {
// Certain compositors might not report the "suspended" wm_capability flag.
// Because of this we'll wake up at the next frame event, indicating the
// desire for the compositor to let us repaint.
if (wayland_thread.get_reset_frame()) {
suspend_state = SuspendState::NONE;
DEBUG_LOG_WAYLAND("Unsuspending from timeout.");
}
}
// Since we're not rendering, nothing is committing the windows'
// surfaces. We have to do it ourselves.
wayland_thread.commit_surfaces();
}
#ifdef DBUS_ENABLED
@ -1305,8 +1385,8 @@ Vector<String> DisplayServerWayland::get_rendering_drivers_func() {
return drivers;
}
DisplayServer *DisplayServerWayland::create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Point2i *p_position, const Size2i &p_resolution, int p_screen, Context p_context, Error &r_error) {
DisplayServer *ds = memnew(DisplayServerWayland(p_rendering_driver, p_mode, p_vsync_mode, p_flags, p_resolution, p_context, r_error));
DisplayServer *DisplayServerWayland::create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Point2i *p_position, const Size2i &p_resolution, int p_screen, Context p_context, int64_t p_parent_window, Error &r_error) {
DisplayServer *ds = memnew(DisplayServerWayland(p_rendering_driver, p_mode, p_vsync_mode, p_flags, p_resolution, p_context, p_parent_window, r_error));
if (r_error != OK) {
ERR_PRINT("Can't create the Wayland display server.");
memdelete(ds);
@ -1316,7 +1396,7 @@ DisplayServer *DisplayServerWayland::create_func(const String &p_rendering_drive
return ds;
}
DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i &p_resolution, Context p_context, Error &r_error) {
DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i &p_resolution, Context p_context, int64_t p_parent_window, Error &r_error) {
#ifdef GLES3_ENABLED
#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
@ -1349,23 +1429,50 @@ DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, Win
rendering_driver = p_rendering_driver;
bool driver_found = false;
String executable_name = OS::get_singleton()->get_executable_path().get_file();
#ifdef RD_ENABLED
#ifdef VULKAN_ENABLED
if (rendering_driver == "vulkan") {
rendering_context = memnew(RenderingContextDriverVulkanWayland);
}
#endif
#endif // VULKAN_ENABLED
if (rendering_context) {
if (rendering_context->initialize() != OK) {
ERR_PRINT(vformat("Could not initialize %s", rendering_driver));
memdelete(rendering_context);
rendering_context = nullptr;
r_error = ERR_CANT_CREATE;
return;
#if defined(GLES3_ENABLED)
bool fallback_to_opengl3 = GLOBAL_GET("rendering/rendering_device/fallback_to_opengl3");
if (fallback_to_opengl3 && rendering_driver != "opengl3") {
WARN_PRINT("Your video card drivers seem not to support the required Vulkan version, switching to OpenGL 3.");
rendering_driver = "opengl3";
OS::get_singleton()->set_current_rendering_method("gl_compatibility");
OS::get_singleton()->set_current_rendering_driver_name(rendering_driver);
} else
#endif // GLES3_ENABLED
{
r_error = ERR_CANT_CREATE;
if (p_rendering_driver == "vulkan") {
OS::get_singleton()->alert(
vformat("Your video card drivers seem not to support the required Vulkan version.\n\n"
"If possible, consider updating your video card drivers or using the OpenGL 3 driver.\n\n"
"You can enable the OpenGL 3 driver by starting the engine from the\n"
"command line with the command:\n\n \"%s\" --rendering-driver opengl3\n\n"
"If you recently updated your video card drivers, try rebooting.",
executable_name),
"Unable to initialize Vulkan video driver");
}
ERR_FAIL_MSG(vformat("Could not initialize %s", rendering_driver));
}
}
driver_found = true;
}
#endif
#endif // RD_ENABLED
#ifdef GLES3_ENABLED
if (rendering_driver == "opengl3" || rendering_driver == "opengl3_es") {
@ -1429,30 +1536,58 @@ DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, Win
if (fallback) {
WARN_PRINT("Your video card drivers seem not to support the required OpenGL version, switching to OpenGLES.");
rendering_driver = "opengl3_es";
OS::get_singleton()->set_current_rendering_driver_name(rendering_driver);
} else {
r_error = ERR_UNAVAILABLE;
OS::get_singleton()->alert(
vformat("Your video card drivers seem not to support the required OpenGL 3.3 version.\n\n"
"If possible, consider updating your video card drivers or using the Vulkan driver.\n\n"
"You can enable the Vulkan driver by starting the engine from the\n"
"command line with the command:\n\n \"%s\" --rendering-driver vulkan\n\n"
"If you recently updated your video card drivers, try rebooting.",
executable_name),
"Unable to initialize OpenGL video driver");
ERR_FAIL_MSG("Could not initialize OpenGL.");
}
} else {
RasterizerGLES3::make_current(true);
driver_found = true;
}
}
if (rendering_driver == "opengl3_es") {
egl_manager = memnew(EGLManagerWaylandGLES);
if (egl_manager->initialize(wayland_thread.get_wl_display()) != OK) {
if (egl_manager->initialize(wayland_thread.get_wl_display()) != OK || egl_manager->open_display(wayland_thread.get_wl_display()) != OK) {
memdelete(egl_manager);
egl_manager = nullptr;
r_error = ERR_CANT_CREATE;
ERR_FAIL_MSG("Could not initialize GLES3.");
OS::get_singleton()->alert(
vformat("Your video card drivers seem not to support the required OpenGL ES 3.0 version.\n\n"
"If possible, consider updating your video card drivers or using the Vulkan driver.\n\n"
"You can enable the Vulkan driver by starting the engine from the\n"
"command line with the command:\n\n \"%s\" --rendering-driver vulkan\n\n"
"If you recently updated your video card drivers, try rebooting.",
executable_name),
"Unable to initialize OpenGL ES video driver");
ERR_FAIL_MSG("Could not initialize OpenGL ES.");
}
RasterizerGLES3::make_current(false);
driver_found = true;
}
}
#endif // GLES3_ENABLED
if (!driver_found) {
r_error = ERR_UNAVAILABLE;
ERR_FAIL_MSG("Video driver not found.");
}
cursor_set_shape(CURSOR_BUSY);
WindowData &wd = main_window;
@ -1481,12 +1616,12 @@ DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, Win
RendererCompositorRD::make_current();
}
#endif
#endif // RD_ENABLED
#ifdef DBUS_ENABLED
portal_desktop = memnew(FreeDesktopPortalDesktop);
screensaver = memnew(FreeDesktopScreenSaver);
#endif
#endif // DBUS_ENABLED
screen_set_keep_on(GLOBAL_GET("display/window/energy_saving/keep_screen_on"));

View file

@ -101,12 +101,22 @@ class DisplayServerWayland : public DisplayServer {
};
struct CustomCursor {
RID rid;
Ref<Resource> resource;
Point2i hotspot;
};
enum class SuspendState {
NONE, // Unsuspended.
TIMEOUT, // Legacy fallback.
CAPABILITY, // New "suspended" wm_capability flag.
};
CursorShape cursor_shape = CURSOR_ARROW;
DisplayServer::MouseMode mouse_mode = DisplayServer::MOUSE_MODE_VISIBLE;
DisplayServer::MouseMode mouse_mode_base = MOUSE_MODE_VISIBLE;
DisplayServer::MouseMode mouse_mode_override = MOUSE_MODE_VISIBLE;
bool mouse_mode_override_enabled = false;
void _mouse_update_mode();
HashMap<CursorShape, CustomCursor> custom_cursors;
@ -118,7 +128,7 @@ class DisplayServerWayland : public DisplayServer {
String ime_text;
Vector2i ime_selection;
bool suspended = false;
SuspendState suspend_state = SuspendState::NONE;
bool emulate_vsync = false;
String rendering_driver;
@ -181,8 +191,14 @@ public:
virtual Error file_dialog_with_options_show(const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback) override;
#endif
virtual void beep() const override;
virtual void mouse_set_mode(MouseMode p_mode) override;
virtual MouseMode mouse_get_mode() const override;
virtual void mouse_set_mode_override(MouseMode p_mode) override;
virtual MouseMode mouse_get_mode_override() const override;
virtual void mouse_set_mode_override_enabled(bool p_override_enabled) override;
virtual bool mouse_is_mode_override_enabled() const override;
virtual void warp_mouse(const Point2i &p_to) override;
virtual Point2i mouse_get_position() const override;
@ -270,6 +286,9 @@ public:
virtual void window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window_id = MAIN_WINDOW_ID) override;
virtual DisplayServer::VSyncMode window_get_vsync_mode(WindowID p_window_id) const override;
virtual void window_start_drag(WindowID p_window = MAIN_WINDOW_ID) override;
virtual void window_start_resize(WindowResizeEdge p_edge, WindowID p_window) override;
virtual void cursor_set_shape(CursorShape p_shape) override;
virtual CursorShape cursor_get_shape() const override;
virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) override;
@ -290,12 +309,12 @@ public:
virtual bool is_window_transparency_available() const override;
static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Point2i *p_position, const Size2i &p_resolution, int p_screen, Context p_context, Error &r_error);
static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Point2i *p_position, const Size2i &p_resolution, int p_screen, Context p_context, int64_t p_parent_window, Error &r_error);
static Vector<String> get_rendering_drivers_func();
static void register_wayland_driver();
DisplayServerWayland(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i &p_resolution, Context p_context, Error &r_error);
DisplayServerWayland(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i &p_resolution, Context p_context, int64_t p_parent_window, Error &r_error);
~DisplayServerWayland();
};

View file

@ -1,7 +1,7 @@
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by ./generate-wrapper.py 0.3 on 2022-12-12 10:55:19
// flags: ./generate-wrapper.py --include /usr/include/libdecor-0/libdecor.h --sys-include <libdecor-0/libdecor.h> --soname libdecor-0.so.0 --init-name libdecor --output-header libdecor-so_wrap.h --output-implementation libdecor-so_wrap.c --omit-prefix wl_
// flags: ./generate-wrapper.py --include /usr/include/libdecor-0/libdecor.h --sys-include <libdecor.h> --soname libdecor-0.so.0 --init-name libdecor --output-header libdecor-so_wrap.h --output-implementation libdecor-so_wrap.c --omit-prefix wl_
//
// EDIT: This has been handpatched to properly report the pointer type of the window_state argument of libdecor_configuration_get_window_state.
#include <stdint.h>
@ -45,7 +45,7 @@
#define libdecor_state_free libdecor_state_free_dylibloader_orig_libdecor
#define libdecor_configuration_get_content_size libdecor_configuration_get_content_size_dylibloader_orig_libdecor
#define libdecor_configuration_get_window_state libdecor_configuration_get_window_state_dylibloader_orig_libdecor
#include <libdecor-0/libdecor.h>
#include <libdecor.h>
#undef libdecor_unref
#undef libdecor_new
#undef libdecor_get_fd

View file

@ -3,7 +3,7 @@
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by ./generate-wrapper.py 0.3 on 2022-12-12 10:55:19
// flags: ./generate-wrapper.py --include /usr/include/libdecor-0/libdecor.h --sys-include <libdecor-0/libdecor.h> --soname libdecor-0.so.0 --init-name libdecor --output-header libdecor-so_wrap.h --output-implementation libdecor-so_wrap.c --omit-prefix wl_
// flags: ./generate-wrapper.py --include /usr/include/libdecor-0/libdecor.h --sys-include <libdecor.h> --soname libdecor-0.so.0 --init-name libdecor --output-header libdecor-so_wrap.h --output-implementation libdecor-so_wrap.c --omit-prefix wl_
//
// EDIT: This has been handpatched to properly report the pointer type of the window_state argument of libdecor_configuration_get_window_state.
#include <stdint.h>
@ -47,7 +47,7 @@
#define libdecor_state_free libdecor_state_free_dylibloader_orig_libdecor
#define libdecor_configuration_get_content_size libdecor_configuration_get_content_size_dylibloader_orig_libdecor
#define libdecor_configuration_get_window_state libdecor_configuration_get_window_state_dylibloader_orig_libdecor
#include <libdecor-0/libdecor.h>
#include <libdecor.h>
#undef libdecor_unref
#undef libdecor_new
#undef libdecor_get_fd

View file

@ -51,7 +51,7 @@ class KeyMappingXKB {
static inline HashMap<Key, unsigned int, HashMapHasherKeys> scancode_map_inv;
static inline HashMap<unsigned int, KeyLocation, HashMapHasherKeys> location_map;
KeyMappingXKB(){};
KeyMappingXKB() {}
public:
static void initialize();

View file

@ -32,11 +32,7 @@
#include "rendering_context_driver_vulkan_wayland.h"
#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"
const char *RenderingContextDriverVulkanWayland::_get_platform_surface_extension() const {
return VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
@ -51,7 +47,7 @@ RenderingContextDriver::SurfaceID RenderingContextDriverVulkanWayland::surface_c
create_info.surface = wpd->surface;
VkSurfaceKHR vk_surface = VK_NULL_HANDLE;
VkResult err = vkCreateWaylandSurfaceKHR(instance_get(), &create_info, nullptr, &vk_surface);
VkResult err = vkCreateWaylandSurfaceKHR(instance_get(), &create_info, get_allocation_callbacks(VK_OBJECT_TYPE_SURFACE_KHR), &vk_surface);
ERR_FAIL_COND_V(err != VK_SUCCESS, SurfaceID());
Surface *surface = memnew(Surface);

View file

@ -32,8 +32,12 @@
#ifdef WAYLAND_ENABLED
// FIXME: Does this cause issues with *BSDs?
#ifdef __FreeBSD__
#include <dev/evdev/input-event-codes.h>
#else
// Assume Linux.
#include <linux/input-event-codes.h>
#endif
// For the actual polling thread.
#include <poll.h>
@ -169,12 +173,13 @@ Vector<uint8_t> WaylandThread::_wp_primary_selection_offer_read(struct wl_displa
int fds[2];
if (pipe(fds) == 0) {
// This function expects to return a string, so we can only ask for a MIME of
// "text/plain"
zwp_primary_selection_offer_v1_receive(p_offer, p_mime, fds[1]);
// Wait for the compositor to know about the pipe.
wl_display_roundtrip(p_display);
// NOTE: It's important to just flush and not roundtrip here as we would risk
// running some cleanup event, like for example `wl_data_device::leave`. We're
// going to wait for the message anyways as the read will probably block if
// the compositor doesn't read from the other end of the pipe.
wl_display_flush(p_display);
// Close the write end of the pipe, which we don't need and would otherwise
// just stall our next `read`s.
@ -186,15 +191,34 @@ Vector<uint8_t> WaylandThread::_wp_primary_selection_offer_read(struct wl_displa
return Vector<uint8_t>();
}
// Sets up an `InputEventKey` and returns whether it has any meaningful value.
bool WaylandThread::_seat_state_configure_key_event(SeatState &p_ss, Ref<InputEventKey> p_event, xkb_keycode_t p_keycode, bool p_pressed) {
// TODO: Handle keys that release multiple symbols?
Key keycode = KeyMappingXKB::get_keycode(xkb_state_key_get_one_sym(p_ss.xkb_state, p_keycode));
Ref<InputEventKey> WaylandThread::_seat_state_get_key_event(SeatState *p_ss, xkb_keycode_t p_keycode, bool p_pressed) {
Ref<InputEventKey> event;
ERR_FAIL_NULL_V(p_ss, event);
Key shifted_key = KeyMappingXKB::get_keycode(xkb_state_key_get_one_sym(p_ss->xkb_state, p_keycode));
Key plain_key = Key::NONE;
// NOTE: xkbcommon's API really encourages to apply the modifier state but we
// only want a "plain" symbol so that we can convert it into a godot keycode.
const xkb_keysym_t *syms = nullptr;
int num_sys = xkb_keymap_key_get_syms_by_level(p_ss->xkb_keymap, p_keycode, p_ss->current_layout_index, 0, &syms);
if (num_sys > 0 && syms) {
plain_key = KeyMappingXKB::get_keycode(syms[0]);
}
Key physical_keycode = KeyMappingXKB::get_scancode(p_keycode);
KeyLocation key_location = KeyMappingXKB::get_location(p_keycode);
uint32_t unicode = xkb_state_key_get_utf32(p_ss->xkb_state, p_keycode);
if (physical_keycode == Key::NONE) {
return false;
Key keycode = Key::NONE;
if ((shifted_key & Key::SPECIAL) != Key::NONE || (plain_key & Key::SPECIAL) != Key::NONE) {
keycode = shifted_key;
}
if (keycode == Key::NONE) {
keycode = plain_key;
}
if (keycode == Key::NONE) {
@ -205,40 +229,71 @@ bool WaylandThread::_seat_state_configure_key_event(SeatState &p_ss, Ref<InputEv
keycode -= 'a' - 'A';
}
p_event->set_window_id(DisplayServer::MAIN_WINDOW_ID);
if (physical_keycode == Key::NONE && keycode == Key::NONE && unicode == 0) {
return event;
}
event.instantiate();
event->set_window_id(DisplayServer::MAIN_WINDOW_ID);
// Set all pressed modifiers.
p_event->set_shift_pressed(p_ss.shift_pressed);
p_event->set_ctrl_pressed(p_ss.ctrl_pressed);
p_event->set_alt_pressed(p_ss.alt_pressed);
p_event->set_meta_pressed(p_ss.meta_pressed);
event->set_shift_pressed(p_ss->shift_pressed);
event->set_ctrl_pressed(p_ss->ctrl_pressed);
event->set_alt_pressed(p_ss->alt_pressed);
event->set_meta_pressed(p_ss->meta_pressed);
p_event->set_pressed(p_pressed);
p_event->set_keycode(keycode);
p_event->set_physical_keycode(physical_keycode);
p_event->set_location(key_location);
uint32_t unicode = xkb_state_key_get_utf32(p_ss.xkb_state, p_keycode);
event->set_pressed(p_pressed);
event->set_keycode(keycode);
event->set_physical_keycode(physical_keycode);
event->set_location(key_location);
if (unicode != 0) {
p_event->set_key_label(fix_key_label(unicode, keycode));
event->set_key_label(fix_key_label(unicode, keycode));
} else {
p_event->set_key_label(keycode);
event->set_key_label(keycode);
}
if (p_pressed) {
p_event->set_unicode(fix_unicode(unicode));
event->set_unicode(fix_unicode(unicode));
}
// Taken from DisplayServerX11.
if (p_event->get_keycode() == Key::BACKTAB) {
if (event->get_keycode() == Key::BACKTAB) {
// Make it consistent across platforms.
p_event->set_keycode(Key::TAB);
p_event->set_physical_keycode(Key::TAB);
p_event->set_shift_pressed(true);
event->set_keycode(Key::TAB);
event->set_physical_keycode(Key::TAB);
event->set_shift_pressed(true);
}
return true;
return event;
}
// NOTE: Due to the nature of the way keys are encoded, there's an ambiguity
// regarding "special" keys. In other words: there's no reliable way of
// switching between a special key and a character key if not marking a
// different Godot keycode, even if we're actually using the same XKB raw
// keycode. This means that, during this switch, the old key will get "stuck",
// as it will never receive a release event. This method returns the necessary
// event to fix this if needed.
Ref<InputEventKey> WaylandThread::_seat_state_get_unstuck_key_event(SeatState *p_ss, xkb_keycode_t p_keycode, bool p_pressed, Key p_key) {
Ref<InputEventKey> event;
if (p_pressed) {
Key *old_key = p_ss->pressed_keycodes.getptr(p_keycode);
if (old_key != nullptr && *old_key != p_key) {
print_verbose(vformat("%s and %s have same keycode. Generating release event for %s", keycode_get_string(*old_key), keycode_get_string(p_key), keycode_get_string(*old_key)));
event = _seat_state_get_key_event(p_ss, p_keycode, false);
if (event.is_valid()) {
event->set_keycode(*old_key);
}
}
p_ss->pressed_keycodes[p_keycode] = p_key;
} else {
p_ss->pressed_keycodes.erase(p_keycode);
}
return event;
}
void WaylandThread::_set_current_seat(struct wl_seat *p_seat) {
@ -264,8 +319,6 @@ bool WaylandThread::_load_cursor_theme(int p_cursor_size) {
if (wl_cursor_theme) {
wl_cursor_theme_destroy(wl_cursor_theme);
wl_cursor_theme = nullptr;
current_wl_cursor = nullptr;
}
if (cursor_theme_name.is_empty()) {
@ -356,7 +409,12 @@ void WaylandThread::_update_scale(int p_scale) {
int cursor_size = unscaled_cursor_size * p_scale;
if (_load_cursor_theme(cursor_size)) {
cursor_set_shape(last_cursor_shape);
for (struct wl_seat *wl_seat : registry.wl_seats) {
SeatState *ss = wl_seat_get_seat_state(wl_seat);
ERR_FAIL_NULL(ss);
seat_state_update_cursor(ss);
}
}
}
@ -370,9 +428,16 @@ void WaylandThread::_wl_registry_on_global(void *data, struct wl_registry *wl_re
return;
}
// NOTE: Deprecated.
if (strcmp(interface, zxdg_exporter_v1_interface.name) == 0) {
registry->xdg_exporter = (struct zxdg_exporter_v1 *)wl_registry_bind(wl_registry, name, &zxdg_exporter_v1_interface, 1);
registry->xdg_exporter_name = name;
registry->xdg_exporter_v1 = (struct zxdg_exporter_v1 *)wl_registry_bind(wl_registry, name, &zxdg_exporter_v1_interface, 1);
registry->xdg_exporter_v1_name = name;
return;
}
if (strcmp(interface, zxdg_exporter_v2_interface.name) == 0) {
registry->xdg_exporter_v2 = (struct zxdg_exporter_v2 *)wl_registry_bind(wl_registry, name, &zxdg_exporter_v2_interface, 1);
registry->xdg_exporter_v2_name = name;
return;
}
@ -493,6 +558,12 @@ void WaylandThread::_wl_registry_on_global(void *data, struct wl_registry *wl_re
return;
}
if (strcmp(interface, xdg_system_bell_v1_interface.name) == 0) {
registry->xdg_system_bell = (struct xdg_system_bell_v1 *)wl_registry_bind(wl_registry, name, &xdg_system_bell_v1_interface, 1);
registry->xdg_system_bell_name = name;
return;
}
if (strcmp(interface, xdg_activation_v1_interface.name) == 0) {
registry->xdg_activation = (struct xdg_activation_v1 *)wl_registry_bind(wl_registry, name, &xdg_activation_v1_interface, 1);
registry->xdg_activation_name = name;
@ -586,13 +657,25 @@ void WaylandThread::_wl_registry_on_global_remove(void *data, struct wl_registry
return;
}
if (name == registry->xdg_exporter_name) {
if (registry->xdg_exporter) {
zxdg_exporter_v1_destroy(registry->xdg_exporter);
registry->xdg_exporter = nullptr;
// NOTE: Deprecated.
if (name == registry->xdg_exporter_v1_name) {
if (registry->xdg_exporter_v1) {
zxdg_exporter_v1_destroy(registry->xdg_exporter_v1);
registry->xdg_exporter_v1 = nullptr;
}
registry->xdg_exporter_name = 0;
registry->xdg_exporter_v1_name = 0;
return;
}
if (name == registry->xdg_exporter_v2_name) {
if (registry->xdg_exporter_v2) {
zxdg_exporter_v2_destroy(registry->xdg_exporter_v2);
registry->xdg_exporter_v2 = nullptr;
}
registry->xdg_exporter_v2_name = 0;
return;
}
@ -688,6 +771,17 @@ void WaylandThread::_wl_registry_on_global_remove(void *data, struct wl_registry
return;
}
if (name == registry->xdg_system_bell_name) {
if (registry->xdg_system_bell) {
xdg_system_bell_v1_destroy(registry->xdg_system_bell);
registry->xdg_system_bell = nullptr;
}
registry->xdg_system_bell_name = 0;
return;
}
if (name == registry->xdg_activation_name) {
if (registry->xdg_activation) {
xdg_activation_v1_destroy(registry->xdg_activation);
@ -1162,7 +1256,15 @@ void WaylandThread::_xdg_toplevel_on_wm_capabilities(void *data, struct xdg_topl
}
}
void WaylandThread::_xdg_exported_on_exported(void *data, zxdg_exported_v1 *exported, const char *handle) {
// NOTE: Deprecated.
void WaylandThread::_xdg_exported_v1_on_handle(void *data, zxdg_exported_v1 *exported, const char *handle) {
WindowState *ws = (WindowState *)data;
ERR_FAIL_NULL(ws);
ws->exported_handle = vformat("wayland:%s", String::utf8(handle));
}
void WaylandThread::_xdg_exported_v2_on_handle(void *data, zxdg_exported_v2 *exported, const char *handle) {
WindowState *ws = (WindowState *)data;
ERR_FAIL_NULL(ws);
@ -1394,6 +1496,8 @@ void WaylandThread::_wl_pointer_on_leave(void *data, struct wl_pointer *wl_point
ss->pointed_surface = nullptr;
ss->pointer_data_buffer.pressed_button_mask.clear();
Ref<WindowEventMessage> msg;
msg.instantiate();
msg->event = DisplayServer::WINDOW_EVENT_MOUSE_EXIT;
@ -1416,10 +1520,10 @@ void WaylandThread::_wl_pointer_on_motion(void *data, struct wl_pointer *wl_poin
PointerData &pd = ss->pointer_data_buffer;
// TODO: Scale only when sending the Wayland message.
pd.position.x = wl_fixed_to_int(surface_x);
pd.position.y = wl_fixed_to_int(surface_y);
pd.position.x = wl_fixed_to_double(surface_x);
pd.position.y = wl_fixed_to_double(surface_y);
pd.position = scale_vector2i(pd.position, window_state_get_scale_factor(ws));
pd.position *= window_state_get_scale_factor(ws);
pd.motion_time = time;
}
@ -1532,7 +1636,7 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
mm->set_position(pd.position);
mm->set_global_position(pd.position);
Vector2i pos_delta = pd.position - old_pd.position;
Vector2 pos_delta = pd.position - old_pd.position;
if (old_pd.relative_motion_time != pd.relative_motion_time) {
uint32_t time_delta = pd.relative_motion_time - old_pd.relative_motion_time;
@ -1649,7 +1753,7 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
// We have to set the last position pressed here as we can't take for
// granted what the individual events might have seen due to them not having
// a garaunteed order.
// a guaranteed order.
if (mb->is_pressed()) {
pd.last_pressed_position = pd.position;
}
@ -1741,7 +1845,7 @@ void WaylandThread::_wl_pointer_on_axis_discrete(void *data, struct wl_pointer *
pd.discrete_scroll_vector_120.y = discrete * 120;
}
if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) {
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
pd.discrete_scroll_vector_120.x = discrete * 120;
}
}
@ -1762,7 +1866,7 @@ void WaylandThread::_wl_pointer_on_axis_value120(void *data, struct wl_pointer *
pd.discrete_scroll_vector_120.y += value120;
}
if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) {
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
pd.discrete_scroll_vector_120.x += value120;
}
}
@ -1848,13 +1952,19 @@ void WaylandThread::_wl_keyboard_on_key(void *data, struct wl_keyboard *wl_keybo
ss->repeating_keycode = XKB_KEYCODE_INVALID;
}
Ref<InputEventKey> k;
k.instantiate();
if (!_seat_state_configure_key_event(*ss, k, xkb_keycode, pressed)) {
Ref<InputEventKey> k = _seat_state_get_key_event(ss, xkb_keycode, pressed);
if (k.is_null()) {
return;
}
Ref<InputEventKey> uk = _seat_state_get_unstuck_key_event(ss, xkb_keycode, pressed, k->get_keycode());
if (uk.is_valid()) {
Ref<InputEventMessage> u_msg;
u_msg.instantiate();
u_msg->event = uk;
wayland_thread->push_message(u_msg);
}
Ref<InputEventMessage> msg;
msg.instantiate();
msg->event = k;
@ -2388,9 +2498,9 @@ void WaylandThread::_wp_tablet_tool_on_motion(void *data, struct zwp_tablet_tool
double scale_factor = window_state_get_scale_factor(ws);
td.position.x = wl_fixed_to_int(x);
td.position.y = wl_fixed_to_int(y);
td.position = scale_vector2i(td.position, scale_factor);
td.position.x = wl_fixed_to_double(x);
td.position.y = wl_fixed_to_double(y);
td.position *= scale_factor;
td.motion_time = OS::get_singleton()->get_ticks_msec();
}
@ -2520,7 +2630,7 @@ void WaylandThread::_wp_tablet_tool_on_frame(void *data, struct zwp_tablet_tool_
mm->set_relative(td.position - old_td.position);
mm->set_relative_screen_position(mm->get_relative());
Vector2i pos_delta = td.position - old_td.position;
Vector2 pos_delta = td.position - old_td.position;
uint32_t time_delta = td.motion_time - old_td.motion_time;
mm->set_velocity((Vector2)pos_delta / time_delta);
@ -2681,7 +2791,7 @@ void WaylandThread::_wp_text_input_on_done(void *data, struct zwp_text_input_v3
msg.instantiate();
msg->text = ss->ime_text_commit;
ss->wayland_thread->push_message(msg);
} else if (!ss->ime_text.is_empty()) {
} else {
Ref<IMEUpdateEventMessage> msg;
msg.instantiate();
msg->text = ss->ime_text;
@ -3071,19 +3181,25 @@ void WaylandThread::seat_state_confine_pointer(SeatState *p_ss) {
void WaylandThread::seat_state_update_cursor(SeatState *p_ss) {
ERR_FAIL_NULL(p_ss);
WaylandThread *thread = p_ss->wayland_thread;
ERR_FAIL_NULL(p_ss->wayland_thread);
if (p_ss->wl_pointer && p_ss->cursor_surface) {
// NOTE: Those values are valid by default and will hide the cursor when
// unchanged, which happens when both the current custom cursor and the
// current wl_cursor are `nullptr`.
struct wl_buffer *cursor_buffer = nullptr;
uint32_t hotspot_x = 0;
uint32_t hotspot_y = 0;
int scale = 1;
if (!p_ss->wl_pointer || !p_ss->cursor_surface) {
return;
}
CustomCursor *custom_cursor = p_ss->wayland_thread->current_custom_cursor;
struct wl_cursor *wl_cursor = p_ss->wayland_thread->current_wl_cursor;
// NOTE: Those values are valid by default and will hide the cursor when
// unchanged.
struct wl_buffer *cursor_buffer = nullptr;
uint32_t hotspot_x = 0;
uint32_t hotspot_y = 0;
int scale = 1;
if (thread->cursor_visible) {
DisplayServer::CursorShape shape = thread->cursor_shape;
struct CustomCursor *custom_cursor = thread->custom_cursors.getptr(shape);
if (custom_cursor) {
cursor_buffer = custom_cursor->wl_buffer;
@ -3093,7 +3209,13 @@ void WaylandThread::seat_state_update_cursor(SeatState *p_ss) {
// We can't really reasonably scale custom cursors, so we'll let the
// compositor do it for us (badly).
scale = 1;
} else if (wl_cursor) {
} else {
struct wl_cursor *wl_cursor = thread->wl_cursors[shape];
if (!wl_cursor) {
return;
}
int frame_idx = 0;
if (wl_cursor->image_count > 1) {
@ -3109,24 +3231,24 @@ void WaylandThread::seat_state_update_cursor(SeatState *p_ss) {
struct wl_cursor_image *wl_cursor_image = wl_cursor->images[frame_idx];
scale = p_ss->wayland_thread->cursor_scale;
scale = thread->cursor_scale;
cursor_buffer = wl_cursor_image_get_buffer(wl_cursor_image);
// As the surface's buffer is scaled (thus the surface is smaller) and the
// hotspot must be expressed in surface-local coordinates, we need to scale
// them down accordingly.
// it down accordingly.
hotspot_x = wl_cursor_image->hotspot_x / scale;
hotspot_y = wl_cursor_image->hotspot_y / scale;
}
wl_pointer_set_cursor(p_ss->wl_pointer, p_ss->pointer_enter_serial, p_ss->cursor_surface, hotspot_x, hotspot_y);
wl_surface_set_buffer_scale(p_ss->cursor_surface, scale);
wl_surface_attach(p_ss->cursor_surface, cursor_buffer, 0, 0);
wl_surface_damage_buffer(p_ss->cursor_surface, 0, 0, INT_MAX, INT_MAX);
wl_surface_commit(p_ss->cursor_surface);
}
wl_pointer_set_cursor(p_ss->wl_pointer, p_ss->pointer_enter_serial, p_ss->cursor_surface, hotspot_x, hotspot_y);
wl_surface_set_buffer_scale(p_ss->cursor_surface, scale);
wl_surface_attach(p_ss->cursor_surface, cursor_buffer, 0, 0);
wl_surface_damage_buffer(p_ss->cursor_surface, 0, 0, INT_MAX, INT_MAX);
wl_surface_commit(p_ss->cursor_surface);
}
void WaylandThread::seat_state_echo_keys(SeatState *p_ss) {
@ -3152,15 +3274,18 @@ void WaylandThread::seat_state_echo_keys(SeatState *p_ss) {
int keys_amount = (ticks_delta / p_ss->repeat_key_delay_msec);
for (int i = 0; i < keys_amount; i++) {
Ref<InputEventKey> k;
k.instantiate();
if (!_seat_state_configure_key_event(*p_ss, k, p_ss->repeating_keycode, true)) {
Ref<InputEventKey> k = _seat_state_get_key_event(p_ss, p_ss->repeating_keycode, true);
if (k.is_null()) {
continue;
}
k->set_echo(true);
Ref<InputEventKey> uk = _seat_state_get_unstuck_key_event(p_ss, p_ss->repeating_keycode, true, k->get_keycode());
if (uk.is_valid()) {
Input::get_singleton()->parse_input_event(uk);
}
Input::get_singleton()->parse_input_event(k);
}
@ -3246,9 +3371,12 @@ void WaylandThread::window_create(DisplayServer::WindowID p_window_id, int p_wid
ws.frame_callback = wl_surface_frame(ws.wl_surface);
wl_callback_add_listener(ws.frame_callback, &frame_wl_callback_listener, &ws);
if (registry.xdg_exporter) {
ws.xdg_exported = zxdg_exporter_v1_export(registry.xdg_exporter, ws.wl_surface);
zxdg_exported_v1_add_listener(ws.xdg_exported, &xdg_exported_listener, &ws);
if (registry.xdg_exporter_v2) {
ws.xdg_exported_v2 = zxdg_exporter_v2_export_toplevel(registry.xdg_exporter_v2, ws.wl_surface);
zxdg_exported_v2_add_listener(ws.xdg_exported_v2, &xdg_exported_v2_listener, &ws);
} else if (registry.xdg_exporter_v1) {
ws.xdg_exported_v1 = zxdg_exporter_v1_export(registry.xdg_exporter_v1, ws.wl_surface);
zxdg_exported_v1_add_listener(ws.xdg_exported_v1, &xdg_exported_v1_listener, &ws);
}
wl_surface_commit(ws.wl_surface);
@ -3264,6 +3392,102 @@ struct wl_surface *WaylandThread::window_get_wl_surface(DisplayServer::WindowID
return ws.wl_surface;
}
void WaylandThread::beep() const {
if (registry.xdg_system_bell) {
xdg_system_bell_v1_ring(registry.xdg_system_bell, nullptr);
}
}
void WaylandThread::window_start_drag(DisplayServer::WindowID p_window_id) {
// TODO: Use window IDs for multiwindow support.
WindowState &ws = main_window;
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
if (ss && ws.xdg_toplevel) {
xdg_toplevel_move(ws.xdg_toplevel, ss->wl_seat, ss->pointer_data.button_serial);
}
#ifdef LIBDECOR_ENABLED
if (ws.libdecor_frame) {
libdecor_frame_move(ws.libdecor_frame, ss->wl_seat, ss->pointer_data.button_serial);
}
#endif
}
void WaylandThread::window_start_resize(DisplayServer::WindowResizeEdge p_edge, DisplayServer::WindowID p_window) {
// TODO: Use window IDs for multiwindow support.
WindowState &ws = main_window;
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
if (ss && ws.xdg_toplevel) {
xdg_toplevel_resize_edge edge = XDG_TOPLEVEL_RESIZE_EDGE_NONE;
switch (p_edge) {
case DisplayServer::WINDOW_EDGE_TOP_LEFT: {
edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT;
} break;
case DisplayServer::WINDOW_EDGE_TOP: {
edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP;
} break;
case DisplayServer::WINDOW_EDGE_TOP_RIGHT: {
edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT;
} break;
case DisplayServer::WINDOW_EDGE_LEFT: {
edge = XDG_TOPLEVEL_RESIZE_EDGE_LEFT;
} break;
case DisplayServer::WINDOW_EDGE_RIGHT: {
edge = XDG_TOPLEVEL_RESIZE_EDGE_RIGHT;
} break;
case DisplayServer::WINDOW_EDGE_BOTTOM_LEFT: {
edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT;
} break;
case DisplayServer::WINDOW_EDGE_BOTTOM: {
edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM;
} break;
case DisplayServer::WINDOW_EDGE_BOTTOM_RIGHT: {
edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT;
} break;
default:
break;
}
xdg_toplevel_resize(ws.xdg_toplevel, ss->wl_seat, ss->pointer_data.button_serial, edge);
}
#ifdef LIBDECOR_ENABLED
if (ws.libdecor_frame) {
libdecor_resize_edge edge = LIBDECOR_RESIZE_EDGE_NONE;
switch (p_edge) {
case DisplayServer::WINDOW_EDGE_TOP_LEFT: {
edge = LIBDECOR_RESIZE_EDGE_TOP_LEFT;
} break;
case DisplayServer::WINDOW_EDGE_TOP: {
edge = LIBDECOR_RESIZE_EDGE_TOP;
} break;
case DisplayServer::WINDOW_EDGE_TOP_RIGHT: {
edge = LIBDECOR_RESIZE_EDGE_TOP_RIGHT;
} break;
case DisplayServer::WINDOW_EDGE_LEFT: {
edge = LIBDECOR_RESIZE_EDGE_LEFT;
} break;
case DisplayServer::WINDOW_EDGE_RIGHT: {
edge = LIBDECOR_RESIZE_EDGE_RIGHT;
} break;
case DisplayServer::WINDOW_EDGE_BOTTOM_LEFT: {
edge = LIBDECOR_RESIZE_EDGE_BOTTOM_LEFT;
} break;
case DisplayServer::WINDOW_EDGE_BOTTOM: {
edge = LIBDECOR_RESIZE_EDGE_BOTTOM;
} break;
case DisplayServer::WINDOW_EDGE_BOTTOM_RIGHT: {
edge = LIBDECOR_RESIZE_EDGE_BOTTOM_RIGHT;
} break;
default:
break;
}
libdecor_frame_resize(ws.libdecor_frame, ss->wl_seat, ss->pointer_data.button_serial, edge);
}
#endif
}
void WaylandThread::window_set_max_size(DisplayServer::WindowID p_window_id, const Size2i &p_size) {
// TODO: Use window IDs for multiwindow support.
WindowState &ws = main_window;
@ -3328,7 +3552,8 @@ bool WaylandThread::window_can_set_mode(DisplayServer::WindowID p_window_id, Dis
return ws.can_maximize;
};
case DisplayServer::WINDOW_MODE_FULLSCREEN: {
case DisplayServer::WINDOW_MODE_FULLSCREEN:
case DisplayServer::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
#ifdef LIBDECOR_ENABLED
if (ws.libdecor_frame) {
return libdecor_frame_has_capability(ws.libdecor_frame, LIBDECOR_ACTION_FULLSCREEN);
@ -3337,13 +3562,6 @@ bool WaylandThread::window_can_set_mode(DisplayServer::WindowID p_window_id, Dis
return ws.can_fullscreen;
};
case DisplayServer::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
// I'm not really sure but from what I can find Wayland doesn't really have
// the concept of exclusive fullscreen.
// TODO: Discuss whether to fallback to regular fullscreen or not.
return false;
};
}
return false;
@ -3458,7 +3676,8 @@ void WaylandThread::window_try_set_mode(DisplayServer::WindowID p_window_id, Dis
#endif // LIBDECOR_ENABLED
} break;
case DisplayServer::WINDOW_MODE_FULLSCREEN: {
case DisplayServer::WINDOW_MODE_FULLSCREEN:
case DisplayServer::WINDOW_MODE_EXCLUSIVE_FULLSCREEN: {
if (ws.xdg_toplevel) {
xdg_toplevel_set_fullscreen(ws.xdg_toplevel, nullptr);
}
@ -3767,25 +3986,19 @@ Error WaylandThread::init() {
return OK;
}
void WaylandThread::cursor_hide() {
current_wl_cursor = nullptr;
current_custom_cursor = nullptr;
void WaylandThread::cursor_set_visible(bool p_visible) {
cursor_visible = p_visible;
SeatState *ss = wl_seat_get_seat_state(wl_seat_current);
ERR_FAIL_NULL(ss);
seat_state_update_cursor(ss);
for (struct wl_seat *wl_seat : registry.wl_seats) {
SeatState *ss = wl_seat_get_seat_state(wl_seat);
ERR_FAIL_NULL(ss);
seat_state_update_cursor(ss);
}
}
void WaylandThread::cursor_set_shape(DisplayServer::CursorShape p_cursor_shape) {
if (!wl_cursors[p_cursor_shape]) {
return;
}
// The point of this method is make the current cursor a "plain" shape and, as
// the custom cursor overrides what gets set, we have to clear it too.
current_custom_cursor = nullptr;
current_wl_cursor = wl_cursors[p_cursor_shape];
cursor_shape = p_cursor_shape;
for (struct wl_seat *wl_seat : registry.wl_seats) {
SeatState *ss = wl_seat_get_seat_state(wl_seat);
@ -3793,27 +4006,10 @@ void WaylandThread::cursor_set_shape(DisplayServer::CursorShape p_cursor_shape)
seat_state_update_cursor(ss);
}
last_cursor_shape = p_cursor_shape;
}
void WaylandThread::cursor_set_custom_shape(DisplayServer::CursorShape p_cursor_shape) {
ERR_FAIL_COND(!custom_cursors.has(p_cursor_shape));
current_custom_cursor = &custom_cursors[p_cursor_shape];
for (struct wl_seat *wl_seat : registry.wl_seats) {
SeatState *ss = wl_seat_get_seat_state(wl_seat);
ERR_FAIL_NULL(ss);
seat_state_update_cursor(ss);
}
last_cursor_shape = p_cursor_shape;
}
void WaylandThread::cursor_shape_set_custom_image(DisplayServer::CursorShape p_cursor_shape, Ref<Image> p_image, const Point2i &p_hotspot) {
ERR_FAIL_COND(!p_image.is_valid());
ERR_FAIL_COND(p_image.is_null());
Size2i image_size = p_image->get_size();
@ -3829,23 +4025,21 @@ void WaylandThread::cursor_shape_set_custom_image(DisplayServer::CursorShape p_c
CustomCursor &cursor = custom_cursors[p_cursor_shape];
cursor.hotspot = p_hotspot;
if (cursor.buffer_data) {
// Clean up the old buffer data.
munmap(cursor.buffer_data, cursor.buffer_data_size);
}
// NOTE: From `wl_keyboard`s of version 7 or later, the spec requires the mmap
// operation to be done with MAP_PRIVATE, as "MAP_SHARED may fail". We'll do it
// regardless of global version.
cursor.buffer_data = (uint32_t *)mmap(nullptr, data_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (cursor.wl_buffer) {
// Clean up the old Wayland buffer.
wl_buffer_destroy(cursor.wl_buffer);
}
if (cursor.buffer_data) {
// Clean up the old buffer data.
munmap(cursor.buffer_data, cursor.buffer_data_size);
}
cursor.buffer_data = (uint32_t *)mmap(nullptr, data_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
cursor.buffer_data_size = data_size;
// Create the Wayland buffer.
struct wl_shm_pool *wl_shm_pool = wl_shm_create_pool(registry.wl_shm, fd, image_size.height * data_size);
struct wl_shm_pool *wl_shm_pool = wl_shm_create_pool(registry.wl_shm, fd, data_size);
// TODO: Make sure that WL_SHM_FORMAT_ARGB8888 format is supported. It
// technically isn't garaunteed to be supported, but I think that'd be a
// pretty unlikely thing to stumble upon.
@ -3873,8 +4067,6 @@ void WaylandThread::cursor_shape_clear_custom_image(DisplayServer::CursorShape p
CustomCursor cursor = custom_cursors[p_cursor_shape];
custom_cursors.erase(p_cursor_shape);
current_custom_cursor = nullptr;
if (cursor.wl_buffer) {
wl_buffer_destroy(cursor.wl_buffer);
}
@ -3979,6 +4171,7 @@ void WaylandThread::selection_set_text(const String &p_text) {
if (registry.wl_data_device_manager == nullptr) {
DEBUG_LOG_WAYLAND_THREAD("Couldn't set selection, wl_data_device_manager global not available.");
return;
}
if (ss == nullptr) {
@ -3997,10 +4190,10 @@ void WaylandThread::selection_set_text(const String &p_text) {
wl_data_source_add_listener(ss->wl_data_source_selection, &wl_data_source_listener, ss);
wl_data_source_offer(ss->wl_data_source_selection, "text/plain;charset=utf-8");
wl_data_source_offer(ss->wl_data_source_selection, "text/plain");
}
// TODO: Implement a good way of getting the latest serial from the user.
wl_data_device_set_selection(ss->wl_data_device, ss->wl_data_source_selection, MAX(ss->pointer_data.button_serial, ss->last_key_pressed_serial));
// TODO: Implement a good way of getting the latest serial from the user.
wl_data_device_set_selection(ss->wl_data_device, ss->wl_data_source_selection, MAX(ss->pointer_data.button_serial, ss->last_key_pressed_serial));
}
// Wait for the message to get to the server before continuing, otherwise the
// clipboard update might come with a delay.
@ -4106,6 +4299,11 @@ void WaylandThread::primary_set_text(const String &p_text) {
return;
}
if (ss->wp_primary_selection_device == nullptr) {
DEBUG_LOG_WAYLAND_THREAD("Couldn't set primary selection, seat doesn't have wp_primary_selection_device.");
return;
}
ss->primary_data = p_text.to_utf8_buffer();
if (ss->wp_primary_selection_source == nullptr) {
@ -4113,10 +4311,10 @@ void WaylandThread::primary_set_text(const String &p_text) {
zwp_primary_selection_source_v1_add_listener(ss->wp_primary_selection_source, &wp_primary_selection_source_listener, ss);
zwp_primary_selection_source_v1_offer(ss->wp_primary_selection_source, "text/plain;charset=utf-8");
zwp_primary_selection_source_v1_offer(ss->wp_primary_selection_source, "text/plain");
}
// TODO: Implement a good way of getting the latest serial from the user.
zwp_primary_selection_device_v1_set_selection(ss->wp_primary_selection_device, ss->wp_primary_selection_source, MAX(ss->pointer_data.button_serial, ss->last_key_pressed_serial));
// TODO: Implement a good way of getting the latest serial from the user.
zwp_primary_selection_device_v1_set_selection(ss->wp_primary_selection_device, ss->wp_primary_selection_source, MAX(ss->pointer_data.button_serial, ss->last_key_pressed_serial));
}
// Wait for the message to get to the server before continuing, otherwise the
// clipboard update might come with a delay.
@ -4141,6 +4339,16 @@ bool WaylandThread::get_reset_frame() {
// Dispatches events until a frame event is received, a window is reported as
// suspended or the timeout expires.
bool WaylandThread::wait_frame_suspend_ms(int p_timeout) {
// This is a bit of a chicken and egg thing... Looks like the main event loop
// has to call its rightfully forever-blocking poll right in between
// `wl_display_prepare_read` and `wl_display_read`. This means, that it will
// basically be guaranteed to stay stuck in a "prepare read" state, where it
// will block any other attempt at reading the display fd, such as ours. The
// solution? Let's make sure the mutex is locked (it should) and unblock the
// main thread with a roundtrip!
MutexLock mutex_lock(mutex);
wl_display_roundtrip(wl_display);
if (main_window.suspended) {
// The window is suspended! The compositor is telling us _explicitly_ that we
// don't need to draw, without letting us guess through the frame event's
@ -4373,6 +4581,10 @@ void WaylandThread::destroy() {
xdg_activation_v1_destroy(registry.xdg_activation);
}
if (registry.xdg_system_bell) {
xdg_system_bell_v1_destroy(registry.xdg_system_bell);
}
if (registry.xdg_decoration_manager) {
zxdg_decoration_manager_v1_destroy(registry.xdg_decoration_manager);
}
@ -4389,10 +4601,14 @@ void WaylandThread::destroy() {
xdg_wm_base_destroy(registry.xdg_wm_base);
}
if (registry.xdg_exporter) {
zxdg_exporter_v1_destroy(registry.xdg_exporter);
// NOTE: Deprecated.
if (registry.xdg_exporter_v1) {
zxdg_exporter_v1_destroy(registry.xdg_exporter_v1);
}
if (registry.xdg_exporter_v2) {
zxdg_exporter_v2_destroy(registry.xdg_exporter_v2);
}
if (registry.wl_shm) {
wl_shm_destroy(registry.wl_shm);
}

View file

@ -44,7 +44,7 @@
#include <wayland-client-core.h>
#include <wayland-cursor.h>
#ifdef GLES3_ENABLED
#include <wayland-egl.h>
#include <wayland-egl-core.h>
#endif
#include <xkbcommon/xkbcommon.h>
#endif // SOWRAP_ENABLED
@ -67,14 +67,18 @@
#include "wayland/protocol/wayland.gen.h"
#include "wayland/protocol/xdg_activation.gen.h"
#include "wayland/protocol/xdg_decoration.gen.h"
#include "wayland/protocol/xdg_foreign.gen.h"
#include "wayland/protocol/xdg_foreign_v2.gen.h"
#include "wayland/protocol/xdg_shell.gen.h"
#include "wayland/protocol/xdg_system_bell.gen.h"
// NOTE: Deprecated.
#include "wayland/protocol/xdg_foreign_v1.gen.h"
#ifdef LIBDECOR_ENABLED
#ifdef SOWRAP_ENABLED
#include "dynwrappers/libdecor-so_wrap.h"
#else
#include <libdecor-0/libdecor.h>
#include <libdecor.h>
#endif // SOWRAP_ENABLED
#endif // LIBDECOR_ENABLED
@ -148,8 +152,12 @@ public:
struct xdg_wm_base *xdg_wm_base = nullptr;
uint32_t xdg_wm_base_name = 0;
struct zxdg_exporter_v1 *xdg_exporter = nullptr;
uint32_t xdg_exporter_name = 0;
// NOTE: Deprecated.
struct zxdg_exporter_v1 *xdg_exporter_v1 = nullptr;
uint32_t xdg_exporter_v1_name = 0;
uint32_t xdg_exporter_v2_name = 0;
struct zxdg_exporter_v2 *xdg_exporter_v2 = nullptr;
// wayland-protocols globals.
@ -162,6 +170,9 @@ public:
struct zxdg_decoration_manager_v1 *xdg_decoration_manager = nullptr;
uint32_t xdg_decoration_manager_name = 0;
struct xdg_system_bell_v1 *xdg_system_bell = nullptr;
uint32_t xdg_system_bell_name = 0;
struct xdg_activation_v1 *xdg_activation = nullptr;
uint32_t xdg_activation_name = 0;
@ -220,7 +231,11 @@ public:
struct wp_viewport *wp_viewport = nullptr;
struct wp_fractional_scale_v1 *wp_fractional_scale = nullptr;
struct zxdg_exported_v1 *xdg_exported = nullptr;
// NOTE: Deprecated.
struct zxdg_exported_v1 *xdg_exported_v1 = nullptr;
struct zxdg_exported_v2 *xdg_exported_v2 = nullptr;
String exported_handle;
@ -295,7 +310,7 @@ public:
};
struct PointerData {
Point2i position;
Point2 position;
uint32_t motion_time = 0;
// Relative motion has its own optional event and so needs its own time.
@ -305,7 +320,7 @@ public:
BitField<MouseButtonMask> pressed_button_mask;
MouseButton last_button_pressed = MouseButton::NONE;
Point2i last_pressed_position;
Point2 last_pressed_position;
// This is needed to check for a new double click every time.
bool double_click_begun = false;
@ -325,14 +340,14 @@ public:
};
struct TabletToolData {
Point2i position;
Point2 position;
Vector2 tilt;
uint32_t pressure = 0;
BitField<MouseButtonMask> pressed_button_mask;
MouseButton last_button_pressed = MouseButton::NONE;
Point2i last_pressed_position;
Point2 last_pressed_position;
bool double_click_begun = false;
@ -413,6 +428,8 @@ public:
const char *keymap_buffer = nullptr;
uint32_t keymap_buffer_size = 0;
HashMap<xkb_keycode_t, Key> pressed_keycodes;
xkb_layout_index_t current_layout_index = 0;
int32_t repeat_key_delay_msec = 0;
@ -469,7 +486,6 @@ public:
uint32_t *buffer_data = nullptr;
uint32_t buffer_data_size = 0;
RID rid;
Point2i hotspot;
};
@ -506,10 +522,8 @@ private:
HashMap<DisplayServer::CursorShape, CustomCursor> custom_cursors;
struct wl_cursor *current_wl_cursor = nullptr;
struct CustomCursor *current_custom_cursor = nullptr;
DisplayServer::CursorShape last_cursor_shape = DisplayServer::CURSOR_ARROW;
DisplayServer::CursorShape cursor_shape = DisplayServer::CURSOR_ARROW;
bool cursor_visible = true;
PointerConstraint pointer_constraint = PointerConstraint::NONE;
@ -651,7 +665,10 @@ private:
static void _xdg_toplevel_decoration_on_configure(void *data, struct zxdg_toplevel_decoration_v1 *xdg_toplevel_decoration, uint32_t mode);
static void _xdg_exported_on_exported(void *data, zxdg_exported_v1 *exported, const char *handle);
// NOTE: Deprecated.
static void _xdg_exported_v1_on_handle(void *data, zxdg_exported_v1 *exported, const char *handle);
static void _xdg_exported_v2_on_handle(void *data, zxdg_exported_v2 *exported, const char *handle);
static void _xdg_activation_token_on_done(void *data, struct xdg_activation_token_v1 *xdg_activation_token, const char *token);
@ -668,7 +685,7 @@ private:
.preferred_buffer_transform = _wl_surface_on_preferred_buffer_transform,
};
static constexpr struct wl_callback_listener frame_wl_callback_listener {
static constexpr struct wl_callback_listener frame_wl_callback_listener = {
.done = _frame_wl_callback_on_done,
};
@ -686,7 +703,7 @@ private:
.name = _wl_seat_on_name,
};
static constexpr struct wl_callback_listener cursor_frame_callback_listener {
static constexpr struct wl_callback_listener cursor_frame_callback_listener = {
.done = _cursor_frame_callback_on_done,
};
@ -819,8 +836,13 @@ private:
.done = _wp_text_input_on_done,
};
static constexpr struct zxdg_exported_v1_listener xdg_exported_listener = {
.handle = _xdg_exported_on_exported
// NOTE: Deprecated.
static constexpr struct zxdg_exported_v1_listener xdg_exported_v1_listener = {
.handle = _xdg_exported_v1_on_handle,
};
static constexpr struct zxdg_exported_v2_listener xdg_exported_v2_listener = {
.handle = _xdg_exported_v2_on_handle,
};
static constexpr struct zxdg_toplevel_decoration_v1_listener xdg_toplevel_decoration_listener = {
@ -883,7 +905,8 @@ private:
static Vector<uint8_t> _wp_primary_selection_offer_read(struct wl_display *wl_display, const char *p_mime, struct zwp_primary_selection_offer_v1 *wp_primary_selection_offer);
static void _seat_state_set_current(WaylandThread::SeatState &p_ss);
static bool _seat_state_configure_key_event(WaylandThread::SeatState &p_seat, Ref<InputEventKey> p_event, xkb_keycode_t p_keycode, bool p_pressed);
static Ref<InputEventKey> _seat_state_get_key_event(SeatState *p_ss, xkb_keycode_t p_keycode, bool p_pressed);
static Ref<InputEventKey> _seat_state_get_unstuck_key_event(SeatState *p_ss, xkb_keycode_t p_keycode, bool p_pressed, Key p_key);
static void _wayland_state_update_cursor();
@ -929,10 +952,14 @@ public:
bool has_message();
Ref<Message> pop_message();
void beep() const;
void window_create(DisplayServer::WindowID p_window_id, int p_width, int p_height);
struct wl_surface *window_get_wl_surface(DisplayServer::WindowID p_window_id) const;
void window_start_resize(DisplayServer::WindowResizeEdge p_edge, DisplayServer::WindowID p_window);
void window_set_max_size(DisplayServer::WindowID p_window_id, const Size2i &p_size);
void window_set_min_size(DisplayServer::WindowID p_window_id, const Size2i &p_size);
@ -949,6 +976,8 @@ public:
// Optional - requires xdg_activation_v1
void window_request_attention(DisplayServer::WindowID p_window_id);
void window_start_drag(DisplayServer::WindowID p_window_id);
// Optional - require idle_inhibit_unstable_v1
void window_set_idle_inhibition(DisplayServer::WindowID p_window_id, bool p_enable);
bool window_get_idle_inhibition(DisplayServer::WindowID p_window_id) const;
@ -962,7 +991,7 @@ public:
DisplayServer::WindowID pointer_get_pointed_window_id() const;
BitField<MouseButtonMask> pointer_get_button_mask() const;
void cursor_hide();
void cursor_set_visible(bool p_visible);
void cursor_set_shape(DisplayServer::CursorShape p_cursor_shape);
void cursor_set_custom_shape(DisplayServer::CursorShape p_cursor_shape);

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *
Import("env")

File diff suppressed because it is too large Load diff

View file

@ -208,6 +208,8 @@ class DisplayServerX11 : public DisplayServer {
bool layered_window = false;
bool mpass = false;
Window embed_parent = 0;
Rect2i parent_safe_rect;
unsigned int focus_order = 0;
@ -234,7 +236,7 @@ class DisplayServerX11 : public DisplayServer {
WindowID last_focused_window = INVALID_WINDOW_ID;
WindowID window_id_counter = MAIN_WINDOW_ID;
WindowID _create_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect);
WindowID _create_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect, Window p_parent_window);
String internal_clipboard;
String internal_clipboard_primary;
@ -295,6 +297,11 @@ class DisplayServerX11 : public DisplayServer {
void _flush_mouse_motion();
MouseMode mouse_mode = MOUSE_MODE_VISIBLE;
MouseMode mouse_mode_base = MOUSE_MODE_VISIBLE;
MouseMode mouse_mode_override = MOUSE_MODE_VISIBLE;
bool mouse_mode_override_enabled = false;
void _mouse_update_mode();
Point2i center;
void _handle_key_event(WindowID p_window, XKeyEvent *p_event, LocalVector<XEvent> &p_events, uint32_t &p_event_index, bool p_echo = false);
@ -331,6 +338,7 @@ class DisplayServerX11 : public DisplayServer {
bool xinerama_ext_ok = true;
bool xshaped_ext_ok = true;
bool xwayland = false;
bool kde5_embed_workaround = false; // Workaround embedded game visibility on KDE 5 (GH-102043).
struct Property {
unsigned char *data;
@ -375,6 +383,18 @@ class DisplayServerX11 : public DisplayServer {
static Bool _predicate_clipboard_incr(Display *display, XEvent *event, XPointer arg);
static Bool _predicate_clipboard_save_targets(Display *display, XEvent *event, XPointer arg);
struct EmbeddedProcessData {
Window process_window = 0;
bool visible = true;
};
HashMap<OS::ProcessID, EmbeddedProcessData *> embedded_processes;
Point2i _get_window_position(Window p_window) const;
Rect2i _get_window_rect(Window p_window) const;
void _set_external_window_settings(Window p_window, Window p_parent_transient, WindowMode p_mode, uint32_t p_flags, const Rect2i &p_rect);
void _set_window_taskbar_pager_enabled(Window p_window, bool p_enabled);
Rect2i _screens_get_full_rect() const;
protected:
void _window_changed(XEvent *event);
@ -406,8 +426,14 @@ public:
virtual Error file_dialog_with_options_show(const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const TypedArray<Dictionary> &p_options, const Callable &p_callback) override;
#endif
virtual void beep() const override;
virtual void mouse_set_mode(MouseMode p_mode) override;
virtual MouseMode mouse_get_mode() const override;
virtual void mouse_set_mode_override(MouseMode p_mode) override;
virtual MouseMode mouse_get_mode_override() const override;
virtual void mouse_set_mode_override_enabled(bool p_override_enabled) override;
virtual bool mouse_is_mode_override_enabled() const override;
virtual void warp_mouse(const Point2i &p_position) override;
virtual Point2i mouse_get_position() const override;
@ -510,6 +536,14 @@ public:
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;
virtual void window_start_drag(WindowID p_window = MAIN_WINDOW_ID) override;
virtual void window_start_resize(WindowResizeEdge p_edge, WindowID p_window) override;
virtual Error embed_process(WindowID p_window, OS::ProcessID p_pid, const Rect2i &p_rect, bool p_visible, bool p_grab_focus) override;
virtual Error request_close_embedded_process(OS::ProcessID p_pid) override;
virtual Error remove_embedded_process(OS::ProcessID p_pid) override;
virtual OS::ProcessID get_focused_process_id() override;
virtual void cursor_set_shape(CursorShape p_shape) override;
virtual CursorShape cursor_get_shape() const override;
virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) override;
@ -534,12 +568,12 @@ public:
virtual void set_native_icon(const String &p_filename) override;
virtual void set_icon(const Ref<Image> &p_icon) override;
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, Context p_context, Error &r_error);
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, Context p_context, int64_t p_parent_window, Error &r_error);
static Vector<String> get_rendering_drivers_func();
static void register_x11_driver();
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, Context p_context, Error &r_error);
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, Context p_context, int64_t p_parent_window, Error &r_error);
~DisplayServerX11();
};

View file

@ -1,12 +1,8 @@
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:09:53
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/Xcursor/Xcursor.h --sys-include "thirdparty/linuxbsd_headers/X11/Xcursor/Xcursor.h" --soname libXcursor.so.1 --init-name xcursor --output-header ./platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:50:26
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/Xcursor/Xcursor.h --sys-include thirdparty/linuxbsd_headers/X11/Xcursor/Xcursor.h --soname libXcursor.so.1 --init-name xcursor --output-header ./platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.c --ignore-other
//
// NOTE: Generated from Xcursor 1.2.0.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, but absent in libXcursor.so.1, were removed.
#include <stdint.h>
#define XcursorImageCreate XcursorImageCreate_dylibloader_orig_xcursor
@ -130,65 +126,65 @@
#undef XcursorSetThemeCore
#include <dlfcn.h>
#include <stdio.h>
XcursorImage* (*XcursorImageCreate_dylibloader_wrapper_xcursor)( int, int);
void (*XcursorImageDestroy_dylibloader_wrapper_xcursor)( XcursorImage*);
XcursorImages* (*XcursorImagesCreate_dylibloader_wrapper_xcursor)( int);
void (*XcursorImagesDestroy_dylibloader_wrapper_xcursor)( XcursorImages*);
void (*XcursorImagesSetName_dylibloader_wrapper_xcursor)( XcursorImages*,const char*);
XcursorCursors* (*XcursorCursorsCreate_dylibloader_wrapper_xcursor)( Display*, int);
void (*XcursorCursorsDestroy_dylibloader_wrapper_xcursor)( XcursorCursors*);
XcursorAnimate* (*XcursorAnimateCreate_dylibloader_wrapper_xcursor)( XcursorCursors*);
void (*XcursorAnimateDestroy_dylibloader_wrapper_xcursor)( XcursorAnimate*);
Cursor (*XcursorAnimateNext_dylibloader_wrapper_xcursor)( XcursorAnimate*);
XcursorComment* (*XcursorCommentCreate_dylibloader_wrapper_xcursor)( XcursorUInt, int);
void (*XcursorCommentDestroy_dylibloader_wrapper_xcursor)( XcursorComment*);
XcursorComments* (*XcursorCommentsCreate_dylibloader_wrapper_xcursor)( int);
void (*XcursorCommentsDestroy_dylibloader_wrapper_xcursor)( XcursorComments*);
XcursorImage* (*XcursorXcFileLoadImage_dylibloader_wrapper_xcursor)( XcursorFile*, int);
XcursorImages* (*XcursorXcFileLoadImages_dylibloader_wrapper_xcursor)( XcursorFile*, int);
XcursorImages* (*XcursorXcFileLoadAllImages_dylibloader_wrapper_xcursor)( XcursorFile*);
XcursorBool (*XcursorXcFileLoad_dylibloader_wrapper_xcursor)( XcursorFile*, XcursorComments**, XcursorImages**);
XcursorBool (*XcursorXcFileSave_dylibloader_wrapper_xcursor)( XcursorFile*,const XcursorComments*,const XcursorImages*);
XcursorImage* (*XcursorFileLoadImage_dylibloader_wrapper_xcursor)( FILE*, int);
XcursorImages* (*XcursorFileLoadImages_dylibloader_wrapper_xcursor)( FILE*, int);
XcursorImages* (*XcursorFileLoadAllImages_dylibloader_wrapper_xcursor)( FILE*);
XcursorBool (*XcursorFileLoad_dylibloader_wrapper_xcursor)( FILE*, XcursorComments**, XcursorImages**);
XcursorBool (*XcursorFileSaveImages_dylibloader_wrapper_xcursor)( FILE*,const XcursorImages*);
XcursorBool (*XcursorFileSave_dylibloader_wrapper_xcursor)( FILE*,const XcursorComments*,const XcursorImages*);
XcursorImage* (*XcursorFilenameLoadImage_dylibloader_wrapper_xcursor)(const char*, int);
XcursorImages* (*XcursorFilenameLoadImages_dylibloader_wrapper_xcursor)(const char*, int);
XcursorImages* (*XcursorFilenameLoadAllImages_dylibloader_wrapper_xcursor)(const char*);
XcursorBool (*XcursorFilenameLoad_dylibloader_wrapper_xcursor)(const char*, XcursorComments**, XcursorImages**);
XcursorBool (*XcursorFilenameSaveImages_dylibloader_wrapper_xcursor)(const char*,const XcursorImages*);
XcursorBool (*XcursorFilenameSave_dylibloader_wrapper_xcursor)(const char*,const XcursorComments*,const XcursorImages*);
XcursorImage* (*XcursorLibraryLoadImage_dylibloader_wrapper_xcursor)(const char*,const char*, int);
XcursorImages* (*XcursorLibraryLoadImages_dylibloader_wrapper_xcursor)(const char*,const char*, int);
const char* (*XcursorLibraryPath_dylibloader_wrapper_xcursor)( void);
int (*XcursorLibraryShape_dylibloader_wrapper_xcursor)(const char*);
Cursor (*XcursorImageLoadCursor_dylibloader_wrapper_xcursor)( Display*,const XcursorImage*);
XcursorCursors* (*XcursorImagesLoadCursors_dylibloader_wrapper_xcursor)( Display*,const XcursorImages*);
Cursor (*XcursorImagesLoadCursor_dylibloader_wrapper_xcursor)( Display*,const XcursorImages*);
Cursor (*XcursorFilenameLoadCursor_dylibloader_wrapper_xcursor)( Display*,const char*);
XcursorCursors* (*XcursorFilenameLoadCursors_dylibloader_wrapper_xcursor)( Display*,const char*);
Cursor (*XcursorLibraryLoadCursor_dylibloader_wrapper_xcursor)( Display*,const char*);
XcursorCursors* (*XcursorLibraryLoadCursors_dylibloader_wrapper_xcursor)( Display*,const char*);
XcursorImage* (*XcursorShapeLoadImage_dylibloader_wrapper_xcursor)( unsigned int,const char*, int);
XcursorImages* (*XcursorShapeLoadImages_dylibloader_wrapper_xcursor)( unsigned int,const char*, int);
Cursor (*XcursorShapeLoadCursor_dylibloader_wrapper_xcursor)( Display*, unsigned int);
XcursorCursors* (*XcursorShapeLoadCursors_dylibloader_wrapper_xcursor)( Display*, unsigned int);
Cursor (*XcursorTryShapeCursor_dylibloader_wrapper_xcursor)( Display*, Font, Font, unsigned int, unsigned int,const XColor*,const XColor*);
void (*XcursorNoticeCreateBitmap_dylibloader_wrapper_xcursor)( Display*, Pixmap, unsigned int, unsigned int);
void (*XcursorNoticePutBitmap_dylibloader_wrapper_xcursor)( Display*, Drawable, XImage*);
Cursor (*XcursorTryShapeBitmapCursor_dylibloader_wrapper_xcursor)( Display*, Pixmap, Pixmap, XColor*, XColor*, unsigned int, unsigned int);
void (*XcursorImageHash_dylibloader_wrapper_xcursor)( XImage*, unsigned char [16]);
XcursorBool (*XcursorSupportsARGB_dylibloader_wrapper_xcursor)( Display*);
XcursorBool (*XcursorSupportsAnim_dylibloader_wrapper_xcursor)( Display*);
XcursorBool (*XcursorSetDefaultSize_dylibloader_wrapper_xcursor)( Display*, int);
int (*XcursorGetDefaultSize_dylibloader_wrapper_xcursor)( Display*);
XcursorBool (*XcursorSetTheme_dylibloader_wrapper_xcursor)( Display*,const char*);
char* (*XcursorGetTheme_dylibloader_wrapper_xcursor)( Display*);
XcursorBool (*XcursorGetThemeCore_dylibloader_wrapper_xcursor)( Display*);
XcursorBool (*XcursorSetThemeCore_dylibloader_wrapper_xcursor)( Display*, XcursorBool);
XcursorImage *(*XcursorImageCreate_dylibloader_wrapper_xcursor)(int, int);
void (*XcursorImageDestroy_dylibloader_wrapper_xcursor)(XcursorImage *);
XcursorImages *(*XcursorImagesCreate_dylibloader_wrapper_xcursor)(int);
void (*XcursorImagesDestroy_dylibloader_wrapper_xcursor)(XcursorImages *);
void (*XcursorImagesSetName_dylibloader_wrapper_xcursor)(XcursorImages *, const char *);
XcursorCursors *(*XcursorCursorsCreate_dylibloader_wrapper_xcursor)(Display *, int);
void (*XcursorCursorsDestroy_dylibloader_wrapper_xcursor)(XcursorCursors *);
XcursorAnimate *(*XcursorAnimateCreate_dylibloader_wrapper_xcursor)(XcursorCursors *);
void (*XcursorAnimateDestroy_dylibloader_wrapper_xcursor)(XcursorAnimate *);
Cursor (*XcursorAnimateNext_dylibloader_wrapper_xcursor)(XcursorAnimate *);
XcursorComment *(*XcursorCommentCreate_dylibloader_wrapper_xcursor)(XcursorUInt, int);
void (*XcursorCommentDestroy_dylibloader_wrapper_xcursor)(XcursorComment *);
XcursorComments *(*XcursorCommentsCreate_dylibloader_wrapper_xcursor)(int);
void (*XcursorCommentsDestroy_dylibloader_wrapper_xcursor)(XcursorComments *);
XcursorImage *(*XcursorXcFileLoadImage_dylibloader_wrapper_xcursor)(XcursorFile *, int);
XcursorImages *(*XcursorXcFileLoadImages_dylibloader_wrapper_xcursor)(XcursorFile *, int);
XcursorImages *(*XcursorXcFileLoadAllImages_dylibloader_wrapper_xcursor)(XcursorFile *);
XcursorBool (*XcursorXcFileLoad_dylibloader_wrapper_xcursor)(XcursorFile *, XcursorComments **, XcursorImages **);
XcursorBool (*XcursorXcFileSave_dylibloader_wrapper_xcursor)(XcursorFile *, const XcursorComments *, const XcursorImages *);
XcursorImage *(*XcursorFileLoadImage_dylibloader_wrapper_xcursor)(FILE *, int);
XcursorImages *(*XcursorFileLoadImages_dylibloader_wrapper_xcursor)(FILE *, int);
XcursorImages *(*XcursorFileLoadAllImages_dylibloader_wrapper_xcursor)(FILE *);
XcursorBool (*XcursorFileLoad_dylibloader_wrapper_xcursor)(FILE *, XcursorComments **, XcursorImages **);
XcursorBool (*XcursorFileSaveImages_dylibloader_wrapper_xcursor)(FILE *, const XcursorImages *);
XcursorBool (*XcursorFileSave_dylibloader_wrapper_xcursor)(FILE *, const XcursorComments *, const XcursorImages *);
XcursorImage *(*XcursorFilenameLoadImage_dylibloader_wrapper_xcursor)(const char *, int);
XcursorImages *(*XcursorFilenameLoadImages_dylibloader_wrapper_xcursor)(const char *, int);
XcursorImages *(*XcursorFilenameLoadAllImages_dylibloader_wrapper_xcursor)(const char *);
XcursorBool (*XcursorFilenameLoad_dylibloader_wrapper_xcursor)(const char *, XcursorComments **, XcursorImages **);
XcursorBool (*XcursorFilenameSaveImages_dylibloader_wrapper_xcursor)(const char *, const XcursorImages *);
XcursorBool (*XcursorFilenameSave_dylibloader_wrapper_xcursor)(const char *, const XcursorComments *, const XcursorImages *);
XcursorImage *(*XcursorLibraryLoadImage_dylibloader_wrapper_xcursor)(const char *, const char *, int);
XcursorImages *(*XcursorLibraryLoadImages_dylibloader_wrapper_xcursor)(const char *, const char *, int);
const char *(*XcursorLibraryPath_dylibloader_wrapper_xcursor)(void);
int (*XcursorLibraryShape_dylibloader_wrapper_xcursor)(const char *);
Cursor (*XcursorImageLoadCursor_dylibloader_wrapper_xcursor)(Display *, const XcursorImage *);
XcursorCursors *(*XcursorImagesLoadCursors_dylibloader_wrapper_xcursor)(Display *, const XcursorImages *);
Cursor (*XcursorImagesLoadCursor_dylibloader_wrapper_xcursor)(Display *, const XcursorImages *);
Cursor (*XcursorFilenameLoadCursor_dylibloader_wrapper_xcursor)(Display *, const char *);
XcursorCursors *(*XcursorFilenameLoadCursors_dylibloader_wrapper_xcursor)(Display *, const char *);
Cursor (*XcursorLibraryLoadCursor_dylibloader_wrapper_xcursor)(Display *, const char *);
XcursorCursors *(*XcursorLibraryLoadCursors_dylibloader_wrapper_xcursor)(Display *, const char *);
XcursorImage *(*XcursorShapeLoadImage_dylibloader_wrapper_xcursor)(unsigned int, const char *, int);
XcursorImages *(*XcursorShapeLoadImages_dylibloader_wrapper_xcursor)(unsigned int, const char *, int);
Cursor (*XcursorShapeLoadCursor_dylibloader_wrapper_xcursor)(Display *, unsigned int);
XcursorCursors *(*XcursorShapeLoadCursors_dylibloader_wrapper_xcursor)(Display *, unsigned int);
Cursor (*XcursorTryShapeCursor_dylibloader_wrapper_xcursor)(Display *, Font, Font, unsigned int, unsigned int, const XColor *, const XColor *);
void (*XcursorNoticeCreateBitmap_dylibloader_wrapper_xcursor)(Display *, Pixmap, unsigned int, unsigned int);
void (*XcursorNoticePutBitmap_dylibloader_wrapper_xcursor)(Display *, Drawable, XImage *);
Cursor (*XcursorTryShapeBitmapCursor_dylibloader_wrapper_xcursor)(Display *, Pixmap, Pixmap, XColor *, XColor *, unsigned int, unsigned int);
void (*XcursorImageHash_dylibloader_wrapper_xcursor)(XImage *, unsigned char [16]);
XcursorBool (*XcursorSupportsARGB_dylibloader_wrapper_xcursor)(Display *);
XcursorBool (*XcursorSupportsAnim_dylibloader_wrapper_xcursor)(Display *);
XcursorBool (*XcursorSetDefaultSize_dylibloader_wrapper_xcursor)(Display *, int);
int (*XcursorGetDefaultSize_dylibloader_wrapper_xcursor)(Display *);
XcursorBool (*XcursorSetTheme_dylibloader_wrapper_xcursor)(Display *, const char *);
char *(*XcursorGetTheme_dylibloader_wrapper_xcursor)(Display *);
XcursorBool (*XcursorGetThemeCore_dylibloader_wrapper_xcursor)(Display *);
XcursorBool (*XcursorSetThemeCore_dylibloader_wrapper_xcursor)(Display *, XcursorBool);
int initialize_xcursor(int verbose) {
void *handle;
char *error;

View file

@ -2,13 +2,9 @@
#define DYLIBLOAD_WRAPPER_XCURSOR
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:09:53
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/Xcursor/Xcursor.h --sys-include "thirdparty/linuxbsd_headers/X11/Xcursor/Xcursor.h" --soname libXcursor.so.1 --init-name xcursor --output-header ./platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:50:26
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/Xcursor/Xcursor.h --sys-include thirdparty/linuxbsd_headers/X11/Xcursor/Xcursor.h --soname libXcursor.so.1 --init-name xcursor --output-header ./platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xcursor-so_wrap.c --ignore-other
//
// NOTE: Generated from Xcursor 1.2.0.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, but absent in libXcursor.so.1, were removed.
#include <stdint.h>
#define XcursorImageCreate XcursorImageCreate_dylibloader_orig_xcursor
@ -192,65 +188,65 @@ extern "C" {
#define XcursorGetTheme XcursorGetTheme_dylibloader_wrapper_xcursor
#define XcursorGetThemeCore XcursorGetThemeCore_dylibloader_wrapper_xcursor
#define XcursorSetThemeCore XcursorSetThemeCore_dylibloader_wrapper_xcursor
extern XcursorImage* (*XcursorImageCreate_dylibloader_wrapper_xcursor)( int, int);
extern void (*XcursorImageDestroy_dylibloader_wrapper_xcursor)( XcursorImage*);
extern XcursorImages* (*XcursorImagesCreate_dylibloader_wrapper_xcursor)( int);
extern void (*XcursorImagesDestroy_dylibloader_wrapper_xcursor)( XcursorImages*);
extern void (*XcursorImagesSetName_dylibloader_wrapper_xcursor)( XcursorImages*,const char*);
extern XcursorCursors* (*XcursorCursorsCreate_dylibloader_wrapper_xcursor)( Display*, int);
extern void (*XcursorCursorsDestroy_dylibloader_wrapper_xcursor)( XcursorCursors*);
extern XcursorAnimate* (*XcursorAnimateCreate_dylibloader_wrapper_xcursor)( XcursorCursors*);
extern void (*XcursorAnimateDestroy_dylibloader_wrapper_xcursor)( XcursorAnimate*);
extern Cursor (*XcursorAnimateNext_dylibloader_wrapper_xcursor)( XcursorAnimate*);
extern XcursorComment* (*XcursorCommentCreate_dylibloader_wrapper_xcursor)( XcursorUInt, int);
extern void (*XcursorCommentDestroy_dylibloader_wrapper_xcursor)( XcursorComment*);
extern XcursorComments* (*XcursorCommentsCreate_dylibloader_wrapper_xcursor)( int);
extern void (*XcursorCommentsDestroy_dylibloader_wrapper_xcursor)( XcursorComments*);
extern XcursorImage* (*XcursorXcFileLoadImage_dylibloader_wrapper_xcursor)( XcursorFile*, int);
extern XcursorImages* (*XcursorXcFileLoadImages_dylibloader_wrapper_xcursor)( XcursorFile*, int);
extern XcursorImages* (*XcursorXcFileLoadAllImages_dylibloader_wrapper_xcursor)( XcursorFile*);
extern XcursorBool (*XcursorXcFileLoad_dylibloader_wrapper_xcursor)( XcursorFile*, XcursorComments**, XcursorImages**);
extern XcursorBool (*XcursorXcFileSave_dylibloader_wrapper_xcursor)( XcursorFile*,const XcursorComments*,const XcursorImages*);
extern XcursorImage* (*XcursorFileLoadImage_dylibloader_wrapper_xcursor)( FILE*, int);
extern XcursorImages* (*XcursorFileLoadImages_dylibloader_wrapper_xcursor)( FILE*, int);
extern XcursorImages* (*XcursorFileLoadAllImages_dylibloader_wrapper_xcursor)( FILE*);
extern XcursorBool (*XcursorFileLoad_dylibloader_wrapper_xcursor)( FILE*, XcursorComments**, XcursorImages**);
extern XcursorBool (*XcursorFileSaveImages_dylibloader_wrapper_xcursor)( FILE*,const XcursorImages*);
extern XcursorBool (*XcursorFileSave_dylibloader_wrapper_xcursor)( FILE*,const XcursorComments*,const XcursorImages*);
extern XcursorImage* (*XcursorFilenameLoadImage_dylibloader_wrapper_xcursor)(const char*, int);
extern XcursorImages* (*XcursorFilenameLoadImages_dylibloader_wrapper_xcursor)(const char*, int);
extern XcursorImages* (*XcursorFilenameLoadAllImages_dylibloader_wrapper_xcursor)(const char*);
extern XcursorBool (*XcursorFilenameLoad_dylibloader_wrapper_xcursor)(const char*, XcursorComments**, XcursorImages**);
extern XcursorBool (*XcursorFilenameSaveImages_dylibloader_wrapper_xcursor)(const char*,const XcursorImages*);
extern XcursorBool (*XcursorFilenameSave_dylibloader_wrapper_xcursor)(const char*,const XcursorComments*,const XcursorImages*);
extern XcursorImage* (*XcursorLibraryLoadImage_dylibloader_wrapper_xcursor)(const char*,const char*, int);
extern XcursorImages* (*XcursorLibraryLoadImages_dylibloader_wrapper_xcursor)(const char*,const char*, int);
extern const char* (*XcursorLibraryPath_dylibloader_wrapper_xcursor)( void);
extern int (*XcursorLibraryShape_dylibloader_wrapper_xcursor)(const char*);
extern Cursor (*XcursorImageLoadCursor_dylibloader_wrapper_xcursor)( Display*,const XcursorImage*);
extern XcursorCursors* (*XcursorImagesLoadCursors_dylibloader_wrapper_xcursor)( Display*,const XcursorImages*);
extern Cursor (*XcursorImagesLoadCursor_dylibloader_wrapper_xcursor)( Display*,const XcursorImages*);
extern Cursor (*XcursorFilenameLoadCursor_dylibloader_wrapper_xcursor)( Display*,const char*);
extern XcursorCursors* (*XcursorFilenameLoadCursors_dylibloader_wrapper_xcursor)( Display*,const char*);
extern Cursor (*XcursorLibraryLoadCursor_dylibloader_wrapper_xcursor)( Display*,const char*);
extern XcursorCursors* (*XcursorLibraryLoadCursors_dylibloader_wrapper_xcursor)( Display*,const char*);
extern XcursorImage* (*XcursorShapeLoadImage_dylibloader_wrapper_xcursor)( unsigned int,const char*, int);
extern XcursorImages* (*XcursorShapeLoadImages_dylibloader_wrapper_xcursor)( unsigned int,const char*, int);
extern Cursor (*XcursorShapeLoadCursor_dylibloader_wrapper_xcursor)( Display*, unsigned int);
extern XcursorCursors* (*XcursorShapeLoadCursors_dylibloader_wrapper_xcursor)( Display*, unsigned int);
extern Cursor (*XcursorTryShapeCursor_dylibloader_wrapper_xcursor)( Display*, Font, Font, unsigned int, unsigned int,const XColor*,const XColor*);
extern void (*XcursorNoticeCreateBitmap_dylibloader_wrapper_xcursor)( Display*, Pixmap, unsigned int, unsigned int);
extern void (*XcursorNoticePutBitmap_dylibloader_wrapper_xcursor)( Display*, Drawable, XImage*);
extern Cursor (*XcursorTryShapeBitmapCursor_dylibloader_wrapper_xcursor)( Display*, Pixmap, Pixmap, XColor*, XColor*, unsigned int, unsigned int);
extern void (*XcursorImageHash_dylibloader_wrapper_xcursor)( XImage*, unsigned char [16]);
extern XcursorBool (*XcursorSupportsARGB_dylibloader_wrapper_xcursor)( Display*);
extern XcursorBool (*XcursorSupportsAnim_dylibloader_wrapper_xcursor)( Display*);
extern XcursorBool (*XcursorSetDefaultSize_dylibloader_wrapper_xcursor)( Display*, int);
extern int (*XcursorGetDefaultSize_dylibloader_wrapper_xcursor)( Display*);
extern XcursorBool (*XcursorSetTheme_dylibloader_wrapper_xcursor)( Display*,const char*);
extern char* (*XcursorGetTheme_dylibloader_wrapper_xcursor)( Display*);
extern XcursorBool (*XcursorGetThemeCore_dylibloader_wrapper_xcursor)( Display*);
extern XcursorBool (*XcursorSetThemeCore_dylibloader_wrapper_xcursor)( Display*, XcursorBool);
extern XcursorImage *(*XcursorImageCreate_dylibloader_wrapper_xcursor)(int, int);
extern void (*XcursorImageDestroy_dylibloader_wrapper_xcursor)(XcursorImage *);
extern XcursorImages *(*XcursorImagesCreate_dylibloader_wrapper_xcursor)(int);
extern void (*XcursorImagesDestroy_dylibloader_wrapper_xcursor)(XcursorImages *);
extern void (*XcursorImagesSetName_dylibloader_wrapper_xcursor)(XcursorImages *, const char *);
extern XcursorCursors *(*XcursorCursorsCreate_dylibloader_wrapper_xcursor)(Display *, int);
extern void (*XcursorCursorsDestroy_dylibloader_wrapper_xcursor)(XcursorCursors *);
extern XcursorAnimate *(*XcursorAnimateCreate_dylibloader_wrapper_xcursor)(XcursorCursors *);
extern void (*XcursorAnimateDestroy_dylibloader_wrapper_xcursor)(XcursorAnimate *);
extern Cursor (*XcursorAnimateNext_dylibloader_wrapper_xcursor)(XcursorAnimate *);
extern XcursorComment *(*XcursorCommentCreate_dylibloader_wrapper_xcursor)(XcursorUInt, int);
extern void (*XcursorCommentDestroy_dylibloader_wrapper_xcursor)(XcursorComment *);
extern XcursorComments *(*XcursorCommentsCreate_dylibloader_wrapper_xcursor)(int);
extern void (*XcursorCommentsDestroy_dylibloader_wrapper_xcursor)(XcursorComments *);
extern XcursorImage *(*XcursorXcFileLoadImage_dylibloader_wrapper_xcursor)(XcursorFile *, int);
extern XcursorImages *(*XcursorXcFileLoadImages_dylibloader_wrapper_xcursor)(XcursorFile *, int);
extern XcursorImages *(*XcursorXcFileLoadAllImages_dylibloader_wrapper_xcursor)(XcursorFile *);
extern XcursorBool (*XcursorXcFileLoad_dylibloader_wrapper_xcursor)(XcursorFile *, XcursorComments **, XcursorImages **);
extern XcursorBool (*XcursorXcFileSave_dylibloader_wrapper_xcursor)(XcursorFile *, const XcursorComments *, const XcursorImages *);
extern XcursorImage *(*XcursorFileLoadImage_dylibloader_wrapper_xcursor)(FILE *, int);
extern XcursorImages *(*XcursorFileLoadImages_dylibloader_wrapper_xcursor)(FILE *, int);
extern XcursorImages *(*XcursorFileLoadAllImages_dylibloader_wrapper_xcursor)(FILE *);
extern XcursorBool (*XcursorFileLoad_dylibloader_wrapper_xcursor)(FILE *, XcursorComments **, XcursorImages **);
extern XcursorBool (*XcursorFileSaveImages_dylibloader_wrapper_xcursor)(FILE *, const XcursorImages *);
extern XcursorBool (*XcursorFileSave_dylibloader_wrapper_xcursor)(FILE *, const XcursorComments *, const XcursorImages *);
extern XcursorImage *(*XcursorFilenameLoadImage_dylibloader_wrapper_xcursor)(const char *, int);
extern XcursorImages *(*XcursorFilenameLoadImages_dylibloader_wrapper_xcursor)(const char *, int);
extern XcursorImages *(*XcursorFilenameLoadAllImages_dylibloader_wrapper_xcursor)(const char *);
extern XcursorBool (*XcursorFilenameLoad_dylibloader_wrapper_xcursor)(const char *, XcursorComments **, XcursorImages **);
extern XcursorBool (*XcursorFilenameSaveImages_dylibloader_wrapper_xcursor)(const char *, const XcursorImages *);
extern XcursorBool (*XcursorFilenameSave_dylibloader_wrapper_xcursor)(const char *, const XcursorComments *, const XcursorImages *);
extern XcursorImage *(*XcursorLibraryLoadImage_dylibloader_wrapper_xcursor)(const char *, const char *, int);
extern XcursorImages *(*XcursorLibraryLoadImages_dylibloader_wrapper_xcursor)(const char *, const char *, int);
extern const char *(*XcursorLibraryPath_dylibloader_wrapper_xcursor)(void);
extern int (*XcursorLibraryShape_dylibloader_wrapper_xcursor)(const char *);
extern Cursor (*XcursorImageLoadCursor_dylibloader_wrapper_xcursor)(Display *, const XcursorImage *);
extern XcursorCursors *(*XcursorImagesLoadCursors_dylibloader_wrapper_xcursor)(Display *, const XcursorImages *);
extern Cursor (*XcursorImagesLoadCursor_dylibloader_wrapper_xcursor)(Display *, const XcursorImages *);
extern Cursor (*XcursorFilenameLoadCursor_dylibloader_wrapper_xcursor)(Display *, const char *);
extern XcursorCursors *(*XcursorFilenameLoadCursors_dylibloader_wrapper_xcursor)(Display *, const char *);
extern Cursor (*XcursorLibraryLoadCursor_dylibloader_wrapper_xcursor)(Display *, const char *);
extern XcursorCursors *(*XcursorLibraryLoadCursors_dylibloader_wrapper_xcursor)(Display *, const char *);
extern XcursorImage *(*XcursorShapeLoadImage_dylibloader_wrapper_xcursor)(unsigned int, const char *, int);
extern XcursorImages *(*XcursorShapeLoadImages_dylibloader_wrapper_xcursor)(unsigned int, const char *, int);
extern Cursor (*XcursorShapeLoadCursor_dylibloader_wrapper_xcursor)(Display *, unsigned int);
extern XcursorCursors *(*XcursorShapeLoadCursors_dylibloader_wrapper_xcursor)(Display *, unsigned int);
extern Cursor (*XcursorTryShapeCursor_dylibloader_wrapper_xcursor)(Display *, Font, Font, unsigned int, unsigned int, const XColor *, const XColor *);
extern void (*XcursorNoticeCreateBitmap_dylibloader_wrapper_xcursor)(Display *, Pixmap, unsigned int, unsigned int);
extern void (*XcursorNoticePutBitmap_dylibloader_wrapper_xcursor)(Display *, Drawable, XImage *);
extern Cursor (*XcursorTryShapeBitmapCursor_dylibloader_wrapper_xcursor)(Display *, Pixmap, Pixmap, XColor *, XColor *, unsigned int, unsigned int);
extern void (*XcursorImageHash_dylibloader_wrapper_xcursor)(XImage *, unsigned char [16]);
extern XcursorBool (*XcursorSupportsARGB_dylibloader_wrapper_xcursor)(Display *);
extern XcursorBool (*XcursorSupportsAnim_dylibloader_wrapper_xcursor)(Display *);
extern XcursorBool (*XcursorSetDefaultSize_dylibloader_wrapper_xcursor)(Display *, int);
extern int (*XcursorGetDefaultSize_dylibloader_wrapper_xcursor)(Display *);
extern XcursorBool (*XcursorSetTheme_dylibloader_wrapper_xcursor)(Display *, const char *);
extern char *(*XcursorGetTheme_dylibloader_wrapper_xcursor)(Display *);
extern XcursorBool (*XcursorGetThemeCore_dylibloader_wrapper_xcursor)(Display *);
extern XcursorBool (*XcursorSetThemeCore_dylibloader_wrapper_xcursor)(Display *, XcursorBool);
int initialize_xcursor(int verbose);
#ifdef __cplusplus
}

View file

@ -1,19 +1,11 @@
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:11:29
// flags: generate-wrapper.py --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xext.h" --include ./thirdparty/linuxbsd_headers/X11/extensions/shape.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/shape.h" --soname libXext.so.6 --init-name xext --output-header ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:50:47
// flags: generate-wrapper.py --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xext.h --include ./thirdparty/linuxbsd_headers/X11/extensions/shape.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/shape.h --soname libXext.so.6 --init-name xext --output-header ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.c --ignore-other --implementation-header thirdparty/linuxbsd_headers/X11/Xlib.h
//
// NOTE: Generated from Xext 1.3.5.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, but absent in libXext.so.6, were removed and an include needed for
// proper parsing was added (this had also to be temporarily added to the
// original header, as dynload-wrapper would complain otherwise)
#include <stdint.h>
// HANDPATCH: Needed for a successful compilation.
#include "thirdparty/linuxbsd_headers/X11/Xlib.h"
#define XShapeQueryExtension XShapeQueryExtension_dylibloader_orig_xext
#define XShapeQueryVersion XShapeQueryVersion_dylibloader_orig_xext
#define XShapeCombineRegion XShapeCombineRegion_dylibloader_orig_xext
@ -40,17 +32,17 @@
#undef XShapeGetRectangles
#include <dlfcn.h>
#include <stdio.h>
int (*XShapeQueryExtension_dylibloader_wrapper_xext)( Display*, int*, int*);
int (*XShapeQueryVersion_dylibloader_wrapper_xext)( Display*, int*, int*);
void (*XShapeCombineRegion_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Region, int);
void (*XShapeCombineRectangles_dylibloader_wrapper_xext)( Display*, Window, int, int, int, XRectangle*, int, int, int);
void (*XShapeCombineMask_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Pixmap, int);
void (*XShapeCombineShape_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Window, int, int);
void (*XShapeOffsetShape_dylibloader_wrapper_xext)( Display*, Window, int, int, int);
int (*XShapeQueryExtents_dylibloader_wrapper_xext)( Display*, Window, int*, int*, int*, unsigned int*, unsigned int*, int*, int*, int*, unsigned int*, unsigned int*);
void (*XShapeSelectInput_dylibloader_wrapper_xext)( Display*, Window, unsigned long);
unsigned long (*XShapeInputSelected_dylibloader_wrapper_xext)( Display*, Window);
XRectangle* (*XShapeGetRectangles_dylibloader_wrapper_xext)( Display*, Window, int, int*, int*);
int (*XShapeQueryExtension_dylibloader_wrapper_xext)(Display *, int *, int *);
int (*XShapeQueryVersion_dylibloader_wrapper_xext)(Display *, int *, int *);
void (*XShapeCombineRegion_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Region, int);
void (*XShapeCombineRectangles_dylibloader_wrapper_xext)(Display *, Window, int, int, int, XRectangle *, int, int, int);
void (*XShapeCombineMask_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Pixmap, int);
void (*XShapeCombineShape_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Window, int, int);
void (*XShapeOffsetShape_dylibloader_wrapper_xext)(Display *, Window, int, int, int);
int (*XShapeQueryExtents_dylibloader_wrapper_xext)(Display *, Window, int *, int *, int *, unsigned int *, unsigned int *, int *, int *, int *, unsigned int *, unsigned int *);
void (*XShapeSelectInput_dylibloader_wrapper_xext)(Display *, Window, unsigned long);
unsigned long (*XShapeInputSelected_dylibloader_wrapper_xext)(Display *, Window);
XRectangle *(*XShapeGetRectangles_dylibloader_wrapper_xext)(Display *, Window, int, int *, int *);
int initialize_xext(int verbose) {
void *handle;
char *error;

View file

@ -2,20 +2,11 @@
#define DYLIBLOAD_WRAPPER_XEXT
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:11:29
// flags: generate-wrapper.py --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xext.h" --include ./thirdparty/linuxbsd_headers/X11/extensions/shape.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/shape.h" --soname libXext.so.6 --init-name xext --output-header ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:50:47
// flags: generate-wrapper.py --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xext.h --include ./thirdparty/linuxbsd_headers/X11/extensions/shape.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/shape.h --soname libXext.so.6 --init-name xext --output-header ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.c --ignore-other --implementation-header thirdparty/linuxbsd_headers/X11/Xlib.h
//
// NOTE: Generated from Xext 1.3.5.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, but absent in libXext.so.6, were removed and an include needed for
// proper parsing was added (this had also to be temporarily added to the
// original header, as dynload-wrapper would complain otherwise)
#include <stdint.h>
// HANDPATCH: Needed for a successful compilation.
#include "thirdparty/linuxbsd_headers/X11/Xlib.h"
#define XShapeQueryExtension XShapeQueryExtension_dylibloader_orig_xext
#define XShapeQueryVersion XShapeQueryVersion_dylibloader_orig_xext
#define XShapeCombineRegion XShapeCombineRegion_dylibloader_orig_xext
@ -54,17 +45,17 @@ extern "C" {
#define XShapeSelectInput XShapeSelectInput_dylibloader_wrapper_xext
#define XShapeInputSelected XShapeInputSelected_dylibloader_wrapper_xext
#define XShapeGetRectangles XShapeGetRectangles_dylibloader_wrapper_xext
extern int (*XShapeQueryExtension_dylibloader_wrapper_xext)( Display*, int*, int*);
extern int (*XShapeQueryVersion_dylibloader_wrapper_xext)( Display*, int*, int*);
extern void (*XShapeCombineRegion_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Region, int);
extern void (*XShapeCombineRectangles_dylibloader_wrapper_xext)( Display*, Window, int, int, int, XRectangle*, int, int, int);
extern void (*XShapeCombineMask_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Pixmap, int);
extern void (*XShapeCombineShape_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Window, int, int);
extern void (*XShapeOffsetShape_dylibloader_wrapper_xext)( Display*, Window, int, int, int);
extern int (*XShapeQueryExtents_dylibloader_wrapper_xext)( Display*, Window, int*, int*, int*, unsigned int*, unsigned int*, int*, int*, int*, unsigned int*, unsigned int*);
extern void (*XShapeSelectInput_dylibloader_wrapper_xext)( Display*, Window, unsigned long);
extern unsigned long (*XShapeInputSelected_dylibloader_wrapper_xext)( Display*, Window);
extern XRectangle* (*XShapeGetRectangles_dylibloader_wrapper_xext)( Display*, Window, int, int*, int*);
extern int (*XShapeQueryExtension_dylibloader_wrapper_xext)(Display *, int *, int *);
extern int (*XShapeQueryVersion_dylibloader_wrapper_xext)(Display *, int *, int *);
extern void (*XShapeCombineRegion_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Region, int);
extern void (*XShapeCombineRectangles_dylibloader_wrapper_xext)(Display *, Window, int, int, int, XRectangle *, int, int, int);
extern void (*XShapeCombineMask_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Pixmap, int);
extern void (*XShapeCombineShape_dylibloader_wrapper_xext)(Display *, Window, int, int, int, Window, int, int);
extern void (*XShapeOffsetShape_dylibloader_wrapper_xext)(Display *, Window, int, int, int);
extern int (*XShapeQueryExtents_dylibloader_wrapper_xext)(Display *, Window, int *, int *, int *, unsigned int *, unsigned int *, int *, int *, int *, unsigned int *, unsigned int *);
extern void (*XShapeSelectInput_dylibloader_wrapper_xext)(Display *, Window, unsigned long);
extern unsigned long (*XShapeInputSelected_dylibloader_wrapper_xext)(Display *, Window);
extern XRectangle *(*XShapeGetRectangles_dylibloader_wrapper_xext)(Display *, Window, int, int *, int *);
int initialize_xext(int verbose);
#ifdef __cplusplus
}

View file

@ -1,12 +1,8 @@
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:11:35
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xinerama.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xinerama.h" --soname libXinerama.so.1 --init-name xinerama --output-header ./platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:51:18
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xinerama.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xinerama.h --soname libXinerama.so.1 --init-name xinerama --output-header ./platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.c --ignore-other
//
// NOTE: Generated from Xinerama 1.1.4.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, but absent in libXinerama.so.1, were removed.
#include <stdint.h>
#define XineramaQueryExtension XineramaQueryExtension_dylibloader_orig_xinerama
@ -20,10 +16,10 @@
#undef XineramaQueryScreens
#include <dlfcn.h>
#include <stdio.h>
int (*XineramaQueryExtension_dylibloader_wrapper_xinerama)( Display*, int*, int*);
int (*XineramaQueryVersion_dylibloader_wrapper_xinerama)( Display*, int*, int*);
int (*XineramaIsActive_dylibloader_wrapper_xinerama)( Display*);
XineramaScreenInfo* (*XineramaQueryScreens_dylibloader_wrapper_xinerama)( Display*, int*);
int (*XineramaQueryExtension_dylibloader_wrapper_xinerama)(Display *, int *, int *);
int (*XineramaQueryVersion_dylibloader_wrapper_xinerama)(Display *, int *, int *);
int (*XineramaIsActive_dylibloader_wrapper_xinerama)(Display *);
XineramaScreenInfo *(*XineramaQueryScreens_dylibloader_wrapper_xinerama)(Display *, int *);
int initialize_xinerama(int verbose) {
void *handle;
char *error;

View file

@ -2,13 +2,9 @@
#define DYLIBLOAD_WRAPPER_XINERAMA
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:11:35
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xinerama.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xinerama.h" --soname libXinerama.so.1 --init-name xinerama --output-header ./platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:51:18
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xinerama.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xinerama.h --soname libXinerama.so.1 --init-name xinerama --output-header ./platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinerama-so_wrap.c --ignore-other
//
// NOTE: Generated from Xinerama 1.1.4.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, but absent in libXinerama.so.1, were removed.
#include <stdint.h>
#define XineramaQueryExtension XineramaQueryExtension_dylibloader_orig_xinerama
@ -27,10 +23,10 @@ extern "C" {
#define XineramaQueryVersion XineramaQueryVersion_dylibloader_wrapper_xinerama
#define XineramaIsActive XineramaIsActive_dylibloader_wrapper_xinerama
#define XineramaQueryScreens XineramaQueryScreens_dylibloader_wrapper_xinerama
extern int (*XineramaQueryExtension_dylibloader_wrapper_xinerama)( Display*, int*, int*);
extern int (*XineramaQueryVersion_dylibloader_wrapper_xinerama)( Display*, int*, int*);
extern int (*XineramaIsActive_dylibloader_wrapper_xinerama)( Display*);
extern XineramaScreenInfo* (*XineramaQueryScreens_dylibloader_wrapper_xinerama)( Display*, int*);
extern int (*XineramaQueryExtension_dylibloader_wrapper_xinerama)(Display *, int *, int *);
extern int (*XineramaQueryVersion_dylibloader_wrapper_xinerama)(Display *, int *, int *);
extern int (*XineramaIsActive_dylibloader_wrapper_xinerama)(Display *);
extern XineramaScreenInfo *(*XineramaQueryScreens_dylibloader_wrapper_xinerama)(Display *, int *);
int initialize_xinerama(int verbose);
#ifdef __cplusplus
}

View file

@ -1,12 +1,8 @@
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:12:16
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/XInput2.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/XInput2.h" --soname libXi.so.6 --init-name xinput2 --output-header ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:51:34
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/XInput2.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/XInput2.h --soname libXi.so.6 --init-name xinput2 --output-header ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.c --ignore-other
//
// NOTE: Generated from Xi 1.7.10.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, liXext and libXfixes, but absent in libXi.so.6, were removed.
#include <stdint.h>
#define XIQueryPointer XIQueryPointer_dylibloader_orig_xinput2
@ -80,40 +76,40 @@
#undef XIFreeDeviceInfo
#include <dlfcn.h>
#include <stdio.h>
int (*XIQueryPointer_dylibloader_wrapper_xinput2)( Display*, int, Window, Window*, Window*, double*, double*, double*, double*, XIButtonState*, XIModifierState*, XIGroupState*);
int (*XIWarpPointer_dylibloader_wrapper_xinput2)( Display*, int, Window, Window, double, double, unsigned int, unsigned int, double, double);
int (*XIDefineCursor_dylibloader_wrapper_xinput2)( Display*, int, Window, Cursor);
int (*XIUndefineCursor_dylibloader_wrapper_xinput2)( Display*, int, Window);
int (*XIChangeHierarchy_dylibloader_wrapper_xinput2)( Display*, XIAnyHierarchyChangeInfo*, int);
int (*XISetClientPointer_dylibloader_wrapper_xinput2)( Display*, Window, int);
int (*XIGetClientPointer_dylibloader_wrapper_xinput2)( Display*, Window, int*);
int (*XISelectEvents_dylibloader_wrapper_xinput2)( Display*, Window, XIEventMask*, int);
XIEventMask* (*XIGetSelectedEvents_dylibloader_wrapper_xinput2)( Display*, Window, int*);
int (*XIQueryVersion_dylibloader_wrapper_xinput2)( Display*, int*, int*);
XIDeviceInfo* (*XIQueryDevice_dylibloader_wrapper_xinput2)( Display*, int, int*);
int (*XISetFocus_dylibloader_wrapper_xinput2)( Display*, int, Window, Time);
int (*XIGetFocus_dylibloader_wrapper_xinput2)( Display*, int, Window*);
int (*XIGrabDevice_dylibloader_wrapper_xinput2)( Display*, int, Window, Time, Cursor, int, int, int, XIEventMask*);
int (*XIUngrabDevice_dylibloader_wrapper_xinput2)( Display*, int, Time);
int (*XIAllowEvents_dylibloader_wrapper_xinput2)( Display*, int, int, Time);
int (*XIAllowTouchEvents_dylibloader_wrapper_xinput2)( Display*, int, unsigned int, Window, int);
int (*XIGrabButton_dylibloader_wrapper_xinput2)( Display*, int, int, Window, Cursor, int, int, int, XIEventMask*, int, XIGrabModifiers*);
int (*XIGrabKeycode_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, int, int, XIEventMask*, int, XIGrabModifiers*);
int (*XIGrabEnter_dylibloader_wrapper_xinput2)( Display*, int, Window, Cursor, int, int, int, XIEventMask*, int, XIGrabModifiers*);
int (*XIGrabFocusIn_dylibloader_wrapper_xinput2)( Display*, int, Window, int, int, int, XIEventMask*, int, XIGrabModifiers*);
int (*XIGrabTouchBegin_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIEventMask*, int, XIGrabModifiers*);
int (*XIUngrabButton_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, XIGrabModifiers*);
int (*XIUngrabKeycode_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, XIGrabModifiers*);
int (*XIUngrabEnter_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
int (*XIUngrabFocusIn_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
int (*XIUngrabTouchBegin_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
Atom* (*XIListProperties_dylibloader_wrapper_xinput2)( Display*, int, int*);
void (*XIChangeProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom, Atom, int, int, unsigned char*, int);
void (*XIDeleteProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom);
int (*XIGetProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom, long, long, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
void (*XIBarrierReleasePointers_dylibloader_wrapper_xinput2)( Display*, XIBarrierReleasePointerInfo*, int);
void (*XIBarrierReleasePointer_dylibloader_wrapper_xinput2)( Display*, int, PointerBarrier, BarrierEventID);
void (*XIFreeDeviceInfo_dylibloader_wrapper_xinput2)( XIDeviceInfo*);
int (*XIQueryPointer_dylibloader_wrapper_xinput2)(Display *, int, Window, Window *, Window *, double *, double *, double *, double *, XIButtonState *, XIModifierState *, XIGroupState *);
int (*XIWarpPointer_dylibloader_wrapper_xinput2)(Display *, int, Window, Window, double, double, unsigned int, unsigned int, double, double);
int (*XIDefineCursor_dylibloader_wrapper_xinput2)(Display *, int, Window, Cursor);
int (*XIUndefineCursor_dylibloader_wrapper_xinput2)(Display *, int, Window);
int (*XIChangeHierarchy_dylibloader_wrapper_xinput2)(Display *, XIAnyHierarchyChangeInfo *, int);
int (*XISetClientPointer_dylibloader_wrapper_xinput2)(Display *, Window, int);
int (*XIGetClientPointer_dylibloader_wrapper_xinput2)(Display *, Window, int *);
int (*XISelectEvents_dylibloader_wrapper_xinput2)(Display *, Window, XIEventMask *, int);
XIEventMask *(*XIGetSelectedEvents_dylibloader_wrapper_xinput2)(Display *, Window, int *);
int (*XIQueryVersion_dylibloader_wrapper_xinput2)(Display *, int *, int *);
XIDeviceInfo *(*XIQueryDevice_dylibloader_wrapper_xinput2)(Display *, int, int *);
int (*XISetFocus_dylibloader_wrapper_xinput2)(Display *, int, Window, Time);
int (*XIGetFocus_dylibloader_wrapper_xinput2)(Display *, int, Window *);
int (*XIGrabDevice_dylibloader_wrapper_xinput2)(Display *, int, Window, Time, Cursor, int, int, int, XIEventMask *);
int (*XIUngrabDevice_dylibloader_wrapper_xinput2)(Display *, int, Time);
int (*XIAllowEvents_dylibloader_wrapper_xinput2)(Display *, int, int, Time);
int (*XIAllowTouchEvents_dylibloader_wrapper_xinput2)(Display *, int, unsigned int, Window, int);
int (*XIGrabButton_dylibloader_wrapper_xinput2)(Display *, int, int, Window, Cursor, int, int, int, XIEventMask *, int, XIGrabModifiers *);
int (*XIGrabKeycode_dylibloader_wrapper_xinput2)(Display *, int, int, Window, int, int, int, XIEventMask *, int, XIGrabModifiers *);
int (*XIGrabEnter_dylibloader_wrapper_xinput2)(Display *, int, Window, Cursor, int, int, int, XIEventMask *, int, XIGrabModifiers *);
int (*XIGrabFocusIn_dylibloader_wrapper_xinput2)(Display *, int, Window, int, int, int, XIEventMask *, int, XIGrabModifiers *);
int (*XIGrabTouchBegin_dylibloader_wrapper_xinput2)(Display *, int, Window, int, XIEventMask *, int, XIGrabModifiers *);
int (*XIUngrabButton_dylibloader_wrapper_xinput2)(Display *, int, int, Window, int, XIGrabModifiers *);
int (*XIUngrabKeycode_dylibloader_wrapper_xinput2)(Display *, int, int, Window, int, XIGrabModifiers *);
int (*XIUngrabEnter_dylibloader_wrapper_xinput2)(Display *, int, Window, int, XIGrabModifiers *);
int (*XIUngrabFocusIn_dylibloader_wrapper_xinput2)(Display *, int, Window, int, XIGrabModifiers *);
int (*XIUngrabTouchBegin_dylibloader_wrapper_xinput2)(Display *, int, Window, int, XIGrabModifiers *);
Atom *(*XIListProperties_dylibloader_wrapper_xinput2)(Display *, int, int *);
void (*XIChangeProperty_dylibloader_wrapper_xinput2)(Display *, int, Atom, Atom, int, int, unsigned char *, int);
void (*XIDeleteProperty_dylibloader_wrapper_xinput2)(Display *, int, Atom);
int (*XIGetProperty_dylibloader_wrapper_xinput2)(Display *, int, Atom, long, long, int, Atom, Atom *, int *, unsigned long *, unsigned long *, unsigned char **);
void (*XIBarrierReleasePointers_dylibloader_wrapper_xinput2)(Display *, XIBarrierReleasePointerInfo *, int);
void (*XIBarrierReleasePointer_dylibloader_wrapper_xinput2)(Display *, int, PointerBarrier, BarrierEventID);
void (*XIFreeDeviceInfo_dylibloader_wrapper_xinput2)(XIDeviceInfo *);
int initialize_xinput2(int verbose) {
void *handle;
char *error;

View file

@ -2,13 +2,9 @@
#define DYLIBLOAD_WRAPPER_XINPUT2
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:12:16
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/XInput2.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/XInput2.h" --soname libXi.so.6 --init-name xinput2 --output-header ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:51:34
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/XInput2.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/XInput2.h --soname libXi.so.6 --init-name xinput2 --output-header ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.c --ignore-other
//
// NOTE: Generated from Xi 1.7.10.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, liXext and libXfixes, but absent in libXi.so.6, were removed.
#include <stdint.h>
#define XIQueryPointer XIQueryPointer_dylibloader_orig_xinput2
@ -117,40 +113,40 @@ extern "C" {
#define XIBarrierReleasePointers XIBarrierReleasePointers_dylibloader_wrapper_xinput2
#define XIBarrierReleasePointer XIBarrierReleasePointer_dylibloader_wrapper_xinput2
#define XIFreeDeviceInfo XIFreeDeviceInfo_dylibloader_wrapper_xinput2
extern int (*XIQueryPointer_dylibloader_wrapper_xinput2)( Display*, int, Window, Window*, Window*, double*, double*, double*, double*, XIButtonState*, XIModifierState*, XIGroupState*);
extern int (*XIWarpPointer_dylibloader_wrapper_xinput2)( Display*, int, Window, Window, double, double, unsigned int, unsigned int, double, double);
extern int (*XIDefineCursor_dylibloader_wrapper_xinput2)( Display*, int, Window, Cursor);
extern int (*XIUndefineCursor_dylibloader_wrapper_xinput2)( Display*, int, Window);
extern int (*XIChangeHierarchy_dylibloader_wrapper_xinput2)( Display*, XIAnyHierarchyChangeInfo*, int);
extern int (*XISetClientPointer_dylibloader_wrapper_xinput2)( Display*, Window, int);
extern int (*XIGetClientPointer_dylibloader_wrapper_xinput2)( Display*, Window, int*);
extern int (*XISelectEvents_dylibloader_wrapper_xinput2)( Display*, Window, XIEventMask*, int);
extern XIEventMask* (*XIGetSelectedEvents_dylibloader_wrapper_xinput2)( Display*, Window, int*);
extern int (*XIQueryVersion_dylibloader_wrapper_xinput2)( Display*, int*, int*);
extern XIDeviceInfo* (*XIQueryDevice_dylibloader_wrapper_xinput2)( Display*, int, int*);
extern int (*XISetFocus_dylibloader_wrapper_xinput2)( Display*, int, Window, Time);
extern int (*XIGetFocus_dylibloader_wrapper_xinput2)( Display*, int, Window*);
extern int (*XIGrabDevice_dylibloader_wrapper_xinput2)( Display*, int, Window, Time, Cursor, int, int, int, XIEventMask*);
extern int (*XIUngrabDevice_dylibloader_wrapper_xinput2)( Display*, int, Time);
extern int (*XIAllowEvents_dylibloader_wrapper_xinput2)( Display*, int, int, Time);
extern int (*XIAllowTouchEvents_dylibloader_wrapper_xinput2)( Display*, int, unsigned int, Window, int);
extern int (*XIGrabButton_dylibloader_wrapper_xinput2)( Display*, int, int, Window, Cursor, int, int, int, XIEventMask*, int, XIGrabModifiers*);
extern int (*XIGrabKeycode_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, int, int, XIEventMask*, int, XIGrabModifiers*);
extern int (*XIGrabEnter_dylibloader_wrapper_xinput2)( Display*, int, Window, Cursor, int, int, int, XIEventMask*, int, XIGrabModifiers*);
extern int (*XIGrabFocusIn_dylibloader_wrapper_xinput2)( Display*, int, Window, int, int, int, XIEventMask*, int, XIGrabModifiers*);
extern int (*XIGrabTouchBegin_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIEventMask*, int, XIGrabModifiers*);
extern int (*XIUngrabButton_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, XIGrabModifiers*);
extern int (*XIUngrabKeycode_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, XIGrabModifiers*);
extern int (*XIUngrabEnter_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
extern int (*XIUngrabFocusIn_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
extern int (*XIUngrabTouchBegin_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
extern Atom* (*XIListProperties_dylibloader_wrapper_xinput2)( Display*, int, int*);
extern void (*XIChangeProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom, Atom, int, int, unsigned char*, int);
extern void (*XIDeleteProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom);
extern int (*XIGetProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom, long, long, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
extern void (*XIBarrierReleasePointers_dylibloader_wrapper_xinput2)( Display*, XIBarrierReleasePointerInfo*, int);
extern void (*XIBarrierReleasePointer_dylibloader_wrapper_xinput2)( Display*, int, PointerBarrier, BarrierEventID);
extern void (*XIFreeDeviceInfo_dylibloader_wrapper_xinput2)( XIDeviceInfo*);
extern int (*XIQueryPointer_dylibloader_wrapper_xinput2)(Display *, int, Window, Window *, Window *, double *, double *, double *, double *, XIButtonState *, XIModifierState *, XIGroupState *);
extern int (*XIWarpPointer_dylibloader_wrapper_xinput2)(Display *, int, Window, Window, double, double, unsigned int, unsigned int, double, double);
extern int (*XIDefineCursor_dylibloader_wrapper_xinput2)(Display *, int, Window, Cursor);
extern int (*XIUndefineCursor_dylibloader_wrapper_xinput2)(Display *, int, Window);
extern int (*XIChangeHierarchy_dylibloader_wrapper_xinput2)(Display *, XIAnyHierarchyChangeInfo *, int);
extern int (*XISetClientPointer_dylibloader_wrapper_xinput2)(Display *, Window, int);
extern int (*XIGetClientPointer_dylibloader_wrapper_xinput2)(Display *, Window, int *);
extern int (*XISelectEvents_dylibloader_wrapper_xinput2)(Display *, Window, XIEventMask *, int);
extern XIEventMask *(*XIGetSelectedEvents_dylibloader_wrapper_xinput2)(Display *, Window, int *);
extern int (*XIQueryVersion_dylibloader_wrapper_xinput2)(Display *, int *, int *);
extern XIDeviceInfo *(*XIQueryDevice_dylibloader_wrapper_xinput2)(Display *, int, int *);
extern int (*XISetFocus_dylibloader_wrapper_xinput2)(Display *, int, Window, Time);
extern int (*XIGetFocus_dylibloader_wrapper_xinput2)(Display *, int, Window *);
extern int (*XIGrabDevice_dylibloader_wrapper_xinput2)(Display *, int, Window, Time, Cursor, int, int, int, XIEventMask *);
extern int (*XIUngrabDevice_dylibloader_wrapper_xinput2)(Display *, int, Time);
extern int (*XIAllowEvents_dylibloader_wrapper_xinput2)(Display *, int, int, Time);
extern int (*XIAllowTouchEvents_dylibloader_wrapper_xinput2)(Display *, int, unsigned int, Window, int);
extern int (*XIGrabButton_dylibloader_wrapper_xinput2)(Display *, int, int, Window, Cursor, int, int, int, XIEventMask *, int, XIGrabModifiers *);
extern int (*XIGrabKeycode_dylibloader_wrapper_xinput2)(Display *, int, int, Window, int, int, int, XIEventMask *, int, XIGrabModifiers *);
extern int (*XIGrabEnter_dylibloader_wrapper_xinput2)(Display *, int, Window, Cursor, int, int, int, XIEventMask *, int, XIGrabModifiers *);
extern int (*XIGrabFocusIn_dylibloader_wrapper_xinput2)(Display *, int, Window, int, int, int, XIEventMask *, int, XIGrabModifiers *);
extern int (*XIGrabTouchBegin_dylibloader_wrapper_xinput2)(Display *, int, Window, int, XIEventMask *, int, XIGrabModifiers *);
extern int (*XIUngrabButton_dylibloader_wrapper_xinput2)(Display *, int, int, Window, int, XIGrabModifiers *);
extern int (*XIUngrabKeycode_dylibloader_wrapper_xinput2)(Display *, int, int, Window, int, XIGrabModifiers *);
extern int (*XIUngrabEnter_dylibloader_wrapper_xinput2)(Display *, int, Window, int, XIGrabModifiers *);
extern int (*XIUngrabFocusIn_dylibloader_wrapper_xinput2)(Display *, int, Window, int, XIGrabModifiers *);
extern int (*XIUngrabTouchBegin_dylibloader_wrapper_xinput2)(Display *, int, Window, int, XIGrabModifiers *);
extern Atom *(*XIListProperties_dylibloader_wrapper_xinput2)(Display *, int, int *);
extern void (*XIChangeProperty_dylibloader_wrapper_xinput2)(Display *, int, Atom, Atom, int, int, unsigned char *, int);
extern void (*XIDeleteProperty_dylibloader_wrapper_xinput2)(Display *, int, Atom);
extern int (*XIGetProperty_dylibloader_wrapper_xinput2)(Display *, int, Atom, long, long, int, Atom, Atom *, int *, unsigned long *, unsigned long *, unsigned char **);
extern void (*XIBarrierReleasePointers_dylibloader_wrapper_xinput2)(Display *, XIBarrierReleasePointerInfo *, int);
extern void (*XIBarrierReleasePointer_dylibloader_wrapper_xinput2)(Display *, int, PointerBarrier, BarrierEventID);
extern void (*XIFreeDeviceInfo_dylibloader_wrapper_xinput2)(XIDeviceInfo *);
int initialize_xinput2(int verbose);
#ifdef __cplusplus
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,8 @@
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:13:54
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xrandr.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xrandr.h" --soname libXrandr.so.2 --init-name xrandr --output-header ./platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:51:53
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xrandr.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xrandr.h --soname libXrandr.so.2 --init-name xrandr --output-header ./platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.c --ignore-other
//
// NOTE: Generated from Xrandr 1.5.2.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11 and libXrender, but absent in libXrandr.so.2, were removed.
#include <stdint.h>
#define XRRQueryExtension XRRQueryExtension_dylibloader_orig_xrandr
@ -152,76 +148,76 @@
#undef XRRFreeMonitors
#include <dlfcn.h>
#include <stdio.h>
int (*XRRQueryExtension_dylibloader_wrapper_xrandr)( Display*, int*, int*);
int (*XRRQueryVersion_dylibloader_wrapper_xrandr)( Display*, int*, int*);
XRRScreenConfiguration* (*XRRGetScreenInfo_dylibloader_wrapper_xrandr)( Display*, Window);
void (*XRRFreeScreenConfigInfo_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*);
int (*XRRSetScreenConfig_dylibloader_wrapper_xrandr)( Display*, XRRScreenConfiguration*, Drawable, int, Rotation, Time);
int (*XRRSetScreenConfigAndRate_dylibloader_wrapper_xrandr)( Display*, XRRScreenConfiguration*, Drawable, int, Rotation, short, Time);
Rotation (*XRRConfigRotations_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, Rotation*);
Time (*XRRConfigTimes_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, Time*);
XRRScreenSize* (*XRRConfigSizes_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, int*);
short* (*XRRConfigRates_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, int, int*);
SizeID (*XRRConfigCurrentConfiguration_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, Rotation*);
short (*XRRConfigCurrentRate_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*);
int (*XRRRootToScreen_dylibloader_wrapper_xrandr)( Display*, Window);
void (*XRRSelectInput_dylibloader_wrapper_xrandr)( Display*, Window, int);
Rotation (*XRRRotations_dylibloader_wrapper_xrandr)( Display*, int, Rotation*);
XRRScreenSize* (*XRRSizes_dylibloader_wrapper_xrandr)( Display*, int, int*);
short* (*XRRRates_dylibloader_wrapper_xrandr)( Display*, int, int, int*);
Time (*XRRTimes_dylibloader_wrapper_xrandr)( Display*, int, Time*);
int (*XRRGetScreenSizeRange_dylibloader_wrapper_xrandr)( Display*, Window, int*, int*, int*, int*);
void (*XRRSetScreenSize_dylibloader_wrapper_xrandr)( Display*, Window, int, int, int, int);
XRRScreenResources* (*XRRGetScreenResources_dylibloader_wrapper_xrandr)( Display*, Window);
void (*XRRFreeScreenResources_dylibloader_wrapper_xrandr)( XRRScreenResources*);
XRROutputInfo* (*XRRGetOutputInfo_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RROutput);
void (*XRRFreeOutputInfo_dylibloader_wrapper_xrandr)( XRROutputInfo*);
Atom* (*XRRListOutputProperties_dylibloader_wrapper_xrandr)( Display*, RROutput, int*);
XRRPropertyInfo* (*XRRQueryOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom);
void (*XRRConfigureOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom, int, int, int, long*);
void (*XRRChangeOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom, Atom, int, int,const unsigned char*, int);
void (*XRRDeleteOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom);
int (*XRRGetOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom, long, long, int, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
XRRModeInfo* (*XRRAllocModeInfo_dylibloader_wrapper_xrandr)(const char*, int);
RRMode (*XRRCreateMode_dylibloader_wrapper_xrandr)( Display*, Window, XRRModeInfo*);
void (*XRRDestroyMode_dylibloader_wrapper_xrandr)( Display*, RRMode);
void (*XRRAddOutputMode_dylibloader_wrapper_xrandr)( Display*, RROutput, RRMode);
void (*XRRDeleteOutputMode_dylibloader_wrapper_xrandr)( Display*, RROutput, RRMode);
void (*XRRFreeModeInfo_dylibloader_wrapper_xrandr)( XRRModeInfo*);
XRRCrtcInfo* (*XRRGetCrtcInfo_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRCrtc);
void (*XRRFreeCrtcInfo_dylibloader_wrapper_xrandr)( XRRCrtcInfo*);
int (*XRRSetCrtcConfig_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRCrtc, Time, int, int, RRMode, Rotation, RROutput*, int);
int (*XRRGetCrtcGammaSize_dylibloader_wrapper_xrandr)( Display*, RRCrtc);
XRRCrtcGamma* (*XRRGetCrtcGamma_dylibloader_wrapper_xrandr)( Display*, RRCrtc);
XRRCrtcGamma* (*XRRAllocGamma_dylibloader_wrapper_xrandr)( int);
void (*XRRSetCrtcGamma_dylibloader_wrapper_xrandr)( Display*, RRCrtc, XRRCrtcGamma*);
void (*XRRFreeGamma_dylibloader_wrapper_xrandr)( XRRCrtcGamma*);
XRRScreenResources* (*XRRGetScreenResourcesCurrent_dylibloader_wrapper_xrandr)( Display*, Window);
void (*XRRSetCrtcTransform_dylibloader_wrapper_xrandr)( Display*, RRCrtc, XTransform*,const char*, XFixed*, int);
int (*XRRGetCrtcTransform_dylibloader_wrapper_xrandr)( Display*, RRCrtc, XRRCrtcTransformAttributes**);
int (*XRRUpdateConfiguration_dylibloader_wrapper_xrandr)( XEvent*);
XRRPanning* (*XRRGetPanning_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRCrtc);
void (*XRRFreePanning_dylibloader_wrapper_xrandr)( XRRPanning*);
int (*XRRSetPanning_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRCrtc, XRRPanning*);
void (*XRRSetOutputPrimary_dylibloader_wrapper_xrandr)( Display*, Window, RROutput);
RROutput (*XRRGetOutputPrimary_dylibloader_wrapper_xrandr)( Display*, Window);
XRRProviderResources* (*XRRGetProviderResources_dylibloader_wrapper_xrandr)( Display*, Window);
void (*XRRFreeProviderResources_dylibloader_wrapper_xrandr)( XRRProviderResources*);
XRRProviderInfo* (*XRRGetProviderInfo_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRProvider);
void (*XRRFreeProviderInfo_dylibloader_wrapper_xrandr)( XRRProviderInfo*);
int (*XRRSetProviderOutputSource_dylibloader_wrapper_xrandr)( Display*, XID, XID);
int (*XRRSetProviderOffloadSink_dylibloader_wrapper_xrandr)( Display*, XID, XID);
Atom* (*XRRListProviderProperties_dylibloader_wrapper_xrandr)( Display*, RRProvider, int*);
XRRPropertyInfo* (*XRRQueryProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom);
void (*XRRConfigureProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom, int, int, int, long*);
void (*XRRChangeProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom, Atom, int, int,const unsigned char*, int);
void (*XRRDeleteProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom);
int (*XRRGetProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom, long, long, int, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
XRRMonitorInfo* (*XRRAllocateMonitor_dylibloader_wrapper_xrandr)( Display*, int);
XRRMonitorInfo* (*XRRGetMonitors_dylibloader_wrapper_xrandr)( Display*, Window, int, int*);
void (*XRRSetMonitor_dylibloader_wrapper_xrandr)( Display*, Window, XRRMonitorInfo*);
void (*XRRDeleteMonitor_dylibloader_wrapper_xrandr)( Display*, Window, Atom);
void (*XRRFreeMonitors_dylibloader_wrapper_xrandr)( XRRMonitorInfo*);
int (*XRRQueryExtension_dylibloader_wrapper_xrandr)(Display *, int *, int *);
int (*XRRQueryVersion_dylibloader_wrapper_xrandr)(Display *, int *, int *);
XRRScreenConfiguration *(*XRRGetScreenInfo_dylibloader_wrapper_xrandr)(Display *, Window);
void (*XRRFreeScreenConfigInfo_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *);
int (*XRRSetScreenConfig_dylibloader_wrapper_xrandr)(Display *, XRRScreenConfiguration *, Drawable, int, Rotation, Time);
int (*XRRSetScreenConfigAndRate_dylibloader_wrapper_xrandr)(Display *, XRRScreenConfiguration *, Drawable, int, Rotation, short, Time);
Rotation (*XRRConfigRotations_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, Rotation *);
Time (*XRRConfigTimes_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, Time *);
XRRScreenSize *(*XRRConfigSizes_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, int *);
short *(*XRRConfigRates_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, int, int *);
SizeID (*XRRConfigCurrentConfiguration_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, Rotation *);
short (*XRRConfigCurrentRate_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *);
int (*XRRRootToScreen_dylibloader_wrapper_xrandr)(Display *, Window);
void (*XRRSelectInput_dylibloader_wrapper_xrandr)(Display *, Window, int);
Rotation (*XRRRotations_dylibloader_wrapper_xrandr)(Display *, int, Rotation *);
XRRScreenSize *(*XRRSizes_dylibloader_wrapper_xrandr)(Display *, int, int *);
short *(*XRRRates_dylibloader_wrapper_xrandr)(Display *, int, int, int *);
Time (*XRRTimes_dylibloader_wrapper_xrandr)(Display *, int, Time *);
int (*XRRGetScreenSizeRange_dylibloader_wrapper_xrandr)(Display *, Window, int *, int *, int *, int *);
void (*XRRSetScreenSize_dylibloader_wrapper_xrandr)(Display *, Window, int, int, int, int);
XRRScreenResources *(*XRRGetScreenResources_dylibloader_wrapper_xrandr)(Display *, Window);
void (*XRRFreeScreenResources_dylibloader_wrapper_xrandr)(XRRScreenResources *);
XRROutputInfo *(*XRRGetOutputInfo_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RROutput);
void (*XRRFreeOutputInfo_dylibloader_wrapper_xrandr)(XRROutputInfo *);
Atom *(*XRRListOutputProperties_dylibloader_wrapper_xrandr)(Display *, RROutput, int *);
XRRPropertyInfo *(*XRRQueryOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom);
void (*XRRConfigureOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom, int, int, int, long *);
void (*XRRChangeOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom, Atom, int, int, const unsigned char *, int);
void (*XRRDeleteOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom);
int (*XRRGetOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom, long, long, int, int, Atom, Atom *, int *, unsigned long *, unsigned long *, unsigned char **);
XRRModeInfo *(*XRRAllocModeInfo_dylibloader_wrapper_xrandr)(const char *, int);
RRMode (*XRRCreateMode_dylibloader_wrapper_xrandr)(Display *, Window, XRRModeInfo *);
void (*XRRDestroyMode_dylibloader_wrapper_xrandr)(Display *, RRMode);
void (*XRRAddOutputMode_dylibloader_wrapper_xrandr)(Display *, RROutput, RRMode);
void (*XRRDeleteOutputMode_dylibloader_wrapper_xrandr)(Display *, RROutput, RRMode);
void (*XRRFreeModeInfo_dylibloader_wrapper_xrandr)(XRRModeInfo *);
XRRCrtcInfo *(*XRRGetCrtcInfo_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRCrtc);
void (*XRRFreeCrtcInfo_dylibloader_wrapper_xrandr)(XRRCrtcInfo *);
int (*XRRSetCrtcConfig_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRCrtc, Time, int, int, RRMode, Rotation, RROutput *, int);
int (*XRRGetCrtcGammaSize_dylibloader_wrapper_xrandr)(Display *, RRCrtc);
XRRCrtcGamma *(*XRRGetCrtcGamma_dylibloader_wrapper_xrandr)(Display *, RRCrtc);
XRRCrtcGamma *(*XRRAllocGamma_dylibloader_wrapper_xrandr)(int);
void (*XRRSetCrtcGamma_dylibloader_wrapper_xrandr)(Display *, RRCrtc, XRRCrtcGamma *);
void (*XRRFreeGamma_dylibloader_wrapper_xrandr)(XRRCrtcGamma *);
XRRScreenResources *(*XRRGetScreenResourcesCurrent_dylibloader_wrapper_xrandr)(Display *, Window);
void (*XRRSetCrtcTransform_dylibloader_wrapper_xrandr)(Display *, RRCrtc, XTransform *, const char *, XFixed *, int);
int (*XRRGetCrtcTransform_dylibloader_wrapper_xrandr)(Display *, RRCrtc, XRRCrtcTransformAttributes **);
int (*XRRUpdateConfiguration_dylibloader_wrapper_xrandr)(XEvent *);
XRRPanning *(*XRRGetPanning_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRCrtc);
void (*XRRFreePanning_dylibloader_wrapper_xrandr)(XRRPanning *);
int (*XRRSetPanning_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRCrtc, XRRPanning *);
void (*XRRSetOutputPrimary_dylibloader_wrapper_xrandr)(Display *, Window, RROutput);
RROutput (*XRRGetOutputPrimary_dylibloader_wrapper_xrandr)(Display *, Window);
XRRProviderResources *(*XRRGetProviderResources_dylibloader_wrapper_xrandr)(Display *, Window);
void (*XRRFreeProviderResources_dylibloader_wrapper_xrandr)(XRRProviderResources *);
XRRProviderInfo *(*XRRGetProviderInfo_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRProvider);
void (*XRRFreeProviderInfo_dylibloader_wrapper_xrandr)(XRRProviderInfo *);
int (*XRRSetProviderOutputSource_dylibloader_wrapper_xrandr)(Display *, XID, XID);
int (*XRRSetProviderOffloadSink_dylibloader_wrapper_xrandr)(Display *, XID, XID);
Atom *(*XRRListProviderProperties_dylibloader_wrapper_xrandr)(Display *, RRProvider, int *);
XRRPropertyInfo *(*XRRQueryProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom);
void (*XRRConfigureProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom, int, int, int, long *);
void (*XRRChangeProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom, Atom, int, int, const unsigned char *, int);
void (*XRRDeleteProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom);
int (*XRRGetProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom, long, long, int, int, Atom, Atom *, int *, unsigned long *, unsigned long *, unsigned char **);
XRRMonitorInfo *(*XRRAllocateMonitor_dylibloader_wrapper_xrandr)(Display *, int);
XRRMonitorInfo *(*XRRGetMonitors_dylibloader_wrapper_xrandr)(Display *, Window, int, int *);
void (*XRRSetMonitor_dylibloader_wrapper_xrandr)(Display *, Window, XRRMonitorInfo *);
void (*XRRDeleteMonitor_dylibloader_wrapper_xrandr)(Display *, Window, Atom);
void (*XRRFreeMonitors_dylibloader_wrapper_xrandr)(XRRMonitorInfo *);
int initialize_xrandr(int verbose) {
void *handle;
char *error;

View file

@ -2,13 +2,9 @@
#define DYLIBLOAD_WRAPPER_XRANDR
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:13:54
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xrandr.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xrandr.h" --soname libXrandr.so.2 --init-name xrandr --output-header ./platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.c
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:51:53
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xrandr.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xrandr.h --soname libXrandr.so.2 --init-name xrandr --output-header ./platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xrandr-so_wrap.c --ignore-other
//
// NOTE: Generated from Xrandr 1.5.2.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11 and libXrender, but absent in libXrandr.so.2, were removed.
#include <stdint.h>
#define XRRQueryExtension XRRQueryExtension_dylibloader_orig_xrandr
@ -225,76 +221,76 @@ extern "C" {
#define XRRSetMonitor XRRSetMonitor_dylibloader_wrapper_xrandr
#define XRRDeleteMonitor XRRDeleteMonitor_dylibloader_wrapper_xrandr
#define XRRFreeMonitors XRRFreeMonitors_dylibloader_wrapper_xrandr
extern int (*XRRQueryExtension_dylibloader_wrapper_xrandr)( Display*, int*, int*);
extern int (*XRRQueryVersion_dylibloader_wrapper_xrandr)( Display*, int*, int*);
extern XRRScreenConfiguration* (*XRRGetScreenInfo_dylibloader_wrapper_xrandr)( Display*, Window);
extern void (*XRRFreeScreenConfigInfo_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*);
extern int (*XRRSetScreenConfig_dylibloader_wrapper_xrandr)( Display*, XRRScreenConfiguration*, Drawable, int, Rotation, Time);
extern int (*XRRSetScreenConfigAndRate_dylibloader_wrapper_xrandr)( Display*, XRRScreenConfiguration*, Drawable, int, Rotation, short, Time);
extern Rotation (*XRRConfigRotations_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, Rotation*);
extern Time (*XRRConfigTimes_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, Time*);
extern XRRScreenSize* (*XRRConfigSizes_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, int*);
extern short* (*XRRConfigRates_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, int, int*);
extern SizeID (*XRRConfigCurrentConfiguration_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*, Rotation*);
extern short (*XRRConfigCurrentRate_dylibloader_wrapper_xrandr)( XRRScreenConfiguration*);
extern int (*XRRRootToScreen_dylibloader_wrapper_xrandr)( Display*, Window);
extern void (*XRRSelectInput_dylibloader_wrapper_xrandr)( Display*, Window, int);
extern Rotation (*XRRRotations_dylibloader_wrapper_xrandr)( Display*, int, Rotation*);
extern XRRScreenSize* (*XRRSizes_dylibloader_wrapper_xrandr)( Display*, int, int*);
extern short* (*XRRRates_dylibloader_wrapper_xrandr)( Display*, int, int, int*);
extern Time (*XRRTimes_dylibloader_wrapper_xrandr)( Display*, int, Time*);
extern int (*XRRGetScreenSizeRange_dylibloader_wrapper_xrandr)( Display*, Window, int*, int*, int*, int*);
extern void (*XRRSetScreenSize_dylibloader_wrapper_xrandr)( Display*, Window, int, int, int, int);
extern XRRScreenResources* (*XRRGetScreenResources_dylibloader_wrapper_xrandr)( Display*, Window);
extern void (*XRRFreeScreenResources_dylibloader_wrapper_xrandr)( XRRScreenResources*);
extern XRROutputInfo* (*XRRGetOutputInfo_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RROutput);
extern void (*XRRFreeOutputInfo_dylibloader_wrapper_xrandr)( XRROutputInfo*);
extern Atom* (*XRRListOutputProperties_dylibloader_wrapper_xrandr)( Display*, RROutput, int*);
extern XRRPropertyInfo* (*XRRQueryOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom);
extern void (*XRRConfigureOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom, int, int, int, long*);
extern void (*XRRChangeOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom, Atom, int, int,const unsigned char*, int);
extern void (*XRRDeleteOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom);
extern int (*XRRGetOutputProperty_dylibloader_wrapper_xrandr)( Display*, RROutput, Atom, long, long, int, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
extern XRRModeInfo* (*XRRAllocModeInfo_dylibloader_wrapper_xrandr)(const char*, int);
extern RRMode (*XRRCreateMode_dylibloader_wrapper_xrandr)( Display*, Window, XRRModeInfo*);
extern void (*XRRDestroyMode_dylibloader_wrapper_xrandr)( Display*, RRMode);
extern void (*XRRAddOutputMode_dylibloader_wrapper_xrandr)( Display*, RROutput, RRMode);
extern void (*XRRDeleteOutputMode_dylibloader_wrapper_xrandr)( Display*, RROutput, RRMode);
extern void (*XRRFreeModeInfo_dylibloader_wrapper_xrandr)( XRRModeInfo*);
extern XRRCrtcInfo* (*XRRGetCrtcInfo_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRCrtc);
extern void (*XRRFreeCrtcInfo_dylibloader_wrapper_xrandr)( XRRCrtcInfo*);
extern int (*XRRSetCrtcConfig_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRCrtc, Time, int, int, RRMode, Rotation, RROutput*, int);
extern int (*XRRGetCrtcGammaSize_dylibloader_wrapper_xrandr)( Display*, RRCrtc);
extern XRRCrtcGamma* (*XRRGetCrtcGamma_dylibloader_wrapper_xrandr)( Display*, RRCrtc);
extern XRRCrtcGamma* (*XRRAllocGamma_dylibloader_wrapper_xrandr)( int);
extern void (*XRRSetCrtcGamma_dylibloader_wrapper_xrandr)( Display*, RRCrtc, XRRCrtcGamma*);
extern void (*XRRFreeGamma_dylibloader_wrapper_xrandr)( XRRCrtcGamma*);
extern XRRScreenResources* (*XRRGetScreenResourcesCurrent_dylibloader_wrapper_xrandr)( Display*, Window);
extern void (*XRRSetCrtcTransform_dylibloader_wrapper_xrandr)( Display*, RRCrtc, XTransform*,const char*, XFixed*, int);
extern int (*XRRGetCrtcTransform_dylibloader_wrapper_xrandr)( Display*, RRCrtc, XRRCrtcTransformAttributes**);
extern int (*XRRUpdateConfiguration_dylibloader_wrapper_xrandr)( XEvent*);
extern XRRPanning* (*XRRGetPanning_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRCrtc);
extern void (*XRRFreePanning_dylibloader_wrapper_xrandr)( XRRPanning*);
extern int (*XRRSetPanning_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRCrtc, XRRPanning*);
extern void (*XRRSetOutputPrimary_dylibloader_wrapper_xrandr)( Display*, Window, RROutput);
extern RROutput (*XRRGetOutputPrimary_dylibloader_wrapper_xrandr)( Display*, Window);
extern XRRProviderResources* (*XRRGetProviderResources_dylibloader_wrapper_xrandr)( Display*, Window);
extern void (*XRRFreeProviderResources_dylibloader_wrapper_xrandr)( XRRProviderResources*);
extern XRRProviderInfo* (*XRRGetProviderInfo_dylibloader_wrapper_xrandr)( Display*, XRRScreenResources*, RRProvider);
extern void (*XRRFreeProviderInfo_dylibloader_wrapper_xrandr)( XRRProviderInfo*);
extern int (*XRRSetProviderOutputSource_dylibloader_wrapper_xrandr)( Display*, XID, XID);
extern int (*XRRSetProviderOffloadSink_dylibloader_wrapper_xrandr)( Display*, XID, XID);
extern Atom* (*XRRListProviderProperties_dylibloader_wrapper_xrandr)( Display*, RRProvider, int*);
extern XRRPropertyInfo* (*XRRQueryProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom);
extern void (*XRRConfigureProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom, int, int, int, long*);
extern void (*XRRChangeProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom, Atom, int, int,const unsigned char*, int);
extern void (*XRRDeleteProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom);
extern int (*XRRGetProviderProperty_dylibloader_wrapper_xrandr)( Display*, RRProvider, Atom, long, long, int, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
extern XRRMonitorInfo* (*XRRAllocateMonitor_dylibloader_wrapper_xrandr)( Display*, int);
extern XRRMonitorInfo* (*XRRGetMonitors_dylibloader_wrapper_xrandr)( Display*, Window, int, int*);
extern void (*XRRSetMonitor_dylibloader_wrapper_xrandr)( Display*, Window, XRRMonitorInfo*);
extern void (*XRRDeleteMonitor_dylibloader_wrapper_xrandr)( Display*, Window, Atom);
extern void (*XRRFreeMonitors_dylibloader_wrapper_xrandr)( XRRMonitorInfo*);
extern int (*XRRQueryExtension_dylibloader_wrapper_xrandr)(Display *, int *, int *);
extern int (*XRRQueryVersion_dylibloader_wrapper_xrandr)(Display *, int *, int *);
extern XRRScreenConfiguration *(*XRRGetScreenInfo_dylibloader_wrapper_xrandr)(Display *, Window);
extern void (*XRRFreeScreenConfigInfo_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *);
extern int (*XRRSetScreenConfig_dylibloader_wrapper_xrandr)(Display *, XRRScreenConfiguration *, Drawable, int, Rotation, Time);
extern int (*XRRSetScreenConfigAndRate_dylibloader_wrapper_xrandr)(Display *, XRRScreenConfiguration *, Drawable, int, Rotation, short, Time);
extern Rotation (*XRRConfigRotations_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, Rotation *);
extern Time (*XRRConfigTimes_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, Time *);
extern XRRScreenSize *(*XRRConfigSizes_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, int *);
extern short *(*XRRConfigRates_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, int, int *);
extern SizeID (*XRRConfigCurrentConfiguration_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *, Rotation *);
extern short (*XRRConfigCurrentRate_dylibloader_wrapper_xrandr)(XRRScreenConfiguration *);
extern int (*XRRRootToScreen_dylibloader_wrapper_xrandr)(Display *, Window);
extern void (*XRRSelectInput_dylibloader_wrapper_xrandr)(Display *, Window, int);
extern Rotation (*XRRRotations_dylibloader_wrapper_xrandr)(Display *, int, Rotation *);
extern XRRScreenSize *(*XRRSizes_dylibloader_wrapper_xrandr)(Display *, int, int *);
extern short *(*XRRRates_dylibloader_wrapper_xrandr)(Display *, int, int, int *);
extern Time (*XRRTimes_dylibloader_wrapper_xrandr)(Display *, int, Time *);
extern int (*XRRGetScreenSizeRange_dylibloader_wrapper_xrandr)(Display *, Window, int *, int *, int *, int *);
extern void (*XRRSetScreenSize_dylibloader_wrapper_xrandr)(Display *, Window, int, int, int, int);
extern XRRScreenResources *(*XRRGetScreenResources_dylibloader_wrapper_xrandr)(Display *, Window);
extern void (*XRRFreeScreenResources_dylibloader_wrapper_xrandr)(XRRScreenResources *);
extern XRROutputInfo *(*XRRGetOutputInfo_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RROutput);
extern void (*XRRFreeOutputInfo_dylibloader_wrapper_xrandr)(XRROutputInfo *);
extern Atom *(*XRRListOutputProperties_dylibloader_wrapper_xrandr)(Display *, RROutput, int *);
extern XRRPropertyInfo *(*XRRQueryOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom);
extern void (*XRRConfigureOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom, int, int, int, long *);
extern void (*XRRChangeOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom, Atom, int, int, const unsigned char *, int);
extern void (*XRRDeleteOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom);
extern int (*XRRGetOutputProperty_dylibloader_wrapper_xrandr)(Display *, RROutput, Atom, long, long, int, int, Atom, Atom *, int *, unsigned long *, unsigned long *, unsigned char **);
extern XRRModeInfo *(*XRRAllocModeInfo_dylibloader_wrapper_xrandr)(const char *, int);
extern RRMode (*XRRCreateMode_dylibloader_wrapper_xrandr)(Display *, Window, XRRModeInfo *);
extern void (*XRRDestroyMode_dylibloader_wrapper_xrandr)(Display *, RRMode);
extern void (*XRRAddOutputMode_dylibloader_wrapper_xrandr)(Display *, RROutput, RRMode);
extern void (*XRRDeleteOutputMode_dylibloader_wrapper_xrandr)(Display *, RROutput, RRMode);
extern void (*XRRFreeModeInfo_dylibloader_wrapper_xrandr)(XRRModeInfo *);
extern XRRCrtcInfo *(*XRRGetCrtcInfo_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRCrtc);
extern void (*XRRFreeCrtcInfo_dylibloader_wrapper_xrandr)(XRRCrtcInfo *);
extern int (*XRRSetCrtcConfig_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRCrtc, Time, int, int, RRMode, Rotation, RROutput *, int);
extern int (*XRRGetCrtcGammaSize_dylibloader_wrapper_xrandr)(Display *, RRCrtc);
extern XRRCrtcGamma *(*XRRGetCrtcGamma_dylibloader_wrapper_xrandr)(Display *, RRCrtc);
extern XRRCrtcGamma *(*XRRAllocGamma_dylibloader_wrapper_xrandr)(int);
extern void (*XRRSetCrtcGamma_dylibloader_wrapper_xrandr)(Display *, RRCrtc, XRRCrtcGamma *);
extern void (*XRRFreeGamma_dylibloader_wrapper_xrandr)(XRRCrtcGamma *);
extern XRRScreenResources *(*XRRGetScreenResourcesCurrent_dylibloader_wrapper_xrandr)(Display *, Window);
extern void (*XRRSetCrtcTransform_dylibloader_wrapper_xrandr)(Display *, RRCrtc, XTransform *, const char *, XFixed *, int);
extern int (*XRRGetCrtcTransform_dylibloader_wrapper_xrandr)(Display *, RRCrtc, XRRCrtcTransformAttributes **);
extern int (*XRRUpdateConfiguration_dylibloader_wrapper_xrandr)(XEvent *);
extern XRRPanning *(*XRRGetPanning_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRCrtc);
extern void (*XRRFreePanning_dylibloader_wrapper_xrandr)(XRRPanning *);
extern int (*XRRSetPanning_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRCrtc, XRRPanning *);
extern void (*XRRSetOutputPrimary_dylibloader_wrapper_xrandr)(Display *, Window, RROutput);
extern RROutput (*XRRGetOutputPrimary_dylibloader_wrapper_xrandr)(Display *, Window);
extern XRRProviderResources *(*XRRGetProviderResources_dylibloader_wrapper_xrandr)(Display *, Window);
extern void (*XRRFreeProviderResources_dylibloader_wrapper_xrandr)(XRRProviderResources *);
extern XRRProviderInfo *(*XRRGetProviderInfo_dylibloader_wrapper_xrandr)(Display *, XRRScreenResources *, RRProvider);
extern void (*XRRFreeProviderInfo_dylibloader_wrapper_xrandr)(XRRProviderInfo *);
extern int (*XRRSetProviderOutputSource_dylibloader_wrapper_xrandr)(Display *, XID, XID);
extern int (*XRRSetProviderOffloadSink_dylibloader_wrapper_xrandr)(Display *, XID, XID);
extern Atom *(*XRRListProviderProperties_dylibloader_wrapper_xrandr)(Display *, RRProvider, int *);
extern XRRPropertyInfo *(*XRRQueryProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom);
extern void (*XRRConfigureProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom, int, int, int, long *);
extern void (*XRRChangeProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom, Atom, int, int, const unsigned char *, int);
extern void (*XRRDeleteProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom);
extern int (*XRRGetProviderProperty_dylibloader_wrapper_xrandr)(Display *, RRProvider, Atom, long, long, int, int, Atom, Atom *, int *, unsigned long *, unsigned long *, unsigned char **);
extern XRRMonitorInfo *(*XRRAllocateMonitor_dylibloader_wrapper_xrandr)(Display *, int);
extern XRRMonitorInfo *(*XRRGetMonitors_dylibloader_wrapper_xrandr)(Display *, Window, int, int *);
extern void (*XRRSetMonitor_dylibloader_wrapper_xrandr)(Display *, Window, XRRMonitorInfo *);
extern void (*XRRDeleteMonitor_dylibloader_wrapper_xrandr)(Display *, Window, Atom);
extern void (*XRRFreeMonitors_dylibloader_wrapper_xrandr)(XRRMonitorInfo *);
int initialize_xrandr(int verbose);
#ifdef __cplusplus
}

View file

@ -1,12 +1,8 @@
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:14:14
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xrender.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xrender.h" --soname libXrender.so.1 --init-name xrender --output-header ./platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.c~
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:52:10
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xrender.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xrender.h --soname libXrender.so.1 --init-name xrender --output-header ./platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.c --ignore-other
//
// NOTE: Generated from Xrender 0.9.10.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, but absent in libXrender.so.1, were removed.
#include <stdint.h>
#define XRenderQueryExtension XRenderQueryExtension_dylibloader_orig_xrender
@ -100,50 +96,50 @@
#undef XRenderCreateConicalGradient
#include <dlfcn.h>
#include <stdio.h>
int (*XRenderQueryExtension_dylibloader_wrapper_xrender)( Display*, int*, int*);
int (*XRenderQueryVersion_dylibloader_wrapper_xrender)( Display*, int*, int*);
int (*XRenderQueryFormats_dylibloader_wrapper_xrender)( Display*);
int (*XRenderQuerySubpixelOrder_dylibloader_wrapper_xrender)( Display*, int);
int (*XRenderSetSubpixelOrder_dylibloader_wrapper_xrender)( Display*, int, int);
XRenderPictFormat* (*XRenderFindVisualFormat_dylibloader_wrapper_xrender)( Display*,const Visual*);
XRenderPictFormat* (*XRenderFindFormat_dylibloader_wrapper_xrender)( Display*, unsigned long,const XRenderPictFormat*, int);
XRenderPictFormat* (*XRenderFindStandardFormat_dylibloader_wrapper_xrender)( Display*, int);
XIndexValue* (*XRenderQueryPictIndexValues_dylibloader_wrapper_xrender)( Display*,const XRenderPictFormat*, int*);
Picture (*XRenderCreatePicture_dylibloader_wrapper_xrender)( Display*, Drawable,const XRenderPictFormat*, unsigned long,const XRenderPictureAttributes*);
void (*XRenderChangePicture_dylibloader_wrapper_xrender)( Display*, Picture, unsigned long,const XRenderPictureAttributes*);
void (*XRenderSetPictureClipRectangles_dylibloader_wrapper_xrender)( Display*, Picture, int, int,const XRectangle*, int);
void (*XRenderSetPictureClipRegion_dylibloader_wrapper_xrender)( Display*, Picture, Region);
void (*XRenderSetPictureTransform_dylibloader_wrapper_xrender)( Display*, Picture, XTransform*);
void (*XRenderFreePicture_dylibloader_wrapper_xrender)( Display*, Picture);
void (*XRenderComposite_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture, Picture, int, int, int, int, int, int, unsigned int, unsigned int);
GlyphSet (*XRenderCreateGlyphSet_dylibloader_wrapper_xrender)( Display*,const XRenderPictFormat*);
GlyphSet (*XRenderReferenceGlyphSet_dylibloader_wrapper_xrender)( Display*, GlyphSet);
void (*XRenderFreeGlyphSet_dylibloader_wrapper_xrender)( Display*, GlyphSet);
void (*XRenderAddGlyphs_dylibloader_wrapper_xrender)( Display*, GlyphSet,const Glyph*,const XGlyphInfo*, int,const char*, int);
void (*XRenderFreeGlyphs_dylibloader_wrapper_xrender)( Display*, GlyphSet,const Glyph*, int);
void (*XRenderCompositeString8_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, GlyphSet, int, int, int, int,const char*, int);
void (*XRenderCompositeString16_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, GlyphSet, int, int, int, int,const unsigned short*, int);
void (*XRenderCompositeString32_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, GlyphSet, int, int, int, int,const unsigned int*, int);
void (*XRenderCompositeText8_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int, int, int,const XGlyphElt8*, int);
void (*XRenderCompositeText16_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int, int, int,const XGlyphElt16*, int);
void (*XRenderCompositeText32_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int, int, int,const XGlyphElt32*, int);
void (*XRenderFillRectangle_dylibloader_wrapper_xrender)( Display*, int, Picture,const XRenderColor*, int, int, unsigned int, unsigned int);
void (*XRenderFillRectangles_dylibloader_wrapper_xrender)( Display*, int, Picture,const XRenderColor*,const XRectangle*, int);
void (*XRenderCompositeTrapezoids_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int,const XTrapezoid*, int);
void (*XRenderCompositeTriangles_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int,const XTriangle*, int);
void (*XRenderCompositeTriStrip_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int,const XPointFixed*, int);
void (*XRenderCompositeTriFan_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int,const XPointFixed*, int);
void (*XRenderCompositeDoublePoly_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int, int, int,const XPointDouble*, int, int);
int (*XRenderParseColor_dylibloader_wrapper_xrender)( Display*, char*, XRenderColor*);
Cursor (*XRenderCreateCursor_dylibloader_wrapper_xrender)( Display*, Picture, unsigned int, unsigned int);
XFilters* (*XRenderQueryFilters_dylibloader_wrapper_xrender)( Display*, Drawable);
void (*XRenderSetPictureFilter_dylibloader_wrapper_xrender)( Display*, Picture,const char*, XFixed*, int);
Cursor (*XRenderCreateAnimCursor_dylibloader_wrapper_xrender)( Display*, int, XAnimCursor*);
void (*XRenderAddTraps_dylibloader_wrapper_xrender)( Display*, Picture, int, int,const XTrap*, int);
Picture (*XRenderCreateSolidFill_dylibloader_wrapper_xrender)( Display*,const XRenderColor*);
Picture (*XRenderCreateLinearGradient_dylibloader_wrapper_xrender)( Display*,const XLinearGradient*,const XFixed*,const XRenderColor*, int);
Picture (*XRenderCreateRadialGradient_dylibloader_wrapper_xrender)( Display*,const XRadialGradient*,const XFixed*,const XRenderColor*, int);
Picture (*XRenderCreateConicalGradient_dylibloader_wrapper_xrender)( Display*,const XConicalGradient*,const XFixed*,const XRenderColor*, int);
int (*XRenderQueryExtension_dylibloader_wrapper_xrender)(Display *, int *, int *);
int (*XRenderQueryVersion_dylibloader_wrapper_xrender)(Display *, int *, int *);
int (*XRenderQueryFormats_dylibloader_wrapper_xrender)(Display *);
int (*XRenderQuerySubpixelOrder_dylibloader_wrapper_xrender)(Display *, int);
int (*XRenderSetSubpixelOrder_dylibloader_wrapper_xrender)(Display *, int, int);
XRenderPictFormat *(*XRenderFindVisualFormat_dylibloader_wrapper_xrender)(Display *, const Visual *);
XRenderPictFormat *(*XRenderFindFormat_dylibloader_wrapper_xrender)(Display *, unsigned long, const XRenderPictFormat *, int);
XRenderPictFormat *(*XRenderFindStandardFormat_dylibloader_wrapper_xrender)(Display *, int);
XIndexValue *(*XRenderQueryPictIndexValues_dylibloader_wrapper_xrender)(Display *, const XRenderPictFormat *, int *);
Picture (*XRenderCreatePicture_dylibloader_wrapper_xrender)(Display *, Drawable, const XRenderPictFormat *, unsigned long, const XRenderPictureAttributes *);
void (*XRenderChangePicture_dylibloader_wrapper_xrender)(Display *, Picture, unsigned long, const XRenderPictureAttributes *);
void (*XRenderSetPictureClipRectangles_dylibloader_wrapper_xrender)(Display *, Picture, int, int, const XRectangle *, int);
void (*XRenderSetPictureClipRegion_dylibloader_wrapper_xrender)(Display *, Picture, Region);
void (*XRenderSetPictureTransform_dylibloader_wrapper_xrender)(Display *, Picture, XTransform *);
void (*XRenderFreePicture_dylibloader_wrapper_xrender)(Display *, Picture);
void (*XRenderComposite_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, Picture, int, int, int, int, int, int, unsigned int, unsigned int);
GlyphSet (*XRenderCreateGlyphSet_dylibloader_wrapper_xrender)(Display *, const XRenderPictFormat *);
GlyphSet (*XRenderReferenceGlyphSet_dylibloader_wrapper_xrender)(Display *, GlyphSet);
void (*XRenderFreeGlyphSet_dylibloader_wrapper_xrender)(Display *, GlyphSet);
void (*XRenderAddGlyphs_dylibloader_wrapper_xrender)(Display *, GlyphSet, const Glyph *, const XGlyphInfo *, int, const char *, int);
void (*XRenderFreeGlyphs_dylibloader_wrapper_xrender)(Display *, GlyphSet, const Glyph *, int);
void (*XRenderCompositeString8_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, GlyphSet, int, int, int, int, const char *, int);
void (*XRenderCompositeString16_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, GlyphSet, int, int, int, int, const unsigned short *, int);
void (*XRenderCompositeString32_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, GlyphSet, int, int, int, int, const unsigned int *, int);
void (*XRenderCompositeText8_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, int, int, const XGlyphElt8 *, int);
void (*XRenderCompositeText16_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, int, int, const XGlyphElt16 *, int);
void (*XRenderCompositeText32_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, int, int, const XGlyphElt32 *, int);
void (*XRenderFillRectangle_dylibloader_wrapper_xrender)(Display *, int, Picture, const XRenderColor *, int, int, unsigned int, unsigned int);
void (*XRenderFillRectangles_dylibloader_wrapper_xrender)(Display *, int, Picture, const XRenderColor *, const XRectangle *, int);
void (*XRenderCompositeTrapezoids_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, const XTrapezoid *, int);
void (*XRenderCompositeTriangles_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, const XTriangle *, int);
void (*XRenderCompositeTriStrip_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, const XPointFixed *, int);
void (*XRenderCompositeTriFan_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, const XPointFixed *, int);
void (*XRenderCompositeDoublePoly_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, int, int, const XPointDouble *, int, int);
int (*XRenderParseColor_dylibloader_wrapper_xrender)(Display *, char *, XRenderColor *);
Cursor (*XRenderCreateCursor_dylibloader_wrapper_xrender)(Display *, Picture, unsigned int, unsigned int);
XFilters *(*XRenderQueryFilters_dylibloader_wrapper_xrender)(Display *, Drawable);
void (*XRenderSetPictureFilter_dylibloader_wrapper_xrender)(Display *, Picture, const char *, XFixed *, int);
Cursor (*XRenderCreateAnimCursor_dylibloader_wrapper_xrender)(Display *, int, XAnimCursor *);
void (*XRenderAddTraps_dylibloader_wrapper_xrender)(Display *, Picture, int, int, const XTrap *, int);
Picture (*XRenderCreateSolidFill_dylibloader_wrapper_xrender)(Display *, const XRenderColor *);
Picture (*XRenderCreateLinearGradient_dylibloader_wrapper_xrender)(Display *, const XLinearGradient *, const XFixed *, const XRenderColor *, int);
Picture (*XRenderCreateRadialGradient_dylibloader_wrapper_xrender)(Display *, const XRadialGradient *, const XFixed *, const XRenderColor *, int);
Picture (*XRenderCreateConicalGradient_dylibloader_wrapper_xrender)(Display *, const XConicalGradient *, const XFixed *, const XRenderColor *, int);
int initialize_xrender(int verbose) {
void *handle;
char *error;

View file

@ -2,13 +2,9 @@
#define DYLIBLOAD_WRAPPER_XRENDER
// This file is generated. Do not edit!
// see https://github.com/hpvb/dynload-wrapper for details
// generated by generate-wrapper.py 0.3 on 2023-01-23 15:14:14
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xrender.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xrender.h" --soname libXrender.so.1 --init-name xrender --output-header ./platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.c~
// generated by generate-wrapper.py 0.7 on 2024-12-12 14:52:10
// flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/Xrender.h --sys-include thirdparty/linuxbsd_headers/X11/extensions/Xrender.h --soname libXrender.so.1 --init-name xrender --output-header ./platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xrender-so_wrap.c --ignore-other
//
// NOTE: Generated from Xrender 0.9.10.
// This has been handpatched to workaround some issues with the generator that
// will be eventually fixed. In this case, non-existent symbols inherited from
// libX11, but absent in libXrender.so.1, were removed.
#include <stdint.h>
#define XRenderQueryExtension XRenderQueryExtension_dylibloader_orig_xrender
@ -147,50 +143,50 @@ extern "C" {
#define XRenderCreateLinearGradient XRenderCreateLinearGradient_dylibloader_wrapper_xrender
#define XRenderCreateRadialGradient XRenderCreateRadialGradient_dylibloader_wrapper_xrender
#define XRenderCreateConicalGradient XRenderCreateConicalGradient_dylibloader_wrapper_xrender
extern int (*XRenderQueryExtension_dylibloader_wrapper_xrender)( Display*, int*, int*);
extern int (*XRenderQueryVersion_dylibloader_wrapper_xrender)( Display*, int*, int*);
extern int (*XRenderQueryFormats_dylibloader_wrapper_xrender)( Display*);
extern int (*XRenderQuerySubpixelOrder_dylibloader_wrapper_xrender)( Display*, int);
extern int (*XRenderSetSubpixelOrder_dylibloader_wrapper_xrender)( Display*, int, int);
extern XRenderPictFormat* (*XRenderFindVisualFormat_dylibloader_wrapper_xrender)( Display*,const Visual*);
extern XRenderPictFormat* (*XRenderFindFormat_dylibloader_wrapper_xrender)( Display*, unsigned long,const XRenderPictFormat*, int);
extern XRenderPictFormat* (*XRenderFindStandardFormat_dylibloader_wrapper_xrender)( Display*, int);
extern XIndexValue* (*XRenderQueryPictIndexValues_dylibloader_wrapper_xrender)( Display*,const XRenderPictFormat*, int*);
extern Picture (*XRenderCreatePicture_dylibloader_wrapper_xrender)( Display*, Drawable,const XRenderPictFormat*, unsigned long,const XRenderPictureAttributes*);
extern void (*XRenderChangePicture_dylibloader_wrapper_xrender)( Display*, Picture, unsigned long,const XRenderPictureAttributes*);
extern void (*XRenderSetPictureClipRectangles_dylibloader_wrapper_xrender)( Display*, Picture, int, int,const XRectangle*, int);
extern void (*XRenderSetPictureClipRegion_dylibloader_wrapper_xrender)( Display*, Picture, Region);
extern void (*XRenderSetPictureTransform_dylibloader_wrapper_xrender)( Display*, Picture, XTransform*);
extern void (*XRenderFreePicture_dylibloader_wrapper_xrender)( Display*, Picture);
extern void (*XRenderComposite_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture, Picture, int, int, int, int, int, int, unsigned int, unsigned int);
extern GlyphSet (*XRenderCreateGlyphSet_dylibloader_wrapper_xrender)( Display*,const XRenderPictFormat*);
extern GlyphSet (*XRenderReferenceGlyphSet_dylibloader_wrapper_xrender)( Display*, GlyphSet);
extern void (*XRenderFreeGlyphSet_dylibloader_wrapper_xrender)( Display*, GlyphSet);
extern void (*XRenderAddGlyphs_dylibloader_wrapper_xrender)( Display*, GlyphSet,const Glyph*,const XGlyphInfo*, int,const char*, int);
extern void (*XRenderFreeGlyphs_dylibloader_wrapper_xrender)( Display*, GlyphSet,const Glyph*, int);
extern void (*XRenderCompositeString8_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, GlyphSet, int, int, int, int,const char*, int);
extern void (*XRenderCompositeString16_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, GlyphSet, int, int, int, int,const unsigned short*, int);
extern void (*XRenderCompositeString32_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, GlyphSet, int, int, int, int,const unsigned int*, int);
extern void (*XRenderCompositeText8_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int, int, int,const XGlyphElt8*, int);
extern void (*XRenderCompositeText16_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int, int, int,const XGlyphElt16*, int);
extern void (*XRenderCompositeText32_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int, int, int,const XGlyphElt32*, int);
extern void (*XRenderFillRectangle_dylibloader_wrapper_xrender)( Display*, int, Picture,const XRenderColor*, int, int, unsigned int, unsigned int);
extern void (*XRenderFillRectangles_dylibloader_wrapper_xrender)( Display*, int, Picture,const XRenderColor*,const XRectangle*, int);
extern void (*XRenderCompositeTrapezoids_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int,const XTrapezoid*, int);
extern void (*XRenderCompositeTriangles_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int,const XTriangle*, int);
extern void (*XRenderCompositeTriStrip_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int,const XPointFixed*, int);
extern void (*XRenderCompositeTriFan_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int,const XPointFixed*, int);
extern void (*XRenderCompositeDoublePoly_dylibloader_wrapper_xrender)( Display*, int, Picture, Picture,const XRenderPictFormat*, int, int, int, int,const XPointDouble*, int, int);
extern int (*XRenderParseColor_dylibloader_wrapper_xrender)( Display*, char*, XRenderColor*);
extern Cursor (*XRenderCreateCursor_dylibloader_wrapper_xrender)( Display*, Picture, unsigned int, unsigned int);
extern XFilters* (*XRenderQueryFilters_dylibloader_wrapper_xrender)( Display*, Drawable);
extern void (*XRenderSetPictureFilter_dylibloader_wrapper_xrender)( Display*, Picture,const char*, XFixed*, int);
extern Cursor (*XRenderCreateAnimCursor_dylibloader_wrapper_xrender)( Display*, int, XAnimCursor*);
extern void (*XRenderAddTraps_dylibloader_wrapper_xrender)( Display*, Picture, int, int,const XTrap*, int);
extern Picture (*XRenderCreateSolidFill_dylibloader_wrapper_xrender)( Display*,const XRenderColor*);
extern Picture (*XRenderCreateLinearGradient_dylibloader_wrapper_xrender)( Display*,const XLinearGradient*,const XFixed*,const XRenderColor*, int);
extern Picture (*XRenderCreateRadialGradient_dylibloader_wrapper_xrender)( Display*,const XRadialGradient*,const XFixed*,const XRenderColor*, int);
extern Picture (*XRenderCreateConicalGradient_dylibloader_wrapper_xrender)( Display*,const XConicalGradient*,const XFixed*,const XRenderColor*, int);
extern int (*XRenderQueryExtension_dylibloader_wrapper_xrender)(Display *, int *, int *);
extern int (*XRenderQueryVersion_dylibloader_wrapper_xrender)(Display *, int *, int *);
extern int (*XRenderQueryFormats_dylibloader_wrapper_xrender)(Display *);
extern int (*XRenderQuerySubpixelOrder_dylibloader_wrapper_xrender)(Display *, int);
extern int (*XRenderSetSubpixelOrder_dylibloader_wrapper_xrender)(Display *, int, int);
extern XRenderPictFormat *(*XRenderFindVisualFormat_dylibloader_wrapper_xrender)(Display *, const Visual *);
extern XRenderPictFormat *(*XRenderFindFormat_dylibloader_wrapper_xrender)(Display *, unsigned long, const XRenderPictFormat *, int);
extern XRenderPictFormat *(*XRenderFindStandardFormat_dylibloader_wrapper_xrender)(Display *, int);
extern XIndexValue *(*XRenderQueryPictIndexValues_dylibloader_wrapper_xrender)(Display *, const XRenderPictFormat *, int *);
extern Picture (*XRenderCreatePicture_dylibloader_wrapper_xrender)(Display *, Drawable, const XRenderPictFormat *, unsigned long, const XRenderPictureAttributes *);
extern void (*XRenderChangePicture_dylibloader_wrapper_xrender)(Display *, Picture, unsigned long, const XRenderPictureAttributes *);
extern void (*XRenderSetPictureClipRectangles_dylibloader_wrapper_xrender)(Display *, Picture, int, int, const XRectangle *, int);
extern void (*XRenderSetPictureClipRegion_dylibloader_wrapper_xrender)(Display *, Picture, Region);
extern void (*XRenderSetPictureTransform_dylibloader_wrapper_xrender)(Display *, Picture, XTransform *);
extern void (*XRenderFreePicture_dylibloader_wrapper_xrender)(Display *, Picture);
extern void (*XRenderComposite_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, Picture, int, int, int, int, int, int, unsigned int, unsigned int);
extern GlyphSet (*XRenderCreateGlyphSet_dylibloader_wrapper_xrender)(Display *, const XRenderPictFormat *);
extern GlyphSet (*XRenderReferenceGlyphSet_dylibloader_wrapper_xrender)(Display *, GlyphSet);
extern void (*XRenderFreeGlyphSet_dylibloader_wrapper_xrender)(Display *, GlyphSet);
extern void (*XRenderAddGlyphs_dylibloader_wrapper_xrender)(Display *, GlyphSet, const Glyph *, const XGlyphInfo *, int, const char *, int);
extern void (*XRenderFreeGlyphs_dylibloader_wrapper_xrender)(Display *, GlyphSet, const Glyph *, int);
extern void (*XRenderCompositeString8_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, GlyphSet, int, int, int, int, const char *, int);
extern void (*XRenderCompositeString16_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, GlyphSet, int, int, int, int, const unsigned short *, int);
extern void (*XRenderCompositeString32_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, GlyphSet, int, int, int, int, const unsigned int *, int);
extern void (*XRenderCompositeText8_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, int, int, const XGlyphElt8 *, int);
extern void (*XRenderCompositeText16_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, int, int, const XGlyphElt16 *, int);
extern void (*XRenderCompositeText32_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, int, int, const XGlyphElt32 *, int);
extern void (*XRenderFillRectangle_dylibloader_wrapper_xrender)(Display *, int, Picture, const XRenderColor *, int, int, unsigned int, unsigned int);
extern void (*XRenderFillRectangles_dylibloader_wrapper_xrender)(Display *, int, Picture, const XRenderColor *, const XRectangle *, int);
extern void (*XRenderCompositeTrapezoids_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, const XTrapezoid *, int);
extern void (*XRenderCompositeTriangles_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, const XTriangle *, int);
extern void (*XRenderCompositeTriStrip_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, const XPointFixed *, int);
extern void (*XRenderCompositeTriFan_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, const XPointFixed *, int);
extern void (*XRenderCompositeDoublePoly_dylibloader_wrapper_xrender)(Display *, int, Picture, Picture, const XRenderPictFormat *, int, int, int, int, const XPointDouble *, int, int);
extern int (*XRenderParseColor_dylibloader_wrapper_xrender)(Display *, char *, XRenderColor *);
extern Cursor (*XRenderCreateCursor_dylibloader_wrapper_xrender)(Display *, Picture, unsigned int, unsigned int);
extern XFilters *(*XRenderQueryFilters_dylibloader_wrapper_xrender)(Display *, Drawable);
extern void (*XRenderSetPictureFilter_dylibloader_wrapper_xrender)(Display *, Picture, const char *, XFixed *, int);
extern Cursor (*XRenderCreateAnimCursor_dylibloader_wrapper_xrender)(Display *, int, XAnimCursor *);
extern void (*XRenderAddTraps_dylibloader_wrapper_xrender)(Display *, Picture, int, int, const XTrap *, int);
extern Picture (*XRenderCreateSolidFill_dylibloader_wrapper_xrender)(Display *, const XRenderColor *);
extern Picture (*XRenderCreateLinearGradient_dylibloader_wrapper_xrender)(Display *, const XLinearGradient *, const XFixed *, const XRenderColor *, int);
extern Picture (*XRenderCreateRadialGradient_dylibloader_wrapper_xrender)(Display *, const XRadialGradient *, const XFixed *, const XRenderColor *, int);
extern Picture (*XRenderCreateConicalGradient_dylibloader_wrapper_xrender)(Display *, const XConicalGradient *, const XFixed *, const XRenderColor *, int);
int initialize_xrender(int verbose);
#ifdef __cplusplus
}

View file

@ -52,8 +52,8 @@ private:
public:
void window_resize(DisplayServer::WindowID p_window_id, int p_width, int p_height) {}
GLManagerEGL_X11(){};
~GLManagerEGL_X11(){};
GLManagerEGL_X11() {}
~GLManagerEGL_X11() {}
};
#endif // X11_ENABLED && GLES3_ENABLED

View file

@ -1129,6 +1129,33 @@ void KeyMappingX11::initialize() {
location_map[0x86] = KeyLocation::RIGHT;
}
bool KeyMappingX11::is_sym_numpad(KeySym p_keysym) {
switch (p_keysym) {
case XK_KP_Equal:
case XK_KP_Add:
case XK_KP_Subtract:
case XK_KP_Multiply:
case XK_KP_Divide:
case XK_KP_Separator:
case XK_KP_Decimal:
case XK_KP_Delete:
case XK_KP_0:
case XK_KP_1:
case XK_KP_2:
case XK_KP_3:
case XK_KP_4:
case XK_KP_5:
case XK_KP_6:
case XK_KP_7:
case XK_KP_8:
case XK_KP_9: {
return true;
} break;
}
return false;
}
Key KeyMappingX11::get_keycode(KeySym p_keysym) {
if (p_keysym >= 0x20 && p_keysym < 0x7E) { // ASCII, maps 1-1
if (p_keysym > 0x60 && p_keysym < 0x7B) { // Lowercase ASCII.

View file

@ -61,6 +61,7 @@ class KeyMappingX11 {
public:
static void initialize();
static bool is_sym_numpad(KeySym p_keysym);
static Key get_keycode(KeySym p_keysym);
static unsigned int get_xlibcode(Key p_keysym);
static Key get_scancode(unsigned int p_code);

View file

@ -32,11 +32,7 @@
#include "rendering_context_driver_vulkan_x11.h"
#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"
const char *RenderingContextDriverVulkanX11::_get_platform_surface_extension() const {
return VK_KHR_XLIB_SURFACE_EXTENSION_NAME;
@ -51,7 +47,7 @@ RenderingContextDriver::SurfaceID RenderingContextDriverVulkanX11::surface_creat
create_info.window = wpd->window;
VkSurfaceKHR vk_surface = VK_NULL_HANDLE;
VkResult err = vkCreateXlibSurfaceKHR(instance_get(), &create_info, nullptr, &vk_surface);
VkResult err = vkCreateXlibSurfaceKHR(instance_get(), &create_info, get_allocation_callbacks(VK_OBJECT_TYPE_SURFACE_KHR), &vk_surface);
ERR_FAIL_COND_V(err != VK_SUCCESS, SurfaceID());
Surface *surface = memnew(Surface);