FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
PluginWindowMacCG.h
1 /**********************************************************\
2 Original Author: Anson MacKeracher
3 
4 Created: Jul 12, 2010
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 2010 Anson MacKeracher, Firebreath development team
13 \**********************************************************/
14 
15 #ifndef H_PLUGINWINDOWMACCG
16 #define H_PLUGINWINDOWMACCG
17 
18 #include <Carbon/Carbon.h>
19 #include "PluginWindowMac.h"
20 
21 namespace FB {
22  class PluginWindowMacCG : public PluginWindowMac {
23  public:
24  PluginWindowMacCG();
25  virtual ~PluginWindowMacCG();
26 
27  NPError SetWindow(NPWindow* window);
28 
29  DrawingModel getDrawingModel() const { return DrawingModelCoreGraphics; }
30  void* getDrawingPrimitive() const { return m_cgContext.context; }
31  WindowRef getWindowRef() const { return (WindowRef) m_cgContext.window; }
32 
33  bool SendEvent(PluginEvent* evt);
34 
35  protected:
36  void DrawLabel(CGContextRef cgContext, FB::Rect clip);
37 
38  public:
39  NP_CGContext m_cgContext;
40  uint64_t m_count;
41  std::list<uint64_t> m_frames;
42  };
43 };
44 
45 #endif // H_PLUGINWINDOWMACCG