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

推荐订阅源

Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
S
Securelist
P
Proofpoint News Feed
H
Help Net Security
S
Schneier on Security
T
Tenable Blog
C
Cisco Blogs
S
Security @ Cisco Blogs
博客园 - 司徒正美
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
Google DeepMind News
Google DeepMind News
C
Cybersecurity and Infrastructure Security Agency CISA
Google Online Security Blog
Google Online Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News: Ask HN
Hacker News: Ask HN
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
V
Vulnerabilities – Threatpost
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
W
WeLiveSecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Jina AI
Jina AI
腾讯CDC
WordPress大学
WordPress大学
Simon Willison's Weblog
Simon Willison's Weblog
Vercel News
Vercel News
小众软件
小众软件
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
雷峰网
雷峰网
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
博客园 - 聂微东
F
Full Disclosure
量子位
Scott Helme
Scott Helme
宝玉的分享
宝玉的分享
A
About on SuperTechFans
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Schneier on Security
Schneier on Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
K
Kaspersky official blog
AI
AI
SecWiki News
SecWiki News
Webroot Blog
Webroot Blog
Martin Fowler
Martin Fowler

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

健康同步专家 隐私政策 健康同步专家介绍 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:

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