/* This file is part of TIFFViewer Copyright (C) 2002-4 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 */ #include "carbonstuff.h" #if 0 #include #include // kHighLevelEvent #include #include #include // SysBeep #include #include #include #include #include #include #include #endif #include // StripAddress #include #include #include //#include "dlg.h" #include "misc-mac.h" #include "qd.h" #include "wind.h" #include "ae.h" #include "str.h" #include "dbg.h" #include "calc_std_state.h" #include "tiffio.h" #include "resource_ids.h" typedef short FILEREF; typedef struct { short refnum; TIFF *tif; uint32 rowsperstrip,width,height; uint16 bitspersample,samplesperpixel; int dircount,curdir,aalevel; float xscale,yscale,zoom,xres,yres; GWorldPtr gw; Rect bounds; ControlRef hscroll,vscroll; } wdata; extern CursHandle watch; void bad(char *msg); void note(char *msg); void draw(PixMapHandle pm,wdata *wd); void setuppage(WindowRef w,wdata *wd); void resizewindow(WindowRef w,wdata *wd); void redrawwindow(WindowRef w,wdata *wd); void close_window(WindowRef w); void do_open(); void draw_window(WindowRef w,RgnHandle rgn); void contentclick(WindowRef w,EventRecord *e); void gotopage(WindowRef w,int p); void setzoom(WindowRef w,float z); void fixmenus(); void do_menu(long r); void eventloop(); AE_HANDLER(my_open_doc); enum{APPLE_MENU=1,FILE_MENU,PAGE_MENU}; enum{ABOUT_ITEM=1}; enum{OPEN_ITEM=1,CLOSE_ITEM,QUIT_ITEM=4}; enum{FIRSTPAGE_ITEM=1,PREVPAGE_ITEM,NEXTPAGE_ITEM,LASTPAGE_ITEM, ZOOMIN_ITEM=LASTPAGE_ITEM+2,ZOOMOUT_ITEM,FIT_ITEM, AA_ITEM=FIT_ITEM+3}; enum{ GWDEPTH = 8,AAMAX = 4 };