home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************************
- #
- # App.h
- #
- # This file contains the constants and structures definitions.
- #
- # Author(s): Michael Marinkovich
- # marink@apple.com
- #
- # Modification History:
- #
- # 10/12/95 MWM Initial coding
- #
- # Copyright © 1992-96 Apple Computer, Inc., All Rights Reserved
- #
- #
- # You may incorporate this sample code into your applications without
- # restriction, though the sample code has been provided "AS IS" and the
- # responsibility for its operation is 100% yours. However, what you are
- # not permitted to do is to redistribute the source as "DSC Sample Code"
- # after having made changes. If you're going to re-distribute the source,
- # we require that you make it clear in the source that the code was
- # descended from Apple Sample Code, but that you've made changes.
- #
- *************************************************************************************/
-
- #include <QDOffscreen.h>
-
- //---------------------------------------------------------------------
- //
- // Macros
- //
- //---------------------------------------------------------------------
-
- #define MIN(x,y) ( ((x)<(y)) ? (x) : (y) )
- #define MAX(x,y) ( ((x)>(y)) ? (x) : (y) )
- #define TopLeft( r ) ( *(Point *) &(r).top )
- #define BotRight( r ) ( *(Point *) &(r).bottom )
-
-
- //---------------------------------------------------------------------
- //
- // General
- //
- //---------------------------------------------------------------------
-
- #define kMinHeap 300 * 1024
- #define kMinSpace 300 * 1024
-
-
- //---------------------------------------------------------------------
- //
- // Menus
- //
- //---------------------------------------------------------------------
-
- #define rMBarID 128
-
- enum {
- mApple = 128,
- iAbout = 1,
-
- mFile = 129,
- iNew = 1,
- iOpen = 2,
- iClose = 3,
- iQuit = 5
- };
-
-
- //---------------------------------------------------------------------
- //
- // Window stuff
- //
- //---------------------------------------------------------------------
-
- // doc types
- enum {
- kDocKind = 94,
- kDialogKind = 95,
- kFloatKind = 96,
- kAboutKind = 97
- };
-
-
- // scroll values
- #define kScrollWidth 15
- #define kScrollDelta 16
-
-
- //---------------------------------------------------------------------
- //
- // General resource ID's
- //
- //---------------------------------------------------------------------
-
- #define rAboutPictID 3000 // about picture
- #define rErrorDlg 128 // main error dialog
-
-
- //---------------------------------------------------------------------
- //
- // Alert Error ID's
- //
- //---------------------------------------------------------------------
-
- #define kNeedsDisplayManager 128 // ID of no Display Manager
-
-
- //---------------------------------------------------------------------
- //
- // Custom Event Proc stuff
- //
- //---------------------------------------------------------------------
-
- struct ZoomData {
- GDHandle screenWithLargestPartOfWindow;
- unsigned long largestArea;
- Rect windowBounds;
- };
- typedef struct ZoomData ZoomData, *ZoomDataPtr;
-
-
- enum {
- kIdleProc = 1,
- kMenuProc,
- kInContentProc,
- kInGoAwayProc,
- kInZoomProc,
- kInGrowProc,
- kMUpProc,
- kKeyProc,
- kActivateProc,
- kUpdateProc
- };
-
-
- //---------------------------------------------------------------------
- //
- // Typedefs
- //
- //---------------------------------------------------------------------
-
- // event handling proc
- typedef void (*CustomProc)(WindowRef window, void *refCon);
-
-
- // we just use the basic events for the callback procs
-
- struct DocRec
- {
- CustomProc idleProc; // custom idle proc
- CustomProc mMenuProc; // custom menu proc
- CustomProc inContentProc; // custom content click Proc
- CustomProc inGoAwayProc; // custom inGoAway proc
- CustomProc inZoomProc; // custom inZoom proc
- CustomProc inGrowProc; // custom inGrow proc
- CustomProc mUpProc; // custom mouseUp proc
- CustomProc keyProc; // custom autoKey-keyDown proc
- CustomProc activateProc; // custom activate window proc
- CustomProc updateProc; // custom window update proc
- ControlRef hScroll; // horz scroll bar
- ControlRef vScroll; // vert scroll bar
- GWorldPtr world; // offscreen for pict imaging
- PicHandle pict; // windows picture
- THPrint printer; // apps print record - inited at window int
- Boolean dirty; // document needs saving
- };
-
- typedef struct DocRec DocRec;
- typedef DocRec *DocPtr, **DocHnd;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-