equal
deleted
inserted
replaced
33 |
33 |
34 // Minimun and maximum sized of one shared memory chunk. |
34 // Minimun and maximum sized of one shared memory chunk. |
35 const TInt KTactileChunkInitialSize = 4096; // 4kB |
35 const TInt KTactileChunkInitialSize = 4096; // 4kB |
36 const TInt KTactileChunkMaxSize = 262144; // 256kB |
36 const TInt KTactileChunkMaxSize = 262144; // 256kB |
37 const TUid KTactileClickPluginUid = { 0x2000B493 }; |
37 const TUid KTactileClickPluginUid = { 0x2000B493 }; |
|
38 |
|
39 _LIT( KChunkNameFormat, "PID_0x%Lx_TID_0x%Lx" ); |
38 // ======== MEMBER FUNCTIONS ======== |
40 // ======== MEMBER FUNCTIONS ======== |
39 |
41 |
40 // --------------------------------------------------------------------------- |
42 // --------------------------------------------------------------------------- |
41 // |
43 // |
42 // --------------------------------------------------------------------------- |
44 // --------------------------------------------------------------------------- |
84 { |
86 { |
85 User::Leave( KErrNotSupported ); |
87 User::Leave( KErrNotSupported ); |
86 } |
88 } |
87 |
89 |
88 // #2 Create shared chunk |
90 // #2 Create shared chunk |
89 RThread me; |
|
90 |
|
91 TTactileFeedbackConnectData data; |
91 TTactileFeedbackConnectData data; |
92 |
92 |
93 // Set window group identifier |
93 // Set window group identifier |
94 data.iWindowGroupId = CCoeEnv::Static()->RootWin().Identifier(); |
94 data.iWindowGroupId = CCoeEnv::Static()->RootWin().Identifier(); |
95 |
95 |
96 // We use our own thread name as name for the chunk |
96 // We use our own process id and thread id as name for the chunk |
97 data.iChunkName.Copy( me.Name().Right( KMaxKernelName ) ); |
97 data.iChunkName.Format( KChunkNameFormat, |
|
98 RProcess().Id().Id(), RThread().Id().Id() ); |
98 |
99 |
99 // Now create the chunk |
100 // Now create the chunk |
100 TInt err = iChunk.CreateGlobal( data.iChunkName, |
101 TInt err = iChunk.CreateGlobal( data.iChunkName, |
101 KTactileChunkInitialSize, |
102 KTactileChunkInitialSize, |
102 KTactileChunkMaxSize ); |
103 KTactileChunkMaxSize ); |
611 iFbClient.StopFeedback(); |
612 iFbClient.StopFeedback(); |
612 iFeedbackTimer->Cancel(); |
613 iFeedbackTimer->Cancel(); |
613 // Clear also client handle to indicate there's no ongoing feedback. |
614 // Clear also client handle to indicate there's no ongoing feedback. |
614 iClientHandle = 0; |
615 iClientHandle = 0; |
615 } |
616 } |
|
617 else if ( !iClientHandle ) // Stop instant feedback |
|
618 { |
|
619 iFbClient.StopFeedback(); |
|
620 } |
616 TRACE("CTouchFeedbackClient::StopFeedback - End"); |
621 TRACE("CTouchFeedbackClient::StopFeedback - End"); |
617 } |
622 } |
618 |
623 |
619 // --------------------------------------------------------------------------- |
624 // --------------------------------------------------------------------------- |
620 // |
625 // |