Skip to content

Commit

Permalink
Merge pull request GeekZooStudio#2 from libertyBoy/master
Browse files Browse the repository at this point in the history
兼容arm64
  • Loading branch information
GeekZooStudio committed Jan 3, 2015
2 parents 61fcd6a + 6d10c50 commit c84e374
Show file tree
Hide file tree
Showing 36 changed files with 4,432 additions and 3,759 deletions.
8 changes: 4 additions & 4 deletions iOS/framework/mvc/model/Bee_Model.mm
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ + (id)model
+ (id)modelWithObserver:(id)observer
{
BeeModel * model = nil;

if ( [self respondsToSelector:@selector(sharedInstance)] )
{
model = (BeeModel *)[[self class] sharedInstance];
}

if ( nil == model || NO == [model isKindOfClass:[BeeModel class]] )
{
model = [[[[self class] alloc] init] autorelease];
Expand All @@ -121,7 +121,7 @@ + (id)modelWithObserver:(id)observer
{
[model addObserver:observer];
}

return model;
}

Expand All @@ -134,7 +134,7 @@ + (NSMutableArray *)modelsByClass:(Class)clazz
{
if ( 0 == __models.count )
return nil;

NSMutableArray * array = [NSMutableArray array];

for ( BeeModel * model in __models )
Expand Down
52 changes: 41 additions & 11 deletions iOS/framework/mvc/view/css/extension/UIImageView+BeeUIStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,37 +205,51 @@ - (void)applyImageContent:(NSMutableDictionary *)properties

if ( [self respondsToSelector:@selector(setStrech:)] )
{
objc_msgSend( self, @selector(setStrech:), stretched );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setStrech:) signal:(void *)&stretched];
// objc_msgSend( self, @selector(setStrech:), stretched );
}

if ( [self respondsToSelector:@selector(setRound:)] )
{
objc_msgSend( self, @selector(setRound:), rounded );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setRound:) signal:(void *)&rounded];
// objc_msgSend( self, @selector(setRound:), rounded );
}

if ( [self respondsToSelector:@selector(setGray:)] )
{
objc_msgSend( self, @selector(setGray:), grayed );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setGray:) signal:(void *)&grayed];
// objc_msgSend( self, @selector(setGray:), grayed );
}

if ( [self respondsToSelector:@selector(setPattern:)] )
{
objc_msgSend( self, @selector(setPattern:), pattern );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setPattern:) signal:(void *)&pattern];
// objc_msgSend( self, @selector(setPattern:), pattern );
}

if ( [self respondsToSelector:@selector(setStrechInsets:)] )
{
objc_msgSend( self, @selector(setStrechInsets:), contentInsets );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setStrechInsets:) signal:(void *)&contentInsets];
// objc_msgSend( self, @selector(setStrechInsets:), contentInsets );
}

if ( [self respondsToSelector:@selector(setCrop:)] )
{
objc_msgSend( self, @selector(setCrop:), croped );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setCrop:) signal:(void *)&croped];
// objc_msgSend( self, @selector(setCrop:), croped );
}

if ( [self respondsToSelector:@selector(setCropSize:)] )
{
objc_msgSend( self, @selector(setCropSize:), cropSize );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setCropSize:) signal:(void *)&cropSize];
// objc_msgSend( self, @selector(setCropSize:), cropSize );
}

