Главная » Просмотр файлов » 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), страница 92

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

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

Other stages are specific to certain types of events. For example,both pointer events and key events have to undergo special processing.The first stage WSERV goes through is to process the pointerevents – this is so that the main processing of pointer events later onreceives pointer events of a standard type. WSERV does various things atthis point:• Filters out Win32 move events for the emulator of a pen-based device• Where the co-ordinates the kernel has delivered to WSERV are relativeto the last position, converts them to absolute co-ordinates for a virtualpointer cursor• For real devices (that is, not the emulator), WSERV rotates co-ordinatesto the current screen rotation.

(Screen rotation allows address of thescreen in a co-ordinate set rotated by 0, 90, 180 or 270 degrees fromthe physical co-ordinates of the screen)• Offsets the co-ordinates to the current screen origin and scaling• If pointer events are being limited to a sub rectangle of the display,then WSERV restricts the co-ordinates if they are outside of this area.It is worth noting that rotation does not need to be taken into account inthe emulator, because the fascia bitmap rotates, and so the co-ordinatesthe kernel receives from Win32 are already rotated.We support the screen origin and scaling functionality from SymbianOS v8.1.

By using screen origin and scaling, a user interface designercan allow different applications to address the pixels of the screen withdifferent co-ordinate sets.Under some circumstances, WSERV turns off its heart beat timer – thisnormally happens when a client calls RWsSession::PrepareForSwitchOff() so that the processor can be powered down to savebattery power. In response to each event from the kernel WSERV turnsthis timer back on (if it’s off).Next WSERV passes the event to any anim DLL that has registereditself as being interested in events. The anim DLL registers by callingthe function MAnimGeneralFunctions::GetRawEvents(ETrue).To deliver the event to the anim DLL, WSERV calls the function: MEventHandler::OfferRawEvent(). The anim DLL can consume the event436THE WINDOW SERVERso that WSERV does no further processing; to do this it should returnETrue from the OfferRawEvent function, otherwise it should returnEFalse.From this point onward WSERV treats the different types of events indifferent ways.

This is shown for all events other than key and pointerevents, in the ‘‘WSERV events’’ table above.11.4Processing key eventsThere are three kernel events that are directly related to keys: EKeyDown,EKeyUp and EUpdateModifiers. To process these key events, WSERVuses an instance of a CKeyTranslator-derived object. This objectunderstands character mappings and modifier keys, and its main purposeis to tell WSERV which characters a particular key press should map to.For example, pressing the ‘‘a’’ key could result in ‘‘a’’ or ‘‘A’’, and it isCKeyTranslator that analyzes the state of the shift keys and determineswhich it should be.The event EUpdateModifiers is passed straight through to theCKeyTranslator object.

The kernel generates this event in the emulator when the emulator window gains focus from another Windowsapplications. The data passed with the event tells us the current state ofall the modifier keys, and enables the emulator to take into account anychanges the user has made to modifier keys while other applications onthe emulator host had focus.11.4.1 Key ups and downsWSERV processes each up and down event thus:• It logs the event, if logging is enabled• It tells the keyboard repeat timer object about the event• It passes the event to the keyboard translator object• It checks for any modifier changes• It queues the key up/down event• It performs further processing to create the character event (if there isto be one).The keyboard-repeat-timer object controls auto repeating of key presses.WSERV only receives a single up or down event from the kernel, no matterhow long the key is pressed. If a key press maps to a character, WSERVstarts a timer, and every time that timer goes off, WSERV generates anotherinstance of the character for the client queue.

If the client is respondingPROCESSING KEY EVENTS437promptly to the events, then it will get many events for that character,and the timer will have generated all but the first of them.When a new key down event occurs, WSERV must inform the timer,so that it can cancel the current repeat – this is needed because any keypress should change the character the timer generates. Similarly, whena key up event occurs, WSERV informs the timer, so that it can stop therepeat if the key up comes from the currently repeating character.WSERV calls the keyboard translator object next, using the function:TBool TranslateKey(TUint aScanCode, TBool aKeyUp,const CCaptureKeys &aCaptureKeys, TKeyData &aKeyData)As you can see, WSERV passes the scan code of the key event, a Booleanto say whether the key is an up or down event, and the current list ofcapture keys.

