87 lines
2.8 KiB
C++
87 lines
2.8 KiB
C++
// =====================================================================================================================
|
|
// 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/>.
|
|
// =====================================================================================================================
|
|
|
|
#include <fennec/platform/linux/wayland/displaydev.h>
|
|
#include <fennec/platform/linux/wayland/window.h>
|
|
|
|
#include <EGL/egl.h>
|
|
|
|
namespace fennec
|
|
{
|
|
bool wayland_window::running() {
|
|
return false;
|
|
}
|
|
|
|
void wayland_window::configure(const config& config) {
|
|
assertf(running() == false, "Attempted to Configure Running Window.");
|
|
|
|
_config = config;
|
|
}
|
|
|
|
bool wayland_window::initialize(bool modal) {
|
|
assertf(_config, "Attempted to Initialize a Window Without Configuration");
|
|
if (not _config) {
|
|
return true;
|
|
}
|
|
|
|
_config->flags &= ~flags_modal & ~flags_child;
|
|
if (_parent != nullptr) {
|
|
_config->flags |= flags_child;
|
|
if (modal) {
|
|
_config->flags |= flags_modal;
|
|
}
|
|
}
|
|
|
|
_surface = wl_compositor_create_surface(get_display<wayland_display>()->get_compositor());
|
|
_shell = wl_shell_get_shell_surface(get_display<wayland_display>()->get_shell(), _surface);
|
|
|
|
|
|
return false;
|
|
}
|
|
|
|
bool wayland_window::shutdown() {
|
|
wl_shell_surface_destroy(_shell);
|
|
wl_surface_destroy(_surface);
|
|
return false;
|
|
}
|
|
|
|
|
|
bool wayland_window::set_title(const cstring&) { return true; }
|
|
bool wayland_window::set_title(const string&) { return true; }
|
|
bool wayland_window::set_width(size_t) { return true; }
|
|
bool wayland_window::set_height(size_t) { return true; }
|
|
bool wayland_window::set_size(size_t, size_t) { return true; }
|
|
bool wayland_window::set_fullscreen_mode(fullscreen_mode) { return true; }
|
|
bool wayland_window::set_resizable(bool) { return true; }
|
|
bool wayland_window::grab_keyboard(bool) { return true; }
|
|
bool wayland_window::grab_mouse(bool) { return true; }
|
|
bool wayland_window::block_screensaver(bool) { return true; }
|
|
|
|
wayland_window::wayland_window(wayland_display* display, wayland_window* parent)
|
|
: window(display, parent)
|
|
, _surface(nullptr)
|
|
, _shell(nullptr)
|
|
, _callback(nullptr) {
|
|
}
|
|
|
|
wayland_window::~wayland_window() {
|
|
|
|
}
|
|
|
|
}
|