]> git.sur5r.net Git - i3/i3/blobdiff - include/util.h
Make i3 compatible with the very latest xcb
[i3/i3] / include / util.h
index 5d954d39a217a3f7c1bae94fa33c8d1576475b12..514e10bde2884265fe59452c6de7b9202feda8a3 100644 (file)
@@ -8,7 +8,6 @@
  * See file LICENSE for license information.
  *
  */
-#include <xcb/xcb.h>
 #include <err.h>
 
 #include "data.h"
 } \
 while (0)
 
+#define CALL(obj, member, ...) obj->member(obj, ## __VA_ARGS__)
+
 int min(int a, int b);
 int max(int a, int b);
+bool rect_contains(Rect rect, uint32_t x, uint32_t y);
+Rect rect_add(Rect a, Rect b);
 
 /**
  * Updates *destination with new_value and returns true if it was changed or false
@@ -101,59 +104,25 @@ void check_error(xcb_connection_t *conn, xcb_void_cookie_t cookie,
  */
 char *convert_utf8_to_ucs2(char *input, int *real_strlen);
 
-#if 0
-/**
- * Returns the client which comes next in focus stack (= was selected before) for
- * the given container, optionally excluding the given client.
- *
- */
-Client *get_last_focused_client(xcb_connection_t *conn, Container *container,
-                                Client *exclude);
-#endif
-
-#if 0
-/**
- * Sets the given client as focused by updating the data structures correctly,
- * updating the X input focus and finally re-decorating both windows (to
- * signalize the user the new focus situation)
- *
- */
-void set_focus(xcb_connection_t *conn, Client *client, bool set_anyways);
-
-/**
- * Called when the user switches to another mode or when the container is
- * destroyed and thus needs to be cleaned up.
- *
- */
-void leave_stack_mode(xcb_connection_t *conn, Container *container);
-
-/**
- * Switches the layout of the given container taking care of the necessary
- * house-keeping
+/*
+ * This function resolves ~ in pathnames.
+ * It may resolve wildcards in the first part of the path, but if no match
+ * or multiple matches are found, it just returns a copy of path as given.
  *
  */
-void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode);
+char *resolve_tilde(const char *path);
 
-/**
- * Gets the first matching client for the given window class/window title.
- * If the paramater specific is set to a specific client, only this one
- * will be checked.
+/*
+ * Checks if the given path exists by calling stat().
  *
  */
-Client *get_matching_client(xcb_connection_t *conn,
-                            const char *window_classtitle, Client *specific);
-#endif
+bool path_exists(const char *path);
 
 /*
  * Restart i3 in-place
  * appends -a to argument list to disable autostart
  *
  */
-void i3_restart();
-
-#if defined(__OpenBSD__)
-/* OpenBSD does not provide memmem(), so we provide FreeBSD’s implementation */
-void *memmem(const void *l, size_t l_len, const void *s, size_t s_len);
-#endif
+void i3_restart(bool forget_layout);
 
 #endif