Files
absinthe/include/types.h
T

186 lines
4.9 KiB
C
Raw Normal View History

2026-01-02 22:53:34 +07:00
#pragma once
#include <linux/input-event-codes.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/render/allocator.h>
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_keyboard.h>
2026-01-04 18:07:28 +07:00
#include <wlr/types/wlr_output_management_v1.h>
#include <wlr/types/wlr_xdg_decoration_v1.h>
2026-01-02 22:53:34 +07:00
2026-04-04 16:42:55 +07:00
#ifdef XWAYLAND
#include <wlr/xwayland.h>
#include <xcb/xcb.h>
#include <xcb/xcb_icccm.h>
#endif
2026-01-06 01:41:46 +07:00
2026-04-04 16:42:55 +07:00
#include "config.h"
2026-04-03 17:13:34 +07:00
2026-01-02 22:53:34 +07:00
enum absinthe_cursor_mode {
ABSINTHE_CURSOR_PASSTHROUGH,
ABSINTHE_CURSOR_MOVE,
ABSINTHE_CURSOR_RESIZE,
};
enum absinthe_cursor_resize_corner {
ABSINTHE_CURSOR_RESIZE_CORNER_TOP_LEFT,
ABSINTHE_CURSOR_RESIZE_CORNER_TOP_RIGHT,
ABSINTHE_CURSOR_RESIZE_CORNER_BOTTOM_LEFT,
ABSINTHE_CURSOR_RESIZE_CORNER_BOTTOM_RIGHT,
};
2026-04-03 17:13:34 +07:00
enum absinthe_toplevel_type {
2026-04-04 16:42:55 +07:00
ABSINTHE_TOPLEVEL_XDG,
2026-04-03 17:13:34 +07:00
ABSINTHE_TOPLEVEL_LAYER_SHELL,
ABSINTHE_TOPLEVEL_X11,
};
enum absinthe_layers {
ABSINTHE_LAYER_BACKGROUND,
2026-04-04 16:42:55 +07:00
ABSINTHE_LAYER_BOTTOM,
2026-04-03 17:13:34 +07:00
ABSINTHE_LAYER_TILE,
ABSINTHE_LAYER_FLOAT,
2026-04-04 16:42:55 +07:00
ABSINTHE_LAYER_TOP,
2026-04-03 17:13:34 +07:00
ABSINTHE_LAYER_FULLSCREEN,
ABSINTHE_LAYER_OVERLAY,
ABSINTHE_LAYER_LOCK,
ABSINTHE_LAYERS_COUNT,
};
2026-01-10 23:16:46 +07:00
struct absinthe_output;
2026-01-02 22:53:34 +07:00
struct absinthe_server {
struct wl_display *display;
struct wlr_backend *backend;
struct wlr_renderer *renderer;
struct wlr_allocator *allocator;
2026-01-04 18:07:28 +07:00
struct wlr_compositor *compositor;
2026-01-02 22:53:34 +07:00
struct wlr_scene *scene;
struct wlr_scene_output_layout *scene_layout;
struct wlr_xdg_shell *xdg_shell;
struct wl_listener new_xdg_toplevel;
struct wl_listener new_xdg_popup;
2026-01-04 18:07:28 +07:00
struct wlr_xdg_decoration_manager_v1 *xdg_decoration_mgr;
struct wl_listener new_xdg_decoration;
2026-01-02 22:53:34 +07:00
2026-04-06 23:38:06 +07:00
#ifdef XWAYLAND
struct wlr_xwayland *xwayland;
struct wl_listener xwayland_new_surface;
struct wl_listener xwayland_ready;
#endif
2026-01-02 22:53:34 +07:00
struct wlr_cursor *cursor;
struct wlr_xcursor_manager *cursor_mgr;
struct wl_listener cursor_motion;
struct wl_listener cursor_motion_absolute;
struct wl_listener cursor_button;
struct wl_listener cursor_axis;
struct wl_listener cursor_frame;
struct wlr_seat *seat;
struct wl_listener new_input;
struct wl_listener request_cursor;
struct wl_listener pointer_focus_change;
struct wl_listener request_set_selection;
struct wl_list keyboards;
2026-04-03 17:13:34 +07:00
2026-01-02 22:53:34 +07:00
enum absinthe_cursor_mode cursor_mode;
2026-01-06 01:41:46 +07:00
struct wlr_box grabbed_geometry;
2026-01-02 22:53:34 +07:00
uint32_t grab_x, grab_y;
enum absinthe_cursor_resize_corner cursor_resize_corner;
2026-01-13 10:51:36 +07:00
struct wl_list toplevels;
struct wl_list focus_stack;
2026-04-03 17:13:34 +07:00
struct absinthe_toplevel *focused_toplevel;
2026-01-13 10:51:36 +07:00
2026-01-10 23:16:46 +07:00
struct absinthe_output *focused_output;
2026-01-02 22:53:34 +07:00
struct wl_list outputs;
struct wl_listener new_output;
2026-01-04 18:07:28 +07:00
struct wlr_output_layout *output_layout;
struct wl_listener output_layout_change;
struct wlr_output_manager_v1 *output_mgr;
struct wl_listener output_mgr_apply;
struct wl_listener output_mgr_test;
2026-01-02 22:53:34 +07:00
};
struct absinthe_output {
struct wl_list link;
struct absinthe_server *server;
2026-01-07 20:35:41 +07:00
struct wlr_box geometry;
2026-01-02 22:53:34 +07:00
struct wlr_output *wlr_output;
struct wl_listener frame;
struct wl_listener request_state;
struct wl_listener destroy;
2026-04-20 19:57:43 +07:00
float main_stack_width;
float main_stack_size;
2026-01-02 22:53:34 +07:00
};
struct absinthe_toplevel {
2026-04-04 16:42:55 +07:00
enum absinthe_toplevel_type type;
2026-01-02 22:53:34 +07:00
struct wl_list link;
2026-04-15 22:57:27 +07:00
struct wl_list flink;
2026-01-02 22:53:34 +07:00
struct absinthe_server *server;
2026-01-10 23:16:46 +07:00
struct absinthe_output *output;
2026-01-02 22:53:34 +07:00
struct wlr_scene_tree *scene_tree;
2026-01-06 21:55:52 +07:00
struct wlr_scene_tree *scene_surface;
2026-04-03 17:13:34 +07:00
2026-01-10 23:16:46 +07:00
int32_t border_width;
2026-01-06 01:41:46 +07:00
struct wlr_scene_rect *border[4];
2026-04-04 16:42:55 +07:00
struct wlr_xdg_toplevel_decoration_v1 *decoration;
2026-04-23 10:47:42 +07:00
bool tiled, floating, fullscreen, maximized;
uint32_t resizing;
2026-04-03 17:13:34 +07:00
2026-01-06 01:41:46 +07:00
struct wlr_box geometry;
2026-01-10 23:16:46 +07:00
struct wlr_box prev_geometry;
2026-04-03 17:13:34 +07:00
2026-04-04 16:42:55 +07:00
union {
struct wlr_xdg_toplevel *xdg;
struct wlr_xwayland_surface *x11;
} toplevel;
2026-01-02 22:53:34 +07:00
struct wl_listener map;
struct wl_listener unmap;
struct wl_listener commit;
struct wl_listener destroy;
struct wl_listener request_move;
struct wl_listener request_resize;
struct wl_listener request_maximize;
struct wl_listener request_fullscreen;
2026-01-04 18:07:28 +07:00
struct wl_listener decoration_request_mode;
struct wl_listener decoration_destroy;
2026-04-04 16:42:55 +07:00
#ifdef XWAYLAND
2026-04-06 23:38:06 +07:00
struct wl_listener xwayland_activate;
struct wl_listener xwayland_associate;
struct wl_listener xwayland_dissociate;
struct wl_listener xwayland_configure;
struct wl_listener xwayland_set_hints;
2026-04-04 16:42:55 +07:00
#endif
2026-01-02 22:53:34 +07:00
};
struct absinthe_popup {
struct wlr_xdg_popup *xdg_popup;
struct wl_listener commit;
struct wl_listener destroy;
};
struct absinthe_keyboard {
struct wl_list link;
struct absinthe_server *server;
struct wlr_keyboard *wlr_keyboard;
struct wl_listener modifiers;
struct wl_listener key;
struct wl_listener destroy;
};