/*
** OpenURL - MUI preferences for openurl.library
** Written by Troels Walsted Hansen <troels@thule.no>
** Placed in the public domain.
**
** Includes header files required for all modules and defines some common
** macros and definitions.  Also Includes prototypes for functions in
** prefs_common.c.
*/

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

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

#include <pragmas/muimaster_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/utility_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/muiundoc.h> /* see aminet */
#include <libraries/asl.h>
#include <libraries/gadtools.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 <mui/Popplaceholder_mcc.h>

#include <string.h>
#include <ctype.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 *);

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

#define APPNAME      "OpenURL"
#define APPBASENAME  "OPENURL"
#define APPVER       "3"
#define APPREV       "3"
#define APPVERSTR    "$VER: " APPNAME " " APPVER "." APPREV " " __AMIGADATE__
#define APPCOPYRIGHT "Placed in the public domain"
#define APPAUTHOR    "Troels Walsted Hansen"
#define APPEMAIL     "troels@thule.no"
#define APPDESCR     "Preferences program for openurl.library"

#define PREFS_VERSION 3

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

/* 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 myPopButton(image)\
	ImageObject,\
		ImageButtonFrame,\
		MUIA_InputMode,            MUIV_InputMode_RelVerify,\
		MUIA_Background,           MUII_ButtonBack,\
		MUIA_CycleChain,           TRUE,\
		MUIA_Image_Spec,           image,\
		MUIA_Image_FontMatchWidth, TRUE,\
		MUIA_Image_FreeVert,       TRUE,\
		End

#define myKeyCheckMark(selected,control)\
	ImageObject,\
		ImageButtonFrame,\
		MUIA_InputMode        , MUIV_InputMode_Toggle,\
		MUIA_Image_Spec       , MUII_CheckMark,\
		MUIA_Image_FreeVert   , TRUE,\
		MUIA_CycleChain       , TRUE,\
		MUIA_Selected         , selected,\
		MUIA_Background       , MUII_ButtonBack,\
		MUIA_ShowSelState     , FALSE,\
		MUIA_ControlChar      , control,\
		End

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

#define MUISN_TWH              328 /* put your OWN serialnumber here! */
#define TAG_MUI_TWH            (TAG_USER | ( MUISN_TWH << 16))
#define TAGBASE_APP            (TAG_MUI_TWH)
#define TAGBASE_PREFSWIN       (TAG_MUI_TWH+50)
#define TAGBASE_APPLIST        (TAG_MUI_TWH+100)
#define TAGBASE_BROWSEREDITWIN (TAG_MUI_TWH+150)
#define TAGBASE_MAILEREDITWIN  (TAG_MUI_TWH+200)
#define TAGBASE_EDITWIN        (TAG_MUI_TWH+250)

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

extern VOID SPrintf(STRPTR to, STRPTR fmt, ...);
extern LONG xget(Object *obj, ULONG attribute);
extern ULONG __stdargs DoSuperNew(struct IClass *cl, Object *obj, ULONG tag1, ...);
