summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2014-01-20 23:36:20 +0100
committerQC <qball@gmpclient.org>2014-01-20 23:36:20 +0100
commit5e72018497207e3902bfd95e103b79ee4066c89f (patch)
tree49aa2f490af8ffb3e13d02d9b1e1af135b24d159 /include
parentf3a77c9b004c46c9a48f181315e39b7bfc4947ab (diff)
Split of run-dialog part in separate file.
Diffstat (limited to 'include')
-rw-r--r--include/run-dialog.h8
-rw-r--r--include/simpleswitcher.h38
2 files changed, 46 insertions, 0 deletions
diff --git a/include/run-dialog.h b/include/run-dialog.h
new file mode 100644
index 00000000..cbbce06c
--- /dev/null
+++ b/include/run-dialog.h
@@ -0,0 +1,8 @@
+#ifndef __RUN_DIALOG_H__
+#define __RUN_DIALOG_H__
+
+
+
+SwitcherMode run_switcher_dialog ( char **input );
+
+#endif
diff --git a/include/simpleswitcher.h b/include/simpleswitcher.h
new file mode 100644
index 00000000..dae7f894
--- /dev/null
+++ b/include/simpleswitcher.h
@@ -0,0 +1,38 @@
+#ifndef __SIMPLESWITCHER_H__
+#define __SIMPLESWITCHER_H__
+
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define NEAR(a,o,b) ((b) > (a)-(o) && (b) < (a)+(o))
+#define OVERLAP(a,b,c,d) (((a)==(c) && (b)==(d)) || MIN((a)+(b), (c)+(d)) - MAX((a), (c)) > 0)
+#define INTERSECT(x,y,w,h,x1,y1,w1,h1) (OVERLAP((x),(w),(x1),(w1)) && OVERLAP((y),(h),(y1),(h1)))
+
+
+typedef enum {
+ WINDOW_SWITCHER,
+ RUN_DIALOG,
+ MODE_EXIT
+} SwitcherMode;
+
+
+// window lists
+typedef struct {
+ Window *array;
+ void **data;
+ int len;
+} winlist;
+
+int menu( char **lines, char **input, char *prompt,
+ int selected, Time *time, int *shift, winlist *ids );
+
+
+/**
+ * Allocator wrappers
+ */
+void* allocate( unsigned long bytes );
+void* allocate_clear( unsigned long bytes );
+void* reallocate( void *ptr, unsigned long bytes );
+
+
+void catch_exit( __attribute__( ( unused ) ) int sig );
+#endif