jens@1: // jens@1: // GGBTextLayer.h jens@1: // GGB-iPhone jens@1: // jens@1: // Created by Jens Alfke on 3/10/08. jens@1: // Copyright 2008 __MyCompanyName__. All rights reserved. jens@1: // jens@1: jens@1: #import "GGBLayer.h" jens@1: jens@1: jens@1: #if TARGET_OS_ASPEN jens@1: @interface GGBTextLayer : GGBLayer jens@1: { jens@1: NSString *_string; jens@4: UIFont *_font; jens@1: CGColorRef _foregroundColor; jens@1: NSString *_alignmentMode; jens@1: } jens@1: jens@1: @property(copy) id string; jens@4: @property (retain) UIFont *font; jens@1: @property CGColorRef foregroundColor; jens@1: @property (copy) NSString *alignmentMode; jens@1: jens@1: #else jens@1: @interface GGBTextLayer : CATextLayer jens@1: #endif jens@1: jens@1: + (GGBTextLayer*) textLayerInSuperlayer: (CALayer*)superlayer jens@1: withText: (NSString*)text jens@1: fontSize: (float) fontSize jens@1: alignment: (enum CAAutoresizingMask) align; jens@4: + (GGBTextLayer*) textLayerInSuperlayer: (CALayer*)superlayer jens@4: withText: (NSString*)text jens@4: font: (id)inputFont jens@4: alignment: (enum CAAutoresizingMask) align; jens@1: jens@1: @end jens@1: jens@1: jens@4: #if TARGET_OS_ASPEN jens@4: /* Bit definitions for `autoresizingMask' property. */ jens@4: jens@4: enum CAAutoresizingMask jens@4: { jens@4: kCALayerNotSizable = 0, jens@4: kCALayerMinXMargin = 1U << 0, jens@4: kCALayerWidthSizable = 1U << 1, jens@4: kCALayerMaxXMargin = 1U << 2, jens@4: kCALayerMinYMargin = 1U << 3, jens@4: kCALayerHeightSizable = 1U << 4, jens@4: kCALayerMaxYMargin = 1U << 5 jens@4: }; jens@4: jens@4: enum jens@4: { jens@4: kCALayerBottomMargin = kCALayerMaxYMargin, jens@4: kCALayerTopMargin = kCALayerMinYMargin jens@4: }; jens@4: jens@4: #else jens@4: enum jens@4: { jens@4: kCALayerBottomMargin = kCALayerMinYMargin, jens@4: kCALayerTopMargin = kCALayerMaxYMargin jens@4: }; jens@4: #endif