Subversion Repositories filter_foundry

Rev

Rev 186 | Rev 192 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*
  2.     This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop
  3.     Copyright (C) 2003-2019 Toby Thain, toby@telegraphics.com.au
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  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.  
  15.     You should have received a copy of the GNU General Public License
  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.  
  20. #include "world.h"
  21.  
  22. #include "PIFilter.h"
  23.  
  24. #include "entry.h"
  25.  
  26. #include "choosefile.h"
  27. #include "ui.h"
  28. #include "file_compat.h"
  29. #include "symtab.h"
  30. #include "PARM.h"
  31. #include "preview.h"
  32. #include "misc.h"
  33.  
  34. #ifndef INCLUDED_FF_H
  35. #define INCLUDED_FF_H
  36.  
  37. #define HOSTSIG_GIMP 'PMIG' // sic: NOT 'GIMP'
  38. #define HOSTSIG_IRFANVIEW 'UP20'
  39. #define HOSTSIG_PHOTOSHOP '8BIM'
  40. #define HOSTSIG_PLUGINCOMMANDER '8BIM' // meh.
  41. #define HOSTSIG_SERIF_PHOTOPLUS '8BIM' // meh.
  42. #define HOSTSIG_JASC_PAINTSHOP_PRO_X 'PSP9'
  43.  
  44. enum{
  45.         TAB = 011,
  46.         LF  = 012,
  47.         CR  = 015,
  48.  
  49.         CHUNK_ROWS = 64,
  50.  
  51.         PARM_TYPE = 'PARM',
  52.         PARM_ID = 16000,
  53.         OBFUSCDATA_ID = 16001,
  54.         TEXT_FILETYPE = 'TEXT',
  55.         SIG_SIMPLETEXT = 'ttxt',
  56.         PS_FILTER_FILETYPE = '8BFM'
  57. };
  58.  
  59. typedef struct{
  60.         Boolean standalone,parmloaded,obfusc;
  61.         PARM_T parm;
  62.         #ifdef _WIN32
  63.         HWND hWndMainDlg;
  64.         #endif /* _WIN32 */
  65. } globals_t;
  66.  
  67. extern globals_t *gdata;
  68.  
  69. #define NUM_CELLS 0x100
  70.  
  71. extern struct node *tree[4];
  72. extern char *err[4];
  73. extern int errpos[4],errstart[4];//,nplanes;
  74. extern value_type slider[8],cell[NUM_CELLS],map[4][0x100];
  75. extern char *expr[4];
  76. // extern long maxSpace;
  77.  
  78. extern int tokpos,tokstart,varused[];
  79. extern char *errstr;
  80.  
  81. #define DBG(x)
  82. //#define DEBUG
  83.  
  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)
  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);
  96. void convert_premiere_to_photoshop(PARM_T* photoshop, PARM_T_PREMIERE* premiere);
  97. Boolean read8bfplugin(StandardFileReply *sfr,char **reason);
  98. Handle readfileintohandle(FILEREF r);
  99. Boolean readfile(StandardFileReply *sfr,char **reason);
  100. Boolean readPARM(Ptr h,PARM_T *parm,char **reasonstr,int fromwin);
  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);
  112. size_t fixpipl(PIPropertyList *pipl,size_t origsize,StringPtr title);
  113. size_t aete_generate(void* aeteptr, PARM_T *pparm);
  114. void obfusc(unsigned char *pparm,size_t size);
  115.  
  116. Boolean loadfile(StandardFileReply *sfr,char **reason);
  117. Boolean readPARMresource(HMODULE hm,char **reason,int readobfusc);
  118.  
  119. void dbglasterror(char*);
  120.  
  121. // from main.c
  122. int64_t maxspace();
  123. Boolean maxspace_available();
  124. Boolean host_preserves_parameters();
  125.  
  126. // from parser.y
  127. struct node *parseexpr(char *s);
  128.  
  129. #ifdef _MSC_VER
  130.         // Microsoft dumbassery
  131.         #define strcasecmp _stricmp
  132.         #define snprintf _snprintf
  133. #endif /* _MSC_VER */
  134.  
  135. #endif /* INCLUDED_FF_H */
  136.