/* This file is part of SGI Format, a File Format plugin for Adobe Photoshop Copyright (C) 2003-2010 Toby Thain, toby@telegraphics.com.au This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Loosely based on Dissolve sample plugin, CS5 SDK #ifdef __x86_64__ #import "SGIChooseFormatController.h" #include "../sgiformat.h" extern Boolean rle; @implementation SGIChooseFormatController - (id) init { self = [super init]; // initialize NSApplication, using an entry point that is specific to // bundles this is a no-op for Cocoa apps, but is required by Carbon apps //NSApplicationLoad(); if (![NSBundle loadNibNamed:@"SGIChooseFormat" owner:self]) NSLog(@"failed to load SGIChooseFormat nib"); return self; } - (int) showWindow { [pickMatrix selectCellWithTag:rle]; //[pickFormatWindow makeKeyAndOrderFront:nil]; int b = [[NSApplication sharedApplication] runModalForWindow:pickFormatWindow]; [pickFormatWindow orderOut:self]; return b; } - (IBAction)compressionNone:(id)sender { rle = 0; } - (IBAction)compressionRLE:(id)sender { rle = 1; } - (IBAction)okAction:(id)sender { [[NSApplication sharedApplication] stopModalWithCode:1]; } - (IBAction)cancelAction:(id)sender { [[NSApplication sharedApplication] stopModalWithCode:0]; } @end static SGIChooseFormatController *gController = NULL; Boolean compdlg(FormatRecordPtr pb){ if(!gController) gController = [[SGIChooseFormatController alloc] init]; return [gController showWindow]; } #endif