// =====================================================================================================================
//  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/>.
// =====================================================================================================================

#include <fennec/lang/types.h>

#ifndef FENNEC_LIB
#define FENNEC_LIB(...)
#endif

#ifndef FENNEC_SYMBOL
#define FENNEC_SYMBOL(...)
#endif

#ifndef FENNEC_GLOBAL
#define FENNEC_GLOBAL(...)
#endif

FENNEC_LIB(LIBDECOR)

FENNEC_SYMBOL(void,                   libdecor_unref,    struct libdecor*)
FENNEC_SYMBOL(int,                    libdecor_dispatch, struct libdecor*, int)
FENNEC_SYMBOL(struct libdecor*,       libdecor_new,      struct wl_display*, \
                                                         struct libdecor_interface*)
FENNEC_SYMBOL(struct libdecor_frame*, libdecor_decorate, struct libdecor*, \
	                                                     struct wl_surface*, \
	                                                     struct libdecor_frame_interface*, void*)

FENNEC_SYMBOL(void,  libdecor_frame_unref,                struct libdecor_frame*)
FENNEC_SYMBOL(void,  libdecor_frame_set_title,            struct libdecor_frame*, const char*)
FENNEC_SYMBOL(void,  libdecor_frame_set_app_id,           struct libdecor_frame*, const char*)
FENNEC_SYMBOL(void,  libdecor_frame_set_max_content_size, struct libdecor_frame*, int,  int)
FENNEC_SYMBOL(void,  libdecor_frame_set_min_content_size, struct libdecor_frame*, int,  int)
FENNEC_SYMBOL(void,  libdecor_frame_get_min_content_size, const struct libdecor_frame*, int*, int*)
FENNEC_SYMBOL(void,  libdecor_frame_get_max_content_size, const struct libdecor_frame*, int*, int*)
FENNEC_SYMBOL(void,  libdecor_frame_resize,               struct libdecor_frame*, struct wl_seat*, uint32_t, \
	                                                      enum   libdecor_resize_edge)
FENNEC_SYMBOL(void,  libdecor_frame_move,                 struct libdecor_frame*, struct wl_seat*, uint32_t)
FENNEC_SYMBOL(void,  libdecor_frame_commit,               struct libdecor_frame*, struct libdecor_state*,\
                                                          struct libdecor_configuration*)
FENNEC_SYMBOL(void,  libdecor_frame_set_minimized,        struct libdecor_frame*)
FENNEC_SYMBOL(void,  libdecor_frame_set_maximized,        struct libdecor_frame*)
FENNEC_SYMBOL(void,  libdecor_frame_unset_maximized,      struct libdecor_frame*)
FENNEC_SYMBOL(void,  libdecor_frame_set_fullscreen,       struct libdecor_frame*, struct wl_output*)
FENNEC_SYMBOL(void,  libdecor_frame_unset_fullscreen,     struct libdecor_frame*)
FENNEC_SYMBOL(void,  libdecor_frame_set_capabilities,     struct libdecor_frame*, enum libdecor_capabilities)
FENNEC_SYMBOL(void,  libdecor_frame_unset_capabilities,   struct libdecor_frame*, enum libdecor_capabilities)
FENNEC_SYMBOL(bool,  libdecor_frame_has_capability,       struct libdecor_frame*, enum libdecor_capabilities)
FENNEC_SYMBOL(void,  libdecor_frame_set_visibility,       struct libdecor_frame*, bool)
FENNEC_SYMBOL(bool,  libdecor_frame_is_visible,           struct libdecor_frame*)
FENNEC_SYMBOL(bool,  libdecor_frame_is_floating,          struct libdecor_frame*)
FENNEC_SYMBOL(void,  libdecor_frame_set_parent,           struct libdecor_frame*,\
                                                          struct libdecor_frame*)
FENNEC_SYMBOL(void,  libdecor_frame_show_window_menu,     struct libdecor_frame*, struct wl_seat*, uint32_t, int, int)
FENNEC_SYMBOL(void,  libdecor_frame_translate_coordinate, struct libdecor_frame*, int, int, int*, int*)
FENNEC_SYMBOL(void,  libdecor_frame_map,                  struct libdecor_frame*)

FENNEC_SYMBOL(struct xdg_surface*,  libdecor_frame_get_xdg_surface,  struct libdecor_frame*)
FENNEC_SYMBOL(struct xdg_toplevel*, libdecor_frame_get_xdg_toplevel, struct libdecor_frame*)

FENNEC_SYMBOL(struct libdecor_state*, libdecor_state_new,  int, int)
FENNEC_SYMBOL(void,                   libdecor_state_free, struct libdecor_state*)

FENNEC_SYMBOL(bool, libdecor_configuration_get_content_size, struct libdecor_configuration*,\
                                                             struct libdecor_frame*,\
                                                             int*,\
                                                             int*)
FENNEC_SYMBOL(bool, libdecor_configuration_get_window_state, struct libdecor_configuration*,\
                                                             enum libdecor_window_state*)


#undef FENNEC_LIB
#undef FENNEC_SYMBOL
#undef FENNEC_GLOBAL