typedefs and comments

This commit is contained in:
2026-05-06 21:24:08 +07:00
parent 9d3528599a
commit 2b7353248d
20 changed files with 238 additions and 225 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
#include "types.h"
void reset_cursor_mode(struct absinthe_server *server);
void process_cursor_motion(struct absinthe_server *server, uint32_t time);
void reset_cursor_mode(absn_server *server);
void process_cursor_motion(absn_server *server, uint32_t time);
+4 -4
View File
@@ -3,11 +3,11 @@
#include "types.h"
void focus_toplevel(struct absinthe_toplevel *toplevel);
void focus_toplevel(absn_toplevel *toplevel);
struct absinthe_toplevel *focus_get_topmost(struct absinthe_server *server);
absn_toplevel *focus_get_topmost(absn_server *server);
void focus_next(struct absinthe_server *server);
void focus_prev(struct absinthe_server *server);
void focus_next(absn_server *server);
void focus_prev(absn_server *server);
#endif
+1 -1
View File
@@ -3,6 +3,6 @@
#include "types.h"
void layout_arrange(struct absinthe_output *output);
void layout_arrange(absn_output *output);
#endif
+1 -1
View File
@@ -10,6 +10,6 @@ void output_request_state(struct wl_listener *listener, void *data);
void output_destroy(struct wl_listener *listener, void *data);
void output_layout_change(struct wl_listener *listener, void *data);
void update_focused_output(struct absinthe_server *server);
void update_focused_output(absn_server *server);
#endif
+9 -12
View File
@@ -3,20 +3,17 @@
#include "types.h"
struct absinthe_toplevel *toplevel_at(struct absinthe_server *server, double lx,
double ly, struct wlr_surface **surface, double *sx, double *sy);
absn_toplevel *toplevel_at(absn_server *server, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy);
bool toplevel_is_unmanaged(struct absinthe_toplevel *toplevel);
bool toplevel_is_unmanaged(absn_toplevel *toplevel);
void toplevel_update_geom(struct absinthe_toplevel *toplevel);
void toplevel_update_borders_geom(struct absinthe_toplevel *toplevel);
void toplevel_get_geom(absn_toplevel *toplevel);
void toplevel_set_pos(struct absinthe_toplevel *toplevel, int32_t x, int32_t y);
void toplevel_set_size(struct absinthe_toplevel *toplevel, int32_t width,
int32_t height);
void toplevel_set_fullscreen(struct absinthe_toplevel *toplevel,
bool fullscreen);
void toplevel_set_border_color(struct absinthe_toplevel *toplevel,
const float color[4]);
void toplevel_set_pos(absn_toplevel *toplevel, int32_t x, int32_t y);
void toplevel_set_size(absn_toplevel *toplevel, int32_t width, int32_t height);
void toplevel_set_geom(absn_toplevel *toplevel, struct wlr_box *geom);
void toplevel_set_fullscreen(absn_toplevel *toplevel, bool fullscreen);
void toplevel_set_border_color(absn_toplevel *toplevel, const float color[4]);
#endif
+31 -24
View File
@@ -24,6 +24,7 @@
#define MAX(A, B) (A) > (B) ? (A) : (B)
#define MIN(A, B) (A) < (B) ? (A) : (B)
/* macro for adding listener for event */
#define LISTEN(L, C, E) \
do { \
(L).notify = (C); \
@@ -31,12 +32,14 @@
} while (0);
#define UNUSED(X) (void)(X)
/* cursor mode */
enum {
CURSOR_PASSTHROUGH,
CURSOR_MOVE,
CURSOR_RESIZE,
};
/* resizing corners */
enum {
TOP_LEFT,
TOP_RIGHT,
@@ -44,12 +47,14 @@ enum {
BOTTOM_RIGHT,
};
/* toplevel types */
enum {
TOPLEVEL_XDG,
TOPLEVEL_X11,
};
enum absinthe_layers {
/* layers for wlr layer shell */
enum {
LAYER_BACKGROUND,
LAYER_BOTTOM,
LAYER_TILE,
@@ -61,9 +66,10 @@ enum absinthe_layers {
LAYERS_COUNT,
};
struct absinthe_output;
typedef struct absn_output absn_output;
typedef struct absn_toplevel absn_toplevel;
struct absinthe_server {
typedef struct {
struct wl_display *display;
struct wlr_backend *backend;
struct wlr_renderer *renderer;
@@ -110,9 +116,9 @@ struct absinthe_server {
struct wl_list toplevels;
struct wl_list focus_stack;
struct absinthe_toplevel *focused_toplevel;
absn_toplevel *focused_toplevel;
struct absinthe_output *focused_output;
absn_output *focused_output;
struct wl_list outputs;
struct wl_listener new_output;
struct wlr_output_layout *output_layout;
@@ -120,11 +126,11 @@ struct absinthe_server {
struct wlr_output_manager_v1 *output_mgr;
struct wl_listener mgr_apply;
struct wl_listener mgr_test;
};
} absn_server;
struct absinthe_output {
struct absn_output {
struct wl_list link;
struct absinthe_server *server;
absn_server *server;
struct wlr_box geom;
struct wlr_box usable_area;
@@ -135,12 +141,12 @@ struct absinthe_output {
struct wl_listener destroy;
float mstack_width;
float mstack_size;
int mstack_count;
};
struct absinthe_layer_surface {
struct absinthe_server *server;
struct absinthe_output *output;
typedef struct {
absn_server *server;
absn_output *output;
struct wlr_scene_tree *scene_tree;
struct wlr_scene_tree *scene_layer;
@@ -151,15 +157,13 @@ struct absinthe_layer_surface {
struct wl_listener unmap;
struct wl_listener commit;
struct wl_listener destroy;
};
struct absinthe_toplevel {
int type;
} absn_layer_surface;
struct absn_toplevel {
struct wl_list link;
struct wl_list flink;
struct absinthe_server *server;
struct absinthe_output *output;
struct wl_list flink; /* link for focus stack */
absn_server *server;
absn_output *output;
struct wlr_scene_tree *scene_tree;
struct wlr_scene_tree *scene_surface;
@@ -175,10 +179,12 @@ struct absinthe_toplevel {
struct wlr_box geom;
struct wlr_box prev_geom;
int type;
union {
struct wlr_xdg_toplevel *xdg;
struct wlr_xwayland_surface *xw;
};
struct wl_listener map;
struct wl_listener unmap;
struct wl_listener commit;
@@ -199,19 +205,20 @@ struct absinthe_toplevel {
#endif
};
struct absinthe_popup {
typedef struct {
struct wlr_xdg_popup *wlr;
struct wl_listener commit;
struct wl_listener destroy;
};
} absn_popup;
struct absinthe_keyboard {
typedef struct {
struct wl_list link;
struct absinthe_server *server;
absn_server *server;
struct wlr_keyboard *wlr;
struct wl_listener modifiers;
struct wl_listener key;
struct wl_listener destroy;
};
} absn_keyboard;
#endif /* __TYPES_H_ */