home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / MacSource / AppPrefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-14  |  5.8 KB  |  187 lines  |  [TEXT/CWIE]

  1. /*==============================================================================
  2. Project:    POV-Ray
  3.  
  4. Version:    3
  5.  
  6. File:    AppPrefs.h
  7.  
  8. Description: Application preferences dialog and handlers
  9. ------------------------------------------------------------------------------
  10. Author:
  11.     Eduard [esp] Schwan
  12. ------------------------------------------------------------------------------
  13.     from Persistence of Vision(tm) Ray Tracer
  14.     Copyright 1996 Persistence of Vision Team
  15. ------------------------------------------------------------------------------
  16.     NOTICE: This source code file is provided so that users may experiment
  17.     with enhancements to POV-Ray and to port the software to platforms other 
  18.     than those supported by the POV-Ray Team.  There are strict rules under
  19.     which you are permitted to use this file.  The rules are in the file
  20.     named POVLEGAL.DOC which should be distributed with this file. If 
  21.     POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  22.     Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  23.     Forum.  The latest version of POV-Ray may be found there as well.
  24.  
  25.     This program is based on the popular DKB raytracer version 2.12.
  26.     DKBTrace was originally written by David K. Buck.
  27.     DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  28. ------------------------------------------------------------------------------
  29. Change History:
  30.     941230    [esp]    Created
  31.     950629    [esp]    Changed aPrf to APRF per registry with Apple
  32. ==============================================================================*/
  33.  
  34. #ifndef APPPREFS_H
  35. #define APPPREFS_H
  36.  
  37.  
  38. /*==== Macintosh-specific headers ====*/
  39. #include "config.h"
  40.  
  41. #include <types.h>
  42. #include <Files.h>
  43.  
  44. #include "FilePrefs.h"    // gDefltFilePrefs_h
  45. #include "povmac.h"
  46.  
  47.  
  48. // Dialog user item ID, used for default outline proc
  49. #define    kDefaultOutlineItem            3
  50.  
  51. // STR# Resource for File Names
  52. #define kSTRI_FileNames        1000
  53. #define    kSTRIi_Prefs            1
  54. #define    kSTRIi_Guide            2
  55. #define    kSTRIi_Templates        3
  56. #define    kSTRIi_INCLUDE_Def        4
  57. #define    kSTRIi_POVRAY_INI        5
  58.  
  59.  
  60. /*==== preferences resource - Application ====*/
  61.  
  62. // the resource ID of the preferences resource (POV-Ray v1.0=128, 2.0=200, 3.0=300)
  63. #define    kAppPrefs_rsrcID    300
  64. // the resource type
  65. #define    kAppPrefsRsrc        'APRF'
  66.  
  67. // The version # of the prefs resources - increment this when prefs_rec_t's change.
  68. // This currently follows the app version #, so 8352 is version
  69. //    8            3            5            2
  70. //    (beta)        3.0            release 5    Mac build 2
  71. //    Final release will clear the high nybble (83XX will become 03XX)
  72.  
  73. #define    kAppPrefs_Vers        kFilePrefs_Vers
  74.  
  75. typedef enum    // menu items
  76. {
  77.     eThrottle_Lowest=1,
  78.     eThrottle_Default=3,
  79.     eThrottle_Highest=5
  80. };
  81.  
  82. typedef enum    // menu items
  83. {
  84.     eDone_Quiet=1,        // don't notify at all when done
  85.     eDone_Beep,
  86.     eDone_Dialog,
  87.     eDone_BnD,
  88.     eDone_Quit
  89. };
  90.  
  91. typedef enum    // menu items
  92. {
  93.     eRender_Self=1,
  94.     eRender_Search,
  95.     eRender_UserChosen
  96. };
  97.  
  98. // This resource/struct will be saved to disk, and should match
  99. // its 68K equivalent...
  100. #if GENERATINGPOWERPC
  101. #pragma options align=mac68k
  102. #endif
  103.  
  104. typedef struct
  105. {
  106.     UINT16_t        prefsVersion;        // prefs resource version #
  107.     UINT16_t        appThrottle;        // how much CPU time POV-Ray should use
  108.     UINT16_t        autoLoadTemplates;    // Auto-read templates on app startup
  109.     UINT16_t        whenBusy;            // what to do if files dropped on while rendering
  110.     UINT16_t        allDoneSoundID;        // sound resource ID to use when all done
  111.     UINT16_t        allDoneNotify;        // what to do when last job is finished
  112.     UINT16_t        autoSavePict;        // auto-save PICT when rendering completes
  113.                                         // (IGNORED/ALWAYS done if multi-job or animation)
  114.     UINT16_t        useAppDefaultPrefs;    // ignore file prefs and use app default prefs
  115.     UINT16_t        useTempMem;            // use tempmem instead of app heap (always on for now)
  116.     UINT16_t        showSplashScreen;    // show splash screen on startup
  117.     UINT16_t        addCustomIcons;        // add custom Finder icons to PICT files when saved
  118.     UINT16_t        keepGoingOnErrors;    // don't halt jobs on errors, continue next job
  119.     Rect            appPrefsDlgPos;        // remember top/left corner of app prefs dialog
  120.     Rect            filePrefsDlgPos;    // remember top/left corner of rendering prefs dialog
  121.     FSSpec            includeDirFSSpec;    // search path directory ref (note that name is volname!)
  122. } app_prefs_rec_t, *app_prefs_ptr_t, **app_prefs_hdl_t;
  123.  
  124. #if GENERATINGPOWERPC
  125. #pragma options align=reset
  126. #endif
  127.  
  128.  
  129. // ---------------------------------------------------------------------
  130.  
  131. extern app_prefs_hdl_t    gAppPrefs_h;            // App prefs from prefs file
  132. extern file_prefs_hdl_t    gDefltFilePrefs_h;        // default file prefs from prefs file
  133. extern Boolean            gUseAppDefaultPrefs;    // True if overriding file prefs
  134.  
  135.  
  136. // ---------------------------------------------------------------------
  137.  
  138. void APSet_TimeSlice(short newValue);
  139. short APGet_TimeSlice(void);
  140.  
  141. void APSet_AutoTemplates(Boolean newValue);
  142. Boolean APGet_AutoTemplates(void);
  143.  
  144. void APSet_AllDoneSoundID(short newValue);
  145. short APGet_AllDoneSoundID(void);
  146.  
  147. void APSet_AutoSaveImage(Boolean newValue);
  148. Boolean APGet_AutoSaveImage(void);
  149.  
  150. void APSet_AllDoneNotify(short newValue);
  151. short APGet_AllDoneNotify(void);
  152.  
  153. void APSet_UseAppDefaultPrefs(Boolean newValue);
  154. Boolean APGet_UseAppDefaultPrefs(void);
  155.  
  156. void APSet_UseTempMem(Boolean newValue);
  157. Boolean APGet_UseTempMem(void);
  158.  
  159. void APSet_ShowSplashScreen(Boolean newValue);
  160. Boolean APGet_ShowSplashScreen(void);
  161.  
  162. void APSet_ShutDownWhenDone(Boolean newValue);
  163. Boolean APGet_ShutDownWhenDone(void);
  164.  
  165. void APSet_AddCustomIcons(Boolean newValue);
  166. Boolean APGet_AddCustomIcons(void);
  167.  
  168. void APSet_KeepGoingOnErrors(Boolean newValue);
  169. Boolean APGet_KeepGoingOnErrors(void);
  170.  
  171. void APSet_IncludePaths(FSSpecPtr newValue);
  172. FSSpecPtr APGet_IncludePaths(void);
  173.  
  174. void APSet_AppPrefsDlgPos(Rect * r);
  175. void APGet_AppPrefsDlgPos(Rect * r);
  176.  
  177. void APSet_FilePrefsDlgPos(Rect * r);
  178. void APGet_FilePrefsDlgPos(Rect * r);
  179.  
  180. OSErr AppPrefs_Open(void);
  181. void AppPrefs_Close(void);
  182. void AppPrefs_Write(void);
  183. void AppPrefs_Read(void);
  184. void AppPrefs_Prompt_Init(void);
  185.  
  186. #endif // APPPREFS_H
  187.