/*
  wind.h - Header for the wind data type.
*/

/* ---------- Macros ---------- */
#define FREE_WINDOW 0
#define HMINES_WINDOW 1

#define INIT_X 0
#define INIT_Y 0
#define INIT_WIDTH 500
#define INIT_HEIGHT 250

/* ---------- Data structures ---------- */
struct wind;
struct wind_ops {
    void (*open)(struct wind *);
    void (*term)(struct wind *);
    void (*mouse)(struct wind *, XButtonEvent *);
    void (*draw)(struct wind *, XExposeEvent *);
    void (*resize)(struct wind *, XConfigureEvent *);
    void (*key)(struct wind *, XKeyEvent *);
    void (*activate)(struct wind *, XMapEvent *);
    void (*deactivate)(struct wind *, XUnmapEvent *);
};

struct hmw {
    int something;
};

struct wind {
    int type;
    XRectangle bounds;
    struct wind *parent;
    GC gc;
    Window window;
    struct areas **areas;
    int num_areas;
    struct wind_ops ops;
    union {
	struct hmw hmw;
    } onion;
};

struct wind_params {
    int win_type;
    int x;
    int y;
    int width;
    int height;
    GC gc;
    struct wind *parent;
};

/* ---------- Function Declarations ---------- */
/*
  wind_create(parent, wop) -> struct wind *

  Create a window which is a child of parent (parent can be NULL), and which
  has parameters described in wop.
*/
struct wind *wind_create(struct wind *, struct wind_params *);

