mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Created a binary of Three20 to bundle with the discussion board example
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTBevelBorderStyle : TTStyle {
|
||||
UIColor* _highlight;
|
||||
UIColor* _shadow;
|
||||
CGFloat _width;
|
||||
NSInteger _lightSource;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* highlight;
|
||||
@property (nonatomic, retain) UIColor* shadow;
|
||||
@property (nonatomic) CGFloat width;
|
||||
@property (nonatomic) NSInteger lightSource;
|
||||
|
||||
+ (TTBevelBorderStyle*)styleWithColor:(UIColor*)color width:(CGFloat)width next:(TTStyle*)next;
|
||||
|
||||
+ (TTBevelBorderStyle*)styleWithHighlight:(UIColor*)highlight shadow:(UIColor*)shadow
|
||||
width:(CGFloat)width lightSource:(NSInteger)lightSource next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTBlendStyle : TTStyle {
|
||||
CGBlendMode _blendMode;
|
||||
}
|
||||
|
||||
@property (nonatomic) CGBlendMode blendMode;
|
||||
|
||||
+ (TTBlendStyle*)styleWithBlend:(CGBlendMode)blendMode next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
#import "Three20Style/TTPosition.h"
|
||||
|
||||
@interface TTBoxStyle : TTStyle {
|
||||
UIEdgeInsets _margin;
|
||||
UIEdgeInsets _padding;
|
||||
CGSize _minSize;
|
||||
TTPosition _position;
|
||||
}
|
||||
|
||||
@property (nonatomic) UIEdgeInsets margin;
|
||||
@property (nonatomic) UIEdgeInsets padding;
|
||||
@property (nonatomic) CGSize minSize;
|
||||
@property (nonatomic) TTPosition position;
|
||||
|
||||
+ (TTBoxStyle*)styleWithMargin:(UIEdgeInsets)margin next:(TTStyle*)next;
|
||||
+ (TTBoxStyle*)styleWithPadding:(UIEdgeInsets)padding next:(TTStyle*)next;
|
||||
+ (TTBoxStyle*)styleWithFloats:(TTPosition)position next:(TTStyle*)next;
|
||||
+ (TTBoxStyle*)styleWithMargin:(UIEdgeInsets)margin padding:(UIEdgeInsets)padding
|
||||
next:(TTStyle*)next;
|
||||
+ (TTBoxStyle*)styleWithMargin:(UIEdgeInsets)margin padding:(UIEdgeInsets)padding
|
||||
minSize:(CGSize)minSize position:(TTPosition)position next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTContentStyle : TTStyle
|
||||
|
||||
+ (TTContentStyle*)styleWithNext:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import "Three20Style/TTDefaultStyleSheet.h"
|
||||
|
||||
@interface TTDefaultStyleSheet (TTDragRefreshHeader)
|
||||
|
||||
@property (nonatomic, readonly) UIFont* tableRefreshHeaderLastUpdatedFont;
|
||||
@property (nonatomic, readonly) UIFont* tableRefreshHeaderStatusFont;
|
||||
@property (nonatomic, readonly) UIColor* tableRefreshHeaderBackgroundColor;
|
||||
@property (nonatomic, readonly) UIColor* tableRefreshHeaderTextColor;
|
||||
@property (nonatomic, readonly) UIColor* tableRefreshHeaderTextShadowColor;
|
||||
@property (nonatomic, readonly) CGSize tableRefreshHeaderTextShadowOffset;
|
||||
@property (nonatomic, readonly) UIImage* tableRefreshHeaderArrowImage;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyleSheet.h"
|
||||
|
||||
@class TTShape;
|
||||
|
||||
@interface TTDefaultStyleSheet : TTStyleSheet
|
||||
|
||||
// Common styles
|
||||
@property (nonatomic, readonly) UIColor* textColor;
|
||||
@property (nonatomic, readonly) UIColor* highlightedTextColor;
|
||||
@property (nonatomic, readonly) UIFont* font;
|
||||
@property (nonatomic, readonly) UIColor* backgroundColor;
|
||||
@property (nonatomic, readonly) UIColor* navigationBarTintColor;
|
||||
@property (nonatomic, readonly) UIColor* toolbarTintColor;
|
||||
@property (nonatomic, readonly) UIColor* searchBarTintColor;
|
||||
|
||||
// Tables
|
||||
@property (nonatomic, readonly) UIColor* tablePlainBackgroundColor;
|
||||
@property (nonatomic, readonly) UIColor* tableGroupedBackgroundColor;
|
||||
@property (nonatomic, readonly) UIColor* searchTableBackgroundColor;
|
||||
@property (nonatomic, readonly) UIColor* searchTableSeparatorColor;
|
||||
|
||||
// Table Headers
|
||||
@property (nonatomic, readonly) UIColor* tableHeaderTextColor;
|
||||
@property (nonatomic, readonly) UIColor* tableHeaderShadowColor;
|
||||
@property (nonatomic, readonly) CGSize tableHeaderShadowOffset;
|
||||
@property (nonatomic, readonly) UIColor* tableHeaderTintColor;
|
||||
|
||||
// Photo Captions
|
||||
@property (nonatomic, readonly) UIColor* photoCaptionTextColor;
|
||||
@property (nonatomic, readonly) UIColor* photoCaptionTextShadowColor;
|
||||
@property (nonatomic, readonly) CGSize photoCaptionTextShadowOffset;
|
||||
|
||||
@property (nonatomic, readonly) UIColor* timestampTextColor;
|
||||
@property (nonatomic, readonly) UIColor* linkTextColor;
|
||||
@property (nonatomic, readonly) UIColor* moreLinkTextColor;
|
||||
|
||||
@property (nonatomic, readonly) UIColor* screenBackgroundColor;
|
||||
|
||||
@property (nonatomic, readonly) UIColor* tableActivityTextColor;
|
||||
@property (nonatomic, readonly) UIColor* tableErrorTextColor;
|
||||
@property (nonatomic, readonly) UIColor* tableSubTextColor;
|
||||
@property (nonatomic, readonly) UIColor* tableTitleTextColor;
|
||||
|
||||
@property (nonatomic, readonly) UIColor* tabTintColor;
|
||||
@property (nonatomic, readonly) UIColor* tabBarTintColor;
|
||||
|
||||
@property (nonatomic, readonly) UIColor* messageFieldTextColor;
|
||||
@property (nonatomic, readonly) UIColor* messageFieldSeparatorColor;
|
||||
|
||||
@property (nonatomic, readonly) UIColor* thumbnailBackgroundColor;
|
||||
|
||||
@property (nonatomic, readonly) UIColor* postButtonColor;
|
||||
|
||||
@property (nonatomic, readonly) UIFont* buttonFont;
|
||||
@property (nonatomic, readonly) UIFont* tableFont;
|
||||
@property (nonatomic, readonly) UIFont* tableSmallFont;
|
||||
@property (nonatomic, readonly) UIFont* tableTitleFont;
|
||||
@property (nonatomic, readonly) UIFont* tableTimestampFont;
|
||||
@property (nonatomic, readonly) UIFont* tableButtonFont;
|
||||
@property (nonatomic, readonly) UIFont* tableSummaryFont;
|
||||
@property (nonatomic, readonly) UIFont* tableHeaderPlainFont;
|
||||
@property (nonatomic, readonly) UIFont* tableHeaderGroupedFont;
|
||||
@property (nonatomic, readonly) CGFloat tableBannerViewHeight;
|
||||
@property (nonatomic, readonly) UIFont* photoCaptionFont;
|
||||
@property (nonatomic, readonly) UIFont* messageFont;
|
||||
@property (nonatomic, readonly) UIFont* errorTitleFont;
|
||||
@property (nonatomic, readonly) UIFont* errorSubtitleFont;
|
||||
@property (nonatomic, readonly) UIFont* activityLabelFont;
|
||||
@property (nonatomic, readonly) UIFont* activityBannerFont;
|
||||
|
||||
@property (nonatomic, readonly) UITableViewCellSelectionStyle tableSelectionStyle;
|
||||
|
||||
- (TTStyle*)selectionFillStyle:(TTStyle*)next;
|
||||
|
||||
- (TTStyle*)toolbarButtonForState:(UIControlState)state shape:(TTShape*)shape
|
||||
tintColor:(UIColor*)tintColor font:(UIFont*)font;
|
||||
|
||||
- (TTStyle*)pageDotWithColor:(UIColor*)color;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTLayout.h"
|
||||
|
||||
@interface TTFlowLayout : TTLayout {
|
||||
CGFloat _padding;
|
||||
CGFloat _spacing;
|
||||
}
|
||||
|
||||
@property (nonatomic) CGFloat padding;
|
||||
@property (nonatomic) CGFloat spacing;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTFourBorderStyle : TTStyle {
|
||||
UIColor* _top;
|
||||
UIColor* _right;
|
||||
UIColor* _bottom;
|
||||
UIColor* _left;
|
||||
CGFloat _width;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* top;
|
||||
@property (nonatomic, retain) UIColor* right;
|
||||
@property (nonatomic, retain) UIColor* bottom;
|
||||
@property (nonatomic, retain) UIColor* left;
|
||||
@property (nonatomic) CGFloat width;
|
||||
|
||||
+ (TTFourBorderStyle*)styleWithTop:(UIColor*)top right:(UIColor*)right bottom:(UIColor*)bottom
|
||||
left:(UIColor*)left width:(CGFloat)width next:(TTStyle*)next;
|
||||
+ (TTFourBorderStyle*)styleWithTop:(UIColor*)top width:(CGFloat)width next:(TTStyle*)next;
|
||||
+ (TTFourBorderStyle*)styleWithRight:(UIColor*)right width:(CGFloat)width next:(TTStyle*)next;
|
||||
+ (TTFourBorderStyle*)styleWithBottom:(UIColor*)bottom width:(CGFloat)width next:(TTStyle*)next;
|
||||
+ (TTFourBorderStyle*)styleWithLeft:(UIColor*)left width:(CGFloat)width next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
/**
|
||||
* A constant denoting that a corner should be rounded.
|
||||
* @const -1
|
||||
*/
|
||||
extern const CGFloat ttkRounded;
|
||||
|
||||
/**
|
||||
* Deprecated macros for common constants.
|
||||
*/
|
||||
#define TT_ROUNDED ttkRounded
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Color helpers
|
||||
|
||||
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
|
||||
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 \
|
||||
alpha:(a)]
|
||||
|
||||
#define HSVCOLOR(h,s,v) [UIColor colorWithHue:(h) saturation:(s) value:(v) alpha:1]
|
||||
#define HSVACOLOR(h,s,v,a) [UIColor colorWithHue:(h) saturation:(s) value:(v) alpha:(a)]
|
||||
|
||||
#define RGBA(r,g,b,a) (r)/255.0, (g)/255.0, (b)/255.0, (a)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Style helpers
|
||||
|
||||
#define TTSTYLE(_SELECTOR) [[TTStyleSheet globalStyleSheet] styleWithSelector:@#_SELECTOR]
|
||||
|
||||
#define TTSTYLESTATE(_SELECTOR, _STATE) [[TTStyleSheet globalStyleSheet] \
|
||||
styleWithSelector:@#_SELECTOR forState:_STATE]
|
||||
|
||||
#define TTSTYLESHEET ((id)[TTStyleSheet globalStyleSheet])
|
||||
|
||||
#define TTSTYLEVAR(_VARNAME) [TTSTYLESHEET _VARNAME]
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTLayout.h"
|
||||
|
||||
@interface TTGridLayout : TTLayout {
|
||||
NSInteger _columnCount;
|
||||
CGFloat _padding;
|
||||
CGFloat _spacing;
|
||||
}
|
||||
|
||||
@property (nonatomic) NSInteger columnCount;
|
||||
@property (nonatomic) CGFloat padding;
|
||||
@property (nonatomic) CGFloat spacing;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTHighlightBorderStyle : TTStyle {
|
||||
UIColor* _color;
|
||||
UIColor* _highlightColor;
|
||||
CGFloat _width;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* color;
|
||||
@property (nonatomic, retain) UIColor* highlightColor;
|
||||
@property (nonatomic) CGFloat width;
|
||||
|
||||
+ (TTHighlightBorderStyle*)styleWithColor:(UIColor*)color highlightColor:(UIColor*)highlightColor
|
||||
width:(CGFloat)width next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTImageStyle : TTStyle {
|
||||
NSString* _imageURL;
|
||||
UIImage* _image;
|
||||
UIImage* _defaultImage;
|
||||
|
||||
CGSize _size;
|
||||
|
||||
UIViewContentMode _contentMode;
|
||||
}
|
||||
|
||||
@property (nonatomic, copy) NSString* imageURL;
|
||||
@property (nonatomic, retain) UIImage* image;
|
||||
@property (nonatomic, retain) UIImage* defaultImage;
|
||||
@property (nonatomic) CGSize size;
|
||||
|
||||
@property (nonatomic) UIViewContentMode contentMode;
|
||||
|
||||
+ (TTImageStyle*)styleWithImageURL:(NSString*)imageURL next:(TTStyle*)next;
|
||||
+ (TTImageStyle*)styleWithImageURL:(NSString*)imageURL defaultImage:(UIImage*)defaultImage
|
||||
next:(TTStyle*)next;
|
||||
+ (TTImageStyle*)styleWithImageURL:(NSString*)imageURL defaultImage:(UIImage*)defaultImage
|
||||
contentMode:(UIViewContentMode)contentMode
|
||||
size:(CGSize)size next:(TTStyle*)next;
|
||||
+ (TTImageStyle*)styleWithImage:(UIImage*)image next:(TTStyle*)next;
|
||||
+ (TTImageStyle*)styleWithImage:(UIImage*)image defaultImage:(UIImage*)defaultImage
|
||||
next:(TTStyle*)next;
|
||||
+ (TTImageStyle*)styleWithImage:(UIImage*)image defaultImage:(UIImage*)defaultImage
|
||||
contentMode:(UIViewContentMode)contentMode
|
||||
size:(CGSize)size next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTShadowStyle.h"
|
||||
|
||||
@interface TTInnerShadowStyle : TTShadowStyle
|
||||
@end
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTInsetStyle : TTStyle {
|
||||
UIEdgeInsets _inset;
|
||||
}
|
||||
|
||||
@property (nonatomic) UIEdgeInsets inset;
|
||||
|
||||
+ (TTInsetStyle*)styleWithInset:(UIEdgeInsets)inset next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface TTLayout : NSObject
|
||||
|
||||
- (CGSize)layoutSubviews:(NSArray*)subviews forView:(UIView*)view;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTLinearGradientBorderStyle : TTStyle {
|
||||
UIColor* _color1;
|
||||
UIColor* _color2;
|
||||
CGFloat _location1;
|
||||
CGFloat _location2;
|
||||
CGFloat _width;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* color1;
|
||||
@property (nonatomic, retain) UIColor* color2;
|
||||
@property (nonatomic) CGFloat location1;
|
||||
@property (nonatomic) CGFloat location2;
|
||||
@property (nonatomic) CGFloat width;
|
||||
|
||||
+ (TTLinearGradientBorderStyle*)styleWithColor1:(UIColor*)color1 color2:(UIColor*)color2
|
||||
width:(CGFloat)width next:(TTStyle*)next;
|
||||
+ (TTLinearGradientBorderStyle*)styleWithColor1:(UIColor*)color1 location1:(CGFloat)location1
|
||||
color2:(UIColor*)color2 location2:(CGFloat)location2
|
||||
width:(CGFloat)width next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTLinearGradientFillStyle : TTStyle {
|
||||
UIColor* _color1;
|
||||
UIColor* _color2;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* color1;
|
||||
@property (nonatomic, retain) UIColor* color2;
|
||||
|
||||
+ (TTLinearGradientFillStyle*)styleWithColor1:(UIColor*)color1 color2:(UIColor*)color2
|
||||
next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTMaskStyle : TTStyle {
|
||||
UIImage* _mask;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIImage* mask;
|
||||
|
||||
+ (TTMaskStyle*)styleWithMask:(UIImage*)mask next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@class TTStyleContext;
|
||||
|
||||
@interface TTPartStyle : TTStyle {
|
||||
NSString* _name;
|
||||
TTStyle* _style;
|
||||
}
|
||||
|
||||
@property (nonatomic, copy) NSString* name;
|
||||
@property (nonatomic, retain) TTStyle* style;
|
||||
|
||||
+ (TTPartStyle*)styleWithName:(NSString*)name style:(TTStyle*)style next:(TTStyle*)next;
|
||||
|
||||
- (void)drawPart:(TTStyleContext*)context;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
typedef enum {
|
||||
TTPositionStatic,
|
||||
TTPositionAbsolute,
|
||||
TTPositionFloatLeft,
|
||||
TTPositionFloatRight,
|
||||
} TTPosition;
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTShape.h"
|
||||
|
||||
@interface TTRectangleShape : TTShape
|
||||
|
||||
+ (TTRectangleShape*)shape;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTReflectiveFillStyle : TTStyle {
|
||||
UIColor* _color;
|
||||
BOOL _withBottomHighlight;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* color;
|
||||
@property (nonatomic, assign) BOOL withBottomHighlight;
|
||||
|
||||
+ (TTReflectiveFillStyle*)styleWithColor:(UIColor*)color next:(TTStyle*)next;
|
||||
+ (TTReflectiveFillStyle*)styleWithColor:(UIColor*)color
|
||||
withBottomHighlight:(BOOL)withBottomHighlight next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTShape.h"
|
||||
|
||||
@interface TTRoundedLeftArrowShape : TTShape {
|
||||
CGFloat _radius;
|
||||
}
|
||||
|
||||
@property (nonatomic) CGFloat radius;
|
||||
|
||||
+ (TTRoundedLeftArrowShape*)shapeWithRadius:(CGFloat)radius;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTShape.h"
|
||||
|
||||
@interface TTRoundedRectangleShape : TTShape {
|
||||
CGFloat _topLeftRadius;
|
||||
CGFloat _topRightRadius;
|
||||
CGFloat _bottomRightRadius;
|
||||
CGFloat _bottomLeftRadius;
|
||||
}
|
||||
|
||||
@property (nonatomic) CGFloat topLeftRadius;
|
||||
@property (nonatomic) CGFloat topRightRadius;
|
||||
@property (nonatomic) CGFloat bottomRightRadius;
|
||||
@property (nonatomic) CGFloat bottomLeftRadius;
|
||||
|
||||
+ (TTRoundedRectangleShape*)shapeWithRadius:(CGFloat)radius;
|
||||
|
||||
+ (TTRoundedRectangleShape*)shapeWithTopLeft:(CGFloat)topLeft topRight:(CGFloat)topRight
|
||||
bottomRight:(CGFloat)bottomRight bottomLeft:(CGFloat)bottomLeft;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTShape.h"
|
||||
|
||||
@interface TTRoundedRightArrowShape : TTShape {
|
||||
CGFloat _radius;
|
||||
}
|
||||
|
||||
@property (nonatomic) CGFloat radius;
|
||||
|
||||
+ (TTRoundedRightArrowShape*)shapeWithRadius:(CGFloat)radius;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTShadowStyle : TTStyle {
|
||||
UIColor* _color;
|
||||
CGFloat _blur;
|
||||
CGSize _offset;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* color;
|
||||
@property (nonatomic) CGFloat blur;
|
||||
@property (nonatomic) CGSize offset;
|
||||
|
||||
+ (TTShadowStyle*)styleWithColor:(UIColor*)color blur:(CGFloat)blur offset:(CGSize)offset
|
||||
next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface TTShape : NSObject
|
||||
|
||||
- (void)openPath:(CGRect)rect;
|
||||
- (void)closePath:(CGRect)rect;
|
||||
|
||||
- (void)addTopEdgeToPath:(CGRect)rect lightSource:(NSInteger)lightSource;
|
||||
- (void)addRightEdgeToPath:(CGRect)rect lightSource:(NSInteger)lightSource;
|
||||
- (void)addBottomEdgeToPath:(CGRect)rect lightSource:(NSInteger)lightSource;
|
||||
- (void)addLeftEdgeToPath:(CGRect)rect lightSource:(NSInteger)lightSource;
|
||||
|
||||
/**
|
||||
* Opens the path, adds all edges, and closes the path.
|
||||
*/
|
||||
- (void)addToPath:(CGRect)rect;
|
||||
|
||||
- (void)addInverseToPath:(CGRect)rect;
|
||||
|
||||
- (UIEdgeInsets)insetsForSize:(CGSize)size;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@class TTShape;
|
||||
|
||||
/**
|
||||
* Causes all layers going forward to use a particular shape.
|
||||
*/
|
||||
@interface TTShapeStyle : TTStyle {
|
||||
TTShape* _shape;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) TTShape* shape;
|
||||
|
||||
+ (TTShapeStyle*)styleWithShape:(TTShape*)shape next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTSolidBorderStyle : TTStyle {
|
||||
UIColor* _color;
|
||||
CGFloat _width;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* color;
|
||||
@property (nonatomic) CGFloat width;
|
||||
|
||||
+ (TTSolidBorderStyle*)styleWithColor:(UIColor*)color width:(CGFloat)width next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTSolidFillStyle : TTStyle {
|
||||
UIColor* _color;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIColor* color;
|
||||
|
||||
+ (TTSolidFillStyle*)styleWithColor:(UIColor*)color next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTShape.h"
|
||||
|
||||
@interface TTSpeechBubbleShape : TTShape {
|
||||
CGFloat _radius;
|
||||
CGFloat _pointLocation;
|
||||
CGFloat _pointAngle;
|
||||
CGSize _pointSize;
|
||||
}
|
||||
|
||||
@property (nonatomic) CGFloat radius;
|
||||
@property (nonatomic) CGFloat pointLocation;
|
||||
@property (nonatomic) CGFloat pointAngle;
|
||||
@property (nonatomic) CGSize pointSize;
|
||||
|
||||
+ (TTSpeechBubbleShape*)shapeWithRadius:(CGFloat)radius pointLocation:(CGFloat)pointLocation
|
||||
pointAngle:(CGFloat)pointAngle pointSize:(CGSize)pointSize;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class TTStyleContext;
|
||||
|
||||
@interface TTStyle : NSObject {
|
||||
TTStyle* _next;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) TTStyle* next;
|
||||
|
||||
- (id)initWithNext:(TTStyle*)next;
|
||||
|
||||
- (TTStyle*)next:(TTStyle*)next;
|
||||
|
||||
- (void)draw:(TTStyleContext*)context;
|
||||
|
||||
- (UIEdgeInsets)addToInsets:(UIEdgeInsets)insets forSize:(CGSize)size;
|
||||
- (CGSize)addToSize:(CGSize)size context:(TTStyleContext*)context;
|
||||
|
||||
- (void)addStyle:(TTStyle*)style;
|
||||
|
||||
- (id)firstStyleOfClass:(Class)cls;
|
||||
- (id)styleForPart:(NSString*)name;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class TTShape;
|
||||
@protocol TTStyleDelegate;
|
||||
|
||||
@interface TTStyleContext : NSObject {
|
||||
CGRect _frame;
|
||||
CGRect _contentFrame;
|
||||
|
||||
TTShape* _shape;
|
||||
|
||||
UIFont* _font;
|
||||
|
||||
BOOL _didDrawContent;
|
||||
|
||||
id<TTStyleDelegate> _delegate;
|
||||
}
|
||||
|
||||
@property (nonatomic) CGRect frame;
|
||||
@property (nonatomic) CGRect contentFrame;
|
||||
@property (nonatomic, retain) TTShape* shape;
|
||||
@property (nonatomic, retain) UIFont* font;
|
||||
@property (nonatomic) BOOL didDrawContent;
|
||||
|
||||
@property (nonatomic, assign) id<TTStyleDelegate> delegate;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class TTStyle;
|
||||
@class TTStyleContext;
|
||||
|
||||
@protocol TTStyleDelegate <NSObject>
|
||||
@optional
|
||||
|
||||
- (NSString*)textForLayerWithStyle:(TTStyle*)style;
|
||||
|
||||
- (UIImage*)imageForLayerWithStyle:(TTStyle*)style;
|
||||
|
||||
- (void)drawLayer:(TTStyleContext*)context withStyle:(TTStyle*)style;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class TTStyle;
|
||||
|
||||
@interface TTStyleSheet : NSObject {
|
||||
NSMutableDictionary* _styles;
|
||||
}
|
||||
|
||||
+ (TTStyleSheet*)globalStyleSheet;
|
||||
+ (void)setGlobalStyleSheet:(TTStyleSheet*)styleSheet;
|
||||
|
||||
- (TTStyle*)styleWithSelector:(NSString*)selector;
|
||||
- (TTStyle*)styleWithSelector:(NSString*)selector forState:(UIControlState)state;
|
||||
|
||||
- (void)freeMemory;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledElement.h"
|
||||
|
||||
@interface TTStyledBlock : TTStyledElement
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledInline.h"
|
||||
|
||||
@interface TTStyledBoldNode : TTStyledInline
|
||||
@end
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledFrame.h"
|
||||
#import "Three20Style/TTStyleDelegate.h"
|
||||
|
||||
@interface TTStyledBoxFrame : TTStyledFrame <TTStyleDelegate> {
|
||||
TTStyledBoxFrame* _parentFrame;
|
||||
TTStyledFrame* _firstChildFrame;
|
||||
TTStyle* _style;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) TTStyledBoxFrame* parentFrame;
|
||||
@property (nonatomic, retain) TTStyledFrame* firstChildFrame;
|
||||
|
||||
/**
|
||||
* The style used to render the frame;
|
||||
*/
|
||||
@property (nonatomic, retain) TTStyle* style;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledInlineBlock.h"
|
||||
|
||||
@interface TTStyledButtonNode : TTStyledInlineBlock {
|
||||
NSString* _URL;
|
||||
BOOL _highlighted;
|
||||
}
|
||||
|
||||
@property (nonatomic) BOOL highlighted;
|
||||
@property (nonatomic, retain) NSString* URL;
|
||||
|
||||
- (id)initWithURL:(NSString*)URL;
|
||||
- (id)initWithURL:(NSString*)URL next:(TTStyledNode*)nextSibling;
|
||||
|
||||
// Designated initializer
|
||||
- (id)initWithText:(NSString*)text URL:(NSString*)URL next:(TTStyledNode*)nextSibling;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledNode.h"
|
||||
|
||||
@interface TTStyledElement : TTStyledNode {
|
||||
TTStyledNode* _firstChild;
|
||||
TTStyledNode* _lastChild;
|
||||
NSString* _className;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) TTStyledNode* firstChild;
|
||||
@property (nonatomic, readonly) TTStyledNode* lastChild;
|
||||
@property (nonatomic, retain) NSString* className;
|
||||
|
||||
- (id)initWithText:(NSString*)text;
|
||||
|
||||
// Designated initializer
|
||||
- (id)initWithText:(NSString*)text next:(TTStyledNode*)nextSibling;
|
||||
|
||||
- (void)addChild:(TTStyledNode*)child;
|
||||
- (void)addText:(NSString*)text;
|
||||
- (void)replaceChild:(TTStyledNode*)oldChild withChild:(TTStyledNode*)newChild;
|
||||
|
||||
- (TTStyledNode*)getElementByClassName:(NSString*)className;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class TTStyledElement;
|
||||
@class TTStyledFrame;
|
||||
@class TTStyledBoxFrame;
|
||||
|
||||
@interface TTStyledFrame : NSObject {
|
||||
TTStyledElement* _element;
|
||||
TTStyledFrame* _nextFrame;
|
||||
CGRect _bounds;
|
||||
}
|
||||
|
||||
/**
|
||||
* The element that contains the frame.
|
||||
*/
|
||||
@property (nonatomic, readonly) TTStyledElement* element;
|
||||
|
||||
/**
|
||||
* The next in the linked list of frames.
|
||||
*/
|
||||
@property (nonatomic, retain) TTStyledFrame* nextFrame;
|
||||
|
||||
/**
|
||||
* The bounds of the content that is displayed by this frame.
|
||||
*/
|
||||
@property (nonatomic) CGRect bounds;
|
||||
|
||||
@property (nonatomic) CGFloat x;
|
||||
@property (nonatomic) CGFloat y;
|
||||
@property (nonatomic) CGFloat width;
|
||||
@property (nonatomic) CGFloat height;
|
||||
|
||||
- (UIFont*)font;
|
||||
|
||||
- (id)initWithElement:(TTStyledElement*)element;
|
||||
|
||||
/**
|
||||
* Draws the frame.
|
||||
*/
|
||||
- (void)drawInRect:(CGRect)rect;
|
||||
|
||||
- (TTStyledBoxFrame*)hitTest:(CGPoint)point;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledFrame.h"
|
||||
#import "Three20Style/TTStyleDelegate.h"
|
||||
|
||||
@class TTStyledImageNode;
|
||||
|
||||
@interface TTStyledImageFrame : TTStyledFrame <TTStyleDelegate> {
|
||||
TTStyledImageNode* _imageNode;
|
||||
TTStyle* _style;
|
||||
}
|
||||
|
||||
/**
|
||||
* The node represented by the frame.
|
||||
*/
|
||||
@property (nonatomic, readonly) TTStyledImageNode* imageNode;
|
||||
|
||||
/**
|
||||
* The style used to render the frame;
|
||||
*/
|
||||
@property (nonatomic, retain) TTStyle* style;
|
||||
|
||||
- (id)initWithElement:(TTStyledElement*)element node:(TTStyledImageNode*)node;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledElement.h"
|
||||
|
||||
@interface TTStyledImageNode : TTStyledElement {
|
||||
NSString* _URL;
|
||||
UIImage* _image;
|
||||
UIImage* _defaultImage;
|
||||
CGFloat _width;
|
||||
CGFloat _height;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSString* URL;
|
||||
@property (nonatomic, retain) UIImage* image;
|
||||
@property (nonatomic, retain) UIImage* defaultImage;
|
||||
@property (nonatomic) CGFloat width;
|
||||
@property (nonatomic) CGFloat height;
|
||||
|
||||
- (id)initWithURL:(NSString*)URL;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledElement.h"
|
||||
|
||||
@interface TTStyledInline : TTStyledElement
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledElement.h"
|
||||
|
||||
@interface TTStyledInlineBlock : TTStyledElement
|
||||
@end
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledBoxFrame.h"
|
||||
|
||||
@interface TTStyledInlineFrame : TTStyledBoxFrame {
|
||||
TTStyledInlineFrame* _inlinePreviousFrame;
|
||||
TTStyledInlineFrame* _inlineNextFrame;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) TTStyledInlineFrame* inlineParentFrame;
|
||||
@property (nonatomic, assign) TTStyledInlineFrame* inlinePreviousFrame;
|
||||
@property (nonatomic, assign) TTStyledInlineFrame* inlineNextFrame;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledInline.h"
|
||||
|
||||
@interface TTStyledItalicNode : TTStyledInline
|
||||
@end
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class TTStyle;
|
||||
@class TTStyledNode;
|
||||
@class TTStyledElement;
|
||||
@class TTStyledFrame;
|
||||
@class TTStyledBoxFrame;
|
||||
@class TTStyledInlineFrame;
|
||||
|
||||
@interface TTStyledLayout : NSObject {
|
||||
CGFloat _x;
|
||||
CGFloat _width;
|
||||
CGFloat _height;
|
||||
CGFloat _lineWidth;
|
||||
CGFloat _lineHeight;
|
||||
CGFloat _minX;
|
||||
CGFloat _floatLeftWidth;
|
||||
CGFloat _floatRightWidth;
|
||||
CGFloat _floatHeight;
|
||||
|
||||
TTStyledFrame* _rootFrame;
|
||||
TTStyledFrame* _lineFirstFrame;
|
||||
TTStyledInlineFrame* _inlineFrame;
|
||||
TTStyledBoxFrame* _topFrame;
|
||||
TTStyledFrame* _lastFrame;
|
||||
|
||||
UIFont* _font;
|
||||
UIFont* _boldFont;
|
||||
UIFont* _italicFont;
|
||||
|
||||
TTStyle* _linkStyle;
|
||||
TTStyledNode* _rootNode;
|
||||
TTStyledNode* _lastNode;
|
||||
|
||||
NSMutableArray* _invalidImages;
|
||||
}
|
||||
|
||||
@property (nonatomic) CGFloat width;
|
||||
@property (nonatomic) CGFloat height;
|
||||
@property (nonatomic, retain) UIFont* font;
|
||||
@property (nonatomic, readonly) TTStyledFrame* rootFrame;
|
||||
@property (nonatomic, retain) NSMutableArray* invalidImages;
|
||||
|
||||
- (id)initWithRootNode:(TTStyledNode*)rootNode;
|
||||
- (id)initWithX:(CGFloat)x width:(CGFloat)width height:(CGFloat)height;
|
||||
|
||||
- (void)layout:(TTStyledNode*)node;
|
||||
- (void)layout:(TTStyledNode*)node container:(TTStyledElement*)element;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledBlock.h"
|
||||
|
||||
@interface TTStyledLineBreakNode : TTStyledBlock
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledInline.h"
|
||||
|
||||
@interface TTStyledLinkNode : TTStyledInline {
|
||||
NSString* _URL;
|
||||
BOOL _highlighted;
|
||||
}
|
||||
|
||||
@property (nonatomic) BOOL highlighted;
|
||||
@property (nonatomic, retain) NSString* URL;
|
||||
|
||||
- (id)initWithURL:(NSString*)URL;
|
||||
- (id)initWithURL:(NSString*)URL next:(TTStyledNode*)nextSibling;
|
||||
|
||||
// Designated initializer
|
||||
- (id)initWithText:(NSString*)text URL:(NSString*)URL next:(TTStyledNode*)nextSibling;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface TTStyledNode : NSObject {
|
||||
TTStyledNode* _nextSibling;
|
||||
TTStyledNode* _parentNode;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) TTStyledNode* nextSibling;
|
||||
@property (nonatomic, assign) TTStyledNode* parentNode;
|
||||
@property (nonatomic, readonly) NSString* outerText;
|
||||
@property (nonatomic, readonly) NSString* outerHTML;
|
||||
|
||||
// Designated initializer
|
||||
- (id)initWithNextSibling:(TTStyledNode*)nextSibling;
|
||||
|
||||
- (id)ancestorOrSelfWithClass:(Class)cls;
|
||||
|
||||
- (void) performDefaultAction;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,140 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
// Network
|
||||
#import "Three20Network/TTURLRequestDelegate.h"
|
||||
|
||||
@protocol TTStyledTextDelegate;
|
||||
@class TTStyledNode;
|
||||
@class TTStyledFrame;
|
||||
@class TTStyledBoxFrame;
|
||||
|
||||
@interface TTStyledText : NSObject <TTURLRequestDelegate> {
|
||||
TTStyledNode* _rootNode;
|
||||
TTStyledFrame* _rootFrame;
|
||||
UIFont* _font;
|
||||
CGFloat _width;
|
||||
CGFloat _height;
|
||||
NSMutableArray* _invalidImages;
|
||||
NSMutableArray* _imageRequests;
|
||||
|
||||
id<TTStyledTextDelegate> _delegate;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) id<TTStyledTextDelegate> delegate;
|
||||
|
||||
/**
|
||||
* The first in the sequence of nodes that contain the styled text.
|
||||
*/
|
||||
@property (nonatomic, retain) TTStyledNode* rootNode;
|
||||
|
||||
/**
|
||||
* The first in the sequence of frames of text calculated by the layout.
|
||||
*/
|
||||
@property (nonatomic, readonly) TTStyledFrame* rootFrame;
|
||||
|
||||
/**
|
||||
* The font that will be used to measure and draw all text.
|
||||
*/
|
||||
@property (nonatomic, retain) UIFont* font;
|
||||
|
||||
/**
|
||||
* The width that the text should be constrained to fit within.
|
||||
*/
|
||||
@property (nonatomic) CGFloat width;
|
||||
|
||||
/**
|
||||
* The height of the text.
|
||||
*
|
||||
* The height is automatically calculated based on the width and the size of word-wrapped text.
|
||||
*/
|
||||
@property (nonatomic, readonly) CGFloat height;
|
||||
|
||||
/**
|
||||
* Indicates if the text needs layout to recalculate its size.
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL needsLayout;
|
||||
|
||||
/**
|
||||
* Images that require loading
|
||||
*/
|
||||
@property (nonatomic, readonly) NSMutableArray* invalidImages;
|
||||
|
||||
/**
|
||||
* Constructs styled text with XHTML tags turned into style nodes.
|
||||
*
|
||||
* Only the following XHTML tags are supported: b, i, img, a. The source must
|
||||
* be a well-formed XHTML fragment. You do not need to enclose the source in an tag --
|
||||
* it can be any string with XHTML tags throughout.
|
||||
*/
|
||||
+ (TTStyledText*)textFromXHTML:(NSString*)source;
|
||||
+ (TTStyledText*)textFromXHTML:(NSString*)source lineBreaks:(BOOL)lineBreaks URLs:(BOOL)URLs;
|
||||
|
||||
/**
|
||||
* Constructs styled text with all URLs transformed into links.
|
||||
*
|
||||
* Only URLs are parsed, not HTML markup. URLs are turned into links.
|
||||
*/
|
||||
+ (TTStyledText*)textWithURLs:(NSString*)source;
|
||||
+ (TTStyledText*)textWithURLs:(NSString*)source lineBreaks:(BOOL)lineBreaks;
|
||||
|
||||
- (id)initWithNode:(TTStyledNode*)rootNode;
|
||||
|
||||
- (void)layoutFrames;
|
||||
|
||||
- (void)layoutIfNeeded;
|
||||
|
||||
/**
|
||||
* Called to indicate that the layout needs to be re-calculated.
|
||||
*/
|
||||
- (void)setNeedsLayout;
|
||||
|
||||
/**
|
||||
* Draws the text at a point.
|
||||
*/
|
||||
- (void)drawAtPoint:(CGPoint)point;
|
||||
|
||||
/**
|
||||
* Draws the text at a point with optional highlighting.
|
||||
*
|
||||
* If highlighted is YES, text colors will be ignored and all text will be drawn in the same color.
|
||||
*/
|
||||
- (void)drawAtPoint:(CGPoint)point highlighted:(BOOL)highlighted;
|
||||
|
||||
/**
|
||||
* Determines which frame is intersected by a point.
|
||||
*/
|
||||
- (TTStyledBoxFrame*)hitTest:(CGPoint)point;
|
||||
|
||||
/**
|
||||
* Finds the frame that represents the node.
|
||||
*
|
||||
* If multiple frames represent a node, such as an inline frame with line breaks, the
|
||||
* first frame in the sequence will be returned.
|
||||
*/
|
||||
- (TTStyledFrame*)getFrameForNode:(TTStyledNode*)node;
|
||||
|
||||
- (void)addChild:(TTStyledNode*)child;
|
||||
|
||||
- (void)addText:(NSString*)text;
|
||||
|
||||
- (void)insertChild:(TTStyledNode*)child atIndex:(NSInteger)index;
|
||||
|
||||
- (TTStyledNode*)getElementByClassName:(NSString*)className;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class TTStyledText;
|
||||
|
||||
@protocol TTStyledTextDelegate <NSObject>
|
||||
@optional
|
||||
|
||||
- (void)styledTextNeedsDisplay:(TTStyledText*)text;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledFrame.h"
|
||||
|
||||
@class TTStyledTextNode;
|
||||
|
||||
@interface TTStyledTextFrame : TTStyledFrame {
|
||||
TTStyledTextNode* _node;
|
||||
NSString* _text;
|
||||
UIFont* _font;
|
||||
}
|
||||
|
||||
/**
|
||||
* The node represented by the frame.
|
||||
*/
|
||||
@property (nonatomic, readonly) TTStyledTextNode* node;
|
||||
|
||||
/**
|
||||
* The text that is displayed by this frame.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString* text;
|
||||
|
||||
/**
|
||||
* The font that is used to measure and display the text of this frame.
|
||||
*/
|
||||
@property (nonatomic, retain) UIFont* font;
|
||||
|
||||
- (id)initWithText:(NSString*)text element:(TTStyledElement*)element node:(TTStyledTextNode*)node;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledNode.h"
|
||||
|
||||
@interface TTStyledTextNode : TTStyledNode {
|
||||
NSString* _text;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSString* text;
|
||||
|
||||
- (id)initWithText:(NSString*)text;
|
||||
|
||||
// Designated initializer
|
||||
- (id)initWithText:(NSString*)text next:(TTStyledNode*)nextSibling;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class TTStyledNode;
|
||||
@class TTStyledElement;
|
||||
|
||||
#if __IPHONE_4_0 && __IPHONE_4_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED
|
||||
@interface TTStyledTextParser : NSObject <NSXMLParserDelegate> {
|
||||
#else
|
||||
@interface TTStyledTextParser : NSObject {
|
||||
#endif
|
||||
TTStyledNode* _rootNode;
|
||||
TTStyledElement* _topElement;
|
||||
TTStyledNode* _lastNode;
|
||||
|
||||
NSError* _parserError;
|
||||
|
||||
NSMutableString* _chars;
|
||||
NSMutableArray* _stack;
|
||||
|
||||
BOOL _parseLineBreaks;
|
||||
BOOL _parseURLs;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) TTStyledNode* rootNode;
|
||||
@property (nonatomic) BOOL parseLineBreaks;
|
||||
@property (nonatomic) BOOL parseURLs;
|
||||
|
||||
- (void)parseXHTML:(NSString*)html;
|
||||
- (void)parseText:(NSString*)string;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
@interface TTTextStyle : TTStyle {
|
||||
UIFont* _font;
|
||||
UIColor* _color;
|
||||
|
||||
UIColor* _shadowColor;
|
||||
CGSize _shadowOffset;
|
||||
|
||||
CGFloat _minimumFontSize;
|
||||
NSInteger _numberOfLines;
|
||||
|
||||
UITextAlignment _textAlignment;
|
||||
UIControlContentVerticalAlignment _verticalAlignment;
|
||||
|
||||
UILineBreakMode _lineBreakMode;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) UIFont* font;
|
||||
@property (nonatomic, retain) UIColor* color;
|
||||
|
||||
@property (nonatomic, retain) UIColor* shadowColor;
|
||||
@property (nonatomic) CGSize shadowOffset;
|
||||
|
||||
@property (nonatomic) CGFloat minimumFontSize;
|
||||
@property (nonatomic) NSInteger numberOfLines;
|
||||
|
||||
@property (nonatomic) UITextAlignment textAlignment;
|
||||
@property (nonatomic) UIControlContentVerticalAlignment verticalAlignment;
|
||||
|
||||
@property (nonatomic) UILineBreakMode lineBreakMode;
|
||||
|
||||
+ (TTTextStyle*)styleWithFont:(UIFont*)font next:(TTStyle*)next;
|
||||
+ (TTTextStyle*)styleWithColor:(UIColor*)color next:(TTStyle*)next;
|
||||
+ (TTTextStyle*)styleWithFont:(UIFont*)font color:(UIColor*)color next:(TTStyle*)next;
|
||||
+ (TTTextStyle*)styleWithFont:(UIFont*)font color:(UIColor*)color
|
||||
textAlignment:(UITextAlignment)textAlignment next:(TTStyle*)next;
|
||||
+ (TTTextStyle*)styleWithFont:(UIFont*)font color:(UIColor*)color
|
||||
shadowColor:(UIColor*)shadowColor shadowOffset:(CGSize)shadowOffset
|
||||
next:(TTStyle*)next;
|
||||
+ (TTTextStyle*)styleWithFont:(UIFont*)font color:(UIColor*)color
|
||||
minimumFontSize:(CGFloat)minimumFontSize
|
||||
shadowColor:(UIColor*)shadowColor shadowOffset:(CGSize)shadowOffset
|
||||
next:(TTStyle*)next;
|
||||
+ (TTTextStyle*)styleWithFont:(UIFont*)font color:(UIColor*)color
|
||||
minimumFontSize:(CGFloat)minimumFontSize
|
||||
shadowColor:(UIColor*)shadowColor shadowOffset:(CGSize)shadowOffset
|
||||
textAlignment:(UITextAlignment)textAlignment
|
||||
verticalAlignment:(UIControlContentVerticalAlignment)verticalAlignment
|
||||
lineBreakMode:(UILineBreakMode)lineBreakMode numberOfLines:(NSInteger)numberOfLines
|
||||
next:(TTStyle*)next;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/Three20Style.h"
|
||||
|
||||
// Additions
|
||||
#import "Three20Style/UIColorAdditions.h"
|
||||
#import "Three20Style/UIFontAdditions.h"
|
||||
#import "Three20Style/UIImageAdditions.h"
|
||||
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Core
|
||||
#import "Three20Core/Three20Core.h"
|
||||
|
||||
// Network
|
||||
#import "Three20Network/Three20Network.h"
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTGlobalStyle.h"
|
||||
#import "Three20Style/TTPosition.h"
|
||||
|
||||
#import "Three20Style/TTDefaultStyleSheet.h"
|
||||
#import "Three20Style/TTDefaultStyleSheet+DragRefreshHeader.h"
|
||||
#import "Three20Style/TTLayout.h"
|
||||
#import "Three20Style/TTFlowLayout.h"
|
||||
#import "Three20Style/TTGridLayout.h"
|
||||
|
||||
// Shapes
|
||||
#import "Three20Style/TTShape.h"
|
||||
#import "Three20Style/TTRectangleShape.h"
|
||||
#import "Three20Style/TTRoundedRectangleShape.h"
|
||||
#import "Three20Style/TTRoundedRightArrowShape.h"
|
||||
#import "Three20Style/TTRoundedLeftArrowShape.h"
|
||||
#import "Three20Style/TTSpeechBubbleShape.h"
|
||||
|
||||
// Styles
|
||||
#import "Three20Style/TTStyle.h"
|
||||
#import "Three20Style/TTStyleDelegate.h"
|
||||
#import "Three20Style/TTStyleContext.h"
|
||||
#import "Three20Style/TTContentStyle.h"
|
||||
#import "Three20Style/TTPartStyle.h"
|
||||
#import "Three20Style/TTShapeStyle.h"
|
||||
#import "Three20Style/TTInsetStyle.h"
|
||||
#import "Three20Style/TTBoxStyle.h"
|
||||
#import "Three20Style/TTTextStyle.h"
|
||||
#import "Three20Style/TTImageStyle.h"
|
||||
#import "Three20Style/TTMaskStyle.h"
|
||||
#import "Three20Style/TTBlendStyle.h"
|
||||
#import "Three20Style/TTSolidFillStyle.h"
|
||||
#import "Three20Style/TTLinearGradientFillStyle.h"
|
||||
#import "Three20Style/TTReflectiveFillStyle.h"
|
||||
#import "Three20Style/TTShadowStyle.h"
|
||||
#import "Three20Style/TTInnerShadowStyle.h"
|
||||
#import "Three20Style/TTSolidBorderStyle.h"
|
||||
#import "Three20Style/TTHighlightBorderStyle.h"
|
||||
#import "Three20Style/TTFourBorderStyle.h"
|
||||
#import "Three20Style/TTBevelBorderStyle.h"
|
||||
#import "Three20Style/TTLinearGradientBorderStyle.h"
|
||||
|
||||
#import "Three20Style/TTStyledText.h"
|
||||
#import "Three20Style/TTStyledTextDelegate.h"
|
||||
|
||||
// Styled nodes
|
||||
#import "Three20Style/TTStyledNode.h"
|
||||
#import "Three20Style/TTStyledTextNode.h"
|
||||
#import "Three20Style/TTStyledElement.h"
|
||||
#import "Three20Style/TTStyledBlock.h"
|
||||
#import "Three20Style/TTStyledInline.h"
|
||||
#import "Three20Style/TTStyledInlineBlock.h"
|
||||
#import "Three20Style/TTStyledBoldNode.h"
|
||||
#import "Three20Style/TTStyledItalicNode.h"
|
||||
#import "Three20Style/TTStyledLinkNode.h"
|
||||
#import "Three20Style/TTStyledButtonNode.h"
|
||||
#import "Three20Style/TTStyledImageNode.h"
|
||||
#import "Three20Style/TTStyledLineBreakNode.h"
|
||||
|
||||
// Styled frames
|
||||
#import "Three20Style/TTStyledFrame.h"
|
||||
#import "Three20Style/TTStyledBoxFrame.h"
|
||||
#import "Three20Style/TTStyledInlineFrame.h"
|
||||
#import "Three20Style/TTStyledTextFrame.h"
|
||||
#import "Three20Style/TTStyledImageFrame.h"
|
||||
|
||||
#import "Three20Style/TTStyledTextParser.h"
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIColor (TTCategory)
|
||||
|
||||
/**
|
||||
* Accepted ranges:
|
||||
* hue: 0.0 - 360.0
|
||||
* saturation: 0.0 - 1.0
|
||||
* value: 0.0 - 1.0
|
||||
* alpha: 0.0 - 1.0
|
||||
*/
|
||||
+ (UIColor*)colorWithHue:(CGFloat)h saturation:(CGFloat)s value:(CGFloat)v alpha:(CGFloat)a;
|
||||
|
||||
/**
|
||||
* Accepted ranges:
|
||||
* hue: 0.0 - 1.0
|
||||
* saturation: 0.0 - 1.0
|
||||
* value: 0.0 - 1.0
|
||||
*/
|
||||
- (UIColor*)multiplyHue:(CGFloat)hd saturation:(CGFloat)sd value:(CGFloat)vd;
|
||||
|
||||
- (UIColor*)addHue:(CGFloat)hd saturation:(CGFloat)sd value:(CGFloat)vd;
|
||||
|
||||
/**
|
||||
* Returns a new UIColor with the given alpha.
|
||||
*/
|
||||
- (UIColor*)copyWithAlpha:(CGFloat)newAlpha;
|
||||
|
||||
/**
|
||||
* Uses multiplyHue:saturation:value:alpha: to create a lighter version of the color.
|
||||
*/
|
||||
- (UIColor*)highlight;
|
||||
|
||||
/**
|
||||
* Uses multiplyHue:saturation:value:alpha: to create a darker version of the color.
|
||||
*/
|
||||
- (UIColor*)shadow;
|
||||
|
||||
- (CGFloat)hue;
|
||||
|
||||
- (CGFloat)saturation;
|
||||
|
||||
- (CGFloat)value;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIFont (TTCategory)
|
||||
|
||||
/**
|
||||
* Gets the height of a line of text with this font.
|
||||
*
|
||||
* Why this isn't part of UIFont is beyond me. This is the height you would expect to get
|
||||
* by calling sizeWithFont.
|
||||
*
|
||||
* App Store-safe method declaration.
|
||||
* Hurrah for broken static code analysis.
|
||||
*/
|
||||
- (CGFloat)ttLineHeight;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIImage (TTCategory)
|
||||
|
||||
/*
|
||||
* Resizes an image. Optionally rotates the image based on imageOrientation.
|
||||
*/
|
||||
- (UIImage*)transformWidth:(CGFloat)width height:(CGFloat)height rotate:(BOOL)rotate;
|
||||
|
||||
/**
|
||||
* Returns a CGRect positioned within rect given the contentMode.
|
||||
*/
|
||||
- (CGRect)convertRect:(CGRect)rect withContentMode:(UIViewContentMode)contentMode;
|
||||
|
||||
/**
|
||||
* Draws the image using content mode rules.
|
||||
*/
|
||||
- (void)drawInRect:(CGRect)rect contentMode:(UIViewContentMode)contentMode;
|
||||
|
||||
/**
|
||||
* Draws the image as a rounded rectangle.
|
||||
*/
|
||||
- (void)drawInRect:(CGRect)rect radius:(CGFloat)radius;
|
||||
- (void)drawInRect:(CGRect)rect radius:(CGFloat)radius contentMode:(UIViewContentMode)contentMode;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTGlobalStyle.h" // For TT_ROUNDED
|
||||
|
||||
extern const CGFloat kArrowPointWidth;
|
||||
extern const CGFloat kArrowRadius;
|
||||
|
||||
#define RD(_RADIUS) (_RADIUS == TT_ROUNDED ? round(fh/2) : _RADIUS)
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyle.h"
|
||||
|
||||
extern const NSInteger kDefaultLightSource;
|
||||
|
||||
@interface TTStyle (TTInternal)
|
||||
|
||||
- (CGGradientRef)newGradientWithColors:(UIColor**)colors locations:(CGFloat*)locations
|
||||
count:(int)count;
|
||||
|
||||
- (CGGradientRef)newGradientWithColors:(UIColor**)colors count:(int)count;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright 2009-2010 Facebook
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Style
|
||||
#import "Three20Style/TTStyledNode.h"
|
||||
|
||||
@interface TTStyledNode (TTInternal)
|
||||
|
||||
- (TTStyledNode*)findLastSibling:(TTStyledNode*)sibling;
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user