/* This file is part of icoformat, a Windows Icon (ICO) File Format plugin for Adobe Photoshop Copyright (C) 2002-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 "IcoChooseFormatController.h" #include "../icoformat.h" #include "../ui.h" @implementation IcoChooseFormatController - (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:@"IcoChooseFormat" owner:self]) NSLog(@"failed to load ChooseFormat xib"); return self; } - (int) showWindow { [pickMatrix selectCellWithTag:usepng]; //[pickFormatWindow makeKeyAndOrderFront:nil]; int b = [[NSApplication sharedApplication] runModalForWindow:pickFormatWindow]; [pickFormatWindow orderOut:self]; return b; } - (IBAction)standardFormat:(id)sender { usepng = false; } - (IBAction)pngFormat:(id)sender { usepng = true; } - (IBAction)okAction:(id)sender { [[NSApplication sharedApplication] stopModalWithCode:1]; } - (IBAction)cancelAction:(id)sender { [[NSApplication sharedApplication] stopModalWithCode:0]; } @end static IcoChooseFormatController *gController = NULL; Boolean formatdialog(FormatRecordPtr pb){ if(!gController) gController = [[IcoChooseFormatController alloc] init]; return [gController showWindow]; } #endif