+/****************
+ * XCB Wrappers *
+ ****************/
+
+static xcb_query_tree_reply_t *do_query_tree(xcb_window_t win)
+{
+ xcb_query_tree_cookie_t cookie =
+ xcb_query_tree(conn, win);
+ xcb_query_tree_reply_t *reply =
+ xcb_query_tree_reply(conn, cookie, NULL);
+ if (!reply)
+ error("do_query_tree: %d - no reply", win);
+ printf("do_query_tree: %d\n", win);
+ return reply;
+}
+
+static xcb_get_geometry_reply_t *do_get_geometry(xcb_window_t win)
+{
+ xcb_get_geometry_cookie_t cookie =
+ xcb_get_geometry(conn, win);
+ xcb_get_geometry_reply_t *reply =
+ xcb_get_geometry_reply(conn, cookie, NULL);
+ if (!reply)
+ error("do_get_geometry: %d - no reply", win);
+ printf("do_get_geometry: %d - %dx%d @ %d,%d\n",
+ win, reply->width, reply->height, reply->x, reply->y);
+ return reply;
+}
+
+static xcb_get_window_attributes_reply_t *do_get_window_attributes(xcb_window_t win)
+{
+ xcb_get_window_attributes_cookie_t cookie =
+ xcb_get_window_attributes(conn, win);
+ xcb_get_window_attributes_reply_t *reply =
+ xcb_get_window_attributes_reply(conn, cookie, NULL);
+ if (!reply)
+ error("do_get_window_attributes: %d - no reply ", win);
+ printf("do_get_window_attributes: %d - %d\n",
+ win, reply->override_redirect);
+ return reply;
+}
+