src: Initial reorganization for NFD Control Center
Change-Id: Ic8bc4b9168df83bd706f780187a5993292565f95
diff --git a/osx/Info.plist b/osx/Info.plist
index bafb8e6..bb7bbb1 100644
--- a/osx/Info.plist
+++ b/osx/Info.plist
@@ -5,15 +5,15 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
- <string>NDNx Control Center</string>
+ <string>NFD Control Center</string>
<key>CFBundleIconFile</key>
- <string>ndnx-main.icns</string>
+ <string>nfd-main.icns</string>
<key>CFBundleIdentifier</key>
<string>net.named-data.control-center</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>NDNx Control Center</string>
+ <string>NFD Control Center</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
diff --git a/osx/LaunchAtLoginController/launch-at-login-controller.mm b/osx/LaunchAtLoginController/launch-at-login-controller.mm
index 88ba818..3354b1c 100644
--- a/osx/LaunchAtLoginController/launch-at-login-controller.mm
+++ b/osx/LaunchAtLoginController/launch-at-login-controller.mm
@@ -49,14 +49,14 @@
self = [super init];
loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
LSSharedFileListAddObserver(loginItems, CFRunLoopGetMain(),
- (CFStringRef)NSDefaultRunLoopMode, sharedFileListDidChange, (voidPtr)CFBridgingRetain(self));
+ (__bridge CFStringRef)NSDefaultRunLoopMode, sharedFileListDidChange, (voidPtr)CFBridgingRetain(self));
return self;
}
- (void) dealloc
{
LSSharedFileListRemoveObserver(loginItems, CFRunLoopGetMain(),
- (CFStringRef)NSDefaultRunLoopMode, sharedFileListDidChange, (__bridge void *)(self));
+ (__bridge CFStringRef)NSDefaultRunLoopMode, sharedFileListDidChange, (__bridge void *)(self));
CFRelease(loginItems);
}
diff --git a/osx/Resources/ndnx-main.icns b/osx/Resources/nfd-main.icns
similarity index 100%
rename from osx/Resources/ndnx-main.icns
rename to osx/Resources/nfd-main.icns
Binary files differ
diff --git a/osx/Resources/ndnx-tray.icns b/osx/Resources/nfd-tray.icns
similarity index 100%
rename from osx/Resources/ndnx-tray.icns
rename to osx/Resources/nfd-tray.icns
Binary files differ
diff --git a/osx/fib-table-controller.h b/osx/fib-table-controller.h
index 65d60f7..1912521 100644
--- a/osx/fib-table-controller.h
+++ b/osx/fib-table-controller.h
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#import <Cocoa/Cocoa.h>
diff --git a/osx/fib-table-controller.mm b/osx/fib-table-controller.mm
index 04821d0..8d56cea 100644
--- a/osx/fib-table-controller.mm
+++ b/osx/fib-table-controller.mm
@@ -1,12 +1,26 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
-#include "config.h"
+#include "config.hpp"
#import "fib-table-controller.h"
@implementation FibTableController
@@ -29,7 +43,7 @@
}
-(id)tableView:(NSTableView *)aTableView
- objectValueForTableColumn:(NSTableColumn *)aTableColumn
+ objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(NSInteger)rowIndex
{
NSXMLNode *element = [[m_document rootElement] childAtIndex:rowIndex];
@@ -46,7 +60,7 @@
{
return [[element childAtIndex:1] stringValue];
}
-
+
return nil;
}
diff --git a/osx/main.mm b/osx/main.mm
index e9b10aa..f0f20fa 100644
--- a/osx/main.mm
+++ b/osx/main.mm
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#import <Cocoa/Cocoa.h>
diff --git a/osx/menu-delegate.h b/osx/menu-delegate.h
index dc736a6..4fe76b9 100644
--- a/osx/menu-delegate.h
+++ b/osx/menu-delegate.h
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#import <Cocoa/Cocoa.h>
@@ -14,7 +28,7 @@
@interface MenuDelegate : NSObject <NSApplicationDelegate>
{
NSOperationQueue *m_operationQueue;
-
+
NSStatusItem *statusItem;
NSImage *m_connectedIcon;
@@ -31,16 +45,16 @@
IBOutlet NSMenuItem *routingStatus;
IBOutlet NSMenuItem *trafficMap;
IBOutlet NSMenuItem *ndnPreferences;
-
+
BOOL m_daemonStarted;
-
+
IBOutlet NSTextField *interestSentRecv;
IBOutlet NSTextField *dataSentRecv;
-
+
IBOutlet NSView *daemonStatusView;
-
+
TightMenuItemView *connectionStatusView;
-
+
IBOutlet PreferenceDelegate *preferencesDelegate;
SystemEvents *m_systemEvents;
diff --git a/osx/menu-delegate.mm b/osx/menu-delegate.mm
index 6b6c75e..4eff7f9 100644
--- a/osx/menu-delegate.mm
+++ b/osx/menu-delegate.mm
@@ -1,12 +1,26 @@
-/* -*- Mode: obj; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
-#include "config.h"
+#include "config.hpp"
#import "menu-delegate.h"
#import "ndnd-status-operation.h"
#import "tight-menu-item-view.h"
@@ -28,9 +42,9 @@
interestRecv = @"N/A";
dataSent = @"N/A";
dataRecv = @"N/A";
-
+
m_autoconfInProgress = false;
- m_operationQueue = [[NSOperationQueue alloc] init];
+ // m_operationQueue = [[NSOperationQueue alloc] init];
return self;
}
@@ -45,30 +59,33 @@
nil
];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
-
+
// Other initialization...
- m_daemonStarted = false;
+ m_daemonStarted = false;
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
m_connectedIcon = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"FlatConnected" ofType:@"png"]];
m_disconnectedIcon = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"FlatDisconnected" ofType:@"png"]];
- m_statusXslt = [NSData dataWithContentsOfFile:[bundle pathForResource:@"status" ofType:@"xslt"]];
- m_statusToFibXslt = [NSData dataWithContentsOfFile:[bundle pathForResource:@"status-to-fib" ofType:@"xslt"]];
-
- [NSTimer scheduledTimerWithTimeInterval: 1.0
- target: self
- selector:@selector(onTick:)
- userInfo: nil
- repeats:YES];
- [self updateStatus];
- m_systemEvents = [[SystemEvents alloc] init];
+ [statusItem setImage:m_disconnectedIcon];
+
+ // m_statusXslt = [NSData dataWithContentsOfFile:[bundle pathForResource:@"status" ofType:@"xslt"]];
+ // m_statusToFibXslt = [NSData dataWithContentsOfFile:[bundle pathForResource:@"status-to-fib" ofType:@"xslt"]];
+
+ // [NSTimer scheduledTimerWithTimeInterval: 1.0
+ // target: self
+ // selector:@selector(onTick:)
+ // userInfo: nil
+ // repeats:YES];
+ // [self updateStatus];
+
+ // m_systemEvents = [[SystemEvents alloc] init];
}
- (void)applicationWillTerminate:(NSNotification *)aNotification
{
- [m_systemEvents disable];
+ // [m_systemEvents disable];
}
-(void)awakeFromNib
@@ -81,8 +98,7 @@
//[statusItem setTarget:self];
[statusItem setTitle:@""];
- [statusItem setImage:m_disconnectedIcon];
-
+
float menuItemHeight = 20;
NSRect viewRect = NSMakeRect(0, 0, /* width autoresizes */ 1, menuItemHeight);
@@ -91,7 +107,7 @@
[connectionStatus setView:connectionStatusView];
[connectionStatus setTarget:self];
-
+
[daemonStatus setView: daemonStatusView];
[daemonStatus setTarget:self];
}
@@ -105,12 +121,12 @@
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"shutdownNdndOnExit"]) {
[m_operationQueue cancelAllOperations];
- [m_operationQueue addOperationWithBlock:^{
- NSTask *task = [[NSTask alloc] init];
- [task setLaunchPath: @NDND_STOP_COMMAND];
- [task launch];
- [task waitUntilExit];
- }];
+ // [m_operationQueue addOperationWithBlock:^{
+ // NSTask *task = [[NSTask alloc] init];
+ // [task setLaunchPath: @NDND_STOP_COMMAND];
+ // [task launch];
+ // [task waitUntilExit];
+ // }];
[m_operationQueue waitUntilAllOperationsAreFinished];
[NSApp terminate:self];
@@ -130,12 +146,12 @@
// "YES" stop ndnd
[m_operationQueue cancelAllOperations];
- [m_operationQueue addOperationWithBlock:^{
- NSTask *task = [[NSTask alloc] init];
- [task setLaunchPath: @NDND_STOP_COMMAND];
- [task launch];
- [task waitUntilExit];
- }];
+ // [m_operationQueue addOperationWithBlock:^{
+ // NSTask *task = [[NSTask alloc] init];
+ // [task setLaunchPath: @NDND_STOP_COMMAND];
+ // [task launch];
+ // [task waitUntilExit];
+ // }];
[m_operationQueue waitUntilAllOperationsAreFinished];
[NSApp terminate:self];
@@ -169,102 +185,102 @@
- (void)statusUpdated:(NSXMLDocument*)document
{
- if (!m_daemonStarted) {
- m_daemonStarted = true;
- [connectionStatusView setStatus:@"Active"];
-
- [statusItem setImage:m_connectedIcon];
- }
+ // if (!m_daemonStarted) {
+ // m_daemonStarted = true;
+ // [connectionStatusView setStatus:@"Active"];
- NSXMLDocument *statusXml = [document objectByApplyingXSLT:m_statusXslt
- arguments:nil
- error:nil];
+ // [statusItem setImage:m_connectedIcon];
+ // }
- NSXMLDocument *statusFibXml = [document objectByApplyingXSLT:m_statusToFibXslt
- arguments:nil
- error:nil];
-
- NSXMLNode *element = [[statusXml rootElement] childAtIndex:0]; //data
- [self setDataRecv:[[element childAtIndex:0] stringValue]];
- [self setDataSent:[[element childAtIndex:1] stringValue]];
-
- element = [[statusXml rootElement] childAtIndex:1]; //interests
- [self setInterestRecv:[[element childAtIndex:0] stringValue]];
- [self setInterestSent:[[element childAtIndex:1] stringValue]];
+ // NSXMLDocument *statusXml = [document objectByApplyingXSLT:m_statusXslt
+ // arguments:nil
+ // error:nil];
- [preferencesDelegate updateFibStatus:statusFibXml];
+ // NSXMLDocument *statusFibXml = [document objectByApplyingXSLT:m_statusToFibXslt
+ // arguments:nil
+ // error:nil];
- if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enableHubDiscovery"]) {
- NSArray *autoconf = [[statusFibXml rootElement] nodesForXPath:@"//fib/prefix[text()='ndn:/autoconf-route']" error:nil];
- if ([autoconf count] == 0)
- {
- [self restartDaemon:nil];
- }
- }
+ // NSXMLNode *element = [[statusXml rootElement] childAtIndex:0]; //data
+ // [self setDataRecv:[[element childAtIndex:0] stringValue]];
+ // [self setDataSent:[[element childAtIndex:1] stringValue]];
+
+ // element = [[statusXml rootElement] childAtIndex:1]; //interests
+ // [self setInterestRecv:[[element childAtIndex:0] stringValue]];
+ // [self setInterestSent:[[element childAtIndex:1] stringValue]];
+
+ // [preferencesDelegate updateFibStatus:statusFibXml];
+
+ // if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enableHubDiscovery"]) {
+ // NSArray *autoconf = [[statusFibXml rootElement] nodesForXPath:@"//fib/prefix[text()='ndn:/autoconf-route']" error:nil];
+ // if ([autoconf count] == 0)
+ // {
+ // [self restartDaemon:nil];
+ // }
+ // }
}
- (void)statusUnavailable:(id)none
{
- // try start ndnd if it is not started yet
- if (m_daemonStarted) {
- m_daemonStarted = false;
-
- [connectionStatusView setStatus:@"Starting..."];
-
- [statusItem setImage:m_disconnectedIcon];
- }
+ // // try start ndnd if it is not started yet
+ // if (m_daemonStarted) {
+ // m_daemonStarted = false;
- [self setInterestSent:@"N/A"];
- [self setInterestRecv:@"N/A"];
- [self setDataSent:@"N/A"];
- [self setDataRecv:@"N/A"];
+ // [connectionStatusView setStatus:@"Starting..."];
- [preferencesDelegate updateFibStatus:nil];
+ // [statusItem setImage:m_disconnectedIcon];
+ // }
- m_autoconfInProgress = true;
-
- NSOperation *startOp = [NSBlockOperation blockOperationWithBlock:^{
- NSTask *task = [[NSTask alloc] init];
- [task setLaunchPath: @NDND_START_COMMAND];
- [task launch];
- }];
+ // [self setInterestSent:@"N/A"];
+ // [self setInterestRecv:@"N/A"];
+ // [self setDataSent:@"N/A"];
+ // [self setDataRecv:@"N/A"];
- if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enableHubDiscovery"]) {
- NSOperation *autoconfOp = [NSBlockOperation blockOperationWithBlock:^{
- NSTask *task = [[NSTask alloc] init];
- [task setLaunchPath: @NDND_AUTOCONFIG_COMMAND];
- [task launch];
- [task waitUntilExit];
+ // [preferencesDelegate updateFibStatus:nil];
- m_autoconfInProgress = false;
- }];
+ // m_autoconfInProgress = true;
- [autoconfOp addDependency:startOp];
- [m_operationQueue addOperation:autoconfOp];
- }
+ // // NSOperation *startOp = [NSBlockOperation blockOperationWithBlock:^{
+ // // NSTask *task = [[NSTask alloc] init];
+ // // [task setLaunchPath: @NDND_START_COMMAND];
+ // // [task launch];
+ // // }];
- [m_operationQueue addOperation:startOp];
+ // // if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enableHubDiscovery"]) {
+ // // NSOperation *autoconfOp = [NSBlockOperation blockOperationWithBlock:^{
+ // // NSTask *task = [[NSTask alloc] init];
+ // // [task setLaunchPath: @NDND_AUTOCONFIG_COMMAND];
+ // // [task launch];
+ // // [task waitUntilExit];
+
+ // // m_autoconfInProgress = false;
+ // // }];
+
+ // // [autoconfOp addDependency:startOp];
+ // // [m_operationQueue addOperation:autoconfOp];
+ // // }
+
+ // // [m_operationQueue addOperation:startOp];
}
-(void)restartDaemon:(id)none
{
- if (![[NSUserDefaults standardUserDefaults] boolForKey:@"enableHubDiscovery"])
- return;
-
- if (m_autoconfInProgress)
- return;
+ // if (![[NSUserDefaults standardUserDefaults] boolForKey:@"enableHubDiscovery"])
+ // return;
- NSLog (@"No automatically detected route configured, trying to get one");
-
- m_autoconfInProgress = true;
- [m_operationQueue addOperationWithBlock:^{
- NSTask *task = [[NSTask alloc] init];
- [task setLaunchPath: @NDND_AUTOCONFIG_COMMAND];
- [task launch];
- [task waitUntilExit];
+ // if (m_autoconfInProgress)
+ // return;
- m_autoconfInProgress = false;
- }];
+ // NSLog(@"No automatically detected route configured, trying to get one");
+
+ // // m_autoconfInProgress = true;
+ // // [m_operationQueue addOperationWithBlock:^{
+ // // NSTask *task = [[NSTask alloc] init];
+ // // [task setLaunchPath: @NDND_AUTOCONFIG_COMMAND];
+ // // [task launch];
+ // // [task waitUntilExit];
+
+ // // m_autoconfInProgress = false;
+ // // }];
}
@end
diff --git a/osx/ndnd-status-operation.h b/osx/ndnd-status-operation.h
index 8970288..2226cd7 100644
--- a/osx/ndnd-status-operation.h
+++ b/osx/ndnd-status-operation.h
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#import <Cocoa/Cocoa.h>
diff --git a/osx/ndnd-status-operation.mm b/osx/ndnd-status-operation.mm
index 8bd5ac9..be7632b 100644
--- a/osx/ndnd-status-operation.mm
+++ b/osx/ndnd-status-operation.mm
@@ -1,12 +1,26 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
-#include "config.h"
+#include "config.hpp"
#import "ndnd-status-operation.h"
@implementation NdndStatusOperation
@@ -20,38 +34,36 @@
-(void)main
{
- NSTask *task = [[NSTask alloc] init];
- [task setLaunchPath: @NDND_STATUS_COMMAND];
- [task setArguments: [NSArray arrayWithObjects: @"status",@"-x",nil]];
+ // NSTask *task = [[NSTask alloc] init];
+ // [task setLaunchPath: @NDND_STATUS_COMMAND];
+ // [task setArguments: [NSArray arrayWithObjects: @"status",@"-x",nil]];
- NSPipe * out = [NSPipe pipe];
- [task setStandardOutput:out];
+ // NSPipe * out = [NSPipe pipe];
+ // [task setStandardOutput:out];
- [task launch];
- [task waitUntilExit];
+ // [task launch];
+ // [task waitUntilExit];
- NSFileHandle * read = [out fileHandleForReading];
- NSData * dataRead = [read readDataToEndOfFile];
- NSString *stringRead = [[NSString alloc] initWithData:dataRead encoding:NSUTF8StringEncoding];
+ // NSFileHandle * read = [out fileHandleForReading];
+ // NSData * dataRead = [read readDataToEndOfFile];
+ // NSString *stringRead = [[NSString alloc] initWithData:dataRead encoding:NSUTF8StringEncoding];
- if ([stringRead isEqualToString:@""]) {
- [m_delegate performSelectorOnMainThread:@selector(statusUnavailable:)
- withObject:nil
- waitUntilDone:YES];
-
- } else {
- NSError *error = nil;
- NSXMLDocument *document = [[NSXMLDocument alloc]
- initWithXMLString:stringRead
- options:0
- error:&error];
+ // if ([stringRead isEqualToString:@""]) {
+ // [m_delegate performSelectorOnMainThread:@selector(statusUnavailable:)
+ // withObject:nil
+ // waitUntilDone:YES];
- [m_delegate performSelectorOnMainThread:@selector(statusUpdated:)
- withObject:document
- waitUntilDone:YES];
- }
-
- // [daemonStatusText setStringValue:stringRead];
+ // } else {
+ // NSError *error = nil;
+ // NSXMLDocument *document = [[NSXMLDocument alloc]
+ // initWithXMLString:stringRead
+ // options:0
+ // error:&error];
+
+ // [m_delegate performSelectorOnMainThread:@selector(statusUpdated:)
+ // withObject:document
+ // waitUntilDone:YES];
+ // }
}
@end
diff --git a/osx/preference-delegate.h b/osx/preference-delegate.h
index aa2d28b..efe0b16 100644
--- a/osx/preference-delegate.h
+++ b/osx/preference-delegate.h
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#import <Cocoa/Cocoa.h>
@@ -12,7 +26,7 @@
@interface PreferenceDelegate : NSObject
{
IBOutlet NSWindow *preferencesPanel;
-
+
IBOutlet NSView *generalSettingsView;
IBOutlet NSButton *checkAllowSoftwareUpdates;
IBOutlet NSButton *checkEnableHubDiscovery;
@@ -20,15 +34,15 @@
IBOutlet NSView *forwardingSettingsView;
IBOutlet NSTableView *fibTableView;
-
+
IBOutlet NSView *securitySettingsView;
IBOutlet NSView *testbedSettingsView;
-
+
IBOutlet NSPanel *prefixRegistrationSheet;
IBOutlet NSComboBox *tunnelCombobox;
IBOutlet NSTextField *namePrefixText;
IBOutlet NSTextField *endpointText;
-
+
IBOutlet FibTableController *tableController;
}
diff --git a/osx/preference-delegate.mm b/osx/preference-delegate.mm
index dd0bfaf..f164c10 100644
--- a/osx/preference-delegate.mm
+++ b/osx/preference-delegate.mm
@@ -1,12 +1,26 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
-#include "config.h"
+#include "config.hpp"
#import "preference-delegate.h"
#import "menu-delegate.h"
@@ -17,7 +31,7 @@
[preferencesPanel setContentView:generalSettingsView];
[preferencesPanel makeKeyAndOrderFront:sender];
[preferencesPanel setLevel: NSStatusWindowLevel];
-
+
tableController.m_tableView = fibTableView;
}
@@ -46,29 +60,29 @@
{
[NSApp endSheet:prefixRegistrationSheet];
[prefixRegistrationSheet orderOut:sender];
-
+
NSString *prefixName = [namePrefixText stringValue];
NSString *tunnelType = [tunnelCombobox itemObjectValueAtIndex:[tunnelCombobox indexOfSelectedItem]];
NSString *endpoint = [endpointText stringValue];
- NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
- NSTask *task = [[NSTask alloc] init];
- [task setLaunchPath: @NDND_FIB_COMMAND];
- [task setArguments: [NSArray arrayWithObjects: @"add", prefixName, tunnelType, endpoint, nil]];
- [task launch];
- [task waitUntilExit];
- }];
+ // NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
+ // NSTask *task = [[NSTask alloc] init];
+ // [task setLaunchPath: @NDND_FIB_COMMAND];
+ // [task setArguments: [NSArray arrayWithObjects: @"add", prefixName, tunnelType, endpoint, nil]];
+ // [task launch];
+ // [task waitUntilExit];
+ // }];
- [(MenuDelegate*)[[NSApplication sharedApplication] delegate] updateStatusWithDependency:operation];
+ // [(MenuDelegate*)[[NSApplication sharedApplication] delegate] updateStatusWithDependency:operation];
}
-(IBAction)removeFibEntry:(id)sender
{
NSInteger selectedRow = [fibTableView selectedRow];
-
+
if(selectedRow == -1)
return;
-
+
NSString *faceID = [tableController getFaceByRowIndex:selectedRow];
if (faceID == nil)
return;
@@ -77,15 +91,15 @@
if (prefix == nil)
return;
- NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
- NSTask *task = [[NSTask alloc] init];
- [task setLaunchPath: @NDND_FIB_COMMAND];
- [task setArguments: [NSArray arrayWithObjects: @"del", prefix, @"face", faceID, nil]];
- [task launch];
- [task waitUntilExit];
- }];
+ // NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
+ // NSTask *task = [[NSTask alloc] init];
+ // [task setLaunchPath: @NDND_FIB_COMMAND];
+ // [task setArguments: [NSArray arrayWithObjects: @"del", prefix, @"face", faceID, nil]];
+ // [task launch];
+ // [task waitUntilExit];
+ // }];
- [(MenuDelegate*)[[NSApplication sharedApplication] delegate] updateStatusWithDependency:operation];
+ // [(MenuDelegate*)[[NSApplication sharedApplication] delegate] updateStatusWithDependency:operation];
}
- (IBAction) showFibEntrySheet:(id)sender
@@ -95,7 +109,7 @@
modalDelegate:self
didEndSelector:nil
contextInfo:nil];
-
+
[tunnelCombobox selectItemAtIndex:0];
}
diff --git a/osx/sparkle-auto-update.h b/osx/sparkle-auto-update.h
index 78c793f..b8c850f 100644
--- a/osx/sparkle-auto-update.h
+++ b/osx/sparkle-auto-update.h
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Zhenkai Zhu <zhenkai@cs.ucla.edu>
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#ifndef SPARKLE_AUTO_UPDATE_H
diff --git a/osx/sparkle-auto-update.mm b/osx/sparkle-auto-update.mm
index a3a9b20..84612b3 100644
--- a/osx/sparkle-auto-update.mm
+++ b/osx/sparkle-auto-update.mm
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Zhenkai Zhu <zhenkai@cs.ucla.edu>
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#include "sparkle-auto-update.h"
diff --git a/osx/system-events.h b/osx/system-events.h
index 52370ce..fa8cd25 100644
--- a/osx/system-events.h
+++ b/osx/system-events.h
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#import <Cocoa/Cocoa.h>
diff --git a/osx/system-events.mm b/osx/system-events.mm
index b7297f8..812ebf4 100644
--- a/osx/system-events.mm
+++ b/osx/system-events.mm
@@ -1,24 +1,38 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
/*
Potentially useful System Configuration regex patterns:
(backslash quoting below is only to protect the C comment)
- State:/Network/Interface/.*\/Link
+ State:/Network/Interface/.*\/Link
State:/Network/Interface/.*\/IPv4
State:/Network/Interface/.*\/IPv6
-
+
State:/Network/Global/DNS
State:/Network/Global/IPv4
-
+
Potentially useful notifications from Darwin Notify Center:
-
+
com.apple.system.config.network_change
*/
@@ -60,8 +74,8 @@
return nil;
}
- [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
- selector: @selector(wakeUpNotification:)
+ [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
+ selector: @selector(wakeUpNotification:)
name: NSWorkspaceDidWakeNotification object: NULL];
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
@@ -70,7 +84,7 @@
CFSTR ("com.apple.system.config.network_change"), // name of notification
NULL, // object to observe
NSNotificationSuspensionBehaviorDeliverImmediately);
-
+
return self;
}
diff --git a/osx/tight-menu-item-view.h b/osx/tight-menu-item-view.h
index 43b04b6..c0925a5 100644
--- a/osx/tight-menu-item-view.h
+++ b/osx/tight-menu-item-view.h
@@ -1,9 +1,23 @@
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#import <Foundation/Foundation.h>
diff --git a/osx/tight-menu-item-view.mm b/osx/tight-menu-item-view.mm
index acd7830..65e0125 100644
--- a/osx/tight-menu-item-view.mm
+++ b/osx/tight-menu-item-view.mm
@@ -1,10 +1,23 @@
-//
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * @copyright See LICENCE for copyright and license information.
+/**
+ * Copyright (c) 2013-2014, Regents of the University of California,
*
- * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- * @author Ilya Moiseenko <iliamo@ucla.edu>
+ * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
+ * authors and contributors.
+ *
+ * NFD Control Center is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with NFD
+ * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
*/
#import "tight-menu-item-view.h"
@@ -30,7 +43,7 @@
blue:(70.0f/255.0f)
alpha:1.0] set];
NSRectFill(fullBounds);
-
+
NSTextField *connectionStatusText = [[NSTextField alloc] initWithFrame:[self bounds]];
[connectionStatusText setTextColor:[NSColor whiteColor]];
[connectionStatusText setStringValue:status];
@@ -41,7 +54,7 @@
[connectionStatusText setAlignment:NSCenterTextAlignment];
NSFont *theFont = [NSFont fontWithName:@"Lucida Grande" size:14];
[connectionStatusText setFont:theFont];
-
+
[self addSubview: connectionStatusText];
}
diff --git a/osx/wscript b/osx/wscript
new file mode 100644
index 0000000..9a6c4bf
--- /dev/null
+++ b/osx/wscript
@@ -0,0 +1,76 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+from waflib import Logs, Utils, Task, TaskGen
+
+top = '..'
+
+def configure(conf):
+
+ conf.find_program('ibtool', var='IBTOOL', mandatory=False)
+
+ conf.check_cxx(framework_name='Foundation', uselib_store='FOUNDATION',
+ compile_filename='test.mm')
+ conf.check_cxx(framework_name='AppKit', uselib_store='APPKIT',
+ compile_filename='test.mm')
+ conf.check_cxx(framework_name='Cocoa', uselib_store='COCOA',
+ compile_filename='test.mm')
+
+ conf.env.ARCH_OSX = 'x86_64'
+ conf.env.CXXFLAGS_OSX += ['-fobjc-arc', '-mmacosx-version-min=10.7']
+ conf.env.LINKFLAGS_OSX += ['-mmacosx-version-min=10.7']
+ conf.env.MACOSX_DEPLOYMENT_TARGET = '10.7'
+
+ conf.load('sparkle')
+
+def build(bld):
+ bld(
+ target = "../NFD Control Center",
+ features=['cxxprogram', 'cxx'],
+ includes = ".. .",
+ source = bld.path.ant_glob(['**/*.mm', 'MainMenu.xib']),
+
+ mac_app = True,
+ use = "OSX COCOA FOUNDATION APPKIT SPARKLE",
+
+ mac_plist = 'Info.plist',
+ mac_resources = [i.path_from(bld.path) for i in bld.path.ant_glob('Resources/**/*')],
+ mac_frameworks = "Frameworks/Sparkle.framework",
+ )
+
+from waflib import TaskGen
+@TaskGen.extension('.mm')
+def m_hook(self, node):
+ """Alias .mm files to be compiled the same as .cc files, gcc/clang will do the right thing."""
+ return self.create_compiled_task('cxx', node)
+
+@TaskGen.extension('.m')
+def m_hook(self, node):
+ """Alias .m files to be compiled the same as .c files, gcc/clang will do the right thing."""
+ return self.create_compiled_task('c', node)
+
+
+def bundle_name_for_output(name):
+ return "%s.app" % name
+ # k = name.rfind('.')
+ # if k >= 0:
+ # name = name[:k] + '.app'
+ # else:
+ # name = name + '.app'
+ # return name
+
+@TaskGen.extension('.xib')
+def xib(self,node):
+ out = node.change_ext('.nib')
+
+ name = self.path.get_bld().find_or_declare(bundle_name_for_output(self.target))
+ resources = name.find_or_declare(['Contents', 'Resources'])
+ resources.mkdir()
+ real_out = resources.make_node(out.name)
+
+ self.create_task('xib', node, real_out)
+ inst_to = getattr(self, 'install_path', '/Applications') + '/%s/Contents/Resources' % name
+ self.bld.install_as(inst_to + '/%s' % real_out.name, real_out)
+
+class xib(Task.Task):
+ color='PINK'
+ run_str = '${IBTOOL} --errors --warnings --notices --output-format human-readable-text --compile ${TGT} ${SRC}'