Rev 185 | Rev 190 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | toby | 1 | /* |
18 | toby | 2 | This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop |
171 | dmarschall | 3 | Copyright (C) 2003-2019 Toby Thain, toby@telegraphics.com.au |
2 | toby | 4 | |
5 | This program is free software; you can redistribute it and/or modify |
||
106 | dmarschall | 6 | it under the terms of the GNU General Public License as published by |
2 | toby | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
||
9 | |||
10 | This program is distributed in the hope that it will be useful, |
||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
13 | GNU General Public License for more details. |
||
14 | |||
106 | dmarschall | 15 | You should have received a copy of the GNU General Public License |
2 | toby | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
18 | */ |
||
19 | |||
8 | toby | 20 | #include "world.h" |
2 | toby | 21 | |
22 | #include "PIFilter.h" |
||
23 | |||
24 | #include "entry.h" |
||
8 | toby | 25 | |
2 | toby | 26 | #include "choosefile.h" |
27 | #include "ui.h" |
||
28 | #include "file_compat.h" |
||
29 | #include "symtab.h" |
||
30 | #include "PARM.h" |
||
94 | toby | 31 | #include "preview.h" |
32 | #include "misc.h" |
||
2 | toby | 33 | |
106 | dmarschall | 34 | #ifndef INCLUDED_FF_H |
35 | #define INCLUDED_FF_H |
||
36 | |||
186 | dmarschall | 37 | #define HOSTSIG_GIMP 'PMIG' // sic: NOT 'GIMP' |
183 | dmarschall | 38 | #define HOSTSIG_IRFANVIEW 'UP20' |
39 | #define HOSTSIG_PHOTOSHOP '8BIM' |
||
40 | #define HOSTSIG_PLUGINCOMMANDER '8BIM' // meh. |
||
186 | dmarschall | 41 | #define HOSTSIG_JASC_PAINTSHOP_PRO_X 'PSP9' |
183 | dmarschall | 42 | |
2 | toby | 43 | enum{ |
44 | TAB = 011, |
||
8 | toby | 45 | LF = 012, |
46 | CR = 015, |
||
2 | toby | 47 | |
48 | CHUNK_ROWS = 64, |
||
49 | |||
50 | PARM_TYPE = 'PARM', |
||
51 | PARM_ID = 16000, |
||
85 | toby | 52 | OBFUSCDATA_ID = 16001, |
2 | toby | 53 | TEXT_FILETYPE = 'TEXT', |
54 | SIG_SIMPLETEXT = 'ttxt', |
||
55 | PS_FILTER_FILETYPE = '8BFM' |
||
56 | }; |
||
57 | |||
58 | typedef struct{ |
||
85 | toby | 59 | Boolean standalone,parmloaded,obfusc; |
2 | toby | 60 | PARM_T parm; |
106 | dmarschall | 61 | #ifdef _WIN32 |
62 | HWND hWndMainDlg; |
||
63 | #endif /* _WIN32 */ |
||
2 | toby | 64 | } globals_t; |
65 | |||
66 | extern globals_t *gdata; |
||
67 | |||
142 | dmarschall | 68 | #define NUM_CELLS 0x100 |
69 | |||
2 | toby | 70 | extern struct node *tree[4]; |
71 | extern char *err[4]; |
||
94 | toby | 72 | extern int errpos[4],errstart[4];//,nplanes; |
142 | dmarschall | 73 | extern value_type slider[8],cell[NUM_CELLS],map[4][0x100]; |
2 | toby | 74 | extern char *expr[4]; |
106 | dmarschall | 75 | // extern long maxSpace; |
2 | toby | 76 | |
77 | extern int tokpos,tokstart,varused[]; |
||
78 | extern char *errstr; |
||
79 | |||
80 | #define DBG(x) |
||
81 | //#define DEBUG |
||
82 | |||
102 | toby | 83 | #define PS_BUFFER_ALLOC (pb->bufferProcs->allocateProc) |
84 | #define PS_BUFFER_LOCK (pb->bufferProcs->lockProc) |
||
85 | #define PS_BUFFER_UNLOCK (pb->bufferProcs->unlockProc) |
||
86 | #define PS_BUFFER_FREE (pb->bufferProcs->freeProc) |
||
2 | toby | 87 | |
88 | void DoPrepare (FilterRecordPtr epb); |
||
89 | void DoStart (FilterRecordPtr epb); |
||
90 | OSErr DoContinue (FilterRecordPtr epb); |
||
91 | void DoFinish (FilterRecordPtr epb); |
||
92 | void RequestNext (FilterRecordPtr epb,long); |
||
93 | |||
94 | Boolean readparams(Handle h,Boolean alerts,char **reason); |
||
149 | dmarschall | 95 | void convert_premiere_to_photoshop(PARM_T* photoshop, PARM_T_PREMIERE* premiere); |
96 | Boolean read8bfplugin(StandardFileReply *sfr,char **reason); |
||
2 | toby | 97 | Handle readfileintohandle(FILEREF r); |
98 | Boolean readfile(StandardFileReply *sfr,char **reason); |
||
45 | toby | 99 | Boolean readPARM(Ptr h,PARM_T *parm,char **reasonstr,int fromwin); |
2 | toby | 100 | |
101 | OSErr saveparams(Handle h); |
||
102 | OSErr savehandleintofile(Handle h,FILEREF r); |
||
103 | Boolean savefile(StandardFileReply *sfr); |
||
104 | |||
105 | OSErr make_standalone(StandardFileReply *sfr); |
||
106 | |||
107 | Boolean setup(FilterRecordPtr pb); |
||
108 | void evalpixel(unsigned char *outp,unsigned char *inp); |
||
109 | |||
110 | unsigned long printablehash(unsigned long hash); |
||
185 | dmarschall | 111 | size_t fixpipl(PIPropertyList *pipl,size_t origsize,StringPtr title); |
112 | size_t aete_generate(void* aeteptr, PARM_T *pparm); |
||
85 | toby | 113 | void obfusc(unsigned char *pparm,size_t size); |
2 | toby | 114 | |
115 | Boolean loadfile(StandardFileReply *sfr,char **reason); |
||
87 | toby | 116 | Boolean readPARMresource(HMODULE hm,char **reason,int readobfusc); |
2 | toby | 117 | |
118 | void dbglasterror(char*); |
||
13 | toby | 119 | |
182 | dmarschall | 120 | // from main.c |
121 | int64_t maxspace(); |
||
185 | dmarschall | 122 | Boolean maxspace_available(); |
123 | Boolean host_preserves_parameters(); |
||
182 | dmarschall | 124 | |
13 | toby | 125 | // from parser.y |
126 | struct node *parseexpr(char *s); |
||
102 | toby | 127 | |
128 | #ifdef _MSC_VER |
||
129 | // Microsoft dumbassery |
||
130 | #define strcasecmp _stricmp |
||
131 | #define snprintf _snprintf |
||
106 | dmarschall | 132 | #endif /* _MSC_VER */ |
133 | |||
134 | #endif /* INCLUDED_FF_H */ |