mirror of
https://github.com/labwc/labwc.git
synced 2026-04-10 08:21:07 -04:00
[wip] src/action.c: Add action_arg_box
This commit is contained in:
parent
9b49f19a73
commit
a0e22d5e07
3 changed files with 27 additions and 0 deletions
19
src/action.c
19
src/action.c
|
|
@ -73,6 +73,13 @@ 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)
|
||||
{
|
||||
assert(arg->type == LAB_ACTION_ARG_BOX);
|
||||
return &((struct action_arg_box *)arg)->value;
|
||||
}
|
||||
|
||||
static struct action_arg *
|
||||
action_get_first_arg(struct action *action)
|
||||
{
|
||||
|
|
@ -357,3 +364,15 @@ action_arg_add_str(struct action *action, char *key, const char *value)
|
|||
arg->value = strdup(value);
|
||||
wl_list_insert(action->args.prev, &arg->base.link);
|
||||
}
|
||||
|
||||
struct wlr_box *
|
||||
action_arg_add_box(struct action *action, char *name)
|
||||
{
|
||||
struct action_arg_box *arg = calloc(1, sizeof(*arg));
|
||||
arg->base.type = LAB_ACTION_ARG_BOX;
|
||||
if (name) {
|
||||
arg->base.key = strdup(name);
|
||||
}
|
||||
wl_list_insert(action->args.prev, &arg->base.link);
|
||||
return &arg->value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue