Crafter.Graphics/implementations/Crafter.Graphics-Window_wayland.cpp
2025-11-22 20:58:42 +01:00

66 lines
No EOL
1.8 KiB
C++

/*
Crafter®.Graphics
Copyright (C) 2025 Catcrafts®
catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 3.0 as published by the Free Software Foundation;
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
module;
#ifdef CRAFTER_GRAPHICS_WAYLAND
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/input-event-codes.h>
#include <xkbcommon/xkbcommon.h>
#include "../lib/xdg-shell-client-protocol.h"
#include "../lib/wayland-xdg-decoration-unstable-v1-client-protocol.h"
#include <string.h>
#include <linux/input.h>
#include <sys/mman.h>
#include <wayland-cursor.h>
#include <xkbcommon/xkbcommon.h>
#include <errno.h>
#include <fcntl.h>
#include <print>
#include <wayland-client.h>
#include <wayland-client-protocol.h>
#endif
export module Crafter.Graphics:Window_impl;
import :Window;
import std;
import :WindowKeyboard;
import :WindowFramebuffer;
import :Types;
import :Shm;
import Crafter.Event;
using namespace Crafter;
void WindowBase::StartSync() {
while (open && wl_display_dispatch(display) != -1) {
std::cout << "bruh3" << std::endl;
}
}
void WindowBase::StartUpdate(void* window) {
cb = wl_surface_frame(surface);
wl_callback_add_listener(cb, &surface_frame_listener, window);
}
void WindowBase::StopUpdate() {
onUpdate.listeners.clear();
}