summaryrefslogtreecommitdiff
path: root/src/gui/window.h
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-06-30 09:10:26 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-06-30 09:10:26 +0200
commit58df0d3172ad548b85627e5bb0b92a27a6072736 (patch)
tree76d621778d30e541ab5bdce539b38bed27833abf /src/gui/window.h
parent587f8d3dbf25408100496854c8803ce3c918ec4f (diff)
downloadabaos-58df0d3172ad548b85627e5bb0b92a27a6072736.tar.gz
abaos-58df0d3172ad548b85627e5bb0b92a27a6072736.tar.bz2
added a window to gui which is draggable by the mouse
Diffstat (limited to 'src/gui/window.h')
-rw-r--r--src/gui/window.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/window.h b/src/gui/window.h
new file mode 100644
index 0000000..3a0cc97
--- /dev/null
+++ b/src/gui/window.h
@@ -0,0 +1,25 @@
+#ifndef WINDOW_H
+#define WINDOW_H
+
+#include "composite_widget.h"
+
+#include <stdbool.h>
+
+typedef struct {
+ composite_widget_vtable_t base;
+} window_vtable_t;
+
+typedef struct {
+ composite_widget_t base;
+ window_vtable_t *vtable;
+ bool dragging;
+} window_t;
+
+void window_init( window_t *window, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color );
+
+void window_draw( void *obj, graphics_context_t *context );
+void window_on_mouse_down( void *obj, const int x, const int y );
+void window_on_mouse_up( void *obj, const int x, const int y );
+void window_on_mouse_move( void *obj, const int old_x, const int old_y, const int x, const int y );
+
+#endif // WINDOW_H