Added new convenience methods for Game implementations.
5 // Created by Jens Alfke on 3/7/08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
11 #import <QuartzCore/QuartzCore.h>
13 #import <Quartz/Quartz.h>
17 extern NSString* const GGBLayerStyleChangedNotification;
20 @interface GGBLayer : CALayer <NSCopying>
22 CABasicAnimation *_curAnimation;
23 NSMutableDictionary *_styleDict;
25 #if ! TARGET_OS_IPHONE
28 // For some reason, the CALayer class on iPhone OS doesn't have these!
29 CGFloat _cornerRadius, _borderWidth;
30 CGColorRef _borderColor, _realBGColor;
31 unsigned int _autoresizingMask;
34 @property CGFloat cornerRadius, borderWidth;
35 @property CGColorRef borderColor;
38 - (void) redisplayAll;
40 - (void) animateAndBlock: (NSString*)keyPath from: (id)from to: (id)to duration: (NSTimeInterval)duration;
42 /** Change a property in this layer's 'style' dictionary (if it has one),
43 and update every other layer that shares the same style dictionary. */
44 - (void) setValue: (id)value ofStyleProperty: (NSString*)prop;
49 /** Moves a layer from one superlayer to another, without changing its position onscreen. */
50 void ChangeSuperlayer( CALayer *layer, CALayer *newSuperlayer, int index );
52 /** Removes a layer from its superlayer without any fade-out animation. */
53 void RemoveImmediately( CALayer *layer );
55 /** Disables animations until EndDisableAnimations is called. */
56 void BeginDisableAnimations(void);
57 void EndDisableAnimations(void);
59 CGColorRef GetEffectiveBackground( CALayer *layer );