/*
 * Rubik's clock.
 *
 * This file is public domain, I just hate copy[left/right]s.
 *-------------
 * the screen handling stuff (showing, drawing) include file
 */

#ifndef _SCREEN_H_
#define _SCREEN_H_

#include <X11/Xlib.h>

#define	BLACK	0
#define	WHITE	1
#define	BLUE	2
#define	BLUE2	3
#define	YELLOW	4
#define	GREY	5
#define	CYAN	6
#define	CYAN2	7
#define	RED	8

#define	SIZEX	160
#define	SIZEY	210

typedef struct {
  Display *d;
  Window w;
  GC gc;
  int colors[9];
  int sizex, sizey;
  Cursor cursor_on, cursor_off;
  int current_corner;
} SCREEN;

/* ok, a little hack. I wanted this variable to be defined in the .h (don't know why, think it's better...) */
#ifdef _LOCAL_SCREEN_H_
char *colname[]={
  "black",
  "white",
  "blue",
  "grey",
  "yellow",
  "grey",
  "cyan",
  "cyan2",
  "red"
};
#endif

int init_screen(SCREEN *);
void close_screen(SCREEN *);

void draw_back(SCREEN *, int);
void draw_clock(SCREEN *, int, int, int, int);
void draw_button(SCREEN *, int, int, int);

void draw_mouse_on(SCREEN *);
void draw_mouse_off(SCREEN *);

int mouse_on_button(SCREEN *, float, float);
int mouse_on_arrow(SCREEN *, float, float);
int mouse_on_turn(SCREEN *, int, int);
int mouse_on_quit(SCREEN *, int, int);

void select_corner(SCREEN *, int);

/* barbarian, but easier for me, and it's still clear enough, nope ? */
#include "event.h"
void get_mouse_position(SCREEN *, EVENT *, int *, int *);
void set_mouse_position(SCREEN *, int, int);

#endif /* _SCREEN_H_ */
