9 namespace ButtonEvent {
11 LEFT=1, MIDDLE=2, RIGHT=4, WHEEL=8,
12 MODKEY_CTRL=16, MODKEY_SHIFT=32,
43 virtual bool on_key_down(
GLWindow& win,
int key) {
return false; }
44 virtual bool on_key_up(
GLWindow& win,
int key) {
return false; }
45 virtual bool on_text(
GLWindow& win,
const char *text,
int len) {
return false; }
46 virtual bool on_button_down(
GLWindow& win,
int btn,
int state,
int x,
int y) {
return false; }
47 virtual bool on_button_up(
GLWindow& win,
int btn,
int state,
int x,
int y) {
return false; }
48 virtual bool on_mouse_move(
GLWindow& win,
int state,
int x,
int y) {
return false; }
49 virtual bool on_mouse_wheel(
GLWindow& win,
int state,
int x,
int y,
int dx,
int dy) {
return false; }
50 virtual bool on_resize(
GLWindow& win,
int x,
int y,
int w,
int h) {
return false; }
51 virtual bool on_close(
GLWindow& win) {
return false; }
58 const std::vector<EventHandler*> &handlers;
61 bool on_key_down(
GLWindow& win,
int key);
62 bool on_key_up(
GLWindow& win,
int key);
63 bool on_text(
GLWindow& win,
const char *text,
int len);
64 bool on_button_down(
GLWindow& win,
int btn,
int state,
int x,
int y);
65 bool on_button_up(
GLWindow& win,
int btn,
int state,
int x,
int y);
66 bool on_mouse_move(
GLWindow& win,
int state,
int x,
int y);
67 bool on_mouse_wheel(
GLWindow& win,
int state,
int x,
int y,
int dx,
int dy);
68 bool on_resize(
GLWindow& win,
int x,
int y,
int w,
int h);
75 GLWindow(
int w=-1,
int h=-1,
const char *title=0);
99 void set_size(
int w,
int h);
100 void set_position(
int x,
int y);
102 void set_title(
const char* title);
106 void handle_events();
107 static void handle_all_events();
111 void draw_text(
double x,
double y,
const char *text,
int xywh[4]=0);
116 std::vector<EventHandler*> handlers;
120 static std::vector<GLWindow*> all_windows;
121 static void add_window(
GLWindow *win);
122 static bool remove_window(
GLWindow *win);
Definition: glwindow.hpp:7
Definition: glwindow.hpp:39
Definition: glwindow.hpp:55
Definition: glwindow.hpp:72
Definition: glwindow_x11.cpp:176
Definition: glwindow.hpp:87