00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined(GROUPCLASS_H)
00024 #define GROUPCLASS_H
00025 #include <qstring.h>
00026 #include <qdatetime.h>
00027 #include <qptrlist.h>
00028
00029 #include "Root.h"
00030 #include "Ingredients.h"
00031 #include "BaseClasses.h"
00032 #include "BaseActions.h"
00033
00034 class MHVisible;
00035
00036
00037
00038
00039 class MHTimer {
00040 public:
00041 int m_nTimerId;
00042 QTime m_Time;
00043 };
00044
00045 class MHGroup : public MHRoot
00046 {
00047 public:
00048 MHGroup();
00049 virtual void PrintMe(FILE *fd, int nTabs) const;
00050
00051 virtual void Preparation(MHEngine *engine);
00052 virtual void Activation(MHEngine *engine);
00053 virtual void Deactivation(MHEngine *engine);
00054 virtual void Destruction(MHEngine *engine);
00055
00056 virtual MHRoot *FindByObjectNo(int n);
00057
00058
00059 virtual void SetTimer(int nTimerId, bool fAbsolute, int nMilliSecs, MHEngine *);
00060
00061 virtual void MakeClone(MHRoot *pTarget, MHRoot *pRef, MHEngine *engine);
00062
00063 protected:
00064 void Initialise(MHParseNode *p, MHEngine *engine);
00065
00066 int m_nOrigGCPriority;
00067 MHActionSequence m_StartUp, m_CloseDown;
00068 MHOwnPtrSequence <MHIngredient> m_Items;
00069 bool m_fIsApp;
00070 friend class MHEngine;
00071
00072
00073
00074
00075 QTime m_StartTime;
00076 QPtrList<MHTimer> m_Timers;
00077 int CheckTimers(MHEngine *engine);
00078
00079 int m_nLastId;
00080
00081 friend class MHEGEngine;
00082 };
00083
00084 class MHScene : public MHGroup
00085 {
00086 public:
00087 MHScene();
00088 void Initialise(MHParseNode *p, MHEngine *engine);
00089 virtual const char *ClassName() { return "Scene"; }
00090 virtual void PrintMe(FILE *fd, int nTabs) const;
00091 virtual void Activation(MHEngine *engine);
00092
00093
00094 virtual void SetInputRegister(int nReg, MHEngine *engine);
00095 protected:
00096 int m_nEventReg;
00097 int m_nSceneCoordX, m_nSceneCoordY;
00098 int m_nAspectRatioW, m_nAspectRatioH;
00099 bool m_fMovingCursor;
00100
00101
00102 friend class MHEngine;
00103 };
00104
00105
00106 class MHApplication : public MHGroup
00107 {
00108 public:
00109 MHApplication();
00110 virtual ~MHApplication();
00111 virtual const char *ClassName() { return "Application"; }
00112 void Initialise(MHParseNode *p, MHEngine *engine);
00113 virtual void PrintMe(FILE *fd, int nTabs) const;
00114 virtual bool IsShared() { return true; }
00115 virtual void Activation(MHEngine *engine);
00116 protected:
00117 MHActionSequence m_OnSpawnCloseDown, m_OnRestart;
00118
00119 int m_nCharSet;
00120 MHColour m_BGColour, m_TextColour, m_ButtonRefColour, m_HighlightRefColour, m_SliderRefColour;
00121 int m_nTextCHook, m_nIPCHook, m_nStrCHook, m_nBitmapCHook, m_nLineArtCHook;
00122 MHFontBody m_Font;
00123 MHOctetString m_FontAttrs;
00124
00125
00126 int m_nLockCount;
00127
00128
00129 MHSequence <MHVisible *> m_DisplayStack;
00130 int FindOnStack(const MHRoot *pVis);
00131
00132 MHScene *m_pCurrentScene;
00133 bool m_fRestarting;
00134 QString m_Path;
00135
00136
00137 friend class MHEngine;
00138 };
00139
00140 class MHLaunch: public MHElemAction
00141 {
00142 public:
00143 MHLaunch(): MHElemAction(":Launch") {}
00144 virtual void Perform(MHEngine *engine);
00145 };
00146
00147
00148 class MHQuit: public MHElemAction
00149 {
00150 public:
00151 MHQuit(): MHElemAction(":Quit") {}
00152 virtual void Perform(MHEngine *engine);
00153 };
00154
00155
00156 class MHSendEvent: public MHElemAction
00157 {
00158 public:
00159 MHSendEvent(): MHElemAction(":SendEvent") {}
00160 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00161 virtual void Perform(MHEngine *engine);
00162 virtual void PrintArgs(FILE *fd, int nTabs) const;
00163 protected:
00164 MHGenericObjectRef m_EventSource;
00165 enum EventType m_EventType;
00166 MHParameter m_EventData;
00167 };
00168
00169 class MHSetTimer: public MHElemAction
00170 {
00171 public:
00172 MHSetTimer(): MHElemAction(":SetTimer"), m_TimerType(ST_NoNewTimer) {}
00173 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00174 virtual void Perform(MHEngine *engine);
00175 protected:
00176 virtual void PrintArgs(FILE *fd, int nTabs) const;
00177 MHGenericInteger m_TimerId;
00178
00179
00180 enum { ST_NoNewTimer, ST_TimerAbsolute, ST_TimerRelative } m_TimerType;
00181 MHGenericInteger m_TimerValue;
00182 MHGenericBoolean m_AbsFlag;
00183 };
00184
00185 class MHSpawn: public MHElemAction
00186 {
00187 public:
00188 MHSpawn(): MHElemAction(":Spawn") {}
00189 virtual void Perform(MHEngine *engine);
00190 };
00191
00192
00193 class MHPersistent: public MHElemAction
00194 {
00195 public:
00196 MHPersistent(const char *name, bool fIsLoad): MHElemAction(name), m_fIsLoad(fIsLoad) {}
00197 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00198 virtual void Perform(MHEngine *engine);
00199 protected:
00200 virtual void PrintArgs(FILE *fd, int nTabs) const;
00201 bool m_fIsLoad;
00202 MHObjectRef m_Succeeded;
00203 MHOwnPtrSequence<MHObjectRef> m_Variables;
00204 MHGenericOctetString m_FileName;
00205 };
00206
00207
00208
00209 class MHTransitionTo: public MHElemAction
00210 {
00211 public:
00212 MHTransitionTo();
00213 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00214 virtual void Perform(MHEngine *engine);
00215 protected:
00216 virtual void PrintArgs(FILE *fd, int nTabs) const;
00217 bool m_fIsTagged;
00218 int m_nConnectionTag;
00219 int m_nTransitionEffect;
00220 };
00221
00222
00223 class MHLockScreen: public MHElemAction
00224 {
00225 public:
00226 MHLockScreen(): MHElemAction(":LockScreen") {}
00227 virtual void Perform(MHEngine *engine);
00228 };
00229
00230 class MHUnlockScreen: public MHElemAction
00231 {
00232 public:
00233 MHUnlockScreen(): MHElemAction(":UnlockScreen") {}
00234 virtual void Perform(MHEngine *engine);
00235 };
00236
00237 class MHGetEngineSupport: public MHElemAction
00238 {
00239 public:
00240 MHGetEngineSupport(): MHElemAction(":GetEngineSupport") {}
00241 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00242 virtual void Perform(MHEngine *engine);
00243 protected:
00244 virtual void PrintArgs(FILE *fd, int ) const { m_Feature.PrintMe(fd, 0); m_Answer.PrintMe(fd, 0); }
00245 MHGenericOctetString m_Feature;
00246 MHObjectRef m_Answer;
00247 };
00248
00249
00250 class MHSetInputRegister: public MHActionInt
00251 {
00252 public:
00253 MHSetInputRegister(): MHActionInt(":SetInputRegister") {}
00254 virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg) { pTarget->SetInputRegister(nArg, engine); };
00255 };
00256
00257
00258 #endif