This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' of github.com:facebook/three20 into develo…
…pment
- Loading branch information
Showing
45 changed files
with
3,662 additions
and
806 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
samples/Style/TTCSSStyleSheets/Classes/SampleCSSStyleSheet.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Copyright 2009-2011 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. | ||
// | ||
|
||
@interface SampleCSSStyleSheet : TTDefaultCSSStyleSheet {} | ||
@end |
36 changes: 36 additions & 0 deletions
36
samples/Style/TTCSSStyleSheets/Classes/SampleCSSStyleSheet.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// Copyright 2009-2011 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 "SampleCSSStyleSheet.h" | ||
|
||
@implementation SampleCSSStyleSheet | ||
|
||
- (TTStyle *)h3:(UIControlState)state { | ||
return | ||
[TTSolidFillStyle styleWithColor:TTCSSSTATE(@"h3", backgroundColor, state) next: | ||
[TTTextStyle styleWithCssSelector:@"h3" forState:state next: | ||
nil]]; | ||
} | ||
|
||
- (TTStyle *)h4:(UIControlState)state { | ||
return | ||
[TTSolidFillStyle styleWithColor:TTCSSSTATE(@"h4text", backgroundColor, state) next: | ||
[TTShadowStyle styleWithCssSelector:@"h4shadow" forState:state next: | ||
[TTTextStyle styleWithCssSelector:@"h4text" forState:state next: | ||
nil]]]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// Copyright 2009-2011 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. | ||
// | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// CSS Style helpers | ||
|
||
#define TTCSSSTYLESHEET ([[TTDefaultCSSStyleSheet globalCSSStyleSheet] styleSheet]) | ||
|
||
#define TTCSS_color(_SELECTOR, _STATE) \ | ||
([TTCSSSTYLESHEET colorWithCssSelector:_SELECTOR forState:_STATE]) | ||
|
||
#define TTCSS_backgroundColor(_SELECTOR, _STATE) \ | ||
([TTCSSSTYLESHEET backgroundColorWithCssSelector:_SELECTOR forState:_STATE]) | ||
|
||
#define TTCSS_font(_SELECTOR, _STATE) \ | ||
([TTCSSSTYLESHEET fontWithCssSelector:_SELECTOR forState:_STATE]) | ||
|
||
#define TTCSS_shadowColor(_SELECTOR, _STATE) \ | ||
([TTCSSSTYLESHEET textShadowColorWithCssSelector:_SELECTOR forState:_STATE]) | ||
|
||
#define TTCSS_shadowOffset(_SELECTOR, _STATE) \ | ||
([TTCSSSTYLESHEET textShadowOffsetWithCssSelector:_SELECTOR forState:_STATE]) | ||
|
||
#define TTCSS_shadowRadius(_SELECTOR, _STATE) \ | ||
([TTCSSSTYLESHEET textShadowRadiusWithCssSelector:_SELECTOR forState:_STATE]) | ||
|
||
// _VARNAME must be one of: color, backgroundColor, font, shadowColor, shadowOffset, shadowRadius | ||
#define TTCSSSTATE(_SELECTOR, _VARNAME, _STATE) \ | ||
TTCSS_##_VARNAME(_SELECTOR, _STATE) | ||
|
||
#define TTCSS(_SELECTOR, _VARNAME) \ | ||
TTCSSSTATE(_SELECTOR, _VARNAME, UIControlStateNormal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// Copyright 2009-2011 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/TTShadowStyle.h" | ||
|
||
@interface TTShadowStyle (TTCSSCategory) | ||
|
||
+ (TTShadowStyle*)styleWithCssSelector:(NSString*)selector | ||
forState:(UIControlState)state | ||
next:(TTStyle*)next; | ||
|
||
+ (TTShadowStyle*)styleWithCssSelector:(NSString*)selector | ||
next:(TTStyle*)next; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// Copyright 2009-2011 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/TTTextStyle.h" | ||
|
||
@interface TTTextStyle (TTCSSCategory) | ||
|
||
+ (TTTextStyle*)styleWithCssSelector:(NSString*)selector | ||
next:(TTStyle*)next; | ||
|
||
+ (TTTextStyle*)styleWithCssSelector:(NSString*)selector | ||
minimumFontSize:(CGFloat)minimumFontSize | ||
next:(TTStyle*)next; | ||
|
||
+ (TTTextStyle*)styleWithCssSelector:(NSString*)selector | ||
minimumFontSize:(CGFloat)minimumFontSize | ||
textAlignment:(UITextAlignment)textAlignment | ||
verticalAlignment:(UIControlContentVerticalAlignment)verticalAlignment | ||
lineBreakMode:(UILineBreakMode)lineBreakMode | ||
numberOfLines:(NSInteger)numberOfLines | ||
next:(TTStyle*)next; | ||
|
||
|
||
+ (TTTextStyle*)styleWithCssSelector:(NSString*)selector | ||
forState:(UIControlState)state | ||
next:(TTStyle*)next; | ||
|
||
+ (TTTextStyle*)styleWithCssSelector:(NSString*)selector | ||
forState:(UIControlState)state | ||
minimumFontSize:(CGFloat)minimumFontSize | ||
next:(TTStyle*)next; | ||
|
||
+ (TTTextStyle*)styleWithCssSelector:(NSString*)selector | ||
forState:(UIControlState)state | ||
minimumFontSize:(CGFloat)minimumFontSize | ||
textAlignment:(UITextAlignment)textAlignment | ||
verticalAlignment:(UIControlContentVerticalAlignment)verticalAlignment | ||
lineBreakMode:(UILineBreakMode)lineBreakMode | ||
numberOfLines:(NSInteger)numberOfLines | ||
next:(TTStyle*)next; | ||
|
||
@end |
Oops, something went wrong.