2 // Written and (C) by Francois Fleuret
3 // Contact <francois.fleuret@idiap.ch> for comments & bug reports
5 #ifndef SIMPLE_WINDOW_H
6 #define SIMPLE_WINDOW_H
14 #include <X11/Xutil.h>
15 #include <X11/XKBlib.h>
23 MOUSE_CLICK_PRESS, MOUSE_CLICK_RELEASE,
25 KEY_PRESS, KEY_RELEASE
29 char key[32]; // This is the max length for the pressed key name ('a', 'Alt_L', etc.)
40 int _red_mask, _green_mask, _blue_mask;
41 int _red_shift, _green_shift, _blue_shift;
45 SimpleWindow(const char *name, int x, int y, int w, int h);
46 virtual ~SimpleWindow();
53 virtual void color(float red, float green, float blue);
54 virtual void draw_point(int x, int y);
55 virtual void draw_line(int x1, int y1, int x2, int y2);
56 virtual void draw_circle(int x, int y, int r);
57 virtual void draw_text(const char *s, int x, int y);
58 virtual void fill_rectangle(int x, int y, int w, int h);
59 virtual void fill_polygon(int nb, int *x, int *y);
63 virtual int file_descriptor();
64 virtual SimpleEvent event();