Skip to content

Commit

Permalink
first usable version with interactive preprocessing (editing image be…
Browse files Browse the repository at this point in the history
…fore sending it)
  • Loading branch information
rsms committed Jan 15, 2010
1 parent 84bd49a commit 9e46b2e
Show file tree
Hide file tree
Showing 23 changed files with 1,317 additions and 96 deletions.
Binary file added resources/BottomTB_ellipse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/BottomTB_fonts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/BottomTB_freeText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/BottomTB_inspector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/BottomTB_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/BottomTB_rectangle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
988 changes: 934 additions & 54 deletions resources/MainMenu.xib

Large diffs are not rendered by default.

Binary file added resources/bottom-tb-icons.psd
Binary file not shown.
Binary file added resources/checker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/checker.psd
Binary file not shown.
Binary file added resources/crop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/move.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/rect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/zoom-actual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/zoom-icons.psd
Binary file not shown.
Binary file added resources/zoom-to-fit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions scrup.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@
3A9D2A601061B083008923FD /* status-item-selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A9D2A5D1061B083008923FD /* status-item-selected.png */; };
3A9DE50C10999E35008F35E2 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A9DE50B10999E35008F35E2 /* CoreServices.framework */; };
3ABE5EAF10B588700085BAC3 /* HTTPPOSTOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3ABE5EAE10B588700085BAC3 /* HTTPPOSTOperation.m */; };
3ADC9B3210FF537F00EDEE39 /* DPCheckerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3ADC9B3110FF537F00EDEE39 /* DPCheckerView.m */; };
3ADC9B4310FF54A300EDEE39 /* checker.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9B4210FF54A300EDEE39 /* checker.png */; };
3ADC9BB510FF8EDB00EDEE39 /* zoom-actual.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9BB410FF8EDB00EDEE39 /* zoom-actual.png */; };
3ADC9BB710FF8F4600EDEE39 /* zoom-to-fit.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9BB610FF8F4600EDEE39 /* zoom-to-fit.png */; };
3ADC9BC010FF926200EDEE39 /* crop.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9BBF10FF926200EDEE39 /* crop.png */; };
3ADC9C5D10FFC04000EDEE39 /* move.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9C5C10FFC04000EDEE39 /* move.png */; };
3ADC9C6710FFC42200EDEE39 /* rect.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9C6610FFC42200EDEE39 /* rect.png */; };
3ADC9E0910FFECE200EDEE39 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3ADC9E0810FFECE200EDEE39 /* QuartzCore.framework */; };
3ADC9E7110FFF35F00EDEE39 /* BottomTB_ellipse.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9E6C10FFF35F00EDEE39 /* BottomTB_ellipse.png */; };
3ADC9E7210FFF35F00EDEE39 /* BottomTB_fonts.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9E6D10FFF35F00EDEE39 /* BottomTB_fonts.png */; };
3ADC9E7310FFF35F00EDEE39 /* BottomTB_freeText.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9E6E10FFF35F00EDEE39 /* BottomTB_freeText.png */; };
3ADC9E7410FFF35F00EDEE39 /* BottomTB_line.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9E6F10FFF35F00EDEE39 /* BottomTB_line.png */; };
3ADC9E7510FFF35F00EDEE39 /* BottomTB_rectangle.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9E7010FFF35F00EDEE39 /* BottomTB_rectangle.png */; };
3ADC9EB310FFFE2D00EDEE39 /* BottomTB_inspector.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADC9EB210FFFE2D00EDEE39 /* BottomTB_inspector.png */; };
3AE55FE010BC95A4006A7F94 /* zutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AE55FB310BC95A4006A7F94 /* zutil.h */; };
3AE55FE110BC95A4006A7F94 /* zutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 3AE55FB410BC95A4006A7F94 /* zutil.c */; };
3AE55FE210BC95A4006A7F94 /* zlibdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AE55FB510BC95A4006A7F94 /* zlibdefs.h */; };
Expand Down Expand Up @@ -183,6 +197,21 @@
3A9DE50B10999E35008F35E2 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
3ABE5EAD10B588700085BAC3 /* HTTPPOSTOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPPOSTOperation.h; path = src/HTTPPOSTOperation.h; sourceTree = "<group>"; };
3ABE5EAE10B588700085BAC3 /* HTTPPOSTOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPPOSTOperation.m; path = src/HTTPPOSTOperation.m; sourceTree = "<group>"; };
3ADC9B3010FF537F00EDEE39 /* DPCheckerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DPCheckerView.h; path = src/DPCheckerView.h; sourceTree = "<group>"; };
3ADC9B3110FF537F00EDEE39 /* DPCheckerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DPCheckerView.m; path = src/DPCheckerView.m; sourceTree = "<group>"; };
3ADC9B4210FF54A300EDEE39 /* checker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = checker.png; path = resources/checker.png; sourceTree = "<group>"; };
3ADC9BB410FF8EDB00EDEE39 /* zoom-actual.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "zoom-actual.png"; path = "resources/zoom-actual.png"; sourceTree = "<group>"; };
3ADC9BB610FF8F4600EDEE39 /* zoom-to-fit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "zoom-to-fit.png"; path = "resources/zoom-to-fit.png"; sourceTree = "<group>"; };
3ADC9BBF10FF926200EDEE39 /* crop.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = crop.png; path = resources/crop.png; sourceTree = "<group>"; };
3ADC9C5C10FFC04000EDEE39 /* move.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = move.png; path = resources/move.png; sourceTree = "<group>"; };
3ADC9C6610FFC42200EDEE39 /* rect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = rect.png; path = resources/rect.png; sourceTree = "<group>"; };
3ADC9E0810FFECE200EDEE39 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
3ADC9E6C10FFF35F00EDEE39 /* BottomTB_ellipse.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BottomTB_ellipse.png; path = resources/BottomTB_ellipse.png; sourceTree = "<group>"; };
3ADC9E6D10FFF35F00EDEE39 /* BottomTB_fonts.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BottomTB_fonts.png; path = resources/BottomTB_fonts.png; sourceTree = "<group>"; };
3ADC9E6E10FFF35F00EDEE39 /* BottomTB_freeText.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BottomTB_freeText.png; path = resources/BottomTB_freeText.png; sourceTree = "<group>"; };
3ADC9E6F10FFF35F00EDEE39 /* BottomTB_line.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BottomTB_line.png; path = resources/BottomTB_line.png; sourceTree = "<group>"; };
3ADC9E7010FFF35F00EDEE39 /* BottomTB_rectangle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BottomTB_rectangle.png; path = resources/BottomTB_rectangle.png; sourceTree = "<group>"; };
3ADC9EB210FFFE2D00EDEE39 /* BottomTB_inspector.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BottomTB_inspector.png; path = resources/BottomTB_inspector.png; sourceTree = "<group>"; };
3AE55FAB10BC9581006A7F94 /* libpngcrush.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libpngcrush.a; sourceTree = BUILT_PRODUCTS_DIR; };
3AE55FB310BC95A4006A7F94 /* zutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zutil.h; path = pngcrush/zutil.h; sourceTree = "<group>"; };
3AE55FB410BC95A4006A7F94 /* zutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zutil.c; path = pngcrush/zutil.c; sourceTree = "<group>"; };
Expand Down Expand Up @@ -256,6 +285,7 @@
3A9DE50C10999E35008F35E2 /* CoreServices.framework in Frameworks */,
3A1C752510BB0FF500BC6030 /* Security.framework in Frameworks */,
3A90678910FE9417009B6B2F /* Quartz.framework in Frameworks */,
3ADC9E0910FFECE200EDEE39 /* QuartzCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -300,6 +330,7 @@
29B97317FDCFA39411CA2CEA /* resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
3ADC9E0810FFECE200EDEE39 /* QuartzCore.framework */,
);
name = Dropub;
sourceTree = "<group>";
Expand All @@ -315,6 +346,8 @@
3A1504AD10618DDF00263983 /* DPAppDelegate.m */,
3A90685710FE9D29009B6B2F /* DPPreprocessingWindowController.h */,
3A90685810FE9D29009B6B2F /* DPPreprocessingWindowController.m */,
3ADC9B3010FF537F00EDEE39 /* DPCheckerView.h */,
3ADC9B3110FF537F00EDEE39 /* DPCheckerView.m */,
3ABE5EAD10B588700085BAC3 /* HTTPPOSTOperation.h */,
3ABE5EAE10B588700085BAC3 /* HTTPPOSTOperation.m */,
3A7AD02C10669AC600AF4940 /* mixins */,
Expand All @@ -332,6 +365,18 @@
3A1C750D10BB0F8400BC6030 /* MoveApplication.strings */,
3A919A8B106590CC002D0F4B /* dsa_pub.pem */,
3A9196291063D08A002D0F4B /* icon.icns */,
3ADC9E6C10FFF35F00EDEE39 /* BottomTB_ellipse.png */,
3ADC9E6D10FFF35F00EDEE39 /* BottomTB_fonts.png */,
3ADC9E6E10FFF35F00EDEE39 /* BottomTB_freeText.png */,
3ADC9E6F10FFF35F00EDEE39 /* BottomTB_line.png */,
3ADC9E7010FFF35F00EDEE39 /* BottomTB_rectangle.png */,
3ADC9EB210FFFE2D00EDEE39 /* BottomTB_inspector.png */,
3ADC9C5C10FFC04000EDEE39 /* move.png */,
3ADC9C6610FFC42200EDEE39 /* rect.png */,
3ADC9B4210FF54A300EDEE39 /* checker.png */,
3ADC9BBF10FF926200EDEE39 /* crop.png */,
3ADC9BB410FF8EDB00EDEE39 /* zoom-actual.png */,
3ADC9BB610FF8F4600EDEE39 /* zoom-to-fit.png */,
3AE5633C10BCCB21006A7F94 /* toolbar-processing.png */,
3A9D2A5B1061B083008923FD /* status-item-standby.png */,
3A199BA710BAF1E300E1F99C /* status-item-paused.png */,
Expand Down Expand Up @@ -553,6 +598,18 @@
3A1C751110BB0F8400BC6030 /* MoveApplication.strings in Resources */,
3A1C751210BB0F8400BC6030 /* MoveApplication.strings in Resources */,
3AE5633D10BCCB21006A7F94 /* toolbar-processing.png in Resources */,
3ADC9B4310FF54A300EDEE39 /* checker.png in Resources */,
3ADC9BB510FF8EDB00EDEE39 /* zoom-actual.png in Resources */,
3ADC9BB710FF8F4600EDEE39 /* zoom-to-fit.png in Resources */,
3ADC9BC010FF926200EDEE39 /* crop.png in Resources */,
3ADC9C5D10FFC04000EDEE39 /* move.png in Resources */,
3ADC9C6710FFC42200EDEE39 /* rect.png in Resources */,
3ADC9E7110FFF35F00EDEE39 /* BottomTB_ellipse.png in Resources */,
3ADC9E7210FFF35F00EDEE39 /* BottomTB_fonts.png in Resources */,
3ADC9E7310FFF35F00EDEE39 /* BottomTB_freeText.png in Resources */,
3ADC9E7410FFF35F00EDEE39 /* BottomTB_line.png in Resources */,
3ADC9E7510FFF35F00EDEE39 /* BottomTB_rectangle.png in Resources */,
3ADC9EB310FFFE2D00EDEE39 /* BottomTB_inspector.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -644,6 +701,7 @@
3AE5627110BCB36B006A7F94 /* ASLLogger.m in Sources */,
3AF2B0C810FE90610052B40E /* MAAttachedWindow.m in Sources */,
3A90685910FE9D29009B6B2F /* DPPreprocessingWindowController.m in Sources */,
3ADC9B3210FF537F00EDEE39 /* DPCheckerView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
12 changes: 12 additions & 0 deletions src/DPAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@
MAAttachedWindow *preprocessingWindow;
IBOutlet NSView *preprocessingUIView;
IBOutlet DPPreprocessingWindowController *preprocessingWindowController;
NSMutableArray *preprocessingUIBlockQueue;
}

// UI bindings
@property(assign) BOOL openAtLogin, showInDock, showInMenuBar,
showQueueCountInMenuBar, paused, convertImagesTosRGB, enablePngcrush,
trashAfterSuccessfulUpload, enablePreprocessingUI;

@property(readonly) BOOL preprocessingWindowIsActive;

-(void)checkForScreenshotsAtPath:(NSString *)dirpath;
-(NSDictionary *)screenshotsAtPath:(NSString *)dirpath modifiedAfterDate:(NSDate *)lmod;
-(NSDictionary *)screenshotsOnDesktop;
Expand Down Expand Up @@ -98,4 +102,12 @@
-(void)writeThumbnailForScreenshotAtPath:(NSString *)path;
-(BOOL)pngcrushPNGImageAtPath:(NSString *)path brute:(BOOL)brute;

#pragma mark -
#pragma mark Preprocessing UI

- (void)enqueueDisplayOfPreprocessingUIForScreenshotAtPath:(NSString *)path
meta:(NSMutableDictionary *)meta
commitBlock:(void(^)(NSString *path))commitBlock
cancelBlock:(void(^)(void))cancelBlock;
@end

124 changes: 90 additions & 34 deletions src/DPAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ - (id)init {
postProcessShellCommand = @"say scrupped at $(date +%X) &";
preprocessingWindow = nil;
preprocessingWindowController = nil;
preprocessingUIBlockQueue = [NSMutableArray array];

// set boolean properties from user defaults or give them default values
#define SETDEFBOOL(_member_, _defval_) \
Expand Down Expand Up @@ -171,6 +172,11 @@ - (NSRect)menuItemFrame {
}


- (BOOL)preprocessingWindowIsActive {
return preprocessingWindow && [preprocessingWindow isVisible];
}


- (void)togglePreprocessingWindow {
if (!preprocessingWindow) {
NSRect wr = [self menuItemFrame];
Expand All @@ -180,57 +186,105 @@ - (void)togglePreprocessingWindow {
preprocessingWindow = [[MAAttachedWindow alloc] initWithView:preprocessingUIView
attachedToPoint:pt
inWindow:nil
onSide:MAPositionBottom
atDistance:5.0];
onSide:MAPositionBottomLeft
atDistance:0.0];
[preprocessingWindowController setWindow:preprocessingWindow];
[preprocessingWindow setDelegate:preprocessingWindowController];
[preprocessingWindow setDrawsRoundCornerBesideArrow:NO];
[preprocessingWindow setBackgroundColor:[NSColor colorWithDeviceWhite:0.8 alpha:1.0]];
[preprocessingWindow setBorderColor:[NSColor colorWithDeviceWhite:0.87 alpha:1.0]];
[preprocessingWindow setBorderWidth:1.0];
[preprocessingWindow makeKeyAndOrderFront:self];

if (statusItem) {
[statusItem setMenu:nil];
[statusItem setTarget:self];
[statusItem setAction:@selector(activateApp)];
}
}
else {
[preprocessingWindow orderOut:self];
[preprocessingWindow release];
preprocessingWindow = nil;

if (statusItem) {
[statusItem setAction:nil];
[statusItem setTarget:nil];
[statusItem setMenu:statusItemMenu];
}
}
/*Reuse:
else if (![preprocessingWindow isVisible]) {
[preprocessingWindow makeKeyAndOrderFront:self];
}
else {
[preprocessingWindow orderOut:self];
}*/
}


