tactilefeedback/tactilefeedbackclient/src/touchfeedbackclient.cpp
branchRCL_3
changeset 46 df6ad9bd4687
parent 37 09b094b73eb8
equal deleted inserted replaced
38:0c5b3d8ea751 46:df6ad9bd4687
    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" );
       
    40 // ======== MEMBER FUNCTIONS ========
    38 // ======== MEMBER FUNCTIONS ========
    41 
    39 
    42 // ---------------------------------------------------------------------------
    40 // ---------------------------------------------------------------------------
    43 // 
    41 // 
    44 // ---------------------------------------------------------------------------
    42 // ---------------------------------------------------------------------------
    86         {
    84         {
    87         User::Leave( KErrNotSupported );
    85         User::Leave( KErrNotSupported );
    88         }
    86         }
    89 
    87 
    90     // #2 Create shared chunk 
    88     // #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 process id and thread id as name for the chunk
    96     // We use our own thread name as name for the chunk       
    97     data.iChunkName.Format( KChunkNameFormat,
    97     data.iChunkName.Copy( me.Name().Right( KMaxKernelName ) );
    98                             RProcess().Id().Id(), RThread().Id().Id() );
       
    99     
    98     
   100     // Now create the chunk
    99     // Now create the chunk
   101     TInt err = iChunk.CreateGlobal( data.iChunkName, 
   100     TInt err = iChunk.CreateGlobal( data.iChunkName, 
   102                                     KTactileChunkInitialSize, 
   101                                     KTactileChunkInitialSize, 
   103                                     KTactileChunkMaxSize );     
   102                                     KTactileChunkMaxSize );