/*
 *  CELLS       An Implementation of the WireWorld cellular automata
 *              as described in Scientific American, Jan 1990.
 *
 *              Copyright 1990 by Davide P. Cervone.
 *  You may use this code, provided this copyright notice is kept intact.
 *  See the CELLS.HELP file for complete information on distribution conditions.
 */

/*
 *  File:  cGadget.h            Defines for main Control Panel gadgets
 */


#include "Cells.h"
#include "cBoxes.h"

/*
 *  Gadget IDs and array positions
 */

#define ID_START    0
#define ID_RESET    1
#define ID_SAVE     2
#define ID_LOAD     3
#define ID_SELECT   4
#define ID_MOVE     5
#define ID_CLEAR    6
#define ID_PART     7
#define ID_UNDO     8
#define ID_HELP     9
#define ID_QUIT     10

#define ID_BLANKC   11
#define ID_WIREC    12
#define ID_TAILC    13
#define ID_HEADC    14

#define ID_SLIDEH   15
#define ID_SLIDEV   16
#define ID_UARROW   17
#define ID_DARROW   18
#define ID_LARROW   19
#define ID_RARROW   20
#define ID_ZOOM     21
#define ID_BRDRGADG 22
#define ID_IMGADG   23

#define GADGET_COUNT    24
#define ID_OFFSET       25
#define TEXT_OFFSET     11

#define TEXT_STOP       (TEXT_OFFSET+TEXT_OFFSET)

#define ID_STEP     (ID_START+ID_OFFSET)
#define ID_WIPE     (ID_RESET+ID_OFFSET)
#define ID_RENAME   (ID_SAVE+ID_OFFSET)
#define ID_NEW      (ID_LOAD+ID_OFFSET)
#define ID_COPY     (ID_MOVE+ID_OFFSET)
#define ID_CLIP     (ID_CLEAR+ID_OFFSET)
#define ID_CENTER   (ID_UNDO+ID_OFFSET)
#define ID_ABOUT    (ID_HELP+ID_OFFSET)
#define ID_STOP     (ID_STEP+ID_OFFSET)

#define ID_SHRINK   (ID_OFFSET-1)


/*
 * Array positions
 */

#define BRDR_PANEL  0
#define BRDR_FRAME1 2
#define BRDR_FRAME2 4
#define BRDR_FRAME3 6
#define BRDR_FRAME4 8
#define BRDR_FRAME5 10
#define BRDR_SLIDEH 12
#define BRDR_SLIDEV 14
#define BRDR_BLANKC 16
#define BRDR_WIREC  17
#define BRDR_TAILC  18
#define BRDR_HEADC  19
#define BRDR_BUTTON 20

#define IM_PANEL    0
#define IM_SLIDEH   1
#define IM_SLIDEV   2
#define IM_UARROW   3
#define IM_DARROW   4
#define IM_LARROW   5
#define IM_RARROW   6
#define IM_ZOOM     7
#define IM_SHRINK   8
#define IM_BLANKC   9
#define IM_WIREC    10
#define IM_TAILC    11
#define IM_HEADC    12

#define PROP_SLIDEH     0
#define PROP_SLIDEV     1


/*
 *  Sizes and screen positions
 */

#define PANELW      (WINDOWW-PANELX)
#define PANELH      (WINDOWH-PANELY)
#define PANELX      (BOARDW+SLIDEWH)
#define PANELY      0

#define FRAMEX      (BUTX-3)
#define FRAMEY      (BUTY-3)

#define BUTW        42
#define BUTH        12
#define BUTX        (PANELX+6)
#define BUTY        (CBOXY+CBOXH+10)

#define CBOXW       9
#define CBOXH       9
#define CBOXX       (PANELX+7)
#define CBOXY       (PANELY+8)

#define CFRAMEW     (4*CBOXW+12)
#define CFRAMEH     (CBOXH+8)
#define CFRAMEX     (CBOXX-4)
#define CFRAMEY     (CBOXY-4)

#define IS_BUTTON           BIT(31)
#define BUTTON_SELECTED     BIT(30)
#define BUTTON_NOSHIFT      BIT(29)
#define BUTTON_RUNSHIFT     BIT(28)
