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

flash.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 _FLASH_H_
00021 #define _FLASH_H_
00022 
00023 #define PLUGIN_NAME "Shockwave Flash"
00024 #define FLASH_VERSION_STRING "Version 0.4.10"
00025 
00026 /* Flags to pass to FlashExec */
00027 #define FLASH_WAKEUP 0x01
00028 #define FLASH_EVENT  0x02
00029 #define FLASH_CMD    0x04
00030 
00031 /* Mask to extract commands */
00032 #define FLASH_CMD_MASK 0xf0
00033 /* Commands */
00034 #define FLASH_STOP     0x10     /* Pause the movie */
00035 #define FLASH_CONT     0x20     /* Continue the movie after pause */
00036 #define FLASH_REWIND   0x30     /* Rewind the movie and pause */
00037 #define FLASH_STEP     0x40     /* Frame by frame operation */
00038 
00039 /* return codes of FlashExec */
00040 #define FLASH_STATUS_WAKEUP   0x01    /* FlashExec must be called again after a given time */
00041 
00042 struct FlashInfo {
00043         long frameRate;
00044         long frameCount;
00045         long frameWidth;
00046         long frameHeight;
00047         long version;
00048 };
00049 
00050 /* Player settings */
00051 #define PLAYER_LOOP     (1<<0)
00052 #define PLAYER_QUALITY  (1<<1)
00053 #define PLAYER_MENU     (1<<2)
00054 
00055 /* Parser status */
00056 #define FLASH_PARSE_ERROR     0
00057 #define FLASH_PARSE_START     1
00058 #define FLASH_PARSE_NEED_DATA 2
00059 #define FLASH_PARSE_EOM       4
00060 #define FLASH_PARSE_WAKEUP    8
00061 #define FLASH_PARSE_OOM       16      /* Out Of Memory */
00062 
00063 typedef void *FlashHandle;
00064 
00065 #if defined(__cplusplus) || defined(c_plusplus)
00066 extern "C" {
00067 #endif
00068 
00069 enum FlashEventType {
00070     FeNone,
00071     FeMouseMove,
00072     FeButtonPress,
00073     FeButtonRelease,
00074     FeRefresh,
00075     FeKeyPress,
00076     /* internal events */
00077     FeKeyRelease,
00078 };
00079 
00080 enum FlashKey {
00081     FeKeyUp = 1,
00082     FeKeyDown,
00083     FeKeyLeft,
00084     FeKeyRight,
00085     FeKeyEnter,
00086     FeKeyNext
00087 };
00088 
00089 
00090 
00091 typedef struct FlashEvent {
00092     enum FlashEventType type;
00093     int          x,y;           /* Mouse coordinates, 
00094                                    relative to upper-left window corner */
00095     enum FlashKey key;
00096 } FlashEvent;
00097 
00098 typedef struct FlashDisplay {
00099     void *pixels;
00100     int bpl;      /* bytes per line */
00101     int width;
00102     int height;
00103     int depth;
00104     int bpp;
00105     int flash_refresh;
00106     /* Clipping region */
00107     int clip_x, clip_y;
00108     int clip_width, clip_height;
00109 } FlashDisplay;
00110 
00111 extern FlashHandle FlashNew();
00112 extern void FlashGetInfo(FlashHandle fh, struct FlashInfo *fi);
00113 extern long FlashGraphicInit(FlashHandle fh, FlashDisplay *fd);
00114 extern void FlashSoundInit(FlashHandle fh, char *device);
00115 extern int  FlashParse(FlashHandle fh, int level, char *data, long size);
00116 extern long FlashExec(FlashHandle fh, long flag, FlashEvent *fe, struct timeval *wakeDate);
00117 extern void FlashClose(FlashHandle fh);
00118 extern void FlashSetGetUrlMethod(FlashHandle flashHandle, void (*getUrl)(char *, char *, void *), void *);
00119 extern void FlashSetGetSwfMethod(FlashHandle flashHandle, void (*getSwf)(char *url, int level, void *clientData), void *clientData);
00120 extern void FlashSetCursorOnOffMethod(FlashHandle flashHandle, void (*cursorOnOff)(int , void *), void *clientData);
00121 extern void FlashZoom(FlashHandle fh, int zoom);
00122 extern void FlashOffset(FlashHandle fh, int x, int y);
00123 extern void FlashSettings(FlashHandle fh, long settings);
00124 
00125 #if defined(__cplusplus) || defined(c_plusplus)
00126 };
00127 #endif
00128 
00129 #endif /* _FLASH_H_ */

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