Subversion Repositories filter_foundry

Rev

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