Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
source/Imageer.app.h
/****************************************************/ |
/* */ |
/* File: Imageer.app.h */ |
/* */ |
/* Program: Imageer */ |
/* */ |
/* By: Jason Hodges-Harris */ |
/* */ |
/* Created: 26/10/95 00:00:00 AM */ |
/* */ |
/* Version: 1.0.0d3 */ |
/* */ |
/* Copyright: © 1995-96 Apple Computer, Inc., */ |
/* all rights reserved. */ |
/* */ |
/****************************************************/ |
#ifndef __IMAGEERAPPHEADER__ |
#define __IMAGEERAPPHEADER__ |
/**** Macintosh Toolbox Headers *****/ |
#ifndef __GXTYPES__ |
#include <GXTypes.h> |
#endif |
#ifndef __PALETTES__ |
#include <Palettes.h> |
#endif |
#ifndef __QDOFFSCREEN__ |
#include <QDOffscreen.h> |
#endif |
#ifndef __STANDARDFILE__ |
#include <StandardFile.h> |
#endif |
#ifndef __TYPES__ |
#include <Types.h> |
#endif |
// Application document structure |
#if GENERATINGPOWERPC |
#pragma options align=mac68k |
#endif |
struct ImageDoc |
{ |
PaletteHandle theColorsPalette; // used by colors window |
GWorldPtr theImageWorld; |
long theFileRefNum, |
theFileType, |
theImageXSize, |
theImageYSize; |
ControlHandle theVScrollBar, |
theHScrollBar; |
gxViewPort theGXview, |
theGxChildView; |
gxShape theGXImageShape; |
gxInk theInkShape; |
gxTransferMode theUndoInkTransform; |
gxTransform theUndoShapeTransform; |
StandardFileReply theImageFileReply; |
FSSpec theTempUndoFileSpec, |
theTempRedoFileSpec; |
Rect theMaxWindowSize; |
short theImageDepth, |
theMenuItem, |
theLastAction, // type of last image action |
theUndoState, // temp file created to reverse last action |
theGXUndoType; |
Boolean theImageChanged, |
isUsingQDGX, // set dependent on image model used |
isColorsWindow, // used to test for colors window |
hasUndoTemp, |
hasRedoTemp; |
}; |
typedef struct ImageDoc ImageDoc, *ImageDocPtr, **ImageDocHndl; |
struct TiffInfo |
{ |
short byteOrder; // Intel or Motorola format |
short version; // Image version |
long offsetToIFD; // offset to 1st image file directory |
long xImageSize; // x coord image size |
long yImageSize; // y coord image size |
short PhotoInterpret; // Photometric Interpretation |
long imageOffset; // offset to image strip |
long rowStrip; // number of rows per image strip |
CTabHandle tiffCTabHndl; // Tiff image Palette colors |
short bitDepth; // image bit depth |
short compressionType; // compression |
short PlanarConfig; // pixel storage method |
}; |
typedef struct TiffInfo TiffInfo, *TiffInfoPtr; |
struct UserGXSpool |
{ |
gxSpoolBlock spool; |
short reference; |
}; |
typedef struct UserGXSpool UserGXSpool; |
#if GENERATINGPOWERPC |
#pragma options align=reset |
#endif |
/**** type of image manipulation ****/ |
enum |
{ |
kPixMapOp = 1, |
kColorTableOp, |
kGXTransformOp |
}; |
/**** Aplication creator ****/ |
#define AppCreator 'Im#¢' |
/**** Supported image file types list ****/ |
enum |
{ |
TiffType = 1, |
PictType, |
GXType |
}; |
/**** TIFF image byte formats ****/ |
enum |
{ |
MotoFormat = 'MM', |
IntlFormat = 'II' |
}; |
/**** Image undo state ****/ |
enum |
{ |
kCannotUndo = 1, |
kCanUndo, |
kCanRedo |
}; |
/**** Menubar constant definitions ****/ |
#define rMenuBar 128 |
#define mApple 128 |
#define iAbout 1 |
#define mFile 129 |
#define iOpen 1 |
#define iClose 2 |
#define iCloseAll 3 |
#define iSave 5 |
#define iSaveAs 6 |
#define iRevert 7 |
#define iQuit 9 |
#define mEdit 130 |
#define iUndo 1 |
#define iCut 3 |
#define iCopy 4 |
#define iPaste 5 |
#define mWindow 131 |
#define iColors 1 |
#define mFilters 132 |
#define iSmoothFilter 1 |
#define iHiPassFilter 2 |
#define mEffects 133 |
#define iInvert 1 |
#define iBrighness 3 |
#define iContrast 4 |
#define iColorComp 6 |
#define iMirrorXaxis 8 |
#define iMirrorYaxis 9 |
#define iRotate180 10 |
#define mBrightness 134 |
#define iLighter 1 |
#define iDarker 2 |
#define mContrast 135 |
#define iIncrease 1 |
#define iDecrease 2 |
#define mColor 136 |
#define iRedColorComp 1 |
#define iGreenColorComp 2 |
#define iBlueColorComp 3 |
#define mModel 137 |
#define iUseQDGX 1 |
#define mFileType 138 |
#define iTiffType 1 |
#define iPictType 2 |
#define iGXType 3 |
#define iAllFiles 4 |
#define mSaveFileType 139 |
#define iSaveTiffType 1 |
#define iSavePictType 2 |
#define iSaveGXType 3 |
/**** General Application Constant definitions ****/ |
#define kSleep 3L // Used in wait next event |
#define kLoadFilePopUpItem 10 |
#define kSaveFilePopUpItem 13 |
#define kProgressSteps 200 |
#define kNull_Str "" |
#define kOkButton 1 |
#define kSplashScrDelay 90 // 1.5 secs delay |
#define rSplashPICT 128 |
#define kRadioButton 6 |
#define kSpoolBlockSize 1024 |
#define kLargeScroller 32 |
#define kSmallScroller 8 |
#define kMinLowMem 0x2800 |
#define kScrollBarWidth 15 |
/**** Window and dialog resource IDs ****/ |
#define rGenWindow 128 |
#define rColorsWindow 129 |
#define rAboutBox 128 |
#define rGenAlert 129 |
#define rGenWarning 130 |
#define rCustomOpenDialog 131 |
#define rCustomSaveDialog 132 |
#define rProgressBarWindow 130 |
#define rSplashWindow 131 |
#define rPictCompDialog 133 |
/**** File System definitions ****/ |
#define kFolderBit 0x10 |
#define kFileVisibleBit 0x004000 |
/**** STR# resource items ****/ |
#define rErrMessages 128 |
#define iNotImplemented 1 |
#define iLowTempMem 2 |
#define iFailAllocMem 3 |
#define iNoSupportBitDepth 4 |
#define rQDGXmessages 129 |
#define iGXNotInstalled 1 |
#define iGXLibNotLoaded 2 |
#define iGXLoadErr 3 |
#define iCannotSwitchGX 4 |
#define iCannotConvToGX 5 |
#define iTransformFailed 6 |
#define iInkGetFail 7 |
#define iFailInitPrint 8 |
#define rQDMessages 130 |
#define iFailGWorldAlloc 1 |
#define iFailLockPixmap 2 |
#define rMenuItems 131 |
#define iShowColors 1 |
#define iHideColors 2 |
#define iOpUndo 3 |
#define iOpCantUndo 4 |
#define iOpRedo 5 |
#define rImageModel 132 |
#define iUseColorQD 1 |
#define iUseQuickDrawGX 2 |
#define rProgressMessages 133 |
#define iLoading 1 |
#define iSaving 2 |
#define rFileIOMessages 134 |
#define iSaveCompPICTErr 1 |
#define iSaveUnCompPICTErr 2 |
#define iSaveQDGXErr 3 |
#define iCreateTempFldrErr 4 |
#define iCreateTempFileErr 5 |
#define iDeleteTempFileErr 6 |
#define iDiskFullErr 7 |
#define iRevertFileFail 8 |
#define iTiffNotSupported 9 |
/**** application defined error values ****/ |
#define kDefaultAppError 1000 // application return error |
#define kFailedLockPixels 1001 // application failed to lock down GWorld PixMap |
#define kFileLoadAbortErr 1002 // failed to load image or cancel selected |
#define kFailMakePalette 1003 // failed to create a new palette |
#define kLowMemWarning 1004 // Low temporary memory warning |
#define kFailGetPixMap 1005 // Failed to retrieve PixMap handle from window doc structure |
#define kFailImageComp 1006 // Failed to compress image. |
#define kPtrNotCreated 1007 // Failed to create memory allocation for pointer |
#define kNotSupported 1008 // Function not supported |
#define kGXFileLoadErr 1009 // Failed to load in GX based image file |
#define kQDtoGXConvErr 1010 // Failed to convert from color QuickDRaw to QDGX |
#define kFailAllocDocHndl 1011 // Failed to allocate handle for window Doc structure |
#define kBitDepthErr 1012 // Image Bit Depth not supported for operation |
#define kGXFailTransform 1013 // QDGX transform operation failed |
#define kGXFailGetInk 1014 // QDGX fail to get ink object |
#define kFailMakeGWorld 1015 // Failed to allocate memory for image GWorld |
#define kFailPictCompSave 1016 // Save compressed PICT file failure |
#define kFailPictUnCompSave 1017 // Save uncompressed PICT file failure |
#define kFailQDGXSave 1018 // Save QDGX file failure |
#define kTIFFNotSupported 1019 // TIFF File contains tags not currently parsed |
/**** Control resource values ****/ |
#define rVScrollBar 128 |
#define rHScrollBar 129 |
#define rProgressCntl 130 |
/**** PICT compression dialog radion button IDs ****/ |
enum |
{ |
kNoCompression = 2, |
kHighQuality, |
kMediumQuality, |
kLowQuality |
}; |
/**** image model return error codes ****/ |
enum |
{ |
kCannotConvertToGX = 1, |
kCannotConvertToQD |
}; |
/**** GWorld flags ****/ |
enum |
{ |
kNoFlags = 0 |
}; |
/**** Color components ****/ |
enum |
{ |
kRedComp = 1, |
kGreenComp, |
kBlueComp |
}; |
/**** QuickDraw GX transform types. Used for Undo operation ****/ |
enum |
{ |
kGXinkTransform = 1, |
kGXshapeTransform |
}; |
/**** Progress Bar display options ****/ |
enum |
{ |
kDisplayProgressWindow, |
kUpdateProgressWindow, |
kDisposeProgressWindow |
}; |
#endif // __IMAGEERAPPHEADER__ |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14