author | Jens Alfke <jens@mooseyard.com> |
Thu May 29 15:04:06 2008 -0700 (2008-05-29) | |
changeset 9 | a59acc683080 |
parent 8 | 45c82a071aca |
child 10 | 6c78cc6bd7a6 |
permissions | -rw-r--r-- |
jens@1 | 1 |
// |
jens@1 | 2 |
// GGBLayer.h |
jens@1 | 3 |
// GGB-iPhone |
jens@1 | 4 |
// |
jens@1 | 5 |
// Created by Jens Alfke on 3/7/08. |
jens@1 | 6 |
// Copyright 2008 __MyCompanyName__. All rights reserved. |
jens@1 | 7 |
// |
jens@1 | 8 |
|
jens@8 | 9 |
|
jens@8 | 10 |
#if TARGET_OS_IPHONE |
jens@1 | 11 |
#import <QuartzCore/QuartzCore.h> |
jens@1 | 12 |
#else |
jens@1 | 13 |
#import <Quartz/Quartz.h> |
jens@1 | 14 |
#endif |
jens@1 | 15 |
|
jens@1 | 16 |
|
jens@1 | 17 |
@interface GGBLayer : CALayer <NSCopying> |
jens@7 | 18 |
{ |
jens@7 | 19 |
CABasicAnimation *_curAnimation; |
jens@1 | 20 |
|
jens@8 | 21 |
#if ! TARGET_OS_IPHONE |
jens@7 | 22 |
} |
jens@7 | 23 |
#else |
jens@1 | 24 |
// For some reason, the CALayer class on iPhone OS doesn't have these! |
jens@1 | 25 |
CGFloat _cornerRadius, _borderWidth; |
jens@1 | 26 |
CGColorRef _borderColor, _realBGColor; |
jens@1 | 27 |
unsigned int _autoresizingMask; |
jens@1 | 28 |
} |
jens@7 | 29 |
|
jens@1 | 30 |
@property CGFloat cornerRadius, borderWidth; |
jens@1 | 31 |
@property CGColorRef borderColor; |
jens@1 | 32 |
#endif |
jens@1 | 33 |
|
jens@4 | 34 |
- (void) redisplayAll; |
jens@4 | 35 |
|
jens@7 | 36 |
- (void) animateAndBlock: (NSString*)keyPath from: (id)from to: (id)to duration: (NSTimeInterval)duration; |
jens@7 | 37 |
|
jens@1 | 38 |
@end |
jens@9 | 39 |
|
jens@9 | 40 |
|
jens@9 | 41 |
/** Moves a layer from one superlayer to another, without changing its position onscreen. */ |
jens@9 | 42 |
void ChangeSuperlayer( CALayer *layer, CALayer *newSuperlayer, int index ); |
jens@9 | 43 |
|
jens@9 | 44 |
/** Removes a layer from its superlayer without any fade-out animation. */ |
jens@9 | 45 |
void RemoveImmediately( CALayer *layer ); |
jens@9 | 46 |
|
jens@9 | 47 |
/** Disables animations until EndDisableAnimations is called. */ |
jens@9 | 48 |
void BeginDisableAnimations(void); |
jens@9 | 49 |
void EndDisableAnimations(void); |