scaling
This commit is contained in:
parent
dcbe05a75d
commit
c84504331b
12 changed files with 867 additions and 17 deletions
|
|
@ -26,6 +26,8 @@ module;
|
|||
#include <xkbcommon/xkbcommon.h>
|
||||
#include "../lib/xdg-shell-client-protocol.h"
|
||||
#include "../lib/wayland-xdg-decoration-unstable-v1-client-protocol.h"
|
||||
#include "../lib/fractional-scale-v1.h"
|
||||
#include "../lib/viewporter.h"
|
||||
#include <string.h>
|
||||
#include <linux/input.h>
|
||||
#include <sys/mman.h>
|
||||
|
|
@ -56,6 +58,7 @@ export namespace Crafter {
|
|||
bool open = true;
|
||||
bool updating = false;
|
||||
std::vector<ClipRect> dirtyRects;
|
||||
float scale;
|
||||
|
||||
Window() = default;
|
||||
Window(std::int_fast32_t width, std::int_fast32_t height);
|
||||
|
|
@ -146,9 +149,13 @@ export namespace Crafter {
|
|||
bool configured = false;
|
||||
wl_shm* shm = nullptr;
|
||||
wl_seat* seat = nullptr;
|
||||
wp_fractional_scale_v1* wp_scale = nullptr;
|
||||
xdg_toplevel* xdgToplevel = nullptr;
|
||||
wp_viewport* wpViewport = nullptr;
|
||||
wp_viewporter* wpViewporter = nullptr;
|
||||
xdg_wm_base* xdgWmBase = nullptr;
|
||||
zxdg_decoration_manager_v1* manager = nullptr;
|
||||
wp_fractional_scale_manager_v1* fractionalScaleManager = nullptr;
|
||||
wl_surface* surface = nullptr;
|
||||
wl_buffer* buffer = nullptr;
|
||||
wl_buffer* backBuffer = nullptr;
|
||||
|
|
@ -183,6 +190,7 @@ export namespace Crafter {
|
|||
static void pointer_handle_button(void* data, wl_pointer* pointer, std::uint32_t serial, std::uint32_t time, std::uint32_t button, std::uint32_t state);
|
||||
static void seat_handle_capabilities(void* data, wl_seat* seat, uint32_t capabilities);
|
||||
static void xdg_surface_handle_configure(void* data, xdg_surface* xdg_surface, std::uint32_t serial);
|
||||
static void xdg_surface_handle_preferred_scale(void* data, wp_fractional_scale_v1*, std::uint32_t scale);
|
||||
static void xdg_wm_base_handle_ping(void* data, xdg_wm_base* xdg_wm_base, std::uint32_t serial);
|
||||
static void keyboard_keymap(void* data, wl_keyboard* keyboard, uint32_t format, int fd, uint32_t size);
|
||||
static void keyboard_enter(void *data, wl_keyboard *keyboard, uint32_t serial, wl_surface *surface, wl_array *keys);
|
||||
|
|
@ -228,6 +236,9 @@ export namespace Crafter {
|
|||
constexpr static xdg_surface_listener xdg_surface_listener = {
|
||||
.configure = xdg_surface_handle_configure,
|
||||
};
|
||||
constexpr static wp_fractional_scale_v1_listener wp_fractional_scale_v1_listener = {
|
||||
.preferred_scale = xdg_surface_handle_preferred_scale,
|
||||
};
|
||||
};
|
||||
#endif
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue