+#define WIN(node) ((win_t*)(node)->data)
+#define ROW(node) ((row_t*)(node)->data)
+#define COL(node) ((col_t*)(node)->data)
+#define FLT(node) ((flt_t*)(node)->data)
+#define DPY(node) ((dpy_t*)(node)->data)
+#define TAG(node) ((tag_t*)(node)->data)
+
+#define tag_foreach_col(tag, dpy, col, row, win) \
+ for (list_t *dpy = tag ->dpys; dpy; dpy = dpy->next) \
+ for (list_t *col = DPY(dpy)->cols; col; col = col->next) \
+ for (list_t *row = COL(col)->rows; row; row = row->next) \
+ for (win_t *win = ROW(row)->win; win; win = NULL)
+
+#define tag_foreach_flt(tag, dpy, flt, win) \
+ for (list_t *dpy = tag ->dpys; dpy; dpy = dpy->next) \
+ for (list_t *flt = DPY(dpy)->flts; flt; flt = flt->next) \
+ for (win_t *win = FLT(flt)->win; win; win = NULL) \
+
+/* Window management data
+ * wm_* macros represent the currently focused item
+ * _only_ wm_focus protects against NULL pointers */
+static wm_t *wm;
+#define wm_tag wm->tag
+#define wm_dpy wm->tag->dpy
+#define wm_col wm->tag->dpy->col
+#define wm_row wm->tag->dpy->col->row
+#define wm_flt wm->tag->dpy->flt
+#define wm_focus get_focus()
+