mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
add emitter_forward_retarget
This commit is contained in:
parent
a8a790647d
commit
493104194f
@ -1,5 +1,8 @@
|
||||
# 最新动态
|
||||
|
||||
2023/05/28
|
||||
* 增加函数emitter\_forward\_retarget。
|
||||
|
||||
2023/05/27
|
||||
* 完善ubjson\_do\_parse\_array数组中包含数组的处理。
|
||||
|
||||
|
@ -412,3 +412,9 @@ ret_t emitter_dispatch_simple_event(emitter_t* emitter, uint32_t type) {
|
||||
ret_t emitter_forward(void* ctx, event_t* e) {
|
||||
return emitter_dispatch(EMITTER(ctx), e);
|
||||
}
|
||||
|
||||
ret_t emitter_forward_retarget(void* ctx, event_t* e) {
|
||||
return_value_if_fail(e != NULL, RET_BAD_PARAMS);
|
||||
e->target = ctx;
|
||||
return emitter_dispatch(EMITTER(ctx), e);
|
||||
}
|
||||
|
@ -295,6 +295,17 @@ emitter_t* emitter_cast(emitter_t* emitter);
|
||||
*/
|
||||
ret_t emitter_forward(void* ctx, event_t* e);
|
||||
|
||||
/**
|
||||
* @method emitter_forward_retarget
|
||||
* 分发事件。并将e->target强制设置为ctx。
|
||||
*
|
||||
* @param {void*} ctx emitter对象。
|
||||
* @param {event_t*} e 分发的事件。
|
||||
*
|
||||
* @return {ret_t} 返回RET_OK表示成功,否则表示失败。
|
||||
*/
|
||||
ret_t emitter_forward_retarget(void* ctx, event_t* e);
|
||||
|
||||
#define EMITTER(emitter) ((emitter_t*)(emitter))
|
||||
|
||||
#define EMITTER_ENABLE(emitter) \
|
||||
|
Loading…
Reference in New Issue
Block a user