Mercurial > projects > dstep
diff dstep/foundation/NSComparisonPredicate.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 89f3c3ef1fd2 |
children | b9de51448c6b |
line wrap: on
line diff
--- a/dstep/foundation/NSComparisonPredicate.d Mon Aug 03 15:31:48 2009 +0200 +++ b/dstep/foundation/NSComparisonPredicate.d Sun Jan 03 22:06:11 2010 +0100 @@ -7,10 +7,10 @@ module dstep.foundation.NSComparisonPredicate; import dstep.foundation.NSExpression; +import dstep.foundation.NSObjCRuntime; import dstep.foundation.NSPredicate; -import dstep.foundation.NSPredicateOperator; import dstep.objc.bridge.Bridge; -import dstep.objc.objc : id; +import dstep.objc.objc; alias NSUInteger NSComparisonPredicateModifier; alias NSUInteger NSPredicateOperatorType; @@ -48,16 +48,26 @@ class NSComparisonPredicate : NSPredicate { - mixin ObjcWrap; + mixin (ObjcWrap); + + this () + { + super(typeof(this).alloc.init.objcObject); + } + + typeof(this) init () + { + return invokeObjcSelf!(typeof(this), "init"); + } static NSPredicate predicateWithLeftExpression (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) { - return invokeObjcSelfClass!(NSPredicate, "predicateWithLeftExpression:rightExpression:modifier:type:options:", NSExpression, NSExpression, uint, uint, NSUInteger)(lhs, rhs, modifier, type, options); + return invokeObjcSuperClass!(NSPredicate, "predicateWithLeftExpression:rightExpression:modifier:type:options:", NSExpression, NSExpression, uint, uint, NSUInteger)(lhs, rhs, modifier, type, options); } static NSPredicate predicateWithLeftExpression (NSExpression lhs, NSExpression rhs, SEL selector) { - return invokeObjcSelfClass!(NSPredicate, "predicateWithLeftExpression:rightExpression:customSelector:", NSExpression, NSExpression, SEL)(lhs, rhs, selector); + return invokeObjcSuperClass!(NSPredicate, "predicateWithLeftExpression:rightExpression:customSelector:", NSExpression, NSExpression, SEL)(lhs, rhs, selector); } Object initWithLeftExpression (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) @@ -67,13 +77,7 @@ this (NSExpression lhs, NSExpression rhs, uint modifier, uint type, NSUInteger options) { - objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); - id result = Bridge.invokeObjcMethod!(id, "initWithLeftExpression:rightExpression:modifier:type:options:", NSExpression, NSExpression, uint, uint, NSUInteger)(objcObject, lhs, rhs, modifier, type, options); - - if (result) - objcObject = ret; - - dObject = this; + typeof(this).alloc.initWithLeftExpression(lhs, rhs, modifier, type, options); } Object initWithLeftExpression (NSExpression lhs, NSExpression rhs, SEL selector) @@ -83,13 +87,7 @@ this (NSExpression lhs, NSExpression rhs, SEL selector) { - objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); - id result = Bridge.invokeObjcMethod!(id, "initWithLeftExpression:rightExpression:customSelector:", NSExpression, NSExpression, SEL)(objcObject, lhs, rhs, selector); - - if (result) - objcObject = ret; - - dObject = this; + typeof(this).alloc.initWithLeftExpression(lhs, rhs, selector); } uint predicateOperatorType ()