FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
NpapiPluginMac.h
1 /**********************************************************\
2 Original Author: Richard Bateman (taxilian)
3 
4 Created: Dec 3, 2009
5 License: Dual license model; choose one of two:
6  New BSD License
7  http://www.opensource.org/licenses/bsd-license.php
8  - or -
9  GNU Lesser General Public License, version 2.1
10  http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2009 PacketPass, Inc and the Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef H_FB_NPAPI_NPAPIPLUGINMAC
17 #define H_FB_NPAPI_NPAPIPLUGINMAC
18 
19 #include "NpapiPlugin.h"
20 #include "PluginWindowMac.h"
21 #include "PluginEventMac.h"
22 #include "NpapiTypes.h"
23 
24 
25 namespace FB { namespace Npapi {
26 
27  class NpapiPluginMac : public NpapiPlugin
28  {
29  public:
30  NpapiPluginMac(const NpapiBrowserHostPtr &host, const std::string& mimetype);
31  virtual ~NpapiPluginMac(void);
32 
33  void init(NPMIMEType pluginType, int16_t argc, char* argn[], char *argv[]);
34 
35  protected:
36  NPEventModel m_eventModel;
37  NPDrawingModel m_drawingModel;
38  FB::PluginWindowMacPtr pluginWin;
39  FB::PluginEventMacPtr pluginEvt;
40  public:
41  // These calls are proxied from the NpapiPluginModule to this object, and are
42  // the NPP_ functions given to the browser; essentially, the entrypoints for the
43  // plugin instance
44  NPError SetWindow(NPWindow* window);
45  int16_t HandleEvent(void* event);
46 
47  // This call is proxied from the TimerFunctor callback
48  void HandleTimerEvent();
49 
50  private:
51  int16_t GetValue(NPPVariable variable, void* value);
52  NPError SetValue(NPNVariable variable, void* value);
53  };
54 
55 }; }; // FB::Npapi
56 
57 #endif
58