Subversion Repositories filter_foundry

Rev

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