- Some underlying features for RTTI

- Macro for automatically generating this_t
 - Semantics with static_constructor.h, now FENNEC_PRIVATE_STATIC_CONSTRUCTOR for .cpp files and FENNEC_CLASS_STATIC_CONSTRUCTOR for a class in any source file type.
This commit is contained in:
2025-12-03 01:41:30 -05:00
parent 0b76b06a1b
commit d928d86014
28 changed files with 479 additions and 301 deletions

View File

@@ -0,0 +1,114 @@
// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 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 display_server.h
/// \brief
///
///
/// \details
/// \author Medusa Slockbower
///
/// \copyright Copyright © 2025 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
///
///
#ifndef FENNEC_PLATFORM_INTERFACE_DISPLAY_SERVER_H
#define FENNEC_PLATFORM_INTERFACE_DISPLAY_SERVER_H
#include <fennec/containers/bitfield.h>
#include <fennec/platform/interface/fwd.h>
#include <fennec/platform/interface/window.h>
#include <fennec/rtti/enable.h>
namespace fennec
{
class display_server {
// Typedefs/Constants/Enums ============================================================================================
public:
enum feature_ : uint32_t {
feature_subwindows = 0,
feature_icon,
feature_window_drag,
feature_mouse,
feature_cursors,
feature_custom_cursors,
feature_clipboard,
feature_clipboard_primary,
feature_virtual_keyboard,
feature_status_indicators,
feature_dialogues,
feature_input_dialogues,
feature_file_dialogues,
feature_filtered_file_dialogues,
feature_orientation,
feature_hidpi,
feature_hdr,
feature_swap_buffers,
feature_window_transparency,
feature_screen_reader,
feature_text_to_speech,
feature_touchscreen,
feature_system_theme,
feature_count,
};
using featureset_t = bitfield<feature_count>;
struct config {
};
// Public Members ======================================================================================================
platform* const platform;
explicit display_server(fennec::platform* p)
: platform(p) {
}
virtual ~display_server() = default;
bool has_feature(uint32_t feature) const {
return _features.test(feature);
}
virtual window* create_window(const window::config& conf) = 0;
private:
featureset_t _features;
FENNEC_RTTI_CLASS_ENABLE() {
}
};
}
#endif // FENNEC_PLATFORM_INTERFACE_DISPLAY_SERVER_H