bzr branch
/browse/iphone/common
| Line | Revision | Contents |
| 1 | 65 | #import <UIKit/UIKit.h> |
| 2 | #import <OpenGLES/ES1/gl.h> |
|
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | 84 | CGPathRef CGPathCreateWithRoundedRect(CGRect rect, CGFloat r); |
| 7 | ||
| 8 | ||
| 9 | @interface GLQuartzTexture : NSObject |
|
| 10 | 65 | { |
| 11 | GLuint texName; |
|
| 12 | CGSize textureSize; |
|
| 13 | |
|
| 14 | BOOL antialias, subpixelAA; |
|
| 15 | BOOL filterTexture, mipmapTexture; |
|
| 16 | ||
| 17 | double texturePadding; |
|
| 18 | |
|
| 19 | BOOL requiresUpdate; |
|
| 20 | } |
|
| 21 | ||
| 22 | ||
| 23 | - (void) drawWithBounds:(CGRect)bounds; |
|
| 24 | - (void) drawCenteredAtPoint:(CGPoint)point scaled: (double) scale; |
|
| 25 | - (void) drawAtPoint:(CGPoint)point scaled: (double) scale; |
|
| 26 | - (void) drawAtPoint:(CGPoint)point; |
|
| 27 | - (void) drawCenteredAtPoint:(CGPoint)point; |
|
| 28 | ||
| 29 | - (GLuint) texName; // 0 if no texture allocated |
|
| 30 | ||
| 31 | - (void) bindTexture; |
|
| 32 | - (void) genTexture; // generates the texture without drawing texture to current context |
|
| 33 | - (void) updateTextureIfRequired; |
|
| 34 | ||
| 35 | - (void) freeGLResources; |
|
| 36 | ||
| 37 | @property(nonatomic) BOOL antialias; |
|
| 38 | 83 | @property(nonatomic) BOOL subpixelAA; |
| 39 | @property(nonatomic) BOOL filterTexture; |
|
| 40 | @property(nonatomic) BOOL mipmapTexture; |
|
| 41 | @property(nonatomic) double texturePadding; |
|
| 42 | @property(readonly) CGSize textureSize; |
|
| 43 | 65 | @property(readonly) GLuint texName; |
| 44 | ||
| 45 | @end |
|
| 46 | ||
| 47 | ||
| 48 | @interface GLQuartzArc : GLQuartzTexture |
|
| 49 | { |
|
| 50 | UIColor* fillColor; |
|
| 51 | UIColor* borderColor; |
|
| 52 | double innerRadius, outerRadius; |
|
| 53 | double borderWidth; |
|
| 54 | double startAngle, endAngle; |
|
| 55 | double cornerRadius; |
|
| 56 | } |
|
| 57 | ||
| 58 | @property(retain, nonatomic) UIColor* fillColor; |
|
| 59 | 83 | @property(retain, nonatomic) UIColor* borderColor; |
| 60 | ||
| 61 | 65 | @property(nonatomic) double innerRadius; |
| 62 | 83 | @property(nonatomic) double outerRadius; |
| 63 | @property(nonatomic) double startAngle; |
|
| 64 | @property(nonatomic) double endAngle; |
|
| 65 | @property(nonatomic) double borderWidth; |
|
| 66 | @property(nonatomic) double cornerRadius; |
|
| 67 | ||
| 68 | 65 | @end |
| 69 | ||
| 70 | @interface GLQuartzBox : GLQuartzTexture |
|
| 71 | { |
|
| 72 | UIColor* boxColor; |
|
| 73 | UIColor* borderColor; |
|
| 74 | CGSize frameSize; |
|
| 75 | double cornerRadius; |
|
| 76 | double borderWidth; |
|
| 77 | } |
|
| 78 | ||
| 79 | @property(retain, nonatomic) UIColor* boxColor; |
|
| 80 | 83 | @property(retain, nonatomic) UIColor* borderColor; |
| 81 | ||
| 82 | 65 | @property(nonatomic) CGSize frameSize; |
| 83 | 83 | @property(nonatomic) double cornerRadius; |
| 84 | @property(nonatomic) double borderWidth; |
|
| 85 | ||
| 86 | 65 | @end |
| 87 | ||
| 88 | ||
| 89 | @interface GLString : GLQuartzBox |
|
| 90 | { |
|
| 91 | UIFont* font; |
|
| 92 | NSString* string; |
|
| 93 | UIColor* textColor; |
|
| 94 | BOOL staticFrame; |
|
| 95 | ||
| 96 | CGSize marginSize; |
|
| 97 | } |
|
| 98 | ||
| 99 | + (UIFont*) defaultFont; |
|
| 100 | ||
| 101 | // this API requires a current rendering context and all operations will be performed in regards to thar context |
|
| 102 | // the same context should be current for all method calls for a particular object instance |
|
| 103 | ||
| 104 | // designated initializer |
|
| 105 | - (id) initWithString:(NSString *)aString withFont:(UIFont*)theFont withTextColor:(UIColor *)color withBoxColor:(UIColor *)color withBorderColor:(UIColor *)color; |
|
| 106 | ||
| 107 | - (id) initWithString:(NSString *)astring; |
|
| 108 | 94 | |
| 109 | // basic methods that pick up defaults |
|
| 110 | 65 | - (id) initWithString:(NSString *)aString withFont:(UIFont *)aFont; |
| 111 | ||
| 112 | - (BOOL) staticFrame; // returns whether or not a static frame will be used |
|
| 113 | ||
| 114 | - (CGSize) marginSize; // current margins for text offset and pads for dynamic frame |
|
| 115 | ||
| 116 | // these will force the texture to be regenerated at the next draw |
|
| 117 | - (void) setMargins:(CGSize)size; // set offset size and size to fit with offset |
|
| 118 | - (void) useStaticFrame:(CGSize)size; // set static frame size and size to frame |
|
| 119 | - (void) useDynamicFrame; // set static frame size and size to frame |
|
| 120 | ||
| 121 | - (void) setString:(NSString *)theString; |
|
| 122 | - (void) setFont: (UIFont*) aFont; |
|
| 123 | ||
| 124 | @property(retain, nonatomic) UIColor* textColor; |
|
| 125 | 83 | |
| 126 | 65 | @end |
| 127 | ||
| 128 |
Loggerhead 1.17 is a web-based interface for Bazaar branches