NEW: XcodeCapp 4.0
XcodeCapp 4.0 is a major release of our beloved tool. In a nutshell it: - allows to manage multiple projects simultaneously - allows to follow operations and cancel them - has a per project Error and Warning reporting - supports capp_env as you can define additional paths and objj include path per project - much more things
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* This file is a part of program XcodeCapp
|
||||
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <CoreServices/CoreServices.h>
|
||||
#import <Quartz/Quartz.h>
|
||||
|
||||
@class XcodeCapp;
|
||||
|
||||
@interface AppController : NSObject <NSApplicationDelegate, NSMenuDelegate>
|
||||
|
||||
@property (strong) IBOutlet NSMenu *statusMenu;
|
||||
@property (unsafe_unretained) IBOutlet NSMenuItem *menuItemHistory;
|
||||
@property (unsafe_unretained) IBOutlet NSMenuItem *menuItemOpenProject;
|
||||
@property (unsafe_unretained) IBOutlet NSMenuItem *menuItemShowInFinder;
|
||||
|
||||
@property (strong) IBOutlet NSPanel *aboutWindow;
|
||||
@property (strong) IBOutlet NSWindow *preferencesWindow;
|
||||
|
||||
@property (strong) IBOutlet NSWindow *helpWindow;
|
||||
@property (unsafe_unretained) IBOutlet PDFView *helpView;
|
||||
|
||||
@property (strong) IBOutlet NSUserDefaultsController *preferencesController;
|
||||
@property (strong) IBOutlet XcodeCapp *xcc;
|
||||
|
||||
+ (AppController *)sharedAppController;
|
||||
|
||||
- (IBAction)createProject:(id)sender;
|
||||
- (IBAction)loadProject:(id)aSender;
|
||||
- (IBAction)openHelp:(id)aSender;
|
||||
- (IBAction)openAbout:(id)aSender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,541 +0,0 @@
|
||||
/*
|
||||
* This file is a part of program XcodeCapp
|
||||
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#import <AppKit/NSApplication.h>
|
||||
|
||||
#import "AppController.h"
|
||||
#import "Notifications.h"
|
||||
#import "XcodeCapp.h"
|
||||
#import "UserDefaults.h"
|
||||
|
||||
|
||||
AppController *SharedAppControllerInstance = nil;
|
||||
|
||||
|
||||
@interface AppController ()
|
||||
|
||||
@property (nonatomic) NSImage *iconActive;
|
||||
@property (nonatomic) NSImage *iconInactive;
|
||||
@property (nonatomic) NSImage *iconWorking;
|
||||
@property (nonatomic) NSImage *iconError;
|
||||
@property (nonatomic) NSMenu *recentMenu;
|
||||
@property NSStatusItem *statusItem;
|
||||
@property NSString *finderName;
|
||||
@property BOOL appFinishedLaunching;
|
||||
@property NSString *pathToOpenAtLaunch;
|
||||
@property NSFileManager *fm;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation AppController
|
||||
|
||||
+ (AppController *)sharedAppController
|
||||
{
|
||||
return SharedAppControllerInstance;
|
||||
}
|
||||
|
||||
#pragma mark - Initialization
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
SharedAppControllerInstance = self;
|
||||
self.fm = [NSFileManager defaultManager];
|
||||
|
||||
[self registerDefaultPreferences];
|
||||
[self initLogging];
|
||||
|
||||
DDLogVerbose(@"\n******************************\n** XcodeCapp started **\n******************************\n");
|
||||
|
||||
self.aboutWindow.backgroundColor = [NSColor whiteColor];
|
||||
[self initStatusItem];
|
||||
[self initObservers];
|
||||
[self initShowInFinderItem];
|
||||
[self pruneProjectHistory];
|
||||
[self updateHistoryMenu];
|
||||
[self checkFirstLaunch];
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
|
||||
{
|
||||
if (filename)
|
||||
{
|
||||
NSString *path = filename.stringByStandardizingPath;
|
||||
|
||||
if (self.appFinishedLaunching)
|
||||
return [self loadProjectAtPath:path reopening:YES];
|
||||
else
|
||||
self.pathToOpenAtLaunch = path;
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
self.appFinishedLaunching = YES;
|
||||
|
||||
if (![self.xcc executablesAreAccessible])
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
|
||||
NSRunAlertPanel(
|
||||
@"Executables are missing.",
|
||||
@"Please make sure that each one of these executables:\n\n"
|
||||
@"%@\n\n"
|
||||
@"(or a symlink to it) is within one these directories:\n\n"
|
||||
@"%@\n\n"
|
||||
@"They do not all have to be in the same directory.",
|
||||
@"Quit",
|
||||
nil,
|
||||
nil,
|
||||
[self.xcc.executables componentsJoinedByString:@"\n"],
|
||||
[self.xcc.environmentPaths componentsJoinedByString:@"\n"]);
|
||||
|
||||
[[NSApplication sharedApplication] terminate:self];
|
||||
return;
|
||||
}
|
||||
|
||||
// If we were opened from the command line, self.pathToOpenAtLaunch will be set.
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
if (!self.pathToOpenAtLaunch)
|
||||
{
|
||||
if (![defaults boolForKey:kDefaultXCCReopenLastProject])
|
||||
return;
|
||||
|
||||
self.pathToOpenAtLaunch = [defaults objectForKey:kDefaultLastOpenedPath];
|
||||
}
|
||||
|
||||
if (self.pathToOpenAtLaunch)
|
||||
{
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:self.pathToOpenAtLaunch])
|
||||
[self loadProjectAtPath:self.pathToOpenAtLaunch reopening:YES];
|
||||
else
|
||||
[defaults removeObjectForKey:kDefaultLastOpenedPath];
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Register default values for preferences
|
||||
*/
|
||||
- (void)registerDefaultPreferences
|
||||
{
|
||||
NSDictionary *appDefaults = @{
|
||||
kDefaultLastEventId: [NSNumber numberWithUnsignedLongLong:kFSEventStreamEventIdSinceNow],
|
||||
kDefaultFirstLaunch: @YES,
|
||||
kDefaultFirstLaunchVersion: @2.0,
|
||||
kDefaultXCCAPIMode: [NSNumber numberWithInt:kXCCAPIModeAuto],
|
||||
kDefaultXCCReactToInodeMod: @YES,
|
||||
kDefaultXCCReopenLastProject: @YES,
|
||||
kDefaultXCCAutoOpenErrorsPanelOnErrors: @YES,
|
||||
kDefaultXCCAutoOpenErrorsPanelOnCappLint: @YES,
|
||||
kDefaultXCCAutoShowNotificationOnErrors: @YES,
|
||||
kDefaultXCCAutoShowNotificationOnCappLint: @YES,
|
||||
kDefaultXCCProjectHistory: [NSArray new],
|
||||
kDefaultMaxRecentProjects: @20,
|
||||
kDefaultLogLevel: [NSNumber numberWithInt:LOG_LEVEL_WARN],
|
||||
kDefaultAutoOpenXcodeProject: @YES,
|
||||
kDefaultUseSymlinkWhenCreatingProject: @YES,
|
||||
kDefaultXCCUseDebugFrameworkWithObjj: @YES,
|
||||
kDefaultXCCShouldProcessObjj: @YES,
|
||||
kDefaultXCCPanelStyleUtility: @NO,
|
||||
kDefaultXCCPanelActiveAppWhenOpening: @NO
|
||||
};
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
[defaults registerDefaults:appDefaults];
|
||||
[defaults synchronize];
|
||||
|
||||
[defaults addObserver:self
|
||||
forKeyPath:kDefaultMaxRecentProjects
|
||||
options:NSKeyValueObservingOptionNew
|
||||
context:NULL];
|
||||
}
|
||||
|
||||
- (void)initLogging
|
||||
{
|
||||
#if DEBUG
|
||||
[DDLog addLogger:[DDTTYLogger sharedInstance]];
|
||||
[[DDTTYLogger sharedInstance] setColorsEnabled:YES];
|
||||
[DDLogLevel setLogLevel:LOG_LEVEL_VERBOSE];
|
||||
#else
|
||||
[DDLog addLogger:[DDASLLogger sharedInstance]];
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
int logLevel = (int)[defaults integerForKey:kDefaultLogLevel];
|
||||
NSUInteger modifiers = [NSEvent modifierFlags];
|
||||
|
||||
if (modifiers & NSAlternateKeyMask)
|
||||
logLevel = LOG_LEVEL_VERBOSE;
|
||||
|
||||
[DDLogLevel setLogLevel:logLevel];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)initStatusItem
|
||||
{
|
||||
self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
|
||||
self.statusItem.menu = self.statusMenu;
|
||||
self.statusItem.image = self.iconInactive;
|
||||
self.statusItem.highlightMode = YES;
|
||||
self.statusItem.length = self.iconInactive.size.width + 12; // Add some space around the icon
|
||||
self.statusMenu.delegate = self;
|
||||
}
|
||||
|
||||
- (void)initObservers
|
||||
{
|
||||
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
|
||||
|
||||
[defaultCenter addObserver:self selector:@selector(batchDidStart:) name:XCCBatchDidStartNotification object:nil];
|
||||
[defaultCenter addObserver:self selector:@selector(batchDidEnd:) name:XCCBatchDidEndNotification object:nil];
|
||||
[defaultCenter addObserver:self selector:@selector(projectDidFinishLoading:) name:XCCProjectDidFinishLoadingNotification object:nil];
|
||||
}
|
||||
|
||||
- (void)initShowInFinderItem
|
||||
{
|
||||
// See if PathFinder is available
|
||||
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
|
||||
NSString *path = [workspace absolutePathForAppBundleWithIdentifier:@"com.cocoatech.PathFinder"];
|
||||
|
||||
if (path)
|
||||
self.finderName = path.lastPathComponent.stringByDeletingPathExtension;
|
||||
else
|
||||
self.finderName = @"Finder";
|
||||
|
||||
self.menuItemShowInFinder.title = [NSString stringWithFormat:self.menuItemShowInFinder.title, self.finderName];
|
||||
}
|
||||
|
||||
- (void)pruneProjectHistory
|
||||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSMutableArray *projectHistory = [[defaults arrayForKey:kDefaultXCCProjectHistory] mutableCopy];
|
||||
NSFileManager *fm = [NSFileManager new];
|
||||
|
||||
for (NSInteger i = projectHistory.count - 1; i >= 0; --i)
|
||||
{
|
||||
if (![fm fileExistsAtPath:projectHistory[i]])
|
||||
[projectHistory removeObjectAtIndex:i];
|
||||
}
|
||||
|
||||
NSInteger maxProjects = [defaults integerForKey:kDefaultMaxRecentProjects];
|
||||
|
||||
if (projectHistory.count > maxProjects)
|
||||
[projectHistory removeObjectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(maxProjects, projectHistory.count - maxProjects)]];
|
||||
|
||||
[defaults setObject:projectHistory forKey:kDefaultXCCProjectHistory];
|
||||
}
|
||||
|
||||
- (void)checkFirstLaunch
|
||||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
double firstLaunchVersion = [defaults doubleForKey:kDefaultFirstLaunchVersion];
|
||||
|
||||
// Note: the scanner will only get the major.minor version numbers, which is what we want.
|
||||
NSScanner *scanner = [NSScanner scannerWithString:[self bundleVersion]];
|
||||
double appVersion = 0.0;
|
||||
[scanner scanDouble:&appVersion];
|
||||
|
||||
if ([defaults boolForKey:kDefaultFirstLaunch] || appVersion > firstLaunchVersion)
|
||||
{
|
||||
[defaults setBool:NO forKey:kDefaultFirstLaunch];
|
||||
[defaults setDouble:appVersion forKey:kDefaultFirstLaunchVersion];
|
||||
[self openHelp:self];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Properties
|
||||
|
||||
- (NSImage *)iconActive
|
||||
{
|
||||
if (!_iconActive)
|
||||
_iconActive = [NSImage imageNamed:@"icon-active"];
|
||||
|
||||
return _iconActive;
|
||||
}
|
||||
|
||||
- (NSImage *)iconInactive
|
||||
{
|
||||
if (!_iconInactive)
|
||||
_iconInactive = [NSImage imageNamed:@"icon-inactive"];
|
||||
|
||||
return _iconInactive;
|
||||
}
|
||||
|
||||
- (NSImage *)iconWorking
|
||||
{
|
||||
if (!_iconWorking)
|
||||
_iconWorking = [NSImage imageNamed:@"icon-working"];
|
||||
|
||||
return _iconWorking;
|
||||
}
|
||||
|
||||
- (NSImage *)iconError
|
||||
{
|
||||
if (!_iconError)
|
||||
_iconError = [NSImage imageNamed:@"icon-error"];
|
||||
|
||||
return _iconError;
|
||||
}
|
||||
|
||||
- (NSMenu *)recentMenu
|
||||
{
|
||||
if (!_recentMenu)
|
||||
{
|
||||
_recentMenu = [NSMenu new];
|
||||
_recentMenu.delegate = self;
|
||||
self.menuItemHistory.submenu = _recentMenu;
|
||||
}
|
||||
|
||||
return _recentMenu;
|
||||
}
|
||||
|
||||
#pragma mark - Notification handlers
|
||||
|
||||
- (void)batchDidStart:(NSNotification *)note
|
||||
{
|
||||
DDLogVerbose(@"Batch start");
|
||||
|
||||
self.statusItem.image = self.iconWorking;
|
||||
}
|
||||
|
||||
- (void)batchDidEnd:(NSNotification *)note
|
||||
{
|
||||
DDLogVerbose(@"Batch end");
|
||||
|
||||
if (!self.xcc.isLoadingProject)
|
||||
self.statusItem.image = self.xcc.hasErrors ? self.iconError : self.iconActive;
|
||||
}
|
||||
|
||||
- (void)projectDidFinishLoading:(NSNotification *)note
|
||||
{
|
||||
self.statusItem.image = self.xcc.hasErrors ? self.iconError : self.iconActive;
|
||||
self.menuItemOpenProject.title = [NSString stringWithFormat:@"Close “%@”", self.xcc.projectPath.lastPathComponent];
|
||||
self.menuItemOpenProject.action = @selector(closeProject:);
|
||||
}
|
||||
|
||||
// Watch changes to the max recent projects preference
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
if ([keyPath isEqualToString:kDefaultMaxRecentProjects])
|
||||
[self pruneProjectHistory];
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (IBAction)loadProject:(id)aSender
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
|
||||
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
|
||||
openPanel.title = @"Choose Cappuccino Project";
|
||||
openPanel.canChooseDirectories = YES;
|
||||
openPanel.canCreateDirectories = YES;
|
||||
openPanel.canChooseFiles = NO;
|
||||
|
||||
if ([openPanel runModal] != NSFileHandlingPanelOKButton)
|
||||
return;
|
||||
|
||||
NSString *projectPath = [[openPanel.URLs[0] path] stringByStandardizingPath];
|
||||
[self loadProjectAtPath:projectPath reopening:YES];
|
||||
}
|
||||
|
||||
- (void)closeProject:(id)aSender
|
||||
{
|
||||
[self.xcc stop];
|
||||
|
||||
self.statusItem.image = self.iconInactive;
|
||||
self.menuItemOpenProject.title = @"Open Project…";
|
||||
self.menuItemOpenProject.action = @selector(loadProject:);
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kDefaultLastOpenedPath];
|
||||
}
|
||||
|
||||
- (void)switchToProject:(NSMenuItem *)aSender
|
||||
{
|
||||
[self loadProjectAtPath:aSender.representedObject reopening:NO];
|
||||
}
|
||||
|
||||
- (void)clearProjectHistory:(id)aSender
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[NSArray array] forKey:kDefaultXCCProjectHistory];
|
||||
[self updateHistoryMenu];
|
||||
}
|
||||
|
||||
- (IBAction)showInFinder:(id)aSender
|
||||
{
|
||||
[[NSWorkspace sharedWorkspace] openFile:self.xcc.projectPath withApplication:self.finderName];
|
||||
}
|
||||
|
||||
- (IBAction)openHelp:(id)aSender
|
||||
{
|
||||
if (!self.helpView.document)
|
||||
{
|
||||
NSURL *helpURL = [[NSBundle mainBundle] URLForResource:@"help" withExtension:@"pdf"];
|
||||
PDFDocument *help = [[PDFDocument alloc] initWithURL:helpURL];
|
||||
self.helpView.document = help;
|
||||
}
|
||||
|
||||
[self openWindow:self.helpWindow];
|
||||
}
|
||||
|
||||
- (IBAction)openAbout:(id)aSender
|
||||
{
|
||||
[self openWindow:self.aboutWindow];
|
||||
}
|
||||
|
||||
- (IBAction)openPreferences:(id)aSender
|
||||
{
|
||||
[self openWindow:self.preferencesWindow];
|
||||
}
|
||||
|
||||
- (IBAction)createProject:(id)sender
|
||||
{
|
||||
NSSavePanel *savePanel = [NSSavePanel savePanel];
|
||||
savePanel.title = @"Create a new Cappuccino Project";
|
||||
savePanel.canCreateDirectories = YES;
|
||||
|
||||
if ([savePanel runModal] != NSFileHandlingPanelOKButton)
|
||||
return;
|
||||
|
||||
NSString *projectPath = [[savePanel.URL path] stringByStandardizingPath];
|
||||
|
||||
NSDictionary *taskResult = [self.xcc createProject:projectPath];
|
||||
|
||||
if ([taskResult[@"status"] intValue])
|
||||
return;
|
||||
|
||||
[self loadProjectAtPath:projectPath reopening:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Delegates
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
|
||||
{
|
||||
[self.xcc stop];
|
||||
|
||||
return NSTerminateNow;
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)aMenuItem
|
||||
{
|
||||
NSMenu *menu = aMenuItem.menu;
|
||||
|
||||
if (menu == self.recentMenu)
|
||||
{
|
||||
// Disable recent items if they don't exist or are not directories,
|
||||
// but enable the Clear History item, which is last in the menu.
|
||||
if ([menu indexOfItem:aMenuItem] == menu.itemArray.count - 1)
|
||||
return YES;
|
||||
|
||||
BOOL isDirectory;
|
||||
BOOL exists = [self.fm fileExistsAtPath:aMenuItem.representedObject isDirectory:&isDirectory];
|
||||
|
||||
return exists && isDirectory;
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Bindings
|
||||
|
||||
- (NSString *)bundleVersion
|
||||
{
|
||||
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
|
||||
}
|
||||
|
||||
#pragma mark - Private Helpers
|
||||
|
||||
|
||||
- (BOOL)loadProjectAtPath:(NSString *)path reopening:(BOOL)reopen
|
||||
{
|
||||
if (!reopen && [self.xcc.projectPath isEqualToString:path])
|
||||
return YES;
|
||||
|
||||
[self closeProject:self];
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSMutableArray *projectHistory = [[defaults arrayForKey:kDefaultXCCProjectHistory] mutableCopy];
|
||||
|
||||
if ([projectHistory containsObject:path])
|
||||
[projectHistory removeObject:path];
|
||||
|
||||
// The path may no longer be there, validate it
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
|
||||
BOOL exists, isDirectory;
|
||||
exists = [fm fileExistsAtPath:path isDirectory:&isDirectory];
|
||||
|
||||
if (exists && isDirectory)
|
||||
{
|
||||
[projectHistory insertObject:path atIndex:0];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
NSRunAlertPanel(@"Project not found.", @"%@ %@", nil, nil, nil, path, !exists ? @"no longer exists." : @"is not a directory.");
|
||||
}
|
||||
|
||||
[defaults setObject:projectHistory forKey:kDefaultXCCProjectHistory];
|
||||
[self pruneProjectHistory];
|
||||
[self updateHistoryMenu];
|
||||
|
||||
if (exists && isDirectory)
|
||||
{
|
||||
[self.xcc loadProjectAtPath:path];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)openWindow:(NSWindow *)aWindow
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
[aWindow makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
- (void)updateHistoryMenu
|
||||
{
|
||||
[self.recentMenu removeAllItems];
|
||||
NSArray *projectHistory = [[NSUserDefaults standardUserDefaults] arrayForKey:kDefaultXCCProjectHistory];
|
||||
|
||||
for (NSString *path in projectHistory)
|
||||
{
|
||||
NSMenuItem *item = [self.recentMenu addItemWithTitle:path.lastPathComponent action:@selector(switchToProject:) keyEquivalent:@""];
|
||||
[item setEnabled:YES];
|
||||
item.representedObject = path;
|
||||
}
|
||||
|
||||
[self.recentMenu addItem:[NSMenuItem separatorItem]];
|
||||
[self.recentMenu addItemWithTitle:@"Clear history" action:@selector(clearProjectHistory:) keyEquivalent:@""];
|
||||
|
||||
self.menuItemHistory.enabled = [projectHistory count] > 0;
|
||||
}
|
||||
|
||||
#pragma mark - Cappuccino methods
|
||||
|
||||
- (IBAction)updateCappuccino:(id)sender
|
||||
{
|
||||
[self.xcc performSelectorInBackground:@selector(updateCappuccino) withObject:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// AppDelegate.h
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Alexandre Wilhelm on 5/5/15.
|
||||
// Copyright (c) 2015 cappuccino-project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <CoreServices/CoreServices.h>
|
||||
|
||||
@class XCCMainController;
|
||||
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
{
|
||||
IBOutlet NSMenu *statusMenu;
|
||||
IBOutlet NSUserDefaultsController *preferencesController;
|
||||
IBOutlet NSPanel *aboutWindow;
|
||||
IBOutlet NSWindow *preferencesWindow;
|
||||
|
||||
NSImage *imageStatusInactive;
|
||||
NSImage *imageStatusProcessing;
|
||||
NSImage *imageStatusError;
|
||||
NSStatusItem *statusItem;
|
||||
}
|
||||
|
||||
@property IBOutlet XCCMainController *mainWindowController;
|
||||
@property NSOperationQueue *mainOperationQueue;
|
||||
@property NSString *version;
|
||||
|
||||
- (IBAction)openAbout:(id)aSender;
|
||||
- (IBAction)openPreferences:(id)aSender;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,170 @@
|
||||
//
|
||||
// AppDelegate.m
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Alexandre Wilhelm on 5/5/15.
|
||||
// Copyright (c) 2015 cappuccino-project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "XCCMainController.h"
|
||||
#import "XCCUserDefaults.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
|
||||
#pragma mark - Utilities
|
||||
|
||||
- (void)_initUserDefaults
|
||||
{
|
||||
NSDictionary *appDefaults = @{
|
||||
XCCUserDefaultsAutoOpenXcodeProject: @YES,
|
||||
XCCUserDefaultsLogLevel: @LOG_LEVEL_WARN,
|
||||
XCCUserDefaultsMaxNumberOfConcurrentOperations: @20
|
||||
};
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
- (void)_initStatusItem
|
||||
{
|
||||
self->imageStatusInactive = [NSImage imageNamed:@"status-icon-inactive"];
|
||||
self->imageStatusProcessing = [NSImage imageNamed:@"status-icon-working"];
|
||||
self->imageStatusError = [NSImage imageNamed:@"status-icon-error"];
|
||||
|
||||
self->statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
|
||||
self->statusItem.menu = self->statusMenu;
|
||||
self->statusItem.image = self->imageStatusInactive;
|
||||
self->statusItem.highlightMode = YES;
|
||||
self->statusItem.length = self->imageStatusInactive.size.width + 12;
|
||||
}
|
||||
|
||||
- (void)_initLogging
|
||||
{
|
||||
#if DEBUG
|
||||
[DDLog addLogger:[DDTTYLogger sharedInstance]];
|
||||
[[DDTTYLogger sharedInstance] setColorsEnabled:YES];
|
||||
[DDLogLevel setLogLevel:LOG_LEVEL_VERBOSE];
|
||||
#else
|
||||
[DDLog addLogger:[DDASLLogger sharedInstance]];
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
int logLevel = (int)[defaults integerForKey:XCCUserDefaultsLogLevel];
|
||||
NSUInteger modifiers = [NSEvent modifierFlags];
|
||||
|
||||
if (modifiers & NSAlternateKeyMask)
|
||||
logLevel = LOG_LEVEL_VERBOSE;
|
||||
|
||||
[DDLogLevel setLogLevel:logLevel];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)_initOperationQueue
|
||||
{
|
||||
self.mainOperationQueue = [NSOperationQueue new];
|
||||
|
||||
[self.mainOperationQueue setMaxConcurrentOperationCount:[[[NSUserDefaults standardUserDefaults] objectForKey:XCCUserDefaultsMaxNumberOfConcurrentOperations] intValue]];
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
- (IBAction)openPreferences:(id)aSender
|
||||
{
|
||||
[self->preferencesWindow makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
- (IBAction)openAbout:(id)aSender
|
||||
{
|
||||
[self->aboutWindow makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Observers
|
||||
|
||||
- (void)_startObservers
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] addObserver:self forKeyPath:XCCUserDefaultsMaxNumberOfConcurrentOperations options:NSKeyValueObservingOptionNew context:nil];
|
||||
|
||||
[self.mainOperationQueue addObserver:self forKeyPath:@"operationCount" options:NSKeyValueObservingOptionNew context:nil];
|
||||
[self.mainWindowController addObserver:self forKeyPath:@"totalNumberOfErrors" options:NSKeyValueObservingOptionNew context:nil];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
if (object == [NSUserDefaults standardUserDefaults] && [keyPath isEqualToString:XCCUserDefaultsMaxNumberOfConcurrentOperations])
|
||||
{
|
||||
[self.mainOperationQueue setMaxConcurrentOperationCount:[change[NSKeyValueChangeNewKey] intValue]];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSImage *image;
|
||||
|
||||
if (self.mainOperationQueue.operationCount)
|
||||
image = self->imageStatusProcessing;
|
||||
else if ([self.mainWindowController totalNumberOfErrors])
|
||||
image = self->imageStatusError;
|
||||
else
|
||||
image = self->imageStatusInactive;
|
||||
|
||||
[self->statusItem performSelectorOnMainThread:@selector(setImage:) withObject:image waitUntilDone:NO];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Delegates
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
DDLogVerbose(@"\n******************************\n** XcodeCapp started **\n******************************\n");
|
||||
|
||||
self.version = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];
|
||||
|
||||
[self _initUserDefaults];
|
||||
[self _initLogging];
|
||||
[self _initOperationQueue];
|
||||
[self _initStatusItem];
|
||||
|
||||
[self _startObservers];
|
||||
|
||||
[self->_mainWindowController windowDidLoad];
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
|
||||
{
|
||||
DDLogVerbose(@"Stop listening to all projects");
|
||||
[self.mainWindowController notifyCappuccinoControllersApplicationIsClosing];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
return NSTerminateNow;
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification
|
||||
{
|
||||
DDLogVerbose(@"\n******************************\n** XcodeCapp stopped **\n******************************\n");
|
||||
}
|
||||
|
||||
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
|
||||
{
|
||||
[self.mainWindowController showWindow:self];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication *)application openFile:(NSString *)filename
|
||||
{
|
||||
BOOL isDir;
|
||||
|
||||
[[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isDir];
|
||||
|
||||
if (isDir)
|
||||
{
|
||||
[self.mainWindowController manageCappuccinoProjectControllerForPath:filename];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -13,7 +13,7 @@ ONLY_ACTIVE_ARCH = YES
|
||||
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
|
||||
COMBINE_HIDPI_IMAGES = YES
|
||||
INSTALL_PATH = $(LOCAL_APPS_DIR)
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6.8
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10
|
||||
COPY_PHASE_STRIP = NO
|
||||
INFOPLIST_FILE = XcodeCapp/Info.plist
|
||||
PRODUCT_NAME = XcodeCapp
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8121.20" systemVersion="15A204h" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<development version="6300" identifier="xcode"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8121.20"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="XCCErrorsViewController">
|
||||
<connections>
|
||||
<outlet property="errorOutlineView" destination="Wcz-on-5sJ" id="5Tx-At-ehM"/>
|
||||
<outlet property="maskingView" destination="zzu-5V-jxy" id="o44-z3-rGK"/>
|
||||
<outlet property="view" destination="bBp-Me-gFz" id="TMO-Xg-NHa"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="bBp-Me-gFz" userLabel="Main View">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="400"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="111" horizontalPageScroll="10" verticalLineScroll="111" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="qFG-4o-jZU">
|
||||
<rect key="frame" x="0.0" y="25" width="400" height="375"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" id="ihl-1p-zkN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="375"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="none" multipleSelection="NO" autosaveColumns="NO" rowHeight="101" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="16" outlineTableColumn="YdX-BQ-xQG" id="Wcz-on-5sJ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="0.0"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
<size key="intercellSpacing" width="5" height="10"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn width="395" minWidth="40" maxWidth="9999999" id="YdX-BQ-xQG">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="sN2-YK-a89">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView identifier="OperationErrorHeaderCell" id="ukB-9q-eZa" customClass="XCCOperationErrorHeaderDataView">
|
||||
<rect key="frame" x="2" y="5" width="395" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="tYH-Hh-IAc">
|
||||
<rect key="frame" x="6" y="3" width="394" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" title="Table View Cell" id="T9K-ex-2Wj">
|
||||
<font key="font" size="12" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<connections>
|
||||
<outlet property="fieldName" destination="tYH-Hh-IAc" id="Jd4-Ex-sgr"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
<tableCellView identifier="OperationErrorCell" id="OMn-8Z-L2f" customClass="XCCOperationErrorDataView">
|
||||
<rect key="frame" x="2" y="35" width="395" height="101"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<box autoresizesSubviews="NO" cornerRadius="3" title="Box" boxType="custom" borderType="line" titlePosition="noTitle" id="MWc-o4-8Q2">
|
||||
<rect key="frame" x="3" y="3" width="355" height="80"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<view key="contentView">
|
||||
<rect key="frame" x="1" y="1" width="353" height="78"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="fAM-P0-o5o">
|
||||
<rect key="frame" x="13" y="6" width="327" height="66"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="small" selectable="YES" sendsActionOnEndEditing="YES" title="Table View Cell" id="vy1-tz-zDb">
|
||||
<font key="font" size="11" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</view>
|
||||
<animations/>
|
||||
<color key="borderColor" red="0.90699486819999997" green="0.90699486819999997" blue="0.90699486819999997" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="fillColor" red="0.97414338089999997" green="0.97084119989999995" blue="0.97744556179999997" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</box>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="ng2-IC-e85">
|
||||
<rect key="frame" x="16" y="87" width="74" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Line number" id="jKW-4V-hZZ">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="my2-jo-uaH">
|
||||
<rect key="frame" x="93" y="87" width="233" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="200" id="uhp-6F-EA1">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" id="7DM-NL-nZw">
|
||||
<rect key="frame" x="3" y="88" width="12" height="12"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSRemoveTemplate" id="jaI-iA-MGK"/>
|
||||
</imageView>
|
||||
<button toolTip="Edit in Code Editor" verticalHuggingPriority="750" id="mMx-zB-OZi">
|
||||
<rect key="frame" x="325" y="86" width="33" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="open-in-editor" imagePosition="overlaps" alignment="center" controlSize="small" imageScaling="proportionallyUpOrDown" inset="2" id="eLG-E9-mZh">
|
||||
<behavior key="behavior" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<connections>
|
||||
<outlet property="buttonOpenInEditor" destination="mMx-zB-OZi" id="PSh-eP-PHa"/>
|
||||
<outlet property="fieldLineNumber" destination="my2-jo-uaH" id="SJQ-Rt-O7D"/>
|
||||
<outlet property="fieldMessage" destination="fAM-P0-o5o" id="2xz-hF-bfY"/>
|
||||
<outlet property="imageViewType" destination="7DM-NL-nZw" id="ebl-MA-9pc"/>
|
||||
<outlet property="labelLineNumber" destination="ng2-IC-e85" id="vP6-Zu-paX"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="-2" id="lUL-h0-wdE"/>
|
||||
<outlet property="delegate" destination="-2" id="OWL-DQ-7Bp"/>
|
||||
</connections>
|
||||
</outlineView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</clipView>
|
||||
<animations/>
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="cAr-D4-7cX">
|
||||
<rect key="frame" x="1" y="119" width="223" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="FyL-86-3OF">
|
||||
<rect key="frame" x="224" y="17" width="15" height="102"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<box autoresizesSubviews="NO" borderWidth="0.0" title="Box" boxType="custom" borderType="line" titlePosition="noTitle" id="MD4-zD-QZt">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<view key="contentView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="wTS-n2-UQU">
|
||||
<rect key="frame" x="-1" y="22" width="402" height="5"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
||||
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<font key="titleFont" metaFont="system"/>
|
||||
</box>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="ago-XC-fwf">
|
||||
<rect key="frame" x="14" y="7" width="343" height="11"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="99999" id="kDG-TG-5o8">
|
||||
<font key="font" metaFont="miniSystem"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="self.cappuccinoProjectController.errorsCountString" id="7je-jq-8G7"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button toolTip="Clean errors" id="Tdm-5T-jGO">
|
||||
<rect key="frame" x="377" y="3" width="18" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="NSMenuOnStateTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="iCa-fe-gSf">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="cleanProjectErrors:" target="-2" id="nQ4-Jp-huO"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</view>
|
||||
<animations/>
|
||||
<color key="borderColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="fillColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</box>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<point key="canvasLocation" x="319" y="-459"/>
|
||||
</customView>
|
||||
<box title="Box" boxType="custom" borderType="line" titlePosition="noTitle" id="zzu-5V-jxy">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="400"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<view key="contentView">
|
||||
<rect key="frame" x="1" y="1" width="398" height="398"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="g7p-NU-xFT">
|
||||
<rect key="frame" x="101" y="188" width="196" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="No Issues" id="cSp-kD-F9V">
|
||||
<font key="font" metaFont="system" size="18"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</view>
|
||||
<animations/>
|
||||
<color key="borderColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="fillColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<point key="canvasLocation" x="780" y="-454"/>
|
||||
</box>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSMenuOnStateTemplate" width="12" height="12"/>
|
||||
<image name="NSRemoveTemplate" width="11" height="11"/>
|
||||
<image name="open-in-editor" width="16" height="16"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// FindSourceFilesOperation.h
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Aparajita on 4/27/13.
|
||||
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class XcodeCapp;
|
||||
|
||||
|
||||
extern NSString * const XCCNeedSourceToProjectPathMappingNotification;
|
||||
|
||||
|
||||
@interface FindSourceFilesOperation : NSOperation
|
||||
|
||||
- (id)initWithXCC:(XcodeCapp *)xcc projectId:(NSNumber *)projectId path:(NSString *)path;
|
||||
|
||||
@end
|
||||
@@ -1,172 +0,0 @@
|
||||
//
|
||||
// FindSourceFilesOperation.m
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Aparajita on 4/27/13.
|
||||
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FindSourceFilesOperation.h"
|
||||
#import "ProcessSourceOperation.h"
|
||||
#import "XcodeCapp.h"
|
||||
|
||||
NSString * const XCCNeedSourceToProjectPathMappingNotification = @"XCCNeedSourceToProjectPathMappingNotification";
|
||||
|
||||
|
||||
@interface FindSourceFilesOperation ()
|
||||
|
||||
@property XcodeCapp *xcc;
|
||||
@property NSNumber *projectId;
|
||||
@property NSString *projectPathToSearch;
|
||||
@property NSString *projectPath;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation FindSourceFilesOperation
|
||||
|
||||
- (id)initWithXCC:(XcodeCapp *)xcc projectId:(NSNumber *)projectId path:(NSString *)path
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
self.xcc = xcc;
|
||||
self.projectId = projectId;
|
||||
self.projectPathToSearch = path;
|
||||
self.projectPath = xcc.projectPath;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)main
|
||||
{
|
||||
[self findSourceFilesAtProjectPath:self.projectPathToSearch];
|
||||
}
|
||||
|
||||
- (void)findSourceFilesAtProjectPath:(NSString *)aProjectPath
|
||||
{
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
DDLogVerbose(@"-->findSourceFiles: %@", aProjectPath);
|
||||
|
||||
NSError *error = NULL;
|
||||
NSString *projectPath = [self.projectPath stringByAppendingPathComponent:aProjectPath];
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
|
||||
NSArray *urls = [fm contentsOfDirectoryAtURL:[NSURL fileURLWithPath:projectPath.stringByResolvingSymlinksInPath]
|
||||
includingPropertiesForKeys:@[NSURLIsDirectoryKey, NSURLIsSymbolicLinkKey]
|
||||
options:NSDirectoryEnumerationSkipsHiddenFiles | NSDirectoryEnumerationSkipsPackageDescendants | NSDirectoryEnumerationSkipsSubdirectoryDescendants
|
||||
error:&error];
|
||||
|
||||
if (!urls)
|
||||
return;
|
||||
|
||||
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
|
||||
|
||||
for (NSURL *url in urls)
|
||||
{
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
NSString *filename = url.lastPathComponent;
|
||||
|
||||
NSString *projectRelativePath = [aProjectPath stringByAppendingPathComponent:filename];
|
||||
NSString *realPath = url.path;
|
||||
NSURL *resolvedURL = url;
|
||||
|
||||
NSNumber *isDirectory, *isSymlink;
|
||||
[url getResourceValue:&isSymlink forKey:NSURLIsSymbolicLinkKey error:nil];
|
||||
|
||||
if (isSymlink.boolValue == YES)
|
||||
{
|
||||
resolvedURL = [url URLByResolvingSymlinksInPath];
|
||||
|
||||
if ([resolvedURL checkResourceIsReachableAndReturnError:nil])
|
||||
{
|
||||
filename = resolvedURL.lastPathComponent;
|
||||
realPath = resolvedURL.path;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
[resolvedURL getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:nil];
|
||||
|
||||
if (isDirectory.boolValue == YES)
|
||||
{
|
||||
if ([self.xcc shouldIgnoreDirectoryNamed:filename])
|
||||
{
|
||||
DDLogVerbose(@"ignored symlinked directory: %@", projectRelativePath);
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the resolved path is not within the project directory and is not ignored, add a mapping to it
|
||||
// so we can map the resolved path back to the project directory later.
|
||||
if (isSymlink.boolValue == YES)
|
||||
{
|
||||
NSString *fullProjectPath = [self.projectPath stringByAppendingPathComponent:projectRelativePath];
|
||||
|
||||
if (![realPath hasPrefix:fullProjectPath] && ![self.xcc pathMatchesIgnoredPaths:fullProjectPath])
|
||||
{
|
||||
DDLogVerbose(@"symlinked directory: %@ -> %@", projectRelativePath, realPath);
|
||||
|
||||
NSDictionary *info =
|
||||
@{
|
||||
@"projectId":self.projectId,
|
||||
@"sourcePath":realPath,
|
||||
@"projectPath":fullProjectPath
|
||||
};
|
||||
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
[center postNotificationName:XCCNeedSourceToProjectPathMappingNotification object:self userInfo:info];
|
||||
}
|
||||
else
|
||||
DDLogVerbose(@"ignored symlinked directory: %@", projectRelativePath);
|
||||
}
|
||||
|
||||
[self findSourceFilesAtProjectPath:projectRelativePath];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
if ([self.xcc pathMatchesIgnoredPaths:realPath])
|
||||
continue;
|
||||
|
||||
NSString *projectSourcePath = [self.projectPath stringByAppendingPathComponent:projectRelativePath];
|
||||
|
||||
if ([self.xcc isObjjFile:filename] || [self.xcc isXibFile:filename])
|
||||
{
|
||||
NSString *processedPath;
|
||||
|
||||
if ([self.xcc isObjjFile:filename])
|
||||
processedPath = [[self.xcc shadowBasePathForProjectSourcePath:projectSourcePath] stringByAppendingPathExtension:@"h"];
|
||||
else
|
||||
processedPath = [projectSourcePath.stringByDeletingPathExtension stringByAppendingPathExtension:@"cib"];
|
||||
|
||||
if (![fm fileExistsAtPath:processedPath])
|
||||
[self createProcessingOperationForProjectSourcePath:projectSourcePath];
|
||||
}
|
||||
}
|
||||
|
||||
DDLogVerbose(@"<--findSourceFiles: %@", aProjectPath);
|
||||
}
|
||||
|
||||
- (void)createProcessingOperationForProjectSourcePath:(NSString *)projectSourcePath
|
||||
{
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
ProcessSourceOperation *op = [[ProcessSourceOperation alloc] initWithXCC:self.xcc
|
||||
projectId:self.projectId
|
||||
sourcePath:projectSourcePath];
|
||||
[[NSOperationQueue currentQueue] addOperation:op];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>TicketVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>AllNotifications</key>
|
||||
<array>
|
||||
<string>DefaultNotifications</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1 +0,0 @@
|
||||
Versions/Current/Growl
|
||||
@@ -1 +0,0 @@
|
||||
Versions/Current/Headers
|
||||
@@ -1 +0,0 @@
|
||||
Versions/Current/Resources
|
||||
@@ -1,5 +0,0 @@
|
||||
#include <Growl/GrowlDefines.h>
|
||||
|
||||
#ifdef __OBJC__
|
||||
# include <Growl/GrowlApplicationBridge.h>
|
||||
#endif
|
||||
@@ -1,567 +0,0 @@
|
||||
//
|
||||
// GrowlApplicationBridge.h
|
||||
// Growl
|
||||
//
|
||||
// Created by Evan Schoenberg on Wed Jun 16 2004.
|
||||
// Copyright 2004-2006 The Growl Project. All rights reserved.
|
||||
//
|
||||
|
||||
/*!
|
||||
* @header GrowlApplicationBridge.h
|
||||
* @abstract Defines the GrowlApplicationBridge class.
|
||||
* @discussion This header defines the GrowlApplicationBridge class as well as
|
||||
* the GROWL_PREFPANE_BUNDLE_IDENTIFIER constant.
|
||||
*/
|
||||
|
||||
#ifndef __GrowlApplicationBridge_h__
|
||||
#define __GrowlApplicationBridge_h__
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Growl/GrowlDefines.h>
|
||||
|
||||
//Forward declarations
|
||||
@protocol GrowlApplicationBridgeDelegate;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
#pragma mark -
|
||||
|
||||
/*!
|
||||
* @class GrowlApplicationBridge
|
||||
* @abstract A class used to interface with Growl.
|
||||
* @discussion This class provides a means to interface with Growl.
|
||||
*
|
||||
* Currently it provides a way to detect if Growl is installed and launch the
|
||||
* GrowlHelperApp if it's not already running.
|
||||
*/
|
||||
@interface GrowlApplicationBridge : NSObject {
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* @method isGrowlInstalled
|
||||
* @abstract Detects whether Growl is installed.
|
||||
* @discussion Determines if the Growl prefpane and its helper app are installed.
|
||||
* @result this method will forever return YES.
|
||||
*/
|
||||
+ (BOOL) isGrowlInstalled __attribute__((deprecated));
|
||||
|
||||
/*!
|
||||
* @method isGrowlRunning
|
||||
* @abstract Detects whether GrowlHelperApp is currently running.
|
||||
* @discussion Cycles through the process list to find whether GrowlHelperApp is running and returns its findings.
|
||||
* @result Returns YES if GrowlHelperApp is running, NO otherwise.
|
||||
*/
|
||||
+ (BOOL) isGrowlRunning;
|
||||
|
||||
|
||||
/*!
|
||||
* @method isMistEnabled
|
||||
* @abstract Gives the caller a fairly good indication of whether or not built-in notifications(Mist) will be used.
|
||||
* @discussion since this call makes use of isGrowlRunning it is entirely possible for this value to change between call and
|
||||
* executing a notification dispatch
|
||||
* @result Returns YES if Growl isn't reachable and the developer has not opted-out of
|
||||
* Mist and the user hasn't set the global mist enable key to false.
|
||||
*/
|
||||
+ (BOOL)isMistEnabled;
|
||||
|
||||
/*!
|
||||
* @method setShouldUseBuiltInNotifications
|
||||
* @abstract opt-out mechanism for the mist notification style in the event growl can't be reached.
|
||||
* @discussion if growl is unavailable due to not being installed or as a result of being turned off then
|
||||
* this option can enable/disable a built-in fire and forget display style
|
||||
* @param should Specifies whether or not the developer wants to opt-in (default) or opt out
|
||||
* of the built-in Mist style in the event Growl is unreachable.
|
||||
*/
|
||||
+ (void)setShouldUseBuiltInNotifications:(BOOL)should;
|
||||
|
||||
/*!
|
||||
* @method shouldUseBuiltInNotifications
|
||||
* @abstract returns the current opt-in state of the framework's use of the Mist display style.
|
||||
* @result Returns NO if the developer opt-ed out of Mist, the default value is YES.
|
||||
*/
|
||||
+ (BOOL)shouldUseBuiltInNotifications;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*!
|
||||
* @method setGrowlDelegate:
|
||||
* @abstract Set the object which will be responsible for providing and receiving Growl information.
|
||||
* @discussion This must be called before using GrowlApplicationBridge.
|
||||
*
|
||||
* The methods in the GrowlApplicationBridgeDelegate protocol are required
|
||||
* and return the basic information needed to register with Growl.
|
||||
*
|
||||
* The methods in the GrowlApplicationBridgeDelegate_InformalProtocol
|
||||
* informal protocol are individually optional. They provide a greater
|
||||
* degree of interaction between the application and growl such as informing
|
||||
* the application when one of its Growl notifications is clicked by the user.
|
||||
*
|
||||
* The methods in the GrowlApplicationBridgeDelegate_Installation_InformalProtocol
|
||||
* informal protocol are individually optional and are only applicable when
|
||||
* using the Growl-WithInstaller.framework which allows for automated Growl
|
||||
* installation.
|
||||
*
|
||||
* When this method is called, data will be collected from inDelegate, Growl
|
||||
* will be launched if it is not already running, and the application will be
|
||||
* registered with Growl.
|
||||
*
|
||||
* If using the Growl-WithInstaller framework, if Growl is already installed
|
||||
* but this copy of the framework has an updated version of Growl, the user
|
||||
* will be prompted to update automatically.
|
||||
*
|
||||
* @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol.
|
||||
*/
|
||||
+ (void) setGrowlDelegate:(id<GrowlApplicationBridgeDelegate>)inDelegate;
|
||||
|
||||
/*!
|
||||
* @method growlDelegate
|
||||
* @abstract Return the object responsible for providing and receiving Growl information.
|
||||
* @discussion See setGrowlDelegate: for details.
|
||||
* @result The Growl delegate.
|
||||
*/
|
||||
+ (id<GrowlApplicationBridgeDelegate>) growlDelegate;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*!
|
||||
* @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:
|
||||
* @abstract Send a Growl notification.
|
||||
* @discussion This is the preferred means for sending a Growl notification.
|
||||
* The notification name and at least one of the title and description are
|
||||
* required (all three are preferred). All other parameters may be
|
||||
* <code>nil</code> (or 0 or NO as appropriate) to accept default values.
|
||||
*
|
||||
* If using the Growl-WithInstaller framework, if Growl is not installed the
|
||||
* user will be prompted to install Growl. If the user cancels, this method
|
||||
* will have no effect until the next application session, at which time when
|
||||
* it is called the user will be prompted again. The user is also given the
|
||||
* option to not be prompted again. If the user does choose to install Growl,
|
||||
* the requested notification will be displayed once Growl is installed and
|
||||
* running.
|
||||
*
|
||||
* @param title The title of the notification displayed to the user.
|
||||
* @param description The full description of the notification displayed to the user.
|
||||
* @param notifName The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane.
|
||||
* @param iconData <code>NSData</code> object to show with the notification as its icon. If <code>nil</code>, the application's icon will be used instead.
|
||||
* @param priority The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority.
|
||||
* @param isSticky If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications.
|
||||
* @param clickContext A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of <code>NSString</code>, <code>NSArray</code>, <code>NSNumber</code>, <code>NSDictionary</code>, and <code>NSData</code> types).
|
||||
*/
|
||||
+ (void) notifyWithTitle:(NSString *)title
|
||||
description:(NSString *)description
|
||||
notificationName:(NSString *)notifName
|
||||
iconData:(NSData *)iconData
|
||||
priority:(signed int)priority
|
||||
isSticky:(BOOL)isSticky
|
||||
clickContext:(id)clickContext;
|
||||
|
||||
/*!
|
||||
* @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier:
|
||||
* @abstract Send a Growl notification.
|
||||
* @discussion This is the preferred means for sending a Growl notification.
|
||||
* The notification name and at least one of the title and description are
|
||||
* required (all three are preferred). All other parameters may be
|
||||
* <code>nil</code> (or 0 or NO as appropriate) to accept default values.
|
||||
*
|
||||
* If using the Growl-WithInstaller framework, if Growl is not installed the
|
||||
* user will be prompted to install Growl. If the user cancels, this method
|
||||
* will have no effect until the next application session, at which time when
|
||||
* it is called the user will be prompted again. The user is also given the
|
||||
* option to not be prompted again. If the user does choose to install Growl,
|
||||
* the requested notification will be displayed once Growl is installed and
|
||||
* running.
|
||||
*
|
||||
* @param title The title of the notification displayed to the user.
|
||||
* @param description The full description of the notification displayed to the user.
|
||||
* @param notifName The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane.
|
||||
* @param iconData <code>NSData</code> object to show with the notification as its icon. If <code>nil</code>, the application's icon will be used instead.
|
||||
* @param priority The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority.
|
||||
* @param isSticky If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications.
|
||||
* @param clickContext A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of <code>NSString</code>, <code>NSArray</code>, <code>NSNumber</code>, <code>NSDictionary</code>, and <code>NSData</code> types).
|
||||
* @param identifier An identifier for this notification. Notifications with equal identifiers are coalesced.
|
||||
*/
|
||||
+ (void) notifyWithTitle:(NSString *)title
|
||||
description:(NSString *)description
|
||||
notificationName:(NSString *)notifName
|
||||
iconData:(NSData *)iconData
|
||||
priority:(signed int)priority
|
||||
isSticky:(BOOL)isSticky
|
||||
clickContext:(id)clickContext
|
||||
identifier:(NSString *)identifier;
|
||||
|
||||
/*! @method notifyWithDictionary:
|
||||
* @abstract Notifies using a userInfo dictionary suitable for passing to
|
||||
* <code>NSDistributedNotificationCenter</code>.
|
||||
* @param userInfo The dictionary to notify with.
|
||||
* @discussion Before Growl 0.6, your application would have posted
|
||||
* notifications using <code>NSDistributedNotificationCenter</code> by
|
||||
* creating a userInfo dictionary with the notification data. This had the
|
||||
* advantage of allowing you to add other data to the dictionary for programs
|
||||
* besides Growl that might be listening.
|
||||
*
|
||||
* This method allows you to use such dictionaries without being restricted
|
||||
* to using <code>NSDistributedNotificationCenter</code>. The keys for this dictionary
|
||||
* can be found in GrowlDefines.h.
|
||||
*/
|
||||
+ (void) notifyWithDictionary:(NSDictionary *)userInfo;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*! @method registerWithDictionary:
|
||||
* @abstract Register your application with Growl without setting a delegate.
|
||||
* @discussion When you call this method with a dictionary,
|
||||
* GrowlApplicationBridge registers your application using that dictionary.
|
||||
* If you pass <code>nil</code>, GrowlApplicationBridge will ask the delegate
|
||||
* (if there is one) for a dictionary, and if that doesn't work, it will look
|
||||
* in your application's bundle for an auto-discoverable plist.
|
||||
* (XXX refer to more information on that)
|
||||
*
|
||||
* If you pass a dictionary to this method, it must include the
|
||||
* <code>GROWL_APP_NAME</code> key, unless a delegate is set.
|
||||
*
|
||||
* This method is mainly an alternative to the delegate system introduced
|
||||
* with Growl 0.6. Without a delegate, you cannot receive callbacks such as
|
||||
* <code>-growlIsReady</code> (since they are sent to the delegate). You can,
|
||||
* however, set a delegate after registering without one.
|
||||
*
|
||||
* This method was introduced in Growl.framework 0.7.
|
||||
*/
|
||||
+ (BOOL) registerWithDictionary:(NSDictionary *)regDict;
|
||||
|
||||
/*! @method reregisterGrowlNotifications
|
||||
* @abstract Reregister the notifications for this application.
|
||||
* @discussion This method does not normally need to be called. If your
|
||||
* application changes what notifications it is registering with Growl, call
|
||||
* this method to have the Growl delegate's
|
||||
* <code>-registrationDictionaryForGrowl</code> method called again and the
|
||||
* Growl registration information updated.
|
||||
*
|
||||
* This method is now implemented using <code>-registerWithDictionary:</code>.
|
||||
*/
|
||||
+ (void) reregisterGrowlNotifications;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*! @method setWillRegisterWhenGrowlIsReady:
|
||||
* @abstract Tells GrowlApplicationBridge to register with Growl when Growl
|
||||
* launches (or not).
|
||||
* @discussion When Growl has started listening for notifications, it posts a
|
||||
* <code>GROWL_IS_READY</code> notification on the Distributed Notification
|
||||
* Center. GrowlApplicationBridge listens for this notification, using it to
|
||||
* perform various tasks (such as calling your delegate's
|
||||
* <code>-growlIsReady</code> method, if it has one). If this method is
|
||||
* called with <code>YES</code>, one of those tasks will be to reregister
|
||||
* with Growl (in the manner of <code>-reregisterGrowlNotifications</code>).
|
||||
*
|
||||
* This attribute is automatically set back to <code>NO</code> (the default)
|
||||
* after every <code>GROWL_IS_READY</code> notification.
|
||||
* @param flag <code>YES</code> if you want GrowlApplicationBridge to register with
|
||||
* Growl when next it is ready; <code>NO</code> if not.
|
||||
*/
|
||||
+ (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag;
|
||||
|
||||
/*! @method willRegisterWhenGrowlIsReady
|
||||
* @abstract Reports whether GrowlApplicationBridge will register with Growl
|
||||
* when Growl next launches.
|
||||
* @result <code>YES</code> if GrowlApplicationBridge will register with Growl
|
||||
* when next it posts GROWL_IS_READY; <code>NO</code> if not.
|
||||
*/
|
||||
+ (BOOL) willRegisterWhenGrowlIsReady;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*! @method registrationDictionaryFromDelegate
|
||||
* @abstract Asks the delegate for a registration dictionary.
|
||||
* @discussion If no delegate is set, or if the delegate's
|
||||
* <code>-registrationDictionaryForGrowl</code> method returns
|
||||
* <code>nil</code>, this method returns <code>nil</code>.
|
||||
*
|
||||
* This method does not attempt to clean up the dictionary in any way - for
|
||||
* example, if it is missing the <code>GROWL_APP_NAME</code> key, the result
|
||||
* will be missing it too. Use <code>+[GrowlApplicationBridge
|
||||
* registrationDictionaryByFillingInDictionary:]</code> or
|
||||
* <code>+[GrowlApplicationBridge
|
||||
* registrationDictionaryByFillingInDictionary:restrictToKeys:]</code> to try
|
||||
* to fill in missing keys.
|
||||
*
|
||||
* This method was introduced in Growl.framework 0.7.
|
||||
* @result A registration dictionary.
|
||||
*/
|
||||
+ (NSDictionary *) registrationDictionaryFromDelegate;
|
||||
|
||||
/*! @method registrationDictionaryFromBundle:
|
||||
* @abstract Looks in a bundle for a registration dictionary.
|
||||
* @discussion This method looks in a bundle for an auto-discoverable
|
||||
* registration dictionary file using <code>-[NSBundle
|
||||
* pathForResource:ofType:]</code>. If it finds one, it loads the file using
|
||||
* <code>+[NSDictionary dictionaryWithContentsOfFile:]</code> and returns the
|
||||
* result.
|
||||
*
|
||||
* If you pass <code>nil</code> as the bundle, the main bundle is examined.
|
||||
*
|
||||
* This method does not attempt to clean up the dictionary in any way - for
|
||||
* example, if it is missing the <code>GROWL_APP_NAME</code> key, the result
|
||||
* will be missing it too. Use <code>+[GrowlApplicationBridge
|
||||
* registrationDictionaryByFillingInDictionary:]</code> or
|
||||
* <code>+[GrowlApplicationBridge
|
||||
* registrationDictionaryByFillingInDictionary:restrictToKeys:]</code> to try
|
||||
* to fill in missing keys.
|
||||
*
|
||||
* This method was introduced in Growl.framework 0.7.
|
||||
* @result A registration dictionary.
|
||||
*/
|
||||
+ (NSDictionary *) registrationDictionaryFromBundle:(NSBundle *)bundle;
|
||||
|
||||
/*! @method bestRegistrationDictionary
|
||||
* @abstract Obtains a registration dictionary, filled out to the best of
|
||||
* GrowlApplicationBridge's knowledge.
|
||||
* @discussion This method creates a registration dictionary as best
|
||||
* GrowlApplicationBridge knows how.
|
||||
*
|
||||
* First, GrowlApplicationBridge contacts the Growl delegate (if there is
|
||||
* one) and gets the registration dictionary from that. If no such dictionary
|
||||
* was obtained, GrowlApplicationBridge looks in your application's main
|
||||
* bundle for an auto-discoverable registration dictionary file. If that
|
||||
* doesn't exist either, this method returns <code>nil</code>.
|
||||
*
|
||||
* Second, GrowlApplicationBridge calls
|
||||
* <code>+registrationDictionaryByFillingInDictionary:</code> with whatever
|
||||
* dictionary was obtained. The result of that method is the result of this
|
||||
* method.
|
||||
*
|
||||
* GrowlApplicationBridge uses this method when you call
|
||||
* <code>+setGrowlDelegate:</code>, or when you call
|
||||
* <code>+registerWithDictionary:</code> with <code>nil</code>.
|
||||
*
|
||||
* This method was introduced in Growl.framework 0.7.
|
||||
* @result A registration dictionary.
|
||||
*/
|
||||
+ (NSDictionary *) bestRegistrationDictionary;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*! @method registrationDictionaryByFillingInDictionary:
|
||||
* @abstract Tries to fill in missing keys in a registration dictionary.
|
||||
* @discussion This method examines the passed-in dictionary for missing keys,
|
||||
* and tries to work out correct values for them. As of 0.7, it uses:
|
||||
*
|
||||
* Key Value
|
||||
* --- -----
|
||||
* <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code>
|
||||
* <code>GROWL_APP_ICON_DATA</code> The data of the icon of the application.
|
||||
* <code>GROWL_APP_LOCATION</code> The location of the application.
|
||||
* <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code>
|
||||
*
|
||||
* Keys are only filled in if missing; if a key is present in the dictionary,
|
||||
* its value will not be changed.
|
||||
*
|
||||
* This method was introduced in Growl.framework 0.7.
|
||||
* @param regDict The dictionary to fill in.
|
||||
* @result The dictionary with the keys filled in. This is an autoreleased
|
||||
* copy of <code>regDict</code>.
|
||||
*/
|
||||
+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
|
||||
|
||||
/*! @method registrationDictionaryByFillingInDictionary:restrictToKeys:
|
||||
* @abstract Tries to fill in missing keys in a registration dictionary.
|
||||
* @discussion This method examines the passed-in dictionary for missing keys,
|
||||
* and tries to work out correct values for them. As of 0.7, it uses:
|
||||
*
|
||||
* Key Value
|
||||
* --- -----
|
||||
* <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code>
|
||||
* <code>GROWL_APP_ICON_DATA</code> The data of the icon of the application.
|
||||
* <code>GROWL_APP_LOCATION</code> The location of the application.
|
||||
* <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code>
|
||||
*
|
||||
* Only those keys that are listed in <code>keys</code> will be filled in.
|
||||
* Other missing keys are ignored. Also, keys are only filled in if missing;
|
||||
* if a key is present in the dictionary, its value will not be changed.
|
||||
*
|
||||
* This method was introduced in Growl.framework 0.7.
|
||||
* @param regDict The dictionary to fill in.
|
||||
* @param keys The keys to fill in. If <code>nil</code>, any missing keys are filled in.
|
||||
* @result The dictionary with the keys filled in. This is an autoreleased
|
||||
* copy of <code>regDict</code>.
|
||||
*/
|
||||
+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys;
|
||||
|
||||
/*! @brief Tries to fill in missing keys in a notification dictionary.
|
||||
* @param notifDict The dictionary to fill in.
|
||||
* @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict.
|
||||
* @discussion This function examines the \a notifDict for missing keys, and
|
||||
* tries to get them from the last known registration dictionary. As of 1.1,
|
||||
* the keys that it will look for are:
|
||||
*
|
||||
* \li <code>GROWL_APP_NAME</code>
|
||||
* \li <code>GROWL_APP_ICON_DATA</code>
|
||||
*
|
||||
* @since Growl.framework 1.1
|
||||
*/
|
||||
+ (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
|
||||
|
||||
+ (NSDictionary *) frameworkInfoDictionary;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*!
|
||||
*@method growlURLSchemeAvailable
|
||||
*@abstract Lets the app know whether growl:// is registered on the system, used for certain methods below this
|
||||
*@return Returns whether growl:// is registered on the system
|
||||
*@discussion Methods such as openGrowlPreferences rely on the growl:// URL scheme to function
|
||||
* Further, this method can provide a check on whether Growl is installed,
|
||||
* however, the framework will not be relying on this method for choosing when/how to notify,
|
||||
* and it is not recommended that the app rely on it for other than whether to use growl:// methods
|
||||
*@since Growl.framework 1.4
|
||||
*/
|
||||
+ (BOOL) isGrowlURLSchemeAvailable;
|
||||
|
||||
/*!
|
||||
* @method openGrowlPreferences:
|
||||
* @abstract Open Growl preferences, optionally to this app's settings, growl:// method
|
||||
* @param showApp Whether to show the application's settings, otherwise just opens to the last position
|
||||
* @return Return's whether opening the URL was succesfull or not.
|
||||
* @discussion Will launch if Growl is installed, but not running, and open the preferences window
|
||||
* Uses growl:// URL scheme
|
||||
* @since Growl.framework 1.4
|
||||
*/
|
||||
+ (BOOL) openGrowlPreferences:(BOOL)showApp;
|
||||
|
||||
@end
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
#pragma mark -
|
||||
|
||||
/*!
|
||||
* @protocol GrowlApplicationBridgeDelegate
|
||||
* @abstract Required protocol for the Growl delegate.
|
||||
* @discussion The methods in this protocol are optional and are called
|
||||
* automatically as needed by GrowlApplicationBridge. See
|
||||
* <code>+[GrowlApplicationBridge setGrowlDelegate:]</code>.
|
||||
* See also <code>GrowlApplicationBridgeDelegate_InformalProtocol</code>.
|
||||
*/
|
||||
|
||||
@protocol GrowlApplicationBridgeDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/*!
|
||||
* @method registrationDictionaryForGrowl
|
||||
* @abstract Return the dictionary used to register this application with Growl.
|
||||
* @discussion The returned dictionary gives Growl the complete list of
|
||||
* notifications this application will ever send, and it also specifies which
|
||||
* notifications should be enabled by default. Each is specified by an array
|
||||
* of <code>NSString</code> objects.
|
||||
*
|
||||
* For most applications, these two arrays can be the same (if all sent
|
||||
* notifications should be displayed by default).
|
||||
*
|
||||
* The <code>NSString</code> objects of these arrays will correspond to the
|
||||
* <code>notificationName:</code> parameter passed in
|
||||
* <code>+[GrowlApplicationBridge
|
||||
* notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:]</code> calls.
|
||||
*
|
||||
* The dictionary should have the required key object pairs:
|
||||
* key: GROWL_NOTIFICATIONS_ALL object: <code>NSArray</code> of <code>NSString</code> objects
|
||||
* key: GROWL_NOTIFICATIONS_DEFAULT object: <code>NSArray</code> of <code>NSString</code> objects
|
||||
*
|
||||
* The dictionary may have the following key object pairs:
|
||||
* key: GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES object: <code>NSDictionary</code> of key: notification name object: human-readable notification name
|
||||
*
|
||||
* You do not need to implement this method if you have an auto-discoverable
|
||||
* plist file in your app bundle. (XXX refer to more information on that)
|
||||
*
|
||||
* @result The <code>NSDictionary</code> to use for registration.
|
||||
*/
|
||||
- (NSDictionary *) registrationDictionaryForGrowl;
|
||||
|
||||
/*!
|
||||
* @method applicationNameForGrowl
|
||||
* @abstract Return the name of this application which will be used for Growl bookkeeping.
|
||||
* @discussion This name is used both internally and in the Growl preferences.
|
||||
*
|
||||
* This should remain stable between different versions and incarnations of
|
||||
* your application.
|
||||
* For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and
|
||||
* "SurfWriter Lite" are not.
|
||||
*
|
||||
* You do not need to implement this method if you are providing the
|
||||
* application name elsewhere, meaning in an auto-discoverable plist file in
|
||||
* your app bundle (XXX refer to more information on that) or in the result
|
||||
* of -registrationDictionaryForGrowl.
|
||||
*
|
||||
* @result The name of the application using Growl.
|
||||
*/
|
||||
- (NSString *) applicationNameForGrowl;
|
||||
|
||||
/*!
|
||||
* @method applicationIconForGrowl
|
||||
* @abstract Return the <code>NSImage</code> to treat as the application icon.
|
||||
* @discussion The delegate may optionally return an <code>NSImage</code>
|
||||
* object to use as the application icon. If this method is not implemented,
|
||||
* {{{-applicationIconDataForGrowl}}} is tried. If that method is not
|
||||
* implemented, the application's own icon is used. Neither method is
|
||||
* generally needed.
|
||||
* @result The <code>NSImage</code> to treat as the application icon.
|
||||
*/
|
||||
- (NSImage *) applicationIconForGrowl;
|
||||
|
||||
/*!
|
||||
* @method applicationIconDataForGrowl
|
||||
* @abstract Return the <code>NSData</code> to treat as the application icon.
|
||||
* @discussion The delegate may optionally return an <code>NSData</code>
|
||||
* object to use as the application icon; if this is not implemented, the
|
||||
* application's own icon is used. This is not generally needed.
|
||||
* @result The <code>NSData</code> to treat as the application icon.
|
||||
* @deprecated In version 1.1, in favor of {{{-applicationIconForGrowl}}}.
|
||||
*/
|
||||
- (NSData *) applicationIconDataForGrowl;
|
||||
|
||||
/*!
|
||||
* @method growlIsReady
|
||||
* @abstract Informs the delegate that Growl has launched.
|
||||
* @discussion Informs the delegate that Growl (specifically, the
|
||||
* GrowlHelperApp) was launched successfully. The application can take actions
|
||||
* with the knowledge that Growl is installed and functional.
|
||||
*/
|
||||
- (void) growlIsReady;
|
||||
|
||||
/*!
|
||||
* @method growlNotificationWasClicked:
|
||||
* @abstract Informs the delegate that a Growl notification was clicked.
|
||||
* @discussion Informs the delegate that a Growl notification was clicked. It
|
||||
* is only sent for notifications sent with a non-<code>nil</code>
|
||||
* clickContext, so if you want to receive a message when a notification is
|
||||
* clicked, clickContext must not be <code>nil</code> when calling
|
||||
* <code>+[GrowlApplicationBridge notifyWithTitle: description:notificationName:iconData:priority:isSticky:clickContext:]</code>.
|
||||
* @param clickContext The clickContext passed when displaying the notification originally via +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:].
|
||||
*/
|
||||
- (void) growlNotificationWasClicked:(id)clickContext;
|
||||
|
||||
/*!
|
||||
* @method growlNotificationTimedOut:
|
||||
* @abstract Informs the delegate that a Growl notification timed out.
|
||||
* @discussion Informs the delegate that a Growl notification timed out. It
|
||||
* is only sent for notifications sent with a non-<code>nil</code>
|
||||
* clickContext, so if you want to receive a message when a notification is
|
||||
* clicked, clickContext must not be <code>nil</code> when calling
|
||||
* <code>+[GrowlApplicationBridge notifyWithTitle: description:notificationName:iconData:priority:isSticky:clickContext:]</code>.
|
||||
* @param clickContext The clickContext passed when displaying the notification originally via +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:].
|
||||
*/
|
||||
- (void) growlNotificationTimedOut:(id)clickContext;
|
||||
|
||||
|
||||
/*!
|
||||
* @method hasNetworkClientEntitlement
|
||||
* @abstract Used only in sandboxed situations since we don't know whether the app has com.apple.security.network.client entitlement
|
||||
* @discussion GrowlDelegate calls to find out if we have the com.apple.security.network.client entitlement,
|
||||
* since we can't find this out without hitting the sandbox. We only call it if we detect that the application is sandboxed.
|
||||
*/
|
||||
- (BOOL) hasNetworkClientEntitlement;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
#endif /* __GrowlApplicationBridge_h__ */
|
||||
@@ -1,386 +0,0 @@
|
||||
//
|
||||
// GrowlDefines.h
|
||||
//
|
||||
|
||||
#ifndef _GROWLDEFINES_H
|
||||
#define _GROWLDEFINES_H
|
||||
|
||||
#ifdef __OBJC__
|
||||
#define XSTR(x) (@x)
|
||||
#else
|
||||
#define XSTR CFSTR
|
||||
#endif
|
||||
|
||||
/*! @header GrowlDefines.h
|
||||
* @abstract Defines all the notification keys.
|
||||
* @discussion Defines all the keys used for registration with Growl and for
|
||||
* Growl notifications.
|
||||
*
|
||||
* Most applications should use the functions or methods of Growl.framework
|
||||
* instead of posting notifications such as those described here.
|
||||
* @updated 2004-01-25
|
||||
*/
|
||||
|
||||
// UserInfo Keys for Registration
|
||||
#pragma mark UserInfo Keys for Registration
|
||||
|
||||
/*! @group Registration userInfo keys */
|
||||
/* @abstract Keys for the userInfo dictionary of a GROWL_APP_REGISTRATION distributed notification.
|
||||
* @discussion The values of these keys describe the application and the
|
||||
* notifications it may post.
|
||||
*
|
||||
* Your application must register with Growl before it can post Growl
|
||||
* notifications (and have them not be ignored). However, as of Growl 0.6,
|
||||
* posting GROWL_APP_REGISTRATION notifications directly is no longer the
|
||||
* preferred way to register your application. Your application should instead
|
||||
* use Growl.framework's delegate system.
|
||||
* See +[GrowlApplicationBridge setGrowlDelegate:] or Growl_SetDelegate for
|
||||
* more information.
|
||||
*/
|
||||
|
||||
/*! @defined GROWL_APP_NAME
|
||||
* @abstract The name of your application.
|
||||
* @discussion The name of your application. This should remain stable between
|
||||
* different versions and incarnations of your application.
|
||||
* For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and
|
||||
* "SurfWriter Lite" are not.
|
||||
*/
|
||||
#define GROWL_APP_NAME XSTR("ApplicationName")
|
||||
/*! @defined GROWL_APP_ID
|
||||
* @abstract The bundle identifier of your application.
|
||||
* @discussion The bundle identifier of your application. This key should
|
||||
* be unique for your application while there may be several applications
|
||||
* with the same GROWL_APP_NAME.
|
||||
* This key is optional.
|
||||
*/
|
||||
#define GROWL_APP_ID XSTR("ApplicationId")
|
||||
/*! @defined GROWL_APP_ICON_DATA
|
||||
* @abstract The image data for your application's icon.
|
||||
* @discussion Image data representing your application's icon. This may be
|
||||
* superimposed on a notification icon as a badge, used as the notification
|
||||
* icon when a notification-specific icon is not supplied, or ignored
|
||||
* altogether, depending on the display. Must be in a format supported by
|
||||
* NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_APP_ICON_DATA XSTR("ApplicationIcon")
|
||||
/*! @defined GROWL_NOTIFICATIONS_DEFAULT
|
||||
* @abstract The array of notifications to turn on by default.
|
||||
* @discussion These are the names of the notifications that should be enabled
|
||||
* by default when your application registers for the first time. If your
|
||||
* application reregisters, Growl will look here for any new notification
|
||||
* names found in GROWL_NOTIFICATIONS_ALL, but ignore any others.
|
||||
*/
|
||||
#define GROWL_NOTIFICATIONS_DEFAULT XSTR("DefaultNotifications")
|
||||
/*! @defined GROWL_NOTIFICATIONS_ALL
|
||||
* @abstract The array of all notifications your application can send.
|
||||
* @discussion These are the names of all of the notifications that your
|
||||
* application may post. See GROWL_NOTIFICATION_NAME for a discussion of good
|
||||
* notification names.
|
||||
*/
|
||||
#define GROWL_NOTIFICATIONS_ALL XSTR("AllNotifications")
|
||||
/*! @defined GROWL_NOTIFICATIONS_HUMAN_READABLE_DESCRIPTIONS
|
||||
* @abstract A dictionary of human-readable names for your notifications.
|
||||
* @discussion By default, the Growl UI will display notifications by the names given in GROWL_NOTIFICATIONS_ALL
|
||||
* which correspond to the GROWL_NOTIFICATION_NAME. This dictionary specifies the human-readable name to display.
|
||||
* The keys of the dictionary are GROWL_NOTIFICATION_NAME strings; the objects are the human-readable versions.
|
||||
* For any GROWL_NOTIFICATION_NAME not specific in this dictionary, the GROWL_NOTIFICATION_NAME will be displayed.
|
||||
*
|
||||
* This key is optional.
|
||||
*/
|
||||
#define GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES XSTR("HumanReadableNames")
|
||||
/*! @defined GROWL_NOTIFICATIONS_DESCRIPTIONS
|
||||
* @abstract A dictionary of descriptions of _when_ each notification occurs
|
||||
* @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are
|
||||
* descriptions of _when_ each notification occurs, such as "You received a new mail message" or
|
||||
* "A file finished downloading".
|
||||
*
|
||||
* This key is optional.
|
||||
*/
|
||||
#define GROWL_NOTIFICATIONS_DESCRIPTIONS XSTR("NotificationDescriptions")
|
||||
/*! @defined GROWL_NOTIFICATIONS_ICONS
|
||||
* @abstract A dictionary of icons for each notification
|
||||
* @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are
|
||||
* icons for each notification, for GNTP spec
|
||||
*
|
||||
* This key is optional.
|
||||
*/
|
||||
#define GROWL_NOTIFICATIONS_ICONS XSTR("NotificationIcons")
|
||||
|
||||
/*! @defined GROWL_TICKET_VERSION
|
||||
* @abstract The version of your registration ticket.
|
||||
* @discussion Include this key in a ticket plist file that you put in your
|
||||
* application bundle for auto-discovery. The current ticket version is 1.
|
||||
*/
|
||||
#define GROWL_TICKET_VERSION XSTR("TicketVersion")
|
||||
// UserInfo Keys for Notifications
|
||||
#pragma mark UserInfo Keys for Notifications
|
||||
|
||||
/*! @group Notification userInfo keys */
|
||||
/* @abstract Keys for the userInfo dictionary of a GROWL_NOTIFICATION distributed notification.
|
||||
* @discussion The values of these keys describe the content of a Growl
|
||||
* notification.
|
||||
*
|
||||
* Not all of these keys are supported by all displays. Only the name, title,
|
||||
* and description of a notification are universal. Most of the built-in
|
||||
* displays do support all of these keys, and most other visual displays
|
||||
* probably will also. But, as of 0.6, the Log, MailMe, and Speech displays
|
||||
* support only textual data.
|
||||
*/
|
||||
|
||||
/*! @defined GROWL_NOTIFICATION_NAME
|
||||
* @abstract The name of the notification.
|
||||
* @discussion The name of the notification. Note that if you do not define
|
||||
* GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES when registering your ticket originally this name
|
||||
* will the one displayed within the Growl preference pane and should be human-readable.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_NAME XSTR("NotificationName")
|
||||
/*! @defined GROWL_NOTIFICATION_TITLE
|
||||
* @abstract The title to display in the notification.
|
||||
* @discussion The title of the notification. Should be very brief.
|
||||
* The title usually says what happened, e.g. "Download complete".
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_TITLE XSTR("NotificationTitle")
|
||||
/*! @defined GROWL_NOTIFICATION_DESCRIPTION
|
||||
* @abstract The description to display in the notification.
|
||||
* @discussion The description should be longer and more verbose than the title.
|
||||
* The description usually tells the subject of the action,
|
||||
* e.g. "Growl-0.6.dmg downloaded in 5.02 minutes".
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_DESCRIPTION XSTR("NotificationDescription")
|
||||
/*! @defined GROWL_NOTIFICATION_ICON
|
||||
* @discussion Image data for the notification icon. Image data must be in a format
|
||||
* supported by NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_ICON_DATA XSTR("NotificationIcon")
|
||||
/*! @defined GROWL_NOTIFICATION_APP_ICON
|
||||
* @discussion Image data for the application icon, in case GROWL_APP_ICON does
|
||||
* not apply for some reason. Image data be in a format supported by NSImage, such
|
||||
* as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_APP_ICON_DATA XSTR("NotificationAppIcon")
|
||||
/*! @defined GROWL_NOTIFICATION_PRIORITY
|
||||
* @discussion The priority of the notification as an integer number from
|
||||
* -2 to +2 (+2 being highest).
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_PRIORITY XSTR("NotificationPriority")
|
||||
/*! @defined GROWL_NOTIFICATION_STICKY
|
||||
* @discussion A Boolean number controlling whether the notification is sticky.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_STICKY XSTR("NotificationSticky")
|
||||
/*! @defined GROWL_NOTIFICATION_CLICK_CONTEXT
|
||||
* @abstract Identifies which notification was clicked.
|
||||
* @discussion An identifier for the notification for clicking purposes.
|
||||
*
|
||||
* This will be passed back to the application when the notification is
|
||||
* clicked. It must be plist-encodable (a data, dictionary, array, number, or
|
||||
* string object), and it should be unique for each notification you post.
|
||||
* A good click context would be a UUID string returned by NSProcessInfo or
|
||||
* CFUUID.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_CLICK_CONTEXT XSTR("NotificationClickContext")
|
||||
|
||||
/*! @defined GROWL_NOTIFICATION_IDENTIFIER
|
||||
* @abstract An identifier for the notification for coalescing purposes.
|
||||
* Notifications with the same identifier fall into the same class; only
|
||||
* the last notification of a class is displayed on the screen. If a
|
||||
* notification of the same class is currently being displayed, it is
|
||||
* replaced by this notification.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_IDENTIFIER XSTR("GrowlNotificationIdentifier")
|
||||
|
||||
/*! @defined GROWL_APP_PID
|
||||
* @abstract The process identifier of the process which sends this
|
||||
* notification. If this field is set, the application will only receive
|
||||
* clicked and timed out notifications which originate from this process.
|
||||
*
|
||||
* Optional.
|
||||
*/
|
||||
#define GROWL_APP_PID XSTR("ApplicationPID")
|
||||
|
||||
/*! @defined GROWL_NOTIFICATION_PROGRESS
|
||||
* @abstract If this key is set, it should contain a double value wrapped
|
||||
* in a NSNumber which describes some sort of progress (from 0.0 to 100.0).
|
||||
* If this is key is not set, no progress bar is shown.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_PROGRESS XSTR("NotificationProgress")
|
||||
|
||||
/*! @defined GROWL_NOTIFICATION_ALREADY_SHOWN
|
||||
* @abstract If this key is set, it should contain a bool value wrapped
|
||||
* in a NSNumber which describes whether the notification has
|
||||
* already been displayed, for instance by built in Notification
|
||||
* Center support. This value can be used to allow display
|
||||
* plugins to skip a notification, while still allowing Growl
|
||||
* actions to run on them.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_ALREADY_SHOWN XSTR("AlreadyShown")
|
||||
|
||||
|
||||
// Notifications
|
||||
#pragma mark Notifications
|
||||
|
||||
/*! @group Notification names */
|
||||
/* @abstract Names of distributed notifications used by Growl.
|
||||
* @discussion These are notifications used by applications (directly or
|
||||
* indirectly) to interact with Growl, and by Growl for interaction between
|
||||
* its components.
|
||||
*
|
||||
* Most of these should no longer be used in Growl 0.6 and later, in favor of
|
||||
* Growl.framework's GrowlApplicationBridge APIs.
|
||||
*/
|
||||
|
||||
/*! @defined GROWL_APP_REGISTRATION
|
||||
* @abstract The distributed notification for registering your application.
|
||||
* @discussion This is the name of the distributed notification that can be
|
||||
* used to register applications with Growl.
|
||||
*
|
||||
* The userInfo dictionary for this notification can contain these keys:
|
||||
* <ul>
|
||||
* <li>GROWL_APP_NAME</li>
|
||||
* <li>GROWL_APP_ICON_DATA</li>
|
||||
* <li>GROWL_NOTIFICATIONS_ALL</li>
|
||||
* <li>GROWL_NOTIFICATIONS_DEFAULT</li>
|
||||
* </ul>
|
||||
*
|
||||
* No longer recommended as of Growl 0.6. An alternate method of registering
|
||||
* is to use Growl.framework's delegate system.
|
||||
* See +[GrowlApplicationBridge setGrowlDelegate:] or Growl_SetDelegate for
|
||||
* more information.
|
||||
*/
|
||||
#define GROWL_APP_REGISTRATION XSTR("GrowlApplicationRegistrationNotification")
|
||||
/*! @defined GROWL_APP_REGISTRATION_CONF
|
||||
* @abstract The distributed notification for confirming registration.
|
||||
* @discussion The name of the distributed notification sent to confirm the
|
||||
* registration. Used by the Growl preference pane. Your application probably
|
||||
* does not need to use this notification.
|
||||
*/
|
||||
#define GROWL_APP_REGISTRATION_CONF XSTR("GrowlApplicationRegistrationConfirmationNotification")
|
||||
/*! @defined GROWL_NOTIFICATION
|
||||
* @abstract The distributed notification for Growl notifications.
|
||||
* @discussion This is what it all comes down to. This is the name of the
|
||||
* distributed notification that your application posts to actually send a
|
||||
* Growl notification.
|
||||
*
|
||||
* The userInfo dictionary for this notification can contain these keys:
|
||||
* <ul>
|
||||
* <li>GROWL_NOTIFICATION_NAME (required)</li>
|
||||
* <li>GROWL_NOTIFICATION_TITLE (required)</li>
|
||||
* <li>GROWL_NOTIFICATION_DESCRIPTION (required)</li>
|
||||
* <li>GROWL_NOTIFICATION_ICON</li>
|
||||
* <li>GROWL_NOTIFICATION_APP_ICON</li>
|
||||
* <li>GROWL_NOTIFICATION_PRIORITY</li>
|
||||
* <li>GROWL_NOTIFICATION_STICKY</li>
|
||||
* <li>GROWL_NOTIFICATION_CLICK_CONTEXT</li>
|
||||
* <li>GROWL_APP_NAME (required)</li>
|
||||
* </ul>
|
||||
*
|
||||
* No longer recommended as of Growl 0.6. Three alternate methods of posting
|
||||
* notifications are +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:],
|
||||
* Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext, and
|
||||
* Growl_PostNotification.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION XSTR("GrowlNotification")
|
||||
/*! @defined GROWL_PING
|
||||
* @abstract A distributed notification to check whether Growl is running.
|
||||
* @discussion This is used by the Growl preference pane. If it receives a
|
||||
* GROWL_PONG, the preference pane takes this to mean that Growl is running.
|
||||
*/
|
||||
#define GROWL_PING XSTR("Honey, Mind Taking Out The Trash")
|
||||
/*! @defined GROWL_PONG
|
||||
* @abstract The distributed notification sent in reply to GROWL_PING.
|
||||
* @discussion GrowlHelperApp posts this in reply to GROWL_PING.
|
||||
*/
|
||||
#define GROWL_PONG XSTR("What Do You Want From Me, Woman")
|
||||
/*! @defined GROWL_IS_READY
|
||||
* @abstract The distributed notification sent when Growl starts up.
|
||||
* @discussion GrowlHelperApp posts this when it has begin listening on all of
|
||||
* its sources for new notifications. GrowlApplicationBridge (in
|
||||
* Growl.framework), upon receiving this notification, reregisters using the
|
||||
* registration dictionary supplied by its delegate.
|
||||
*/
|
||||
#define GROWL_IS_READY XSTR("Lend Me Some Sugar; I Am Your Neighbor!")
|
||||
|
||||
|
||||
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX
|
||||
* @abstract Part of the name of the distributed notification sent when a supported notification is clicked.
|
||||
* @discussion When a Growl notification with a click context is clicked on by
|
||||
* the user, Growl posts a distributed notification whose name is in the format:
|
||||
* [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX]
|
||||
* The GrowlApplicationBridge responds to this notification by calling a callback in its delegate.
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX XSTR("GrowlClicked!")
|
||||
|
||||
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX
|
||||
* @abstract Part of the name of the distributed notification sent when a supported notification times out without being clicked.
|
||||
* @discussion When a Growl notification with a click context times out, Growl posts a distributed notification
|
||||
* whose name is in the format:
|
||||
* [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX]
|
||||
* The GrowlApplicationBridge responds to this notification by calling a callback in its delegate.
|
||||
* NOTE: The user may have actually clicked the 'close' button; this triggers an *immediate* time-out of the notification.
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX XSTR("GrowlTimedOut!")
|
||||
|
||||
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON
|
||||
* @abstract The distributed notification sent when the Notification Center support is toggled on in Growl 2.0
|
||||
* @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
|
||||
* to inform all running apps that they should now speak to Notification Center directly.
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON XSTR("GrowlNotificationCenterOn!")
|
||||
|
||||
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF
|
||||
* @abstract The distributed notification sent when the Notification Center support is toggled off in Growl 2.0
|
||||
* @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
|
||||
* to inform all running apps that they should no longer speak to Notification Center directly.
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF XSTR("GrowlNotificationCenterOff!")
|
||||
|
||||
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY
|
||||
* @abstract The distributed notification sent by an application to query Growl 2.0's notification center support.
|
||||
* @discussion When an app starts up, it will send this query to get Growl 2.0 to spit out whether notification
|
||||
* center support is on or off.
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY XSTR("GrowlNotificationCenterYN?")
|
||||
|
||||
|
||||
/*! @group Other symbols */
|
||||
/* Symbols which don't fit into any of the other categories. */
|
||||
|
||||
/*! @defined GROWL_KEY_CLICKED_CONTEXT
|
||||
* @abstract Used internally as the key for the clickedContext passed over DNC.
|
||||
* @discussion This key is used in GROWL_NOTIFICATION_CLICKED, and contains the
|
||||
* click context that was supplied in the original notification.
|
||||
*/
|
||||
#define GROWL_KEY_CLICKED_CONTEXT XSTR("ClickedContext")
|
||||
/*! @defined GROWL_REG_DICT_EXTENSION
|
||||
* @abstract The filename extension for registration dictionaries.
|
||||
* @discussion The GrowlApplicationBridge in Growl.framework registers with
|
||||
* Growl by creating a file with the extension of .(GROWL_REG_DICT_EXTENSION)
|
||||
* and opening it in the GrowlHelperApp. This happens whether or not Growl is
|
||||
* running; if it was stopped, it quits immediately without listening for
|
||||
* notifications.
|
||||
*/
|
||||
#define GROWL_REG_DICT_EXTENSION XSTR("growlRegDict")
|
||||
|
||||
|
||||
#define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition"
|
||||
|
||||
#define GROWL_PLUGIN_CONFIG_ID XSTR("GrowlPluginConfigurationID")
|
||||
|
||||
#endif //ndef _GROWLDEFINES_H
|
||||
@@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>12C60</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Growl</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.growl.growlframework</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>GRRR</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.0.1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>4G2008a</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>12C37</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.8</string>
|
||||
<key>DTXcode</key>
|
||||
<string>0452</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>4G2008a</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>GrowlApplicationBridge</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Resources/Info.plist</key>
|
||||
<data>
|
||||
VZb3f8My4te/5JwcjfvotgCXTAs=
|
||||
</data>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^Resources/</key>
|
||||
<true/>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1 +0,0 @@
|
||||
A
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-16.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-16@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-32.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-32@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-128.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-128@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-256.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-256@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-512.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon-512@2x.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 83 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "logo-1.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "logo.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 95 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "open-in-editor-white.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "open-in-editor-white@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "open-in-editor.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "open-in-editor@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "open-in-finder-white.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "open-in-finder-white@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "open-in-finder.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "open-in-finder@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "open-in-terminal-white.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "open-in-terminal-white@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "open-in-terminal.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "open-in-terminal@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "open-in-xcode-white.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "open-in-xcode-white@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "open-in-xcode.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "open-in-xcode@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "resync-white.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "resync-white@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "resync.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "resync@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "run-white.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "run-white@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "run.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "run@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "status-icon-error.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "status-icon-error@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "status-icon-inactive.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "status-icon-inactive@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "status-icon-working.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "status-icon-working@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "stop-white.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "stop-white@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "stop.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "stop@2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -2,39 +2,60 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>XCCLastCappuccinoReleaseURL</key>
|
||||
<string>https://github.com/cappuccino/cappuccino/archive/0.9.8.zip</string>
|
||||
<key>XCCLastCappuccinoMasterBranchURL</key>
|
||||
<string>https://github.com/cappuccino/cappuccino/archive/master.zip</string>
|
||||
<key>NSUserNotificationAlertStyle</key>
|
||||
<string>alert</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<string>en</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>LSItemContentTypes</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>public.folder</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>XcodeCapp.icns</string>
|
||||
<string>Icon.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.cappuccino.xcodecapp</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.2</string>
|
||||
<string>Version 4.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3.2</string>
|
||||
<string>1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.developer-tools</string>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2015 cappuccino-project. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>XCCCompatibilityVersion</key>
|
||||
<real>3</real>
|
||||
<string>4</string>
|
||||
<key>XCCLastCappuccinoMasterBranchURL</key>
|
||||
<string>https://github.com/cappuccino/cappuccino/archive/master.zip</string>
|
||||
<key>XCCLastCappuccinoReleaseURL</key>
|
||||
<string>https://github.com/cappuccino/cappuccino/archive/0.9.8.zip</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -45,7 +45,7 @@ static DDASLLogger *sharedInstance;
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
- (instancetype)init
|
||||
{
|
||||
if (sharedInstance != nil)
|
||||
{
|
||||
|
||||
@@ -487,11 +487,11 @@ NSString *DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy);
|
||||
* If you write custom loggers or formatters, you will be dealing with objects of this class.
|
||||
**/
|
||||
|
||||
enum {
|
||||
typedef NS_OPTIONS(NSUInteger, DDLogMessageOptions)
|
||||
{
|
||||
DDLogMessageCopyFile = 1 << 0,
|
||||
DDLogMessageCopyFunction = 1 << 1,
|
||||
};
|
||||
typedef int DDLogMessageOptions;
|
||||
|
||||
@interface DDLogMessage : NSObject
|
||||
{
|
||||
@@ -534,7 +534,7 @@ typedef int DDLogMessageOptions;
|
||||
* However, if you need them to be copied you may use the options parameter to specify this.
|
||||
* Options is a bitmask which supports DDLogMessageCopyFile and DDLogMessageCopyFunction.
|
||||
**/
|
||||
- (id)initWithLogMsg:(NSString *)logMsg
|
||||
- (instancetype)initWithLogMsg:(NSString *)logMsg
|
||||
level:(int)logLevel
|
||||
flag:(int)logFlag
|
||||
context:(int)logContext
|
||||
@@ -548,18 +548,18 @@ typedef int DDLogMessageOptions;
|
||||
* Returns the threadID as it appears in NSLog.
|
||||
* That is, it is a hexadecimal value which is calculated from the machThreadID.
|
||||
**/
|
||||
- (NSString *)threadID;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *threadID;
|
||||
|
||||
/**
|
||||
* Convenience property to get just the file name, as the file variable is generally the full file path.
|
||||
* This method does not include the file extension, which is generally unwanted for logging purposes.
|
||||
**/
|
||||
- (NSString *)fileName;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *fileName;
|
||||
|
||||
/**
|
||||
* Returns the function variable in NSString form.
|
||||
**/
|
||||
- (NSString *)methodName;
|
||||
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *methodName;
|
||||
|
||||
@end
|
||||
|
||||
@@ -591,7 +591,6 @@ typedef int DDLogMessageOptions;
|
||||
dispatch_queue_t loggerQueue;
|
||||
}
|
||||
|
||||
- (id <DDLogFormatter>)logFormatter;
|
||||
- (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
||||
@property (NS_NONATOMIC_IOSONLY, strong) id<DDLogFormatter> logFormatter;
|
||||
|
||||
@end
|
||||
|
||||
@@ -786,7 +786,7 @@ NSString *DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy)
|
||||
|
||||
@implementation DDLoggerNode
|
||||
|
||||
- (id)initWithLogger:(id <DDLogger>)aLogger loggerQueue:(dispatch_queue_t)aLoggerQueue
|
||||
- (instancetype)initWithLogger:(id <DDLogger>)aLogger loggerQueue:(dispatch_queue_t)aLoggerQueue
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
@@ -834,7 +834,7 @@ static char *dd_str_copy(const char *str)
|
||||
return result;
|
||||
}
|
||||
|
||||
- (id)initWithLogMsg:(NSString *)msg
|
||||
- (instancetype)initWithLogMsg:(NSString *)msg
|
||||
level:(int)level
|
||||
flag:(int)flag
|
||||
context:(int)context
|
||||
@@ -890,7 +890,7 @@ static char *dd_str_copy(const char *str)
|
||||
if (function == NULL)
|
||||
return nil;
|
||||
else
|
||||
return [[NSString alloc] initWithUTF8String:function];
|
||||
return @(function);
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
@@ -913,7 +913,7 @@ static char *dd_str_copy(const char *str)
|
||||
|
||||
@implementation DDAbstractLogger
|
||||
|
||||
- (id)init
|
||||
- (instancetype)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
size_t resetCodeLen;
|
||||
}
|
||||
|
||||
- (id)initWithForegroundColor:(OSColor *)fgColor backgroundColor:(OSColor *)bgColor flag:(int)mask context:(int)ctxt;
|
||||
- (instancetype)initWithForegroundColor:(OSColor *)fgColor backgroundColor:(OSColor *)bgColor flag:(int)mask context:(int)ctxt NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
@@ -813,7 +813,7 @@ static DDTTYLogger *sharedInstance;
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
- (instancetype)init
|
||||
{
|
||||
if (sharedInstance != nil)
|
||||
{
|
||||
@@ -827,12 +827,12 @@ static DDTTYLogger *sharedInstance;
|
||||
calendar = [NSCalendar autoupdatingCurrentCalendar];
|
||||
|
||||
calendarUnitFlags = 0;
|
||||
calendarUnitFlags |= NSYearCalendarUnit;
|
||||
calendarUnitFlags |= NSMonthCalendarUnit;
|
||||
calendarUnitFlags |= NSDayCalendarUnit;
|
||||
calendarUnitFlags |= NSHourCalendarUnit;
|
||||
calendarUnitFlags |= NSMinuteCalendarUnit;
|
||||
calendarUnitFlags |= NSSecondCalendarUnit;
|
||||
calendarUnitFlags |= NSCalendarUnitYear;
|
||||
calendarUnitFlags |= NSCalendarUnitMonth;
|
||||
calendarUnitFlags |= NSCalendarUnitDay;
|
||||
calendarUnitFlags |= NSCalendarUnitHour;
|
||||
calendarUnitFlags |= NSCalendarUnitMinute;
|
||||
calendarUnitFlags |= NSCalendarUnitSecond;
|
||||
|
||||
// Initialze 'app' variable (char *)
|
||||
|
||||
@@ -954,7 +954,7 @@ static DDTTYLogger *sharedInstance;
|
||||
}
|
||||
|
||||
if (i < [colorProfilesArray count])
|
||||
[colorProfilesArray replaceObjectAtIndex:i withObject:newColorProfile];
|
||||
colorProfilesArray[i] = newColorProfile;
|
||||
else
|
||||
[colorProfilesArray addObject:newColorProfile];
|
||||
}};
|
||||
@@ -992,7 +992,7 @@ static DDTTYLogger *sharedInstance;
|
||||
|
||||
NSLogInfo(@"DDTTYLogger: newColorProfile: %@", newColorProfile);
|
||||
|
||||
[colorProfilesDict setObject:newColorProfile forKey:tag];
|
||||
colorProfilesDict[tag] = newColorProfile;
|
||||
}};
|
||||
|
||||
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
|
||||
@@ -1189,7 +1189,7 @@ static DDTTYLogger *sharedInstance;
|
||||
{
|
||||
if (logMessage->tag)
|
||||
{
|
||||
colorProfile = [colorProfilesDict objectForKey:logMessage->tag];
|
||||
colorProfile = colorProfilesDict[logMessage->tag];
|
||||
}
|
||||
if (colorProfile == nil)
|
||||
{
|
||||
@@ -1359,7 +1359,7 @@ static DDTTYLogger *sharedInstance;
|
||||
|
||||
@implementation DDTTYLoggerColorProfile
|
||||
|
||||
- (id)initWithForegroundColor:(OSColor *)fgColor backgroundColor:(OSColor *)bgColor flag:(int)aMask context:(int)ctxt
|
||||
- (instancetype)initWithForegroundColor:(OSColor *)fgColor backgroundColor:(OSColor *)bgColor flag:(int)aMask context:(int)ctxt
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
@@ -1390,7 +1390,7 @@ static DDTTYLogger *sharedInstance;
|
||||
// Map foreground color to closest available shell color
|
||||
|
||||
fgCodeIndex = [DDTTYLogger codeIndexForColor:fgColor];
|
||||
fgCodeRaw = [codes_fg objectAtIndex:fgCodeIndex];
|
||||
fgCodeRaw = codes_fg[fgCodeIndex];
|
||||
|
||||
NSString *escapeSeq = @"\033[";
|
||||
|
||||
@@ -1424,7 +1424,7 @@ static DDTTYLogger *sharedInstance;
|
||||
// Map background color to closest available shell color
|
||||
|
||||
bgCodeIndex = [DDTTYLogger codeIndexForColor:bgColor];
|
||||
bgCodeRaw = [codes_bg objectAtIndex:bgCodeIndex];
|
||||
bgCodeRaw = codes_bg[bgCodeIndex];
|
||||
|
||||
NSString *escapeSeq = @"\033[";
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// NSMutableArray+moveIndexes.h
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Antoine Mercadal on 6/2/15.
|
||||
// Copyright (c) 2015 cappuccino-project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSMutableArray (MoveIndexes)
|
||||
|
||||
- (void)moveIndexes:(NSIndexSet *)indexes toIndex:(NSUInteger)insertIndex;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// NSMutableArray+moveIndexes.m
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Antoine Mercadal on 6/2/15.
|
||||
// Copyright (c) 2015 cappuccino-project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSMutableArray+moveIndexes.h"
|
||||
|
||||
@implementation NSMutableArray (MoveIndexes)
|
||||
|
||||
- (void)moveIndexes:(NSIndexSet *)indexes toIndex:(NSUInteger)insertIndex
|
||||
{
|
||||
NSUInteger aboveCount = 0;
|
||||
id object;
|
||||
NSUInteger removeIndex;
|
||||
|
||||
NSUInteger index = [indexes lastIndex];
|
||||
|
||||
while (index != NSNotFound)
|
||||
{
|
||||
if (index >= insertIndex)
|
||||
{
|
||||
removeIndex = index + aboveCount;
|
||||
aboveCount ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
removeIndex = index;
|
||||
insertIndex --;
|
||||
}
|
||||
|
||||
object = self[removeIndex];
|
||||
|
||||
[self removeObjectAtIndex:removeIndex];
|
||||
[self insertObject:object atIndex:insertIndex];
|
||||
|
||||
index = [indexes indexLessThanIndex:index];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// Notifications.h
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Aparajita on 4/27/13.
|
||||
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef XcodeCapp_Notifications_h
|
||||
#define XcodeCapp_Notifications_h
|
||||
|
||||
extern NSString * const XCCProjectDidFinishLoadingNotification;
|
||||
extern NSString * const XCCBatchDidStartNotification;
|
||||
extern NSString * const XCCBatchDidEndNotification;
|
||||
extern NSString * const XCCConversionDidStartNotification;
|
||||
extern NSString * const XCCConversionDidEndNotification;
|
||||
extern NSString * const XCCConversionDidGenerateErrorNotification;
|
||||
|
||||
#endif
|
||||
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// Notifications.m
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Aparajita on 4/27/13.
|
||||
//
|
||||
//
|
||||
|
||||
#include "Notifications.h"
|
||||
|
||||
|
||||
NSString * const XCCProjectDidFinishLoadingNotification = @"XCCProjectDidFinishLoadingNotification";
|
||||
NSString * const XCCBatchDidStartNotification = @"XCCBatchDidStartNotification";
|
||||
NSString * const XCCBatchDidEndNotification = @"XCCBatchDidEndNotification";
|
||||
NSString * const XCCConversionDidStartNotification = @"XCCConversionDidStartNotification";
|
||||
NSString * const XCCConversionDidEndNotification = @"XCCConversionDidStopNotification";
|
||||
NSString * const XCCConversionDidGenerateErrorNotification = @"XCCConversionDidGenerateErrorNotification";
|
||||
@@ -0,0 +1,198 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8164.2" systemVersion="15A235d" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<development version="6300" identifier="xcode"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8164.2"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="XCCOperationsViewController">
|
||||
<connections>
|
||||
<outlet property="maskingView" destination="rPm-ot-o84" id="Xb6-FC-bE4"/>
|
||||
<outlet property="operationTableView" destination="L6L-Ia-hHw" id="DlM-jq-0Zs"/>
|
||||
<outlet property="view" destination="bhk-PN-1fI" id="qRe-5g-Kbc"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="bhk-PN-1fI" userLabel="mainView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="400"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="50" horizontalPageScroll="10" verticalLineScroll="50" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="tDz-3F-ZPY">
|
||||
<rect key="frame" x="0.0" y="25" width="400" height="375"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" id="8nd-Lh-h18">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="375"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView identifier="OperationsTableView" verticalHuggingPriority="750" allowsExpansionToolTips="YES" selectionHighlightStyle="none" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="40" rowSizeStyle="automatic" viewBased="YES" id="L6L-Ia-hHw">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="0.0"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
<size key="intercellSpacing" width="5" height="10"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn editable="NO" width="395" minWidth="40" maxWidth="10000000" id="PNx-cQ-yYb">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="gq8-QZ-CFg">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView identifier="OperationDataView" id="BFn-if-RVP" customClass="XCCOperationDataView">
|
||||
<rect key="frame" x="2" y="5" width="395" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="NB8-Q7-Qqc">
|
||||
<rect key="frame" x="19" y="20" width="375" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="jvO-Vq-NgM">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="Vil-NW-lEi">
|
||||
<rect key="frame" x="19" y="3" width="375" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="HhV-u4-qRr">
|
||||
<font key="font" size="11" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<box autoresizesSubviews="NO" borderWidth="0.0" cornerRadius="100" title="Box" boxType="custom" borderType="line" titlePosition="noTitle" id="t7U-ts-XEf">
|
||||
<rect key="frame" x="6" y="23" width="10" height="10"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<view key="contentView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="10" height="10"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
</view>
|
||||
<animations/>
|
||||
<color key="borderColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</box>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<connections>
|
||||
<outlet property="boxStatus" destination="t7U-ts-XEf" id="jMq-Om-cvI"/>
|
||||
<outlet property="fieldDescription" destination="Vil-NW-lEi" id="x2T-S4-Ft7"/>
|
||||
<outlet property="fieldName" destination="NB8-Q7-Qqc" id="mht-28-aVp"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="-2" id="jv0-gt-j0N"/>
|
||||
<outlet property="delegate" destination="-2" id="vyi-dy-8AN"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</clipView>
|
||||
<animations/>
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="I49-aN-61K">
|
||||
<rect key="frame" x="1" y="119" width="223" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="Ell-T5-eht">
|
||||
<rect key="frame" x="224" y="17" width="15" height="102"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<box autoresizesSubviews="NO" borderWidth="0.0" title="Box" boxType="custom" borderType="line" titlePosition="noTitle" id="tst-OL-fMW">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<view key="contentView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="vAq-Ur-KQc">
|
||||
<rect key="frame" x="-1" y="22" width="402" height="5"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
||||
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<font key="titleFont" metaFont="system"/>
|
||||
</box>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="EoK-lo-Lyg">
|
||||
<rect key="frame" x="13" y="7" width="344" height="11"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="99999" id="bSf-Rp-YO4">
|
||||
<font key="font" metaFont="miniSystem"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="self.cappuccinoProjectController.operationsRemainingString" id="QB8-Xe-j6P"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button toolTip="Cancel all running operations" id="yTX-3g-Fn2">
|
||||
<rect key="frame" x="377" y="3" width="18" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="NSStopProgressTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="LeO-oQ-18M">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="cancelAllOperations:" target="-2" id="b5g-2t-gU5"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</view>
|
||||
<animations/>
|
||||
<color key="borderColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="fillColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</box>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<point key="canvasLocation" x="279" y="155"/>
|
||||
</customView>
|
||||
<box title="Box" boxType="custom" borderType="line" titlePosition="noTitle" id="rPm-ot-o84">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="400"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<view key="contentView">
|
||||
<rect key="frame" x="1" y="1" width="398" height="398"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="Wtz-Ws-sU5">
|
||||
<rect key="frame" x="94" y="188" width="211" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="No Scheduled Operation" id="plk-ZH-ETu">
|
||||
<font key="font" metaFont="system" size="18"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</view>
|
||||
<animations/>
|
||||
<color key="borderColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="fillColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<point key="canvasLocation" x="452" y="114"/>
|
||||
</box>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSStopProgressTemplate" width="11" height="11"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// ProcessSourceOperation.h
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Aparajita on 4/27/13.
|
||||
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class XcodeCapp;
|
||||
|
||||
|
||||
@interface ProcessSourceOperation : NSOperation
|
||||
|
||||
// sourcePath should be a path within the project (no resolved symlinks)
|
||||
- (id)initWithXCC:(XcodeCapp *)xcc projectId:(NSNumber *)projectId sourcePath:(NSString *)sourcePath;
|
||||
|
||||
@end
|
||||
@@ -1,217 +0,0 @@
|
||||
//
|
||||
// ProcessSourceOperation.m
|
||||
// XcodeCapp
|
||||
//
|
||||
// Created by Aparajita on 4/27/13.
|
||||
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ProcessSourceOperation.h"
|
||||
#import "Notifications.h"
|
||||
#import "XcodeCapp.h"
|
||||
|
||||
|
||||
@interface ProcessSourceOperation ()
|
||||
|
||||
@property XcodeCapp *xcc;
|
||||
@property NSNumber *projectId;
|
||||
@property NSString *sourcePath;
|
||||
@property NSString *projectPath;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation ProcessSourceOperation
|
||||
|
||||
- (id)initWithXCC:(XcodeCapp *)xcc projectId:(NSNumber *)projectId sourcePath:(NSString *)sourcePath
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
self.xcc = xcc;
|
||||
self.projectId = projectId;
|
||||
self.sourcePath = sourcePath;
|
||||
self.projectPath = xcc.projectPath;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)main
|
||||
{
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
|
||||
|
||||
NSDictionary *info = @{ @"projectId":self.projectId, @"path":self.sourcePath};
|
||||
[center postNotificationName:XCCConversionDidStartNotification object:self userInfo:info];
|
||||
|
||||
DDLogVerbose(@"Conversion started: %@", self.sourcePath);
|
||||
|
||||
NSString *launchPath = nil;
|
||||
NSArray *arguments = nil;
|
||||
NSString *response = nil;
|
||||
NSString *projectRelativePath = [self.sourcePath substringFromIndex:self.projectPath.length + 1];
|
||||
NSString *notificationTitle = nil;
|
||||
NSString *notificationMessage = projectRelativePath.lastPathComponent;
|
||||
|
||||
if ([self.xcc isXibFile:self.sourcePath])
|
||||
{
|
||||
launchPath = self.xcc.executablePaths[@"nib2cib"];
|
||||
arguments = @[
|
||||
@"--no-colors",
|
||||
self.sourcePath
|
||||
];
|
||||
|
||||
notificationTitle = @"Xib converted";
|
||||
}
|
||||
else if ([self.xcc isObjjFile:self.sourcePath])
|
||||
{
|
||||
launchPath = self.xcc.executablePaths[@"objj"];
|
||||
arguments = @[
|
||||
self.xcc.parserPath,
|
||||
self.projectPath,
|
||||
self.sourcePath
|
||||
];
|
||||
|
||||
notificationTitle = @"Objective-J source processed";
|
||||
}
|
||||
else if ([self.xcc isXCCIgnoreFile:self.sourcePath])
|
||||
{
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
[self.xcc performSelectorOnMainThread:@selector(computeIgnoredPaths) withObject:nil waitUntilDone:NO];
|
||||
|
||||
notificationTitle = @"Parsed .xcodecapp-ignore";
|
||||
notificationMessage = @"Ignored paths updated";
|
||||
}
|
||||
|
||||
// Run the task and get the response if needed
|
||||
NSInteger status = 0;
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
DDLogVerbose(@"Running processing task: %@", launchPath);
|
||||
|
||||
NSDictionary *taskResult = [self.xcc runTaskWithLaunchPath:launchPath
|
||||
arguments:arguments
|
||||
returnType:kTaskReturnTypeAny];
|
||||
|
||||
status = [taskResult[@"status"] intValue];
|
||||
response = taskResult[@"response"];
|
||||
|
||||
DDLogInfo(@"Processed %@: [%ld, %@]", self.sourcePath, status, status ? response : @"");
|
||||
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
if (status != 0)
|
||||
{
|
||||
if ([self.xcc isXibFile:self.sourcePath])
|
||||
{
|
||||
if (response.length == 0)
|
||||
response = @"An unspecified error occurred";
|
||||
|
||||
notificationTitle = @"Error converting xib";
|
||||
NSString *message = [NSString stringWithFormat:@"%@\n%@", self.sourcePath.lastPathComponent, response];
|
||||
|
||||
NSDictionary *info =
|
||||
@{
|
||||
@"projectId":self.projectId,
|
||||
@"message":message,
|
||||
@"path":self.sourcePath,
|
||||
@"status":taskResult[@"status"]
|
||||
};
|
||||
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
[center postNotificationName:XCCConversionDidGenerateErrorNotification object:self userInfo:info];
|
||||
}
|
||||
else
|
||||
{
|
||||
notificationTitle = [(status == XCCStatusCodeError ? @"Error" : @"Warning") stringByAppendingString:@" parsing Objective-J source"];
|
||||
|
||||
@try
|
||||
{
|
||||
NSArray *errors = [response propertyList];
|
||||
|
||||
for (NSDictionary *error in errors)
|
||||
{
|
||||
[self postErrorNotificationForPath:error[@"path"] line:[error[@"line"] intValue] message:error[@"message"] status:status];
|
||||
}
|
||||
}
|
||||
@catch (NSException *exception)
|
||||
{
|
||||
[self postErrorNotificationForPath:self.sourcePath line:0 message:response status:status];
|
||||
}
|
||||
}
|
||||
|
||||
if ([self.xcc shouldShowErrorNotification])
|
||||
[self notifyUserWithTitle:notificationTitle message:notificationMessage];
|
||||
}
|
||||
else if (!self.xcc.isLoadingProject)
|
||||
{
|
||||
BOOL showFinalNotification = YES;
|
||||
|
||||
// At this point, we should only detect warnings
|
||||
if ([self.xcc shouldProcessWithObjjWarnings] && ![self.xcc isXibFile:self.sourcePath])
|
||||
{
|
||||
showFinalNotification = [self.xcc checkObjjWarningsForPath:[NSArray arrayWithObject:self.sourcePath]];
|
||||
[self.xcc showObjjWarnings];
|
||||
}
|
||||
|
||||
if ([self.xcc shouldProcessWithCappLint] && ![self.xcc isXibFile:self.sourcePath])
|
||||
{
|
||||
showFinalNotification = [self.xcc checkCappLintForPath:[NSArray arrayWithObject:self.sourcePath]] && showFinalNotification;
|
||||
[self.xcc showCappLintWarnings];
|
||||
}
|
||||
|
||||
if (showFinalNotification)
|
||||
[self notifyUserWithTitle:notificationTitle message:notificationMessage];
|
||||
}
|
||||
}
|
||||
|
||||
if (!self.isCancelled)
|
||||
{
|
||||
DDLogVerbose(@"Conversion ended: %@", self.sourcePath);
|
||||
|
||||
[center postNotificationName:XCCConversionDidEndNotification object:self userInfo:@{ @"projectId":self.projectId, @"path":self.sourcePath }];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)postErrorNotificationForPath:(NSString *)path line:(int)line message:(NSString *)message status:(NSInteger)status
|
||||
{
|
||||
NSMutableDictionary *info = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
path, @"path",
|
||||
[NSNumber numberWithInt:line], @"line",
|
||||
[NSNumber numberWithInteger:status], @"status",
|
||||
nil];
|
||||
|
||||
info[@"projectId"] = self.projectId;
|
||||
info[@"message"] = [NSString stringWithFormat:@"Compilation issue: %@, line %d\n%@", [self.sourcePath lastPathComponent], 0, message];
|
||||
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionDidGenerateErrorNotification object:self userInfo:info];
|
||||
}
|
||||
|
||||
- (void)notifyUserWithTitle:(NSString *)title message:(NSString *)message
|
||||
{
|
||||
NSDictionary *info = @{ @"projectId":self.projectId, @"title":title, @"message":message };
|
||||
|
||||
if (self.isCancelled)
|
||||
return;
|
||||
|
||||
// nib2cib can take a while to run, show a message while the conversion is happening
|
||||
[self.xcc wantUserNotificationWithInfo:info];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -13,7 +13,7 @@ ONLY_ACTIVE_ARCH = YES
|
||||
DEBUG_INFORMATION_FORMAT = dwarf
|
||||
COMBINE_HIDPI_IMAGES = YES
|
||||
INSTALL_PATH = $(LOCAL_APPS_DIR)
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6.8
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10
|
||||
COPY_PHASE_STRIP = YES
|
||||
INFOPLIST_FILE = XcodeCapp/Info.plist
|
||||
PRODUCT_NAME = XcodeCapp
|
||||
|
||||
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 83 KiB |