/*
 * ViewILBM.c
 *   Read an ILBM file and display as a screen/window until closed.
 *   Simulated close gadget in upper left corner of window.
 *   Clicking below title bar area toggles screen bar for dragging.
 *   Handles normal and HAM ILBM's
 *
 *  By Carolyn Scheppner   CBM  03/15/86
 *  Modified 09/02/86 - Only global frame is iFrame
 *                      Use message->MouseX and Y
 *                      Wait() for IDCMP
 *  Modified 10/15/86 - For HAM
 *                      Name changed from SeeILBM to ViewILBM
 *  Modified 11/01/86 - Revised for linkage with myreadpict.c
 *  Modified 11/18/86 - For Astartup ... Amiga.lib, LC.lib linkage
 *
 * Based on ShowILBM.c, readpict.c    1/86
 *  By Jerry Morrison, Steve Shaw, and Steve Hayes, Electronic Arts.
 *  This software is in the public domain.
 *
 * >>NOTE<<: This example must be linked with additional IFF rtn files.
 *           See linkage information below.
 *
 * The display portion is specific to the Commodore Amiga computer.
 *
 * Linkage Information:
 *  (NOTE: All modules including iff stuff compiled with -v on LC2)
 *
 * FROM     AStartup.obj,ViewILBM.o,myreadpict.o,iffr.o,ilbmr.o,unpacker.o
 * TO       ViewILBM
 * LIBRARY  Amiga.lib, LC.lib
 * 
 */

#include <exec/types.h>
#include <exec/memory.h>
#include <libraries/dos.h>
#include <libraries/dosextens.h>
#include <graphics/gfxbase.h>
#include <graphics/rastport.h>
#include <graphics/gfx.h>
#include <graphics/view.h>
#include <workbench/startup.h>
#include <intuition/intuition.h>

#include "iff/ilbm.h"
#include "myreadpict.h"


/* For wbStdio rtns */
extern LONG stdin, stdout, stderr;  /* in Astartup.obj */
char conSpec[] = "CON:0/40/640/140/>> ViewILBM <<";
BOOL wbHasStdio = NULL;


/* general usage pointers */
struct GfxBase       *GfxBase;
struct IntuitionBase *IntuitionBase;
struct IntuiMessage  *message;

/* Globals for displaying an image */
struct Screen   *screen1;
struct Window   *window1;^" & 2!t0" *&!u~&$*&! *^" & 2!t8 "*&!u~"$*&! *_^" & 2!t8 0%uut 8 0%*uuuuuujt  (%t8 0%t" & 2!t"*'t"(0()t$82"uuj__jt*'t*&: *2=t" 0&  %ujuuuu^ ,  &+t" & 2!t 0&  %u~ *2<""*^

	uut"&*(*^" & 2!t8( *2:u~" 0& *2:iu~* "*2:*__jt
 < 't"(*60("uj^8*!uut8it &&*'*^  ut2*^

	ut  *""( it ** *^ 

t2(0""it2*  it$(  "*^
t(* " it(* " *__jt & 2  & "t"*'t* "t2&  +it* "t8* *"uj_^" & 2!uut  ,   'uuuuuut  , **!u(t*_uuuv *$0/j"**!wiuuuuuuuuuuuuuuuuuuuujt‚  