home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- ** **
- ** Module: QD3DWinViewer.h **
- ** **
- ** Purpose: WinViewer Controller Interface File. **
- ** **
- ** Copyright (C) 1996 Apple Computer, Inc. All rights reserved. **
- ** **
- *****************************************************************************/
-
- #ifndef QD3DWinViewer_h
- #define QD3DWinViewer_h
-
- #include "QD3D.h"
- #include "QD3DGroup.h"
-
- #if defined(OS_WIN32) && OS_WIN32
-
- #include <windows.h>
-
- #if defined(_MSC_VER) /* Microsoft Visual C */
- #if defined(Q3VIEWER_EXPORTING) // define when building DLL
- #define Q3VIEWER_EXPORT __declspec( dllexport )
- #else
- #define Q3VIEWER_EXPORT __declspec( dllimport )
- #endif //WIN32_EXPORTING
- #else
- #define Q3VIEWER_EXPORT
- #endif /* _MSC_VER */
-
- typedef void *TQ3WinViewerObject;
-
- typedef TQ3Status (*TQ3WinViewerDrawingCallbackMethod)(
- TQ3WinViewerObject theViewer,
- const void *data);
-
- enum {
- kQ3ViewerShowBadge = 1<<0,
- kQ3ViewerActive = 1<<1,
- kQ3ViewerControllerVisible = 1<<2,
- kQ3ViewerDrawFrame = 1<<3,
- kQ3ViewerDraggingOff = 1<<4,
-
- kQ3ViewerButtonCamera = 1<<5,
- kQ3ViewerButtonTruck = 1<<6,
- kQ3ViewerButtonOrbit = 1<<7,
- kQ3ViewerButtonZoom = 1<<8,
- kQ3ViewerButtonDolly = 1<<9,
- kQ3ViewerButtonReset = 1<<10,
-
- kQ3ViewerOutputTextMode = 1<<11,
- kQ3ViewerDragMode = 1<<12,
-
- kQ3ViewerDrawGrowBox = 1<<13,
- kQ3ViewerDrawDragBorder = 1<<14,
-
- kQ3ViewerDraggingInOff = 1<<15,
- kQ3ViewerDraggingOutOff = 1<<16,
-
- kQ3ViewerDefault = 1<<31
- };
-
-
- enum {
- kQ3ViewerEmpty = 0,
- kQ3ViewerHasModel = 1<<0,
- kQ3ViewerHasUndo = 1<<1
- };
-
- typedef enum TQ3ViewerCameraView {
- kQ3ViewerCameraRestore,
- kQ3ViewerCameraFit,
- kQ3ViewerCameraFront,
- kQ3ViewerCameraBack,
- kQ3ViewerCameraLeft,
- kQ3ViewerCameraRight,
- kQ3ViewerCameraTop,
- kQ3ViewerCameraBottom
- } TQ3ViewerCameraView;
-
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
-
- Q3VIEWER_EXPORT ATOM Q3WinInitializeViewerWindowClass (HANDLE hInstance);
-
-
- /******************************************************************************
- ** **
- ** Creation and destruction **
- ** Note that this is not a QuickDraw 3D object **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3WinViewerObject Q3WinViewerNew (
- HANDLE hInstance,
- HWND window,
- const RECT *rect,
- unsigned long flags);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerDispose(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Functions to attach data to a WinViewer **
- ** **
- *****************************************************************************/
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerUseFile(
- TQ3WinViewerObject theWinViewer,
- HANDLE fileHandle);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerUseUnixPath (
- TQ3WinViewerObject theWinViewer,
- char *filePath); /* temporary until we
- have a win storage */
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerUseData(
- TQ3WinViewerObject theWinViewer,
- void *data,
- unsigned long size);
-
- /******************************************************************************
- ** **
- ** Functions to write data out from the WinViewer **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerWriteFile(
- TQ3WinViewerObject theWinViewer,
- HANDLE fileHandle);
-
- Q3VIEWER_EXPORT unsigned long Q3WinViewerWriteData(
- TQ3WinViewerObject theWinViewer,
- void **data);
-
- /******************************************************************************
- ** **
- ** Use this function to force the WinViewer to re-draw **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerDraw(
- TQ3WinViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerDrawContent(
- TQ3WinViewerObject theViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerDrawControlStrip(
- TQ3WinViewerObject theViewer);
-
-
- /******************************************************************************
- ** **
- ** Function used by the WinViewer to filter and handle events **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerMouseDown(
- TQ3WinViewerObject theWinViewer,
- long x,
- long y);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerContinueTracking(
- TQ3WinViewerObject theWinViewer,
- long x,
- long y);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerMouseUp(
- TQ3WinViewerObject theWinViewer,
- long x,
- long y);
-
- /* TBD: Re-parameterize using params from WM_CHAR and WM_KEYDOWN, WM_KEYUP
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerKeyDown(
- TQ3WinViewerObject theWinViewer,
- unsigned char keyCode,
- unsigned short characterCode,
- unsigned short flags);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerKeyUp(
- TQ3WinViewerObject theWinViewer,
- unsigned char keyCode,
- unsigned short characterCode,
- unsigned short flags);
- */
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerActivate(
- TQ3WinViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerDeactivate(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** This function returns a Bitmap of the contents of the **
- ** WinViewer's window. The application should dispose the Bitmap. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT HBITMAP Q3WinViewerGetBitmap(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Calls for dealing with Buttons **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetButtonRect(
- TQ3WinViewerObject theWinViewer,
- unsigned long button,
- RECT *rectangle);
-
- Q3VIEWER_EXPORT unsigned long Q3WinViewerGetCurrentButton(
- TQ3WinViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetCurrentButton(
- TQ3WinViewerObject theWinViewer,
- unsigned long button);
-
- /******************************************************************************
- ** **
- ** Functions to set/get the group to be displayed by the WinViewer. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerUseGroup(
- TQ3WinViewerObject theWinViewer,
- TQ3GroupObject group);
-
- Q3VIEWER_EXPORT TQ3GroupObject Q3WinViewerGetGroup(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Functions to set/get the color used to clear the window **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetBackgroundColor(
- TQ3WinViewerObject theWinViewer,
- TQ3ColorARGB *color);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetBackgroundColor(
- TQ3WinViewerObject theWinViewer,
- TQ3ColorARGB *color);
-
- /******************************************************************************
- ** **
- ** Getting/Setting a WinViewer's View object. Disposal is needed. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3ViewObject Q3WinViewerGetView(
- TQ3WinViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerRestoreView(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Calls for setting/getting WinViewer flags **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetFlags(
- TQ3WinViewerObject theWinViewer,
- unsigned long flags);
-
- Q3VIEWER_EXPORT unsigned long Q3WinViewerGetFlags(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Calls related to bounds/dimensions. Bounds is the size of **
- ** the window. Dimensions can either be the Rect from the ViewHints **
- ** or the current dimensions of the window (if you do a Set). **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetBounds(
- TQ3WinViewerObject theWinViewer,
- RECT *bounds);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetBounds(
- TQ3WinViewerObject theWinViewer,
- RECT *bounds);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetDimension(
- TQ3WinViewerObject theViewer,
- unsigned long width,
- unsigned long height);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetDimension(
- TQ3WinViewerObject theWinViewer,
- unsigned long *width,
- unsigned long *height);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetMininumDimension(
- TQ3WinViewerObject theViewer,
- unsigned long *width,
- unsigned long *height);
-
- /******************************************************************************
- ** **
- ** Window related calls **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetWindow(
- TQ3WinViewerObject theWinViewer,
- HWND aWindow);
-
- Q3VIEWER_EXPORT HWND Q3WinViewerGetWindow(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Adjust Cursor should be called from idle loop to allow the WinViewer **
- ** to change the cursor according to the cursor position/object under **
- ** the cursor. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Boolean Q3WinViewerAdjustCursor(
- TQ3WinViewerObject theWinViewer,
- long x,
- long y);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerCursorChanged(
- TQ3WinViewerObject theViewer);
-
- /******************************************************************************
- ** **
- ** Returns the state of the WinViewer. See the constant defined at the **
- ** top of this file. **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT unsigned long Q3WinViewerGetState(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Clipboard utilities **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerClear(
- TQ3WinViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerCut(
- TQ3WinViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerCopy(
- TQ3WinViewerObject theWinViewer);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerPaste(
- TQ3WinViewerObject theWinViewer);
-
- /******************************************************************************
- ** **
- ** Drawing CallBack **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetDrawingCallbackMethod(
- TQ3WinViewerObject theViewer,
- TQ3WinViewerDrawingCallbackMethod callbackMethod,
- const void *data);
-
- /******************************************************************************
- ** **
- ** Undo **
- ** **
- *****************************************************************************/
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerUndo(
- TQ3WinViewerObject theViewer);
-
- TQ3Boolean Q3WinViewerGetUndoString(
- TQ3WinViewerObject theViewer,
- char *string,
- unsigned long *cnt);
-
- /******************************************************************************
- ** **
- ** New Camera Stuff **
- ** **
- *****************************************************************************/
-
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerGetCameraCnt(
- TQ3WinViewerObject theViewer,
- unsigned long *cnt);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetCameraNumber(
- TQ3WinViewerObject theViewer,
- unsigned long cameraNo);
-
- Q3VIEWER_EXPORT TQ3Status Q3WinViewerSetCameraView(
- TQ3WinViewerObject theViewer,
- TQ3ViewerCameraView viewType);
-
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
-
- #endif /* OS_WINDOWS */
-
- #endif /* QD3DWinViewer_h */
-
-