- (void)displayPreprocessingUIForScreenshotAtPath:(NSString *)path
meta:(NSMutableDictionary *)meta
confirmBlock:(void(^)(NSString *path))confirmBlock
- (void)activateApp {
if (![NSApp isActive])
[NSApp activateIgnoringOtherApps:YES];
}


- (void)enqueueDisplayOfPreprocessingUIForScreenshotAtPath:(NSString *)path
meta:(NSMutableDictionary *)meta
commitBlock:(void(^)(NSString *path))commitBlock
cancelBlock:(void(^)(void))cancelBlock
{
[log debug:@"displaying preprocessing window for %@", path];
[log debug:@"enqueing/displaying preprocessing UI for %@", path];

if (confirmBlock)
confirmBlock = [confirmBlock copy];
if (commitBlock) commitBlock = [commitBlock copy];
if (cancelBlock) cancelBlock = [cancelBlock copy];

BOOL appWasActive = [NSApp isActive];

void(^_commonDoneBlock)(void) = [^{
if (!appWasActive)
[NSApp deactivate]; // todo: look at QuickCursor (or similar) and use AX* if enabled to re-activate previously active app & window
void(^_block)(void) = ^{
BOOL appWasActive = [NSApp isActive];

// todo: look at QuickCursor (or similar) and use AX* if enabled to re-activate
// previously active app & window

#define DONE_ROUTINE \
if (!appWasActive) [NSApp deactivate]; \
[self togglePreprocessingWindow];\
[self performSelectorOnMainThread:@selector(dequeueDisplayOfPreprocessingUI) withObject:nil waitUntilDone:NO];

[preprocessingWindowController editScreenshotAtPath:path meta:meta commitBlock:^(NSString *_path){
DONE_ROUTINE
if (commitBlock)
commitBlock(_path);
} cancelBlock:^{
DONE_ROUTINE
if (cancelBlock)
cancelBlock();
}];

#undef DONE_ROUTINE

[self togglePreprocessingWindow];
} copy];

if (!appWasActive)
[NSApp activateIgnoringOtherApps:YES];
};

[preprocessingWindowController editScreenshotAtPath:path meta:meta commitBlock:^(NSString *_path){
_commonDoneBlock();
if (confirmBlock)
confirmBlock(_path);
} cancelBlock:^{
_commonDoneBlock();
[log debug:@"cancel block called"];
}];
if (!appWasActive)
[NSApp activateIgnoringOtherApps:YES];
[self togglePreprocessingWindow];
// enqueue or run now?
if (self.preprocessingWindowIsActive) {
// enqueue
[preprocessingUIBlockQueue addObject:[_block copy]];
}
else {
_block();
}
}


