Subversion Repositories filter_foundry

Rev

Rev 208 | Rev 216 | 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
192 daniel-mar 3
    Copyright (C) 2003-2009 Toby Thain, toby@telegraphics.com.au
206 daniel-mar 4
    Copyright (C) 2018-2021 Daniel Marschall, ViaThinkSoft
2 toby 5
 
6
    This program is free software; you can redistribute it and/or modify
106 dmarschall 7
    it under the terms of the GNU General Public License as published by
2 toby 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
 
106 dmarschall 16
    You should have received a copy of the GNU General Public License
2 toby 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
 
8 toby 21
#include "world.h"
2 toby 22
 
23
#include "PIFilter.h"
24
 
25
#include "entry.h"
8 toby 26
 
2 toby 27
#include "choosefile.h"
28
#include "ui.h"
29
#include "file_compat.h"
30
#include "symtab.h"
31
#include "PARM.h"
94 toby 32
#include "preview.h"
33
#include "misc.h"
2 toby 34
 
106 dmarschall 35
#ifndef INCLUDED_FF_H
36
#define INCLUDED_FF_H
37
 
186 dmarschall 38
#define HOSTSIG_GIMP 'PMIG' // sic: NOT 'GIMP'
183 dmarschall 39
#define HOSTSIG_IRFANVIEW 'UP20'
40
#define HOSTSIG_PHOTOSHOP '8BIM'
41
#define HOSTSIG_PLUGINCOMMANDER '8BIM' // meh.
190 dmarschall 42
#define HOSTSIG_SERIF_PHOTOPLUS '8BIM' // meh.
186 dmarschall 43
#define HOSTSIG_JASC_PAINTSHOP_PRO_X 'PSP9'
183 dmarschall 44
 
2 toby 45
enum{
46
        TAB = 011,
8 toby 47
        LF  = 012,
48
        CR  = 015,
2 toby 49
 
50
        CHUNK_ROWS = 64,
51
 
52
        PARM_TYPE = 'PARM',
53
        PARM_ID = 16000,
85 toby 54
        OBFUSCDATA_ID = 16001,
2 toby 55
        TEXT_FILETYPE = 'TEXT',
56
        SIG_SIMPLETEXT = 'ttxt',
57
        PS_FILTER_FILETYPE = '8BFM'
58
};
59
 
60
typedef struct{
85 toby 61
        Boolean standalone,parmloaded,obfusc;
2 toby 62
        PARM_T parm;
106 dmarschall 63
        #ifdef _WIN32
64
        HWND hWndMainDlg;
65
        #endif /* _WIN32 */
2 toby 66
} globals_t;
67
 
68
extern globals_t *gdata;
69
 
142 dmarschall 70
#define NUM_CELLS 0x100
71
 
2 toby 72
extern struct node *tree[4];
73
extern char *err[4];
94 toby 74
extern int errpos[4],errstart[4];//,nplanes;
142 dmarschall 75
extern value_type slider[8],cell[NUM_CELLS],map[4][0x100];
2 toby 76
extern char *expr[4];
106 dmarschall 77
// extern long maxSpace;
2 toby 78
 
79
extern int tokpos,tokstart,varused[];
80
extern char *errstr;
81
 
194 daniel-mar 82
#define DBG(x) {}
2 toby 83
//#define DEBUG
84
 
102 toby 85
#define PS_BUFFER_ALLOC  (pb->bufferProcs->allocateProc)
86
#define PS_BUFFER_LOCK   (pb->bufferProcs->lockProc)
87
#define PS_BUFFER_UNLOCK (pb->bufferProcs->unlockProc)
88
#define PS_BUFFER_FREE   (pb->bufferProcs->freeProc)
2 toby 89
 
90
void DoPrepare (FilterRecordPtr epb);
91
void DoStart (FilterRecordPtr epb);
92
OSErr DoContinue (FilterRecordPtr epb);
93
void DoFinish (FilterRecordPtr epb);
94
void RequestNext (FilterRecordPtr epb,long);
95
 
96
Boolean readparams(Handle h,Boolean alerts,char **reason);
149 dmarschall 97
void convert_premiere_to_photoshop(PARM_T* photoshop, PARM_T_PREMIERE* premiere);
98
Boolean read8bfplugin(StandardFileReply *sfr,char **reason);
2 toby 99
Handle readfileintohandle(FILEREF r);
100
Boolean readfile(StandardFileReply *sfr,char **reason);
45 toby 101
Boolean readPARM(Ptr h,PARM_T *parm,char **reasonstr,int fromwin);
2 toby 102
 
103
OSErr saveparams(Handle h);
104
OSErr savehandleintofile(Handle h,FILEREF r);
105
Boolean savefile(StandardFileReply *sfr);
106
 
107
OSErr make_standalone(StandardFileReply *sfr);
108
 
109
Boolean setup(FilterRecordPtr pb);
110
void evalpixel(unsigned char *outp,unsigned char *inp);
111
 
112
unsigned long printablehash(unsigned long hash);
208 daniel-mar 113
size_t fixpipl(PIPropertyList *pipl,size_t origsize,StringPtr title, long *event_id);
114
size_t aete_generate(void* aeteptr, PARM_T *pparm, long event_id);
211 daniel-mar 115
void obfusc(unsigned char* pparm, size_t size);
116
void deobfusc(unsigned char* pparm, size_t size);
2 toby 117
 
118
Boolean loadfile(StandardFileReply *sfr,char **reason);
87 toby 119
Boolean readPARMresource(HMODULE hm,char **reason,int readobfusc);
2 toby 120
 
121
void dbglasterror(char*);
13 toby 122
 
182 dmarschall 123
// from main.c
124
int64_t maxspace();
185 dmarschall 125
Boolean maxspace_available();
126
Boolean host_preserves_parameters();
182 dmarschall 127
 
13 toby 128
// from parser.y
129
struct node *parseexpr(char *s);
102 toby 130
 
131
#ifdef _MSC_VER
132
        // Microsoft dumbassery
133
        #define strcasecmp _stricmp
134
        #define snprintf _snprintf
106 dmarschall 135
#endif /* _MSC_VER */
136
 
137
#endif /* INCLUDED_FF_H */