Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed .mm file tabs

  • Loading branch information...
commit 599921675f2380836de8c649696d91fc9fb12664 1 parent ca505a6
Richard Bateman authored March 08, 2011
8  fixtabs
@@ -2,6 +2,7 @@
2 2
 
3 3
 CPPFILES=`find . -type f -name '*.cpp'`
4 4
 HFILES=`find . -type f -name '*.h'`
  5
+MMFILES=`find . -type f -name '*.mm'`
5 6
 
6 7
 for FILE in $HFILES
7 8
 do
@@ -17,3 +18,10 @@ do
17 18
     rm -v $FILE
18 19
     mv -v ${FILE}_ $FILE
19 20
 done
  21
+for FILE in $MMFILES
  22
+do
  23
+    echo "Expanding $FILE..."
  24
+    expand -t 4 $FILE > ${FILE}_
  25
+    rm -v $FILE
  26
+    mv -v ${FILE}_ $FILE
  27
+done
158  src/PluginAuto/Mac/NpapiPluginMac.mm 100755 → 100644
@@ -54,9 +54,9 @@
54 54
 }
55 55
 
56 56
 NpapiPluginMac::NpapiPluginMac(const FB::Npapi::NpapiBrowserHostPtr &host, const std::string& mimetype)
57  
-	: NpapiPlugin(host, mimetype), m_eventModel((NPEventModel)-1), m_drawingModel((NPDrawingModel)-1)
  57
+    : NpapiPlugin(host, mimetype), m_eventModel((NPEventModel)-1), m_drawingModel((NPDrawingModel)-1)
58 58
 #if FBMAC_USE_COREANIMATION
59  
-	, m_layer(NULL)
  59
+    , m_layer(NULL)
60 60
 #endif
61 61
 {
62 62
     // If you receive a BAD_ACCESS error here you probably have something
@@ -68,109 +68,109 @@
68 68
     static const std::string pluginPath = getPluginPath();      
69 69
     setFSPath(pluginPath);
70 70
 
71  
-	// These HAVE to be called here during the NPP_New call to set the drawing and event models.
72  
-	m_drawingModel = PluginWindowMac::initPluginWindowMac(m_npHost);
73  
-	m_eventModel = PluginEventMac::initPluginEventMac(m_npHost, m_drawingModel);
  71
+    // These HAVE to be called here during the NPP_New call to set the drawing and event models.
  72
+    m_drawingModel = PluginWindowMac::initPluginWindowMac(m_npHost);
  73
+    m_eventModel = PluginEventMac::initPluginEventMac(m_npHost, m_drawingModel);
74 74
 
75  
-	// We can create our event model handler now.
76  
-	pluginEvt = PluginEventMacPtr(PluginEventMac::createPluginEventMac(m_eventModel));
  75
+    // We can create our event model handler now.
  76
+    pluginEvt = PluginEventMacPtr(PluginEventMac::createPluginEventMac(m_eventModel));
77 77
 }
78 78
 
79 79
 NpapiPluginMac::~NpapiPluginMac()
80 80
 {
81 81
 #if FBMAC_USE_COREANIMATION
82  
-	if (m_layer) {
83  
-		[(CALayer*)m_layer autorelease];
84  
-		m_layer = NULL;
85  
-	}
  82
+    if (m_layer) {
  83
+        [(CALayer*)m_layer autorelease];
  84
+        m_layer = NULL;
  85
+    }
86 86
 #endif
87 87
 }
88 88
 