- (void(^)(void))dequeueDisplayOfPreprocessingUI {
if (preprocessingUIBlockQueue && [preprocessingUIBlockQueue count]) {
void(^nextBlock)(void) = [preprocessingUIBlockQueue objectAtIndex:0];
[preprocessingUIBlockQueue removeObjectAtIndex:0];
[log info:@"invoking next preprocessing UI"];
nextBlock();
}
else {
[log debug:@"no more preprocessing UIs to invoke"];
}
}


#if DEBUG
-(void)debugPerpetualStateCheck {
ASLLogger *tlog;
Expand Down Expand Up @@ -454,8 +508,10 @@ -(void)processScreenshotAtPath:(NSString *)path modifiedAtDate:(NSDate *)dateMod

// UI-based preprocessing?
if (self.enablePreprocessingUI) {
// todo: impl
[self displayPreprocessingUIForScreenshotAtPath:path meta:rec confirmBlock:continue_block];
[self enqueueDisplayOfPreprocessingUIForScreenshotAtPath:path
meta:rec
commitBlock:continue_block
cancelBlock:nil];
}
else {
continue_block(path);
Expand Down
4 changes: 4 additions & 0 deletions src/DPCheckerView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@interface DPCheckerView : NSView {
}

@end
15 changes: 15 additions & 0 deletions src/DPCheckerView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#import "DPCheckerView.h"

@implementation DPCheckerView

- (void)drawRect:(NSRect)dirtyRect {
NSColor *color1, *color2;
NSRect r = [self bounds];
color1 = [NSColor colorWithPatternImage:[NSImage imageNamed:@"checker"]];

[color1 set];

NSRectFill(dirtyRect);
}

@end
19 changes: 17 additions & 2 deletions src/DPPreprocessingWindowController.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "DPImageView.h"
#import <Quartz/Quartz.h>

@class DPAppDelegate;
Expand All @@ -6,16 +7,30 @@
IBOutlet DPAppDelegate *appDelegate;
IBOutlet NSTextField *filenameTextField;
IBOutlet IKImageView *imageView;
IBOutlet NSButton *commitActionButton; // crop, etc
IBOutlet NSSegmentedControl *toolbarSegmentedControl;

NSString *screenshotPath;
NSMutableDictionary *screenshotMeta;

void (^commitBlock)(NSString *path);
void (^cancelBlock)(void);

NSDictionary *imageProperties;
NSString *imageUTType;
}

- (IBAction)performCancel:(id)sender;
- (IBAction)performCommit:(id)sender;
- (void)openImageAtURL:(NSURL*)url;

- (IBAction)performCancel:(id)sender; // OK button
- (IBAction)performCommit:(id)sender; // Cancel button

- (IBAction)switchToolMode:(id)sender;
- (IBAction)toggleIKInspector:(id)sender;

- (IBAction)crop:(id)sender;
- (IBAction)zoomIn:(id)sender;
- (IBAction)zoomOut:(id)sender;

- (void)editScreenshotAtPath:(NSString *)path
meta:(NSMutableDictionary *)meta
Expand Down
Loading

0 comments on commit 9e46b2e

Please sign in to comment.