You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/03/06 22:39:15 UTC

[2/7] Re-arranged group and folder structure to make it easy for plugman support.

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/e1c85923/CordovaMac/CordovaMac/Utils.h
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/Utils.h b/CordovaMac/CordovaMac/Utils.h
deleted file mode 100644
index 9895454..0000000
--- a/CordovaMac/CordovaMac/Utils.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-#define DEG_EPS 0.001
-#define fequal(a,b) (fabs((a) - (b)) < DEG_EPS)
-#define fequalzero(a) (fabs(a) < DEG_EPS)
-
-@class LoadingView;
-
-@interface Utils : NSObject {
-}
-
-- (float) titleBarHeight:(NSWindow*)aWindow;
-- (NSString*) pathForResource:(NSString*)resourcepath;
-
-
-+ (Utils*) sharedInstance;
-
-@end

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/e1c85923/CordovaMac/CordovaMac/Utils.m
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/Utils.m b/CordovaMac/CordovaMac/Utils.m
deleted file mode 100644
index b557014..0000000
--- a/CordovaMac/CordovaMac/Utils.m
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "Utils.h"
-
-static Utils* sharedInstance = nil;
-
-@implementation Utils
-
-- (float) titleBarHeight:(NSWindow*)aWindow
-{
-    NSRect frame = [aWindow frame];
-    NSRect contentRect = [NSWindow contentRectForFrameRect: frame
-												 styleMask: NSTitledWindowMask];
-	
-    return (frame.size.height - contentRect.size.height);
-}
-
-- (NSString*) pathForResource:(NSString*)resourcepath
-{
-    NSBundle * mainBundle = [NSBundle mainBundle];
-    NSMutableArray *directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]];
-    NSString       *filename       = [directoryParts lastObject];
-    [directoryParts removeLastObject];
-	
-    NSString *directoryStr = [NSString stringWithFormat:@"%@/%@", kCDVStartFolder, [directoryParts componentsJoinedByString:@"/"]];
-    return [mainBundle pathForResource:filename
-								ofType:@""
-						   inDirectory:directoryStr];
-}
-
-#pragma mark -
-#pragma mark Singleton methods
-
-+ (Utils*) sharedInstance
-{
-    @synchronized(self)
-    {
-        if (sharedInstance == nil){
-			sharedInstance = [[Utils alloc] init];
-		}
-    }
-    return sharedInstance;
-}
-
-+ (id) allocWithZone:(NSZone *)zone {
-    @synchronized(self) {
-        if (sharedInstance == nil) {
-            sharedInstance = [super allocWithZone:zone];
-            return sharedInstance;  // assignment and return on first allocation
-        }
-    }
-    return nil; // on subsequent allocation attempts return nil
-}
-
-- (id) copyWithZone:(NSZone *)zone
-{
-    return self;
-}
-
-//- (id) retain {
-//    return self;
-//}
-//
-//- (unsigned long) retainCount {
-//    return UINT_MAX;  // denotes an object that cannot be released
-//}
-//
-//- (oneway void) release {
-//    //do nothing
-//}
-//
-//- (id) autorelease {
-//    return self;
-//}
-
-
-@end

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/e1c85923/CordovaMac/CordovaMac/WebViewDelegate.h
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/WebViewDelegate.h b/CordovaMac/CordovaMac/WebViewDelegate.h
deleted file mode 100644
index 458cd29..0000000
--- a/CordovaMac/CordovaMac/WebViewDelegate.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cocoa/Cocoa.h>
-#import <WebKit/WebKit.h>
-
-@class CDVSound;
-@class CDVNotification;
-@class CDVConsole;
-@class CDVBridge;
-
-@interface WebViewDelegate : NSObject {
-}
-
-@property (nonatomic, strong) CDVSound* sound;
-@property (nonatomic, strong) CDVNotification* notification;
-@property (nonatomic, strong) CDVConsole* console;
-@property (nonatomic, strong) CDVBridge* bridge;
-
-@end

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/e1c85923/CordovaMac/CordovaMac/WebViewDelegate.m
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/WebViewDelegate.m b/CordovaMac/CordovaMac/WebViewDelegate.m
deleted file mode 100644
index f0dbd98..0000000
--- a/CordovaMac/CordovaMac/WebViewDelegate.m
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-
-#import "WebViewDelegate.h"
-#import "CDVConsole.h"
-#import "CDVBridge.h"
-
-@implementation WebViewDelegate
-
-@synthesize sound, notification, console;
-
-- (void) webView:(WebView*)webView windowScriptObjectAvailable:(WebScriptObject*)windowScriptObject
-{
-	if (self.console == nil) {
-        self.console = [CDVConsole new];
-    }
-	[windowScriptObject setValue:self.console forKey:@"console"];
-	
-	if (self.bridge == nil) {
-        self.bridge = [[CDVBridge alloc] initWithWebView:webView];
-    }
-    [windowScriptObject setValue:self.bridge forKey:@"cordovabridge"];
-}
-
-- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
-{
-    id win = [sender windowScriptObject];
-    NSString* nativeReady = @"try{cordova.require('cordova/channel').onNativeReady.fire();}catch(e){window._nativeReady = true;}";
-    [win evaluateWebScript:nativeReady];
-}
-
-/* This logs all errors from Javascript, nifty */
-- (void) webView:(WebView*)webView addMessageToConsole:(NSDictionary*)message
-{
-	if (![message isKindOfClass:[NSDictionary class]]) { 
-		return;
-	}
-	
-	NSLog(@"JavaScript error: %@:%@: %@", 
-		  [[message objectForKey:@"sourceURL"] lastPathComponent],	// could be nil
-		  [message objectForKey:@"lineNumber"],
-		  [message objectForKey:@"message"]);
-}
-
-#pragma mark WebScripting protocol
-
-/* checks whether a selector is acceptable to be called from JavaScript */
-+ (BOOL) isSelectorExcludedFromWebScript:(SEL)selector
-{
-	return YES;
-}
-
-// right now exclude all properties (eg keys)
-+ (BOOL) isKeyExcludedFromWebScript:(const char*)name
-{
-	return YES;
-}
-
-#pragma mark WebPolicyDelegate
-
-- (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
-{	
-    NSString* url = [[request URL] description];
-    NSLog(@"navigating to %@", url);
-
-    [listener use];
-}
-
-
-@end

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/e1c85923/CordovaMac/CordovaMac/config.xml
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/config.xml b/CordovaMac/CordovaMac/config.xml
new file mode 100644
index 0000000..f9170ef
--- /dev/null
+++ b/CordovaMac/CordovaMac/config.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+-->
+<widget>
+    <!--
+    <preference name="MyPreferenceName" value="true" />
+     -->
+
+    <content src="index.html" />
+
+    <plugins>
+        <plugin name="Device" value="CDVDevice" />
+        <plugin name="NetworkStatus" value="CDVConnection" />
+    </plugins>
+
+    <access origin="*" />
+</widget>

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/e1c85923/CordovaMac/CordovaMac/en.lproj/Credits.rtf
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/en.lproj/Credits.rtf b/CordovaMac/CordovaMac/en.lproj/Credits.rtf
deleted file mode 100644
index 816c9db..0000000
--- a/CordovaMac/CordovaMac/en.lproj/Credits.rtf
+++ /dev/null
@@ -1,18 +0,0 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
-{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;\f1\fnil\fcharset0 HelveticaNeue-Light;}
-{\colortbl;\red255\green255\blue255;}
-\vieww9600\viewh8400\viewkind0
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
-{\field{\*\fldinst{HYPERLINK "http://www.apache.org/"}}{\fldrslt 
-\f0\fs36 \cf0 Apache Software Foundation\
-}}\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
-
-\f1\fs36 \cf0 \
-
-\fs28 The {\field{\*\fldinst{HYPERLINK "http://phonegap.com/about"}}{\fldrslt PhoneGap}} code was contributed to the Apache Software Foundation (ASF) under the name Apache Callback in October 2011. It is currently under incubation until it can become a full Apache project. Through the ASF, future {\field{\*\fldinst{HYPERLINK "http://phonegap.com/about"}}{\fldrslt PhoneGap}} development will ensure open stewardship of the project. It will always remain free and open source under the Apache License, Version 2.0.
-\fs32 \
-\
-\pard\tx560\pardeftab560\pardirnatural
-
-\fs28 \cf0 \CocoaLigature0 Licensed to the {\field{\*\fldinst{HYPERLINK "http://www.apache.org/"}}{\fldrslt Apache Software Foundation (ASF)}} under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at {\field{\*\fldinst{HYPERLINK "http://www.apache.org/licenses/LICENSE-2.0"}}{\fldrslt http://www.apache.org/licenses/LICENSE-2.0}} Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.\
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/e1c85923/CordovaMac/CordovaMac/en.lproj/InfoPlist.strings
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/en.lproj/InfoPlist.strings b/CordovaMac/CordovaMac/en.lproj/InfoPlist.strings
deleted file mode 100644
index d277f9d..0000000
--- a/CordovaMac/CordovaMac/en.lproj/InfoPlist.strings
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-
-
-/* Localized versions of Info.plist keys */
-