FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
PluginWindowMacICA.mm
1 /**********************************************************\
2 Original Author: Anson MacKeracher
3 
4 Created: May 5, 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 Georg Fritzsche, Firebreath development team
13 \**********************************************************/
14 
15 #include "ConstructDefaultPluginWindows.h"
16 
17 #include "PluginWindowMacICA.h"
18 
19 using namespace FB;
20 
21 FB::PluginWindowMacICA* FB::createPluginWindowMacICA()
22 {
23  return new PluginWindowMacICA();
24 }
25 
26 PluginWindowMacICA::PluginWindowMacICA()
27  : PluginWindowMacCA(), m_displayOnInvalidate(true)
28 {
29 }
30 
31 void PluginWindowMacICA::InvalidateWindow() const {
32  if (m_displayOnInvalidate) {
33  CALayer *mlayer = (CALayer*) m_layer;
34 #if 1
35  // setNeedsDisplay will draw sometime in the future.
36  [[mlayer sublayers] makeObjectsPerformSelector:@selector(setNeedsDisplay)];
37 #else
38  // display will draw now, immediately.
39  [[mlayer sublayers] makeObjectsPerformSelector:@selector(display)];
40 #endif
41  }
42  PluginWindowMac::InvalidateWindow();
43 }