Skip to content

Commit

Permalink
updata
Browse files Browse the repository at this point in the history
兼容64位
  • Loading branch information
Chenyun authored and Chenyun committed Dec 18, 2014
1 parent 24de10f commit 2ce78e5
Show file tree
Hide file tree
Showing 11 changed files with 2,105 additions and 1,979 deletions.
34 changes: 24 additions & 10 deletions framework/mvc/view/css/extension/UIImageView+BeeUIStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,37 +205,44 @@ - (void)applyImageContent:(NSMutableDictionary *)properties

if ( [self respondsToSelector:@selector(setStrech:)] )
{
objc_msgSend( self, @selector(setStrech:), stretched );
[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 );
[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 );
[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 );
[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 );
[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 );
[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 );
[self performMsgSendWithTarget:self sel:@selector(setCropSize:) signal:(void *)&cropSize];
// objc_msgSend( self, @selector(setCropSize:), cropSize );
}

self.contentMode = contentMode;
Expand Down Expand Up @@ -307,14 +314,20 @@ - (void)applyImageIndicator:(NSMutableDictionary *)properties
{
if ( [self respondsToSelector:@selector(setIndicatorStyle:)] )
{
objc_msgSend( self, @selector(setIndicatorStyle:), UIActivityIndicatorViewStyleWhite );
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 );
UIActivityIndicatorViewStyle indicatorStyle = UIActivityIndicatorViewStyleGray;

[self performMsgSendWithTarget:self sel:@selector(setIndicatorStyle:) signal:(void *)&indicatorStyle];
// objc_msgSend( self, @selector(setIndicatorStyle:), UIActivityIndicatorViewStyleGray );
}
}
else
Expand All @@ -324,7 +337,8 @@ - (void)applyImageIndicator:(NSMutableDictionary *)properties
UIColor * color = [UIColor colorWithString:imageLoading];
if ( color )
{
objc_msgSend( self, @selector(setIndicatorColor:), color );
[self performMsgSendWithTarget:self sel:@selector(setIndicatorStyle:) signal:(void *)&color];
// objc_msgSend( self, @selector(setIndicatorColor:), color );
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion framework/mvc/view/css/extension/UIPageControl+BeeUIStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ - (void)applySizes:(NSMutableDictionary *)properties

if ( NO == CGSizeEqualToSize( dotSize, CGSizeZero ) )
{
objc_msgSend( self, @selector(setDotSize:), dotSize );
[self performMsgSendWithTarget:self sel:@selector(setDotSize:) signal:(void *)&dotSize];
// objc_msgSend( self, @selector(setDotSize:), dotSize );
}
}
}
Expand Down
22 changes: 15 additions & 7 deletions framework/mvc/view/css/extension/UIScrollView+BeeUIStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,28 @@ - (void)applyScrollDirection:(NSMutableDictionary *)properties
{
if ( [self respondsToSelector:@selector(setHorizontal:)] )
{
objc_msgSend( self, @selector(setHorizontal:), YES );
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 );
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 );
BOOL i = YES;
[self performMsgSendWithTarget:self sel:@selector(setVertical:) signal:(void *)&i];
// objc_msgSend( self, @selector(setVertical:), YES );
}
}
}
Expand All @@ -88,12 +94,14 @@ - (void)applyScrollInsets:(NSMutableDictionary *)properties
if ( [scrollInsets matchAnyOf:@[@"auto"]] )
{
UIEdgeInsets insets = [BeeUIConfig sharedInstance].baseInsets;
objc_msgSend( self, @selector(setExtInsets:), insets );
[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);
[self performMsgSendWithTarget:self sel:@selector(setExtInsets:) signal:(void *)&insets];
// objc_msgSend( self, @selector(setExtInsets:), insets);
}
}
}
Expand All @@ -113,8 +121,8 @@ - (void)applyScrollLines:(NSMutableDictionary *)properties
{
lineCount = 1;
}

objc_msgSend( self, @selector(setLineCount:), lineCount);
[self performMsgSendWithTarget:self sel:@selector(setLineCount:) signal:(void *)&lineCount];
// objc_msgSend( self, @selector(setLineCount:), lineCount);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion framework/mvc/view/css/extension/UITextField+BeeUIStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ - (void)applyInputValue:(NSMutableDictionary *)properties

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

Expand Down
6 changes: 4 additions & 2 deletions framework/mvc/view/css/extension/UITextView+BeeUIStyle.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ - (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 );
[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 );
[self performMsgSendWithTarget:self sel:@selector(setMaxLength:) signal:(void *)&maxLength];
// objc_msgSend( self, @selector(setMaxLength:), maxLength );
}
}

