Subversion Repositories filter_foundry

Rev

Rev 505 | 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.net
  4.     Copyright (C) 2018-2022 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. #ifndef FF_MISC_H_
  22. #define FF_MISC_H_
  23.  
  24. extern FilterRecordPtr gpb;
  25.  
  26. #define BUFVERSION_NULL    'bNUL'
  27. #define BUFVERSION_STD32   'bST1'
  28. #define BUFVERSION_STD64   'bST2'
  29. #define BUFVERSION_SUITE32 'bSU1'
  30. #define BUFVERSION_SUITE64 'bSU2'
  31.  
  32. typedef struct FFBuffer_ {
  33.     OSType signature; // BUFVERSION_*
  34.     BufferID standard;
  35.     Ptr suite;
  36. } FFBuffer;
  37.  
  38. void newBuffer(FFBuffer* buf, size_t size);
  39. Ptr lockBuffer(FFBuffer* buf);
  40. void unlockBuffer(FFBuffer* buf);
  41. void disposeBuffer(FFBuffer* buf);
  42.  
  43. #define HDLVERSION_NULL     'hNUL'
  44. #define HDLVERSION_STANDARD 'hSTD'
  45. #define HDLVERSION_SUITE1   'hSU1'
  46. #define HDLVERSION_SUITE2   'hSU2'
  47.  
  48. typedef struct FFHandle_ {
  49.     OSType signature; // HDLVERSION_*
  50.     Handle handle;
  51. } FFHandle;
  52.  
  53. void newHandle(FFHandle* hdl, size_t nBytes);
  54. void disposeHandle(FFHandle* hdl);
  55. size_t getHandleSize(FFHandle* hdl);
  56. OSErr setHandleSize(FFHandle* hdl, size_t nBytes);
  57. Ptr lockHandle(FFHandle* hdl);
  58. void unlockHandle(FFHandle* hdl);
  59.  
  60. // These functions are for code backwards compatibility:
  61. Handle PINEWHANDLE(int32 size);
  62. void PIDISPOSEHANDLE(Handle h);
  63. size_t PIGETHANDLESIZE(Handle h);
  64. OSErr PISETHANDLESIZE(Handle h, int32 newSize);
  65. Ptr PILOCKHANDLE(Handle h, Boolean moveHigh);
  66. void PIUNLOCKHANDLE(Handle h);
  67.  
  68. //#define PINEWHANDLE      gpb->handleProcs->newProc
  69. //#define PIDISPOSEHANDLE  gpb->handleProcs->disposeProc
  70. //#define PIGETHANDLESIZE  gpb->handleProcs->getSizeProc
  71. //#define PISETHANDLESIZE  gpb->handleProcs->setSizeProc
  72. //#define PILOCKHANDLE     gpb->handleProcs->lockProc
  73. //#define PIUNLOCKHANDLE   gpb->handleProcs->unlockProc
  74.  
  75. #define MIN(a,b) ((a) < (b) ? (a) : (b))
  76. #define MAX(a,b) ((a) > (b) ? (a) : (b))
  77.  
  78. #endif
  79.