diff -uNr FrameworkOrig/src/base/CContext.cpp Framework/src/base/CContext.cpp --- FrameworkOrig/src/base/CContext.cpp 2010-04-01 19:23:12.000000000 +0200 +++ Framework/src/base/CContext.cpp 2010-04-21 12:46:33.055914910 +0200 @@ -17,14 +17,17 @@ const char* TUNER_COMPONENT_NAME = "TunerComponent"; const char* NAVI_COMPONENT_NAME = "NaviComponent"; const char* CD_COMPONENT_NAME = "CdComponent"; +const char* HMIGL_COMPONENT_NAME = "HmiGLComponent"; const Int32 CContext::ADMIN_STACK_SIZE = 1000; const Int32 CContext::MDISP_STACK_SIZE = 1000; const Int32 CContext::HMI_STACK_SIZE = 1000; -const Int32 CContext::GL_STACK_SIZE = 120000; +//const Int32 CContext::GL_STACK_SIZE = 120000; +const Int32 CContext::GL_STACK_SIZE = 1000; const Int32 CContext::TUNER_STACK_SIZE = 1000; const Int32 CContext::NAVI_STACK_SIZE = 1000; const Int32 CContext::CD_STACK_SIZE = 1000; +const Int32 CContext::HMIGL_STACK_SIZE = 120000; const Int32 CContext::DEFAULT_STACK_SIZE = 1000; const CThread::EPriority CContext::ADMIN_PRIORITY = CThread::PRIORITY_NORM; @@ -33,6 +36,7 @@ const CThread::EPriority CContext::TUNER_PRIORITY = CThread::PRIORITY_NORM; const CThread::EPriority CContext::NAVI_PRIORITY = CThread::PRIORITY_NORM; const CThread::EPriority CContext::CD_PRIORITY = CThread::PRIORITY_NORM; +const CThread::EPriority CContext::HMIGL_PRIORITY = CThread::PRIORITY_NORM; const CThread::EPriority CContext::DEFAULT_PRIORITY = CThread::PRIORITY_NORM; // these are the values defining the cpu/thread affinities; @@ -44,6 +48,7 @@ const Int32 CContext::TUNER_AFFINITY = 4; const Int32 CContext::NAVI_AFFINITY = 5; const Int32 CContext::CD_AFFINITY = 6; +const Int32 CContext::HMIGL_AFFINITY = 3; const Int32 CContext::DEFAULT_AFFINITY = 7; const Int32 ADMIN_NORMALQUEUESIZE = 100; // Number of Messages @@ -52,6 +57,7 @@ const Int32 TUNER_NORMALQUEUESIZE = 100; const Int32 NAVI_NORMALQUEUESIZE = 100; const Int32 CD_NORMALQUEUESIZE = 100; +const Int32 HMIGL_NORMALQUEUESIZE = 100; const Int32 ADMIN_SYSTEMQUEUESIZE = 100; const Int32 MDISP_SYSTEMQUEUESIZE = 100; @@ -59,6 +65,7 @@ const Int32 TUNER_SYSTEMQUEUESIZE = 100; const Int32 NAVI_SYSTEMQUEUESIZE = 100; const Int32 CD_SYSTEMQUEUESIZE = 100; +const Int32 HMIGL_SYSTEMQUEUESIZE = 100; const Int32 ADMIN_INTERNALQUEUESIZE = 4; const Int32 MDISP_INTERNALQUEUESIZE = 4; @@ -66,6 +73,7 @@ const Int32 TUNER_INTERNALQUEUESIZE = 4; const Int32 NAVI_INTERNALQUEUESIZE = 4; const Int32 CD_INTERNALQUEUESIZE = 4; +const Int32 HMIGL_INTERNALQUEUESIZE = 4; const Int32 ADMIN_DCSIZE = 0; const Int32 MDISP_DCSIZE = 0; @@ -73,6 +81,7 @@ const Int32 TUNER_DCSIZE = MAKE_ALIGNMENT_SIZE(sizeof(CTunerDataContainer)); // in Byte const Int32 NAVI_DCSIZE = 0; // das wird ersetzt, wenn die Containter eingefuehrt werden const Int32 CD_DCSIZE = 0; +const Int32 HMIGL_DCSIZE = MAKE_ALIGNMENT_SIZE(sizeof(CHmiGlDataContainer)); const Int32 ADMIN_WDLIMIT = 2; const Int32 MDISP_WDLIMIT = 2; @@ -80,6 +89,7 @@ const Int32 TUNER_WDLIMIT = 2; const Int32 NAVI_WDLIMIT = 2; const Int32 CD_WDLIMIT = 2; +const Int32 HMIGL_WDLIMIT = 2; /// Groessenberechnungen durch den Compiler @@ -107,9 +117,13 @@ CD_CONTEXT_SIZE = HEADER_SIZE + QUEUE_SIZE(CD_NORMALQUEUESIZE) + QUEUE_SIZE(CD_SYSTEMQUEUESIZE) + QUEUE_SIZE(CD_INTERNALQUEUESIZE) + CD_DCSIZE, + HMIGL_CONTEXT_SIZE = HEADER_SIZE + QUEUE_SIZE(HMIGL_NORMALQUEUESIZE) + + QUEUE_SIZE(HMIGL_SYSTEMQUEUESIZE) + QUEUE_SIZE(HMIGL_INTERNALQUEUESIZE) + + HMIGL_DCSIZE, TOTAL_SIZE = ADMIN_CONTEXT_SIZE + MDISP_CONTEXT_SIZE + HMI_CONTEXT_SIZE + TUNER_CONTEXT_SIZE + NAVI_CONTEXT_SIZE + CD_CONTEXT_SIZE + + HMIGL_CONTEXT_SIZE }; static const CContextDescription sDescriptionTable[] = @@ -136,7 +150,10 @@ NAVI_DCSIZE, NAVI_WDLIMIT, NAVI_CONTEXT_SIZE }, { CD_INDEX, CD_COMPONENT_NAME, CContext::CD_AFFINITY, CContext::CD_STACK_SIZE, CContext::CD_PRIORITY, CD_NORMALQUEUESIZE, CD_SYSTEMQUEUESIZE, - CD_INTERNALQUEUESIZE, CD_DCSIZE, CD_WDLIMIT, CD_CONTEXT_SIZE } }; + CD_INTERNALQUEUESIZE, CD_DCSIZE, CD_WDLIMIT, CD_CONTEXT_SIZE }, +{ HMIGL_INDEX, HMIGL_COMPONENT_NAME, CContext::HMIGL_AFFINITY, CContext::HMIGL_STACK_SIZE, + CContext::HMIGL_PRIORITY, HMIGL_NORMALQUEUESIZE, HMIGL_SYSTEMQUEUESIZE, + HMIGL_INTERNALQUEUESIZE, HMIGL_DCSIZE, HMIGL_WDLIMIT, HMIGL_CONTEXT_SIZE } }; CComponentContext CContext::sContextTable[NUM_OF_COMPONENTS]; // wg. static @@ -199,6 +216,11 @@ return sContextTable[CD_INDEX]; } +CComponentContext& CContext::getHMIGLContext(void) +{ + return sContextTable[HMIGL_INDEX]; +} + CComponentContext& CContext::getContext(Component_Index Index) { return sContextTable[Index]; diff -uNr FrameworkOrig/src/base/CContext.h Framework/src/base/CContext.h --- FrameworkOrig/src/base/CContext.h 2010-04-01 19:23:12.000000000 +0200 +++ Framework/src/base/CContext.h 2010-04-21 12:45:56.263624839 +0200 @@ -33,6 +33,10 @@ #include "CTunerDataContainer.h" #endif +#ifndef _CHMIGLDATACONTAINER_H + #include "CHmiGlDataContainer.h" +#endif + #ifndef _FWASSERTION_H #include "FWAssertion.h" // for assertion #endif @@ -57,6 +61,7 @@ TUNER_INDEX, NAVI_INDEX, CD_INDEX, + HMIGL_INDEX, /** * Das hat immer als letzter Eintrag nach den adressierbaren * Komponenten zu folgen! @@ -104,6 +109,7 @@ static CComponentContext& getTunerContext(void); static CComponentContext& getNaviContext(void); static CComponentContext& getCdContext(void); + static CComponentContext& getHMIGLContext(void); static CComponentContext& getContext(Component_Index Index); static const Int32 ADMIN_STACK_SIZE; @@ -113,6 +119,7 @@ static const Int32 TUNER_STACK_SIZE; static const Int32 NAVI_STACK_SIZE; static const Int32 CD_STACK_SIZE; + static const Int32 HMIGL_STACK_SIZE; static const Int32 DEFAULT_STACK_SIZE; static const CThread::EPriority ADMIN_PRIORITY; @@ -121,6 +128,7 @@ static const CThread::EPriority TUNER_PRIORITY; static const CThread::EPriority NAVI_PRIORITY; static const CThread::EPriority CD_PRIORITY; + static const CThread::EPriority HMIGL_PRIORITY; static const CThread::EPriority DEFAULT_PRIORITY; static const Int32 ADMIN_AFFINITY; @@ -129,6 +137,7 @@ static const Int32 TUNER_AFFINITY; static const Int32 NAVI_AFFINITY; static const Int32 CD_AFFINITY; + static const Int32 HMIGL_AFFINITY; static const Int32 DEFAULT_AFFINITY; diff -uNr FrameworkOrig/src/components/CAdminComponent.cpp Framework/src/components/CAdminComponent.cpp --- FrameworkOrig/src/components/CAdminComponent.cpp 2010-04-01 20:58:59.000000000 +0200 +++ Framework/src/components/CAdminComponent.cpp 2010-04-22 15:44:25.664810465 +0200 @@ -54,9 +54,9 @@ /* * GL thread for graphics */ - CHmiGLThread gl; - CThread GLThread(gl, "GLThread", CContext::GL_STACK_SIZE, - CContext::DEFAULT_PRIORITY, CContext::HMI_AFFINITY, false); + CHmiGLThread gl(CContext::getHMIGLContext()); + CThread GLThread(gl, "HMI_GL_Component_Thread", CContext::HMIGL_STACK_SIZE, + CContext::HMIGL_PRIORITY, CContext::HMIGL_AFFINITY, false); GLThread.start(); CThread CHmiComponent_thread(hmi, diff -uNr FrameworkOrig/src/components/CAdminComponent.h Framework/src/components/CAdminComponent.h --- FrameworkOrig/src/components/CAdminComponent.h 2010-04-01 19:23:12.000000000 +0200 +++ Framework/src/components/CAdminComponent.h 2010-04-21 12:35:37.255677517 +0200 @@ -33,6 +33,10 @@ #include "CHmiGLThread.h" #endif +#ifndef _CHMIGLDATACONTAINER_H + #include "CHmiGlDataContainer.h" +#endif + #ifndef _CTUNERCOMPONENT_H #include "CTunerComponent.h" #endif diff -uNr FrameworkOrig/src/components/CHmiComponent.cpp Framework/src/components/CHmiComponent.cpp --- FrameworkOrig/src/components/CHmiComponent.cpp 2010-04-01 19:23:12.000000000 +0200 +++ Framework/src/components/CHmiComponent.cpp 2010-04-22 14:48:41.551623726 +0200 @@ -49,6 +49,9 @@ void CHmiComponent::handleKeyEvent(const CMessage& _m) { const IcmKeyCode keycode = (IcmKeyCode) _m.getOpcode(); // could be used for giving the 'x times-pressed' count + char newtitle[CHmiGlDataContainer::MAX_LINE_LENGTH]; + char newlines[CHmiGlDataContainer::NUM_LINES][CHmiGlDataContainer::MAX_LINE_LENGTH]; + CHmiGlDataContainer* hmiGlContPtr = static_cast( &(CContext::getHMIGLContext().getContainer()) ); switch (keycode) { case CD_KEY: { @@ -59,6 +62,23 @@ * to the GL component and setting its parameters in * the DC. */ + + strcpy(newtitle,"CD MENU"); + strcpy(newlines[CHmiGlDataContainer::LINE_ONE],"CD ONE"); + strcpy(newlines[CHmiGlDataContainer::LINE_TWO],"TRACK ONE"); + strcpy(newlines[CHmiGlDataContainer::LINE_THREE],"GUESS A TRACK TITLE"); + strcpy(newlines[CHmiGlDataContainer::LINE_FOUR],"ONE SECOND PLAYED"); + color4f cdBgCol = {0.0f,1.0f,0.0f,1.0f}; + hmiGlContPtr->setTitle(newtitle); + for(Int32 actLine=0;actLinesetLine(static_cast(actLine),newlines[actLine]); + } + hmiGlContPtr->setBackgroundColor(cdBgCol); + CMessage updMsg(CMessage::Internal_App_Type); + updMsg.setSenderID(HMI_INDEX); + updMsg.setReceiverID(HMIGL_INDEX); + CContext::getMDispContext().getInternalQueue().add(updMsg,false); } break; @@ -70,6 +90,22 @@ * to the GL component and setting its parameters in * the DC. */ + strcpy(newtitle,"TUNER MENU"); + strcpy(newlines[CHmiGlDataContainer::LINE_ONE],"SUPER STATION"); + strcpy(newlines[CHmiGlDataContainer::LINE_TWO],"FREQ X MHZ"); + strcpy(newlines[CHmiGlDataContainer::LINE_THREE],"RDS SAYS NICE WEATHER TODAY"); + strcpy(newlines[CHmiGlDataContainer::LINE_FOUR],""); + color4f tunerBgCol = {0.0f,0.0f,1.0f,1.0f}; + hmiGlContPtr->setTitle(newtitle); + for(Int32 actLine=0;actLinesetLine(static_cast(actLine),newlines[actLine]); + } + hmiGlContPtr->setBackgroundColor(tunerBgCol); + CMessage updMsg(CMessage::Internal_App_Type); + updMsg.setSenderID(HMI_INDEX); + updMsg.setReceiverID(HMIGL_INDEX); + CContext::getMDispContext().getInternalQueue().add(updMsg,false); } break; diff -uNr FrameworkOrig/src/components/CHmiComponent.h Framework/src/components/CHmiComponent.h --- FrameworkOrig/src/components/CHmiComponent.h 2010-04-01 21:00:27.000000000 +0200 +++ Framework/src/components/CHmiComponent.h 2010-04-22 14:58:50.319592697 +0200 @@ -25,6 +25,8 @@ #include "Events.h" #endif +#include "CHmiGlDataContainer.h" + #include #include #include diff -uNr FrameworkOrig/src/gl/CHmiGlDataContainer.cpp Framework/src/gl/CHmiGlDataContainer.cpp --- FrameworkOrig/src/gl/CHmiGlDataContainer.cpp 1970-01-01 01:00:00.000000000 +0100 +++ Framework/src/gl/CHmiGlDataContainer.cpp 2010-04-22 14:38:44.943764102 +0200 @@ -0,0 +1,53 @@ +/* + * CHmiGlDataContainer.cpp + * + * Created on: 21.04.2010 + * Author: sven + */ +#include "CHmiGlDataContainer.h" + +void CHmiGlDataContainer::setTitle(const char *atitle) +{ + mMutex.take(true); + memset(mTitle,'\0',MAX_LINE_LENGTH); + strcpy(mTitle,atitle); + mMutex.give(); +} +void CHmiGlDataContainer::setLine(const CHmiGlDataContainer::LINES lineIdx, const char *abody) +{ + mMutex.take(true); + memset(mLines[lineIdx],'\0',MAX_LINE_LENGTH); + strcpy(mLines[lineIdx],abody); + mMutex.give(); +} +void CHmiGlDataContainer::setBackgroundColor(color4f& bgCol) +{ + mMutex.take(true); + for (UInt16 i=0;i<4;i++) { + mBackgroundColor[i] = bgCol[i]; + } + mMutex.give(); +} +bool CHmiGlDataContainer::getTitle(char* atitle) +{ + mMutex.take(true); + strcpy(atitle,mTitle); + mMutex.give(); + return true; +} +bool CHmiGlDataContainer::getLine(const CHmiGlDataContainer::LINES lineIdx, char* aline) +{ + mMutex.take(true); + strcpy(aline,mLines[lineIdx]); + mMutex.give(); + return true; +} +bool CHmiGlDataContainer::getBackgroundColor(color4f& aBgColor) +{ + mMutex.take(true); + for (UInt16 i=0;i<4;i++) { + aBgColor[i] = mBackgroundColor[i]; + } + mMutex.give(); + return true; +} diff -uNr FrameworkOrig/src/gl/CHmiGlDataContainer.h Framework/src/gl/CHmiGlDataContainer.h --- FrameworkOrig/src/gl/CHmiGlDataContainer.h 1970-01-01 01:00:00.000000000 +0100 +++ Framework/src/gl/CHmiGlDataContainer.h 2010-04-22 15:08:24.223581008 +0200 @@ -0,0 +1,57 @@ +/* + * CHmiGlDataContainer.h + * + * Created on: 21.04.2010 + * Author: sven + */ +#ifndef _CHMIGLDATACONTAINER_H +#define _CHMIGLDATACONTAINER_H + +#ifdef QNX +#ifdef EGL +#include +#include +#include +#elif GFX +#include "gfx.h" // QNX GF-Framework and freetype library +#endif +#elif LINUX +#include +#include +#endif + +#ifndef _CMUTEX_H + #include "CMutex.h" +#endif +#ifndef CCONTAINER_H_ + #include "CContainer.h" +#endif +#ifndef CFONTRENDERER_H_ + #include "CFontRenderer.h" +#endif + +#include + +typedef GLfloat color4f[4]; + +class CHmiGlDataContainer : public CContainer +{ +public: + enum LINES { + LINE_ONE, LINE_TWO, LINE_THREE, LINE_FOUR, NUM_LINES + }; + const static Int32 MAX_LINE_LENGTH=60; + void setTitle(const char*); + void setLine(const CHmiGlDataContainer::LINES, const char*); + void setBackgroundColor(color4f&); + bool getTitle(char*); + bool getLine(const CHmiGlDataContainer::LINES, char*); + bool getBackgroundColor(color4f&); +private: + CMutex mMutex; + char mTitle[MAX_LINE_LENGTH]; + char mLines[NUM_LINES][MAX_LINE_LENGTH]; + color4f mBackgroundColor; +}; + +#endif /* CHMIGLDATACONTAINER_H_ */ diff -uNr FrameworkOrig/src/gl/CHmiGLThread.cpp Framework/src/gl/CHmiGLThread.cpp --- FrameworkOrig/src/gl/CHmiGLThread.cpp 2010-04-01 21:00:52.000000000 +0200 +++ Framework/src/gl/CHmiGLThread.cpp 2010-04-22 15:28:14.352408837 +0200 @@ -13,6 +13,8 @@ #include "CHmiGLThread.h" #include +CHmiGLThread* CHmiGLThread::sInstancePtr; + #ifdef QNX #ifdef GFX GfxEglState CHmiGLThread::sGfxEglState; @@ -29,8 +31,32 @@ int width = WINDOW_WIDTH; int height = WINDOW_HEIGHT; +CHmiGLThread::CHmiGLThread(CComponentContext& theContext) : + mContext(theContext), mDispatcher(theContext.getNormalQueue(), + theContext.getSystemQueue(), theContext.getInternalQueue(), + theContext.getTriggerSemaphore()) +{ + CHmiGLThread::sInstancePtr = this; + mDispatcher.setHandler(*this); +} + +CHmiGLThread::~CHmiGLThread() +{ + stop(); +} + void CHmiGLThread::init() { + CHmiGlDataContainer* hmiGlContPtr = static_cast(&mContext.getContainer()); + char title[CHmiGlDataContainer::MAX_LINE_LENGTH]; + char body[CHmiGlDataContainer::MAX_LINE_LENGTH]; + strcpy(title,"EMBEDDED FRAMEWORKS"); + hmiGlContPtr->setTitle(title); + strcpy(body,"THIS IS THE BODY TEXT OF THE PANEL WHERE YOU CAN PRINT INFOS"); + hmiGlContPtr->setLine(CHmiGlDataContainer::LINE_ONE,body); + color4f initialBgColor = {0.38f,0.72f,1.0f,1.0f}; + hmiGlContPtr->setBackgroundColor(initialBgColor); + #ifdef QNX #ifdef GFX memset(&sGfxEglState, 0, sizeof(sGfxEglState)); // passiert im Konstrukturaufruf @@ -236,9 +262,11 @@ glutSwapBuffers(); glutPostRedisplay(); #endif - + DEBUG_PRINT("waiting for new message to dispatch"); + CHmiGLThread::getInstancePtr()->getDispatcher().dispatch(true); + DEBUG_PRINT("returned from dispatch"); //Polling - usleep(1500000); + //usleep(1500000); } /** @@ -287,29 +315,85 @@ WINDOW_WIDTH, WINDOW_HEIGHT, 0 /* top-right*/ }; - glColor4f(0.38, 0.72, 1, 1); // steelblue - + //glColor4f(0.38, 0.72, 1, 1); // steelblue + CHmiGlDataContainer* hmiGlContPtr = static_cast(&(CHmiGLThread::getInstancePtr()->getComponentContext().getContainer())); + color4f bg; + hmiGlContPtr->getBackgroundColor(bg); + glColor4f(bg[0],bg[1],bg[2],bg[3]); glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_SHORT, 0, vPanel); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - + char title[CHmiGlDataContainer::MAX_LINE_LENGTH]; + char lines[CHmiGlDataContainer::NUM_LINES][CHmiGlDataContainer::MAX_LINE_LENGTH]; + hmiGlContPtr->getTitle(title); + DEBUG_PRINT("Title: %s",title); + for(Int32 actLine = CHmiGlDataContainer::LINE_ONE; + actLine < CHmiGlDataContainer::NUM_LINES; + actLine++) { + hmiGlContPtr->getLine(static_cast(actLine),lines[actLine]); + DEBUG_PRINT("Line %d: %s",actLine,lines[actLine]); + } /* * draw child Elements * hard coded text and position */ #ifdef LINUX CFontRenderer mTitelText; - CFontRenderer mBodyText; + //CFontRenderer mBodyText; + CFontRenderer mLinesText[CHmiGlDataContainer::NUM_LINES]; mTitelText.setPosition((WINDOW_WIDTH/2)-CFontRenderer::CHAR_WIDTH*10, WINDOW_HEIGHT-CFontRenderer::CHAR_HEIGHT); - mBodyText.setPosition(70, WINDOW_HEIGHT/2); - - char titel[] = "EMBEDDED FRAMEWORKS"; - char body[] = "THIS IS THE BODY TEXT OF THE PANEL WHERE YOU CAN PRINT INFOS"; - mTitelText.printString(titel); - mBodyText.printString(body); + mTitelText.printString(title); + for(Int32 actLine = CHmiGlDataContainer::LINE_ONE; + actLine < CHmiGlDataContainer::NUM_LINES; + actLine++) { + mLinesText[actLine].setPosition(70, /*WINDOW_HEIGHT/2*/ WINDOW_HEIGHT - ( (CFontRenderer::CHAR_HEIGHT*2) + (CFontRenderer::CHAR_HEIGHT*2*actLine)) ); + mLinesText[actLine].printString(lines[actLine]); + } #endif glFlush(); // mHmiComponent->getCurrentDrawable()->draw(); } +void CHmiGLThread::handleMessage(const CMessage& msg) +{ + DEBUG_PRINT("%s handle message", mContext.getContextNamePtr()); + switch(msg.getMessageType()) + { + case CMessage::Key_Event_Type : + handleKeyEvent(msg); + break; + case CMessage::Internal_App_Type : + handleInternalEvent(msg); + break; + default: + break; + } +} +CDispatcher& CHmiGLThread::getDispatcher(void) +{ + return mDispatcher; +} +CComponentContext& CHmiGLThread::getComponentContext(void) +{ + return mContext; +} +CHmiGLThread* CHmiGLThread::getInstancePtr(void) +{ + return sInstancePtr; +} +void CHmiGLThread::handleKeyEvent(const CMessage& msg) +{ + +} +void CHmiGLThread::handleInternalEvent(const CMessage& msg) +{ + switch(msg.getSenderID()) { + case HMI_INDEX: { + + break; + } + default: + break; + } +} diff -uNr FrameworkOrig/src/gl/CHmiGLThread.h Framework/src/gl/CHmiGLThread.h --- FrameworkOrig/src/gl/CHmiGLThread.h 2010-04-01 19:23:12.000000000 +0200 +++ Framework/src/gl/CHmiGLThread.h 2010-04-22 15:26:56.143700277 +0200 @@ -14,6 +14,9 @@ #include #endif +#ifndef _IMESSAGEHANDLER_H + #include "IMessageHandler.h" +#endif #ifndef _IRUNNABLE_H #include "IRunnable.h" #endif @@ -32,12 +35,24 @@ #include "CFontRenderer.h" #endif +#ifndef _CDISPATCHER_H + #include "CDispatcher.h" +#endif + +#ifndef _CCONTEXT_H + #include "CContext.h" +#endif + +#include "CHmiGlDataContainer.h" + #include #include -class CHmiGLThread : public IRunnable +class CHmiGLThread : public IRunnable, public IMessageHandler { public: + CHmiGLThread(CComponentContext&); + ~CHmiGLThread(); virtual void init(); virtual void run(); virtual void stop(); @@ -46,6 +61,9 @@ virtual void reRun() {} virtual void goToStandby() {} + virtual void handleMessage(const CMessage& msg); + virtual void handleInternalEvent(const CMessage& msg); + virtual void handleKeyEvent(const CMessage& msg); /* must be static so it can * be called from the C-function * 'displayFunction()' defined in @@ -53,11 +71,19 @@ */ static void draw(); + static CHmiGLThread* getInstancePtr(void); + CComponentContext& getComponentContext(void); + CDispatcher& getDispatcher(void); #ifdef QNX #ifdef GFX static GfxEglState sGfxEglState; #endif #endif + + private: + CComponentContext& mContext; + CDispatcher mDispatcher; + static CHmiGLThread* sInstancePtr; }; #endif // CHMIGLTHREAD_H_