EmbeddedArtists AB / ewgui

Dependents:   app_emwin1 app_emwin2_pos lpc4088_ebb_gui_emwin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EwGui.cpp Source File

EwGui.cpp

00001 #include "EwGui.h"
00002 #include "mbed.h"
00003 
00004 
00005 #include "WM.h"
00006 
00007 #include "emwin_port.h"
00008 
00009 EwGui::EwGui() {
00010     _initialized = false;
00011     _penIsDown = false;;
00012 
00013     _touchX = 0;
00014     _touchY = 0;
00015     
00016     memset(&_touchState, 0, sizeof(GUI_PID_STATE));
00017 }
00018 
00019 void EwGui::exec() {
00020     WM_Exec();
00021 }
00022 
00023 void EwGui::execTouch() {
00024     int32_t x = 0, y = 0, z = 0;
00025 
00026     getTouchValues(&x, &y, &z);
00027 
00028     _touchState.x = x;
00029     _touchState.y = y;
00030     _touchState.Pressed = (z != 0) ? 1 : 0;
00031     GUI_PID_StoreState(&_touchState);
00032 }
00033 
00034 void EwGui::init() {
00035 
00036     if (!_initialized) {
00037 
00038         // register class with porting layer
00039         ew_registerGuiHandle(this);
00040 
00041         GUI_Init();
00042         _initialized = true;
00043 
00044         // TODO:
00045 //        GUI_CURSOR_Show();
00046 //        GUI_CURSOR_Select(&GUI_CursorCrossL);
00047     }
00048 
00049 }
00050 
00051