1 /*******************************************************************
\r
5 * Author: Peter van Sebille (peter@yipton.net)
\r
7 * Modified/adapted for picodriveN by notaz, 2006
\r
9 * (c) Copyright 2006, notaz
\r
10 * (c) Copyright 2001, Peter van Sebille
\r
11 * All Rights Reserved
\r
13 *******************************************************************/
\r
18 #include <coecntrl.h>
\r
19 #include <coeccntx.h>
\r
20 #include <coemain.h>
\r
22 #include <eikappui.h>
\r
27 #include "../ClientServer.h"
\r
28 #include "SimpleClient.h"
\r
29 #include "picodriven.hrh"
\r
31 const TUid KUidPicolApp = { 0x1000C193 };
\r
32 const TUid KUidPicolFOView = { 0x1000C194 };
\r
33 const TUid KUidPicolFCView = { 0x1000C195 };
\r
37 EScreenModeFlipOpen = 0,
\r
38 EScreenModeFlipClosed
\r
45 class CPicolDocument : public CEikDocument
\r
49 CPicolDocument(CEikApplication& aApp);
\r
52 private: // from CEikDocument
\r
53 CEikAppUi* CreateAppUiL();
\r
57 class CEPicolAppView : public CCoeControl // , public MCoeControlBrushContext
\r
61 void ConstructL(const TRect& aRect);
\r
64 void Draw(const TRect& aRect) const;
\r
66 //CWsBitmap* iBgImage;
\r
67 //TPoint iImagePosition;
\r
71 class CPicolViewBase : public CBase, public MCoeView
\r
75 CPicolViewBase(CEPicolAppView& aAppViewCtl) : iAppViewCtl(aAppViewCtl) {}
\r
76 //~CPicolViewBase();
\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
85 CEPicolAppView& iAppViewCtl;
\r
89 class CPicolFOView : public CPicolViewBase
\r
93 CPicolFOView(CEPicolAppView& aAppViewCtl) : CPicolViewBase(aAppViewCtl) {}
\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
102 class CPicolFCView : public CPicolViewBase
\r
106 CPicolFCView(CEPicolAppView& aAppViewCtl) : CPicolViewBase(aAppViewCtl) {}
\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
116 class CPicolAppUi : public CEikAppUi, public MGameWatcher
\r
123 public: // implements MGameWatcher
\r
124 void NotifyEmuDeath();
\r
125 void NotifyForcedExit();
\r
127 TBool EmuRunning() const;
\r
129 protected: // from CEikAppUi
\r
130 void HandleCommandL(TInt aCommand);
\r
131 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
\r
132 void HandleSystemEventL(const TWsEvent& aEvent);
\r
134 protected: // new stuf
\r
135 void DisplayAboutDialogL();
\r
136 void DisplayOpenROMDialogL();
\r
137 void DisplayConfigDialogL();
\r
138 void DisplayDebugDialogL();
\r
143 void RetrieveConfig();
\r
145 CGameRunner* iGameRunner;
\r
146 CExitForcer* iExitForcer; // makes sure emu process exits
\r
147 CThreadWatcher* iThreadWatcher1; // emu process helper thread watcher
\r
151 //void HandleScreenDeviceChangedL();
\r
152 //void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
\r
153 virtual void HandleApplicationSpecificEventL(TInt aType, const TWsEvent& aEvent);
\r
159 TBool iAfterConfigDialog;
\r
160 TTime iConfigDialogClosed;
\r
161 TPicoConfig iCurrentConfig;
\r
162 TPLauncherConfig iCurrentLConfig;
\r
164 CEPicolAppView* iAppView;
\r
165 CPicolFOView* iFOView;
\r
166 CPicolFCView* iFCView;
\r
171 class CPicolApplication : public CEikApplication
\r
173 private: // from CApaApplication
\r
174 CApaDocument* CreateDocumentL();
\r
175 TUid AppDllUid() const;
\r