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 // $Id: simple_window.h,v 1.2 2007-04-24 21:22:52 fleuret Exp $
18 #ifndef SIMPLE_WINDOW_H
19 #define SIMPLE_WINDOW_H
27 #include <X11/Xutil.h>
35 MOUSE_CLICK_PRESS, MOUSE_CLICK_RELEASE,
37 KEY_PRESS, KEY_RELEASE
41 char key[32]; // This is the max length for the pressed key name ('a', 'Alt_L', etc.)
52 int _red_mask, _green_mask, _blue_mask;
53 int _red_shift, _green_shift, _blue_shift;
57 SimpleWindow(char *name, int x, int y, int w, int h);
58 virtual ~SimpleWindow();
65 virtual void color(float red, float green, float blue);
66 virtual void draw_point(int x, int y);
67 virtual void draw_line(int x1, int y1, int x2, int y2);
68 virtual void draw_circle(int x, int y, int r);
69 virtual void draw_text(char *s, int x, int y);
70 virtual void fill_rectangle(int x, int y, int w, int h);
71 virtual void fill_polygon(int nb, int *x, int *y);
75 virtual int file_descriptor();
76 virtual SimpleEvent event();