Source/GGBTextLayer.h
author Jens Alfke <jens@mooseyard.com>
Thu Jul 31 20:01:26 2008 -0700 (2008-07-31)
changeset 24 db8640a38faf
parent 4 d781b00f3ed4
permissions -rw-r--r--
* Put the spots in the right place in 13x13 and 19x19 boards.
* Fixed some front/back layering issues in Grid.
     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_IPHONE
    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_IPHONE
    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