From aa6e80d9a1cf1f0a060966975aabe9cbf7157ca1 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Mon, 4 Jul 2022 01:09:13 +0200 Subject: [PATCH] [wip] convert to wlr_fbox --- include/action.h | 4 ++-- include/labwc.h | 2 +- include/private/action.h | 6 +++--- src/action.c | 18 +++++++++--------- src/config/rcxml.c | 12 ++++++------ src/view.c | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/action.h b/include/action.h index 1a45fa92..78351a3f 100644 --- a/include/action.h +++ b/include/action.h @@ -5,7 +5,7 @@ struct view; struct server; struct wl_list; -struct wlr_box; +struct wlr_fbox; struct action { struct wl_list link; /* struct keybinding.actions, @@ -18,7 +18,7 @@ struct action { struct action *action_create(const char *action_name); void action_arg_add_str(struct action *action, char *key, const char *value); -struct wlr_box *action_arg_add_box(struct action *action, char *name); +struct wlr_fbox *action_arg_add_fbox(struct action *action, char *name); void actions_run(struct view *activator, struct server *server, struct wl_list *actions, uint32_t resize_edges); void action_list_free(struct wl_list *action_list); diff --git a/include/labwc.h b/include/labwc.h index 09413391..ad8d5c47 100644 --- a/include/labwc.h +++ b/include/labwc.h @@ -435,7 +435,7 @@ void view_adjust_for_layout_change(struct view *view); void view_discover_output(struct view *view); void view_move_to_edge(struct view *view, const char *direction); void view_snap_to_edge(struct view *view, const char *direction); -void view_rel_move_resize_to(struct view *view, struct wlr_box *rel_box); +void view_rel_move_resize_to(struct view *view, struct wlr_fbox *rel_box); const char *view_get_string_prop(struct view *view, const char *prop); void view_update_title(struct view *view); diff --git a/include/private/action.h b/include/private/action.h index e58ee666..6c229181 100644 --- a/include/private/action.h +++ b/include/private/action.h @@ -7,7 +7,7 @@ enum action_arg_type { LAB_ACTION_ARG_STR = 0, - LAB_ACTION_ARG_BOX, + LAB_ACTION_ARG_FBOX, }; struct action_arg { @@ -22,9 +22,9 @@ struct action_arg_str { char *value; }; -struct action_arg_box { +struct action_arg_fbox { struct action_arg base; - struct wlr_box value; + struct wlr_fbox value; }; #endif /* __LABWC_PRIVATE_ACTION_H */ diff --git a/src/action.c b/src/action.c index 63c91c10..1ba8295e 100644 --- a/src/action.c +++ b/src/action.c @@ -76,11 +76,11 @@ action_str_from_arg(struct action_arg *arg) return ((struct action_arg_str *)arg)->value; } -static struct wlr_box * -action_box_from_arg(struct action_arg *arg) +static struct wlr_fbox * +action_fbox_from_arg(struct action_arg *arg) { - assert(arg->type == LAB_ACTION_ARG_BOX); - return &((struct action_arg_box *)arg)->value; + assert(arg->type == LAB_ACTION_ARG_FBOX); + return &((struct action_arg_fbox *)arg)->value; } static struct action_arg * @@ -345,7 +345,7 @@ actions_run(struct view *activator, struct server *server, break; } if (view) { - struct wlr_box *box = action_box_from_arg(arg); + struct wlr_fbox *box = action_fbox_from_arg(arg); view_rel_move_resize_to(view, box); } break; @@ -378,11 +378,11 @@ action_arg_add_str(struct action *action, char *key, const char *value) wl_list_insert(action->args.prev, &arg->base.link); } -struct wlr_box * -action_arg_add_box(struct action *action, char *name) +struct wlr_fbox * +action_arg_add_fbox(struct action *action, char *name) { - struct action_arg_box *arg = calloc(1, sizeof(*arg)); - arg->base.type = LAB_ACTION_ARG_BOX; + struct action_arg_fbox *arg = calloc(1, sizeof(*arg)); + arg->base.type = LAB_ACTION_ARG_FBOX; if (name) { arg->base.key = strdup(name); } diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 14168bcd..bc0a9483 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -32,7 +32,7 @@ static struct libinput_category *current_libinput_category; static const char *current_mouse_context; static struct action *current_keybind_action; static struct action *current_mousebind_action; -static struct wlr_box *current_action_box; +static struct wlr_fbox *current_action_box; enum font_place { FONT_PLACE_UNKNOWN = 0, @@ -49,13 +49,13 @@ fill_geo(char *key, char *content) { assert(current_action_box); if (!strcmp(key, "x.action")) { - current_action_box->x = atoi(content); + current_action_box->x = atof(content); } else if (!strcmp(key, "y.action")) { - current_action_box->y = atoi(content); + current_action_box->y = atof(content); } else if (!strcmp(key, "width.action")) { - current_action_box->width = atoi(content); + current_action_box->width = atof(content); } else if (!strcmp(key, "height.action")) { - current_action_box->height = atoi(content); + current_action_box->height = atof(content); } } @@ -85,7 +85,7 @@ fill_keybind(char *nodename, char *content) wl_list_insert(current_keybind->actions.prev, ¤t_keybind_action->link); if (!strcmp(content, "MoveResizeTo")) { - current_action_box = action_arg_add_box( + current_action_box = action_arg_add_fbox( current_keybind_action, NULL); } else { current_action_box = NULL; diff --git a/src/view.c b/src/view.c index 6f0c9c7b..1a39e953 100644 --- a/src/view.c +++ b/src/view.c @@ -661,7 +661,7 @@ view_edge_parse(const char *direction) /* Move and resize view based on percent output local values in rel_box */ void -view_rel_move_resize_to(struct view *view, struct wlr_box *rel_box) +view_rel_move_resize_to(struct view *view, struct wlr_fbox *rel_box) { assert(view); assert(rel_box);