Subversion Repositories filter_foundry

Rev

Rev 87 | Rev 102 | 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-7 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. enum{
  35.         TAB = 011,
  36.         LF  = 012,
  37.         CR  = 015,
  38.  
  39.         CHUNK_ROWS = 64,
  40.  
  41.         PARM_TYPE = 'PARM',
  42.         PARM_ID = 16000,
  43.         OBFUSCDATA_ID = 16001,
  44.         TEXT_FILETYPE = 'TEXT',
  45.         SIG_SIMPLETEXT = 'ttxt',
  46.         PS_FILTER_FILETYPE = '8BFM'
  47. };
  48.  
  49. typedef struct{
  50.         Boolean standalone,parmloaded,obfusc;
  51.         PARM_T parm;
  52. } globals_t;
  53.  
  54. extern globals_t *gdata;
  55.  
  56. extern struct node *tree[4];
  57. extern char *err[4];
  58. extern int errpos[4],errstart[4];//,nplanes;
  59. extern value_type slider[8],cell[0x100],map[4][0x100];
  60. extern char *expr[4];
  61. extern long maxSpace;
  62.  
  63. extern int tokpos,tokstart,varused[];
  64. extern char *errstr;
  65.  
  66. #define DBG(x)
  67. //#define DEBUG
  68.  
  69.  
  70. DLLEXPORT MACPASCAL
  71. void ENTRYPOINT(short selector,FilterRecordPtr epb,long *data,short *result);
  72.  
  73. void DoPrepare (FilterRecordPtr epb);
  74. void DoStart (FilterRecordPtr epb);
  75. OSErr DoContinue (FilterRecordPtr epb);
  76. void DoFinish (FilterRecordPtr epb);
  77. void RequestNext (FilterRecordPtr epb,long);
  78.  
  79. Boolean readparams(Handle h,Boolean alerts,char **reason);
  80. Handle readfileintohandle(FILEREF r);
  81. Boolean readfile(StandardFileReply *sfr,char **reason);
  82. Boolean readPARM(Ptr h,PARM_T *parm,char **reasonstr,int fromwin);
  83.  
  84. OSErr saveparams(Handle h);
  85. OSErr savehandleintofile(Handle h,FILEREF r);
  86. Boolean savefile(StandardFileReply *sfr);
  87.  
  88. OSErr make_standalone(StandardFileReply *sfr);
  89.  
  90. Boolean setup(FilterRecordPtr pb);
  91. void evalpixel(unsigned char *outp,unsigned char *inp);
  92.  
  93. unsigned long printablehash(unsigned long hash);
  94. long fixpipl(PIPropertyList *pipl,long origsize,StringPtr title);
  95. long fixaete(unsigned char *p,long origsize,StringPtr title);
  96. void obfusc(unsigned char *pparm,size_t size);
  97.  
  98. Boolean loadfile(StandardFileReply *sfr,char **reason);
  99. Boolean readPARMresource(HMODULE hm,char **reason,int readobfusc);
  100.  
  101. void dbglasterror(char*);
  102.  
  103. // from parser.y
  104. struct node *parseexpr(char *s);
  105.