89 89
 NPError NpapiPluginMac::SetWindow(NPWindow* window) {
90  
-	NPError res = NPERR_NO_ERROR;
91  
-	if (window)
92  
-	{
93  
-		if (!pluginWin)
94  
-		{
95  
-			// If we don't have a PluginWindow, create one. It will be made for the chosen drawing model.
96  
-			pluginWin = PluginWindowMacPtr(PluginWindowMac::createPluginWindowMac(m_drawingModel));
97  
-			if (pluginWin)
98  
-			{
99  
-				pluginWin->setNpHost(m_npHost);
100  
-				// Tell the event model which window to use for events.
101  
-				if (pluginEvt)
102  
-					pluginEvt->setPluginWindow(pluginWin);
103  
-				pluginWin->setPluginEvent(pluginEvt);
104  
-			}
105  
-		}
106  
-		if (pluginWin)
107  
-		{
  90
+    NPError res = NPERR_NO_ERROR;
  91
+    if (window)
  92
+    {
  93
+        if (!pluginWin)
  94
+        {
  95
+            // If we don't have a PluginWindow, create one. It will be made for the chosen drawing model.
  96
+            pluginWin = PluginWindowMacPtr(PluginWindowMac::createPluginWindowMac(m_drawingModel));
  97
+            if (pluginWin)
  98
+            {
  99
+                pluginWin->setNpHost(m_npHost);
  100
+                // Tell the event model which window to use for events.
  101
+                if (pluginEvt)
  102
+                    pluginEvt->setPluginWindow(pluginWin);
  103
+                pluginWin->setPluginEvent(pluginEvt);
  104
+            }
  105
+        }
  106
+        if (pluginWin)
  107
+        {
108 108
 #if FBMAC_USE_COREANIMATION
109  
-			// Patch up the NPWindow before calling SetWindow for CoreAnimation to pass the CALayer.
110  
-			if ((PluginWindowMac::DrawingModelCoreAnimation == pluginWin->getDrawingModel()) || (PluginWindowMac::DrawingModelInvalidatingCoreAnimation == pluginWin->getDrawingModel()))
111  
-			{
112  
-				assert(!window->window);
113  
-				window->window = m_layer;
114  
-			}
  109
+            // Patch up the NPWindow before calling SetWindow for CoreAnimation to pass the CALayer.
  110
+            if ((PluginWindowMac::DrawingModelCoreAnimation == pluginWin->getDrawingModel()) || (PluginWindowMac::DrawingModelInvalidatingCoreAnimation == pluginWin->getDrawingModel()))
  111
+            {
  112
+                assert(!window->window);
  113
+                window->window = m_layer;
  114
+            }
115 115
 #endif
116  
-			// Set the Window.
117  
-			res = pluginWin->SetWindow(window);
  116
+            // Set the Window.
  117
+            res = pluginWin->SetWindow(window);
118 118
 #if FBMAC_USE_COREANIMATION
119  
-			if ((PluginWindowMac::DrawingModelCoreAnimation == pluginWin->getDrawingModel()) || (PluginWindowMac::DrawingModelInvalidatingCoreAnimation == pluginWin->getDrawingModel()))
120  
-				window->window = NULL;
  119
+            if ((PluginWindowMac::DrawingModelCoreAnimation == pluginWin->getDrawingModel()) || (PluginWindowMac::DrawingModelInvalidatingCoreAnimation == pluginWin->getDrawingModel()))
  120
+                window->window = NULL;
121 121
 #endif
122  
-			// Notify the PluginCore about our new window. This will post an AttachedEvent.
123  
-			if (!pluginMain->GetWindow())
124  
-				pluginMain->SetWindow(pluginWin.get());
125  
-		}
126  
-	} else {
127  
-		// Notify the PluginCore about our missing window. This will post an DetachedEvent.
128  
-		pluginMain->ClearWindow();
129  
-		pluginWin.reset();
130  
-	}
  122
+            // Notify the PluginCore about our new window. This will post an AttachedEvent.
  123
+            if (!pluginMain->GetWindow())
  124
+                pluginMain->SetWindow(pluginWin.get());
  125
+        }
  126
+    } else {
  127
+        // Notify the PluginCore about our missing window. This will post an DetachedEvent.
  128
+        pluginMain->ClearWindow();
  129
+        pluginWin.reset();
  130
+    }
131 131
     return res;
132 132
 }
133 133
 
134 134
 int16_t NpapiPluginMac::HandleEvent(void* event)
135 135
 {
136  
-	if (pluginEvt)
137  
-		return pluginEvt->HandleEvent(event);
  136
+    if (pluginEvt)
  137
+        return pluginEvt->HandleEvent(event);
138 138
     return 0;
139 139
 }
140 140
 
