update copyright date
[gnash.git] / plugin / win32 / plugin.h
blob99dd8918fbbd5c92c9ba3a447abee9e47bb74912
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 // 2011 Free Software Foundation, Inc
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef GNASH_W32_PLUGIN_H
20 #define GNASH_W32_PLUGIN_H
22 #include <string>
23 #include "pluginbase.h"
25 #include "prinit.h"
26 #include "prlock.h"
27 #include "prcvar.h"
28 #include "prerr.h"
29 #include "prerror.h"
30 #include "prthread.h"
32 #include "log.h"
33 #include "rc.h"
34 #include "Player.h"
35 #include "URL.h"
36 #include "sound_handler.h"
37 #include "Renderer.h"
38 #include "Renderer_agg.h"
39 #include "MovieClip.h"
40 #include "movie_definition.h"
41 #include "movie_root.h"
42 #include "SystemClock.h"
43 #include "VM.h"
45 class nsPluginInstance : public nsPluginInstanceBase
47 public:
48 nsPluginInstance(nsPluginCreateData*);
49 virtual ~nsPluginInstance();
51 // We are required to implement these three methods.
52 NPBool init(NPWindow* aWindow);
53 void shut(void);
54 NPBool isInitialized(void) { return _initialized; }
56 NPError NewStream(NPMIMEType type, NPStream *stream, NPBool seekable,
57 uint16_t *stype);
58 NPError DestroyStream(NPStream *stream, NPError reason);
59 int32 Write(NPStream *stream, int32 offset, int32 len, void *buffer);
61 // locals
62 typedef std::map<std::string, std::string> VariableMap;
63 const char* getVersion();
64 void threadMain(void);
66 HWND getWindow() { return _window; }
67 int getWidth() { return _width; };
68 int getHeight() { return _height; };
69 int getRowStride() { return _rowstride; }
70 HDC getMemDC() { return _hMemDC; }
71 HBITMAP getBitmap() { return _bmp; }
72 unsigned char* getMemAddr() { return _memaddr; }
73 size_t getMemSize() { return _rowstride * _height; }
74 void notify_mouse_state(int x, int y, int buttons)
76 mouse_x = x;
77 mouse_y = y;
78 if (buttons >= 0) {
79 mouse_buttons = buttons;
83 private:
84 NPP _instance;
85 HWND _window;
86 NPBool _initialized;
87 NPBool _shutdown;
88 WNDPROC _oldWndProc;
90 NPStream* _stream;
91 std::string _url;
92 VariableMap _flashVars;
93 PRThread* _thread;
94 uint32_t _x;
95 uint32_t _y;
96 uint32_t _width;
97 uint32_t _height;
98 uint32_t _rowstride;
99 HDC _hMemDC;
100 BITMAPINFO _bmpInfo;
101 HBITMAP _bmp;
102 unsigned char* _memaddr;
104 std::auto_ptr<gnash::media::sound_handler> _sound_handler;
105 gnash::Renderer* _Renderer;
107 // Mouse state.
108 int mouse_x;
109 int mouse_y;
110 int mouse_buttons;
112 static void FSCommand_callback(gnash::MovieClip* movie, const std::string& command, const std::string& args);
115 #endif // __PLUGIN_H__