
#define miniwindowinclude /*so other modules can tell we've been loaded*/


#ifndef shellinclude

	#include "shell.h"
	
#endif


#ifndef langinclude

	#include "lang.h" /*our record has a valuerecord in it*/
	
#endif

#ifndef popupinclude

	#include "popup.h"

#endif

#define maxtextitems 2 

#define maxpopups 2


typedef boolean (*minisavestringcallback) (short, Handle); 
	
typedef boolean (*miniloadstringcallback) (short, Handle *);
	
typedef boolean (*minitexthitcallback) (Point);
	

typedef struct tyminirecord {
	
	short idconfig; /*resource number for config that governs this window*/
	
	short windowtype; /*an index into cancoon.h's windowinfo array*/
	
	short cttextitems; /*actual number of valid item numbers*/
	
	short textitems [maxtextitems]; /*dialog item numbers of the text items*/
	
	Rect textrects [maxtextitems]; /*location of text items*/
	
	struct tywprecord ** textdata [maxtextitems]; /*data of text items*/
	
	short ctpopups; /*actual number of popup menus*/
	
	Rect popuprects [maxpopups]; /*each rect covers a whole popup item, including arrow*/
	
	hdlstring popupmessages [maxpopups]; /*the string displayed in the rect*/
	
	short popupnumber; /*during a popup hit, this is the index of the popup, else undefined*/
	
	short activetextitem; /*index of active text item*/
	
	Rect iconrect; /*location of the icon, for mouse clicks, cursor adjustment*/
	
	byte iconlabel [11]; /*max 10 chars for string under icon, length byte at head*/
	
	byte windowtitle [33]; /*max 32 chars for window title, length byte at head*/
	
	tyvaluerecord minivalue; /*any miniwindow can have a value associated with it*/
	
	Rect msgrect; /*location of messages displayed in this window*/
	
	bigstring bsmsg; /*string displayed in msgrect, result of shell.windowmessage call*/
	
	long forecolor, backcolor; /*uses the old QuickDraw colors, should be modernized*/
	
	boolean fliconenabled; /*enabled if there's text that can be run*/
	
	boolean flactive; /*determines whether items are drawn as active or inactive*/
	
	boolean flmassiveupdate; /*erase whole rect, use offscreen bitmap*/
	
	boolean flselectallpending; /*selectall in idle, if flactive is true*/
	
	boolean flbitmapactive; /*for some drawing, if true don't open a bitmap*/
	
	minisavestringcallback savestringroutine; 
	
	miniloadstringcallback loadstringroutine;
	
	shellcallback setvalueroutine; /*fills in the minivalue field of this record*/
	
	minitexthitcallback texthitroutine;
	
	shellvoidcallback iconenableroutine;
	
	shellcallback iconhitroutine;
	
	fillpopupcallback fillpopuproutine;
	
	popupselectcallback popupselectroutine;
	
	shellshortcallback gettargetdataroutine;
	
	long minirefcon; /*optional data for the next layer up*/
	} tyminirecord, *ptrminirecord, **hdlminirecord;


/*globals*/

extern WindowPtr miniwindow;

extern hdlwindowinfo miniwindowinfo;

extern hdlminirecord minidata;


/*prototypes*/

extern boolean minisetstring (short, Handle);

extern boolean minigetstring (short, Handle *);

extern boolean minigetselstring (short, bigstring);

extern boolean minisetpopupmessage (short, bigstring);

extern void minisetselect (short, short);

extern boolean miniinvalicon (short);

extern boolean minisetwindowmessage (short, bigstring);

extern boolean startminidialog (short, callback);

extern boolean ministart (short);




