Rev 442 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
334 | daniel-mar | 1 | /* |
2 | This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop |
||
536 | daniel-mar | 3 | Copyright (C) 2003-2009 Toby Thain, toby@telegraphics.net |
334 | daniel-mar | 4 | Copyright (C) 2018-2021 Daniel Marschall, ViaThinkSoft |
259 | daniel-mar | 5 | |
334 | daniel-mar | 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. |
||
259 | daniel-mar | 10 | |
334 | daniel-mar | 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 | |||
439 | daniel-mar | 21 | #ifndef SCRIPTING_H_ |
22 | #define SCRIPTING_H_ |
||
23 | |||
334 | daniel-mar | 24 | /* Portions Copyright 1993 - 1999 Adobe Systems Incorporated */ |
25 | /* All Rights Reserved. */ |
||
26 | |||
442 | daniel-mar | 27 | //#include <stddef.h> // Standard definitions. |
334 | daniel-mar | 28 | //#include <Types.h> // Standard types. |
29 | |||
442 | daniel-mar | 30 | //#include "PITypes.h" // Photoshop types. |
31 | //#include "PIGeneral.h" // Photoshop general routines. |
||
32 | //#include "PIActions.h" // Photoshop scripting. |
||
33 | //#include "PIAbout.h" // AboutRecord structure. |
||
34 | //#include "PIFormat.h" // AboutRecord structure. |
||
334 | daniel-mar | 35 | //#include "PIDefines.h" // Plug-in definitions. |
36 | //#include "FileUtilities.h" // Simple file utilities. |
||
37 | |||
259 | daniel-mar | 38 | Boolean HostDescriptorAvailable (PIDescriptorParameters *procs, |
334 | daniel-mar | 39 | Boolean *outNewerVersion); |
40 | |||
259 | daniel-mar | 41 | OSErr HostCloseReader (PIDescriptorParameters *procs, |
334 | daniel-mar | 42 | HandleProcs *hProcs, |
43 | PIReadDescriptor *token); |
||
44 | |||
45 | OSErr HostCloseWriter(PIDescriptorParameters *procs, |
||
46 | HandleProcs *hProcs, |
||
47 | PIWriteDescriptor *token); |
||
48 | |||
49 | OSErr put_cstring(PIWriteDescriptor token, DescriptorKeyID key, char *s); |
||
50 | |||
259 | daniel-mar | 51 | char *get_cstring(PIReadDescriptor token); |
52 | |||
53 | enum ScriptingShowDialog { |
||
54 | SCR_NO_SCRIPT, |
||
55 | SCR_SHOW_DIALOG, |
||
56 | SCR_HIDE_DIALOG |
||
57 | }; |
||
58 | |||
59 | enum ScriptingShowDialog ReadScriptParamsOnRead(void); |
||
334 | daniel-mar | 60 | |
259 | daniel-mar | 61 | OSErr WriteScriptParamsOnRead(void); |
62 | |||
63 | OSType getAeteKey(char c, PARM_T *parm); |
||
64 | |||
65 | //------------------------------------------------------------------------------- |
||
66 | // PIDescriptorParameters -- Macro definitions |
||
67 | //------------------------------------------------------------------------------- |
||
68 | |||
69 | #define NULLID 0 // for ID routines needing null terminator |
||
70 | |||
71 | #define DescParams gpb->descriptorParameters |
||
72 | |||
73 | #define Reader DescParams->readDescriptorProcs |
||
74 | |||
75 | #define Writer DescParams->writeDescriptorProcs |
||
76 | |||
77 | #define PlayInfo DescParams->playInfo |
||
78 | |||
79 | #define RecordInfo DescParams->recordInfo |
||
80 | |||
81 | #define PlayDialog() \ |
||
82 | HostPlayDialog (DescParams) |
||
83 | |||
84 | #define DescriptorAvailable(outNewerVersion) \ |
||
85 | HostDescriptorAvailable(DescParams, outNewerVersion) |
||
86 | |||
87 | #define WarnDescriptorAvailable() \ |
||
88 | WarnHostDescriptorAvailable(DescParams, hDllInstance) |
||
89 | |||
90 | #define OpenReadDesc(desc, array) \ |
||
91 | Reader->openReadDescriptorProc(desc, array) |
||
92 | |||
93 | #define OpenReader(array) \ |
||
94 | OpenReadDesc(DescParams->descriptor, array) |
||
536 | daniel-mar | 95 | |
259 | daniel-mar | 96 | #define CloseReadDesc(token) \ |
97 | Reader->closeReadDescriptorProc(token) |
||
98 | |||
99 | #define CloseReader(token) \ |
||
100 | HostCloseReader(DescParams, gpb->handleProcs, token) |
||
536 | daniel-mar | 101 | |
259 | daniel-mar | 102 | #define OpenWriter() \ |
103 | Writer->openWriteDescriptorProc() |
||
104 | |||
105 | #define CloseWriteDesc(token, handle) \ |
||
106 | Writer->closeWriteDescriptorProc(token, handle) |
||
107 | |||
108 | #define CloseWriter(token) \ |
||
109 | HostCloseWriter(DescParams, gpb->handleProcs, token) |
||
110 | |||
111 | // These Macros simplify access to all the basic Get and Put routines: |
||
112 | |||
113 | #define PIGetKey(token, key, type, flags) \ |
||
114 | Reader->getKeyProc(token, key, type, flags) |
||
536 | daniel-mar | 115 | |
259 | daniel-mar | 116 | #define PIGetEnum(token, value) \ |
117 | Reader->getEnumeratedProc(token, value) |
||
536 | daniel-mar | 118 | |
259 | daniel-mar | 119 | #define PIPutEnum(token, key, type, value) \ |
120 | Writer->putEnumeratedProc(token, key, type, value) |
||
536 | daniel-mar | 121 | |
259 | daniel-mar | 122 | #define PIGetInt(token, value) \ |
123 | Reader->getIntegerProc(token, value) |
||
124 | |||
125 | #define PIGetPinInt(token, min, max, value) \ |
||
126 | Reader->getPinnedIntegerProc(token, min, max, value) |
||
127 | |||
128 | #define PIPutInt(token, key, value) \ |
||
129 | Writer->putIntegerProc(token, key, value) |
||
536 | daniel-mar | 130 | |
259 | daniel-mar | 131 | #define PIGetFloat(token, value) \ |
132 | Reader->getFloatProc(token, value) |
||
536 | daniel-mar | 133 | |
259 | daniel-mar | 134 | #define PIGetPinFloat(token, min, max, value) \ |
135 | Reader->getPinnedFloatProc(token, min, max, value) |
||
136 | |||
137 | #define PIPutFloat(token, key, value) \ |
||
138 | Writer->putFloatProc(token, key, value) |
||
536 | daniel-mar | 139 | |
259 | daniel-mar | 140 | #define PIGetUnitFloat(token, unit, value) \ |
141 | Reader->getUnitFloatProc(token, unit, value) |
||
142 | |||
143 | #define PIGetPinUnitFloat(token, min, max, unit, value) \ |
||
144 | Reader->getPinnedUnitFloatProc(token, min, max, unit, value) |
||
145 | |||
146 | #define PIPutUnitFloat(token, key, unit, value) \ |
||
147 | Writer->putUnitFloatProc(token, key, unit, value) |
||
536 | daniel-mar | 148 | |
259 | daniel-mar | 149 | #define PIGetBool(token, value) \ |
150 | Reader->getBooleanProc(token, value) |
||
151 | |||
152 | #define PIPutBool(token, key, value) \ |
||
153 | Writer->putBooleanProc(token, key, value) |
||
154 | |||
155 | #define PIGetText(token, value) \ |
||
156 | Reader->getTextProc(token, value) |
||
536 | daniel-mar | 157 | |
259 | daniel-mar | 158 | #define PIPutText(token, key, value) \ |
159 | Writer->putTextProc(token, key, value) |
||
536 | daniel-mar | 160 | |
259 | daniel-mar | 161 | #define PIGetAlias(token, value) \ |
162 | Reader->getAliasProc(token, value) |
||
536 | daniel-mar | 163 | |
259 | daniel-mar | 164 | #define PIPutAlias(token, key, value) \ |
165 | Writer->putAliasProc(token, key, value) |
||
166 | |||
167 | #define PIGetEnum(token, value) \ |
||
168 | Reader->getEnumeratedProc(token, value) |
||
169 | |||
170 | #define PIPutEnum(token, key, type, value) \ |
||
171 | Writer->putEnumeratedProc(token, key, type, value) |
||
172 | |||
173 | #define PIGetClass(token, value) \ |
||
174 | Reader->getClassProc(token, value) |
||
536 | daniel-mar | 175 | |
259 | daniel-mar | 176 | #define PIPutClass(token, key, value) \ |
177 | Writer->putClassProc(token, key, value) |
||
536 | daniel-mar | 178 | |
259 | daniel-mar | 179 | #define PIGetRef(token, value) \ |
180 | Reader->getSimpleReferenceProc(token,value) |
||
536 | daniel-mar | 181 | |
259 | daniel-mar | 182 | #define PIPutRef(token, key, value) \ |
183 | Writer->putSimpleReferenceProc(token, key, value) |
||
536 | daniel-mar | 184 | |
259 | daniel-mar | 185 | #define PIGetObj(token, type, value) \ |
186 | Reader->getObjectProc(token, type, value) |
||
187 | |||
188 | #define PIPutObj(token, key, type, value) \ |
||
189 | HostPutObj(DescParams, gpb->handleProcs, token, key, type, value) |
||
190 | |||
191 | #define PIPutObjProc(token, key, type, value) \ |
||
192 | Writer->putObjectProc(token, key, type, value) |
||
536 | daniel-mar | 193 | |
259 | daniel-mar | 194 | #define PIGetCount(token, value) \ |
195 | Reader->getCountProc(token, value) |
||
536 | daniel-mar | 196 | |
259 | daniel-mar | 197 | #define PIPutCount(token, key, value) \ |
198 | Writer->putCountProc(token, key, value) |
||
536 | daniel-mar | 199 | |
259 | daniel-mar | 200 | #define PIGetStr(token, value) \ |
201 | Reader->getStringProc(token, value) |
||
536 | daniel-mar | 202 | |
259 | daniel-mar | 203 | #define PIPutStr(token, key, value) \ |
204 | Writer->putStringProc(token, key, value) |
||
439 | daniel-mar | 205 | |
206 | #endif |