tactilefeedback/tactilefeedbackclient/src/touchfeedbackclient.cpp
branchRCL_3
changeset 34 d57e599df233
parent 21 f35d4b6d212e
child 36 39d4c97df8cb
equal deleted inserted replaced
26:7c0f4520ea0a 34:d57e599df233
    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 );