Subversion Repositories filter_foundry

Rev

Rev 186 | Rev 192 | 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.
190 dmarschall 41
#define HOSTSIG_SERIF_PHOTOPLUS '8BIM' // meh.
186 dmarschall 42
#define HOSTSIG_JASC_PAINTSHOP_PRO_X 'PSP9'
183 dmarschall 43
 
2 toby 44
enum{
45
        TAB = 011,
8 toby 46
        LF  = 012,
47
        CR  = 015,
2 toby 48
 
49
        CHUNK_ROWS = 64,
50
 
51
        PARM_TYPE = 'PARM',
52
        PARM_ID = 16000,
85 toby 53
        OBFUSCDATA_ID = 16001,
2 toby 54
        TEXT_FILETYPE = 'TEXT',
55
        SIG_SIMPLETEXT = 'ttxt',
56
        PS_FILTER_FILETYPE = '8BFM'
57
};
58
 
59
typedef struct{
85 toby 60
        Boolean standalone,parmloaded,obfusc;
2 toby 61
        PARM_T parm;
106 dmarschall 62
        #ifdef _WIN32
63
        HWND hWndMainDlg;
64
        #endif /* _WIN32 */
2 toby 65
} globals_t;
66
 
67
extern globals_t *gdata;
68
 
142 dmarschall 69
#define NUM_CELLS 0x100
70
 
2 toby 71
extern struct node *tree[4];
72
extern char *err[4];
94 toby 73
extern int errpos[4],errstart[4];//,nplanes;
142 dmarschall 74
extern value_type slider[8],cell[NUM_CELLS],map[4][0x100];
2 toby 75
extern char *expr[4];
106 dmarschall 76
// extern long maxSpace;
2 toby 77
 
78
extern int tokpos,tokstart,varused[];
79
extern char *errstr;
80
 
81
#define DBG(x)
82
//#define DEBUG
83
 
102 toby 84
#define PS_BUFFER_ALLOC  (pb->bufferProcs->allocateProc)
85
#define PS_BUFFER_LOCK   (pb->bufferProcs->lockProc)
86
#define PS_BUFFER_UNLOCK (pb->bufferProcs->unlockProc)
87
#define PS_BUFFER_FREE   (pb->bufferProcs->freeProc)
2 toby 88
 
89
void DoPrepare (FilterRecordPtr epb);
90
void DoStart (FilterRecordPtr epb);
91
OSErr DoContinue (FilterRecordPtr epb);
92
void DoFinish (FilterRecordPtr epb);
93
void RequestNext (FilterRecordPtr epb,long);
94
 
95
Boolean readparams(Handle h,Boolean alerts,char **reason);
149 dmarschall 96
void convert_premiere_to_photoshop(PARM_T* photoshop, PARM_T_PREMIERE* premiere);
97
Boolean read8bfplugin(StandardFileReply *sfr,char **reason);
2 toby 98
Handle readfileintohandle(FILEREF r);
99
Boolean readfile(StandardFileReply *sfr,char **reason);
45 toby 100
Boolean readPARM(Ptr h,PARM_T *parm,char **reasonstr,int fromwin);
2 toby 101
 
102
OSErr saveparams(Handle h);
103
OSErr savehandleintofile(Handle h,FILEREF r);
104
Boolean savefile(StandardFileReply *sfr);
105
 
106
OSErr make_standalone(StandardFileReply *sfr);
107
 
108
Boolean setup(FilterRecordPtr pb);
109
void evalpixel(unsigned char *outp,unsigned char *inp);
110
 
111
unsigned long printablehash(unsigned long hash);
185 dmarschall 112
size_t fixpipl(PIPropertyList *pipl,size_t origsize,StringPtr title);
113
size_t aete_generate(void* aeteptr, PARM_T *pparm);
85 toby 114
void obfusc(unsigned char *pparm,size_t size);
2 toby 115
 
116
Boolean loadfile(StandardFileReply *sfr,char **reason);
87 toby 117
Boolean readPARMresource(HMODULE hm,char **reason,int readobfusc);
2 toby 118
 
119
void dbglasterror(char*);
13 toby 120
 
182 dmarschall 121
// from main.c
122
int64_t maxspace();
185 dmarschall 123
Boolean maxspace_available();
124
Boolean host_preserves_parameters();
182 dmarschall 125
 
13 toby 126
// from parser.y
127
struct node *parseexpr(char *s);
102 toby 128
 
129
#ifdef _MSC_VER
130
        // Microsoft dumbassery
131
        #define strcasecmp _stricmp
132
        #define snprintf _snprintf
106 dmarschall 133
#endif /* _MSC_VER */
134
 
135
#endif /* INCLUDED_FF_H */