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

character.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 _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 // Character definition
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 *);  // Display, play or whatever
00047         virtual int              isButton(void);        // True if Character is a button
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();       // Reset internal state of object
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();    // Return tagId
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;  // Iteration variable for dictNextCharacter
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 /* _CHARACTER_H_ */

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