Rev 503 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
439 | daniel-mar | 1 | /* |
2 | This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop |
||
3 | Copyright (C) 2003-2009 Toby Thain, toby@telegraphics.com.au |
||
503 | daniel-mar | 4 | Copyright (C) 2018-2022 Daniel Marschall, ViaThinkSoft |
439 | daniel-mar | 5 | |
6 | This program is free software; you can redistribute it and/or modify |
||
7 | it under the terms of the GNU General Public License as published by |
||
8 | the Free Software Foundation; either version 2 of the License, or |
||
9 | (at your option) any later version. |
||
10 | |||
11 | This program is distributed in the hope that it will be useful, |
||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
14 | GNU General Public License for more details. |
||
15 | |||
16 | You should have received a copy of the GNU General Public License |
||
17 | along with this program; if not, write to the Free Software |
||
18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
19 | */ |
||
20 | |||
21 | #ifndef FF_MISC_H_ |
||
22 | #define FF_MISC_H_ |
||
23 | |||
330 | daniel-mar | 24 | extern FilterRecordPtr gpb; |
25 | |||
488 | daniel-mar | 26 | #define BUFVERSION_NULL 'bNUL' |
486 | daniel-mar | 27 | #define BUFVERSION_STD32 'bST1' |
28 | #define BUFVERSION_STD64 'bST2' |
||
29 | #define BUFVERSION_SUITE32 'bSU1' |
||
30 | #define BUFVERSION_SUITE64 'bSU2' |
||
485 | daniel-mar | 31 | |
32 | typedef struct FFBuffer_ { |
||
487 | daniel-mar | 33 | OSType signature; // BUFVERSION_* |
485 | daniel-mar | 34 | BufferID standard; |
486 | daniel-mar | 35 | Ptr suite; |
485 | daniel-mar | 36 | } FFBuffer; |
37 | |||
488 | daniel-mar | 38 | void newBuffer(FFBuffer* buf, size_t size); |
39 | Ptr lockBuffer(FFBuffer* buf); |
||
40 | void unlockBuffer(FFBuffer* buf); |
||
41 | void disposeBuffer(FFBuffer* buf); |
||
42 | |||
43 | #define HDLVERSION_NULL 'hNUL' |
||
486 | daniel-mar | 44 | #define HDLVERSION_STANDARD 'hSTD' |
45 | #define HDLVERSION_SUITE1 'hSU1' |
||
46 | #define HDLVERSION_SUITE2 'hSU2' |
||
330 | daniel-mar | 47 | |
486 | daniel-mar | 48 | typedef struct FFHandle_ { |
487 | daniel-mar | 49 | OSType signature; // HDLVERSION_* |
486 | daniel-mar | 50 | Handle handle; |
51 | } FFHandle; |
||
52 | |||
488 | daniel-mar | 53 | void newHandle(FFHandle* hdl, size_t nBytes); |
54 | void disposeHandle(FFHandle* hdl); |
||
55 | size_t getHandleSize(FFHandle* hdl); |
||
56 | OSErr setHandleSize(FFHandle* hdl, size_t nBytes); |
||
57 | Ptr lockHandle(FFHandle* hdl); |
||
58 | void unlockHandle(FFHandle* hdl); |
||
59 | |||
486 | daniel-mar | 60 | // These functions are for code backwards compatibility: |
61 | Handle PINEWHANDLE(int32 size); |
||
62 | void PIDISPOSEHANDLE(Handle h); |
||
505 | daniel-mar | 63 | size_t PIGETHANDLESIZE(Handle h); |
486 | daniel-mar | 64 | OSErr PISETHANDLESIZE(Handle h, int32 newSize); |
65 | Ptr PILOCKHANDLE(Handle h, Boolean moveHigh); |
||
66 | void PIUNLOCKHANDLE(Handle h); |
||
67 | |||
68 | //#define PINEWHANDLE gpb->handleProcs->newProc |
||
69 | //#define PIDISPOSEHANDLE gpb->handleProcs->disposeProc |
||
70 | //#define PIGETHANDLESIZE gpb->handleProcs->getSizeProc |
||
71 | //#define PISETHANDLESIZE gpb->handleProcs->setSizeProc |
||
72 | //#define PILOCKHANDLE gpb->handleProcs->lockProc |
||
73 | //#define PIUNLOCKHANDLE gpb->handleProcs->unlockProc |
||
74 | |||
330 | daniel-mar | 75 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) |
76 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) |
||
439 | daniel-mar | 77 | |
78 | #endif |