Главная » Просмотр файлов » Wiley.Symbian.OS.Internals.Real.time.Kernel.Programming.Dec.2005.eBook-DDU

Wiley.Symbian.OS.Internals.Real.time.Kernel.Programming.Dec.2005.eBook-DDU (779891), страница 91

Файл №779891 Wiley.Symbian.OS.Internals.Real.time.Kernel.Programming.Dec.2005.eBook-DDU (Symbian Books) 91 страницаWiley.Symbian.OS.Internals.Real.time.Kernel.Programming.Dec.2005.eBook-DDU (779891) страница 912018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 91)

It creates a newhandle from the client thread or process to the new DLibrary and passesit back to the loader. If the main code segment has the EMarkDataInitflag set, the kernel sets the state of the DLibrary to ELoaded, sinceC++ constructors must be run before it is ready for use; otherwise it setsthe DLibrary state to EAttached.Control then returns to the loader, which writes the new handle backto the client and then completes the load request, at which point controlreturns to the client thread.10.5 SummaryIn this chapter I have described the process of loading executables andthe management of executable code in Symbian OS, from both the fileserver’s perspective, and the kernel’s.

In the next chapter, I shall go on tolook at another key user-mode server, the window server.11The Window Serverby Douglas Feather‘‘The truth of the matter is thatwindow management under Xis not yet well understood.’’The Xlib Programming ManualThe window server (or WSERV) works in conjunction with almost everypart of Symbian OS, from the kernel to the applications, with the onlyreal exception being the communications sub-systems.

Its two mainresponsibilities are screen management and event management. WSERVreceives events from the kernel and passes them to its clients (which arenormally applications). It receives commands from clients and updatesthe screen accordingly. My discussion of these two key responsibilitieswill make up the backbone of this chapter.WSERV is started during system boot and runs continually throughoutthe life of the system. It is a standard system server, being a derivedclass of CServer2 (or CPolicyServer from Symbian OS v9 onwards)called CWindowServer.In this chapter I shall also cover animation DLLs (anim DLLs), whichare a plug-in to WSERV. I will discuss what an anim DLL is, how to createone and how an anim DLL interacts with events. To illustrate this, I willdevelop a simple handwriting recognition system.And of course I will cover windows in great depth – different typesof windows, window classes on both the client and server sides, howwindow objects link together (the window tree), the different regions thatwindows have, different window effects and how clients can draw towindows.

But first I will consider WSERV as the kernel’s event handler.11.1 The kernel’s event handlerDuring system bootup, WSERV calls the function UserSvr::CaptureEventHook(), which tells the kernel that WSERV wants to become430THE WINDOW SERVERthe kernel’s event handler. To actually receive the events, WSERVthen has to call the function UserSvr::RequestEvent(TRawEventBuf& aBuf, TRequestStatus& aStatus), passing in the requeststatus of the active object CRawEventReceiver, which will then runwhenever the kernel has an event waiting.

In this way, the kernel passesall its events (for example, digitizer and key events) to WSERV, whichthen has to perform further processing on these events.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, actingupon others, creating new events and deciding which client to send theevent to. The set of event types that is passed between the kernel andWSERV is not exactly the same as the set of event types that is passedbetween 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 toanim DLLs.11.2Different types of eventsIn this section I will list the different types of events that WSERV dealswith, and give a brief description of what each type is for. I will describeboth the set of events passed from the kernel to WSERV and the set passedfrom WSERV to the client. Figure 11.1 gives an overview of the paths thatevents can take within the system.

It shows three different threads: thekernel, WSERV and a client of WSERV – the boundaries between thesethreads are represented by the three dividing lines. The three small boxesrepresent processing that goes on inside WSERV itself.clientWSERVClient QueuesProcessingAnimsuserkernelFigure 11.1 WSERV event flowDIFFERENT TYPES OF EVENTS431Although Figure 11.1 does not give the complete picture, it shouldsuffice to give you a feel for how events pass through WSERV.11.2.1 Events from the kernel to WSERVThe events that are passed from the kernel to WSERV are listed in the classTRawEvent::TType. Several of these are to do with pointer events.

