2 ////////////////////////////////////////////////////////////////////////////////
3 // This program is free software; you can redistribute it and/or //
4 // modify it under the terms of the GNU General Public License //
5 // version 2 as published by the Free Software Foundation. //
7 // This program is distributed in the hope that it will be useful, but //
8 // WITHOUT ANY WARRANTY; without even the implied warranty of //
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
10 // General Public License for more details. //
12 // Written and (C) by François Fleuret //
13 // Contact <francois.fleuret@epfl.ch> for comments & bug reports //
14 ////////////////////////////////////////////////////////////////////////////////
16 #ifndef SIMPLE_WINDOW_H
17 #define SIMPLE_WINDOW_H
25 #include <X11/Xutil.h>
33 MOUSE_CLICK_PRESS, MOUSE_CLICK_RELEASE,
35 KEY_PRESS, KEY_RELEASE
39 char key[32]; // This is the max length for the pressed key name ('a', 'Alt_L', etc.)
50 int _red_mask, _green_mask, _blue_mask;
51 int _red_shift, _green_shift, _blue_shift;
55 SimpleWindow(char *name, int x, int y, int w, int h);
56 virtual ~SimpleWindow();
63 virtual void color(float red, float green, float blue);
64 virtual void draw_point(int x, int y);
65 virtual void draw_line(int x1, int y1, int x2, int y2);
66 virtual void draw_circle(int x, int y, int r);
67 virtual void draw_text(char *s, int x, int y);
68 virtual void fill_rectangle(int x, int y, int w, int h);
69 virtual void fill_polygon(int nb, int *x, int *y);
73 virtual int file_descriptor();
74 virtual SimpleEvent event();