self.contentMode = contentMode;
Expand Down Expand Up @@ -301,30 +315,46 @@ - (void)applyImageContent:(NSMutableDictionary *)properties
- (void)applyImageIndicator:(NSMutableDictionary *)properties
{
NSString * imageLoading = [properties parseStringWithKeys:@[@"loading", @"image-loading"]];

if ( imageLoading )
{
if ( NSOrderedSame == [imageLoading compare:@"white" options:NSCaseInsensitiveSearch] )
{
if ( [self respondsToSelector:@selector(setIndicatorStyle:)] )
{
objc_msgSend( self, @selector(setIndicatorStyle:), UIActivityIndicatorViewStyleWhite );
// TODO: CY

UIActivityIndicatorViewStyle indicatorStyle = UIActivityIndicatorViewStyleWhite;

[self performMsgSendWithTarget:self sel:@selector(setIndicatorStyle:) signal:(void *)&indicatorStyle];

// objc_msgSend( self, @selector(setIndicatorStyle:), UIActivityIndicatorViewStyleWhite );
}
}
else if ( NSOrderedSame == [imageLoading compare:@"gray" options:NSCaseInsensitiveSearch] )
{
if ( [self respondsToSelector:@selector(setIndicatorStyle:)] )
{
objc_msgSend( self, @selector(setIndicatorStyle:), UIActivityIndicatorViewStyleGray );
// TODO: CY

UIActivityIndicatorViewStyle indicatorStyle = UIActivityIndicatorViewStyleGray;

[self performMsgSendWithTarget:self sel:@selector(setIndicatorStyle:) signal:(void *)&indicatorStyle];

// objc_msgSend( self, @selector(setIndicatorStyle:), UIActivityIndicatorViewStyleGray );
}
}
else
{
if ( [self respondsToSelector:@selector(setIndicatorColor:)] )
{
UIColor * color = [UIColor colorWithString:imageLoading];

if ( color )
{
objc_msgSend( self, @selector(setIndicatorColor:), color );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setIndicatorStyle:) signal:(void *)&color];
// objc_msgSend( self, @selector(setIndicatorColor:), color );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ - (void)applySizes:(NSMutableDictionary *)properties

if ( NO == CGSizeEqualToSize( dotSize, CGSizeZero ) )
{
objc_msgSend( self, @selector(setDotSize:), dotSize );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setDotSize:) signal:(void *)&dotSize];
// objc_msgSend( self, @selector(setDotSize:), dotSize );
}
}
}
Expand Down
28 changes: 22 additions & 6 deletions iOS/framework/mvc/view/css/extension/UIScrollView+BeeUIStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,31 @@ - (void)applyScrollDirection:(NSMutableDictionary *)properties
{
if ( [self respondsToSelector:@selector(setHorizontal:)] )
{
objc_msgSend( self, @selector(setHorizontal:), YES );
// TODO: CY
BOOL i = YES;
[self performMsgSendWithTarget:self sel:@selector(setHorizontal:) signal:(void *)&i];
// objc_msgSend( self, @selector(setHorizontal:), YES );
}
}
else
{
if ( [self respondsToSelector:@selector(setVertical:)] )
{
objc_msgSend( self, @selector(setVertical:), YES );
// TODO: CY
BOOL i = YES;
[self performMsgSendWithTarget:self sel:@selector(setVertical:) signal:(void *)&i];
// objc_msgSend( self, @selector(setVertical:), YES );
}
}
}
else
{
if ( [self respondsToSelector:@selector(setVertical:)] )
{
objc_msgSend( self, @selector(setVertical:), YES );
// TODO: CY
BOOL i = YES;
[self performMsgSendWithTarget:self sel:@selector(setVertical:) signal:(void *)&i];
// objc_msgSend( self, @selector(setVertical:), YES );
}
}
}
Expand All @@ -88,12 +97,17 @@ - (void)applyScrollInsets:(NSMutableDictionary *)properties
if ( [scrollInsets matchAnyOf:@[@"auto"]] )
{
UIEdgeInsets insets = [BeeUIConfig sharedInstance].baseInsets;
objc_msgSend( self, @selector(setExtInsets:), insets );

// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setExtInsets:) signal:(void *)&insets];
// objc_msgSend( self, @selector(setExtInsets:), insets );
}
else
{
UIEdgeInsets insets = UIEdgeInsetsFromStringEx( scrollInsets );
objc_msgSend( self, @selector(setExtInsets:), insets);
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setExtInsets:) signal:(void *)&insets];
// objc_msgSend( self, @selector(setExtInsets:), insets);
}
}
}
Expand All @@ -114,7 +128,9 @@ - (void)applyScrollLines:(NSMutableDictionary *)properties
lineCount = 1;
}

