]> git.lizzy.rs Git - bspwm.git/blobdiff - helpers.h
Keep the real wm name on the supporting window
[bspwm.git] / helpers.h
index 345f9080b865548126d3da15bbfc01eebc3d9080..f1d1ae24a25d7e4ed94581287f194288dad1ddcc 100644 (file)
--- a/helpers.h
+++ b/helpers.h
@@ -1,24 +1,39 @@
 #ifndef _HELPERS_H
 #define _HELPERS_H
 
+#include <xcb/xcb.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdint.h>
+
 #define LENGTH(x)         (sizeof(x) / sizeof(*x))
 #define MAX(A, B)         ((A) > (B) ? (A) : (B))
 #define MIN(A, B)         ((A) < (B) ? (A) : (B))
 #define BOOLSTR(A)        ((A) ? "true" : "false")
 
-#define XCB_MOVE_RESIZE XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT
+#define XCB_CONFIG_WINDOW_X_Y               XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
+#define XCB_CONFIG_WINDOW_WIDTH_HEIGHT      XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT
+#define XCB_CONFIG_WINDOW_X_Y_WIDTH_HEIGHT  XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT
+
+#define MAXLEN    256
+#define INIT_CAP    8
+
+#define REMLEN(x)         (BUFSIZ - strlen(x) - 1)
+#define streq(s1, s2)     (strcmp((s1), (s2)) == 0)
 
-#if 1
-#  define PUTS(x)            puts(x);
-#  define PRINTF(x,...)      printf(x, ##__VA_ARGS__);
+#ifdef DEBUG
+#  define PUTS(x)         puts(x)
+#  define PRINTF(x,...)   printf(x, __VA_ARGS__)
 #else
-#  define PUTS(x)            ;
-#  define PRINTF(x)          ;
+#  define PUTS(x)         ((void)0)
+#  define PRINTF(x,...)   ((void)0)
 #endif
 
-typedef enum {
-    false,
-    true
-} bool;
+void warn(char *, ...);
+__attribute__((noreturn))
+void err(char *, ...);
+bool get_color(char *, uint32_t *);
+double distance(xcb_point_t, xcb_point_t);
 
 #endif