diff options
Diffstat (limited to 'cross')
| -rw-r--r-- | cross/README.md | 8 | ||||
| -rw-r--r-- | cross/include/util.h | 20 | ||||
| -rw-r--r-- | cross/src/runtime_requests.c | 44 | ||||
| -rw-r--r-- | cross/src/util.c | 16 |
4 files changed, 44 insertions, 44 deletions
diff --git a/cross/README.md b/cross/README.md index cea84bb..b435e7c 100644 --- a/cross/README.md +++ b/cross/README.md @@ -2,21 +2,21 @@ Cross (Native Bridge Library) ============================= Cross is a static C library (`libcross.a`) that provides native helper -functions for a dynamically loaded soul to interact with the runtime and +functions for a dynamically loaded world to interact with the runtime and wlroots. Why a static library? --------------------- -These helpers are linked into the soul (`.so`) so they hot-reload along with -the soul, instead of being stuck inside the long-running runtime process. +These helpers are linked into the world (`.so`) so they hot-reload along with +the world, instead of being stuck inside the long-running runtime process. API surface ----------- Public headers live in `cross/include`. -- `cross/include/util.h`: soul-facing functions used via FFI, including: +- `cross/include/util.h`: world-facing functions used via FFI, including: - runtime requests (log/exit/hot-reload) - seat access - toplevel queries and basic positioning/geometry helpers diff --git a/cross/include/util.h b/cross/include/util.h index 3707ae1..bf89c2d 100644 --- a/cross/include/util.h +++ b/cross/include/util.h @@ -2,23 +2,23 @@ #define MONTIS_UTIL_H /* - * Runtime helpers exposed to souls. These operate on compositor state and are - * intended for direct FFI use from a soul implementation. + * Runtime helpers exposed to worlds. These operate on compositor state and are + * intended for direct FFI use from a world implementation. */ void montis_do_request_hot_reload(void *plugv); void montis_do_request_log(void *plugv, const char *str); void montis_do_request_exit(void *plugv, int ec); -void *arksoul_get_seat(void *ctx); -void *arksoul_toplevel_at(void *ctx, double lx, double ly); -void arksoul_get_toplevel_position(void *toplevel, double *x, double *y); -void arksoul_set_toplevel_position(void *toplevel, double x, double y); -void arksoul_get_toplevel_geometry(void *toplevel, double *x, double *y, +void *arkworld_get_seat(void *ctx); +void *arkworld_toplevel_at(void *ctx, double lx, double ly); +void arkworld_get_toplevel_position(void *toplevel, double *x, double *y); +void arkworld_set_toplevel_position(void *toplevel, double x, double y); +void arkworld_get_toplevel_geometry(void *toplevel, double *x, double *y, double *w, double *h); -void arksoul_set_toplevel_geometry(void *toplevel, double x, double y, +void arkworld_set_toplevel_geometry(void *toplevel, double x, double y, double w, double h); -void arksoul_focus_toplevel(void *toplevel); -void arksoul_warp_cursor(void *ctx, double lx, double ly); +void arkworld_focus_toplevel(void *toplevel); +void arkworld_warp_cursor(void *ctx, double lx, double ly); #endif /* MONTIS_UTIL_H */ diff --git a/cross/src/runtime_requests.c b/cross/src/runtime_requests.c index adb2b2f..cf0955c 100644 --- a/cross/src/runtime_requests.c +++ b/cross/src/runtime_requests.c @@ -5,26 +5,26 @@ #include <stdlib.h> #include <string.h> -static int soul_hot_reload_same_state_action_(soul_t *soul, void *ignore) +static int world_hot_reload_same_state_action_(world_t *world, void *ignore) { (void)ignore; - return soul_hot_reload_same_state(soul); + return world_hot_reload_same_state(world); } void montis_do_request_hot_reload(void *plugv) { - soul_t *soul = plugv; + world_t *world = plugv; - size_t n = soul->n_requested_actions++; + size_t n = world->n_requested_actions++; if (n < MAX_QUEUED_ACTIONS) { - soul->requested_actions[n].action = soul_hot_reload_same_state_action_; - soul->requested_actions[n].arg_dtor = NULL; + world->requested_actions[n].action = world_hot_reload_same_state_action_; + world->requested_actions[n].arg_dtor = NULL; } } -static int soul_do_log(soul_t *soul, void *chrs) +static int world_do_log(world_t *world, void *chrs) { - (void)soul; + (void)world; char *str = chrs; puts(str); return 0; @@ -32,17 +32,17 @@ static int soul_do_log(soul_t *soul, void *chrs) void montis_do_request_log(void *plugv, const char *str) { - soul_t *soul = plugv; + world_t *world = plugv; - size_t n = soul->n_requested_actions++; + size_t n = world->n_requested_actions++; if (n < MAX_QUEUED_ACTIONS) { - soul->requested_actions[n].action = soul_do_log; - soul->requested_actions[n].str_arg = strdup(str); - soul->requested_actions[n].arg_dtor = free; + world->requested_actions[n].action = world_do_log; + world->requested_actions[n].str_arg = strdup(str); + world->requested_actions[n].arg_dtor = free; } } -static int arksoul_do_exit(void *plugv, int ec) +static int arkworld_do_exit(void *plugv, int ec) { (void)plugv; exit(ec); @@ -51,19 +51,19 @@ static int arksoul_do_exit(void *plugv, int ec) void montis_do_request_exit(void *plugv, int ec) { - soul_t *soul = plugv; + world_t *world = plugv; - size_t n = soul->n_requested_actions++; + size_t n = world->n_requested_actions++; if (n < MAX_QUEUED_ACTIONS) { - soul->requested_actions[n].action = - (int (*)(soul_t *, void *))arksoul_do_exit; - soul->requested_actions[n].int_arg = ec; - soul->requested_actions[n].arg_dtor = NULL; + world->requested_actions[n].action = + (int (*)(world_t *, void *))arkworld_do_exit; + world->requested_actions[n].int_arg = ec; + world->requested_actions[n].arg_dtor = NULL; } } -void *arksoul_get_seat(void *ctx) +void *arkworld_get_seat(void *ctx) { - struct montis_server *server = wl_container_of(ctx, server, soul); + struct montis_server *server = wl_container_of(ctx, server, world); return server->seat; } diff --git a/cross/src/util.c b/cross/src/util.c index 0c02dfe..6497d89 100644 --- a/cross/src/util.c +++ b/cross/src/util.c @@ -6,7 +6,7 @@ static struct montis_server *server_from_ctx(void *ctx) { - struct montis_server *server = wl_container_of(ctx, server, soul); + struct montis_server *server = wl_container_of(ctx, server, world); return server; } @@ -35,7 +35,7 @@ static struct montis_toplevel *toplevel_at(struct montis_server *server, return tree ? tree->node.data : NULL; } -void *arksoul_toplevel_at(void *ctx, double lx, double ly) +void *arkworld_toplevel_at(void *ctx, double lx, double ly) { if (!ctx) { return NULL; @@ -44,7 +44,7 @@ void *arksoul_toplevel_at(void *ctx, double lx, double ly) return toplevel_at(server, lx, ly); } -void arksoul_get_toplevel_position(void *toplevel, double *x, double *y) +void arkworld_get_toplevel_position(void *toplevel, double *x, double *y) { if (!toplevel || !x || !y) { return; @@ -54,7 +54,7 @@ void arksoul_get_toplevel_position(void *toplevel, double *x, double *y) *y = tl->scene_tree->node.y; } -void arksoul_set_toplevel_position(void *toplevel, double x, double y) +void arkworld_set_toplevel_position(void *toplevel, double x, double y) { if (!toplevel) { return; @@ -63,7 +63,7 @@ void arksoul_set_toplevel_position(void *toplevel, double x, double y) wlr_scene_node_set_position(&tl->scene_tree->node, (int)x, (int)y); } -void arksoul_get_toplevel_geometry(void *toplevel, double *x, double *y, +void arkworld_get_toplevel_geometry(void *toplevel, double *x, double *y, double *w, double *h) { if (!toplevel || !x || !y || !w || !h) { @@ -78,7 +78,7 @@ void arksoul_get_toplevel_geometry(void *toplevel, double *x, double *y, *h = geo_box.height; } -void arksoul_set_toplevel_geometry(void *toplevel, double x, double y, +void arkworld_set_toplevel_geometry(void *toplevel, double x, double y, double w, double h) { if (!toplevel) { @@ -89,7 +89,7 @@ void arksoul_set_toplevel_geometry(void *toplevel, double x, double y, wlr_xdg_toplevel_set_size(tl->xdg_toplevel, (int)w, (int)h); } -void arksoul_warp_cursor(void *ctx, double lx, double ly) +void arkworld_warp_cursor(void *ctx, double lx, double ly) { if (!ctx) { return; @@ -98,7 +98,7 @@ void arksoul_warp_cursor(void *ctx, double lx, double ly) wlr_cursor_warp(server->cursor, NULL, lx, ly); } -void arksoul_focus_toplevel(void *toplevel) +void arkworld_focus_toplevel(void *toplevel) { if (!toplevel) { return; |