mirror of
https://github.com/labwc/labwc.git
synced 2026-04-10 08:21:07 -04:00
[wip] convert to wlr_fbox
This commit is contained in:
parent
7585c7c26a
commit
aa6e80d9a1
6 changed files with 22 additions and 22 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
18
src/action.c
18
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue