Subversion Repositories filter_foundry

Rev

Rev 192 | Rev 198 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 192 Rev 194
Line 213... Line 213...
213
        for(i = 0; i < nplanes; i++)
213
        for(i = 0; i < nplanes; i++)
214
                if(!tree[i]){
214
                if(!tree[i]){
215
                        /* uh oh, couldn't parse one of the saved expressions...this is fatal */
215
                        /* uh oh, couldn't parse one of the saved expressions...this is fatal */
216
                        DISABLEDLGITEM(dp,IDOK);
216
                        DISABLEDLGITEM(dp,IDOK);
217
                        if(gdata->standalone){
217
                        if(gdata->standalone){
218
                                alertuser("Can't run this filter (there is a problem with the saved expressions).","");
218
                                alertuser(my_strdup("Can't run this filter (there is a problem with the saved expressions)."),my_strdup(""));
219
                        }else{
219
                        }else{
220
                                DISABLEDLGITEM(dp,SAVEITEM);
220
                                DISABLEDLGITEM(dp,SAVEITEM);
221
                                DISABLEDLGITEM(dp,MAKEITEM);
221
                                DISABLEDLGITEM(dp,MAKEITEM);
222
                        }
222
                        }
223
                        return;
223
                        return;
Line 238... Line 238...
238
/* one-time initialisation of dialog box */
238
/* one-time initialisation of dialog box */
239
 
239
 
240
void maindlginit(DIALOGREF dp){
240
void maindlginit(DIALOGREF dp){
241
        char s[0x100];
241
        char s[0x100];
242
        int i;
242
        int i;
243
        char *channelsuffixes[] = {
243
        const char *channelsuffixes[] = {
244
                "", "KA", "I", "RGBA",
244
                "", "KA", "I", "RGBA",
245
                "CMYK", "HSL", "HSB", "1234",
245
                "CMYK", "HSL", "HSB", "1234",
246
                "DA", "LabA"
246
                "DA", "LabA"
247
        };
247
        };
248
 
248
 
Line 336... Line 336...
336
                dispose_preview();
336
                dispose_preview();
337
                return false; // end dialog
337
                return false; // end dialog
338
        case OPENITEM:
338
        case OPENITEM:
339
                if(!gdata->standalone && choosefiletypes(
339
                if(!gdata->standalone && choosefiletypes(
340
                                        #ifdef MAC_ENV
340
                                        #ifdef MAC_ENV
341
                                        (StringPtr)"\pChoose filter settings",
341
                                        (StringPtr)my_strdup("\pChoose filter settings"),
342
                                        #else
342
                                        #else
343
                                        (StringPtr)"Choose filter settings",
343
                                        (StringPtr)my_strdup("Choose filter settings"),
344
                                        #endif
344
                                        #endif
345
                                        &sfr,&reply,types,2,
345
                                        &sfr,&reply,types,2,
346
                                        "All supported files (*.afs, *.8bf, *.pff, *.prm, *.bin, *.txt)\0*.afs;*.8bf;*.pff;*.prm;*.bin;*.txt\0Filter Factory Settings (*.afs, *.txt)\0*.afs;*.txt\0Filter Factory for Windows, Standalone Filter (*.8bf)\0*.8bf\0Premiere TF/FF Settings (*.pff, *.txt)\0*.pff;*.txt\0Premiere TT/FF for Windows, Standalone Filter (*.prm)\0*.prm\0FilterFactory for MacOS, Standalone Filter (*.bin)\0*.bin\0All files (*.*)\0*.*\0\0"
346
                                        my_strdup("All supported files (*.afs, *.8bf, *.pff, *.prm, *.bin, *.txt)\0*.afs;*.8bf;*.pff;*.prm;*.bin;*.txt\0Filter Factory Settings (*.afs, *.txt)\0*.afs;*.txt\0Filter Factory for Windows, Standalone Filter (*.8bf)\0*.8bf\0Premiere TF/FF Settings (*.pff, *.txt)\0*.pff;*.txt\0Premiere TT/FF for Windows, Standalone Filter (*.prm)\0*.prm\0FilterFactory for MacOS, Standalone Filter (*.bin)\0*.bin\0All files (*.*)\0*.*\0\0")
347
                                        #ifdef _WIN32
347
                                        #ifdef _WIN32
348
                                        ,gdata->hWndMainDlg
348
                                        ,gdata->hWndMainDlg
349
                                        #endif /* _WIN32 */
349
                                        #endif /* _WIN32 */
350
                                        )){
350
                                        )){
351
                        if(loadfile(&sfr,&reason)){
351
                        if(loadfile(&sfr,&reason)){
352
                                updatedialog(dp);
352
                                updatedialog(dp);
353
                                maindlgupdate(dp);
353
                                maindlgupdate(dp);
354
                        }else
354
                        }else
355
                                alertuser("Cannot load settings.",reason);
355
                                alertuser(my_strdup("Cannot load settings."),reason);
356
                }
356
                }
357
                break;
357
                break;
358
        case SAVEITEM:
358
        case SAVEITEM:
359
                if(!gdata->standalone && putfile(
359
                if(!gdata->standalone && putfile(
360
                                                                                #ifdef MAC_ENV
360
                                                                                #ifdef MAC_ENV
361
                                                                                (StringPtr)"\pSave filter settings",
361
                                                                                (StringPtr)my_strdup("\pSave filter settings"),
362
                                                                                #else
362
                                                                                #else
363
                                                                                (StringPtr)"Save filter settings",
363
                                                                                (StringPtr)my_strdup("Save filter settings"),
364
                                                                                #endif
364
                                                                                #endif
365
                                                                                (StringPtr)"",
365
                                                                                (StringPtr)"",
366
                                                                                TEXT_FILETYPE,SIG_SIMPLETEXT,&reply,&sfr,
366
                                                                                TEXT_FILETYPE,SIG_SIMPLETEXT,&reply,&sfr,
367
                                                                                "afs","Settings file (.afs, .txt)\0*.afs;*.txt\0\0",1
367
                                                                                my_strdup("afs"),my_strdup("Settings file (.afs, .txt)\0*.afs;*.txt\0\0"),1
368
                                                                                #ifdef _WIN32
368
                                                                                #ifdef _WIN32
369
                                                                                ,gdata->hWndMainDlg
369
                                                                                ,gdata->hWndMainDlg
370
                                                                                #endif /* _WIN32 */
370
                                                                                #endif /* _WIN32 */
371
                                                                                )){
371
                                                                                )){
372
                        if(savefile(&sfr))
372
                        if(savefile(&sfr))
Line 379... Line 379...
379
#ifdef MACMACHO
379
#ifdef MACMACHO
380
                        PLstrcat(fname,(StringPtr)"\p.plugin");
380
                        PLstrcat(fname,(StringPtr)"\p.plugin");
381
#endif
381
#endif
382
                        if( putfile(
382
                        if( putfile(
383
                                                #ifdef MAC_ENV
383
                                                #ifdef MAC_ENV
384
                                                (StringPtr)"\pMake standalone filter",
384
                                                (StringPtr)my_strdup("\pMake standalone filter"),
385
                                                #else
385
                                                #else
386
                                                (StringPtr)"Make standalone filter",
386
                                                (StringPtr)my_strdup("Make standalone filter"),
387
                                                #endif
387
                                                #endif
388
                                                fname,
388
                                                fname,
389
                                                PS_FILTER_FILETYPE,kPhotoshopSignature,&reply,&sfr,
389
                                                PS_FILTER_FILETYPE,kPhotoshopSignature,&reply,&sfr,
390
                                                "8bf","Filter plugin file (.8bf)\0*.8bf\0\0",1
390
                                                my_strdup("8bf"),my_strdup("Filter plugin file (.8bf)\0*.8bf\0\0"),1
391
                                                #ifdef _WIN32
391
                                                #ifdef _WIN32
392
                                                ,gdata->hWndMainDlg
392
                                                ,gdata->hWndMainDlg
393
                                                #endif /* _WIN32 */
393
                                                #endif /* _WIN32 */
394
                                                ))
394
                                                ))
395
                                make_standalone(&sfr);
395
                                make_standalone(&sfr);
Line 440... Line 440...
440
        case FIRSTICONITEM:
440
        case FIRSTICONITEM:
441
        case FIRSTICONITEM+1:
441
        case FIRSTICONITEM+1:
442
        case FIRSTICONITEM+2:
442
        case FIRSTICONITEM+2:
443
        case FIRSTICONITEM+3:
443
        case FIRSTICONITEM+3:
444
                item -= FIRSTICONITEM;
444
                item -= FIRSTICONITEM;
445
                alertuser(err[item],"");
445
                alertuser(err[item],my_strdup(""));
446
                SELECTCTLTEXT(dp,FIRSTEXPRITEM+item,errstart[item],errpos[item]);
446
                SELECTCTLTEXT(dp,FIRSTEXPRITEM+item,errstart[item],errpos[item]);
447
                break;
447
                break;
448
        case FIRSTEXPRITEM:
448
        case FIRSTEXPRITEM:
449
        case FIRSTEXPRITEM+1:
449
        case FIRSTEXPRITEM+1:
450
        case FIRSTEXPRITEM+2:
450
        case FIRSTEXPRITEM+2:
Line 458... Line 458...
458
 
458
 
459
        return true; // keep going
459
        return true; // keep going
460
}
460
}
461
 
461
 
462
Boolean alertuser(char *err,char *more){
462
Boolean alertuser(char *err,char *more){
463
        char *s = malloc(strlen(err)+strlen(more)+2),*q;
463
        char *s = (char*)malloc(strlen(err)+strlen(more)+2),*q;
464
        Boolean res;
464
        Boolean res;
465
 
465
 
466
        q = cat(s,err);
466
        q = cat(s,err);
467
        *q++ = '\n';
467
        *q++ = '\n';
468
        q = cat(q,more);
468
        q = cat(q,more);