00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef _BUTTON_H_
00021 #define _BUTTON_H_
00022
00023 struct ButtonRecord {
00024 ButtonState state;
00025 Character *character;
00026 long layer;
00027 Matrix buttonMatrix;
00028 Cxform *cxform;
00029
00030 struct ButtonRecord *next;
00031 };
00032
00033 struct Condition {
00034 long transition;
00035 ActionRecord *actions;
00036
00037 Condition *next;
00038 };
00039
00040 class Button : public Character {
00041 public:
00042 long defLevel;
00043
00044 ButtonRecord *buttonRecords;
00045 ActionRecord *actionRecords;
00046 Condition *conditionList;
00047
00048 long isMenu;
00049
00050 Sound *sound[4];
00051
00052 Button(long id, int level = 1);
00053 ~Button();
00054 void addActionRecord( ActionRecord *ar );
00055 void addButtonRecord( ButtonRecord *br );
00056 void addCondition( long transition );
00057 int execute(GraphicDevice *gd, Matrix *matrix,
00058 Cxform *cxform, ButtonState renderState);
00059 ActionRecord *getActionFromTransition(ButtonState currentState,
00060 ButtonState old);
00061 void getRegion(GraphicDevice *gd, Matrix *matrix,
00062 void *id, ScanLineFunc scan_line_func);
00063 ButtonRecord *getButtonRecords();
00064 void setButtonSound(Sound *, int);
00065 void setButtonMenu(int);
00066
00067 ActionRecord *getActionRecords();
00068 Condition *getConditionList();
00069 Sound **getSounds();
00070
00071 void getBoundingBox(Rect *bb, DisplayListEntry *);
00072
00073 void updateButtonState(DisplayListEntry *);
00074 Character *getRenderCharacter(ButtonState state);
00075
00076
00077 int isButton() {
00078 return 1;
00079 };
00080
00081 #ifdef DUMP
00082 void dump(BitStream *);
00083 void dumpButtonRecords(BitStream *, int putCxform = 0);
00084 void dumpButtonConditions(BitStream *);
00085 #endif
00086 };
00087
00088 #endif