Wrapper classes for the emwin library

Dependents:   app_emwin1 app_emwin2_pos lpc4088_ebb_gui_emwin

Committer:
embeddedartists
Date:
Mon Dec 16 07:03:22 2013 +0000
Revision:
0:316c181e9b65
Child:
1:0b16165ada7c
First commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 0:316c181e9b65 1 #include "EwGui.h"
embeddedartists 0:316c181e9b65 2 #include "mbed.h"
embeddedartists 0:316c181e9b65 3
embeddedartists 0:316c181e9b65 4
embeddedartists 0:316c181e9b65 5 #include "WM.h"
embeddedartists 0:316c181e9b65 6
embeddedartists 0:316c181e9b65 7 #include "emwin_port.h"
embeddedartists 0:316c181e9b65 8
embeddedartists 0:316c181e9b65 9 EwGui::EwGui() {
embeddedartists 0:316c181e9b65 10 _initialized = false;
embeddedartists 0:316c181e9b65 11 _penIsDown = false;;
embeddedartists 0:316c181e9b65 12
embeddedartists 0:316c181e9b65 13 _touchX = 0;
embeddedartists 0:316c181e9b65 14 _touchY = 0;
embeddedartists 0:316c181e9b65 15
embeddedartists 0:316c181e9b65 16 }
embeddedartists 0:316c181e9b65 17
embeddedartists 0:316c181e9b65 18 void EwGui::exec() {
embeddedartists 0:316c181e9b65 19 WM_Exec();
embeddedartists 0:316c181e9b65 20 }
embeddedartists 0:316c181e9b65 21
embeddedartists 0:316c181e9b65 22 void EwGui::execTouch() {
embeddedartists 0:316c181e9b65 23 int32_t x = 0, y = 0, z = 0;
embeddedartists 0:316c181e9b65 24
embeddedartists 0:316c181e9b65 25 getTouchValues(&x, &y, &z);
embeddedartists 0:316c181e9b65 26
embeddedartists 0:316c181e9b65 27 _touchState.x = x;
embeddedartists 0:316c181e9b65 28 _touchState.y = y;
embeddedartists 0:316c181e9b65 29 _touchState.Pressed = (z != 0) ? 1 : 0;
embeddedartists 0:316c181e9b65 30 GUI_PID_StoreState(&_touchState);
embeddedartists 0:316c181e9b65 31 }
embeddedartists 0:316c181e9b65 32
embeddedartists 0:316c181e9b65 33 void EwGui::init() {
embeddedartists 0:316c181e9b65 34
embeddedartists 0:316c181e9b65 35 if (!_initialized) {
embeddedartists 0:316c181e9b65 36
embeddedartists 0:316c181e9b65 37 // register class with porting layer
embeddedartists 0:316c181e9b65 38 ew_registerGuiHandle(this);
embeddedartists 0:316c181e9b65 39
embeddedartists 0:316c181e9b65 40 GUI_Init();
embeddedartists 0:316c181e9b65 41 _initialized = true;
embeddedartists 0:316c181e9b65 42
embeddedartists 0:316c181e9b65 43 // TODO:
embeddedartists 0:316c181e9b65 44 // GUI_CURSOR_Show();
embeddedartists 0:316c181e9b65 45 // GUI_CURSOR_Select(&GUI_CursorCrossL);
embeddedartists 0:316c181e9b65 46 }
embeddedartists 0:316c181e9b65 47
embeddedartists 0:316c181e9b65 48 }
embeddedartists 0:316c181e9b65 49
embeddedartists 0:316c181e9b65 50