diff options
author | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
commit | cfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch) | |
tree | 18d94153a302445196fc0c18586abf44a1ce4a38 /Slimber/Cocoa | |
parent | 1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff) | |
download | swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2 |
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Slimber/Cocoa')
-rw-r--r-- | Slimber/Cocoa/CocoaController.mm | 14 | ||||
-rw-r--r-- | Slimber/Cocoa/CocoaMenulet.h | 34 | ||||
-rw-r--r-- | Slimber/Cocoa/CocoaMenulet.mm | 86 | ||||
-rw-r--r-- | Slimber/Cocoa/main.mm | 8 |
4 files changed, 71 insertions, 71 deletions
diff --git a/Slimber/Cocoa/CocoaController.mm b/Slimber/Cocoa/CocoaController.mm index 1d2ef5c..7d17948 100644 --- a/Slimber/Cocoa/CocoaController.mm +++ b/Slimber/Cocoa/CocoaController.mm @@ -11,19 +11,19 @@ #include <Slimber/MainController.h> @implementation CocoaController { - CocoaMenulet* menulet; - MainController* main; + CocoaMenulet* menulet; + MainController* main; } - (void) dealloc { - delete main; - delete menulet; - [super dealloc]; + delete main; + delete menulet; + [super dealloc]; } - (void) awakeFromNib { - menulet = new CocoaMenulet(); - main = new MainController(menulet, eventLoop); + menulet = new CocoaMenulet(); + main = new MainController(menulet, eventLoop); } @end diff --git a/Slimber/Cocoa/CocoaMenulet.h b/Slimber/Cocoa/CocoaMenulet.h index c31f15c..0dc06f5 100644 --- a/Slimber/Cocoa/CocoaMenulet.h +++ b/Slimber/Cocoa/CocoaMenulet.h @@ -13,21 +13,21 @@ #include <SwifTools/Cocoa/CocoaAction.h> class CocoaMenulet : public Menulet { - public: - CocoaMenulet(); - virtual ~CocoaMenulet(); - - private: - virtual void clear(); - virtual void addItem(const std::string& name, const std::string& icon); - virtual void addSeparator(); - void setIcon(const std::string& icon); - virtual void addAboutItem(); - virtual void addRestartItem(); - virtual void addExitItem(); - - private: - NSStatusItem* statusItem; - NSMenu* menu; - CocoaAction* restartAction; + public: + CocoaMenulet(); + virtual ~CocoaMenulet(); + + private: + virtual void clear(); + virtual void addItem(const std::string& name, const std::string& icon); + virtual void addSeparator(); + void setIcon(const std::string& icon); + virtual void addAboutItem(); + virtual void addRestartItem(); + virtual void addExitItem(); + + private: + NSStatusItem* statusItem; + NSMenu* menu; + CocoaAction* restartAction; }; diff --git a/Slimber/Cocoa/CocoaMenulet.mm b/Slimber/Cocoa/CocoaMenulet.mm index f62da80..98042d7 100644 --- a/Slimber/Cocoa/CocoaMenulet.mm +++ b/Slimber/Cocoa/CocoaMenulet.mm @@ -11,72 +11,72 @@ #include <SwifTools/Cocoa/CocoaUtil.h> CocoaMenulet::CocoaMenulet() { - restartAction = [[CocoaAction alloc] initWithFunction: - new boost::function<void()>(boost::ref(onRestartClicked))]; - menu = [[NSMenu alloc] init]; + restartAction = [[CocoaAction alloc] initWithFunction: + new boost::function<void()>(boost::ref(onRestartClicked))]; + menu = [[NSMenu alloc] init]; - statusItem = [[[NSStatusBar systemStatusBar] - statusItemWithLength: NSVariableStatusItemLength] retain]; - [statusItem setHighlightMode: YES]; - [statusItem setEnabled: YES]; - [statusItem setToolTip: @"Slimber"]; - [statusItem setMenu: menu]; + statusItem = [[[NSStatusBar systemStatusBar] + statusItemWithLength: NSVariableStatusItemLength] retain]; + [statusItem setHighlightMode: YES]; + [statusItem setEnabled: YES]; + [statusItem setToolTip: @"Slimber"]; + [statusItem setMenu: menu]; } CocoaMenulet::~CocoaMenulet() { - [statusItem release]; - [menu release]; - [restartAction release]; + [statusItem release]; + [menu release]; + [restartAction release]; } void CocoaMenulet::setIcon(const std::string& icon) { - NSString* path = [[NSBundle mainBundle] pathForResource: std2NSString(icon) ofType:@"png"]; - NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; - [statusItem setImage: image]; - [image release]; + NSString* path = [[NSBundle mainBundle] pathForResource: std2NSString(icon) ofType:@"png"]; + NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; + [statusItem setImage: image]; + [image release]; } void CocoaMenulet::clear() { - while ([menu numberOfItems] > 0) { - [menu removeItemAtIndex: 0]; - } + while ([menu numberOfItems] > 0) { + [menu removeItemAtIndex: 0]; + } } void CocoaMenulet::addItem(const std::string& name, const std::string& icon) { - NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: std2NSString(name) - action: NULL keyEquivalent: @""]; - if (!icon.empty()) { - NSString* path = [[NSBundle mainBundle] pathForResource: std2NSString(icon) ofType:@"png"]; - NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; - [item setImage: image]; - [image release]; - } - [menu addItem: item]; - [item release]; + NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: std2NSString(name) + action: NULL keyEquivalent: @""]; + if (!icon.empty()) { + NSString* path = [[NSBundle mainBundle] pathForResource: std2NSString(icon) ofType:@"png"]; + NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; + [item setImage: image]; + [image release]; + } + [menu addItem: item]; + [item release]; } void CocoaMenulet::addAboutItem() { - NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"About Slimber" action: @selector(orderFrontStandardAboutPanel:) keyEquivalent: @""]; - [item setTarget: [NSApplication sharedApplication]]; - [menu addItem: item]; - [item release]; + NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"About Slimber" action: @selector(orderFrontStandardAboutPanel:) keyEquivalent: @""]; + [item setTarget: [NSApplication sharedApplication]]; + [menu addItem: item]; + [item release]; } void CocoaMenulet::addRestartItem() { - NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: - @"Restart" action: @selector(doAction:) keyEquivalent: @""]; - [item setTarget: restartAction]; - [menu addItem: item]; - [item release]; + NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: + @"Restart" action: @selector(doAction:) keyEquivalent: @""]; + [item setTarget: restartAction]; + [menu addItem: item]; + [item release]; } void CocoaMenulet::addExitItem() { - NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"Exit" action: @selector(terminate:) keyEquivalent: @""]; - [item setTarget: [NSApplication sharedApplication]]; - [menu addItem: item]; - [item release]; + NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"Exit" action: @selector(terminate:) keyEquivalent: @""]; + [item setTarget: [NSApplication sharedApplication]]; + [menu addItem: item]; + [item release]; } void CocoaMenulet::addSeparator() { - [menu addItem: [NSMenuItem separatorItem]]; + [menu addItem: [NSMenuItem separatorItem]]; } diff --git a/Slimber/Cocoa/main.mm b/Slimber/Cocoa/main.mm index 41678f1..c5495af 100644 --- a/Slimber/Cocoa/main.mm +++ b/Slimber/Cocoa/main.mm @@ -13,8 +13,8 @@ Swift::CocoaEventLoop* eventLoop; int main(int argc, char *argv[]) { - eventLoop = new Swift::CocoaEventLoop(); - int result = NSApplicationMain(argc, const_cast<const char **>(argv)); - delete eventLoop; - return result; + eventLoop = new Swift::CocoaEventLoop(); + int result = NSApplicationMain(argc, const_cast<const char **>(argv)); + delete eventLoop; + return result; } |