/* *** specialwin.h *** */


#define FONTNAME		"topaz.font"
#define FONTYSIZE		8
#define FONTSTYLE		FS_NORMAL
#define FONTFLAGS		FPF_ROMFONT

#define WIN_X_KOO		30
#define WIN_Y_KOO		40
#define WIN_WIDTH		460
#define WIN_HEIGHT		130
#define WIN_TITLE		"Special-Host-Program V" VERSION
#define WIN_IDCMP_FLAGS		CLOSEWINDOW | MOUSEBUTTONS | GADGETUP | REFRESHWINDOW | RAWKEY | MENUPICK | NEWSIZE
#define WIN_X_MIN_WIDTH		456
#define WIN_X_MIN_HEIGHT	70
#define WIN_X_MAX_WIDTH		640
#define WIN_X_MAX_HEIGHT	250

#define ICON_HEIGHT		35
#define ICON_WIDTH		64
#define ICON_LEFT_EDGE		20
#define ICON_TOP_EDGE		20


#define NR_TEXT_LINES		50		/* Lines */
#define LINE_LENGTH		80		/* Chars */
#define START_PRINTING		55		/* Pixel */
#define HEIGHT_CHAR		10		/* Pixel */
#define WIDTH_CHAR		 8		/* Pixel */




/***  Gad-Numbers *************/

#define NR_MEM_GAD	1
#define NR_FILE_GAD	2
#define NR_MEM_B_GAD	3
#define NR_FILE_B_GAD	4
#define NR_BORDER_GAD	5
#define NR_RECT_GAD	6
#define NR_INT_GAD	7
#define NR_TOICON_GAD	8
#define NR_SHOW_GAD	9
#define NR_INVERT_GAD	10
#define NR_BLITTER_GAD	11



#define CONFIG_FILE_MAGIC	(('S'<<24) | ('C'<<16) | ('N'<<8) | 'F')
#define CONFIG_FILE_VERSION	1

struct config_struct {
    long	magic;
    long	version;
    short	use_blitter;
    short	invert_bmap;
    int		base_dpi;
    int		draw_modus;
    int		icon_x_pos;
    int		icon_y_pos;
    int		win_x_pos;
    int		win_y_pos;
    int		win_width;
    int		win_height;
    short	use_pubscr;
    short	reserved1;
    long	reserved2;
    long	reserved3;
    long	reserved4;
    long	reserved5;
    long	reserved6;
    long	reserved7;
    long	reserved8;
    long	reserved9;
  };



static SHORT brd_arr[10] = { 0,0, 52,0, 52,12, 0,12, 0,0 };

static struct Border brd =
 { -2, -2, 1, 0, JAM1, 5, brd_arr, NULL };

static struct Border selbrd =
 { -2, -2, 3, 0, JAM1, 5, brd_arr, NULL };



static SHORT brd2_arr[10] = { 0,0, 52+24,0, 52+24,12, 0,12, 0,0 };

static struct Border brd2 =
 { -2, -2, 1, 0, JAM1, 5, brd2_arr, NULL };

static struct Border selbrd2 =
 { -2, -2, 3, 0, JAM1, 5, brd2_arr, NULL };



static struct IntuiText Memory_Title =
 {
	1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"Memory",
	(struct IntuiText*)NULL
 };

static struct Gadget Memory_Gad =
 {
	(struct Gadget*)NULL, 20, 15,
	50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
	BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
	&Memory_Title, 0L, (APTR)NULL,
	NR_MEM_GAD, (APTR)NULL
 };

static struct IntuiText File_Title =
 {
	1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"File",
	(struct IntuiText*)NULL
 };

static struct Gadget File_Gad =
 {
	&Memory_Gad, 20, 30,
	50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
	BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
	&File_Title, 0L, (APTR)NULL,
	NR_FILE_GAD, (APTR)NULL
 };

static struct IntuiText Memory_B_Title =
 {
	1, 0, JAM2, 5, 1, &txtAttr, (UBYTE*)"Mem-B",
	(struct IntuiText*)NULL
 };

static struct Gadget Memory_B_Gad =
 {
	&File_Gad, 80, 15,
	50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
	BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
	&Memory_B_Title, 0L, (APTR)NULL,
	NR_MEM_B_GAD, (APTR)NULL
 };

static struct IntuiText File_B_Title =
 {
	1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"File-B",
	(struct IntuiText*)NULL
 };

static struct Gadget File_B_Gad =
 {
	&Memory_B_Gad, 80, 30,
	50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
	BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
	&File_B_Title, 0L, (APTR)NULL,
	NR_FILE_B_GAD, (APTR)NULL
 };

