class CTactileAreaRegistry : public CBase |
Access to area registry from server side.
This class defines the interface that is used from server side for managing area registry (e.g. handling connect and disconnect requests)
The main purpose of this class is to do hit testing of pointer events, for knowing if feedback should be triggered based on the pointer event.
This class also implements bookkeeping of created window groups and corresponding window server connection handles. This information is used for finding correct application's registry entries when a pointer event arrives (application usually has only one window group, but some pop-up controls create additional ones).
Public Member Functions | |
---|---|
~CTactileAreaRegistry () | |
IMPORT_C void | HandleConnectL (const TTactileFeedbackConnectData &) |
IMPORT_C void | HandleDisconnect (const TTactileFeedbackDisconnectData &) |
IMPORT_C void | HandleWindowGroupClosed ( TInt ) |
IMPORT_C void | HandleWindowGroupCreated ( TInt , TUint ) |
IMPORT_C TTouchLogicalFeedback | HitTestPointerEvent (const TPointerEvent &, TInt , TUint32 ) |
IMPORT_C CTactileAreaRegistry * | NewL () |
Private Member Functions | |
---|---|
CTactileAreaRegistry () | |
TInt | ChunkIndexByWindowGroupId ( TInt ) |
TUint | ConnectionHandleByWgId ( TInt ) |
TTouchLogicalFeedback | HitTestChunk ( RChunk &, const TPointerEvent &, TInt , TUint32 ) |
TBool | HitTestRegistryEntry (const TPointerEvent &, const TFeedbackChunkAreaEntry &, TInt , TUint32 , TTouchLogicalFeedback &) |
Private Attributes | |
---|---|
RArray < TTactileAreaChunk > | iChunkArray |
TTactilePenDownEvent | iLastPenDown |
RSemaphore | iTactileSemaphore |
RArray < TTactileWgroupItem > | iWgArray |
TInt | ChunkIndexByWindowGroupId | ( | TInt | aWgIdentifier | ) | const [private] |
Finds the correct shared memory chunk based on window group id.
This is used for performing first phase of hit testing.
TInt aWgIdentifier | - Identifier of the window group, which chunk is searched. |
TUint | ConnectionHandleByWgId | ( | TInt | aWgIdentifier | ) | const [private] |
Finds window server client's connection handle based on given window group identifier.
This is used for finding correct shared memory chunk based on window group identifier.
TInt aWgIdentifier | - The window group identifier. |
IMPORT_C void | HandleConnectL | ( | const TTactileFeedbackConnectData & | aData | ) |
Handles connection requests from client application. This has to be called for every application that connects to the click plugin.
Area registry immediately tries to connect to the chunk created by client application. This function leaves with Standard Symbian OS error codes in case connection fails.
const TTactileFeedbackConnectData & aData | - The data sent by client application. |
IMPORT_C void | HandleDisconnect | ( | const TTactileFeedbackDisconnectData & | aData | ) |
Handles disconnect request from client application. This has to be called for every application that disconnects from the click plugin.
const TTactileFeedbackDisconnectData & aData | - The data sent by client application. |
IMPORT_C void | HandleWindowGroupClosed | ( | TInt | aIdentifier | ) |
Clears stored information about a window group that is closed.
This function has to be called when click plugin receives a notification about closed window group.
TInt aIdentifier | - Window group identifier of the window group that was closed. |
IMPORT_C void | HandleWindowGroupCreated | ( | TInt | aIdentifier, |
TUint | aConnectionHandle | |||
) |
Records information about a newly created window group.
This function has to be called when click plugin receives a notification about created window group.
TTouchLogicalFeedback | HitTestChunk | ( | RChunk & | aChunk, |
const TPointerEvent & | aPointerEvent, | |||
TInt | aWgIdentifier, | |||
TUint32 | aWindowHandle | |||
) | [private] |
This function is used for hit testing one chunk.
It is assumed that the given chunk is the chunk of that application, where pointer event shall be delivered.
IMPORT_C TTouchLogicalFeedback | HitTestPointerEvent | ( | const TPointerEvent & | aPointerEvent, |
TInt | aWgIdentifier, | |||
TUint32 | aWindowHandle | |||
) |
Does hit testing of given pointer event against area registry content.
Hit testing is done in three phases:
1. First this function uses window group identifier for finding the application, which shall receive the pointer event (registry contents has to be grouped by applicaitons because window identifiers are only unique inside one application)
2. Window handle is used for finding those registry entries, which are registered to the same window where pointer event hit now (coordinates are window -relative).
3. Window's registry entries are hit tested one by one against the given pointer event, and in case a match is found, then corresponding registry entries feedback type is returned.
TBool | HitTestRegistryEntry | ( | const TPointerEvent & | aPointerEvent, |
const TFeedbackChunkAreaEntry & | aEntry, | |||
TInt | aWgIdentifier, | |||
TUint32 | aWindowHandle, | |||
TTouchLogicalFeedback & | aFeedback | |||
) | [private] |
This function checks whether given pointer event and area registry entry match, and sets feedback type accordingly in case they match.
It is assumed that pointer event shall hit that window, where given area is registered (as coordinates are window-relative).
Notice that feedback is actually returned in reference parameter aFeedback, and the main return value of the function tells whether hit testing should be continued on next possible area or not. This is because feedback can be "None" even if pointer event hit the feedback area (because "None" is a valid type for feedback areas)
const TPointerEvent & aPointerEvent | - The pointer event. |
const TFeedbackChunkAreaEntry & aEntry | - Area registry entry, representing feedback area in same window where pointer event hit. |
TInt aWgIdentifier | - Identifier of the window group, where pointer event hit. |
TUint32 aWindowHandle | - Handle number of the window, where pointer event hit. |
TTouchLogicalFeedback & aFeedback |
RArray < TTactileAreaChunk > | iChunkArray | [private] |
Array of chunk handles and identifying window group identifiers. Each entry in the array represents one application and its registered feedback areas.
TTactilePenDownEvent | iLastPenDown | [private] |
Information about last received pen down event. This can be used for determining whether pen up event should produde feedback or not.
RSemaphore | iTactileSemaphore | [private] |
Handle to the global semaphore, which is used for mutual exclusion when accessing shared memory chunks.
RArray < TTactileWgroupItem > | iWgArray | [private] |
Here we store the information about created window groups. For each group we also store the connection handle, so that we can know into which application newly created window groups belong.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.