Wrapper classes for the emwin library

Dependents:   app_emwin1 app_emwin2_pos lpc4088_ebb_gui_emwin

Revision:
0:316c181e9b65
Child:
1:0b16165ada7c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EwGui.cpp	Mon Dec 16 07:03:22 2013 +0000
@@ -0,0 +1,50 @@
+#include "EwGui.h"
+#include "mbed.h"
+
+
+#include "WM.h"
+
+#include "emwin_port.h"
+
+EwGui::EwGui() {
+    _initialized = false;
+    _penIsDown = false;;
+
+    _touchX = 0;
+    _touchY = 0;
+
+}
+
+void EwGui::exec() {
+    WM_Exec();
+}
+
+void EwGui::execTouch() {
+    int32_t x = 0, y = 0, z = 0;
+
+    getTouchValues(&x, &y, &z);
+
+    _touchState.x = x;
+    _touchState.y = y;
+    _touchState.Pressed = (z != 0) ? 1 : 0;
+    GUI_PID_StoreState(&_touchState);
+}
+
+void EwGui::init() {
+
+    if (!_initialized) {
+
+        // register class with porting layer
+        ew_registerGuiHandle(this);
+
+        GUI_Init();
+        _initialized = true;
+
+        // TODO:
+//        GUI_CURSOR_Show();
+//        GUI_CURSOR_Select(&GUI_CursorCrossL);
+    }
+
+}
+
+