// =====================================================================================================================
//  fennec, a free and open source game engine
//  Copyright © 2025 - 2026  Medusa Slockbower
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================

///
/// \file fennec/platform/linux/wayland/libdecor/libdecor.h
/// \brief
///
///
/// \details
/// \author Medusa Slockbower
///
/// \copyright Copyright © 2025 - 2026 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
///
///


#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 LIBDECOR_##fn;
#define FENNEC_GLOBAL(type, name)   extern "C" type* LIBDECOR_##name;
#include <fennec/platform/linux/wayland/libdecor/sym.h>

#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_H