FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
PluginEventMacCarbon.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_PLUGINEVENTMACCARBON
16 #define H_PLUGINEVENTMACCARBON
17 
18 #ifndef NP_NO_CARBON
19 
20 #include "PluginEventMac.h"
21 
22 namespace FB {
23 
29  class PluginEventMacCarbon : public PluginEventMac
30  {
31  public:
33  virtual ~PluginEventMacCarbon();
34 
35  int16_t HandleEvent(void* event);
36  EventModel getEventModel() const { return EventModelCarbon; }
37 
38  protected:
39  Point GlobalToLocal(Point location);
40  bool isMouseOver(Point location);
41 
42  void CarbonToNPCocoaEvent(const EventRecord* evt, NPCocoaEvent& rval);
43  NPNSString* TranslateKeyEventRecord(const EventRecord *event);
44 
45  short m_old_h, m_old_v; // Keep track of mouse movement coordinates
46  bool m_mouseEntered; // Keep track of mouseEntered/mouseExited
47  CFDataRef m_tisKeyLayoutData;
48  UInt32 m_deadKeyState;
49 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
50  TISInputSourceRef m_tisInputSource;
51 #endif
52  };
53 };
54 
55 #endif // NP_NO_CARBON
56 
57 #endif // H_PLUGINEVENTMACCARBON
Mac OS X Carbon specific implementation of PluginEventMac.