QD3DWinViewer.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:22k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       QD3DWinViewer.h
  3.  
  4.      Contains:   Win32 Viewer Controller Interface File.
  5.  
  6.      Version:    Technology: Quickdraw 3D 1.6
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1995-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QD3DWINVIEWER__
  18. #define __QD3DWINVIEWER__
  19. #ifndef __QD3D__
  20. #include "QD3D.h"
  21. #endif
  22. #ifndef __QD3DGROUP__
  23. #include "QD3DGroup.h"
  24. #endif
  25. #if TARGET_OS_WIN32
  26. #include "windows.h"
  27. #endif
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37. #if PRAGMA_STRUCT_ALIGN
  38.     #pragma options align=power
  39. #elif PRAGMA_STRUCT_PACKPUSH
  40.     #pragma pack(push, 2)
  41. #elif PRAGMA_STRUCT_PACK
  42.     #pragma pack(2)
  43. #endif
  44. #if PRAGMA_ENUM_ALWAYSINT
  45.     #if defined(__fourbyteints__) && !__fourbyteints__ 
  46.         #define __QD3DWINVIEWER__RESTORE_TWOBYTEINTS
  47.         #pragma fourbyteints on
  48.     #endif
  49.     #pragma enumsalwaysint on
  50. #elif PRAGMA_ENUM_OPTIONS
  51.     #pragma option enum=int
  52. #elif PRAGMA_ENUM_PACK
  53.     #if __option(pack_enums)
  54.         #define __QD3DWINVIEWER__RESTORE_PACKED_ENUMS
  55.         #pragma options(!pack_enums)
  56.     #endif
  57. #endif
  58. #if TARGET_OS_WIN32
  59. typedef void *                          TQ3ViewerObject;
  60. typedef CALLBACK_API_C( TQ3Status , TQ3ViewerDrawingCallbackMethod )(TQ3ViewerObject theViewer, const void *data);
  61. typedef CALLBACK_API_C( TQ3Status , TQ3ViewerWindowResizeCallbackMethod )(TQ3ViewerObject theViewer, const void *data);
  62. typedef CALLBACK_API_C( TQ3Status , TQ3ViewerPaneResizeNotifyCallbackMethod )(TQ3ViewerObject theViewer, const void *data);
  63. enum {
  64.     kQ3ViewerShowBadge          = 1 << 0,
  65.     kQ3ViewerActive             = 1 << 1,
  66.     kQ3ViewerControllerVisible  = 1 << 2,
  67.     kQ3ViewerButtonCamera       = 1 << 3,
  68.     kQ3ViewerButtonTruck        = 1 << 4,
  69.     kQ3ViewerButtonOrbit        = 1 << 5,
  70.     kQ3ViewerButtonZoom         = 1 << 6,
  71.     kQ3ViewerButtonDolly        = 1 << 7,
  72.     kQ3ViewerButtonReset        = 1 << 8,
  73.     kQ3ViewerButtonNone         = 1 << 9,
  74.     kQ3ViewerOutputTextMode     = 1 << 10,
  75.     kQ3ViewerDraggingInOff      = 1 << 11,
  76.     kQ3ViewerButtonOptions      = 1 << 12,
  77.     kQ3ViewerPaneGrowBox        = 1 << 13,
  78.     kQ3ViewerDefault            = 1 << 15
  79. };
  80. enum {
  81.     kQ3ViewerEmpty              = 0,
  82.     kQ3ViewerHasModel           = 1 << 0,
  83.     kQ3ViewerHasUndo            = 1 << 1
  84. };
  85. enum TQ3ViewerCameraView {
  86.     kQ3ViewerCameraRestore      = 0,
  87.     kQ3ViewerCameraFit          = 1,
  88.     kQ3ViewerCameraFront        = 2,
  89.     kQ3ViewerCameraBack         = 3,
  90.     kQ3ViewerCameraLeft         = 4,
  91.     kQ3ViewerCameraRight        = 5,
  92.     kQ3ViewerCameraTop          = 6,
  93.     kQ3ViewerCameraBottom       = 7
  94. };
  95. typedef enum TQ3ViewerCameraView TQ3ViewerCameraView;
  96. /******************************************************************************
  97.  **                                                                          **
  98.  **                             WM_NOTIFY structures                         **
  99.  **                                                                          **
  100.  *****************************************************************************/
  101. struct TQ3ViewerDropFiles {
  102.     NMHDR                           nmhdr;
  103.     HANDLE                          hDrop;
  104. };
  105. typedef struct TQ3ViewerDropFiles       TQ3ViewerDropFiles;
  106. struct TQ3ViewerSetView {
  107.     NMHDR                           nmhdr;
  108.     TQ3ViewerCameraView             view;
  109. };
  110. typedef struct TQ3ViewerSetView         TQ3ViewerSetView;
  111. struct TQ3ViewerSetViewNumber {
  112.     NMHDR                           nmhdr;
  113.     unsigned long                   number;
  114. };
  115. typedef struct TQ3ViewerSetViewNumber   TQ3ViewerSetViewNumber;
  116. struct TQ3ViewerButtonSet {
  117.     NMHDR                           nmhdr;
  118.     unsigned long                   button;
  119. };
  120. typedef struct TQ3ViewerButtonSet       TQ3ViewerButtonSet;
  121. /******************************************************************************
  122.  **                                                                          **
  123.  **                             WM_NOTIFY defines                            **
  124.  **                                                                          **
  125.  *****************************************************************************/
  126. #define Q3VNM_DROPFILES        0x5000
  127. #define Q3VNM_CANUNDO        0x5001
  128. #define Q3VNM_DRAWCOMPLETE   0x5002
  129. #define Q3VNM_SETVIEW        0x5003
  130. #define Q3VNM_SETVIEWNUMBER  0x5004
  131. #define Q3VNM_BUTTONSET      0x5005
  132. #define Q3VNM_BADGEHIT       0x5006
  133. /******************************************************************************
  134.  **                                                                          **
  135.  **                         Win32 Window Class Name                          **
  136.  **     Can be passed as a parameter to CreateWindow or CreateWindowEx       **
  137.  **                                                                          **
  138.  *****************************************************************************/
  139. #define kQ3ViewerClassName "QD3DViewerWindow"
  140. /******************************************************************************
  141.  **                                                                          **
  142.  **                         Win32 Clipboard type                             **
  143.  **                                                                          **
  144.  *****************************************************************************/
  145. #define kQ3ViewerClipboardFormat "QuickDraw 3D Metafile"
  146. /******************************************************************************
  147.  **                                                                          **
  148.  **     Return viewer version number                                         **
  149.  **                                                                          **
  150.  *****************************************************************************/
  151. #if CALL_NOT_IN_CARBON
  152. EXTERN_API_C( TQ3Status )
  153. Q3WinViewerGetVersion           (unsigned long *        majorRevision,
  154.                                  unsigned long *        minorRevision);
  155. /******************************************************************************
  156.  **                                                                          **
  157.  **     Return viewer release version number                                 **
  158.  **     (in 'vers' format - e.g. 0x01518000 ==> 1.5.1 release)               **
  159.  **                                                                          **
  160.  *****************************************************************************/
  161. EXTERN_API_C( TQ3Status )
  162. Q3WinViewerGetReleaseVersion    (unsigned long *        releaseRevision);
  163. /******************************************************************************
  164.  **                                                                          **
  165.  **                     Creation and destruction                             **
  166.  **             Note that this is not a QuickDraw 3D object                  **
  167.  **                                                                          **
  168.  *****************************************************************************/
  169. EXTERN_API_C( TQ3ViewerObject )
  170. Q3WinViewerNew                  (HWND                   window,
  171.                                  const RECT *           rect,
  172.                                  unsigned long          flags);
  173. EXTERN_API_C( TQ3Status )
  174. Q3WinViewerDispose              (TQ3ViewerObject        viewer);
  175. /******************************************************************************
  176.  **                                                                          **
  177.  **                 Functions to attach data to a WinViewer                  **
  178.  **                                                                          **
  179.  *****************************************************************************/
  180. EXTERN_API_C( TQ3Status )
  181. Q3WinViewerUseFile              (TQ3ViewerObject        viewer,
  182.                                  HANDLE                 fileHandle);
  183. EXTERN_API_C( TQ3Status )
  184. Q3WinViewerUseData              (TQ3ViewerObject        viewer,
  185.                                  void *                 data,
  186.                                  unsigned long          size);
  187. /******************************************************************************
  188.  **                                                                          **
  189.  **             Functions to write data out from the WinViewer               **
  190.  **                                                                          **
  191.  *****************************************************************************/
  192. EXTERN_API_C( TQ3Status )
  193. Q3WinViewerWriteFile            (TQ3ViewerObject        viewer,
  194.                                  HANDLE                 fileHandle);
  195. EXTERN_API_C( TQ3Status )
  196. Q3WinViewerWriteData            (TQ3ViewerObject        viewer,
  197.                                  void *                 data,
  198.                                  unsigned long          dataSize,
  199.                                  unsigned long *        actualDataSize);
  200. /******************************************************************************
  201.  **                                                                          **
  202.  **     Use this function to force the WinViewer to re-draw                  **
  203.  **                                                                          **
  204.  *****************************************************************************/
  205. EXTERN_API_C( TQ3Status )
  206. Q3WinViewerDraw                 (TQ3ViewerObject        viewer);
  207. EXTERN_API_C( TQ3Status )
  208. Q3WinViewerDrawContent          (TQ3ViewerObject        viewer);
  209. EXTERN_API_C( TQ3Status )
  210. Q3WinViewerDrawControlStrip     (TQ3ViewerObject        viewer);
  211. /******************************************************************************
  212.  **                                                                          **
  213.  **     Function used by the WinViewer to filter and handle events           **
  214.  **                                                                          **
  215.  *****************************************************************************/
  216. EXTERN_API_C( BOOL )
  217. Q3WinViewerMouseDown            (TQ3ViewerObject        viewer,
  218.                                  long                   x,
  219.                                  long                   y);
  220. EXTERN_API_C( BOOL )
  221. Q3WinViewerContinueTracking     (TQ3ViewerObject        viewer,
  222.                                  long                   x,
  223.                                  long                   y);
  224. EXTERN_API_C( BOOL )
  225. Q3WinViewerMouseUp              (TQ3ViewerObject        viewer,
  226.                                  long                   x,
  227.                                  long                   y);
  228. /******************************************************************************
  229.  **                                                                          **
  230.  **     This function returns a Bitmap of the contents of the                **
  231.  **     WinViewer's window.  The application should dispose the Bitmap.      **
  232.  **                                                                          **
  233.  *****************************************************************************/
  234. EXTERN_API_C( HBITMAP )
  235. Q3WinViewerGetBitmap            (TQ3ViewerObject        viewer);
  236. /******************************************************************************
  237.  **                                                                          **
  238.  **                 Calls for dealing with Buttons                           **
  239.  **                                                                          **
  240.  *****************************************************************************/
  241. EXTERN_API_C( TQ3Status )
  242. Q3WinViewerGetButtonRect        (TQ3ViewerObject        viewer,
  243.                                  unsigned long          button,
  244.                                  RECT *                 rectangle);
  245. EXTERN_API_C( unsigned long )
  246. Q3WinViewerGetCurrentButton     (TQ3ViewerObject        viewer);
  247. EXTERN_API_C( TQ3Status )
  248. Q3WinViewerSetCurrentButton     (TQ3ViewerObject        viewer,
  249.                                  unsigned long          button);
  250. /******************************************************************************
  251.  **                                                                          **
  252.  **     Functions to set/get the group to be displayed by the WinViewer.     **
  253.  **                                                                          **
  254.  *****************************************************************************/
  255. EXTERN_API_C( TQ3Status )
  256. Q3WinViewerUseGroup             (TQ3ViewerObject        viewer,
  257.                                  TQ3GroupObject         group);
  258. EXTERN_API_C( TQ3GroupObject )
  259. Q3WinViewerGetGroup             (TQ3ViewerObject        viewer);
  260. /******************************************************************************
  261.  **                                                                          **
  262.  **     Functions to set/get the color used to clear the window              **
  263.  **                                                                          **
  264.  *****************************************************************************/
  265. EXTERN_API_C( TQ3Status )
  266. Q3WinViewerSetBackgroundColor   (TQ3ViewerObject        viewer,
  267.                                  TQ3ColorARGB *         color);
  268. EXTERN_API_C( TQ3Status )
  269. Q3WinViewerGetBackgroundColor   (TQ3ViewerObject        viewer,
  270.                                  TQ3ColorARGB *         color);
  271. /******************************************************************************
  272.  **                                                                          **
  273.  **     Getting/Setting a WinViewer's View object.                           **
  274.  **                                                                          **
  275.  *****************************************************************************/
  276. EXTERN_API_C( TQ3ViewObject )
  277. Q3WinViewerGetView              (TQ3ViewerObject        viewer);
  278. EXTERN_API_C( TQ3Status )
  279. Q3WinViewerRestoreView          (TQ3ViewerObject        viewer);
  280. /******************************************************************************
  281.  **                                                                          **
  282.  **     Calls for setting/getting WinViewer flags                            **
  283.  **                                                                          **
  284.  *****************************************************************************/
  285. EXTERN_API_C( TQ3Status )
  286. Q3WinViewerSetFlags             (TQ3ViewerObject        viewer,
  287.                                  unsigned long          flags);
  288. EXTERN_API_C( unsigned long )
  289. Q3WinViewerGetFlags             (TQ3ViewerObject        viewer);
  290. /******************************************************************************
  291.  **                                                                          **
  292.  **     Calls related to bounds/dimensions.  Bounds is the size of           **
  293.  **     the window.  Dimensions can either be the Rect from the ViewHints    **
  294.  **     or the current dimensions of the window (if you do a Set).           **
  295.  **                                                                          **
  296.  *****************************************************************************/
  297. EXTERN_API_C( TQ3Status )
  298. Q3WinViewerSetBounds            (TQ3ViewerObject        viewer,
  299.                                  RECT *                 bounds);
  300. EXTERN_API_C( TQ3Status )
  301. Q3WinViewerGetBounds            (TQ3ViewerObject        viewer,
  302.                                  RECT *                 bounds);
  303. EXTERN_API_C( TQ3Status )
  304. Q3WinViewerSetDimension         (TQ3ViewerObject        viewer,
  305.                                  unsigned long          width,
  306.                                  unsigned long          height);
  307. EXTERN_API_C( TQ3Status )
  308. Q3WinViewerGetDimension         (TQ3ViewerObject        viewer,
  309.                                  unsigned long *        width,
  310.                                  unsigned long *        height);
  311. EXTERN_API_C( TQ3Status )
  312. Q3WinViewerGetMinimumDimension  (TQ3ViewerObject        viewer,
  313.                                  unsigned long *        width,
  314.                                  unsigned long *        height);
  315. /******************************************************************************
  316.  **                                                                          **
  317.  **                         Window related calls                             **
  318.  **                                                                          **
  319.  *****************************************************************************/
  320. EXTERN_API_C( TQ3Status )
  321. Q3WinViewerSetWindow            (TQ3ViewerObject        viewer,
  322.                                  HWND                   window);
  323. EXTERN_API_C( HWND )
  324. Q3WinViewerGetWindow            (TQ3ViewerObject        viewer);
  325. EXTERN_API_C( TQ3ViewerObject )
  326. Q3WinViewerGetViewer            (HWND                   theWindow);
  327. EXTERN_API_C( HWND )
  328. Q3WinViewerGetControlStrip      (TQ3ViewerObject        viewer);
  329. /******************************************************************************
  330.  **                                                                          **
  331.  **     Adjust Cursor provided for compatibility with Mac Viewer             **
  332.  **                                                                          **
  333.  *****************************************************************************/
  334. EXTERN_API_C( TQ3Boolean )
  335. Q3WinViewerAdjustCursor         (TQ3ViewerObject        viewer,
  336.                                  long                   x,
  337.                                  long                   y);
  338. EXTERN_API_C( TQ3Status )
  339. Q3WinViewerCursorChanged        (TQ3ViewerObject        viewer);
  340. /******************************************************************************
  341.  **                                                                          **
  342.  **     Returns the state of the WinViewer.  See the constant defined at the **
  343.  **     top of this file.                                                    **
  344.  **                                                                          **
  345.  *****************************************************************************/
  346. EXTERN_API_C( unsigned long )
  347. Q3WinViewerGetState             (TQ3ViewerObject        viewer);
  348. /******************************************************************************
  349.  **                                                                          **
  350.  **                         Clipboard utilities                              **
  351.  **                                                                          **
  352.  *****************************************************************************/
  353. EXTERN_API_C( TQ3Status )
  354. Q3WinViewerClear                (TQ3ViewerObject        viewer);
  355. EXTERN_API_C( TQ3Status )
  356. Q3WinViewerCut                  (TQ3ViewerObject        viewer);
  357. EXTERN_API_C( TQ3Status )
  358. Q3WinViewerCopy                 (TQ3ViewerObject        viewer);
  359. EXTERN_API_C( TQ3Status )
  360. Q3WinViewerPaste                (TQ3ViewerObject        viewer);
  361. /******************************************************************************
  362.  **                                                                          **
  363.  **                             Undo                                         **
  364.  **                                                                          **
  365.  *****************************************************************************/
  366. EXTERN_API_C( TQ3Status )
  367. Q3WinViewerUndo                 (TQ3ViewerObject        viewer);
  368. EXTERN_API_C( TQ3Boolean )
  369. Q3WinViewerGetUndoString        (TQ3ViewerObject        viewer,
  370.                                  char *                 theString,
  371.                                  unsigned long          stringSize,
  372.                                  unsigned long *        actualSize);
  373. /******************************************************************************
  374.  **                                                                          **
  375.  **                         New Camera Stuff                                 **
  376.  **                                                                          **
  377.  *****************************************************************************/
  378. EXTERN_API_C( TQ3Status )
  379. Q3WinViewerGetCameraCount       (TQ3ViewerObject        viewer,
  380.                                  unsigned long *        count);
  381. EXTERN_API_C( TQ3Status )
  382. Q3WinViewerSetCameraNumber      (TQ3ViewerObject        viewer,
  383.                                  unsigned long          cameraNo);
  384. EXTERN_API_C( TQ3Status )
  385. Q3WinViewerSetCameraView        (TQ3ViewerObject        viewer,
  386.                                  TQ3ViewerCameraView    viewType);
  387. #endif  /* CALL_NOT_IN_CARBON */
  388. #endif  /* TARGET_OS_WIN32 */
  389. #if PRAGMA_ENUM_ALWAYSINT
  390.     #pragma enumsalwaysint reset
  391.     #ifdef __QD3DWINVIEWER__RESTORE_TWOBYTEINTS
  392.         #pragma fourbyteints off
  393.     #endif
  394. #elif PRAGMA_ENUM_OPTIONS
  395.     #pragma option enum=reset
  396. #elif defined(__QD3DWINVIEWER__RESTORE_PACKED_ENUMS)
  397.     #pragma options(pack_enums)
  398. #endif
  399. #if PRAGMA_STRUCT_ALIGN
  400.     #pragma options align=reset
  401. #elif PRAGMA_STRUCT_PACKPUSH
  402.     #pragma pack(pop)
  403. #elif PRAGMA_STRUCT_PACK
  404.     #pragma pack()
  405. #endif
  406. #ifdef PRAGMA_IMPORT_OFF
  407. #pragma import off
  408. #elif PRAGMA_IMPORT
  409. #pragma import reset
  410. #endif
  411. #ifdef __cplusplus
  412. }
  413. #endif
  414. #endif /* __QD3DWINVIEWER__ */