// This method is here to 'wrap' the internal thread's virtual method call with some standard setup/tear-down code of our own void Thread::InternalThreadEntryAux() { const uint32 threadStackBase = 0; // only here so we can get its address below _threadStackBase = &threadStackBase; // remember this stack location so GetCurrentStackUsage() can reference it later on muscle_thread_key curThreadKey = GetCurrentThreadKey(); if (_curThreadsMutex.Lock() == B_NO_ERROR) { (void) _curThreads.Put(curThreadKey, this); _curThreadsMutex.Unlock(); } if ((_threadPriority != PRIORITY_UNSPECIFIED)&&(SetThreadPriorityAux(_threadPriority) != B_NO_ERROR)) { LogTime(MUSCLE_LOG_ERROR, "Thread %p: Unable to set thread priority to %i\n", this, _threadPriority); } if (_threadData[MESSAGE_THREAD_OWNER]._messages.HasItems()) SignalOwner(); InternalThreadEntry(); _threadData[MESSAGE_THREAD_INTERNAL]._messageSocket.Reset(); // this will wake up the owner thread with EOF on socket if (_curThreadsMutex.Lock() == B_NO_ERROR) { (void) _curThreads.Remove(curThreadKey); _curThreadsMutex.Unlock(); } _threadStackBase = NULL; }
EXPORT_C void CFepUiLayout::ChangeFeedbackType(TInt aId, TInt aNewTactileType) { #ifdef RD_TACTILE_FEEDBACK TTactileFeedbackArea area= {aId,TRect(0,0,0,0),TRect(0,0,0,0),aNewTactileType}; TPtrC data(reinterpret_cast<TUint16*>(&area),sizeof(area)/2); SignalOwner(ESignalChangeFeedbackType,data); #endif // RD_TACTILE_FEEDBACK }
// --------------------------------------------------------------------------- // CFepUiLayout::DeRegisterFeedbackArea // De-Register the feedback area // --------------------------------------------------------------------------- // EXPORT_C void CFepUiLayout::DeRegisterFeedbackArea(TInt aId,const TRect& aRect) { #ifdef RD_TACTILE_FEEDBACK TTactileFeedbackArea area= {aId,aRect,TRect(0,0,0,0)}; TPtrC data(reinterpret_cast<TUint16*>(&area),sizeof(area)/2); SignalOwner(ESignalDeRegisterFeedbackArea,data); #endif // RD_TACTILE_FEEDBACK }
// --------------------------------------------------------------------------- // CFepUiLayout::~CFepUiLayout // Destructor // --------------------------------------------------------------------------- // EXPORT_C CFepUiLayout::~CFepUiLayout() { #ifdef RD_TACTILE_FEEDBACK //remove all registered area SignalOwner(ESignalDeRegisterAllFeedbackArea); #endif // RD_TACTILE_FEEDBACK delete iRootCtrl; }
// --------------------------------------------------------------------------- // CFepUiLayout::ChangeFeedbackArea // De-Register the feedback area // --------------------------------------------------------------------------- // EXPORT_C void CFepUiLayout::ChangeFeedbackArea(TInt aId,const TRect& aNew, const TRect& aOld) { #ifdef RD_TACTILE_FEEDBACK if(aNew == aOld) return; TInt InvalidType = 0; TTactileFeedbackArea area= {aId,aNew,aOld,InvalidType}; TPtrC data(reinterpret_cast<TUint16*>(&area),sizeof(area)/2); SignalOwner(ESignalChangeFeedbackArea,data); #endif // RD_TACTILE_FEEDBACK }
status_t Thread :: SendMessageAux(int whichQueue, const MessageRef & replyRef) { status_t ret = B_ERROR; ThreadSpecificData & tsd = _threadData[whichQueue]; if (tsd._queueLock.Lock() == B_NO_ERROR) { if (tsd._messages.AddTail(replyRef) == B_NO_ERROR) ret = B_NO_ERROR; const bool sendNotification = (tsd._messages.GetNumItems() == 1); (void) tsd._queueLock.Unlock(); if ((sendNotification)&&(_signalLock.Lock() == B_NO_ERROR)) { switch(whichQueue) { case MESSAGE_THREAD_INTERNAL: SignalInternalThread(); break; case MESSAGE_THREAD_OWNER: SignalOwner(); break; } _signalLock.Unlock(); } } return ret; }
// --------------------------------------------------------------------------- // CFepUiLayout::SetAppEditorCursor // Handle changing app editor cursor event // (other items were commented in a header). // --------------------------------------------------------------------------- // EXPORT_C void CFepUiLayout::SetAppEditorCursor(const TCursorSelection& aCurSel, TBool aReqMoreText) { TPtrC16 ptr; TInt size = sizeof(TBool) + sizeof(TCursorSelection) + 1; TUint8* packedData = new TUint8[size]; if(!packedData) return; TInt cpLen = sizeof(TCursorSelection); Mem::Copy(packedData,&aCurSel,cpLen); Mem::Copy(packedData+cpLen,&aReqMoreText,sizeof(TBool)); ptr.Set(reinterpret_cast<TUint16*>(packedData),size / 2); SignalOwner(ESignalSetAppEditorCursor,ptr); delete []packedData; }
// This method is here to 'wrap' the internal thread's virtual method call with some standard setup/tear-down code of our own void Thread::InternalThreadEntryAux() { const uint32 threadStackBase = 0; // only here so we can get its address below _threadStackBase = &threadStackBase; // remember this stack location so GetCurrentStackUsage() can reference it later on muscle_thread_key curThreadKey = GetCurrentThreadKey(); if (_curThreadsMutex.Lock() == B_NO_ERROR) { (void) _curThreads.Put(curThreadKey, this); _curThreadsMutex.Unlock(); } if (_threadData[MESSAGE_THREAD_OWNER]._messages.HasItems()) SignalOwner(); InternalThreadEntry(); _threadData[MESSAGE_THREAD_INTERNAL]._messageSocket.Reset(); // this will wake up the owner thread with EOF on socket if (_curThreadsMutex.Lock() == B_NO_ERROR) { (void) _curThreads.Remove(curThreadKey); _curThreadsMutex.Unlock(); } _threadStackBase = NULL; }