-/* Mouse drag data */
-static drag_t move_mode;
-static list_t *move_lrow;
-static list_t *move_lcol;
-static ptr_t move_prev;
-static struct { int v, h; } move_dir;
-
-/* Window management data */
-static wm_t *wm;
+#define WIN(node) ((win_t*)(node)->data)
+#define ROW(node) ((row_t*)(node)->data)
+#define COL(node) ((col_t*)(node)->data)
+#define DPY(node) ((dpy_t*)(node)->data)
+#define TAG(node) ((tag_t*)(node)->data)
+
+#define tag_foreach(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) \
+
+/* Window management data
+ * wm_* macros represent the currently focused item
+ * _only_ wm_focus protects against NULL pointers */
+static wm_t *wm;