Skip to content

Commit

Permalink
renamed objc_exch to ct_objc_xch and fixed it to be static
Browse files Browse the repository at this point in the history
  • Loading branch information
rsms committed Dec 1, 2010
1 parent cf6a0d4 commit 15ef2b7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions src/CTBrowserFrameView.mm
Expand Up @@ -144,6 +144,16 @@ - (void)drawRect:(NSRect)rect {
yRadius:cornerRadius] addClip];
[[NSBezierPath bezierPathWithRect:rect] addClip];

// Draw a fancy gradient at the top of the window, like "Incognito mode"
/*
NSGradient* gradient = [[NSGradient alloc] initWithStartingColor:[NSColor yellowColor]
endingColor:[NSColor redColor]];
NSPoint startPoint = NSMakePoint(NSMinX(windowRect), NSMaxY(windowRect));
NSPoint endPoint = startPoint;
endPoint.y -= kBrowserFrameViewPaintHeight;
[gradient drawFromPoint:startPoint toPoint:endPoint options:0];
*/

// -- removed: themed window drawing routines --
}

Expand Down
4 changes: 2 additions & 2 deletions src/CTBrowserWindowController.mm
Expand Up @@ -12,8 +12,8 @@
#import "scoped_nsdisable_screen_updates.h"

@interface NSWindow (ThingsThatMightBeImplemented)
-(void)setShouldHideTitle:(BOOL)y;
-(void)setBottomCornerRounded:(BOOL)y;
- (void)setShouldHideTitle:(BOOL)y;
- (void)setBottomCornerRounded:(BOOL)y;
@end

@interface CTBrowserWindowController (Private)
Expand Down
2 changes: 1 addition & 1 deletion src/CTTabContents.mm
Expand Up @@ -13,7 +13,7 @@ @implementation CTTabContents
#define _synthRetain(T, setname, getname) \
- (T)getname { return getname##_; } \
- (void)set##setname :(T)v { \
objc_exch(&(getname##_), v); \
ct_objc_xch(&(getname##_), v); \
if (browser_) [browser_ updateTabStateForContent:self]; \
}
#define _synthAssign(T, setname, getname) \
Expand Down
4 changes: 2 additions & 2 deletions src/common.h
Expand Up @@ -100,8 +100,8 @@ const char *common_strrstr(const char *string, const char *find);
// utils
#ifdef __OBJC__
// exchange dst with src, retaining src and safely releasing old object.
// id old = objc_exch(&foo_, [NSColor redColor]);
inline id objc_exch(id *dst, id src) {
// id old = ct_objc_xch(&foo_, [NSColor redColor]);
static inline id ct_objc_xch(id *dst, id src) {
id old = *dst;
*dst = src;
if (old) [old release];
Expand Down

0 comments on commit 15ef2b7

Please sign in to comment.