00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __CIVFAPP_H__
00025 #define __CIVFAPP_H__
00026
00027 #include <Inventor/SbBasic.h>
00028
00029 class CIvfDocument ;
00030 class CIvfMainFrame ;
00031 class CIvfComponent;
00032
00033 class CWinApp ;
00034 class CObject ;
00035 class CDocument ;
00036 class CDocTemplate ;
00037 class CView ;
00038 class CWnd ;
00039 class CFrameWnd ;
00040 class CPtrList ;
00041
00047 typedef SoDEPRECATED CIvfComponent * (*IvfCvtAfxViewProc)(CView *) ;
00048
00054 typedef SoDEPRECATED CView * (*IvfCvtIvfComponentProc)(CIvfComponent *) ;
00055
00061 typedef SoDEPRECATED CIvfComponent * (*IvfCvtAfxWndProc)(CWnd *) ;
00062
00068 typedef SoDEPRECATED CWnd * (*IvfCvtIvfComponentProcW)(CIvfComponent *) ;
00069
00075 typedef SoDEPRECATED CIvfDocument * (*IvfCvtAfxDocProc)(CDocument *) ;
00076
00082 typedef SoDEPRECATED CDocument * (*IvfCvtIvfDocProc)(CIvfDocument *) ;
00083
00089 typedef SoDEPRECATED CIvfMainFrame * (*IvfCvtAfxFrameProc)(CFrameWnd *pFrame);
00090
00091 class SoDEPRECATED CIvfApp
00126 {
00127 public:
00128
00132 CIvfApp();
00136 ~CIvfApp();
00137
00142 static void IvfInitInstance(CWinApp *pApp,
00143 CIvfApp *pIvfApp,
00144 IvfCvtAfxViewProc pAfxViewProc,
00145 IvfCvtIvfComponentProc pIvfComponentProc,
00146 IvfCvtAfxWndProc pAfxWndProc,
00147 IvfCvtIvfComponentProcW pIvfComponentProcW,
00148 IvfCvtAfxDocProc pAfxDocProc,
00149 IvfCvtIvfDocProc pIvfDocProc,
00150 IvfCvtAfxFrameProc pAfxFrameProc,
00151 void *pCreateArgs,
00152 BOOL nCreateComponent) ;
00153
00154
00158 static void IvfExitInstance();
00159
00164 static void IvfOnIdle( LONG lCount );
00165
00169 static void IvfInitSoWin(CWnd *pTopLevel);
00170
00174 static CIvfApp *IvfGetApp();
00175
00179 static CDocTemplate *IvfGetDocTemplate();
00180
00187 static CIvfDocument *IvfGetDocument(CIvfComponent *pIvfComponent = NULL) ;
00188
00196 static CIvfComponent *IvfGetComponent(CIvfDocument *pIvfDoc = NULL) ;
00197
00201 static CFrameWnd *IvfGetAfxFrame(CIvfComponent *pIvfComponent = NULL) ;
00202
00206 static CIvfMainFrame *IvfGetIvfFrame() ;
00207
00216 static CView *IvfGetAfxView(CIvfComponent *pIvfComponent = NULL) ;
00217
00226 static CWnd *IvfGetAfxWnd(CIvfComponent *pIvfComponent = NULL) ;
00227
00238 static CDocument *IvfGetAfxDocument(CIvfComponent *pIvfComponent = NULL) ;
00239
00247 static CDocument *IvfGetAfxDocument(CIvfDocument *pIvfDoc) ;
00248
00249
00255 static CIvfComponent *ToIvfComponent(CView *pAfxView) ;
00256
00262 static CView *ToAfxView(CIvfComponent *pIvfComponent) ;
00263
00269 static CIvfComponent *ToIvfComponentW(CWnd *pAfxWnd) ;
00270
00276 static CWnd *ToAfxWnd(CIvfComponent *pIvfComponent) ;
00277
00283 static CIvfDocument *ToIvfDocument(CDocument *pAfxDoc) ;
00284
00290 static CDocument *ToAfxDocument(CIvfDocument *pIvfDoc) ;
00291
00292
00298 static CIvfMainFrame *ToIvfFrame(CFrameWnd *pFrame) ;
00299
00304 static void *IvfCreateArgs();
00305
00309 static BOOL IvfIsMdi();
00310
00319 static void IvfAddToIvfAfxObjectList(CObject *pAfxObj);
00320
00324 static void IvfRemoveFromIvfAfxObjectList(CObject *pAfxObj);
00325
00326
00330 static BOOL IvfIsIvfComponent(CView *pAfxView);
00331
00335 static BOOL IvfIsIvfDocument(CDocument *pAfxDoc);
00336
00337
00341 static CIvfApp *m_pApp ;
00342
00346 static CDocTemplate *m_pDocTemplate ;
00347
00351 static void *m_pCreateArgs ;
00352
00356 static BOOL m_nMDI ;
00357
00362 static void enableMultiThread(void);
00363
00364 private:
00365
00366
00367 static IvfCvtAfxViewProc m_pAfxViewProc ;
00368 static IvfCvtIvfComponentProc m_pIvfComponentProc ;
00369 static IvfCvtAfxWndProc m_pAfxWndProc ;
00370 static IvfCvtIvfComponentProcW m_pIvfComponentProcW ;
00371 static IvfCvtAfxDocProc m_pAfxDocProc ;
00372 static IvfCvtIvfDocProc m_pIvfDocProc ;
00373 static IvfCvtAfxFrameProc m_pAfxFrameProc ;
00374
00375
00376 static CPtrList *m_pIvfAfxObjectList;
00377 static int isMTEnabled;
00378
00380
00381
00382
00383
00385
00386 };
00387
00388
00394 #ifdef __TGS_DEMO_UNLOCK
00395 #include <lock/demoUnlock.h>
00396 #include <Inventor/lock/SoLockMgr.h>
00397 #define IVF_INIT_INSTANCE_BETA2(CFrameClass,CViewClass,CDocClass,pVwrClass,pCreateArgs,nMDI) \
00398 { \
00399 SoLockManager::SetUnlockString(DEMO_UNLOCK_STRING) ; \
00400 CIvfApp::IvfInitInstance(\
00401 this,\
00402 this,\
00403 IvfCvtAfxView, \
00404 IvfCvtIvfComponent, \
00405 NULL,\
00406 NULL,\
00407 IvfCvtAfxDoc, \
00408 IvfCvtIvfDoc, \
00409 pCreateArgs, \
00410 TRUE); \
00411 }
00412
00413 #define IVF_INIT_INSTANCE(pApp,IvfCvtAfxView,IvfCvtIvfComponent,IvfCvtAfxWnd,IvfCvtIvfComponentW,IvfCvtAfxDoc,IvfCvtIvfDoc,IvfCvtAfxFrame,pCreateArgs,nCreateVwr) \
00414 { \
00415 SoLockManager::SetUnlockString(DEMO_UNLOCK_STRING) ; \
00416 CIvfApp::IvfInitInstance( \
00417 pApp,\
00418 pApp,\
00419 IvfCvtAfxView, \
00420 IvfCvtIvfComponent, \
00421 IvfCvtAfxWnd, \
00422 IvfCvtIvfComponentW, \
00423 IvfCvtAfxDoc, \
00424 IvfCvtIvfDoc, \
00425 IvfCvtAfxFrame,\
00426 pCreateArgs, \
00427 nCreateVwr); \
00428 }
00429
00430 #else
00431 #define IVF_INIT_INSTANCE_BETA2(CFrameClass,CViewClass,CDocClass,pVwrClass,pCreateArgs,nMDI) \
00432 { \
00433 CIvfApp::IvfInitInstance(\
00434 this,\
00435 this,\
00436 IvfCvtAfxView, \
00437 IvfCvtIvfComponent, \
00438 NULL,\
00439 NULL,\
00440 IvfCvtAfxDoc, \
00441 IvfCvtIvfDoc, \
00442 IvfCvtAfxFrame,\
00443 pCreateArgs, \
00444 TRUE); \
00445 }
00446
00447 #define IVF_INIT_INSTANCE(pApp,IvfCvtAfxView,IvfCvtIvfComponent,IvfCvtAfxWnd,IvfCvtIvfComponentW,IvfCvtAfxDoc,IvfCvtIvfDoc,IvfCvtAfxFrame,pCreateArgs,nCreateVwr) \
00448 { \
00449 CIvfApp::IvfInitInstance( \
00450 pApp,\
00451 pApp,\
00452 IvfCvtAfxView, \
00453 IvfCvtIvfComponent, \
00454 IvfCvtAfxWnd, \
00455 IvfCvtIvfComponentW, \
00456 IvfCvtAfxDoc, \
00457 IvfCvtIvfDoc, \
00458 IvfCvtAfxFrame,\
00459 pCreateArgs, \
00460 nCreateVwr); \
00461 }
00462 #endif
00463
00464
00472 #ifndef __AFXOLE_H__
00473
00474 #define IVF_AFX_CONVERSION_METHOD(AppViewClassName,AppDocClassName) \
00475 static CIvfComponent *IvfCvtAfxView(CView *pAfxView) \
00476 { \
00477 AppViewClassName *pView = (AppViewClassName *) pAfxView ; \
00478 return pView ; \
00479 } \
00480 static CView *IvfCvtIvfComponent(CIvfComponent *pIvfComponent) \
00481 { \
00482 AppViewClassName *pView = (AppViewClassName *) pIvfComponent ; \
00483 return pView ; \
00484 } \
00485 static CIvfDocument *IvfCvtAfxDoc(CDocument *pAfxDoc) \
00486 { \
00487 AppDocClassName *pDoc = (AppDocClassName *) pAfxDoc ; \
00488 return pDoc ; \
00489 } \
00490 static CDocument *IvfCvtIvfDoc(CIvfDocument *pIvfDoc) \
00491 { \
00492 AppDocClassName *pDoc = (AppDocClassName *) pIvfDoc ; \
00493 return pDoc ; \
00494 }\
00495 static CIvfMainFrame *IvfCvtAfxFrame(CFrameWnd *pFrame)\
00496 {\
00497 if (pFrame->IsKindOf( RUNTIME_CLASS(CMainFrame) ) )\
00498 {\
00499 CMainFrame *pMainFrame = (CMainFrame *)pFrame;\
00500 CIvfMainFrame *pIvfFrame = (CIvfMainFrame *)pMainFrame;\
00501 return pIvfFrame;\
00502 }\
00503 else\
00504 return NULL;\
00505 }
00506
00507 #else
00508
00509 #define IVF_AFX_CONVERSION_METHOD(AppViewClassName,AppDocClassName) \
00510 static CIvfComponent *IvfCvtAfxView(CView *pAfxView) \
00511 { \
00512 AppViewClassName *pView = (AppViewClassName *) pAfxView ; \
00513 return pView ; \
00514 } \
00515 static CView *IvfCvtIvfComponent(CIvfComponent *pIvfComponent) \
00516 { \
00517 AppViewClassName *pView = (AppViewClassName *) pIvfComponent ; \
00518 return pView ; \
00519 } \
00520 static CIvfDocument *IvfCvtAfxDoc(CDocument *pAfxDoc) \
00521 { \
00522 AppDocClassName *pDoc = (AppDocClassName *) pAfxDoc ; \
00523 return pDoc ; \
00524 } \
00525 static CDocument *IvfCvtIvfDoc(CIvfDocument *pIvfDoc) \
00526 { \
00527 AppDocClassName *pDoc = (AppDocClassName *) pIvfDoc ; \
00528 return pDoc ; \
00529 }\
00530 static CIvfMainFrame *IvfCvtAfxFrame(CFrameWnd *pFrame)\
00531 {\
00532 if (pFrame->IsKindOf( RUNTIME_CLASS(CInPlaceFrame) ) )\
00533 {\
00534 CInPlaceFrame *pMainFrame = (CInPlaceFrame *)pFrame;\
00535 CIvfMainFrame *pIvfFrame = (CIvfMainFrame *)pMainFrame;\
00536 return pIvfFrame;\
00537 }\
00538 else if (pFrame->IsKindOf( RUNTIME_CLASS(CMainFrame) ) )\
00539 {\
00540 CMainFrame *pMainFrame = (CMainFrame *)pFrame;\
00541 CIvfMainFrame *pIvfFrame = (CIvfMainFrame *)pMainFrame;\
00542 return pIvfFrame;\
00543 }\
00544 else\
00545 return NULL;\
00546 }
00547
00548 #endif
00549
00550
00555 #define IVF_AFX_WND_CONVERSION_METHOD(AppWndClassName) \
00556 static CIvfComponent *IvfCvtAfxWnd(CWnd *pAfxWnd) \
00557 { \
00558 AppWndClassName *pWnd = (AppWndClassName *) pAfxWnd ; \
00559 return pWnd ; \
00560 } \
00561 static CWnd *IvfCvtIvfComponent(CIvfComponent *pIvfComponent) \
00562 { \
00563 AppWndClassName *pWnd = (AppWndClassName *) pIvfComponent ; \
00564 return pWnd ; \
00565 }
00566
00567 extern UINT WMAPPU_PROCPENDINGINLINE;
00568
00570 #endif
00571
00572