home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / Freeware / Swf_Player / Lib / flash.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-17  |  4.0 KB  |  137 lines

  1. /*///////////////////////////////////////////////////////////
  2. // Flash Plugin and Player
  3. // Copyright (C) 1998 Olivier Debon
  4. // 
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. // 
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. // 
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18. // 
  19. ///////////////////////////////////////////////////////////// */
  20. #ifndef _FLASH_H_
  21. #define _FLASH_H_
  22.  
  23. #ifdef AMIGA
  24. #include "amiga_specific.h"
  25. #define AMIGAFLAG_MONO 1
  26. #endif
  27.  
  28. #define PLUGIN_NAME "Shockwave Flash"
  29. #define FLASH_VERSION_STRING "Version 0.4.10"
  30.  
  31. /* Flags to pass to FlashExec */
  32. #define FLASH_WAKEUP 0x01
  33. #define FLASH_EVENT  0x02
  34. #define FLASH_CMD    0x04
  35.  
  36. /* Mask to extract commands */
  37. #define FLASH_CMD_MASK 0xf0
  38. /* Commands */
  39. #define FLASH_STOP     0x10    /* Pause the movie */
  40. #define FLASH_CONT     0x20    /* Continue the movie after pause */
  41. #define FLASH_REWIND   0x30    /* Rewind the movie and pause */
  42. #define FLASH_STEP     0x40    /* Frame by frame operation */
  43.  
  44. /* return codes of FlashExec */
  45. #define FLASH_STATUS_WAKEUP   0x01    /* FlashExec must be called again after a given time */
  46.  
  47. struct FlashInfo {
  48.     long frameRate;
  49.     long frameCount;
  50.     long frameWidth;
  51.     long frameHeight;
  52.     long version;
  53. };
  54.  
  55. /* Player settings */
  56. #define PLAYER_LOOP    (1<<0)
  57. #define PLAYER_QUALITY    (1<<1)
  58. #define PLAYER_MENU    (1<<2)
  59.  
  60. /* Parser status */
  61. #define FLASH_PARSE_ERROR     0
  62. #define FLASH_PARSE_START     1
  63. #define FLASH_PARSE_NEED_DATA 2
  64. #define FLASH_PARSE_EOM       4
  65. #define FLASH_PARSE_WAKEUP    8
  66. #define FLASH_PARSE_OOM       16      /* Out Of Memory */
  67.  
  68. typedef void *FlashHandle;
  69.  
  70. #if defined(__cplusplus) || defined(c_plusplus)
  71. extern "C" {
  72. #endif
  73.  
  74. enum FlashEventType {
  75.     FeNone,
  76.     FeMouseMove,
  77.     FeButtonPress,
  78.     FeButtonRelease,
  79.     FeRefresh,
  80.     FeKeyPress,
  81.     /* internal events */
  82.     FeKeyRelease,
  83. };
  84.  
  85. enum FlashKey {
  86.     FeKeyUp = 1,
  87.     FeKeyDown,
  88.     FeKeyLeft,
  89.     FeKeyRight,
  90.     FeKeyEnter,
  91.     FeKeyNext
  92. };
  93.  
  94.  
  95.  
  96. typedef struct FlashEvent {
  97.     enum FlashEventType type;
  98.     int         x,y;        /* Mouse coordinates, 
  99.                                    relative to upper-left window corner */
  100.     enum FlashKey key;
  101. } FlashEvent;
  102.  
  103. typedef struct FlashDisplay {
  104.     void *pixels;
  105.     int bpl;      /* bytes per line */
  106.     int width;
  107.     int height;
  108.     int depth;
  109.     int bpp;
  110.     int flash_refresh;
  111.     /* Clipping region */
  112.     int clip_x, clip_y;
  113.     int clip_width, clip_height;
  114. } FlashDisplay;
  115.  
  116. extern FlashHandle FlashNew();
  117. extern void FlashGetInfo(FlashHandle fh, struct FlashInfo *fi);
  118. extern long FlashGraphicInit(FlashHandle fh, FlashDisplay *fd);
  119. extern void FlashSoundInit(FlashHandle fh, char *device);
  120. extern int  FlashParse(FlashHandle fh, int level, char *data, long size);
  121. extern long FlashExec(FlashHandle fh, long flag, FlashEvent *fe, struct myTimeval *wakeDate);
  122. extern void FlashClose(FlashHandle fh);
  123. extern void FlashSetGetUrlMethod(FlashHandle flashHandle, void (*getUrl)(char *, char *, void *), void *);
  124. extern void FlashSetGetSwfMethod(FlashHandle flashHandle, void (*getSwf)(char *url, int level, void *clientData), void *clientData);
  125. extern void FlashSetCursorOnOffMethod(FlashHandle flashHandle, void (*cursorOnOff)(int , void *), void *clientData);
  126. extern void FlashZoom(FlashHandle fh, int zoom);
  127. extern void FlashOffset(FlashHandle fh, int x, int y);
  128. extern void FlashSettings(FlashHandle fh, long settings);
  129.  
  130. extern void AmigaFlashSoundInit(FlashHandle fh, int flag);
  131.  
  132. #if defined(__cplusplus) || defined(c_plusplus)
  133. };
  134. #endif
  135.  
  136. #endif /* _FLASH_H_ */
  137.