141 141
 int16_t NpapiPluginMac::GetValue(NPPVariable variable, void *value) {
142  
-	int16_t res = NPERR_GENERIC_ERROR;
143  
-	switch (variable) {
  142
+    int16_t res = NPERR_GENERIC_ERROR;
  143
+    switch (variable) {
144 144
 #if FBMAC_USE_COREANIMATION
145  
-		case NPPVpluginCoreAnimationLayer:
146  
-		{
147  
-			// The BrowserPlugin owns the CALayer.
148  
-			CALayer *mlayer = (CALayer *) m_layer;
149  
-			if (!mlayer)
150  
-				mlayer = [[CALayer layer] retain];
151  
-			if (mlayer) {
152  
-				mlayer.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
153  
-				mlayer.needsDisplayOnBoundsChange = YES;
154  
-				*(CALayer**) value = [(CALayer*)mlayer retain];
155  
-			}
156  
-			m_layer = mlayer;
157  
-			res = NPERR_NO_ERROR;
158  
-		}	break;
  145
+        case NPPVpluginCoreAnimationLayer:
  146
+        {
  147
+            // The BrowserPlugin owns the CALayer.
  148
+            CALayer *mlayer = (CALayer *) m_layer;
  149
+            if (!mlayer)
  150
+                mlayer = [[CALayer layer] retain];
  151
+            if (mlayer) {
  152
+                mlayer.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
  153
+                mlayer.needsDisplayOnBoundsChange = YES;
  154
+                *(CALayer**) value = [(CALayer*)mlayer retain];
  155
+            }
  156
+            m_layer = mlayer;
  157
+            res = NPERR_NO_ERROR;
  158
+        }   break;
159 159
 #endif
160  
-		case NPPVpluginScriptableNPObject:
161  
-		{
162  
-			res = NpapiPlugin::GetValue(variable, value);
163  
-			if (NPERR_NO_ERROR == res)
164  
-				setReady(); // Ready state means that we are ready to interact with Javascript;
165  
-		}	break;
166  
-		default:
167  
-			res = NpapiPlugin::GetValue(variable, value);
168  
-			break;
169  
-	}
170  
-	return res;
  160
+        case NPPVpluginScriptableNPObject:
  161
+        {
  162
+            res = NpapiPlugin::GetValue(variable, value);
  163
+            if (NPERR_NO_ERROR == res)
  164
+                setReady(); // Ready state means that we are ready to interact with Javascript;
  165
+        }   break;
  166
+        default:
  167
+            res = NpapiPlugin::GetValue(variable, value);
  168
+            break;
  169
+    }
  170
+    return res;
171 171
 }
172 172
 
173 173
 void NpapiPluginMac::HandleTimerEvent() {
174  
-	if (pluginWin)
175  
-		return pluginWin->handleTimerEvent();
  174
+    if (pluginWin)
  175
+        return pluginWin->handleTimerEvent();
176 176
 }
8  src/PluginAuto/Mac/PluginEventMacCocoa.mm
@@ -32,10 +32,10 @@
32 32
 PluginEventMacCocoa::~PluginEventMacCocoa() {}
33 33
 
34 34
 int16_t PluginEventMacCocoa::HandleEvent(void* event) {
35  
-	NPCocoaEvent* evt = (NPCocoaEvent*) event;
36  
-	PluginWindowMacPtr window = m_PluginWindow.lock();
37  
-	if (!window)
38  
-		return false;
  35
+    NPCocoaEvent* evt = (NPCocoaEvent*) event;
  36
+    PluginWindowMacPtr window = m_PluginWindow.lock();
  37
+    if (!window)
  38
+        return false;
39 39
 
40 40
     // Let the plugin handle the event if it wants
41 41
     MacEventCocoa macEv(evt);
52  src/PluginAuto/Mac/PluginWindowMacCA.mm
@@ -26,42 +26,42 @@
26 26
 }
27 27
 
28 28
 PluginWindowMacCA::PluginWindowMacCA(bool invalidating)
29  
-	: PluginWindowMac(), m_layer(NULL), m_invalidating(invalidating)
  29
+    : PluginWindowMac(), m_layer(NULL), m_invalidating(invalidating)
30 30
 {
31 31
 }
32 32
 
33 33
 PluginWindowMacCA::~PluginWindowMacCA()
34 34
 {
35  
-	[(CALayer*)m_layer autorelease];
36  
-	m_layer = NULL;
  35
+    [(CALayer*)m_layer autorelease];
  36
+    m_layer = NULL;
37 37
 }
38 38
 
39 39
 NPError PluginWindowMacCA::SetWindow(NPWindow* window)
