123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- // Copyright 2019-2020 Inaban Authors <https://hacktivis.me/git/inaban>
- // SPDX-License-Identifier: BSD-3-Clause
- // Based on wlroots's TinyWL which is distributed under CC0
- #ifndef INABAN_H
- #define INABAN_H
- #include <stdbool.h>
- #include <wayland-server.h>
- #include <wlr/backend.h>
- #include <wlr/render/wlr_renderer.h>
- #include <wlr/types/wlr_compositor.h>
- #include <wlr/types/wlr_cursor.h>
- #include <wlr/types/wlr_data_device.h>
- #include <wlr/types/wlr_input_device.h>
- #include <wlr/types/wlr_keyboard.h>
- #include <wlr/types/wlr_matrix.h>
- #include <wlr/types/wlr_output.h>
- #include <wlr/types/wlr_output_layout.h>
- #include <wlr/types/wlr_pointer.h>
- #include <wlr/types/wlr_seat.h>
- #include <wlr/types/wlr_xcursor_manager.h>
- #include <wlr/types/wlr_xdg_shell.h>
- #include <wlr/util/log.h>
- #include <xkbcommon/xkbcommon.h>
- struct inaban_server
- {
- struct wl_display *wl_display;
- struct wlr_backend *backend;
- struct wlr_renderer *renderer;
- struct wlr_xdg_shell *xdg_shell;
- struct wl_listener new_xdg_surface;
- struct wl_list views;
- 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_list keyboards;
- struct wlr_output_layout *output_layout;
- struct wl_list outputs;
- struct wl_listener new_output;
- };
- struct inaban_output
- {
- struct wl_list link;
- struct inaban_server *server;
- struct wlr_output *wlr_output;
- struct wl_listener frame;
- };
- struct inaban_view
- {
- struct wl_list link;
- struct inaban_server *server;
- struct wlr_xdg_surface *xdg_surface;
- struct wl_listener map;
- struct wl_listener unmap;
- struct wl_listener destroy;
- struct wl_listener request_move;
- struct wl_listener request_resize;
- bool mapped;
- int x, y;
- };
- struct inaban_keyboard
- {
- struct wl_list link;
- struct inaban_server *server;
- struct wlr_input_device *device;
- struct wl_listener modifiers;
- struct wl_listener key;
- };
- /* Used to move all of the data necessary to render a surface from the top-level
- * frame handler to the per-surface render function. */
- struct render_data
- {
- struct wlr_output *output;
- struct wlr_renderer *renderer;
- struct inaban_view *view;
- struct timespec *when;
- };
- typedef union {
- int i;
- unsigned int ui;
- float f;
- const void *v;
- } Arg;
- typedef struct
- {
- uint32_t mod;
- xkb_keysym_t keysym;
- void (*func)(const Arg *);
- const Arg arg;
- } Shortcut;
- void spawn(const Arg *arg);
- void quit(const Arg *arg);
- void server_new_output(struct wl_listener *listener, void *data);
- #endif /* INABAN_H */
|