Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

button.h

Go to the documentation of this file.
00001 
00002 // Flash Plugin and Player
00003 // Copyright (C) 1998 Olivier Debon
00004 // 
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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         // Builtin
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 /* _BUTTON_H_ */

Generated on Sat Nov 5 16:15:34 2005 for OPIE by  doxygen 1.4.2