惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Project Zero
Project Zero
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
大猫的无限游戏
大猫的无限游戏
The Register - Security
The Register - Security
C
Check Point Blog
Attack and Defense Labs
Attack and Defense Labs
L
LangChain Blog
Simon Willison's Weblog
Simon Willison's Weblog
S
Schneier on Security
Recorded Future
Recorded Future
GbyAI
GbyAI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Y
Y Combinator Blog
量子位
A
About on SuperTechFans
I
Intezer
T
Threat Research - Cisco Blogs
MongoDB | Blog
MongoDB | Blog
U
Unit 42
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
Cisco Talos Blog
Cisco Talos Blog
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
M
MIT News - Artificial intelligence
雷峰网
雷峰网
博客园 - 聂微东
NISL@THU
NISL@THU
The Hacker News
The Hacker News
G
Google Developers Blog
F
Full Disclosure
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Privacy & Cybersecurity Law Blog
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
Security Latest
Security Latest
T
Tenable Blog
Know Your Adversary
Know Your Adversary
Stack Overflow Blog
Stack Overflow Blog
K
Kaspersky official blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
C
Cybersecurity and Infrastructure Security Agency CISA
Martin Fowler
Martin Fowler
Schneier on Security
Schneier on Security

博客园 - 清风徐来,水波不兴

健康同步专家 隐私政策 健康同步专家介绍 IOS动画实现(3)UIView封装的动画 IOS动画实现(2)ImageView自带动画 IOS动画实现(1)几种实现方式 学习CEGUI亟待解决问题一:文本控件的格式问题 第一讲 ERP初阶(四):MRP基本构成 ERP初阶(三):MRP基本原理 ERP初阶(二):ERP概念与历程 ERP初阶(一):走近ERP 协议开发 中移动CMPP2.0协议API(四) 协议开发 中移动CMPP2.0协议API(二) 协议开发 中移动CMPP2.0协议API(三) 协议开发 中移动CMPP2.0协议API(一) 短信网关简介 SP 短信开发-PROVISION接口实现-反向取消实例代码 SP 短信开发-PROVISION接口实现-正向订购实例代码 SP 短信开发-PROVISION接口实现1
学习CEGUI亟待解决问题二:消息事件传递机制问题
清风徐来,水波不兴 · 2009-04-15 · via 博客园 - 清风徐来,水波不兴

公司的那个项目里面的事件传递看不过眼了哩。那多回调函数的重复代码。看CEGUI的事件机制MS还不错,抽点时间来学习学习。

Day1:

      首先看一下消息传递的过程。就拿点击按钮的左键鼠标弹起消息来说吧。首先还是从wndProc开始,在WM_LBUTTONUP分支接收到鼠标弹起的消息,使用injectMouseButtonUp这个函数将该事件“注射”到系统中去。再遍历系统中所有存在的窗体,让每个窗体依次接收到消息,直到该消息被处理。代码dest_window->onMouseButtonUp(ma);用来处理每个窗体的鼠标左键弹起消息。然后onClicked(args)-> fireEvent(EventClicked, e, EventNamespace)->fireEvent_impl(name, args);-> (*ev)(args);->args.handled |= (*iter->second->d_subscriber)(args);->(*d_functor_impl)(args);->(d_object->*d_function)(args);->映射到具体的消息处理函数。

      其上基本上是将堆栈的内容摆出来了,然后讲讲涉及到的类,包括EventSet(用来存放事件的容器),Event(事件),SubscriberSlot(用来订阅事件)。明天仔细研究下事件机制。

Day2:

      今天来看下事件机制。拿列表框来说吧,