Symbian OS Internals----The Window Server ( 1 )

Symbian OS Internals----The Window Server

The Window Server
窗口服务器
by Douglas Feather
‘‘The truth of the matter is that
window management under X
is not yet well understood.’’
The Xlib Programming Manual

The window server (or WSERV) works in conjunction with almost every part of Symbian OS,
from the kernel to the applications, with the only real exception being the communications sub-systems.
 Its two main responsibilities are screen management and event management.
WSERV receives events from the kernel and passes them to its clients (which are normally applications).
It receives commands from clients and updates the screen accordingly.
 My discussion of these two key responsibilities will make up the backbone of this chapter.

从内核到应用程序,窗口服务器(或者WSERV)几乎与 Symbian OS 的每个部分协同工作,只有一个例外,那就是通信子系统。
他的两个主要职责是 屏幕管理 和 事件管理。WSERV从内核接收事件,然后将之传递到客户端(一般是应用程序)。
他从客户端接收命令,然后相应的更新屏幕。关于这两个关键职责的讨论,将成为这一章的主线。

WSERV is started during system boot and runs continually throughout the life of the system.
 It is a standard system server, being a derived class of CServer2 (or CPolicyServer from Symbian OS v9 onwards) called CWindowServer.

WSERV开始于系统启动过程中,在系统整个生命周期中一直不停运行。
他是一个标准的系统服务器,作为一个CServer2(或 CPolicyServer)的继承类,称为CwindowServer.

In this chapter I shall also cover animation DLLs (anim DLLs), which are a plug-in to WSERV.
I will discuss what an anim DLL is, how to create one and how an anim DLL interacts with events.
To illustrate this, I will develop a simple handwriting recognition system.

在这一章,我也会涵盖动画DLL(anim Dlls),这是WSERV 的一个插件。我将讨论什么是动画DLL,如何创建他,以及动画DLL如何与事件交互。
为了阐明这些,我会开发一个简单的手写识别系统。

And of course I will cover windows in great depth – different types of windows, window classes on both the client and server sides,
how window objects link together (the window tree), the different regions that windows have,
different window effects and how clients can draw to windows.
But first I will consider WSERV as the kernel’s event handler.

当然,我会深入讨论窗口 - 不同类型的窗口,客户端 及服务器端的窗口类,窗口对象如何链接在一起(窗口树),
窗口拥有的不同区域,不同的窗口效果,及客户端如何绘制窗口。但首先,我会考虑WSERV作为内核的事件处理者。

 

11.1 The kernel’s event handler(内核事件管理者)

During system bootup, WSERV calls the function UserSvr::Capture-EventHook(),
 which tells the kernel that WSERV wants to become the kernel’s event handler.
To actually receive the events, WSERV then has to call the function UserSvr::RequestEvent(TRawEvent-Buf& aBuf, TRequestStatus& aStatus),
passing in the request status of the active object CRawEventReceiver,
which will then run whenever the kernel has an event waiting.
In this way, the kernel passes all its events (for example, digitizer and key events) to WSERV,
which then has to perform further processing on these events.

 

在系统启动期间,WSERV调用UserSvr::CaptureEventHook(),来告诉内核WSERV想要成为内核事件管理者。
为了实际接收事件,WSERV必须调用 UserSvr::RequestEvent(TRawEvent-Buf& aBuf, TRequestStatus& aStatus)函数,
传入活动对象CRawReciever的请求状态,这个活动对象在内核有事件等待的时候都会运行。
以这种方式,内核将他的事件(例如,digitizer 和键盘事件)传递给WSERV,WSERV随后必须对这些事件做进一步处理。

 

WSERV is not just a simple pipe that passes events on to its clients.
It does a lot of processing on the events, discarding some events,
acting upon others, creating new events and deciding which client to send the event to.
The set of event types that is passed between the kernel and WSERV
is not exactly the same as the set of event types that is passed between WSERV and its clients.
The kernel is not the only source of events;clients can also generate them, as can anim DLLs and WSERV itself.
As well as passing events to clients, WSERV can pass them to anim DLLs.

 

WSERV 不仅仅是一个简单的管道,用来向他的客户端传递事件。他对于这些事件还进行了许多处理,丢弃其中一些事件,
处理其他事件,创建新的事件,以及决定发送事件到哪个客户端。从内核向WSERV传递的事件类型的组合,同WSERV向客户端传递的事件类型组合并不完全相同。
事件不仅仅来源于内核,客户端也会产生事件,同时anim DLL 和 WSERV自身也会产生。
WSERV除了向客户端传递事件以外,也能向anim DLL 发送。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值