typedef struct retina_device_s {
  gx_device_common;
  struct RetinaScreen *rs; /* retina screen pointer */
  ULONG  screenmode;       /* retina screen mode (MID_DEFAULT_*)        */
  gx_color_index ncols;    /* no. of allocated colors (index modes only */
  byte (*palette)[3];  /* color lookup table (index modes only)     */
  float wz_scale_x;
  float wz_scale_y;
} retina_device;

#define rdev ((retina_device *)dev)
#define boolean char
#define FALSE 0
#define XPPI 80.0
#define YPPI 75.0
#define SCALE 0.68
#define PRE_WIDTH  800
#define PRE_HEIGHT 600

void *AllocMem(unsigned long ,unsigned long );

#define RED_BITS	2           /* 2 */
#define GREEN_BITS	RED_BITS    /* 2 */
#define BLUE_BITS	RED_BITS    /* 2 */
#define RGB_BITS	(RED_BITS + GREEN_BITS + BLUE_BITS) /* 6 */
#define MAX_BITS	RED_BITS    /* 2 */
#define BLUE_MASK	((1<<BLUE_BITS)-1)   
#define GREEN_MASK	((1<<(BLUE_BITS+GREEN_BITS))-1-BLUE_MASK)
#define RED_MASK	((1<<(BLUE_BITS+GREEN_BITS+RED_BITS))-1-BLUE_MASK-GREEN_MASK)
#define RED_COLS	(1 << RED_BITS)    /* 4 */
#define GREEN_COLS	(1 << GREEN_BITS)  /* 4 */
#define BLUE_COLS	(1 << BLUE_BITS)   /* 4 */
#define RGB_COLS	(RED_COLS * GREEN_COLS * BLUE_COLS) /* 64 */
#define MAX_COLS	(1 << MAX_BITS) /* max   4 colors/rgb     */
#define ALL_COLS	(1 << 8)	/* max 256 colors in clut */