static struct IntuiText Border_Title =
 {
	1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"Border",
	(struct IntuiText*)NULL
 };

static struct Gadget Border_Gad =
 {
	&File_B_Gad, 140, 15,
	50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
	BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
	&Border_Title, 0L, (APTR)NULL,
	NR_BORDER_GAD, (APTR)NULL
 };

static struct IntuiText Rect_Title =
 {
	1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"Rect.",
	(struct IntuiText*)NULL
 };

static struct Gadget Rect_Gad =
 {
	&Border_Gad, 140, 30,
	50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
	BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
	&Rect_Title, 0L, (APTR)NULL,
	NR_RECT_GAD, (APTR)NULL
 };


static UBYTE	int_buffer[5],
		int_buffer_undo[5];

static SHORT int_brd_arr[10] = { 0,0, 35,0, 35,11, 0,11, 0,0 };

static struct Border int_brd =
 { -2, -2, 1, 0, JAM1, 5, int_brd_arr, NULL };

static struct IntuiText Bdpi_Title =
 {
	1, 0, JAM2, -15,-11, &txtAttr, (UBYTE*)"base dpi",
	(struct IntuiText*)NULL
 };

static struct StringInfo int_strInfo =
 {
	int_buffer, int_buffer_undo, 0, 4, 0, 0, 0, 0,
	0, 0, (struct Layer*)NULL, 0L,
	(struct KeyMap*)NULL
 };

static struct Gadget Bdpi_Gad = 
 {
	&Rect_Gad, 230, 28,
	32, 10, GADGHCOMP, RELVERIFY | LONGINT,
	STRGADGET, (APTR)&int_brd, (APTR)NULL,
	(struct IntuiText*)&Bdpi_Title, 0L,
	(APTR)&int_strInfo,
	NR_INT_GAD, (APTR)NULL
 };


static struct IntuiText toIcon_Title =
 {
	1, 0, JAM2, 8, 1, &txtAttr, (UBYTE*)"Icon",
	(struct IntuiText*)NULL
 };

static struct Gadget toIcon_Gad =
 {
	&Bdpi_Gad, 360+24, 15,
	50, 10, GADGHCOMP, RELVERIFY,
	BOOLGADGET, (APTR)&brd, (APTR)NULL,
	&toIcon_Title, 0L, (APTR)NULL,
	NR_TOICON_GAD, (APTR)NULL
 };


static struct IntuiText Show_Title =
 {
	1, 0, JAM2, 8, 1, &txtAttr, (UBYTE*)"Show",
	(struct IntuiText*)NULL
 };

static struct Gadget Show_Gad =
 {
	&toIcon_Gad, 360+24, 30,
	50, 10, GADGHCOMP, RELVERIFY,
	BOOLGADGET, (APTR)&brd, (APTR)NULL,
	&Show_Title, 0L, (APTR)NULL,
	NR_SHOW_GAD, (APTR)NULL
 };


static struct IntuiText Invert_Title =
 {
	1, 0, JAM2, 8, 1, &txtAttr, (UBYTE*)"Invert?",
	(struct IntuiText*)NULL
 };

static struct Gadget Invert_Gad =
 {
	&Show_Gad, 295, 15,
	50+24, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
	BOOLGADGET, (APTR)&brd2, (APTR)&selbrd2,
	&Invert_Title, 0L, (APTR)NULL,
	NR_INVERT_GAD, (APTR)NULL
 };


static struct IntuiText Blitter_Title =
 {
	1, 0, JAM2, 8, 1, &txtAttr, (UBYTE*)"Blitter?",
	(struct IntuiText*)NULL
 };

static struct Gadget Blitter_Gad =
 {
	&Invert_Gad, 295, 30,
	50+24, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
	BOOLGADGET, (APTR)&brd2, (APTR)&selbrd2,
	&Blitter_Title, 0L, (APTR)NULL,
	NR_BLITTER_GAD, (APTR)NULL
 };


/******************** MENU **********************/


struct IntuiText MenItem_Text[] = {
    { 0, 1, JAM1, 0, 1, &txtAttr, "About", NULL },		/* men 1 */
    { 0, 1, JAM1, 0, 1, &txtAttr, "", NULL },
    { 0, 1, JAM1, 0, 1, &txtAttr, "Read config", NULL },
    { 0, 1, JAM1, 0, 1, &txtAttr, "Save config", NULL },
    { 0, 1, JAM1, 0, 1, &txtAttr, "", NULL },
    { 0, 1, JAM1, 0, 1, &txtAttr, "To ShowDVI", NULL },
    { 0, 1, JAM1, 0, 1, &txtAttr, "Iconify", NULL },
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Use PubScr", NULL },
    { 0, 1, JAM1, 0, 1, &txtAttr, "", NULL },
    { 0, 1, JAM1, 0, 1, &txtAttr, "Quit", NULL },
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Transfer in memory", NULL },	/* men 2 */
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Transfer in file", NULL },
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Memory with border", NULL },
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "File with border", NULL },
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Only a border", NULL },
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Only a rectangle", NULL },
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Invert", NULL },		/* men 3 */
    { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Use blitter", NULL }
  };

