home *** CD-ROM | disk | FTP | other *** search
- /*==============================================================================
- Project: POV-Ray
-
- Version: 3
-
- File: PovMac.h
-
- Description:
- This file contains typedefs, function prototypes and extern var declarations
- that need to be exported from pov.c.
- ------------------------------------------------------------------------------
- Authors:
- Thomas Okken, David Lichtman, Glenn Sugden
- Jim Nitchals, Eduard [esp] Schwan
- ------------------------------------------------------------------------------
- from Persistence of Vision(tm) Ray Tracer
- Copyright 1996 Persistence of Vision Team
- ------------------------------------------------------------------------------
- NOTICE: This source code file is provided so that users may experiment
- with enhancements to POV-Ray and to port the software to platforms other
- than those supported by the POV-Ray Team. There are strict rules under
- which you are permitted to use this file. The rules are in the file
- named POVLEGAL.DOC which should be distributed with this file. If
- POVLEGAL.DOC is not available or for more info please contact the POV-Ray
- Team Coordinator by leaving a message in CompuServe's Graphics Developer's
- Forum. The latest version of POV-Ray may be found there as well.
-
- This program is based on the popular DKB raytracer version 2.12.
- DKBTrace was originally written by David K. Buck.
- DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
- ------------------------------------------------------------------------------
- Change History:
- 920815 [jln] version 1.0 Mac released.
- 920908 [esp] version 1.1 alpha Mac
- 921221 [esp] Changed to include QuickTime 1.5 Headers
- 930826 [esp] Added 1.x/2.x ifdefs in
- 931001 [esp] version 2.0 finished (Released on 10/4/93)
- 931119 [djh] 2.0.1 source conditionally compiles for PPC machines, keyword __powerc
- 940430 [esp] Preliminary 3.0a1 work
- 950629 [esp] Changed alpha app signature from 'POV0' to 'POV3'
- ==============================================================================*/
-
- #if !defined(POVMAC_H)
- #define POVMAC_H
-
-
- /*==== POV definitions =====*/
- #include "config.h"
- #include "FRAME.H"
- #include "Printf2Window.h" // p2w_WindowPtr_t
-
- /*==== Mac definitions =====*/
-
-
- /*==== QuickTime compression headers ====*/
-
- #include <ImageCompression.h>
- #include <QuickTimeComponents.h> // ComponentInstance
-
-
- /*==== Animate header ====*/
- #include "Animate.h" // for AnimRec_t definition in prefs
-
-
-
- /*==== Think to non-THINK compatibility ====*/
-
- #if !defined(THINK_C)
- #include <Strings.h> // p<->cstr
- #endif // THINK_C
-
-
- /*==== definitions ====*/
-
- // default stack size
- #define DEFAULT_STACK_SIZE 80000
-
- // #define _QD32Trap 0xAB03 /* 32 bit Quickdraw trap */
-
- #define kRsrcFileClosed (-1)
-
- /* keyboard values used by ModalFilter() */
- /*
- #define kReturnKey 0x0D
- #define kEnterKey 0x03
- #define kEscKey 0x1B
- #define kTabKey 0x09
- */
-
- /* All dialogs have a user item #3 for outlining buttons */
- // #define kDefaultItem 3
-
- /* Windows */
- #define kWindID_p2w 9600 // POV-Ray status window
-
- /* Dialog resource IDs */
- #define kdlog_P2W_INIT_ERROR 9600
-
- #define kdlog_ConfigFatalErr 129 // bad hardware/software config
- #define kdlog_GenericFatalErr 152 // general purpose fatal error dialog
- #define kdlog_CantOpenOverDirty 154 // cant open over existing busy file
- #define kdlog_CantOpenNonText 155 // cant open non-text files
- #define kdlog_UseFPUVersion 158 // Note: should use FPU version of POV-Ray
- #define kdlog_UsePPCVersion 159 // Note: should use PPC version of POV-Ray
-
- /* our application's creator signature */
- #define kAppSignature 'POV3'
-
- /* the Creator type for non-launchable POV-Ray files (like Prefs) */
- // #define kAppXtraSignature 'POVX'
- // NOTE: The above style of creating PREFs files that are not connected
- // to the app's signature was suggested by Apple at one time, since it
- // kept the app from launching if the user double-clicked the prefs file.
- // However, a more serious problem arises by doing this... "prefs-killer"
- // applications that delete prefs files whose owner doesn't exist on the
- // hard drive, mistakenly see POV-Ray's prefs file as an orphan, and
- // delete it! Therefore, because of an Apple employee's last minute bug
- // report (right before 3.0 release), I've gone ahead and changed the
- // Prefs file creator signature back to POV-Ray 3, and POVX isn't used.
-
- /* POV Menu equates */
- #define num_of_menus 7
- #define num_of_submenus 3
- #define menu_offset 128 // ID of the first menu
- #define submenu_offset 200 // ID of the first submenu
-
- /* Apple Menu */
- #define apmn_ID 128
- #define apmn_about 1
-
- /* File Menu */
- #define fmn_ID 129
- #define fmn_new 1
- #define fmn_open 2
- #define fmn_close 4
- #define fmn_save 5
- #define fmn_saveas 6
- #define fmn_revert 7
- #define fmn_quit 9
-
- /* Edit Menu */
- #define edmn_ID 130
- #define edmn_undo 1
- #define edmn_cut 3
- #define edmn_copy 4
- #define edmn_paste 5
- #define edmn_clear 6
- #define edmn_selectAll 7
- #define edmn_redo 9
- #define edmn_goto 11
- #define edmn_matchbrace 12
- #define edmn_prefs 14
-
- /* Template Menu */
- #define temn_ID 131
- #define temn_import 1
-
- /* Image Menu */
- #define immn_ID 132
- #define immn_view 1
- #define immn_dither 2
- #define immn_custom 3
- #define immn_process 4
-
- /* Render Menu */
- #define rnmn_ID 133
- #define rnmn_render 1
- #define rnmn_pause 2
- #define rnmn_stop 3
-
- /* Windows Menu */
- #define wndmn_ID 134
- #define wndmn_status 1
- #define wndmn_source 2
- #define wndmn_image 3
- #define wndmn_autoscroll 5
-
- /* View submenu */
- #define viewmn_ID 200
- #define viewmn_hidden 1
- #define viewmn_Size2Window 2
- #define viewmn_normal 3
- #define viewmn_x2 4
- #define viewmn_x3 5
- #define viewmn_x4 6
-
- /* palette submenu */
- #define plmn_ID 201
- #define palette_none 1
- #define palette_default 3
- #define palette_median 4
- #define palette_popular 5
- #define palette_var_min 6
- #define palette_octree 7
-
- /* prefs submenu */
- #define pfmn_ID 202
- #define pref_app 1
- #define pref_file 2
-
- /* don't want to collide with system equates, so... */
- #define varianceMethod 1000
- #define octreeMethod 1001
-
-
- #if !defined (min)
- #define min(x,y) ((x>y)?y:x)
- #endif // min
-
-
- // Application internal configuration settings resource (stack size, etc.)
- #define kAppConfigRsrc 'CNFG'
- #define kAppConfigRsrcID 1000
-
- typedef struct
- {
- long stackSize; // # of bytes to grow stack to
- long reserved1; // currently unused
- long reserved2; // currently unused
- } app_config_rec_t, *app_config_ptr_t, **app_config_hdl_t;
-
-
- /*==== POV-Ray engine globals ====*/
-
- // need to reference these from POV engine
- extern volatile int Stop_Flag;
- extern struct Token_Struct Token; // tokenize.c
-
-
- /*==== pov.c globals ====*/
-
- extern p2w_WindowPtr_t gp2wWindow; // the Status (text) window
-
- extern Boolean gHasAppleEvents; // Apple Events available for doing shutdown?
- extern Boolean gHas32BitQD; // is 32 bit Quickdraw available for depth & dithering
- extern Boolean gHasPictUtils; // is Picture Utils (extract best palette) avail?
- extern Boolean gHasImageCompressionMgr; // Is QuickTime Image compression available?
- extern Boolean gHasQuickTime; // Is QuickTime available?
- extern long gQTVersion; // QuicktTime version from Gestalt
- extern StringPtr gDistMessage; // concatenated from FRAME.H strings
- extern Boolean gInBackground; // is the program currently switched out
- extern Boolean gDoingRender; // for determining the menu states
- extern Rect gDragBounds; // window dragging boundary
- extern Boolean gDoingBatchODOCs; // in the middle of ODOC, postpone other odocs
- extern Boolean gCanUndo; // can we undo this operation?
- extern Boolean gCanRedo; // can we redo this operation?
- extern short gAppRefNum; // The application's resource file refnum
-
- extern Str31 gPictFname; // name of pict output file
- extern Str31 gOutFname; // name of other output file
-
- extern ComponentInstance gtheSCComponent;
-
- /*==== PowerPC-specific globals ====*/
-
-
- #include "povmacproto.h"
-
- #endif // POVMAC_H
-