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(BITMAP_H)
00024 #define BITMAP_H
00025
00026 #include "Visible.h"
00027 #include "BaseActions.h"
00028
00029 #include "Presentable.h"
00030 #include "Ingredients.h"
00031 #include "Root.h"
00032 #include "BaseClasses.h"
00033
00034 class MHBitmapDisplay;
00035
00036 class MHBitmap : public MHVisible
00037 {
00038 public:
00039 MHBitmap();
00040 MHBitmap(const MHBitmap &ref);
00041 virtual const char *ClassName() { return "Bitmap"; }
00042 virtual ~MHBitmap();
00043 virtual void Initialise(MHParseNode *p, MHEngine *engine);
00044 virtual void PrintMe(FILE *fd, int nTabs) const;
00045
00046 virtual void Preparation(MHEngine *engine);
00047 virtual void ContentPreparation(MHEngine *engine);
00048 virtual void ContentArrived(const unsigned char *data, int length, MHEngine *engine);
00049
00050
00051 virtual void SetTransparency(int nTransPerCent, MHEngine *);
00052 virtual void ScaleBitmap(int xScale, int yScale, MHEngine *engine);
00053 virtual void SetBitmapDecodeOffset(int newXOffset, int newYOffset, MHEngine *engine);
00054 virtual void GetBitmapDecodeOffset(MHRoot *pXOffset, MHRoot *pYOffset);
00055 virtual MHIngredient *Clone(MHEngine *) { return new MHBitmap(*this); }
00056
00057
00058 virtual void Display(MHEngine *d);
00059 virtual QRegion GetVisibleArea();
00060 virtual QRegion GetOpaqueArea();
00061
00062 protected:
00063 bool m_fTiling;
00064 int m_nOrigTransparency;
00065
00066
00067 int m_nTransparency;
00068
00069 int m_nXDecodeOffset, m_nYDecodeOffset;
00070
00071 MHBitmapDisplay *m_pContent;
00072 };
00073
00074
00075 class MHSetTransparency: public MHActionInt {
00076 public:
00077 MHSetTransparency(): MHActionInt(":SetTransparency") {}
00078 virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg) { pTarget->SetTransparency(nArg, engine); }
00079 };
00080
00081 class MHScaleBitmap: public MHActionIntInt {
00082 public:
00083 MHScaleBitmap(): MHActionIntInt(":ScaleBitmap") {}
00084 virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg1, int nArg2) { pTarget->ScaleBitmap(nArg1, nArg2, engine); }
00085 };
00086
00087
00088 class MHSetBitmapDecodeOffset: public MHActionIntInt
00089 {
00090 public:
00091 MHSetBitmapDecodeOffset(): MHActionIntInt(":SetBitmapDecodeOffset") {}
00092 virtual void CallAction(MHEngine *engine, MHRoot *pTarget, int nArg1, int nArg2)
00093 { pTarget->SetBitmapDecodeOffset(nArg1, nArg2, engine); }
00094 };
00095
00096 class MHGetBitmapDecodeOffset: public MHActionObjectRef2
00097 {
00098 public:
00099 MHGetBitmapDecodeOffset(): MHActionObjectRef2(":GetBitmapDecodeOffset") {}
00100 virtual void CallAction(MHEngine *, MHRoot *pTarget, MHRoot *pArg1, MHRoot *pArg2) { pTarget->GetBitmapDecodeOffset(pArg1, pArg2); }
00101 };
00102
00103
00104 #endif