/* SPDX-License-Identifier: GPL-2.0-only */
+#include <wayland-server-core.h>
+
struct wlr_scene_tree;
struct wlr_scene_rect;
-struct wl_listener;
struct multi_rect {
struct wlr_scene_tree *tree;
#include <strings.h>
#include <unistd.h>
#include <wlr/util/log.h>
+#include "common/list.h"
#include "common/mem.h"
#include "common/spawn.h"
#include "debug.h"
arg->base.key = xstrdup(key);
}
arg->value = xstrdup(value);
- wl_list_insert(action->args.prev, &arg->base.link);
+ wl_list_append(&action->args, &arg->base.link);
}
#include <stdlib.h>
#include <string.h>
#include <wlr/util/log.h>
+#include "common/list.h"
#include "common/mem.h"
#include "config/keybind.h"
#include "config/rcxml.h"
if (!k) {
return NULL;
}
- wl_list_insert(rc.keybinds.prev, &k->link);
+ wl_list_append(&rc.keybinds, &k->link);
k->keysyms = xmalloc(k->keysyms_len * sizeof(xkb_keysym_t));
memcpy(k->keysyms, keysyms, k->keysyms_len * sizeof(xkb_keysym_t));
wl_list_init(&k->actions);
#include <strings.h>
#include <unistd.h>
#include <wlr/util/log.h>
+#include "common/list.h"
#include "common/mem.h"
#include "config/mousebind.h"
#include "config/rcxml.h"
struct mousebind *m = znew(*m);
m->context = context_from_str(context);
if (m->context != LAB_SSD_NONE) {
- wl_list_insert(rc.mousebinds.prev, &m->link);
+ wl_list_append(&rc.mousebinds, &m->link);
}
wl_list_init(&m->actions);
return m;
#include <wayland-server-core.h>
#include <wlr/util/log.h>
#include "action.h"
+#include "common/list.h"
#include "common/mem.h"
#include "common/nodename.h"
#include "common/string-helpers.h"
"nodename: '%s' content: '%s'", nodename, content);
} else if (!strcmp(nodename, "name.action")) {
current_keybind_action = action_create(content);
- wl_list_insert(current_keybind->actions.prev,
+ wl_list_append(¤t_keybind->actions,
¤t_keybind_action->link);
} else if (!current_keybind_action) {
wlr_log(WLR_ERROR, "expect <action name=\"\"> element first. "
mousebind_event_from_str(content);
} else if (!strcmp(nodename, "name.action")) {
current_mousebind_action = action_create(content);
- wl_list_insert(current_mousebind->actions.prev,
+ wl_list_append(¤t_mousebind->actions,
¤t_mousebind_action->link);
} else if (!current_mousebind_action) {
wlr_log(WLR_ERROR, "expect <action name=\"\"> element first. "
} else if (!strcasecmp(nodename, "name.names.desktops")) {
struct workspace *workspace = znew(*workspace);
workspace->name = xstrdup(content);
- wl_list_insert(rc.workspace_config.workspaces.prev, &workspace->link);
+ wl_list_append(&rc.workspace_config.workspaces, &workspace->link);
} else if (!strcasecmp(nodename, "popupTime.desktops")) {
rc.workspace_config.popuptime = atoi(content);
}
}
action = action_create(key_combos[i].action);
- wl_list_insert(k->actions.prev, &action->link);
+ wl_list_append(&k->actions, &action->link);
if (key_combos[i].command) {
action_arg_add_str(action, NULL, key_combos[i].command);
}
action = action_create(current->action);
- wl_list_insert(m->actions.prev, &action->link);
+ wl_list_append(&m->actions, &action->link);
if (current->command) {
action_arg_add_str(action, NULL, current->command);
if (!wl_list_length(&rc.workspace_config.workspaces)) {
struct workspace *workspace = znew(*workspace);
workspace->name = xstrdup("Default");
- wl_list_insert(rc.workspace_config.workspaces.prev, &workspace->link);
+ wl_list_append(&rc.workspace_config.workspaces, &workspace->link);
}
if (rc.workspace_config.popuptime == INT_MIN) {
rc.workspace_config.popuptime = 1000;
// SPDX-License-Identifier: GPL-2.0-only
#include "config.h"
#include <assert.h>
+#include "common/list.h"
+#include "common/scene-helpers.h"
#include "labwc.h"
#include "layers.h"
#include "node.h"
#include "ssd.h"
-#include "common/scene-helpers.h"
#include "workspaces.h"
static void
cursor_update_focus(view->server);
}
-static void
-wl_list_insert_tail(struct wl_list *list, struct wl_list *elm)
-{
- elm->prev = list->prev;
- elm->next = list;
- list->prev = elm;
- elm->prev->next = elm;
-}
-
void
desktop_move_to_back(struct view *view)
{
return;
}
wl_list_remove(&view->link);
- wl_list_insert_tail(&view->server->views, &view->link);
+ wl_list_append(&view->server->views, &view->link);
}
void
#include <wayland-server.h>
#include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/util/log.h>
+#include "common/list.h"
#include "common/mem.h"
#include "layers.h"
#include "labwc.h"
return;
}
- wl_list_insert(output->layers[layer_surface->pending.layer].prev,
+ wl_list_append(&output->layers[layer_surface->pending.layer],
&surface->link);
/*
* Temporarily set the layer's current state to pending so that
#include <strings.h>
#include <wayland-server-core.h>
#include <wlr/util/log.h>
+#include "action.h"
#include "common/buf.h"
#include "common/font.h"
+#include "common/list.h"
#include "common/mem.h"
#include "common/nodename.h"
#include "common/scaled_font_buffer.h"
#include "common/string-helpers.h"
#include "labwc.h"
#include "menu/menu.h"
-#include "theme.h"
-#include "action.h"
#include "node.h"
+#include "theme.h"
#define MENUWIDTH (110)
#define MENU_ITEM_PADDING_Y (4)
*/
} else if (!strcmp(nodename, "name.action")) {
current_item_action = action_create(content);
- wl_list_insert(current_item->actions.prev, ¤t_item_action->link);
+ wl_list_append(¤t_item->actions, ¤t_item_action->link);
} else if (!current_item_action) {
wlr_log(WLR_ERROR, "expect <action name=\"\"> element first. "
"nodename: '%s' content: '%s'", nodename, content);
// SPDX-License-Identifier: GPL-2.0-only
#include <assert.h>
+#include "common/list.h"
#include "common/mem.h"
#include "labwc.h"
-#include "ssd.h"
#include "node.h"
+#include "ssd.h"
/* Internal helpers */
static void
{
struct ssd_part *part = znew(*part);
part->type = type;
- wl_list_insert(part_list->prev, &part->link);
+ wl_list_append(part_list, &part->link);
return part;
}
#include <stdlib.h>
#include <string.h>
#include <strings.h>
-#include "labwc.h"
#include "common/font.h"
#include "common/graphic-helpers.h"
+#include "common/list.h"
#include "common/mem.h"
+#include "labwc.h"
#include "workspaces.h"
/* Internal helpers */
workspace->server = server;
workspace->name = xstrdup(name);
workspace->tree = wlr_scene_tree_create(server->view_tree);
- wl_list_insert(server->workspaces.prev, &workspace->link);
+ wl_list_append(&server->workspaces, &workspace->link);
if (!server->workspace_current) {
server->workspace_current = workspace;
} else {
// SPDX-License-Identifier: GPL-2.0-only
+#include "common/list.h"
#include "common/mem.h"
#include "labwc.h"
/* Stack new surface on top */
wlr_xwayland_surface_restack(xsurface, NULL, XCB_STACK_MODE_ABOVE);
- wl_list_insert(unmanaged->server->unmanaged_surfaces.prev,
- &unmanaged->link);
+ wl_list_append(&unmanaged->server->unmanaged_surfaces, &unmanaged->link);
wl_signal_add(&xsurface->events.set_geometry, &unmanaged->set_geometry);
unmanaged->set_geometry.notify = unmanaged_handle_set_geometry;