[qwaq] Support an actual parameter for listeners

This commit is contained in:
Bill Currie 2020-03-26 14:16:07 +09:00
parent 983a7422db
commit aac732fc63
2 changed files with 14 additions and 0 deletions

View file

@ -13,6 +13,7 @@
}
-initWithResponder: (id) responder :(SEL)message;
-(void) respond: (void *) caller_data;
-(void) respond: (void *) caller_data withObject:(void *)anObject;
-(BOOL) matchResponder: (id) responder :(SEL)message;
@end
@ -24,6 +25,7 @@
-addListener: (id) responder :(SEL)message;
-removeListener: (id) responder :(SEL)message;
-(void) respond: (void *) caller_data;
-(void) respond: (void *) caller_data withObject:(void *)anObject;
@end
#endif//__qwaq_listener_h

View file

@ -21,6 +21,11 @@
imp (responder, message, caller_data);
}
-(void)respond: (void *) caller_data withObject:(void *)anObject
{
imp (responder, message, caller_data, anObject);
}
-(BOOL) matchResponder: (id) responder :(SEL)message
{
return self.responder == responder && self.message == message;
@ -63,4 +68,11 @@
[listeners makeObjectsPerformSelector: @selector (respond:)
withObject: caller_data];
}
-(void)respond: (void *) caller_data withObject:(void *)anObject
{
[listeners makeObjectsPerformSelector: @selector (respond:)
withObject: caller_data
withObject: anObject];
}
@end