00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef _CHARACTER_H_
00021 #define _CHARACTER_H_
00022
00023 enum ObjectType {
00024 ShapeType,
00025 TextType,
00026 FontType,
00027 SoundType,
00028 BitmapType,
00029 SpriteType,
00030 ButtonType
00031 };
00032
00033 class DisplayListEntry;
00034
00035
00036
00037 class Character {
00038 long tagId;
00039 ObjectType type;
00040 char *name;
00041
00042 public:
00043 Character(ObjectType type, long tagId);
00044 virtual ~Character();
00045
00046 virtual int execute(GraphicDevice *, Matrix *, Cxform *);
00047 virtual int isButton(void);
00048 virtual int isSprite(void);
00049 virtual ActionRecord *eventHandler(GraphicDevice *, FlashEvent *);
00050 virtual void getRegion(GraphicDevice *gd, Matrix *matrix, void *id, ScanLineFunc scan_line_func);
00051 virtual void reset();
00052 virtual void getBoundingBox(Rect *bb, DisplayListEntry *de);
00053 #ifdef DUMP
00054 virtual void dump(BitStream *main);
00055
00056 int saved;
00057 #endif
00058
00059 long getTagId();
00060 ObjectType getType();
00061 char *getTypeString();
00062 char *getName();
00063 void setName(char *);
00064 };
00065
00066 struct sCharCell {
00067 Character *elt;
00068 struct sCharCell *next;
00069 };
00070
00071 class Dict {
00072 struct sCharCell *head;
00073 struct sCharCell *currentCell;
00074
00075 public:
00076 Dict();
00077 ~Dict();
00078
00079 void addCharacter(Character *character);
00080 void nameCharacter(long id, char *string);
00081 Character *getCharacter(long id);
00082 void dictRewind();
00083 Character *dictNextCharacter();
00084
00085 #ifdef DUMP
00086 void dictSetUnsaved();
00087 #endif
00088 };
00089
00090 #endif