Inthe following table, I only list a representative set of the pointer events:Raw eventsEventsPurposeENoneA dummy value that is not actually used.EPointerMoveThe pointer or pen has moved position. This could be amove or drag event.EPointerSwitchOnThe digitizer was pressed and this caused the device topower up.EKeyDownA key on the keyboard was pressed.EKeyUpA key on the keyboard was released.ERedrawThe emulator has received a Win32 redraw event.ESwitchOnThe device has just been powered up.EActiveThe emulator window has gained focus.EInactiveThe emulator window has lost focus.EUpdateModifiersThe modifier key settings have changed. Sent by theemulator when it regains focus.EButton1DownThe pen or mouse button 1 has been pressed.EButton1UpThe pen or mouse button 1 has been released.ESwitchOffThe device is about to be switched off.ECaseOpenThe case on a clam-shell device has been opened.ECaseCloseThe case on a clam-shell device has been closed.432THE WINDOW SERVERI will discuss what happens to key and pointer events later in thischapter.

The following table shows how WSERV responds to all the otherraw events in the system:WSERV eventsEventResponseERedrawOn the emulator, there is a bitmap managed by the screendriver component that contains the complete copy of thedisplay. WSERV calls the function: CFbsScreenDevice::Update(const TRegion& aRegion)passing in the full screen area, which updates the screenfrom the bitmap.ESwitchOnStops the keyboard repeat timer.

Puts up the passwordwindow if one has been set. Switches on the screenhardware by calling UserSvr::WsSwitchOnScreen(). Sends on events to clients that have requestedthis notification.EInactiveStops keys auto-repeating.EUpdateModifiersResets the state of all the modifier keys.ESwitchOffIf a client has registered itself for switch-off events, thenWSERV sends an event to that client. Otherwise it powersdown the device by calling: UserHal::SwitchOff().EKeyRepeatNothing.ECaseOpenSame as ESwitchOn except that it does not power up thescreen hardware.ECaseCloseSends an event to the client that has registered itself todeal with switching off.

(Does not power down if such aclient does not exist.)11.2.2Events from WSERV to its clientsIn the next two tables, I show the list of events that WSERV sends to itsclients. I will discuss key and pointer events in more detail later in thisDIFFERENT TYPES OF EVENTS433chapter. The first table contains events that WSERV sends to the relevantclient whenever they occur:Non-client registered eventsEventMeaningEEventNullShould be ignored.EEventKeyA character event.EEventKeyUpA key up event.EEventKeyDownA key down event.EEventPointerAn up, down, drag or move pointer event.EEventPointerEnterThe pointer has moved over a window.EEventPointerExitThe pointer has moved away from a particularwindow.EEventPointerBufferReadyA buffer containing pointer drag or moveevents is ready for delivery.EEventDragDropA special kind of pointer event.

These eventscan be requested by clients so that they canreceive UI widgets by dragging and releasing.EEventFocusLostThe window has just lost focus.EEventFocusGainedThe window has just gained focus.EEventPasswordSent to the owner of the password windowwhen the password window is displayed.EEventMessageReadyA message has arrived from anotherapplication.EEventMarkInvalidInternal use only, never sent to clients.EEventKeyRepeatNot sent to clients, sent to key click makers.434THE WINDOW SERVERIn the next table I show events that WSERV only sends to clients that register for them – most of these events can be sent to more than one client:Client-registered eventsEventMeaningEEventModifiersChangedOne or more modifier keys have changedtheir state.EEventSwitchOnThe machine has just been switched on.(This event is not generated on a phone,but is generated on, for example, a PsionSeries 5 PDA.)EEventWindowGroupsChangedSent when a group window is destroyedor named.EEventErrorMessageSent when an error, such as out-ofmemory, occurs in WSERV.

(For moredetails, see the documentation forTEventCode in the Symbian DeveloperLibrary’s C++ component referencesection.)EEventSwitchOffSent to the client dealing with switch off.EEventKeySwitchOffSent to clients dealing with switch off ifthe off key is pressed.EEventScreenDeviceChangedSent when the screen size mode changes.EEventFocusGroupChangedSent when the focused group windowchanges.EEventCaseOpenedSent when the clam-shell device isopened.EEventCaseClosedSent to the client dealing with switch offwhen the clam-shell is closed.EEventWindowGroupListChangedSent when there is a change in groupwindow order.HOW WSERV PROCESSES EVENTS43511.3 How WSERV processes eventsWSERV processes events in many stages; some of these are general toall events, in particular the way in which WSERV queues events for theclient.

Характеристики

Тип файла
PDF-файл
Размер
6,63 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6418
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее