Rev 516 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 516 | Rev 517 | ||
---|---|---|---|
Line 170... | Line 170... | ||
170 | unsigned long hash; |
170 | unsigned long hash; |
171 | size_t realLength; |
171 | size_t realLength; |
172 | size_t roundedLength; |
172 | size_t roundedLength; |
173 | unsigned long componentVersion; |
173 | unsigned long componentVersion; |
174 | time_t curTime; |
174 | time_t curTime; |
175 | char szScope[0x300]; |
175 | char szScope[0x300], szOID[0x50]; |
176 | 176 | ||
177 | pipl->count += 4; // 4 more keys in PiPL: catg, name, cmpt, hstm |
177 | pipl->count += 5; // 5 more keys in PiPL: catg, name, cmpt, hstm, ObId |
178 | 178 | ||
179 | p = (char*)pipl + origsize; |
179 | p = (char*)pipl + origsize; |
180 | prop = (PIProperty*)p; |
180 | prop = (PIProperty*)p; |
181 | 181 | ||
182 | /* Important not about proptyLength: |
182 | /* Important not about proptyLength: |
Line 229... | Line 229... | ||
229 | memcpy(prop->propertyData, &componentVersion, sizeof(componentVersion)); |
229 | memcpy(prop->propertyData, &componentVersion, sizeof(componentVersion)); |
230 | strcpy((char*)(prop->propertyData+sizeof(componentVersion)), component); |
230 | strcpy((char*)(prop->propertyData+sizeof(componentVersion)), component); |
231 | p += offsetof(PIProperty, propertyData) + prop->propertyLength; // skip past new property record, and any padding |
231 | p += offsetof(PIProperty, propertyData) + prop->propertyLength; // skip past new property record, and any padding |
232 | prop = (PIProperty*)p; |
232 | prop = (PIProperty*)p; |
233 | 233 | ||
- | 234 | /* add OID property key */ |
|
- | 235 | ||
- | 236 | sprintf(szScope, "%s %s", category, component); |
|
- | 237 | hash = djb2(szScope); |
|
- | 238 | // max 47 chars ("1.3.6.1.4.1.37476.2.72.1.4294967295.4294967295\0") |
|
- | 239 | sprintf(szOID, "1.3.6.1.4.1.37476.2.72.1.%lu.%lu", hash, componentVersion); |
|
- | 240 | ||
- | 241 | prop->vendorID = kViaThinkSoftSignature; |
|
- | 242 | prop->propertyKey = PIOIDProperty; |
|
- | 243 | prop->propertyID = 0; |
|
- | 244 | prop->propertyLength = (SPInt32)roundToNext4(strlen(szOID) + 1); |
|
- | 245 | memset(prop->propertyData, 0x00, prop->propertyLength); // fill padding with 00h bytes (cosmetics) |
|
- | 246 | strcpy((char*)prop->propertyData, szOID); |
|
- | 247 | p += offsetof(PIProperty, propertyData) + prop->propertyLength; // skip past new property record, and any padding |
|
- | 248 | prop = (PIProperty*)p; |
|
- | 249 | ||
234 | /* add HasTerminology property key */ |
250 | /* add HasTerminology property key */ |
235 | 251 | ||
236 | hstm = (struct hstm_data*)prop->propertyData; |
252 | hstm = (struct hstm_data*)prop->propertyData; |
237 | 253 | ||
238 | sprintf(szScope, "%s %s", category, title); |
- | |
239 | - | ||
240 | #ifdef ENABLE_APPLESCRIPT |
254 | #ifdef ENABLE_APPLESCRIPT |
241 | // If the uniqueString/scope is set, the plugin will only communicate with Photoshop. |
255 | // If the uniqueString/scope is set, the plugin will only communicate with Photoshop. |
242 | // Otherwise it can be accessed with AppleScript, but the AETE keys need to be unique then. |
256 | // Otherwise it can be accessed with AppleScript, but the AETE keys need to be unique then. |
243 | // This is achieved with getAeteKey(). |
257 | // This is achieved with getAeteKey(). |
244 | scopelen = 0; |
258 | scopelen = 0; |
Line 251... | Line 265... | ||
251 | scopelen = strlen(&szScope); |
265 | scopelen = strlen(&szScope); |
252 | memcpy(&hstm->scope, &szScope, scopelen); |
266 | memcpy(&hstm->scope, &szScope, scopelen); |
253 | #endif |
267 | #endif |
254 | 268 | ||
255 | /* make up a new event ID for this aete, based on printable base-95 hash of scope */ |
269 | /* make up a new event ID for this aete, based on printable base-95 hash of scope */ |
256 | hash = djb2(szScope); |
- | |
257 | *event_id = printablehash(hash); /* this is used by aete_generate() later... */ |
270 | *event_id = printablehash(hash); /* this is used by aete_generate() later... */ |
258 | 271 | ||
259 | prop->vendorID = kPhotoshopSignature; |
272 | prop->vendorID = kPhotoshopSignature; |
260 | prop->propertyKey = PIHasTerminologyProperty; |
273 | prop->propertyKey = PIHasTerminologyProperty; |
261 | prop->propertyID = 0; |
274 | prop->propertyID = 0; |