renderers (interlace and stuff)
[picodrive.git] / platform / uiq2 / launcher / App.h
CommitLineData
cc68a136 1/*******************************************************************\r
2 *\r
3 * File: App.h\r
4 *\r
5 * Author: Peter van Sebille (peter@yipton.net)\r
6 *\r
7 * Modified/adapted for picodriveN by notaz, 2006\r
8 *\r
9 * (c) Copyright 2006, notaz\r
10 * (c) Copyright 2001, Peter van Sebille\r
11 * All Rights Reserved\r
12 *\r
13 *******************************************************************/\r
14\r
15#ifndef __APP_H\r
16#define __APP_H\r
17\r
18#include <coecntrl.h>\r
19#include <coeccntx.h>\r
20#include <coemain.h>\r
21\r
22#include <eikappui.h>\r
23#include <eikapp.h>\r
24#include <eikdoc.h>\r
25\r
26#include "Engine.h"\r
27#include "../ClientServer.h"\r
28#include "SimpleClient.h"\r
29#include "picodriven.hrh"\r
30\r
31const TUid KUidPicolApp = { 0x1000C193 };\r
32const TUid KUidPicolFOView = { 0x1000C194 };\r
33const TUid KUidPicolFCView = { 0x1000C195 };\r
34\r
35enum\r
36{\r
37 EScreenModeFlipOpen = 0,\r
38 EScreenModeFlipClosed\r
39};\r
40\r
41\r
42//class CWsBitmap;\r
43\r
44\r
45class CPicolDocument : public CEikDocument\r
46{\r
47public:\r
48 ~CPicolDocument();\r
49 CPicolDocument(CEikApplication& aApp);\r
50 void ConstructL();\r
51\r
52private: // from CEikDocument\r
53 CEikAppUi* CreateAppUiL();\r
54};\r
55\r
56\r
57class CEPicolAppView : public CCoeControl // , public MCoeControlBrushContext\r
58{\r
59public:\r
60 ~CEPicolAppView();\r
61 void ConstructL(const TRect& aRect);\r
62\r
63private:\r
64 void Draw(const TRect& aRect) const;\r
65\r
66 //CWsBitmap* iBgImage;\r
67 //TPoint iImagePosition;\r
68};\r
69\r
70\r
71class CPicolViewBase : public CBase, public MCoeView\r
72{\r
73 public:\r
74\r
75 CPicolViewBase(CEPicolAppView& aAppViewCtl) : iAppViewCtl(aAppViewCtl) {}\r
76 //~CPicolViewBase();\r
77 \r
78 protected: \r
79\r
80 // implements MCoeView:\r
81 virtual void ViewActivatedL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/);\r
82 virtual void ViewDeactivated();\r
83 //virtual void ViewConstructL();\r
84 \r
85 CEPicolAppView& iAppViewCtl;\r
86};\r
87\r
88\r
89class CPicolFOView : public CPicolViewBase\r
90{\r
91 public:\r
92\r
93 CPicolFOView(CEPicolAppView& aAppViewCtl) : CPicolViewBase(aAppViewCtl) {}\r
94 //~CPicolFOView();\r
95 virtual TVwsViewId ViewId() const;\r
96 virtual TVwsViewIdAndMessage ViewScreenDeviceChangedL();\r
97 virtual TBool ViewScreenModeCompatible(TInt aScreenMode);\r
98 virtual void ViewActivatedL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/);\r
99};\r
100\r
101\r
102class CPicolFCView : public CPicolViewBase\r
103{\r
104 public:\r
105\r
106 CPicolFCView(CEPicolAppView& aAppViewCtl) : CPicolViewBase(aAppViewCtl) {}\r
107 //~CPicolFCView();\r
108 virtual TVwsViewId ViewId() const;\r
109 virtual TVwsViewIdAndMessage ViewScreenDeviceChangedL();\r
110 virtual TBool ViewScreenModeCompatible(TInt aScreenMode);\r
111 virtual void ViewActivatedL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/);\r
112};\r
113\r
114\r
115\r
116class CPicolAppUi : public CEikAppUi, public MGameWatcher\r
117{\r
118public:\r
119 CPicolAppUi();\r
120 void ConstructL();\r
121 ~CPicolAppUi();\r
122\r
123public: // implements MGameWatcher\r
124 void NotifyEmuDeath();\r
125 void NotifyForcedExit();\r
126\r
127 TBool EmuRunning() const;\r
128\r
129protected: // from CEikAppUi\r
130 void HandleCommandL(TInt aCommand);\r
131 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);\r
132 void HandleSystemEventL(const TWsEvent& aEvent);\r
133\r
134protected: // new stuf\r
135 void DisplayAboutDialogL();\r
136 void DisplayOpenROMDialogL();\r
137 void DisplayConfigDialogL();\r
138 void DisplayDebugDialogL();\r
139\r
140 void StopGame();\r
141 void RunGameL();\r
142 void SendConfig();\r
143 void RetrieveConfig();\r
144\r
145 CGameRunner* iGameRunner;\r
146 CExitForcer* iExitForcer; // makes sure emu process exits\r
147 CThreadWatcher* iThreadWatcher1; // emu process helper thread watcher\r
148 RServSession ss;\r
149\r
150private:\r
151 //void HandleScreenDeviceChangedL();\r
152 //void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);\r
153 virtual void HandleApplicationSpecificEventL(TInt aType, const TWsEvent& aEvent);\r
154\r
155private:\r
156 TBool iQuitting;\r
157 TBool iROMLoaded;\r
158 TBool iEmuRunning;\r
159 TBool iAfterConfigDialog;\r
160 TTime iConfigDialogClosed;\r
161 TPicoConfig iCurrentConfig;\r
162 TPLauncherConfig iCurrentLConfig;\r
163\r
164 CEPicolAppView* iAppView;\r
165 CPicolFOView* iFOView;\r
166 CPicolFCView* iFCView;\r
167};\r
168\r
169\r
170\r
171class CPicolApplication : public CEikApplication\r
172{\r
173private: // from CApaApplication\r
174 CApaDocument* CreateDocumentL();\r
175 TUid AppDllUid() const;\r
176};\r
177\r
178#endif\r