Source/GGBTextLayer.h
author Jens Alfke <jens@mooseyard.com>
Sun Mar 16 15:06:47 2008 -0700 (2008-03-16)
changeset 7 428a194e3e59
parent 1 3eb7be1dd7b6
child 8 45c82a071aca
permissions -rw-r--r--
Game class now tracks board state and moves, as strings, and can step through its history.
Fixed another bug in Go (you could drag your captured stones back to the board!)
     1 //
     2 //  GGBTextLayer.h
     3 //  GGB-iPhone
     4 //
     5 //  Created by Jens Alfke on 3/10/08.
     6 //  Copyright 2008 __MyCompanyName__. All rights reserved.
     7 //
     8 
     9 #import "GGBLayer.h"
    10 
    11 
    12 #if TARGET_OS_ASPEN
    13 @interface GGBTextLayer : GGBLayer
    14 {
    15     NSString *_string;
    16     UIFont *_font;
    17     CGColorRef _foregroundColor;
    18     NSString *_alignmentMode;
    19 }
    20 
    21 @property(copy) id string;
    22 @property (retain) UIFont *font;
    23 @property CGColorRef foregroundColor;
    24 @property (copy) NSString *alignmentMode;
    25 
    26 #else
    27 @interface GGBTextLayer : CATextLayer
    28 #endif
    29 
    30 + (GGBTextLayer*) textLayerInSuperlayer: (CALayer*)superlayer
    31                                withText: (NSString*)text
    32                                fontSize: (float) fontSize
    33                               alignment: (enum CAAutoresizingMask) align;
    34 + (GGBTextLayer*) textLayerInSuperlayer: (CALayer*)superlayer
    35                                withText: (NSString*)text
    36                                    font: (id)inputFont
    37                               alignment: (enum CAAutoresizingMask) align;
    38 
    39 @end
    40 
    41 
    42 #if TARGET_OS_ASPEN
    43 /* Bit definitions for `autoresizingMask' property. */
    44 
    45 enum CAAutoresizingMask
    46 {
    47     kCALayerNotSizable	= 0,
    48     kCALayerMinXMargin	= 1U << 0,
    49     kCALayerWidthSizable	= 1U << 1,
    50     kCALayerMaxXMargin	= 1U << 2,
    51     kCALayerMinYMargin	= 1U << 3,
    52     kCALayerHeightSizable	= 1U << 4,
    53     kCALayerMaxYMargin	= 1U << 5
    54 };
    55 
    56 enum
    57 {
    58     kCALayerBottomMargin = kCALayerMaxYMargin,
    59     kCALayerTopMargin    = kCALayerMinYMargin
    60 };
    61 
    62 #else
    63 enum
    64 {
    65     kCALayerBottomMargin = kCALayerMinYMargin,
    66     kCALayerTopMargin    = kCALayerMaxYMargin
    67 };
    68 #endif