- Windows now use libdecor when present.
This commit is contained in:
@@ -29,52 +29,52 @@
|
||||
///
|
||||
|
||||
|
||||
#ifndef FENNEC_PLATFORM_LINUX_WAYLAND_LIBDECOR_LIBDECOR_H
|
||||
#define FENNEC_PLATFORM_LINUX_WAYLAND_LIBDECOR_LIBDECOR_H
|
||||
#ifndef FENNEC_PLATFORM_LINUX_WAYLAND_LIBDECOR_H
|
||||
#define FENNEC_PLATFORM_LINUX_WAYLAND_LIBDECOR_H
|
||||
|
||||
#include <fennec/platform/linux/wayland/lib/wayland.h>
|
||||
#include <libdecor.h>
|
||||
|
||||
#define FENNEC_LIB(name) extern "C" bool FENNEC_HAS_LIB_##name;
|
||||
#define FENNEC_SYMBOL(ret, fn, ...) using LIBDECOR_sym_##fn = ret(*)(__VA_ARGS__); \
|
||||
extern "C" LIBDECOR_sym_##fn WAYLAND_##fn;
|
||||
extern "C" LIBDECOR_sym_##fn LIBDECOR_##fn;
|
||||
#define FENNEC_GLOBAL(type, name) extern "C" type* LIBDECOR_##name;
|
||||
#include <fennec/platform/linux/wayland/libdecor/sym.h>
|
||||
|
||||
#define libdecor_unref WAYLAND_libdecor_unref
|
||||
#define libdecor_new WAYLAND_libdecor_new
|
||||
#define libdecor_decorate WAYLAND_libdecor_decorate
|
||||
#define libdecor_frame_unref WAYLAND_libdecor_frame_unref
|
||||
#define libdecor_frame_set_title WAYLAND_libdecor_frame_set_title
|
||||
#define libdecor_frame_set_app_id WAYLAND_libdecor_frame_set_app_id
|
||||
#define libdecor_frame_set_max_content_size WAYLAND_libdecor_frame_set_max_content_size
|
||||
#define libdecor_frame_get_max_content_size WAYLAND_libdecor_frame_get_max_content_size
|
||||
#define libdecor_frame_set_min_content_size WAYLAND_libdecor_frame_set_min_content_size
|
||||
#define libdecor_frame_get_min_content_size WAYLAND_libdecor_frame_get_min_content_size
|
||||
#define libdecor_frame_resize WAYLAND_libdecor_frame_resize
|
||||
#define libdecor_frame_move WAYLAND_libdecor_frame_move
|
||||
#define libdecor_frame_commit WAYLAND_libdecor_frame_commit
|
||||
#define libdecor_frame_set_minimized WAYLAND_libdecor_frame_set_minimized
|
||||
#define libdecor_frame_set_maximized WAYLAND_libdecor_frame_set_maximized
|
||||
#define libdecor_frame_unset_maximized WAYLAND_libdecor_frame_unset_maximized
|
||||
#define libdecor_frame_set_fullscreen WAYLAND_libdecor_frame_set_fullscreen
|
||||
#define libdecor_frame_unset_fullscreen WAYLAND_libdecor_frame_unset_fullscreen
|
||||
#define libdecor_frame_set_capabilities WAYLAND_libdecor_frame_set_capabilities
|
||||
#define libdecor_frame_unset_capabilities WAYLAND_libdecor_frame_unset_capabilities
|
||||
#define libdecor_frame_has_capability WAYLAND_libdecor_frame_has_capability
|
||||
#define libdecor_frame_set_visibility WAYLAND_libdecor_frame_set_visibility
|
||||
#define libdecor_frame_is_visible WAYLAND_libdecor_frame_is_visible
|
||||
#define libdecor_frame_is_floating WAYLAND_libdecor_frame_is_floating
|
||||
#define libdecor_frame_set_parent WAYLAND_libdecor_frame_set_parent
|
||||
#define libdecor_frame_show_window_menu WAYLAND_libdecor_frame_show_window_menu
|
||||
#define libdecor_frame_get_wm_capabilities WAYLAND_libdecor_frame_get_wm_capabilities
|
||||
#define libdecor_frame_get_xdg_surface WAYLAND_libdecor_frame_get_xdg_surface
|
||||
#define libdecor_frame_get_xdg_toplevel WAYLAND_libdecor_frame_get_xdg_toplevel
|
||||
#define libdecor_frame_translate_coordinate WAYLAND_libdecor_frame_translate_coordinate
|
||||
#define libdecor_frame_map WAYLAND_libdecor_frame_map
|
||||
#define libdecor_state_new WAYLAND_libdecor_state_new
|
||||
#define libdecor_state_free WAYLAND_libdecor_state_free
|
||||
#define libdecor_configuration_get_content_size WAYLAND_libdecor_configuration_get_content_size
|
||||
#define libdecor_configuration_get_window_state WAYLAND_libdecor_configuration_get_window_state
|
||||
#define libdecor_dispatch WAYLAND_libdecor_dispatch
|
||||
#define libdecor_unref LIBDECOR_libdecor_unref
|
||||
#define libdecor_new LIBDECOR_libdecor_new
|
||||
#define libdecor_decorate LIBDECOR_libdecor_decorate
|
||||
#define libdecor_frame_unref LIBDECOR_libdecor_frame_unref
|
||||
#define libdecor_frame_set_title LIBDECOR_libdecor_frame_set_title
|
||||
#define libdecor_frame_set_app_id LIBDECOR_libdecor_frame_set_app_id
|
||||
#define libdecor_frame_set_max_content_size LIBDECOR_libdecor_frame_set_max_content_size
|
||||
#define libdecor_frame_get_max_content_size LIBDECOR_libdecor_frame_get_max_content_size
|
||||
#define libdecor_frame_set_min_content_size LIBDECOR_libdecor_frame_set_min_content_size
|
||||
#define libdecor_frame_get_min_content_size LIBDECOR_libdecor_frame_get_min_content_size
|
||||
#define libdecor_frame_resize LIBDECOR_libdecor_frame_resize
|
||||
#define libdecor_frame_move LIBDECOR_libdecor_frame_move
|
||||
#define libdecor_frame_commit LIBDECOR_libdecor_frame_commit
|
||||
#define libdecor_frame_set_minimized LIBDECOR_libdecor_frame_set_minimized
|
||||
#define libdecor_frame_set_maximized LIBDECOR_libdecor_frame_set_maximized
|
||||
#define libdecor_frame_unset_maximized LIBDECOR_libdecor_frame_unset_maximized
|
||||
#define libdecor_frame_set_fullscreen LIBDECOR_libdecor_frame_set_fullscreen
|
||||
#define libdecor_frame_unset_fullscreen LIBDECOR_libdecor_frame_unset_fullscreen
|
||||
#define libdecor_frame_set_capabilities LIBDECOR_libdecor_frame_set_capabilities
|
||||
#define libdecor_frame_unset_capabilities LIBDECOR_libdecor_frame_unset_capabilities
|
||||
#define libdecor_frame_has_capability LIBDECOR_libdecor_frame_has_capability
|
||||
#define libdecor_frame_set_visibility LIBDECOR_libdecor_frame_set_visibility
|
||||
#define libdecor_frame_is_visible LIBDECOR_libdecor_frame_is_visible
|
||||
#define libdecor_frame_is_floating LIBDECOR_libdecor_frame_is_floating
|
||||
#define libdecor_frame_set_parent LIBDECOR_libdecor_frame_set_parent
|
||||
#define libdecor_frame_show_window_menu LIBDECOR_libdecor_frame_show_window_menu
|
||||
#define libdecor_frame_get_xdg_surface LIBDECOR_libdecor_frame_get_xdg_surface
|
||||
#define libdecor_frame_get_xdg_toplevel LIBDECOR_libdecor_frame_get_xdg_toplevel
|
||||
#define libdecor_frame_translate_coordinate LIBDECOR_libdecor_frame_translate_coordinate
|
||||
#define libdecor_frame_map LIBDECOR_libdecor_frame_map
|
||||
#define libdecor_state_new LIBDECOR_libdecor_state_new
|
||||
#define libdecor_state_free LIBDECOR_libdecor_state_free
|
||||
#define libdecor_configuration_get_content_size LIBDECOR_libdecor_configuration_get_content_size
|
||||
#define libdecor_configuration_get_window_state LIBDECOR_libdecor_configuration_get_window_state
|
||||
#define libdecor_dispatch LIBDECOR_libdecor_dispatch
|
||||
|
||||
#endif // FENNEC_PLATFORM_LINUX_WAYLAND_LIBDECOR_LIBDECOR_H
|
||||
#endif // FENNEC_PLATFORM_LINUX_WAYLAND_LIBDECOR_H
|
||||
@@ -83,14 +83,6 @@ FENNEC_SYMBOL(bool, libdecor_configuration_get_window_state, struct libdecor_con
|
||||
enum libdecor_window_state*)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#undef FENNEC_LIB
|
||||
#undef FENNEC_SYMBOL
|
||||
#undef FENNEC_GLOBAL
|
||||
@@ -34,6 +34,10 @@
|
||||
#include <fennec/platform/linux/wayland/fwd.h>
|
||||
#include <fennec/platform/interface/display_server.h>
|
||||
|
||||
#if FENNEC_HAS_LIBDECOR
|
||||
#include <fennec/platform/linux/wayland/libdecor/libdecor.h>
|
||||
#endif
|
||||
|
||||
// forward defs to avoid flooding global namespace
|
||||
struct wl_display;
|
||||
struct wl_shm;
|
||||
@@ -64,6 +68,8 @@ public:
|
||||
|
||||
void* get_native_handle() override { return display; }
|
||||
|
||||
|
||||
// Fields ==============================================================================================================
|
||||
private:
|
||||
wl_display* display;
|
||||
wl_registry* registry;
|
||||
@@ -71,15 +77,26 @@ private:
|
||||
wl_compositor* compositor;
|
||||
xdg_wm_base* xdg;
|
||||
wl_seat* seat;
|
||||
bool fifo, libdecor;
|
||||
bool fifo, has_libdecor;
|
||||
|
||||
static void listen_global(void*, wl_registry*, uint32_t, const char*, uint32_t);
|
||||
static void listen_global_remove(void*, wl_registry*, uint32_t);
|
||||
#if FENNEC_HAS_LIBDECOR
|
||||
libdecor* libdecor;
|
||||
#endif
|
||||
|
||||
static void listen_seat_capabilities(void*, wl_seat*, uint32_t);
|
||||
static void listen_seat_name(void*, wl_seat*, const char*);
|
||||
|
||||
static void listen_xdg_ping(void*, xdg_wm_base*, uint32_t);
|
||||
// Listeners ===========================================================================================================
|
||||
|
||||
static void _wl_registry_listen_global(void*, wl_registry*, uint32_t, const char*, uint32_t);
|
||||
static void _wl_registry_on_global_remove(void*, wl_registry*, uint32_t);
|
||||
|
||||
static void _wl_seat_listen_capabilities(void*, wl_seat*, uint32_t);
|
||||
static void _wl_seat_listen_name(void*, wl_seat*, const char*);
|
||||
|
||||
static void _xdg_listen_ping(void*, xdg_wm_base*, uint32_t);
|
||||
|
||||
#if FENNEC_HAS_LIBDECOR
|
||||
static void _libdecor_on_error(struct libdecor*, libdecor_error error, const char* message);
|
||||
#endif
|
||||
|
||||
FENNEC_RTTI_CLASS_ENABLE(display_server) {
|
||||
display_server::register_type<wayland_server>(1);
|
||||
|
||||
@@ -42,6 +42,9 @@ struct wl_surface;
|
||||
struct xdg_surface;
|
||||
struct xdg_toplevel;
|
||||
|
||||
struct libdecor_frame;
|
||||
struct libdecor_configuration;
|
||||
|
||||
namespace fennec
|
||||
{
|
||||
|
||||
@@ -63,19 +66,30 @@ private:
|
||||
xdg_toplevel* xdgtoplevel;
|
||||
wl_callback* frame_callback;
|
||||
|
||||
static void listen_enter(void*, wl_surface*, wl_output*);
|
||||
static void listen_leave(void*, wl_surface*, wl_output*);
|
||||
static void listen_preferred_buffer_scale(void*, wl_surface*, int32_t);
|
||||
static void listen_preferred_buffer_transform(void*, wl_surface*, uint32_t);
|
||||
#if FENNEC_HAS_LIBDECOR
|
||||
libdecor_frame* libdecorframe;
|
||||
#endif
|
||||
|
||||
static void listen_frame_callback(void*, wl_callback*, uint32_t);
|
||||
static void _wl_surface_listen_enter(void*, wl_surface*, wl_output*);
|
||||
static void _wl_surface_listen_leave(void*, wl_surface*, wl_output*);
|
||||
static void _wl_surface_listen_preferred_buffer_scale(void*, wl_surface*, int32_t);
|
||||
static void _wl_surface_listen_preferred_buffer_transform(void*, wl_surface*, uint32_t);
|
||||
|
||||
static void listen_xdg_surface_configure(void*, xdg_surface*, uint32_t);
|
||||
static void _wl_frame_listen_done(void*, wl_callback*, uint32_t);
|
||||
|
||||
static void listen_xdg_toplevel_configure(void*, xdg_toplevel*, int32_t, int32_t, wl_array*);
|
||||
static void listen_xdg_toplevel_configure_bounds(void*, xdg_toplevel*, int32_t, int32_t);
|
||||
static void listen_xdg_toplevel_close(void*, xdg_toplevel*);
|
||||
static void listen_xdg_toplevel_capabilities(void*, xdg_toplevel*, wl_array*);
|
||||
static void _xdg_surface_listen_configure(void*, xdg_surface*, uint32_t);
|
||||
|
||||
static void _xdg_toplevel_listen_configure(void*, xdg_toplevel*, int32_t, int32_t, wl_array*);
|
||||
static void _xdg_toplevel_listen_configure_bounds(void*, xdg_toplevel*, int32_t, int32_t);
|
||||
static void _xdg_toplevel_listen_close(void*, xdg_toplevel*);
|
||||
static void _xdg_toplevel_listen_wm_capabilities(void*, xdg_toplevel*, wl_array*);
|
||||
|
||||
#if FENNEC_HAS_LIBDECOR
|
||||
static void _libdecor_frame_listen_configure(libdecor_frame*, libdecor_configuration*, void*);
|
||||
static void _libdecor_frame_listen_close(libdecor_frame*, void*);
|
||||
static void _libdecor_frame_listen_commit(libdecor_frame*, void*);
|
||||
static void _libdecor_frame_listen_dismiss_popup(libdecor_frame*, const char*, void*);
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user