#include <document.h>
Inheritance diagram for SafeRenderPointer:
Public Member Functions | |
SafeRenderPointer () | |
Constructs a SafeRenderPointer object. | |
~SafeRenderPointer () | |
Destroys a SafeRenderPointer object. | |
void | SetPointerValid () |
Sets the pointer as being valid. | |
void | SetPointerInValid () |
Sets the pointer as being invalid. | |
BOOL | IsPointerValid () |
Returns whether or not the pointer is valid. | |
BOOL | UpdateLastSafeNode (Node *pNewNode) |
Updates the last safe node that can be rendered. | |
Node * | GetLastSafeNode () |
Returns a pointer to the last safe node that can be rendered. | |
Protected Attributes | |
Node * | pLastSafeNodeToRender |
BOOL | m_bPointerValid |
Definition at line 185 of file document.h.
|
Constructs a SafeRenderPointer object.
Definition at line 6145 of file document.cpp. 06146 { 06147 m_bPointerValid = TRUE; 06148 pLastSafeNodeToRender = NULL; 06149 }
|
|
Destroys a SafeRenderPointer object.
Definition at line 6161 of file document.cpp.
|
|
Returns a pointer to the last safe node that can be rendered.
Definition at line 6234 of file document.cpp. 06235 { 06236 if (!m_bPointerValid) 06237 return NULL; 06238 06239 Node* pSafeNode = NULL; 06240 06241 // Make sure this pointer cannot be updated by another thread while we read it 06242 // CCamApp::EnterSafeRenderCriticalSection(); 06243 06244 pSafeNode = pLastSafeNodeToRender; 06245 // TRACEUSER( "Will", _T("Thread %d is reading safe node as %x\n"), GetCurrentThreadId(), pSafeNode); 06246 06247 // Ok, it's safe for other threads to update it now 06248 // CCamApp::ExitSafeRenderCriticalSection(); 06249 06250 return pSafeNode; 06251 }
|
|
Returns whether or not the pointer is valid.
Definition at line 6295 of file document.cpp. 06296 { 06297 return m_bPointerValid; 06298 }
|
|
Sets the pointer as being invalid.
Definition at line 6279 of file document.cpp. 06280 { 06281 // TRACEUSER( "Will", _T("Thread %d is setting safe node ptr as INVALID\n"), GetCurrentThreadId()); 06282 m_bPointerValid = FALSE; 06283 }
|
|
Sets the pointer as being valid.
Definition at line 6263 of file document.cpp. 06264 { 06265 // TRACEUSER( "Will", _T("Thread %d is setting safe node ptr as VALID\n"), GetCurrentThreadId()); 06266 m_bPointerValid = TRUE; 06267 }
|
|
Updates the last safe node that can be rendered.
Definition at line 6176 of file document.cpp. 06177 { 06178 ERROR2IF(!m_bPointerValid, FALSE, "Trying to set safe pointer when it's invalid."); 06179 06180 #ifdef RALPH 06181 06182 if ((!pLastSafeNodeToRender) && pNewNode) 06183 { 06184 NodeDocument* pNodeDoc = (NodeDocument*) pNewNode->FindParent(CC_RUNTIME_CLASS(NodeDocument)); 06185 ASSERT (pNodeDoc); 06186 if (pNodeDoc) 06187 { 06188 Document* TheDoc = (Document*)pNodeDoc->GetParentDoc(); 06189 ASSERT(TheDoc); 06190 if (TheDoc) 06191 { 06192 RalphDocument* pRalphDoc = TheDoc->GetRalphDoc(); 06193 if (pRalphDoc) 06194 { 06195 RalphView * pRalphView = pRalphDoc->GetRalphView(); 06196 if(pRalphView) 06197 { 06198 /* OpZoomDescriptor::FakeZoomToRect(&(pRalphDoc->GetViewportRect())); 06199 pRalphView->SetSafeToDraw(TRUE); 06200 */ 06201 //Beep(1500,15); 06202 06203 SendMessage(pRalphView->GetSafeHwnd(),WM_ZOOMTORECT,NULL,(INT32)(pRalphDoc->GetViewportRect())); 06204 } 06205 } 06206 } 06207 } 06208 } 06209 06210 #endif 06211 06212 // Make sure this pointer cannot be accessed by other threads 06213 // while we update it 06214 // CCamApp::EnterSafeRenderCriticalSection(); 06215 06216 // TRACEUSER( "Will", _T("Thread %d is setting safe node to %x\n"), GetCurrentThreadId(), pNewNode); 06217 pLastSafeNodeToRender = pNewNode; 06218 06219 // Ok, it's safe for other threads to access us now 06220 // CCamApp::ExitSafeRenderCriticalSection(); 06221 return TRUE; 06222 }
|
|
Definition at line 204 of file document.h. |
|
Definition at line 203 of file document.h. |