Subversion Repositories filter_foundry

Rev

Rev 190 | Rev 194 | 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-2009 Toby Thain, toby@telegraphics.com.au
  4.     Copyright (C) 2018-2019 Daniel Marschall, ViaThinkSoft
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 2 of the License, or
  9.     (at your option) any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19. */
  20.  
  21. #include "world.h"
  22.  
  23. #include "PIFilter.h"
  24.  
  25. #include "entry.h"
  26.  
  27. #include "choosefile.h"
  28. #include "ui.h"
  29. #include "file_compat.h"
  30. #include "symtab.h"
  31. #include "PARM.h"
  32. #include "preview.h"
  33. #include "misc.h"
  34.  
  35. #ifndef INCLUDED_FF_H
  36. #define INCLUDED_FF_H
  37.  
  38. #define HOSTSIG_GIMP 'PMIG' // sic: NOT 'GIMP'
  39. #define HOSTSIG_IRFANVIEW 'UP20'
  40. #define HOSTSIG_PHOTOSHOP '8BIM'
  41. #define HOSTSIG_PLUGINCOMMANDER '8BIM' // meh.
  42. #define HOSTSIG_SERIF_PHOTOPLUS '8BIM' // meh.
  43. #define HOSTSIG_JASC_PAINTSHOP_PRO_X 'PSP9'
  44.  
  45. enum{
  46.         TAB = 011,
  47.         LF  = 012,
  48.         CR  = 015,
  49.  
  50.         CHUNK_ROWS = 64,
  51.  
  52.         PARM_TYPE = 'PARM',
  53.         PARM_ID = 16000,
  54.         OBFUSCDATA_ID = 16001,
  55.         TEXT_FILETYPE = 'TEXT',
  56.         SIG_SIMPLETEXT = 'ttxt',
  57.         PS_FILTER_FILETYPE = '8BFM'
  58. };
  59.  
  60. typedef struct{
  61.         Boolean standalone,parmloaded,obfusc;
  62.         PARM_T parm;
  63.         #ifdef _WIN32
  64.         HWND hWndMainDlg;
  65.         #endif /* _WIN32 */
  66. } globals_t;
  67.  
  68. extern globals_t *gdata;
  69.  
  70. #define NUM_CELLS 0x100
  71.  
  72. extern struct node *tree[4];
  73. extern char *err[4];
  74. extern int errpos[4],errstart[4];//,nplanes;
  75. extern value_type slider[8],cell[NUM_CELLS],map[4][0x100];
  76. extern char *expr[4];
  77. // extern long maxSpace;
  78.  
  79. extern int tokpos,tokstart,varused[];
  80. extern char *errstr;
  81.  
  82. #define DBG(x)
  83. //#define DEBUG
  84.  
  85. #define PS_BUFFER_ALLOC  (pb->bufferProcs->allocateProc)
  86. #define PS_BUFFER_LOCK   (pb->bufferProcs->lockProc)
  87. #define PS_BUFFER_UNLOCK (pb->bufferProcs->unlockProc)
  88. #define PS_BUFFER_FREE   (pb->bufferProcs->freeProc)
  89.  
  90. void DoPrepare (FilterRecordPtr epb);
  91. void DoStart (FilterRecordPtr epb);
  92. OSErr DoContinue (FilterRecordPtr epb);
  93. void DoFinish (FilterRecordPtr epb);
  94. void RequestNext (FilterRecordPtr epb,long);
  95.  
  96. Boolean readparams(Handle h,Boolean alerts,char **reason);
  97. void convert_premiere_to_photoshop(PARM_T* photoshop, PARM_T_PREMIERE* premiere);
  98. Boolean read8bfplugin(StandardFileReply *sfr,char **reason);
  99. Handle readfileintohandle(FILEREF r);
  100. Boolean readfile(StandardFileReply *sfr,char **reason);
  101. Boolean readPARM(Ptr h,PARM_T *parm,char **reasonstr,int fromwin);
  102.  
  103. OSErr saveparams(Handle h);
  104. OSErr savehandleintofile(Handle h,FILEREF r);
  105. Boolean savefile(StandardFileReply *sfr);
  106.  
  107. OSErr make_standalone(StandardFileReply *sfr);
  108.  
  109. Boolean setup(FilterRecordPtr pb);
  110. void evalpixel(unsigned char *outp,unsigned char *inp);
  111.  
  112. unsigned long printablehash(unsigned long hash);
  113. size_t fixpipl(PIPropertyList *pipl,size_t origsize,StringPtr title);
  114. size_t aete_generate(void* aeteptr, PARM_T *pparm);
  115. void obfusc(unsigned char *pparm,size_t size);
  116.  
  117. Boolean loadfile(StandardFileReply *sfr,char **reason);
  118. Boolean readPARMresource(HMODULE hm,char **reason,int readobfusc);
  119.  
  120. void dbglasterror(char*);
  121.  
  122. // from main.c
  123. int64_t maxspace();
  124. Boolean maxspace_available();
  125. Boolean host_preserves_parameters();
  126.  
  127. // from parser.y
  128. struct node *parseexpr(char *s);
  129.  
  130. #ifdef _MSC_VER
  131.         // Microsoft dumbassery
  132.         #define strcasecmp _stricmp
  133.         #define snprintf _snprintf
  134. #endif /* _MSC_VER */
  135.  
  136. #endif /* INCLUDED_FF_H */
  137.