home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / Windows / Interfaces / QD3DWinViewer.h < prev   
Encoding:
C/C++ Source or Header  |  1996-05-03  |  12.9 KB  |  415 lines  |  [TEXT/LMAN]

  1. /******************************************************************************
  2.  **                                                                              **
  3.  **     Module:        QD3DWinViewer.h                                             **                        
  4.  **                                                                              **
  5.  **     Purpose:     WinViewer Controller Interface File.                     **            
  6.  **                                                                              **
  7.  **     Copyright (C) 1996 Apple Computer, Inc.  All rights reserved.         **
  8.  **                                                                              **
  9.  *****************************************************************************/
  10.  
  11. #ifndef QD3DWinViewer_h
  12. #define QD3DWinViewer_h
  13.  
  14. #include "QD3D.h"
  15. #include "QD3DGroup.h"
  16.  
  17. #if defined(OS_WIN32) && OS_WIN32
  18.  
  19. #include <windows.h>
  20.  
  21. #if defined(_MSC_VER)    /* Microsoft Visual C */
  22.     #if defined(Q3VIEWER_EXPORTING)    // define when building DLL
  23.         #define Q3VIEWER_EXPORT __declspec( dllexport )     
  24.     #else
  25.         #define Q3VIEWER_EXPORT __declspec( dllimport )    
  26.     #endif //WIN32_EXPORTING
  27. #else
  28.     #define Q3VIEWER_EXPORT
  29. #endif  /*  _MSC_VER  */
  30.  
  31. typedef void *TQ3WinViewerObject;
  32.  
  33. typedef TQ3Status (*TQ3WinViewerDrawingCallbackMethod)(
  34.         TQ3WinViewerObject    theViewer,
  35.         const void *data);
  36.  
  37. enum {
  38.     kQ3ViewerShowBadge             = 1<<0,
  39.     kQ3ViewerActive                = 1<<1,
  40.     kQ3ViewerControllerVisible    = 1<<2,
  41.     kQ3ViewerDrawFrame            = 1<<3,
  42.     kQ3ViewerDraggingOff        = 1<<4,
  43.     
  44.     kQ3ViewerButtonCamera        = 1<<5,
  45.     kQ3ViewerButtonTruck        = 1<<6,
  46.     kQ3ViewerButtonOrbit        = 1<<7,
  47.     kQ3ViewerButtonZoom            = 1<<8,
  48.     kQ3ViewerButtonDolly        = 1<<9,
  49.     kQ3ViewerButtonReset        = 1<<10,
  50.     
  51.     kQ3ViewerOutputTextMode        = 1<<11,
  52.     kQ3ViewerDragMode            = 1<<12,
  53.  
  54.     kQ3ViewerDrawGrowBox        = 1<<13,
  55.     kQ3ViewerDrawDragBorder        = 1<<14,
  56.  
  57.     kQ3ViewerDraggingInOff        = 1<<15,
  58.     kQ3ViewerDraggingOutOff        = 1<<16,
  59.  
  60.     kQ3ViewerDefault            = 1<<31
  61. };
  62.  
  63.  
  64. enum {
  65.     kQ3ViewerEmpty    = 0,
  66.     kQ3ViewerHasModel = 1<<0,
  67.     kQ3ViewerHasUndo  = 1<<1
  68. };
  69.  
  70. typedef enum TQ3ViewerCameraView {
  71.     kQ3ViewerCameraRestore,
  72.     kQ3ViewerCameraFit,
  73.     kQ3ViewerCameraFront,
  74.     kQ3ViewerCameraBack,
  75.     kQ3ViewerCameraLeft,
  76.     kQ3ViewerCameraRight,
  77.     kQ3ViewerCameraTop,
  78.     kQ3ViewerCameraBottom
  79. } TQ3ViewerCameraView;
  80.  
  81. #ifdef __cplusplus
  82. extern "C" {
  83. #endif    /* __cplusplus */
  84.  
  85. Q3VIEWER_EXPORT ATOM Q3WinInitializeViewerWindowClass (HANDLE hInstance);
  86.  
  87.  
  88. /******************************************************************************
  89.  **                                                                             **
  90.  **        Creation and destruction                                             **
  91.  **        Note that this is not a QuickDraw 3D object                             **
  92.  **                                                                             **
  93.  *****************************************************************************/
  94.  
  95. Q3VIEWER_EXPORT TQ3WinViewerObject Q3WinViewerNew (
  96.     HANDLE hInstance, 
  97.     HWND window, 
  98.     const RECT *rect, 
  99.     unsigned long flags);
  100.  
  101. Q3VIEWER_EXPORT TQ3Status Q3WinViewerDispose(
  102.     TQ3WinViewerObject    theWinViewer);
  103.  
  104. /******************************************************************************
  105.  **                                                                             **
  106.  **        Functions to attach data to a WinViewer                                 **
  107.  **                                                                             **
  108.  *****************************************************************************/
  109. Q3VIEWER_EXPORT TQ3Status Q3WinViewerUseFile(
  110.     TQ3WinViewerObject    theWinViewer,
  111.     HANDLE                fileHandle);
  112.  
  113. Q3VIEWER_EXPORT TQ3Status Q3WinViewerUseUnixPath (
  114.     TQ3WinViewerObject    theWinViewer,
  115.     char *filePath); /* temporary until we
  116.                                                               have a win storage */
  117.  
  118. Q3VIEWER_EXPORT TQ3Status Q3WinViewerUseData(
  119.     TQ3WinViewerObject    theWinViewer,
  120.     void                *data,
  121.     unsigned long        size);
  122.  
  123. /******************************************************************************
  124.  **                                                                             **
  125.  **        Functions to write data out from the WinViewer                         **
  126.  **                                                                             **
  127.  *****************************************************************************/
  128.  
  129. Q3VIEWER_EXPORT TQ3Status Q3WinViewerWriteFile(
  130.     TQ3WinViewerObject    theWinViewer,
  131.     HANDLE                fileHandle);
  132.  
  133. Q3VIEWER_EXPORT unsigned long Q3WinViewerWriteData(
  134.     TQ3WinViewerObject    theWinViewer,
  135.     void                **data);
  136.  
  137. /******************************************************************************
  138.  **                                                                             **
  139.  **        Use this function to force the WinViewer to re-draw                     **
  140.  **                                                                             **
  141.  *****************************************************************************/
  142.  
  143. Q3VIEWER_EXPORT TQ3Status Q3WinViewerDraw(
  144.     TQ3WinViewerObject    theWinViewer);
  145.  
  146. Q3VIEWER_EXPORT TQ3Status Q3WinViewerDrawContent(
  147.     TQ3WinViewerObject theViewer);
  148.  
  149. Q3VIEWER_EXPORT TQ3Status Q3WinViewerDrawControlStrip(
  150.     TQ3WinViewerObject theViewer);
  151.  
  152.  
  153. /******************************************************************************
  154.  **                                                                             **
  155.  **        Function used by the WinViewer to filter and handle events             **
  156.  **                                                                             **
  157.  *****************************************************************************/
  158.  
  159. Q3VIEWER_EXPORT TQ3Status Q3WinViewerMouseDown(
  160.     TQ3WinViewerObject    theWinViewer,
  161.     long                x,
  162.     long                y);
  163.  
  164. Q3VIEWER_EXPORT TQ3Status Q3WinViewerContinueTracking(
  165.     TQ3WinViewerObject    theWinViewer,
  166.     long                x,
  167.     long                y);
  168.  
  169. Q3VIEWER_EXPORT TQ3Status Q3WinViewerMouseUp(
  170.     TQ3WinViewerObject    theWinViewer,
  171.     long                x,
  172.     long                y);
  173.  
  174. /* TBD: Re-parameterize using params from WM_CHAR and WM_KEYDOWN, WM_KEYUP
  175.  
  176. Q3VIEWER_EXPORT TQ3Status Q3WinViewerKeyDown(
  177.     TQ3WinViewerObject    theWinViewer,
  178.     unsigned char        keyCode,
  179.     unsigned short        characterCode,
  180.     unsigned short        flags);
  181.  
  182. Q3VIEWER_EXPORT TQ3Status Q3WinViewerKeyUp(
  183.     TQ3WinViewerObject    theWinViewer,
  184.     unsigned char        keyCode,
  185.     unsigned short        characterCode,
  186.     unsigned short        flags);
  187. */
  188.  
  189. Q3VIEWER_EXPORT TQ3Status Q3WinViewerActivate(
  190.     TQ3WinViewerObject theWinViewer);
  191.  
  192. Q3VIEWER_EXPORT TQ3Status Q3WinViewerDeactivate(
  193.     TQ3WinViewerObject theWinViewer);
  194.  
  195. /******************************************************************************
  196.  **                                                                             **
  197.  **        This function returns a Bitmap of the contents of the                  **
  198.  **        WinViewer's window.  The application should dispose the Bitmap.         **
  199.  **                                                                             **
  200.  *****************************************************************************/
  201.  
  202. Q3VIEWER_EXPORT HBITMAP Q3WinViewerGetBitmap(
  203.     TQ3WinViewerObject    theWinViewer);
  204.  
  205. /******************************************************************************
  206.  **                                                                             **
  207.  **        Calls for dealing with Buttons                                         **
  208.  **                                                                             **
  209.  *****************************************************************************/
  210.  
  211. Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetButtonRect(
  212.     TQ3WinViewerObject    theWinViewer,
  213.     unsigned long        button,
  214.     RECT                *rectangle);
  215.  
  216. Q3VIEWER_EXPORT unsigned long Q3WinViewerGetCurrentButton(
  217.     TQ3WinViewerObject    theWinViewer);
  218.     
  219. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetCurrentButton(
  220.     TQ3WinViewerObject    theWinViewer,
  221.     unsigned long        button);
  222.  
  223. /******************************************************************************
  224.  **                                                                             **
  225.  **        Functions to set/get the group to be displayed by the WinViewer.     **
  226.  **                                                                             **
  227.  *****************************************************************************/
  228.  
  229. Q3VIEWER_EXPORT TQ3Status Q3WinViewerUseGroup(
  230.     TQ3WinViewerObject    theWinViewer,
  231.     TQ3GroupObject        group);
  232.     
  233. Q3VIEWER_EXPORT TQ3GroupObject Q3WinViewerGetGroup(
  234.     TQ3WinViewerObject    theWinViewer);
  235.  
  236. /******************************************************************************
  237.  **                                                                             **
  238.  **        Functions to set/get the color used to clear the window                 **
  239.  **                                                                             **
  240.  *****************************************************************************/
  241.  
  242. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetBackgroundColor(
  243.     TQ3WinViewerObject    theWinViewer,
  244.     TQ3ColorARGB        *color);
  245.     
  246. Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetBackgroundColor(
  247.     TQ3WinViewerObject    theWinViewer,
  248.     TQ3ColorARGB        *color);
  249.  
  250. /******************************************************************************
  251.  **                                                                             **
  252.  **        Getting/Setting a WinViewer's View object.  Disposal is needed.         **
  253.  **                                                                             **
  254.  *****************************************************************************/
  255.  
  256. Q3VIEWER_EXPORT TQ3ViewObject Q3WinViewerGetView(
  257.     TQ3WinViewerObject    theWinViewer);
  258.  
  259. Q3VIEWER_EXPORT TQ3Status Q3WinViewerRestoreView(
  260.     TQ3WinViewerObject    theWinViewer);
  261.  
  262. /******************************************************************************
  263.  **                                                                             **
  264.  **        Calls for setting/getting WinViewer flags                             **
  265.  **                                                                             **
  266.  *****************************************************************************/
  267.  
  268. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetFlags(
  269.     TQ3WinViewerObject    theWinViewer,
  270.     unsigned long        flags);
  271.  
  272. Q3VIEWER_EXPORT unsigned long Q3WinViewerGetFlags(
  273.     TQ3WinViewerObject    theWinViewer);
  274.  
  275. /******************************************************************************
  276.  **                                                                             **
  277.  **        Calls related to bounds/dimensions.  Bounds is the size of              **
  278.  **        the window.  Dimensions can either be the Rect from the ViewHints     **
  279.  **        or the current dimensions of the window (if you do a Set).             **
  280.  **                                                                             **
  281.  *****************************************************************************/
  282.  
  283. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetBounds(
  284.     TQ3WinViewerObject    theWinViewer,
  285.     RECT                *bounds);
  286.     
  287. Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetBounds(
  288.     TQ3WinViewerObject    theWinViewer,
  289.     RECT                *bounds);
  290.  
  291. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetDimension(
  292.     TQ3WinViewerObject    theViewer,
  293.     unsigned long    width,
  294.     unsigned long    height);
  295.  
  296. Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetDimension(
  297.     TQ3WinViewerObject    theWinViewer,
  298.     unsigned long        *width,
  299.     unsigned long        *height);
  300.  
  301. Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetMininumDimension(
  302.     TQ3WinViewerObject    theViewer,
  303.     unsigned long    *width,
  304.     unsigned long    *height);
  305.  
  306. /******************************************************************************
  307.  **                                                                             **
  308.  **        Window related calls                                                 **
  309.  **                                                                             **
  310.  *****************************************************************************/
  311.  
  312. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetWindow(
  313.     TQ3WinViewerObject    theWinViewer,
  314.     HWND                aWindow);
  315.     
  316. Q3VIEWER_EXPORT HWND Q3WinViewerGetWindow(
  317.     TQ3WinViewerObject    theWinViewer);
  318.  
  319. /******************************************************************************
  320.  **                                                                             **
  321.  **        Adjust Cursor should be called from idle loop to allow the WinViewer **
  322.  **        to change the cursor according to the cursor position/object under     **
  323.  **        the cursor.                                                             **
  324.  **                                                                             **
  325.  *****************************************************************************/
  326.  
  327. Q3VIEWER_EXPORT TQ3Boolean Q3WinViewerAdjustCursor(
  328.     TQ3WinViewerObject    theWinViewer,
  329.     long                x,
  330.     long                y);
  331.  
  332. Q3VIEWER_EXPORT TQ3Status Q3WinViewerCursorChanged(
  333.     TQ3WinViewerObject    theViewer);
  334.  
  335. /******************************************************************************
  336.  **                                                                             **
  337.  **        Returns the state of the WinViewer.  See the constant defined at the **
  338.  **        top of this file.                                                     **
  339.  **                                                                             **
  340.  *****************************************************************************/
  341.  
  342. Q3VIEWER_EXPORT unsigned long Q3WinViewerGetState(
  343.     TQ3WinViewerObject    theWinViewer);
  344.  
  345. /******************************************************************************
  346.  **                                                                             **
  347.  **        Clipboard utilities                                                     **
  348.  **                                                                             **
  349.  *****************************************************************************/
  350.  
  351. Q3VIEWER_EXPORT TQ3Status Q3WinViewerClear(
  352.     TQ3WinViewerObject    theWinViewer);
  353.     
  354. Q3VIEWER_EXPORT TQ3Status Q3WinViewerCut(
  355.     TQ3WinViewerObject    theWinViewer);
  356.     
  357. Q3VIEWER_EXPORT TQ3Status Q3WinViewerCopy(
  358.     TQ3WinViewerObject    theWinViewer);
  359.     
  360. Q3VIEWER_EXPORT TQ3Status Q3WinViewerPaste(
  361.     TQ3WinViewerObject    theWinViewer);
  362.  
  363. /******************************************************************************
  364.  **                                                                             **
  365.  **        Drawing CallBack                                                     **
  366.  **                                                                             **
  367.  *****************************************************************************/
  368.  
  369. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetDrawingCallbackMethod(
  370.         TQ3WinViewerObject                    theViewer,
  371.         TQ3WinViewerDrawingCallbackMethod    callbackMethod,
  372.         const void *data);
  373.  
  374. /******************************************************************************
  375.  **                                                                             **
  376.  **        Undo                                                                  **
  377.  **                                                                             **
  378.  *****************************************************************************/
  379.  
  380. Q3VIEWER_EXPORT TQ3Status     Q3WinViewerUndo(
  381.             TQ3WinViewerObject    theViewer);
  382.         
  383. TQ3Boolean Q3WinViewerGetUndoString(
  384.             TQ3WinViewerObject    theViewer, 
  385.             char             *string,
  386.             unsigned long     *cnt);
  387.  
  388. /******************************************************************************
  389.  **                                                                             **
  390.  **        New Camera Stuff                                                     **
  391.  **                                                                             **
  392.  *****************************************************************************/
  393.  
  394.  
  395. Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetCameraCnt(
  396.         TQ3WinViewerObject    theViewer, 
  397.         unsigned long     *cnt);
  398.  
  399. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetCameraNumber(
  400.         TQ3WinViewerObject    theViewer, 
  401.         unsigned long     cameraNo);
  402.  
  403. Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetCameraView(
  404.         TQ3WinViewerObject        theViewer, 
  405.         TQ3ViewerCameraView viewType);
  406.  
  407. #ifdef __cplusplus
  408. }
  409. #endif    /* __cplusplus */
  410.  
  411. #endif     /* OS_WINDOWS */
  412.  
  413. #endif    /* QD3DWinViewer_h */
  414.  
  415.