FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
DrawingEvents.h
1 /**********************************************************\
2 Original Author: Richard Bateman (taxilian)
3 
4 Created: Dec 7, 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 Richard Bateman, Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef H_FB_PLUGINEVENTS_DRAWINGEVENTS
17 #define H_FB_PLUGINEVENTS_DRAWINGEVENTS
18 
19 #include "PluginEvent.h"
20 #include "APITypes.h"
21 
22 #ifndef XP_MACOSX
23 #define CGContextRef void*
24 #define CGrafPtr void*
25 #else
26 #include "npapi.h"
27 #endif
28 
29 namespace FB {
30 
36  class ResizedEvent : public PluginEvent
37  {
38  };
39 
46  {
47  };
48 
55  class RefreshEvent : public PluginEvent
56  {
57  public:
58  RefreshEvent() { }
59 
60  RefreshEvent(FB::Rect inBounds)
61  : bounds(inBounds) {}
62  public:
63  FB::Rect bounds;
64  };
65 
72  class QuickDrawDraw : public RefreshEvent
73  {
74  public:
75  QuickDrawDraw(CGrafPtr port, const FB::Rect& bounds, const FB::Rect& clip)
76  : RefreshEvent(bounds), port(port), clip(clip) {}
77  public:
78  CGrafPtr port;
79  FB::Rect clip;
80  };
81 
89  {
90  public:
91  CoreGraphicsDraw(CGContextRef context, const FB::Rect& bounds, const FB::Rect& clip)
92  : RefreshEvent(bounds), context(context), clip(clip) {}
93  public:
94  CGContextRef context;
95  FB::Rect clip;
96  };
97 
104  {
105  public:
106  FocusChangedEvent(bool hasFocus) : m_hasFocus(hasFocus) { }
107  virtual ~FocusChangedEvent() { }
108 
109  bool hasFocus() { return m_hasFocus; }
110  protected:
111  bool m_hasFocus;
112  };
113 
120  class ContentsScaleFactorChangedEvent : public PluginEvent
121  {
122  public:
123  ContentsScaleFactorChangedEvent(double contentsScaleFactor)
124  : m_contentsScaleFactor(contentsScaleFactor) {}
125  virtual ~ContentsScaleFactorChangedEvent() { }
126 
127  double contentsScaleFactor() { return m_contentsScaleFactor; }
128  protected:
129  double m_contentsScaleFactor;
130  };
131 
132 };
133 
134 #endif // H_FB_PLUGINEVENTS_DRAWINGEVENTS
135 
Mac QuickDraw Draw event.
Definition: DrawingEvents.h:72
Fired when the clipping of the plugin drawing area changes.
Definition: DrawingEvents.h:45
Fired when the focus changes.
Plugin event base class.
Definition: PluginEvent.h:36
Fired when the plugin should repaint itself (such as on windows when WM_PAINT is received) ...
Definition: DrawingEvents.h:55
Mac CoreGraphics Draw event.
Definition: DrawingEvents.h:88
Fired when the plugin window is resized.
Definition: DrawingEvents.h:36