Permalink
Browse files

fixing upstream merge conflict

  • Loading branch information...
2 parents a11eb48 + 2763201 commit 81aa6fd5d84929709c2206772d2c860a3565aede @Machx committed Nov 5, 2012
@@ -22,6 +22,8 @@
B85EE8EA163ECF4C00265870 /* NSView+RBLViewControllerAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B85EE8E8163ECF4C00265870 /* NSView+RBLViewControllerAdditions.m */; };
B85EE8ED163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = B85EE8EB163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.h */; };
B85EE8EE163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B85EE8EC163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.m */; };
+ AB61F6D41638370900DD5D2C /* NSApplication+RBLBlockAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = AB61F6D21638370900DD5D2C /* NSApplication+RBLBlockAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AB61F6D51638370900DD5D2C /* NSApplication+RBLBlockAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = AB61F6D31638370900DD5D2C /* NSApplication+RBLBlockAdditions.m */; };
D011FD5E16239A8600A27946 /* NSImage+RBLResizableImageAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = D011FD5C16239A8600A27946 /* NSImage+RBLResizableImageAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
D011FD5F16239A8600A27946 /* NSImage+RBLResizableImageAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = D011FD5D16239A8600A27946 /* NSImage+RBLResizableImageAdditions.m */; };
D01A4A28162C81EE0092D61F /* libExpecta.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D01A4A0C162C81CC0092D61F /* libExpecta.a */; };
@@ -147,6 +149,8 @@
B85EE8E8163ECF4C00265870 /* NSView+RBLViewControllerAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSView+RBLViewControllerAdditions.m"; sourceTree = "<group>"; };
B85EE8EB163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+RBObjectSizzlingAdditions.h"; sourceTree = "<group>"; };
B85EE8EC163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+RBObjectSizzlingAdditions.m"; sourceTree = "<group>"; };
+ AB61F6D21638370900DD5D2C /* NSApplication+RBLBlockAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSApplication+RBLBlockAdditions.h"; sourceTree = "<group>"; };
+ AB61F6D31638370900DD5D2C /* NSApplication+RBLBlockAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSApplication+RBLBlockAdditions.m"; sourceTree = "<group>"; };
D011FD5C16239A8600A27946 /* NSImage+RBLResizableImageAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+RBLResizableImageAdditions.h"; sourceTree = "<group>"; };
D011FD5D16239A8600A27946 /* NSImage+RBLResizableImageAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSImage+RBLResizableImageAdditions.m"; sourceTree = "<group>"; };
D0410EA915C61895003A3203 /* NSTextView+RBLAntialiasingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTextView+RBLAntialiasingAdditions.h"; sourceTree = "<group>"; };
@@ -292,6 +296,8 @@
B85EE8E8163ECF4C00265870 /* NSView+RBLViewControllerAdditions.m */,
B85EE8EB163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.h */,
B85EE8EC163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.m */,
+ AB61F6D21638370900DD5D2C /* NSApplication+RBLBlockAdditions.h */,
+ AB61F6D31638370900DD5D2C /* NSApplication+RBLBlockAdditions.m */,
);
name = Extensions;
sourceTree = "<group>";
@@ -477,6 +483,7 @@
B85EE8DE163ECA8C00265870 /* RBLViewController.h in Headers */,
B85EE8E9163ECF4C00265870 /* NSView+RBLViewControllerAdditions.h in Headers */,
B85EE8ED163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.h in Headers */,
+ AB61F6D41638370900DD5D2C /* NSApplication+RBLBlockAdditions.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -672,6 +679,7 @@
B85EE8DF163ECA8C00265870 /* RBLViewController.m in Sources */,
B85EE8EA163ECF4C00265870 /* NSView+RBLViewControllerAdditions.m in Sources */,
B85EE8EE163EE15800265870 /* NSObject+RBObjectSizzlingAdditions.m in Sources */,
+ AB61F6D51638370900DD5D2C /* NSApplication+RBLBlockAdditions.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -0,0 +1,18 @@
+//
+// NSApplication+RBLBlockAdditions.h
+// Rebel
+//
+// Created by Jonathan Willing on 10/24/12.
+// Copyright (c) 2012 GitHub. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+// Adds support for block handlers on a standard sheet.
+@interface NSApplication (RBLBlockAdditions)
+
+// Adds onto the standard `beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:`
+// with support for a block completion handler.
+- (void)rbl_beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)modalWindow completionHandler:(void (^)(NSInteger returnCode))handler;
+
+@end
@@ -0,0 +1,28 @@
+//
+// NSApplication+RBLBlockAdditions.m
+// Rebel
+//
+// Created by Jonathan Willing on 10/24/12.
+// Copyright (c) 2012 GitHub. All rights reserved.
+//
+
+#import "NSApplication+RBLBlockAdditions.h"
+#import <objc/runtime.h>
+
+static void *RBLNSApplicationSheetBlockAssociatedObjectKey = &RBLNSApplicationSheetBlockAssociatedObjectKey;
+
+@implementation NSApplication (RBLBlockAdditions)
+
+- (void)rbl_beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)modalWindow completionHandler:(void (^)(NSInteger returnCode))handler {
+ [self beginSheet:sheet modalForWindow:modalWindow modalDelegate:self didEndSelector:@selector(rbl_sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL];
+ objc_setAssociatedObject(sheet, RBLNSApplicationSheetBlockAssociatedObjectKey, handler, OBJC_ASSOCIATION_COPY_NONATOMIC);
+}
+
+- (void)rbl_sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
+ void (^handler)(NSInteger returnCode) = objc_getAssociatedObject(sheet, RBLNSApplicationSheetBlockAssociatedObjectKey);
+ [sheet orderOut:self];
+ handler(returnCode);
+ objc_setAssociatedObject(sheet, RBLNSApplicationSheetBlockAssociatedObjectKey, nil, OBJC_ASSOCIATION_COPY_NONATOMIC);
+}
+
+@end
@@ -13,9 +13,12 @@
// Useful to clear properties and bindings before reuse.
@interface RBLTableCellView : NSTableCellView
-// Called immediately before the cell view is going to be added
-// to a new table row view. At the time this is called, the cell
-// view will not have a superview.
+
+// Called when the cell view has either been removed from
+// its superview (the row view), or has just been created.
+//
+// Either way, the cell will not have a superview during this
+// time and will be in an enqueued state.
- (void)prepareForReuse;
@end
@@ -10,12 +10,12 @@
@implementation RBLTableCellView
-- (void)viewWillMoveToSuperview:(NSView *)newSuperview {
- [super viewWillMoveToSuperview:newSuperview];
-
- if (self.superview == nil && newSuperview != nil) {
+- (void)viewDidMoveToSuperview {
+ if (self.superview == nil) {
[self prepareForReuse];
}
+
+ [super viewDidMoveToSuperview];
}
- (void)prepareForReuse {
View
@@ -15,16 +15,24 @@
// The backing layer's background color, or nil if none has been set.
@property (nonatomic, strong) NSColor *backgroundColor;
+// Whether the view's content and subviews clip to its bounds.
+//
+// Setting this property is equivalent to setting maskToBounds on the backing
+// layer.
+//
+// Defaults to NO.
+@property (nonatomic, assign) BOOL clipsToBounds;
+
// Whether the view's drawing completely fills its bounds with opaque content.
//
// Defaults to NO.
-@property (nonatomic, getter = isOpaque) BOOL opaque;
+@property (nonatomic, assign, getter = isOpaque) BOOL opaque;
// Whether the view's drawing and layout uses a flipped (top-left origin)
// coordinate system.
//
// Defaults to NO.
-@property (nonatomic, getter = isFlipped) BOOL flipped;
+@property (nonatomic, assign, getter = isFlipped) BOOL flipped;
// Whether the graphics context for the view's drawing should be cleared to
// transparent black in RBLView's implementation of -drawRect:.
View
@@ -40,6 +40,14 @@ - (void)setBackgroundColor:(NSColor *)color {
self.layer.backgroundColor = color.rbl_CGColor;
}
+- (BOOL)clipsToBounds {
+ return self.layer.masksToBounds;
+}
+
+- (void)setClipsToBounds:(BOOL)value {
+ self.layer.masksToBounds = value;
+}
+
- (BOOL)isOpaque {
return self.layer.opaque;
}
View
@@ -6,6 +6,7 @@
// Copyright (c) 2012 GitHub. All rights reserved.
//
+#import <Rebel/NSApplication+RBLBlockAdditions.h>
#import <Rebel/NSColor+RBLCGColorAdditions.h>
#import <Rebel/NSImage+RBLResizableImageAdditions.h>
#import <Rebel/NSView+RBLAnimationAdditions.h>
@@ -15,3 +16,5 @@
#import <Rebel/CAAnimation+RBLBlockAdditions.h>
#import <Rebel/RBLPopover.h>
#import <Rebel/RBLViewController.h>
+#import <Rebel/RBLTableCellView.h>
+

0 comments on commit 81aa6fd

Please sign in to comment.