00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(INGREDIENTS_H)
00023 #define INGREDIENTS_H
00024
00025 #include "Root.h"
00026 #include "BaseClasses.h"
00027 #include "Actions.h"
00028 #include "BaseActions.h"
00029
00030 class MHParseNode;
00031
00032
00033 class MHIngredient : public MHRoot
00034 {
00035 public:
00036 MHIngredient();
00037 MHIngredient(const MHIngredient &ref);
00038 virtual ~MHIngredient() {}
00039 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00040 virtual void PrintMe(FILE *fd, int nTabs) const;
00041 virtual bool InitiallyActive() { return m_fInitiallyActive; }
00042 virtual bool InitiallyAvailable() { return false; }
00043 virtual bool IsShared() { return m_fShared; }
00044
00045
00046 virtual void Preparation(MHEngine *engine);
00047 virtual void Destruction(MHEngine *engine);
00048 virtual void ContentPreparation(MHEngine *engine);
00049
00050
00051 virtual void SetData(const MHOctetString &included, MHEngine *engine);
00052 virtual void SetData(const MHContentRef &referenced, bool fSizeGiven, int size, bool fCCGiven, int cc, MHEngine *engine);
00053 virtual void Preload(MHEngine *engine) { Preparation(engine); }
00054 virtual void Unload(MHEngine *engine) { Destruction(engine); }
00055
00056
00057 virtual void ContentArrived(const unsigned char *, int, MHEngine *) { }
00058
00059 protected:
00060 bool m_fInitiallyActive;
00061 int m_nContentHook;
00062 bool m_fShared;
00063
00064
00065 enum { IN_NoContent, IN_IncludedContent, IN_ReferencedContent } m_ContentType;
00066 MHOctetString m_OrigIncludedContent;
00067 MHContentRef m_OrigContentRef;
00068 int m_nOrigContentSize;
00069 int m_nOrigCCPrio;
00070
00071 MHOctetString m_IncludedContent;
00072 MHContentRef m_ContentRef;
00073 int m_nContentSize;
00074 int m_nCCPrio;
00075 friend class MHEngine;
00076 };
00077
00078
00079 class MHFont : public MHIngredient
00080 {
00081 public:
00082 MHFont();
00083 virtual ~MHFont();
00084 virtual const char *ClassName() { return "Font"; }
00085 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00086 virtual void PrintMe(FILE *fd, int nTabs) const;
00087
00088 protected:
00089 };
00090
00091
00092 class MHCursorShape : public MHIngredient
00093 {
00094 public:
00095 MHCursorShape();
00096 virtual ~MHCursorShape();
00097 virtual const char *ClassName() { return "CursorShape"; }
00098 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00099 virtual void PrintMe(FILE *fd, int nTabs) const;
00100
00101 protected:
00102 };
00103
00104
00105 class MHPalette : public MHIngredient
00106 {
00107 public:
00108 MHPalette();
00109 virtual ~MHPalette();
00110 virtual const char *ClassName() { return "Palette"; }
00111 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00112 virtual void PrintMe(FILE *fd, int nTabs) const;
00113
00114 protected:
00115 };
00116
00117
00118
00119 class MHSetData: public MHElemAction
00120 {
00121 public:
00122 MHSetData(): MHElemAction(":SetData"), m_fIsIncluded(false),
00123 m_fSizePresent(false), m_fCCPriorityPresent(false) {}
00124 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00125 virtual void Perform(MHEngine *engine);
00126 virtual void PrintArgs(FILE *fd, int nTabs) const;
00127 protected:
00128
00129 bool m_fIsIncluded, m_fSizePresent, m_fCCPriorityPresent;
00130 MHGenericOctetString m_Included;
00131 MHGenericContentRef m_Referenced;
00132 MHGenericInteger m_ContentSize;
00133 MHGenericInteger m_CCPriority;
00134 };
00135
00136
00137 class MHPreload: public MHElemAction
00138 {
00139 public:
00140 MHPreload(): MHElemAction(":Preload") {}
00141 virtual void Perform(MHEngine *engine) { Target(engine)->Preload(engine); }
00142 };
00143
00144 class MHUnload: public MHElemAction
00145 {
00146 public:
00147 MHUnload(): MHElemAction(":Unload") {}
00148 virtual void Perform(MHEngine *engine) { Target(engine)->Unload(engine); }
00149 };
00150
00151
00152 class MHClone: public MHActionGenericObjectRef
00153 {
00154 public:
00155 MHClone(): MHActionGenericObjectRef(":Clone") {}
00156 virtual void CallAction(MHEngine *engine, MHRoot *pTarget, MHRoot *pRef);
00157 };
00158
00159 #endif