/* 
** OpenURL - MUI preferences for openurl.library
** Written by Troels Walsted Hansen <troels@stud.cs.uit.no>
** Placed in the public domain.
**
** Includes header files required for both modules.
*/

#define __USE_SYSBASE
#include <proto/exec.h>
#include <proto/dos.h>

#include <clib/muimaster_protos.h>
#include <clib/intuition_protos.h>
#include <clib/icon_protos.h>
#include <clib/openurl_protos.h>

#include <pragmas/muimaster_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/icon_pragmas.h>
#include <pragmas/openurl_pragmas.h>

#include <exec/memory.h>
#include <workbench/workbench.h>
#include <workbench/startup.h>
#include <libraries/mui.h>
#include <libraries/asl.h>
#include <libraries/iffparse.h>
#include <libraries/openurl.h>

#include <mui/NListview_mcc.h>
#include <mui/NList_mcc.h>
#include <mui/Popport_mcc.h>

#include <string.h>

/**************************************************************************/

#define REG(x) register __ ## x
#define SAVEDS __saveds
#define ASM __asm
#define STDARGS __stdargs

/**************************************************************************/

extern ASM VOID *AsmCreatePool (REG(d0) ULONG, REG(d1) ULONG, REG(d2) ULONG, REG(a6) struct ExecBase *);
extern ASM VOID  AsmDeletePool (REG(a0) APTR,  REG(a6) struct ExecBase *);
extern ASM VOID *AsmAllocPooled(REG(a0) APTR,  REG(d0) ULONG, REG(a6) struct ExecBase *);
extern ASM VOID  AsmFreePooled (REG(a0) APTR,  REG(a1) APTR,  REG(d0) ULONG, REG(a6) struct ExecBase *);

/**************************************************************************/

/* mui class tricks */

#undef MUIC_String 
#define MUIC_String stringclassname 
#undef MUIC_Listview
#define MUIC_Listview listviewclassname 
#undef MUIC_List
#define MUIC_List listclassname 

/**************************************************************************/

#define APPNAME      "OpenURL"
#define APPBASENAME  "OPENURL"
#define APPVER       "1"
#define APPREV       "0"
#define APPVERSTR    "$VER: " APPNAME " " APPVER "." APPREV " " __AMIGADATE__
#define APPCOPYRIGHT "Placed in the public domain"
#define APPAUTHOR    "Troels Walsted Hansen <troels@stud.cs.uit.no>"
#define APPDESCR     "Preferences program for openurl.library"

/**************************************************************************/

extern struct IntuitionBase *IntuitionBase;
extern struct Library *MUIMasterBase, *OpenURLBase;
extern STRPTR stringclassname, listviewclassname, listclassname;

extern VOID SPrintf(STRPTR to, STRPTR fmt, ...);
extern LONG xget(Object *obj, ULONG attribute);

/**************************************************************************/

SAVEDS ASM ULONG PrefsWin_Dispatcher(REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg);

/**************************************************************************/

struct PrefsWin_Data
{
	Object *InfoGrpObj;
	Object *NameStrObj;
	Object *PathStrObj;
	Object *PortStrObj;
	Object *CmdLineChkObj;

	Object *CmdGrpObj;
	Object *ShowStrObj;
	Object *ToFrontStrObj;
	Object *OpenURLStrObj;
	Object *OpenURLWStrObj;

	Object *BrowserLstObj;
	Object *AddButObj;
	Object *CloneButObj;
	Object *DeleteButObj;

	Object *SaveButObj;
	Object *UseButObj;
	Object *CancelButObj;

	struct Hook ConstructHook;
	struct Hook DestructHook;
	struct Hook DisplayHook;

	ULONG   NotifiesAdded;
};