#define STARTDRAW	10
#define INVERTNR	16
#define BLITTERNR	17

struct MenuItem MenItem[] = {
    { &MenItem[1], 0, 0, 150, 10,			/* about */
      ITEMENABLED|ITEMTEXT|HIGHCOMP,
      0, (APTR)&MenItem_Text[0], NULL, ' ', NULL, 0
    },
    { &MenItem[2], 0, 10, 150, 10,			/* "" */
      ITEMTEXT|HIGHNONE,
      0, (APTR)&MenItem_Text[1], NULL, ' ', NULL, 0
    },
    { &MenItem[3], 0, 20, 150, 10,			/* read cnf */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ,
      0, (APTR)&MenItem_Text[2], NULL, 'O', NULL, 0
    },
    { &MenItem[4], 0, 30, 150, 10,			/* save cnf */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ,
      0, (APTR)&MenItem_Text[3], NULL, 'W', NULL, 0
    },
    { &MenItem[5], 0, 40, 150, 10,			/* "" */
      ITEMTEXT|HIGHNONE,
      0, (APTR)&MenItem_Text[4], NULL, ' ', NULL, 0
    },
    { &MenItem[6], 0, 50, 150, 10,			/* ShowDVI */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ,
      0, (APTR)&MenItem_Text[5], NULL, 'S', NULL, 0
    },
    { &MenItem[7], 0, 60, 150, 10,			/* icon */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ,
      0, (APTR)&MenItem_Text[6], NULL, 'I', NULL, 0
    },
    {&MenItem[8], 0, 70, 150, 10,			/* use pubscreen */
      ITEMTEXT|HIGHCOMP|COMMSEQ|CHECKIT,
      0, (APTR)&MenItem_Text[7], NULL, 'P', NULL, 0
    },
    { &MenItem[9], 0, 80, 150, 10,			/* "" */
      ITEMTEXT|HIGHNONE,
      0, (APTR)&MenItem_Text[8], NULL, ' ', NULL, 0
    },
    { NULL, 0, 90, 150, 10,				/* quit */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ,
      0, (APTR)&MenItem_Text[9], NULL, 'Q', NULL, 0
    },
    {&MenItem[11], 0, 0, 220, 10,			/* memory */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ|CHECKIT,
      ~1, (APTR)&MenItem_Text[10], NULL, 'M', NULL, 0
    },
    { &MenItem[12], 0, 10, 220, 10,			/* file */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ|CHECKIT,
      ~2, (APTR)&MenItem_Text[11], NULL, 'F', NULL, 0
    },
    { &MenItem[13], 0, 20, 220, 10,			/* memory-border */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|CHECKIT,
      ~4, (APTR)&MenItem_Text[12], NULL, ' ', NULL, 0
    },
    { &MenItem[14], 0, 30, 220, 10,			/* file-border */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|CHECKIT,
      ~8, (APTR)&MenItem_Text[13], NULL, ' ', NULL, 0
    },
    { &MenItem[15], 0, 40, 220, 10,			/* border */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ|CHECKIT,
      ~16, (APTR)&MenItem_Text[14], NULL, 'B', NULL, 0
    },
    { NULL, 0, 50, 220, 10,				/* rectangle */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ|CHECKIT,
      ~32, (APTR)&MenItem_Text[15], NULL, 'R', NULL, 0
    },
    { &MenItem[17], 0, 0, 130, 10,			/* invert */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|CHECKIT|MENUTOGGLE,
      0, (APTR)&MenItem_Text[16], NULL, ' ', NULL, 0
    },
    { NULL, 0, 10, 130, 10,				/* blitter */
      ITEMENABLED|ITEMTEXT|HIGHCOMP|CHECKIT|MENUTOGGLE,
      0, (APTR)&MenItem_Text[17], NULL, ' ', NULL, 0
    }
  };

struct Menu SpecialMenu[] = {
    { &SpecialMenu[1], 0, 0, 100, 10,
      MENUENABLED,
      "Project",
      &MenItem[0]
    },
    { &SpecialMenu[2], 100, 0, 130, 10,
      MENUENABLED,
      "Draw modus",
      &MenItem[10]
    },
    { NULL, 230, 0, 100, 10,
      MENUENABLED,
      "Misc",
      &MenItem[16]
    },
  };
