aboutsummaryrefslogtreecommitdiff
path: root/src/ui_txtwindow.h
diff options
context:
space:
mode:
authortoni <matzeton@googlemail.com>2016-07-04 15:36:07 +0200
committertoni <matzeton@googlemail.com>2016-07-04 15:36:07 +0200
commitcb6047b694a86f78723a613819677227f14e30c3 (patch)
tree4eb9c2f2339c5185fec81447bd832d4d4f0bd3d0 /src/ui_txtwindow.h
parent7248ec097b19828e047e83df89aa7bac4150c2cd (diff)
parentbc30ed7f5624f7d5ccc1e9937ed7bcb7faae9892 (diff)
Merge branch 'master' into jessie
Conflicts: main.c
Diffstat (limited to 'src/ui_txtwindow.h')
-rw-r--r--src/ui_txtwindow.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/ui_txtwindow.h b/src/ui_txtwindow.h
new file mode 100644
index 0000000..1e1bc3f
--- /dev/null
+++ b/src/ui_txtwindow.h
@@ -0,0 +1,55 @@
+#ifndef UI_TXTWINDOW_H
+#define UI_TXTWINDOW_H 1
+
+#include <ncurses.h>
+
+#include "ui.h"
+
+#define INITIAL_TITLE_LEN 32
+
+#define set_txtwindow_active(wnd, activate) wnd->active = activate;
+
+struct txtwindow {
+ unsigned int y;
+ unsigned int x;
+ unsigned int width;
+ unsigned int height;
+ bool active;
+ char *title;
+ size_t title_len;
+ char **text;
+ int (*window_func)(WINDOW *, struct txtwindow *, bool);
+ chtype attrs;
+ chtype text_attrs;
+};
+
+typedef int (*window_func)(WINDOW *, struct txtwindow *, bool);
+
+struct txtwindow *
+init_txtwindow(unsigned int x, unsigned int y, unsigned int width, unsigned int height, window_func cb_update);
+
+struct txtwindow *
+init_txtwindow_centered(unsigned int width, unsigned int height, window_func cb_update);
+
+void
+free_txtwindow(struct txtwindow *a);
+
+void
+register_txtwindow(struct txtwindow *a);
+
+void
+set_txtwindow_text(struct txtwindow *a, char *text);
+
+void
+set_txtwindow_title(struct txtwindow *a, const char *title);
+
+void
+set_txtwindow_color(struct txtwindow *a, chtype wnd, chtype txt);
+
+void
+set_txtwindow_pos(struct txtwindow *a, unsigned int x, unsigned int y);
+
+void
+set_txtwindow_dim(struct txtwindow *a, unsigned int w, unsigned int h);
+
+#endif