objc_msgSend( self, @selector(setLineCount:), lineCount);
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setLineCount:) signal:(void *)&lineCount];
// objc_msgSend( self, @selector(setLineCount:), lineCount);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ - (void)applyInputValue:(NSMutableDictionary *)properties

if ( [self respondsToSelector:@selector(setMaxLength:)] )
{
objc_msgSend( self, @selector(setMaxLength:), maxLength );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setMaxLength:) signal:(void *)&maxLength];
// objc_msgSend( self, @selector(setMaxLength:), maxLength );
}
}

Expand Down
8 changes: 6 additions & 2 deletions iOS/framework/mvc/view/css/extension/UITextView+BeeUIStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ - (void)applyInputValue:(NSMutableDictionary *)properties
{
NSString * defaultPlaceholder = [self performSelector:@selector(placeholder)];
NSString * placeholder = [properties parseTextWithKeys:@[@"placeholder", @"input-placeholder"] defaultValue:defaultPlaceholder];
objc_msgSend( self, @selector(setPlaceholder:), placeholder );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setPlaceholder:) signal:(void *)&placeholder];
// objc_msgSend( self, @selector(setPlaceholder:), placeholder );
}

NSInteger maxLength = [properties parseIntegerWithKeys:@[@"maxlength", @"input-max-length"] defaultValue:0];
if ( [self respondsToSelector:@selector(setMaxLength:)] )
{
objc_msgSend( self, @selector(setMaxLength:), maxLength );
// TODO: CY
[self performMsgSendWithTarget:self sel:@selector(setMaxLength:) signal:(void *)&maxLength];
// objc_msgSend( self, @selector(setMaxLength:), maxLength );
}
}

Expand Down
6 changes: 3 additions & 3 deletions iOS/framework/mvc/view/css/parser/cssom/CSSStyleSelector.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ - (BOOL)checkOneSelector:(CSSSelector *)selector element:(id<CSSElementProtocol>
return element.classes && [element.classes containsObject:selector.value];

if ( selector.match == MatchId )
return element.hash && [element.hash isEqualToString:selector.value];
return [element hash] && [[element hash] isEqualToString:selector.value];

// TODO: attribute check
}
Expand Down Expand Up @@ -299,9 +299,9 @@ - (void)clearMatchedRules
- (void)matchRules:(CSSRuleSet *)ruleSet
{
// #id
if ( self.element.hash )
if ( [self.element hash] )
{
[self matchRulesForList:[ruleSet getIDRules:self.element.hash]];
[self matchRulesForList:[ruleSet getIDRules:[self.element hash]]];
}
// .class
for ( NSString * className in self.element.classes )
Expand Down
1 change: 0 additions & 1 deletion iOS/framework/mvc/view/dom-element/Bee_UIImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#import "Bee_UIImageView.h"
#import "Bee_UIConfig.h"
#import "Bee_UISignalBus.h"
#import "Bee_UIMetrics.h"

#import "Bee_Cache.h"
#import "Bee_Network.h"
Expand Down
27 changes: 26 additions & 1 deletion iOS/framework/mvc/view/dom-event/Bee_UISignalBus.m
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,42 @@ - (BOOL)perform:(BeeUISignal *)signal target:(id)target selector:(SEL)sel class:

if ( [BeeUIConfig sharedInstance].ASR )
{
// NSInvocation 调用 TODO: CY

ImpFuncType prevImp = NULL;

Method method = class_getInstanceMethod( clazz, sel );

if ( method )
{
IMP imp = method_getImplementation( method );
ImpFuncType imp = (ImpFuncType)method_getImplementation( method );

if ( imp )
{
// if ( imp == prevImp )
// {
// continue;
// }

imp( target, sel, signal );

prevImp = imp;

performed = YES;
}
}

// Method method = class_getInstanceMethod( clazz, sel );
// if ( method )
// {
// IMP imp = method_getImplementation( method );
// if ( imp )
// {
// imp( target, sel, signal );
//
// performed = YES;
// }
// }
}
else
{
Expand Down
Loading

0 comments on commit c84e374

Please sign in to comment.