Wrapper classes for the emwin library

Dependents:   app_emwin1 app_emwin2_pos lpc4088_ebb_gui_emwin

Committer:
embeddedartists
Date:
Mon Apr 14 08:38:33 2014 +0000
Revision:
1:0b16165ada7c
Parent:
0:316c181e9b65
Initialize uninitialized touchState in EwGui

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 1:0b16165ada7c 15
embeddedartists 1:0b16165ada7c 16 memset(&_touchState, 0, sizeof(GUI_PID_STATE));
embeddedartists 0:316c181e9b65 17 }
embeddedartists 0:316c181e9b65 18
embeddedartists 0:316c181e9b65 19 void EwGui::exec() {
embeddedartists 0:316c181e9b65 20 WM_Exec();
embeddedartists 0:316c181e9b65 21 }
embeddedartists 0:316c181e9b65 22
embeddedartists 0:316c181e9b65 23 void EwGui::execTouch() {
embeddedartists 0:316c181e9b65 24 int32_t x = 0, y = 0, z = 0;
embeddedartists 0:316c181e9b65 25
embeddedartists 0:316c181e9b65 26 getTouchValues(&x, &y, &z);
embeddedartists 0:316c181e9b65 27
embeddedartists 0:316c181e9b65 28 _touchState.x = x;
embeddedartists 0:316c181e9b65 29 _touchState.y = y;
embeddedartists 0:316c181e9b65 30 _touchState.Pressed = (z != 0) ? 1 : 0;
embeddedartists 0:316c181e9b65 31 GUI_PID_StoreState(&_touchState);
embeddedartists 0:316c181e9b65 32 }
embeddedartists 0:316c181e9b65 33
embeddedartists 0:316c181e9b65 34 void EwGui::init() {
embeddedartists 0:316c181e9b65 35
embeddedartists 0:316c181e9b65 36 if (!_initialized) {
embeddedartists 0:316c181e9b65 37
embeddedartists 0:316c181e9b65 38 // register class with porting layer
embeddedartists 0:316c181e9b65 39 ew_registerGuiHandle(this);
embeddedartists 0:316c181e9b65 40
embeddedartists 0:316c181e9b65 41 GUI_Init();
embeddedartists 0:316c181e9b65 42 _initialized = true;
embeddedartists 0:316c181e9b65 43
embeddedartists 0:316c181e9b65 44 // TODO:
embeddedartists 0:316c181e9b65 45 // GUI_CURSOR_Show();
embeddedartists 0:316c181e9b65 46 // GUI_CURSOR_Select(&GUI_CursorCrossL);
embeddedartists 0:316c181e9b65 47 }
embeddedartists 0:316c181e9b65 48
embeddedartists 0:316c181e9b65 49 }
embeddedartists 0:316c181e9b65 50
embeddedartists 0:316c181e9b65 51