The key translator object returns a TBool saying whether thekey maps to a character event or if it does, the key translator also returnsthe following details of the character event in the TKeyData object:• The code of the character• The current state of all the modifiers• Whether the key has been captured.If the key is captured, the key translator also returns:• A handle indicating which window captured the object• Another handle which WSERV uses for its own capture keys.WSERV capture keys or hotkeys are system wide.

There are hotkeys forincreasing or decreasing contrast, toggling or turning the backlight on oroff and more – you can see the full list in the enum THotKey.Clients can request events to let them know when certain modifier keyschange their state. When this happens, WSERV checks all client requeststo see if any are requesting information about the particular change thathas occurred. For each such request, WSERV queues an event to therelevant client.WSERV has to decide which client to send the up or down keyevent to.

Usually it chooses the client that owns the currently focusedwindow – the only exception is if a particular client has requested thecapture of up and down events on that particular key. WSERV also sendsthe event to the key click plug-in in case there is a sound associated withthis event.WSERV now processes those key up or down events that the keytranslator object decided gave rise to character events. This processing isquite involved and I will describe it in the next section.438THE WINDOW SERVER11.4.2 Character eventsThe main steps WSERV performs in processing character events are:• Calls the key click plug-in• Deals with capture keys (including WSERV capture keys)• Determines who should receive the event• Checks to see if the event has a long capture• Checks to see if repeat timer should start• Queues the event.First, WSERV sends the event to the key click plug-in, if there is one.The key translator object has already returned a flag to say whether thecharacter event should be captured, so WSERV checks this and sets thedestination for the event accordingly.

If the key has not been captured,then WSERV sends the event to the currently focused window. If the eventwas captured but WSERV is currently displaying the password window,then WSERV only sends the event if it was captured by the same groupwindow as the password window.If the character event is one of WSERV’s capture keys, then WSERVwill have captured it itself. In this case, WSERV will process the eventimmediately and not send it on to a client.If the key is either:• A long capture key, or• There is currently no repeating key, and the key is allowed to beauto-repeatablethen the repeat timer is started.Long capturing is a feature that we added in Symbian OS v7.0.

Itallows a long press of a key to be treated differently from a quick tap. Thelong-key-press event and the short-key-press event yielded by a singlephysical key press can differ both in their destination client and the actualcharacter code generated. This feature allows a quick press of a numberkey on a phone to enter a number into the ‘‘dial number’’ dialogue, whilea longer press of the same key could launch the contacts application andjump to first contact starting with a certain letter.11.5Processing pointer eventsThe processing of pointer events is much more complicated than theprocessing of key events. This is because WSERV calculates whichPROCESSING POINTER EVENTS439window to send the event to from the exact location of the click.

Pointergrabbing and capturing affect it too.The normal sequence of pointer events starts with a pointer downevent, is followed by zero or more pointer drag events, and ends with apointer up event. It is possible for all of these events to go to the windowvisible on the screen at the location that they occur. However, thereare two features that clients can use to vary this behavior: grabbing andcapturing.If a window receives a down event and it is set to grab pointer events,then WSERV sends all the drag events and the following up event tothat window, even if they actually take place over other windows. If awindow is capturing, and the down event is on a window behind it, thenthe window that is capturing will receive the event.

If that window is alsograbbing, then it will receive the following drag and up events too.In practice, most windows will grab pointer events and some windowswill also capture them too. Capturing allows dialogs to prevent pointerevents from being sent to windows behind them.WSERV takes the following major steps during the processing of pointerevents:• Calculates the actual window the pointer event is on• Determines if another window’s grabbing or capturing means that itshould get the pointer event• Queues enter and exit events if the current window has changed• Tells the key click plug-in about the pointer event• For move and drag events, checks the window to see if it doesn’t wantsuch events• If the window has requested it, stores move and drag events in apointer buffer• If window has a virtual keyboard and the event occurs on one of thevirtual keys, converts the event to a key event• Checks the event to see if it should be a double-click event, and if adrag-drop event is needed too.WSERV calculates the actual window that a pointer event occurs in byanalyzing the window tree in a recursive way.

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

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

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

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