/* avwm.h */

#define VERSION "avwm 0.4"
#define VER_NUM 0
#define REV_NUM 4

#define AVWM_WIDTH 182
#define AVWM_HEIGHT 82

#define SUB_WIDTH 58
#define SUB_HEIGHT 34

#define GREY	0
#define BLACK	1
#define WHITE	2
#define BLUE	3

#define HIGH_PRI 0x7f

struct vWindow {
struct Node	node;
struct Window	*window;
short		area, changed,
		ox, oy, ow, oh, /* original position */
		sx, sy, sw, sh; /* virtual-window position */
};

#define OPT_NO_TIMER 1
#define OPT_NO_SETF 2
#define OPT_MOVE_SCREEN 4

#define ACT_NONE      0
#define ACT_MOVE_WIN  1
#define ACT_SIZE_WIN  2

#define AREA(left,top) (((left) / VisWidth << 1) + (top) / VisHeight)
#define vAREA(left,top) (((left) / SUB_WIDTH << 1) + (top) / SUB_HEIGHT)
#define AREA_X(area) ((area) >> 1)
#define AREA_Y(area) ((area) & 1)

int close_window (struct IntuiMessage *msg, struct Callback *cb);
int mouse_event (struct IntuiMessage *msg, struct Callback *cb);
int mouse_move (struct IntuiMessage *msg, struct Callback *cb);
int refresh_window (struct IntuiMessage *msg, struct Callback *cb);
int timer_event (struct timerequest *msg, struct Callback *cb);
void workbench_monitor_event (int signals);
struct Window *assert_window (struct Window *search);
void exit_avwm (int code);
void refresh_graphic (void);
void redraw_graphic (void);
struct vWindow *find_window (int x, int y);
void init_timer (void);
void draw_box (short color, short x1, short y1, short x2, short y2, struct RastPort *rp);
void draw_frame (short color, short x1, short y1, short x2, short y2, struct RastPort *rp);
void draw_vwindow (int color, struct vWindow *vw);
