aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2013-07-01 10:10:45 +0200
committerJoel Bodenmann <joel@unormal.org>2013-07-01 10:10:45 +0200
commitde27a6c2db6f5fb97b3a5d07395a629c879abfbc (patch)
tree64a0d07071b4675bc8017ff43f540fec4b30ede0 /src
parentb8b149591f3b68d5f925a60e81ebc6c78f190e99 (diff)
downloaduGFX-de27a6c2db6f5fb97b3a5d07395a629c879abfbc.tar.gz
uGFX-de27a6c2db6f5fb97b3a5d07395a629c879abfbc.tar.bz2
uGFX-de27a6c2db6f5fb97b3a5d07395a629c879abfbc.zip
image widget implementation work in progress
Diffstat (limited to 'src')
-rw-r--r--src/gwin/gwin.mk1
-rw-r--r--src/gwin/image.c63
2 files changed, 64 insertions, 0 deletions
diff --git a/src/gwin/gwin.mk b/src/gwin/gwin.mk
index fb8fdfd1..9c114b3b 100644
--- a/src/gwin/gwin.mk
+++ b/src/gwin/gwin.mk
@@ -6,4 +6,5 @@ GFXSRC += $(GFXLIB)/src/gwin/gwin.c \
$(GFXLIB)/src/gwin/button.c \
$(GFXLIB)/src/gwin/slider.c \
$(GFXLIB)/src/gwin/checkbox.c \
+ $(GFXLIB)/src/gwin/image.c \
diff --git a/src/gwin/image.c b/src/gwin/image.c
new file mode 100644
index 00000000..35a0471d
--- /dev/null
+++ b/src/gwin/image.c
@@ -0,0 +1,63 @@
+/*
+ * This file is subject to the terms of the GFX License. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://chibios-gfx.com/license.html
+ */
+
+/**
+ * @file src/gwin/image.c
+ * @brief GWIN sub-system image code.
+ */
+
+#include "gfx.h"
+
+#if GFX_USE_GWIN && GWIN_NEED_IMAGE
+
+#include "gwin/class_gwin.h"
+
+static void _destroy(GWindowObject *gh) {
+ (void)gh;
+
+ return;
+}
+
+static void _redraw(GWindowObject *gh) {
+ (void)gh;
+
+ return;
+}
+
+static void _afterClear(GWindowObject *gh) {
+ ((GImageWidget *)gh)->cx = 0;
+ ((GImageWidget *)gh)->cy = 0;
+
+ return;
+}
+
+static const gwinVMT imageVMT = {
+ "Image", // The class name
+ sizeof(GImageWidget), // The object size
+ _destroy, // The destroy routine
+ _redraw, // The redraw routine
+ _afterClear, // The after-clear routine
+};
+
+GHandle gwinImageCreate(GImageWidget *widget, GWindowInit *pInit) {
+ if (!(widget = (GImageWidget *)_gwindowCreate(&widget->g, pInit, &imageVMT, 0)))
+ return 0;
+
+ widget->cx = 0;
+ widget->cy = 0;
+ gwinSetVisible((GHandle)widget, pInit->show);
+
+ return (GHandle)widget;
+}
+
+void gwinImageDisplay(GImageWidget *widget, gdispImage *image) {
+
+}
+
+#endif // GFX_USE_GWIN && GWIN_NEED_IMAGE
+/** @} */
+