/* This file is part of PSPFormat, a File Format plugin for Adobe Photoshop Copyright (C) 2003-7 Toby Thain, toby@telegraphics.com.au This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* PSP File Format Specification is Copyright (C) 2000 Jasc Software, Inc. See http://www.jasc.com/specs/psp.asp */ #include #include #include #include "world.h" // must come before Photoshop includes #include "PIAbout.h" #include "PIFormat.h" #include "file_io.h" #include "psp.h" #define PINEWHANDLE gpb->handleProcs->newProc #define PIDISPOSEHANDLE gpb->handleProcs->disposeProc #define PIGETHANDLESIZE gpb->handleProcs->getSizeProc #define PISETHANDLESIZE gpb->handleProcs->setSizeProc #define PILOCKHANDLE gpb->handleProcs->lockProc #define PIUNLOCKHANDLE gpb->handleProcs->unlockProc #define PIGETPROPERTY gpb->propertyProcs->getPropertyProc #define PS_BUFFER_ALLOC (pb->bufferProcs->allocateProc) #define PS_BUFFER_LOCK (pb->bufferProcs->lockProc) #define PS_BUFFER_UNLOCK (pb->bufferProcs->unlockProc) #define PS_BUFFER_FREE (pb->bufferProcs->freeProc) //#include "my_malloc.h" /* general-purpose constants */ enum{ MAX_CHANNELS = 64 }; struct revertinfo{ /* fetched at Open and kept with the document (revertInfo handle) */ int savevers, savecomp; }; typedef struct{ /* persistent variables - currently used to share data between Options and Write sequences */ int psprb; long channelsize; } globals; #define G ((globals*)*data) extern FormatRecordPtr gpb; OSErr read_start(FormatRecordPtr pb, intptr_t *data); OSErr read_continue(FormatRecordPtr pb, intptr_t *data); OSErr read_finish(FormatRecordPtr pb, intptr_t *data); OSErr options_start(FormatRecordPtr pb, intptr_t *data); OSErr estimate_start(FormatRecordPtr pb, intptr_t *data); OSErr estimate_continue(FormatRecordPtr pb, intptr_t *data); OSErr estimate_finish(FormatRecordPtr pb, intptr_t *data); OSErr write_start(FormatRecordPtr pb, intptr_t *data); OSErr write_continue(FormatRecordPtr pb, intptr_t *data); OSErr write_finish(FormatRecordPtr pb, intptr_t *data); OSErr headerok(FILEREF r, PSP_file_header *ph); void putrevertinfo(FormatRecordPtr pb, struct revertinfo *p); int getrevertinfo(FormatRecordPtr pb, struct revertinfo *p);