Rev 491 | Rev 498 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 491 | Rev 492 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | // Used to find out which host signatures and memory settings a plugin host has |
38 | // Used to find out which host signatures and memory settings a plugin host has |
39 | //#define SHOW_HOST_DEBUG |
39 | //#define SHOW_HOST_DEBUG |
40 | 40 | ||
41 | // Here are working variables: |
41 | // Here are working variables: |
42 | struct node *tree[4]; |
42 | struct node *tree[4]; |
43 | char *err[4]; |
43 | TCHAR *err[4]; |
44 | int errpos[4],errstart[4],nplanes,cnvused,chunksize,toprow; |
44 | int errpos[4],errstart[4],nplanes,cnvused,chunksize,toprow; |
45 | uint8_t slider[8]; // this is the "working data". We cannot always use gdata->parm, because parm will not be loaded if a AFS file is read |
45 | uint8_t slider[8]; // this is the "working data". We cannot always use gdata->parm, because parm will not be loaded if a AFS file is read |
46 | char* expr[4]; // this is the "working data". We cannot always use gdata->parm, because parm will not be loaded if a AFS file is read |
46 | char* expr[4]; // this is the "working data". We cannot always use gdata->parm, because parm will not be loaded if a AFS file is read |
47 | value_type cell[NUM_CELLS]; |
47 | value_type cell[NUM_CELLS]; |
48 | 48 | ||
Line 133... | Line 133... | ||
133 | MessageBoxA(0, tmp, 0, 0); |
133 | MessageBoxA(0, tmp, 0, 0); |
134 | free(tmp); |
134 | free(tmp); |
135 | } |
135 | } |
136 | */ |
136 | */ |
137 | 137 | ||
138 | simplealert((TCHAR*)TEXT("You tried to execute this DLL with RunDLL32. This is a Photoshop plugin!")); |
138 | simplealert_id(MSG_RUNDLL_ERR_ID); |
- | 139 | ||
139 | return; |
140 | return; |
140 | } |
141 | } |
141 | 142 | ||
142 | void CreateDataPointer(intptr_t* data) { |
143 | void CreateDataPointer(intptr_t* data) { |
143 | // Register "gdata" that contains the PARM information and other things which need to be persistant |
144 | // Register "gdata" that contains the PARM information and other things which need to be persistant |
Line 200... | Line 201... | ||
200 | 201 | ||
201 | DLLEXPORT MACPASCAL |
202 | DLLEXPORT MACPASCAL |
202 | void ENTRYPOINT(short selector, FilterRecordPtr pb, intptr_t *data, short *result){ |
203 | void ENTRYPOINT(short selector, FilterRecordPtr pb, intptr_t *data, short *result){ |
203 | static Boolean wantdialog = false; |
204 | static Boolean wantdialog = false; |
204 | static Boolean premiereWarnedOnce = false; |
205 | static Boolean premiereWarnedOnce = false; |
205 | char *reason; |
206 | TCHAR*reason; |
206 | 207 | ||
207 | #ifdef SHOW_HOST_DEBUG |
208 | #ifdef SHOW_HOST_DEBUG |
208 | char* tmp; |
209 | char* tmp; |
209 | #endif |
210 | #endif |
210 | 211 | ||
Line 273... | Line 274... | ||
273 | // but it crashes in evalpixel() where there is write-access to the "outp". |
274 | // but it crashes in evalpixel() where there is write-access to the "outp". |
274 | // DM 24.04.2022 : On Adobe Premiere 6 + Win10, the filter opens sometimes (and sometimes crashes inside DialogBoxParam), |
275 | // DM 24.04.2022 : On Adobe Premiere 6 + Win10, the filter opens sometimes (and sometimes crashes inside DialogBoxParam), |
275 | // but the filter is not applied when you click "OK" (because it crashes internally; only the debugger sees it)... |
276 | // but the filter is not applied when you click "OK" (because it crashes internally; only the debugger sees it)... |
276 | // Probably the canvas structure is different (maybe it contains frames to achieve transitions?) |
277 | // Probably the canvas structure is different (maybe it contains frames to achieve transitions?) |
277 | if (!premiereWarnedOnce) { |
278 | if (!premiereWarnedOnce) { |
278 | simplealert((TCHAR*)TEXT("This version of Filter Foundry is not compatible with Adobe Premiere!")); |
279 | simplealert_id(MSG_PREMIERE_COMPAT_ID); |
279 | } |
280 | } |
280 | premiereWarnedOnce = true; |
281 | premiereWarnedOnce = true; |
281 | *result = errPlugInHostInsufficient; |
282 | *result = errPlugInHostInsufficient; |
282 | goto endmain; |
283 | goto endmain; |
283 | } |
284 | } |
Line 312... | Line 313... | ||
312 | if (!gdata) break; |
313 | if (!gdata) break; |
313 | gdata->hWndMainDlg = (HWND)((PlatformData*)((AboutRecordPtr)pb)->platformData)->hwnd; // so that simplealert() works |
314 | gdata->hWndMainDlg = (HWND)((PlatformData*)((AboutRecordPtr)pb)->platformData)->hwnd; // so that simplealert() works |
314 | gdata->standalone = gdata->parmloaded = readPARMresource((HMODULE)hDllInstance,&reason); |
315 | gdata->standalone = gdata->parmloaded = readPARMresource((HMODULE)hDllInstance,&reason); |
315 | if (gdata->parmloaded && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) { |
316 | if (gdata->parmloaded && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) { |
316 | if (gdata->obfusc) { |
317 | if (gdata->obfusc) { |
317 | simplealert((TCHAR*)TEXT("Incompatible obfuscation.")); |
318 | simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID); |
318 | } |
319 | } |
319 | else { |
320 | else { |
320 | simplealert((TCHAR*)TEXT("Invalid parameter data.")); |
321 | simplealert_id(MSG_INVALID_PARAMETER_DATA_ID); |
321 | } |
322 | } |
322 | } |
323 | } |
323 | else { |
324 | else { |
324 | DoAbout((AboutRecordPtr)pb); |
325 | DoAbout((AboutRecordPtr)pb); |
325 | } |
326 | } |
Line 446... | Line 447... | ||
446 | 447 | ||
447 | ExitCodeResource(); |
448 | ExitCodeResource(); |
448 | } |
449 | } |
449 | 450 | ||
450 | int checkandinitparams(Handle params){ |
451 | int checkandinitparams(Handle params){ |
451 | char *reasonstr,*reason; |
452 | TCHAR*reasonstr,*reason; |
452 | int i; |
453 | int i; |
453 | Boolean bUninitializedParams; |
454 | Boolean bUninitializedParams; |
454 | Boolean showdialog; |
455 | Boolean showdialog; |
455 | 456 | ||
456 | if (!host_preserves_parameters()) { |
457 | if (!host_preserves_parameters()) { |
Line 468... | Line 469... | ||
468 | // Reason: readPARMresource() reads parameters from the DLL while loadfile() reads parameters from the AFS file |
469 | // Reason: readPARMresource() reads parameters from the DLL while loadfile() reads parameters from the AFS file |
469 | // But loadfile() will reset gdata->standalone ... |
470 | // But loadfile() will reset gdata->standalone ... |
470 | isStandalone = readPARMresource((HMODULE)hDllInstance, &reason); |
471 | isStandalone = readPARMresource((HMODULE)hDllInstance, &reason); |
471 | if (isStandalone && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) { |
472 | if (isStandalone && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) { |
472 | if (gdata->obfusc) { |
473 | if (gdata->obfusc) { |
473 | simplealert((TCHAR*)TEXT("Incompatible obfuscation.")); |
474 | simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID); |
474 | } |
475 | } |
475 | else { |
476 | else { |
476 | simplealert((TCHAR*)TEXT("Invalid parameter data.")); |
477 | simplealert_id(MSG_INVALID_PARAMETER_DATA_ID); |
477 | } |
478 | } |
478 | gdata->parmloaded = false; |
479 | gdata->parmloaded = false; |
479 | return false; |
480 | return false; |
480 | } |
481 | } |
481 | 482 | ||
Line 514... | Line 515... | ||
514 | 515 | ||
515 | // see if saved parameters exist |
516 | // see if saved parameters exist |
516 | gdata->standalone = gdata->parmloaded = readPARMresource((HMODULE)hDllInstance,&reason); |
517 | gdata->standalone = gdata->parmloaded = readPARMresource((HMODULE)hDllInstance,&reason); |
517 | if (gdata->parmloaded && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) { |
518 | if (gdata->parmloaded && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) { |
518 | if (gdata->obfusc) { |
519 | if (gdata->obfusc) { |
519 | simplealert((TCHAR*)TEXT("Incompatible obfuscation.")); |
520 | simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID); |
520 | } |
521 | } |
521 | else { |
522 | else { |
522 | simplealert((TCHAR*)TEXT("Invalid parameter data.")); |
523 | simplealert_id(MSG_INVALID_PARAMETER_DATA_ID); |
523 | } |
524 | } |
524 | gdata->parmloaded = false; |
525 | gdata->parmloaded = false; |
525 | return false; |
526 | return false; |
526 | } |
527 | } |
527 | 528 |