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