Expand Down
28 changes: 26 additions & 2 deletions framework/mvc/view/dom-event/Bee_UISignalBus.m
Original file line number Diff line number Diff line change
Expand Up @@ -296,22 +296,46 @@ - (BOOL)perform:(BeeUISignal *)signal target:(id)target selector:(SEL)sel class:

if ( [BeeUIConfig sharedInstance].ASR )
{
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 ( nil == [history objectForKey:@((unsigned int)imp)] )
{
imp( target, sel, signal );

[history setObject:@(YES) forKey:@((unsigned int)imp)];

prevImp = imp;

performed = YES;

}
}
}

// Method method = class_getInstanceMethod( clazz, sel );
// if ( method )
// {
// IMP imp = method_getImplementation( method );
// if ( imp )
// {
// if ( nil == [history objectForKey:@((unsigned int)imp)] )
// {
// imp( target, sel, signal );
//
// [history setObject:@(YES) forKey:@((unsigned int)imp)];
//
// performed = YES;
// }
// }
// }
}
else
{
Expand Down
18 changes: 11 additions & 7 deletions framework/mvc/view/dom-query/extension/BeeUIQuery+Events.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ - (BOOL)selected
{
if ( [view respondsToSelector:@selector(selected)] )
{
BOOL flag = (BOOL)objc_msgSend( view, @selector(selected) );
BOOL flag = [self performMsgSendWithTarget:view sel:@selector(selected)];
if ( flag )
return YES;
}

if ( [view respondsToSelector:@selector(state)] )
{
UIControlState state = (BOOL)objc_msgSend( view, @selector(state) );
UIControlState state = [self performMsgSendWithTarget:view sel:@selector(state)];
if ( state & UIControlStateSelected )
return YES;
}
Expand All @@ -115,7 +115,7 @@ - (BOOL)focusing
{
if ( view && [view respondsToSelector:@selector(isFirstResponder)] )
{
BOOL flag = (BOOL)objc_msgSend( view, @selector(isFirstResponder) );
BOOL flag = [self performMsgSendWithTarget:view sel:@selector(isFirstResponder)];
if ( flag )
return YES;
}
Expand All @@ -136,7 +136,8 @@ - (BeeUIQueryObjectBlock)ENABLE

if ( [v respondsToSelector:@selector(setEnabled:)] )
{
objc_msgSend( v, @selector(setEnabled:), YES );
BOOL i = YES;
[self performMsgSendWithTarget:v sel:@selector(setEnabled:) signal:(void *)&i];
}
}
return self;
Expand All @@ -155,7 +156,8 @@ - (BeeUIQueryObjectBlock)DISABLE

if ( [v respondsToSelector:@selector(setEnabled:)] )
{
objc_msgSend( v, @selector(setEnabled:), NO );
BOOL i = NO;
[self performMsgSendWithTarget:v sel:@selector(setEnabled:) signal:(void *)&i];
}
}
return self;
Expand Down Expand Up @@ -210,7 +212,8 @@ - (BeeUIQueryObjectBlock)SELECT
{
if ( [v respondsToSelector:@selector(setSelected:)] )
{
objc_msgSend( v, @selector(setSelected:), YES );
BOOL i = YES;
[self performMsgSendWithTarget:v sel:@selector(setSelected:) signal:(void *)&i];
}
}

Expand All @@ -228,7 +231,8 @@ - (BeeUIQueryObjectBlock)UNSELECT
{
if ( [v respondsToSelector:@selector(setSelected:)] )
{
objc_msgSend( v, @selector(setSelected:), NO );
BOOL i = YES;
[self performMsgSendWithTarget:v sel:@selector(setSelected:) signal:(void *)&i];
}
}

Expand Down
5 changes: 5 additions & 0 deletions framework/system/foundation/extension/NSObject+BeeExtension.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

#pragma mark -

typedef void ( *ImpFuncType )( id a, SEL b, void * c );

@interface NSObject(BeeExtension)

+ (instancetype)object;
Expand All @@ -53,6 +55,9 @@
- (void)performSelectorAlongChain:(SEL)sel;
- (void)performSelectorAlongChainReversed:(SEL)sel;

- (void)performMsgSendWithTarget:(id)target sel:(SEL)sel signal:(id)signal;
- (BOOL)performMsgSendWithTarget:(id)target sel:(SEL)sel;

- (void)copyPropertiesFrom:(id)obj;

@end
Loading

0 comments on commit 2ce78e5

Please sign in to comment.