#include <stdio.h>
#include <ctype.h>

#include <X11/Intrinsic.h>

#ifdef __GNUC__
#define inline __inline__
#else
#define inline
#endif

#define TRUE 1
#define FALSE 0

#define MIL2PIXEL(x) ((x)*scale/1000)
#define MIRRORX(x) (mirrorx?max_xpos-(x):(x))
#define MIRRORY(x) (mirrory?max_ypos-(x):(x))

typedef enum { Round, Square } shape_t;
typedef enum { Flash, Draw } flash_t;

typedef struct {
  int size;                /* Size in mils */
  shape_t shape;           /* round or square */
  flash_t flash;           /* flash or draw */
  GC gc;
} tool_t;


typedef struct object_t {
  struct object_t *next;
  tool_t *tool;
  int start_x, start_y;
  int end_x, end_y;
} object_t;

#define MAXTOOLS 100
#define DEFAULT_SCALE 100

extern void *xmalloc();
extern Display *dpy;
extern Widget toplevel;
extern int max_xpos, max_ypos;
extern int scale;
extern int redisplay;

