00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef _DISPLAYLIST_H_
00021 #define _DISPLAYLIST_H_
00022
00023 class Character;
00024 class Program;
00025
00026 struct DisplayList;
00027
00028
00029 struct DisplayListEntry {
00030 Character *character;
00031 long depth;
00032 Matrix *matrix;
00033 Cxform *cxform;
00034 char *instanceName;
00035
00036
00037 ButtonState renderState;
00038 ButtonState oldState;
00039 Character *buttonCharacter;
00040 Matrix buttonMatrix;
00041 Matrix renderMatrix;
00042
00043 DisplayListEntry *next;
00044
00045 DisplayList *owner;
00046 };
00047
00048 struct DisplayList {
00049 DisplayListEntry *list;
00050 FlashMovie *movie;
00051 Rect bbox;
00052 int isSprite;
00053 public:
00054 DisplayList(FlashMovie *movie);
00055 ~DisplayList();
00056 DisplayListEntry *getList();
00057 void clearList();
00058 void placeObject(GraphicDevice *gd,Character *character, long depth, Matrix *matrix = 0, Cxform *cxform = 0, char *name = 0);
00059 Character *removeObject(GraphicDevice *gd, Character *character, long depth);
00060
00061 int render(GraphicDevice *gd, Matrix *m = 0, Cxform *cxform = 0);
00062 void updateBoundingBox(DisplayListEntry *);
00063 void updateButtons (FlashMovie *);
00064 void getBoundary(Rect *bb);
00065 int updateSprites();
00066 };
00067
00068 typedef void (*DisplayListFunc)(DisplayListEntry *e, void *opaque);
00069
00070 void updateButtons(FlashMovie *m);
00071 int computeActions(FlashMovie *m, Program **prog, ActionRecord **ar);
00072 void renderFocus(FlashMovie *movie);
00073
00074 typedef int (*ExploreButtonFunc)(void *opaque, Program *prg, DisplayListEntry *e);
00075 int exploreButtons(FlashMovie *movie, void *opaque, ExploreButtonFunc func);
00076 void updateBoundingBox(DisplayListEntry *e);
00077 void transformBoundingBox(Rect *bb, Matrix *matrix, Rect *boundary, int reset);
00078 void updateButtonState(DisplayListEntry *e, ButtonState state);
00079
00080 #endif