aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-06-12 12:34:22 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-06-12 12:34:22 -0700
commit6db18fdf24d4f91f208618de03a9ade8d21dc999 (patch)
tree95ec49c80a6361bff0ce996e7e0d96b18adb13da /sys/cmd
parenta79d1edc9ef2e29597faa723a05088a5d19ea8aa (diff)
straglers
Diffstat (limited to 'sys/cmd')
-rw-r--r--sys/cmd/menu/menu.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/sys/cmd/menu/menu.h b/sys/cmd/menu/menu.h
new file mode 100644
index 0000000..f558339
--- /dev/null
+++ b/sys/cmd/menu/menu.h
@@ -0,0 +1,38 @@
+/* See LICENSE file for copyright and license details. */
+#include <u.h>
+#include <libn.h>
+#include <time.h>
+#include <locale.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+#include <X11/extensions/Xinerama.h>
+#include <X11/Xft/Xft.h>
+
+#include "drw.h"
+
+/* macros */
+#define INTERSECT(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \
+ * MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
+#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
+#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
+
+
+/* enums */
+enum {
+ SchemeNorm,
+ SchemeSel,
+ SchemeOut,
+ SchemeLast
+}; /* color schemes */
+
+struct item {
+ char *text;
+ struct item *left, *right;
+ int out;
+};
+
+/* util.c */
+void fatal(const char *fmt, ...);
+void *ecalloc(size_t nmemb, size_t size);