├── demo.png ├── imgur.dmg ├── imgur ├── Status.png ├── Status@2x.png ├── imgur_old.png ├── Status_invert.png ├── StatusHighlighted.png ├── Status_invert@2x.png ├── StatusHighlighted@2x.png ├── main.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── icon_128x128.png │ │ ├── icon_16x16.png │ │ ├── icon_256x256.png │ │ ├── icon_32x32.png │ │ ├── icon_512x512.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_512x512@2x.png │ │ └── Contents.json ├── imgur-Prefix.pch ├── ScreenshotController.h ├── ApplicationDelegate.h ├── StatusItemView.h ├── imgur-Info.plist ├── ScreenshotController.m ├── ApplicationDelegate.m ├── StatusItemView.m └── en.lproj │ └── MainMenu.xib ├── imgur.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── imgur.xccheckout ├── imgur.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── .gitignore └── README.md /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/demo.png -------------------------------------------------------------------------------- /imgur.dmg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur.dmg -------------------------------------------------------------------------------- /imgur/Status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Status.png -------------------------------------------------------------------------------- /imgur/Status@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Status@2x.png -------------------------------------------------------------------------------- /imgur/imgur_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/imgur_old.png -------------------------------------------------------------------------------- /imgur/Status_invert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Status_invert.png -------------------------------------------------------------------------------- /imgur/StatusHighlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/StatusHighlighted.png -------------------------------------------------------------------------------- /imgur/Status_invert@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Status_invert@2x.png -------------------------------------------------------------------------------- /imgur/StatusHighlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/StatusHighlighted@2x.png -------------------------------------------------------------------------------- /imgur/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | return NSApplicationMain(argc, (const char **)argv); 6 | } 7 | -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_128x128.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_16x16.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_256x256.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_32x32.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_512x512.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zbuc/imgurBar/HEAD/imgur/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /imgur/imgur-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'imgur' target in the 'imgur' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | 7 | #import 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /imgur.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /imgur.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /imgur/ScreenshotController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ScreenshotController : NSObject 4 | { 5 | 6 | } 7 | 8 | - (void)uploadImage:(NSData *)image cpmpletitionBlock:(void (^)(BOOL success, NSURL *url, NSError *error))block; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | !default.xcworkspace 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | # Finder 16 | .DS_Store 17 | #deploy script 18 | deploy 19 | rakefile*.rb 20 | upload*.sh 21 | *.rb 22 | pkg/ 23 | bin 24 | 25 | *.xccheckout 26 | -------------------------------------------------------------------------------- /imgur/ApplicationDelegate.h: -------------------------------------------------------------------------------- 1 | #import "StatusItemView.h" 2 | 3 | #define CLIENT_ID @"" 4 | 5 | @interface ApplicationDelegate : NSObject { 6 | IBOutlet NSMenu *menu; 7 | IBOutlet NSMenuItem *menuItem; 8 | IBOutlet NSMenuItem *screenshotsMenuItem; 9 | 10 | NSMetadataQuery *_metadataQuery; 11 | } 12 | 13 | @property (nonatomic, readonly) StatusItemView *statusItemView; 14 | 15 | - (IBAction)screenshotMenuItemAction:(id)sender; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # imgurBar 2 | 3 | This is an OS X menubar application that makes it easy 4 | to upload images to imgur.com. 5 | 6 | ![imgurBar In Action](https://github.com/zbuc/imgurBar/raw/master/demo.png) 7 | 8 | Simply drag and drop images to the green dot. 9 | 10 | **Download:** [imgur.dmg](https://github.com/zbuc/imgurBar/raw/master/imgur.dmg) 11 | 12 | # Thanks 13 | 14 | Thanks to [shpakovski's popup demo](https://github.com/shpakovski/Popup). 15 | 16 | # License 17 | 18 | imgurBar is licensed under the BSD license. 19 | -------------------------------------------------------------------------------- /imgur/StatusItemView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface StatusItemView : NSView { 4 | @private 5 | NSImage *_image; 6 | NSImage *_alternateImage; 7 | NSStatusItem *_statusItem; 8 | BOOL _isHighlighted; 9 | SEL _action; 10 | id __unsafe_unretained _target; 11 | } 12 | 13 | - (id)initWithStatusItem:(NSStatusItem *)statusItem; 14 | 15 | @property (nonatomic, readonly) NSStatusItem *statusItem; 16 | @property (nonatomic, strong) NSImage *image; 17 | @property (nonatomic, strong) NSImage *alternateImage; 18 | @property (nonatomic, setter = setHighlighted:) BOOL isHighlighted; 19 | @property (nonatomic) SEL action; 20 | @property (nonatomic, unsafe_unretained) id target; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /imgur/imgur-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.zbuc.imgur 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSApplicationCategoryType 24 | public.app-category.utilities 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | LSUIElement 28 | 29 | NSHumanReadableCopyright 30 | Copyleft 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /imgur/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "icon_16x16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "icon_16x16@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "icon_32x32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "icon_32x32@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "icon_128x128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "icon_128x128@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "icon_256x256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "icon_256x256@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "icon_512x512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "icon_512x512@2x.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /imgur.xcworkspace/xcshareddata/imgur.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 2175E2E6-3623-4D5C-A0A4-D0399F732830 9 | IDESourceControlProjectName 10 | imgur 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | F59CF6B5-D6EF-462C-AEE7-67EC7CF04630 14 | https://github.com/zbuc/imgurBar.git 15 | 16 | IDESourceControlProjectPath 17 | imgur.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | F59CF6B5-D6EF-462C-AEE7-67EC7CF04630 21 | .. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/zbuc/imgurBar.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | F59CF6B5-D6EF-462C-AEE7-67EC7CF04630 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | F59CF6B5-D6EF-462C-AEE7-67EC7CF04630 36 | IDESourceControlWCCName 37 | imgurBar 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /imgur/ScreenshotController.m: -------------------------------------------------------------------------------- 1 | //#import "NSData-Base64Extensions.h" 2 | #import "ScreenshotController.h" 3 | #import "ApplicationDelegate.h" 4 | 5 | @implementation ScreenshotController 6 | 7 | - (void)uploadImage:(NSData *)image cpmpletitionBlock:(void (^)(BOOL, NSURL *, NSError *))block 8 | { 9 | NSString *urlString = @"https://api.imgur.com/3/upload.json"; 10 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; 11 | [request setURL:[NSURL URLWithString:urlString]]; 12 | [request setHTTPMethod:@"POST"]; 13 | [request setValue:[NSString stringWithFormat:@"Client-ID %@", CLIENT_ID] forHTTPHeaderField:@"Authorization"]; 14 | 15 | NSMutableData *body = [NSMutableData data]; 16 | 17 | NSString *boundary = @"---------------------------14737809831466499882746641449"; 18 | NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary]; 19 | [request addValue:contentType forHTTPHeaderField:@"Content-Type"]; 20 | 21 | // file 22 | [body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]]; 23 | [body appendData:[@"Content-Disposition: attachment; name=\"image\"; filename=\".tiff\"\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; 24 | [body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; 25 | [body appendData:[NSData dataWithData:image]]; 26 | [body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; 27 | 28 | // text parameter 29 | [body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]]; 30 | [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"key\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; 31 | 32 | // close form 33 | [body appendData:[[NSString stringWithFormat:@"--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]]; 34 | 35 | // set request body 36 | [request setHTTPBody:body]; 37 | 38 | [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { 39 | NSDictionary *decodedResponse = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil]; 40 | 41 | if (block) 42 | { 43 | BOOL success = [decodedResponse[@"success"] boolValue]; 44 | NSURL *imgurUrl; 45 | NSError *imgurError; 46 | 47 | if (success) 48 | { 49 | imgurUrl = [NSURL URLWithString:decodedResponse[@"data"][@"link"]]; 50 | } 51 | else 52 | { 53 | imgurError = [NSError errorWithDomain:@"imgur.com" code:[decodedResponse[@"status"] integerValue] userInfo:@{NSLocalizedDescriptionKey:decodedResponse[@"data"][@"error"]}]; 54 | } 55 | 56 | block(success, imgurUrl, imgurError); 57 | } 58 | }]; 59 | } 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /imgur/ApplicationDelegate.m: -------------------------------------------------------------------------------- 1 | #import "ApplicationDelegate.h" 2 | #import "ScreenshotController.h" 3 | 4 | @implementation ApplicationDelegate 5 | 6 | static NSString *kDefaultsScreenshotUploadingKey = @"defaultsScreenshotUploadingKey"; 7 | 8 | #pragma mark - 9 | 10 | - (void)dealloc 11 | { 12 | [[NSStatusBar systemStatusBar] removeStatusItem:self.statusItemView.statusItem]; 13 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 14 | } 15 | 16 | #pragma mark - NSApplicationDelegate 17 | 18 | - (void)applicationDidFinishLaunching:(NSNotification *)notification 19 | { 20 | // Install icon into the menu bar 21 | NSStatusItem *stockStatusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength]; 22 | _statusItemView = [[StatusItemView alloc] initWithStatusItem:stockStatusItem]; 23 | [_statusItemView setImage:[NSImage imageNamed:@"Status"]]; 24 | [_statusItemView setAlternateImage:[NSImage imageNamed:@"Status_invert"]]; 25 | [_statusItemView setMenu:menu]; 26 | 27 | [self _updateScreenshotMenuItem]; 28 | } 29 | 30 | - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender 31 | { 32 | return NSTerminateNow; 33 | } 34 | 35 | #pragma mark - Public accessors 36 | 37 | - (NSStatusItem *)statusItem 38 | { 39 | return self.statusItemView.statusItem; 40 | } 41 | 42 | #pragma mark - Screenshots 43 | 44 | - (void)screenshotMenuItemAction:(id)sender 45 | { 46 | BOOL isScreenshotUploadingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:kDefaultsScreenshotUploadingKey]; 47 | isScreenshotUploadingEnabled = !isScreenshotUploadingEnabled; 48 | [[NSUserDefaults standardUserDefaults] setBool:isScreenshotUploadingEnabled forKey:kDefaultsScreenshotUploadingKey]; 49 | [self _updateScreenshotMenuItem]; 50 | } 51 | 52 | - (void)metadataQueryUpdated:(NSNotification*)note 53 | { 54 | NSArray *items = note.userInfo[NSMetadataQueryUpdateAddedItemsKey]; 55 | 56 | for (NSMetadataItem *item in items) 57 | { 58 | NSString *imagePath = [item valueForKey:NSMetadataItemPathKey]; 59 | NSData *data = [[NSData alloc] initWithContentsOfFile:imagePath]; 60 | 61 | [[ScreenshotController alloc] uploadImage:data cpmpletitionBlock:^(BOOL success, NSURL *url, NSError *error) { 62 | if (success) 63 | { 64 | // set so you can paste it 65 | NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard]; 66 | [pasteBoard declareTypes:@[NSStringPboardType] owner:nil]; 67 | [pasteBoard setString:url.absoluteString forType:NSStringPboardType]; 68 | 69 | BOOL finished = [[NSWorkspace sharedWorkspace] openURL:url]; 70 | 71 | if(finished) { 72 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 73 | notification.title = @"Image uploaded!"; 74 | notification.informativeText = @"Link copied to clipboard"; 75 | notification.contentImage = [[NSImage alloc] initWithData:data]; 76 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 77 | 78 | [[NSFileManager defaultManager] removeItemAtPath:imagePath error:&error]; 79 | } 80 | } 81 | else 82 | { 83 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 84 | notification.title = @"Error image uploading"; 85 | notification.informativeText = error.localizedDescription; 86 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 87 | } 88 | }]; 89 | } 90 | } 91 | 92 | - (void)_updateScreenshotMenuItem 93 | { 94 | BOOL isScreenshotUploadingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:kDefaultsScreenshotUploadingKey]; 95 | 96 | if (isScreenshotUploadingEnabled) 97 | { 98 | if (!_metadataQuery) 99 | { 100 | _metadataQuery = [[NSMetadataQuery alloc] init]; 101 | [_metadataQuery setDelegate:self]; 102 | [_metadataQuery setPredicate:[NSPredicate predicateWithFormat:@"kMDItemIsScreenCapture = 1"]]; 103 | } 104 | 105 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(metadataQueryUpdated:) name:NSMetadataQueryDidUpdateNotification object:_metadataQuery]; 106 | 107 | [_metadataQuery startQuery]; 108 | } 109 | else 110 | { 111 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 112 | [_metadataQuery stopQuery]; 113 | } 114 | 115 | [screenshotsMenuItem setState:isScreenshotUploadingEnabled]; 116 | } 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /imgur/StatusItemView.m: -------------------------------------------------------------------------------- 1 | #import "StatusItemView.h" 2 | #import "ScreenshotController.h" 3 | 4 | @implementation StatusItemView 5 | 6 | @synthesize statusItem = _statusItem; 7 | @synthesize image = _image; 8 | @synthesize alternateImage = _alternateImage; 9 | @synthesize isHighlighted = _isHighlighted; 10 | @synthesize action = _action; 11 | @synthesize target = _target; 12 | 13 | #pragma mark - 14 | 15 | 16 | - (void)setMenu:(NSMenu *)menu { 17 | [menu setDelegate:self]; 18 | [super setMenu:menu]; 19 | } 20 | 21 | 22 | - (id)initWithFrame:(NSRect)frame 23 | { 24 | self = [super initWithFrame:frame]; 25 | if (self) { 26 | //register for drags 27 | NSArray *dragTypes = @[NSURLPboardType, NSFileContentsPboardType, NSFilenamesPboardType]; 28 | [self registerForDraggedTypes:dragTypes]; 29 | } 30 | 31 | return self; 32 | } 33 | 34 | - (id)initWithStatusItem:(NSStatusItem *)statusItem 35 | { 36 | CGFloat itemWidth = [statusItem length]; 37 | CGFloat itemHeight = [[NSStatusBar systemStatusBar] thickness]; 38 | NSRect itemRect = NSMakeRect(0.0, 0.0, itemWidth, itemHeight); 39 | self = [self initWithFrame:itemRect]; 40 | 41 | if (self != nil) 42 | { 43 | _statusItem = statusItem; 44 | _statusItem.view = self; 45 | } 46 | return self; 47 | } 48 | 49 | 50 | #pragma mark - 51 | 52 | - (void)drawRect:(NSRect)dirtyRect 53 | { 54 | [self.statusItem drawStatusBarBackgroundInRect:dirtyRect withHighlight:self.isHighlighted]; 55 | 56 | NSImage *icon = self.isHighlighted ? self.alternateImage : self.image; 57 | NSSize iconSize = [icon size]; 58 | NSRect bounds = self.bounds; 59 | CGFloat iconX = roundf((NSWidth(bounds) - iconSize.width) / 2); 60 | CGFloat iconY = roundf((NSHeight(bounds) - iconSize.height) / 2); 61 | NSPoint iconPoint = NSMakePoint(iconX, iconY); 62 | [icon drawAtPoint:iconPoint fromRect:bounds operation:NSCompositeSourceOver fraction:1.0]; 63 | } 64 | 65 | #pragma mark - 66 | #pragma mark Mouse tracking 67 | 68 | - (void)mouseDown:(NSEvent *)theEvent 69 | { 70 | NSMenu *menu = [super menu]; 71 | [_statusItem popUpStatusItemMenu:menu]; 72 | [NSApp sendAction:self.action to:self.target from:self]; 73 | } 74 | 75 | 76 | - (void)menuWillOpen:(NSMenu *)menu { 77 | [self setHighlighted:YES]; 78 | [self setNeedsDisplay:YES]; 79 | } 80 | 81 | - (void)menuDidClose:(NSMenu *)menu { 82 | [self setHighlighted:NO]; 83 | [self setNeedsDisplay:YES]; 84 | } 85 | 86 | 87 | 88 | #pragma mark - 89 | #pragma mark Accessors 90 | 91 | - (void)setHighlighted:(BOOL)newFlag 92 | { 93 | if (_isHighlighted == newFlag) return; 94 | _isHighlighted = newFlag; 95 | [self setNeedsDisplay:YES]; 96 | } 97 | 98 | #pragma mark - 99 | 100 | - (void)setImage:(NSImage *)newImage 101 | { 102 | _image = newImage; 103 | [self setNeedsDisplay:YES]; 104 | } 105 | 106 | - (void)setAlternateImage:(NSImage *)newImage 107 | { 108 | _alternateImage = newImage; 109 | if (self.isHighlighted) 110 | [self setNeedsDisplay:YES]; 111 | } 112 | 113 | 114 | //we want to copy the files 115 | - (NSDragOperation)draggingEntered:(id)sender 116 | { 117 | if ([[sender draggingPasteboard] availableTypeFromArray:@[NSFilenamesPboardType]]) { 118 | return NSDragOperationCopy; 119 | } 120 | return NSDragOperationNone; 121 | } 122 | 123 | //perform the drag and log the files that are dropped 124 | - (BOOL)performDragOperation:(id )sender 125 | { 126 | NSPasteboard *pb = [sender draggingPasteboard]; 127 | if([[pb pasteboardItems] count] != 1){ 128 | return NO; 129 | } 130 | 131 | if([NSBitmapImageRep canInitWithPasteboard:pb]){ 132 | NSURL *url = [NSURL URLFromPasteboard:pb]; 133 | NSData *data = [[NSData alloc] initWithContentsOfURL:url]; 134 | [[ScreenshotController alloc] uploadImage:data cpmpletitionBlock:^(BOOL success, NSURL *url, NSError *error) { 135 | if (success) 136 | { 137 | // set so you can paste it 138 | NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard]; 139 | [pasteBoard declareTypes:@[NSStringPboardType] owner:nil]; 140 | [pasteBoard setString:url.absoluteString forType:NSStringPboardType]; 141 | 142 | BOOL finished = [[NSWorkspace sharedWorkspace] openURL:url]; 143 | 144 | if(finished){ 145 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 146 | notification.title = @"Image uploaded!"; 147 | notification.informativeText = @"Link copied to clipboard"; 148 | notification.contentImage = [[NSImage alloc] initWithData:data]; 149 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 150 | } 151 | } 152 | else 153 | { 154 | NSUserNotification *notification = [[NSUserNotification alloc] init]; 155 | notification.title = @"Error image uploading"; 156 | notification.informativeText = error.localizedDescription; 157 | [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; 158 | } 159 | }]; 160 | 161 | return YES; 162 | } 163 | 164 | return NO; 165 | } 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /imgur/en.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 101000 5 | 14C109 6 | 6254 7 | 1344.72 8 | 757.30 9 | 10 | com.apple.InterfaceBuilder.CocoaPlugin 11 | 6254 12 | 13 | 14 | NSCustomObject 15 | NSMenu 16 | NSMenuItem 17 | 18 | 19 | com.apple.InterfaceBuilder.CocoaPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | NSApplication 28 | 29 | 30 | FirstResponder 31 | 32 | 33 | NSApplication 34 | 35 | 36 | AMainMenu 37 | 38 | _NSMainMenu 39 | 40 | 41 | ApplicationDelegate 42 | 43 | 44 | NSFontManager 45 | 46 | 47 | 48 | 49 | 50 | 51 | Take Screenshot 52 | 4 53 | 655360 54 | 2147483647 55 | 56 | NSImage 57 | NSMenuCheckmark 58 | 59 | 60 | NSImage 61 | NSMenuMixedState 62 | 63 | 64 | 65 | 66 | Login 67 | 68 | 2147483647 69 | 70 | 71 | 72 | 73 | 74 | YES 75 | YES 76 | 77 | 78 | 2147483647 79 | 80 | 81 | 82 | 83 | 84 | Screenshots auto uploading 85 | 86 | 2147483647 87 | 88 | 89 | 90 | 91 | 92 | YES 93 | YES 94 | 95 | 96 | 2147483647 97 | 98 | 99 | 100 | 101 | 102 | Quit imgur 103 | 104 | 2147483647 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | terminate: 116 | 117 | 118 | 119 | 543 120 | 121 | 122 | 123 | delegate 124 | 125 | 126 | 127 | 495 128 | 129 | 130 | 131 | menu 132 | 133 | 134 | 135 | 546 136 | 137 | 138 | 139 | menuItem 140 | 141 | 142 | 143 | 548 144 | 145 | 146 | 147 | screenshotsMenuItem 148 | 149 | 150 | 151 | 552 152 | 153 | 154 | 155 | screenshotMenuItemAction: 156 | 157 | 158 | 159 | 553 160 | 161 | 162 | 163 | 164 | 165 | 0 166 | 167 | 168 | 169 | 170 | 171 | -2 172 | 173 | 174 | File's Owner 175 | 176 | 177 | -1 178 | 179 | 180 | First Responder 181 | 182 | 183 | -3 184 | 185 | 186 | Application 187 | 188 | 189 | 29 190 | 191 | 192 | 193 | 194 | 195 | 420 196 | 197 | 198 | 199 | 200 | 494 201 | 202 | 203 | 204 | 205 | 536 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | imgur Menu 217 | 218 | 219 | 537 220 | 221 | 222 | 223 | 224 | 538 225 | 226 | 227 | 228 | 229 | 539 230 | 231 | 232 | 233 | 234 | 540 235 | 236 | 237 | 238 | 239 | 550 240 | 241 | 242 | 243 | 244 | 551 245 | 246 | 247 | 248 | 249 | 250 | 251 | com.apple.InterfaceBuilder.CocoaPlugin 252 | com.apple.InterfaceBuilder.CocoaPlugin 253 | com.apple.InterfaceBuilder.CocoaPlugin 254 | com.apple.InterfaceBuilder.CocoaPlugin 255 | com.apple.InterfaceBuilder.CocoaPlugin 256 | com.apple.InterfaceBuilder.CocoaPlugin 257 | com.apple.InterfaceBuilder.CocoaPlugin 258 | com.apple.InterfaceBuilder.CocoaPlugin 259 | com.apple.InterfaceBuilder.CocoaPlugin 260 | com.apple.InterfaceBuilder.CocoaPlugin 261 | com.apple.InterfaceBuilder.CocoaPlugin 262 | com.apple.InterfaceBuilder.CocoaPlugin 263 | com.apple.InterfaceBuilder.CocoaPlugin 264 | 265 | 266 | 267 | 268 | 269 | 553 270 | 271 | 272 | 273 | 274 | ApplicationDelegate 275 | NSObject 276 | 277 | screenshotMenuItemAction: 278 | id 279 | 280 | 281 | screenshotMenuItemAction: 282 | 283 | screenshotMenuItemAction: 284 | id 285 | 286 | 287 | 288 | NSMenu 289 | NSMenuItem 290 | NSMenuItem 291 | 292 | 293 | 294 | menu 295 | NSMenu 296 | 297 | 298 | menuItem 299 | NSMenuItem 300 | 301 | 302 | screenshotsMenuItem 303 | NSMenuItem 304 | 305 | 306 | 307 | IBProjectSource 308 | ../imgur/ApplicationDelegate.h 309 | 310 | 311 | 312 | 313 | 314 | NSApplication 315 | NSResponder 316 | 317 | IBFrameworkSource 318 | AppKit.framework/Headers/NSApplication.h 319 | 320 | 321 | 322 | NSFontManager 323 | NSObject 324 | 325 | IBFrameworkSource 326 | AppKit.framework/Headers/NSFontManager.h 327 | 328 | 329 | 330 | NSMenu 331 | NSObject 332 | 333 | IBFrameworkSource 334 | AppKit.framework/Headers/NSMenu.h 335 | 336 | 337 | 338 | NSMenuItem 339 | NSObject 340 | 341 | IBFrameworkSource 342 | AppKit.framework/Headers/NSMenuItem.h 343 | 344 | 345 | 346 | NSResponder 347 | NSObject 348 | 349 | IBFrameworkSource 350 | AppKit.framework/Headers/NSResponder.h 351 | 352 | 353 | 354 | NSView 355 | NSResponder 356 | 357 | IBFrameworkSource 358 | AppKit.framework/Headers/NSView.h 359 | 360 | 361 | 362 | 363 | 0 364 | IBCocoaFramework 365 | NO 366 | 367 | com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 368 | 369 | 370 | YES 371 | 3 372 | 373 | {12, 12} 374 | {10, 2} 375 | 376 | 377 | 378 | -------------------------------------------------------------------------------- /imgur.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 60368E9D14F9E8020092CF27 /* SystemUIPlugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60368E9C14F9E8020092CF27 /* SystemUIPlugin.framework */; }; 11 | 60368EAA14FA10190092CF27 /* ScreenshotController.m in Sources */ = {isa = PBXBuildFile; fileRef = 60368EA914FA10190092CF27 /* ScreenshotController.m */; }; 12 | C9293B7816AE75DF00829127 /* Status_invert.png in Resources */ = {isa = PBXBuildFile; fileRef = C9293B7416AE75DF00829127 /* Status_invert.png */; }; 13 | C9293B7916AE75DF00829127 /* Status_invert@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C9293B7516AE75DF00829127 /* Status_invert@2x.png */; }; 14 | C9293B7A16AE75DF00829127 /* Status.png in Resources */ = {isa = PBXBuildFile; fileRef = C9293B7616AE75DF00829127 /* Status.png */; }; 15 | C9293B7B16AE75DF00829127 /* Status@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C9293B7716AE75DF00829127 /* Status@2x.png */; }; 16 | DD4F7C0913C30F9F00825C6E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD4F7C0813C30F9F00825C6E /* Cocoa.framework */; }; 17 | DD4F7C1513C30F9F00825C6E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DD4F7C1413C30F9F00825C6E /* main.m */; }; 18 | DD4F7C1C13C30F9F00825C6E /* ApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD4F7C1B13C30F9F00825C6E /* ApplicationDelegate.m */; }; 19 | DD4F7C1F13C30F9F00825C6E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DD4F7C1D13C30F9F00825C6E /* MainMenu.xib */; }; 20 | DD4F7C3C13C3180800825C6E /* StatusItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD4F7C3B13C3180800825C6E /* StatusItemView.m */; }; 21 | DD4F7C4C13C322FA00825C6E /* StatusHighlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = DD4F7C4A13C322FA00825C6E /* StatusHighlighted.png */; }; 22 | EAC001361A9220ED00B5EE40 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAC001351A9220ED00B5EE40 /* Images.xcassets */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 60368E9C14F9E8020092CF27 /* SystemUIPlugin.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemUIPlugin.framework; path = ../../../../System/Library/PrivateFrameworks/SystemUIPlugin.framework; sourceTree = ""; }; 27 | 60368EA814FA10190092CF27 /* ScreenshotController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScreenshotController.h; sourceTree = ""; }; 28 | 60368EA914FA10190092CF27 /* ScreenshotController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScreenshotController.m; sourceTree = ""; }; 29 | C9293B7416AE75DF00829127 /* Status_invert.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Status_invert.png; path = imgur/Status_invert.png; sourceTree = ""; }; 30 | C9293B7516AE75DF00829127 /* Status_invert@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Status_invert@2x.png"; path = "imgur/Status_invert@2x.png"; sourceTree = ""; }; 31 | C9293B7616AE75DF00829127 /* Status.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Status.png; path = imgur/Status.png; sourceTree = ""; }; 32 | C9293B7716AE75DF00829127 /* Status@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Status@2x.png"; path = "imgur/Status@2x.png"; sourceTree = ""; }; 33 | DD4F7C0413C30F9F00825C6E /* imgur.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = imgur.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | DD4F7C0813C30F9F00825C6E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 35 | DD4F7C0B13C30F9F00825C6E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 36 | DD4F7C0C13C30F9F00825C6E /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 37 | DD4F7C0D13C30F9F00825C6E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 38 | DD4F7C1013C30F9F00825C6E /* imgur-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "imgur-Info.plist"; path = "imgur/imgur-Info.plist"; sourceTree = ""; }; 39 | DD4F7C1413C30F9F00825C6E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 40 | DD4F7C1613C30F9F00825C6E /* imgur-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "imgur-Prefix.pch"; sourceTree = ""; }; 41 | DD4F7C1A13C30F9F00825C6E /* ApplicationDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplicationDelegate.h; sourceTree = ""; }; 42 | DD4F7C1B13C30F9F00825C6E /* ApplicationDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ApplicationDelegate.m; sourceTree = ""; }; 43 | DD4F7C1E13C30F9F00825C6E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 44 | DD4F7C3A13C3180800825C6E /* StatusItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusItemView.h; sourceTree = ""; }; 45 | DD4F7C3B13C3180800825C6E /* StatusItemView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusItemView.m; sourceTree = ""; }; 46 | DD4F7C4A13C322FA00825C6E /* StatusHighlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = StatusHighlighted.png; path = imgur/StatusHighlighted.png; sourceTree = ""; }; 47 | EAC001351A9220ED00B5EE40 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = imgur/Images.xcassets; sourceTree = ""; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | DD4F7C0113C30F9F00825C6E /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | 60368E9D14F9E8020092CF27 /* SystemUIPlugin.framework in Frameworks */, 56 | DD4F7C0913C30F9F00825C6E /* Cocoa.framework in Frameworks */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | DD4F7BF913C30F9F00825C6E = { 64 | isa = PBXGroup; 65 | children = ( 66 | EAC001351A9220ED00B5EE40 /* Images.xcassets */, 67 | 60368E9C14F9E8020092CF27 /* SystemUIPlugin.framework */, 68 | DD4F7C0E13C30F9F00825C6E /* Sources */, 69 | DD4F7C2813C3123E00825C6E /* User Interface */, 70 | DD4F7C0713C30F9F00825C6E /* Frameworks */, 71 | DD4F7C0513C30F9F00825C6E /* Products */, 72 | DD4F7C1013C30F9F00825C6E /* imgur-Info.plist */, 73 | ); 74 | sourceTree = ""; 75 | }; 76 | DD4F7C0513C30F9F00825C6E /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | DD4F7C0413C30F9F00825C6E /* imgur.app */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | DD4F7C0713C30F9F00825C6E /* Frameworks */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | DD4F7C0B13C30F9F00825C6E /* AppKit.framework */, 88 | DD4F7C0C13C30F9F00825C6E /* CoreData.framework */, 89 | DD4F7C0D13C30F9F00825C6E /* Foundation.framework */, 90 | DD4F7C0813C30F9F00825C6E /* Cocoa.framework */, 91 | ); 92 | name = Frameworks; 93 | sourceTree = ""; 94 | }; 95 | DD4F7C0E13C30F9F00825C6E /* Sources */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | DD4F7C2613C311DF00825C6E /* Controllers */, 99 | DD4F7C3913C317EC00825C6E /* Views */, 100 | DD4F7C0F13C30F9F00825C6E /* Supporting Files */, 101 | ); 102 | name = Sources; 103 | path = imgur; 104 | sourceTree = ""; 105 | }; 106 | DD4F7C0F13C30F9F00825C6E /* Supporting Files */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | DD4F7C1613C30F9F00825C6E /* imgur-Prefix.pch */, 110 | DD4F7C1413C30F9F00825C6E /* main.m */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | DD4F7C2613C311DF00825C6E /* Controllers */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | DD4F7C1A13C30F9F00825C6E /* ApplicationDelegate.h */, 119 | DD4F7C1B13C30F9F00825C6E /* ApplicationDelegate.m */, 120 | 60368EA814FA10190092CF27 /* ScreenshotController.h */, 121 | 60368EA914FA10190092CF27 /* ScreenshotController.m */, 122 | ); 123 | name = Controllers; 124 | sourceTree = ""; 125 | }; 126 | DD4F7C2813C3123E00825C6E /* User Interface */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | DD4F7C4813C322D800825C6E /* Graphics */, 130 | DD4F7C2913C3124300825C6E /* XIBs */, 131 | ); 132 | name = "User Interface"; 133 | sourceTree = ""; 134 | }; 135 | DD4F7C2913C3124300825C6E /* XIBs */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | DD4F7C1D13C30F9F00825C6E /* MainMenu.xib */, 139 | ); 140 | name = XIBs; 141 | sourceTree = ""; 142 | }; 143 | DD4F7C3913C317EC00825C6E /* Views */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | DD4F7C3A13C3180800825C6E /* StatusItemView.h */, 147 | DD4F7C3B13C3180800825C6E /* StatusItemView.m */, 148 | ); 149 | name = Views; 150 | sourceTree = ""; 151 | }; 152 | DD4F7C4813C322D800825C6E /* Graphics */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | C9293B7416AE75DF00829127 /* Status_invert.png */, 156 | C9293B7516AE75DF00829127 /* Status_invert@2x.png */, 157 | C9293B7616AE75DF00829127 /* Status.png */, 158 | C9293B7716AE75DF00829127 /* Status@2x.png */, 159 | DD4F7C4A13C322FA00825C6E /* StatusHighlighted.png */, 160 | ); 161 | name = Graphics; 162 | sourceTree = ""; 163 | }; 164 | /* End PBXGroup section */ 165 | 166 | /* Begin PBXNativeTarget section */ 167 | DD4F7C0313C30F9F00825C6E /* imgur */ = { 168 | isa = PBXNativeTarget; 169 | buildConfigurationList = DD4F7C2213C30F9F00825C6E /* Build configuration list for PBXNativeTarget "imgur" */; 170 | buildPhases = ( 171 | DD4F7C0013C30F9F00825C6E /* Sources */, 172 | DD4F7C0113C30F9F00825C6E /* Frameworks */, 173 | DD4F7C0213C30F9F00825C6E /* Resources */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | ); 179 | name = imgur; 180 | productName = imgur; 181 | productReference = DD4F7C0413C30F9F00825C6E /* imgur.app */; 182 | productType = "com.apple.product-type.application"; 183 | }; 184 | /* End PBXNativeTarget section */ 185 | 186 | /* Begin PBXProject section */ 187 | DD4F7BFB13C30F9F00825C6E /* Project object */ = { 188 | isa = PBXProject; 189 | attributes = { 190 | LastUpgradeCheck = 0610; 191 | }; 192 | buildConfigurationList = DD4F7BFE13C30F9F00825C6E /* Build configuration list for PBXProject "imgur" */; 193 | compatibilityVersion = "Xcode 3.2"; 194 | developmentRegion = English; 195 | hasScannedForEncodings = 0; 196 | knownRegions = ( 197 | en, 198 | ); 199 | mainGroup = DD4F7BF913C30F9F00825C6E; 200 | productRefGroup = DD4F7C0513C30F9F00825C6E /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | DD4F7C0313C30F9F00825C6E /* imgur */, 205 | ); 206 | }; 207 | /* End PBXProject section */ 208 | 209 | /* Begin PBXResourcesBuildPhase section */ 210 | DD4F7C0213C30F9F00825C6E /* Resources */ = { 211 | isa = PBXResourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | DD4F7C1F13C30F9F00825C6E /* MainMenu.xib in Resources */, 215 | EAC001361A9220ED00B5EE40 /* Images.xcassets in Resources */, 216 | DD4F7C4C13C322FA00825C6E /* StatusHighlighted.png in Resources */, 217 | C9293B7816AE75DF00829127 /* Status_invert.png in Resources */, 218 | C9293B7916AE75DF00829127 /* Status_invert@2x.png in Resources */, 219 | C9293B7A16AE75DF00829127 /* Status.png in Resources */, 220 | C9293B7B16AE75DF00829127 /* Status@2x.png in Resources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXResourcesBuildPhase section */ 225 | 226 | /* Begin PBXSourcesBuildPhase section */ 227 | DD4F7C0013C30F9F00825C6E /* Sources */ = { 228 | isa = PBXSourcesBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | DD4F7C1513C30F9F00825C6E /* main.m in Sources */, 232 | DD4F7C1C13C30F9F00825C6E /* ApplicationDelegate.m in Sources */, 233 | DD4F7C3C13C3180800825C6E /* StatusItemView.m in Sources */, 234 | 60368EAA14FA10190092CF27 /* ScreenshotController.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | DD4F7C1D13C30F9F00825C6E /* MainMenu.xib */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | DD4F7C1E13C30F9F00825C6E /* en */, 245 | ); 246 | name = MainMenu.xib; 247 | path = imgur; 248 | sourceTree = ""; 249 | }; 250 | /* End PBXVariantGroup section */ 251 | 252 | /* Begin XCBuildConfiguration section */ 253 | DD4F7C2013C30F9F00825C6E /* Debug */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ALWAYS_SEARCH_USER_PATHS = NO; 257 | CLANG_WARN_BOOL_CONVERSION = YES; 258 | CLANG_WARN_CONSTANT_CONVERSION = YES; 259 | CLANG_WARN_EMPTY_BODY = YES; 260 | CLANG_WARN_ENUM_CONVERSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN_UNREACHABLE_CODE = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | COPY_PHASE_STRIP = NO; 265 | ENABLE_STRICT_OBJC_MSGSEND = YES; 266 | GCC_C_LANGUAGE_STANDARD = gnu99; 267 | GCC_DYNAMIC_NO_PIC = NO; 268 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 269 | GCC_OPTIMIZATION_LEVEL = 0; 270 | GCC_PREPROCESSOR_DEFINITIONS = ( 271 | "DEBUG=1", 272 | "$(inherited)", 273 | ); 274 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 275 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 276 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 277 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 278 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 279 | GCC_WARN_UNDECLARED_SELECTOR = YES; 280 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 281 | GCC_WARN_UNUSED_FUNCTION = YES; 282 | GCC_WARN_UNUSED_VARIABLE = YES; 283 | MACOSX_DEPLOYMENT_TARGET = 10.7; 284 | ONLY_ACTIVE_ARCH = YES; 285 | OTHER_LDFLAGS = ( 286 | "-lcrypto", 287 | "-lssl", 288 | ); 289 | SDKROOT = macosx; 290 | WRAPPER_EXTENSION = menu; 291 | }; 292 | name = Debug; 293 | }; 294 | DD4F7C2113C30F9F00825C6E /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ALWAYS_SEARCH_USER_PATHS = NO; 298 | CLANG_WARN_BOOL_CONVERSION = YES; 299 | CLANG_WARN_CONSTANT_CONVERSION = YES; 300 | CLANG_WARN_EMPTY_BODY = YES; 301 | CLANG_WARN_ENUM_CONVERSION = YES; 302 | CLANG_WARN_INT_CONVERSION = YES; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | COPY_PHASE_STRIP = YES; 306 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 307 | ENABLE_STRICT_OBJC_MSGSEND = YES; 308 | GCC_C_LANGUAGE_STANDARD = gnu99; 309 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 310 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 311 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 312 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 314 | GCC_WARN_UNDECLARED_SELECTOR = YES; 315 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 316 | GCC_WARN_UNUSED_FUNCTION = YES; 317 | GCC_WARN_UNUSED_VARIABLE = YES; 318 | MACOSX_DEPLOYMENT_TARGET = 10.7; 319 | ONLY_ACTIVE_ARCH = NO; 320 | OTHER_LDFLAGS = ( 321 | "-lcrypto", 322 | "-lssl", 323 | ); 324 | SDKROOT = macosx; 325 | WRAPPER_EXTENSION = menu; 326 | }; 327 | name = Release; 328 | }; 329 | DD4F7C2313C30F9F00825C6E /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | COMBINE_HIDPI_IMAGES = YES; 335 | FRAMEWORK_SEARCH_PATHS = ( 336 | "$(inherited)", 337 | "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", 338 | ); 339 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 340 | GCC_PREFIX_HEADER = "imgur/imgur-Prefix.pch"; 341 | INFOPLIST_FILE = "imgur/imgur-Info.plist"; 342 | MACOSX_DEPLOYMENT_TARGET = ""; 343 | PRODUCT_NAME = "$(TARGET_NAME)"; 344 | SDKROOT = macosx; 345 | WRAPPER_EXTENSION = app; 346 | }; 347 | name = Debug; 348 | }; 349 | DD4F7C2413C30F9F00825C6E /* Release */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 353 | CLANG_ENABLE_OBJC_ARC = YES; 354 | COMBINE_HIDPI_IMAGES = YES; 355 | FRAMEWORK_SEARCH_PATHS = ( 356 | "$(inherited)", 357 | "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", 358 | ); 359 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 360 | GCC_PREFIX_HEADER = "imgur/imgur-Prefix.pch"; 361 | INFOPLIST_FILE = "imgur/imgur-Info.plist"; 362 | MACOSX_DEPLOYMENT_TARGET = ""; 363 | ONLY_ACTIVE_ARCH = NO; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | SDKROOT = macosx; 366 | WRAPPER_EXTENSION = app; 367 | }; 368 | name = Release; 369 | }; 370 | /* End XCBuildConfiguration section */ 371 | 372 | /* Begin XCConfigurationList section */ 373 | DD4F7BFE13C30F9F00825C6E /* Build configuration list for PBXProject "imgur" */ = { 374 | isa = XCConfigurationList; 375 | buildConfigurations = ( 376 | DD4F7C2013C30F9F00825C6E /* Debug */, 377 | DD4F7C2113C30F9F00825C6E /* Release */, 378 | ); 379 | defaultConfigurationIsVisible = 0; 380 | defaultConfigurationName = Release; 381 | }; 382 | DD4F7C2213C30F9F00825C6E /* Build configuration list for PBXNativeTarget "imgur" */ = { 383 | isa = XCConfigurationList; 384 | buildConfigurations = ( 385 | DD4F7C2313C30F9F00825C6E /* Debug */, 386 | DD4F7C2413C30F9F00825C6E /* Release */, 387 | ); 388 | defaultConfigurationIsVisible = 0; 389 | defaultConfigurationName = Release; 390 | }; 391 | /* End XCConfigurationList section */ 392 | }; 393 | rootObject = DD4F7BFB13C30F9F00825C6E /* Project object */; 394 | } 395 | --------------------------------------------------------------------------------