40 40
 {
41  
-	CALayer *layer = (CALayer*) window->window;
42  
-//	FBLOG_TRACE("PluginCore", "PluginWindowMacCA::SetWindow() CALayer=%p", layer);
43  
-	if (!layer)
44  
-		return NPERR_INVALID_PARAM;
  41
+    CALayer *layer = (CALayer*) window->window;
  42
+//  FBLOG_TRACE("PluginCore", "PluginWindowMacCA::SetWindow() CALayer=%p", layer);
  43
+    if (!layer)
  44
+        return NPERR_INVALID_PARAM;
45 45
 
46  
-	if (m_layer != layer)
47  
-	{
48  
-		[(CALayer*)layer retain];
49  
-		[(CALayer*)m_layer autorelease];
50  
-		m_layer = layer;
51  
-		
52  
-		m_x = window->x;
53  
-		m_y = window->y;
54  
-		m_width = window->width;
55  
-		m_height = window->height;
56  
-		m_clipTop = window->clipRect.top;
57  
-		m_clipLeft = window->clipRect.left;
58  
-		m_clipBottom = window->clipRect.bottom;
59  
-		m_clipRight = window->clipRect.right;
60  
-		
61  
-		AttachedEvent evt2;
62  
-		SendEvent(&evt2);
63  
-		return NPERR_NO_ERROR;
64  
-	}
  46
+    if (m_layer != layer)
  47
+    {
  48
+        [(CALayer*)layer retain];
  49
+        [(CALayer*)m_layer autorelease];
  50
+        m_layer = layer;
  51
+        
  52
+        m_x = window->x;
  53
+        m_y = window->y;
  54
+        m_width = window->width;
  55
+        m_height = window->height;
  56
+        m_clipTop = window->clipRect.top;
  57
+        m_clipLeft = window->clipRect.left;
  58
+        m_clipBottom = window->clipRect.bottom;
  59
+        m_clipRight = window->clipRect.right;
  60
+        
  61
+        AttachedEvent evt2;
  62
+        SendEvent(&evt2);
  63
+        return NPERR_NO_ERROR;
  64
+    }
65 65
     return PluginWindowMac::SetWindow(window);
66 66
 }
67 67
 
34  src/PluginCore/Mac/OneShotManager.mm
@@ -83,29 +83,29 @@ - (void)doStuff:(id)obj
83 83
 
84 84
 void FB::OneShotManager::push(void* npp, OneShotCallback sink)
85 85
 {
86  
-	boost::mutex::scoped_lock lock(m_mutex);
  86
+    boost::mutex::scoped_lock lock(m_mutex);
87 87
     m_sinks.push(std::make_pair(npp, sink));
88 88
     [getHelper(this) performSelectorOnMainThread:@selector(doStuff:) withObject:nil waitUntilDone:NO];
89 89
 }
90 90
 
91 91
 void FB::OneShotManager::clear(void* npp)
92 92
 {
93  
-	// This and push must never be called at the same time; thus, the mutex prevents that
94  
-	// from happening.
95  
-	boost::mutex::scoped_lock lock(m_mutex);
  93
+    // This and push must never be called at the same time; thus, the mutex prevents that
  94
+    // from happening.
  95
+    boost::mutex::scoped_lock lock(m_mutex);
96 96
     SinkQueue tmp;
97  
-	SinkPair cur;
98  
-	// Go through all items in the queue; add all but those
99  
-	// associated with npp to a temporary queue
100  
-	while (m_sinks.try_pop(cur)) {
101  
-		if (cur.first != npp) {
102  
-			tmp.push(cur);
103  
-		}
104  
-	}
105  
-	// Add the items we kept back into the queue
106  
-	while (tmp.try_pop(cur)) {
107  
-		m_sinks.push(cur);
108  
-	}
  97
+    SinkPair cur;
  98
+    // Go through all items in the queue; add all but those
  99
+    // associated with npp to a temporary queue
  100
+    while (m_sinks.try_pop(cur)) {
  101
+        if (cur.first != npp) {
  102
+            tmp.push(cur);
  103
+        }
  104
+    }
  105
+    // Add the items we kept back into the queue
  106
+    while (tmp.try_pop(cur)) {
  107
+        m_sinks.push(cur);
  108
+    }
109 109
 }
110 110
 
111 111
 FB::OneShotManager& FB::OneShotManager::getInstance()
@@ -116,7 +116,7 @@ - (void)doStuff:(id)obj
116 116
 
117 117
 void FB::OneShotManager::shoot()
118 118
 {
119  
-	SinkPair val;
  119
+    SinkPair val;
120 120
     while (m_sinks.try_pop(val))
121 121
     {
122 122
         val.second(val.first, 0);

0 notes on commit 5999216

Please sign in to comment.
Something went wrong with that request. Please try again.