1
#ifndef __DesktopWindow
2
#define __DesktopWindow
4
#include <guide/Container.h>
5
#include <guide/Desktop.h>
6
#include <guide/WidgetEvents.h>
7
#include <guide/DesktopWindowEvents.h>
8
#include <guide/Pixmap.h>
14
typedef void (*paint_f)();
16
class DesktopWindow:public Container {
19
DesktopWindow(int width, int height, const string &caption, int fullscreen);
20
DesktopWindow(int width, int height, int fullscreen);
21
DesktopWindow(const string &caption, int fullscreen);
22
virtual ~DesktopWindow();
24
virtual vector<EventHandler *> getEventHandlers();
25
virtual vector<string> getMethods();
27
void setHandler(DesktopWindowEvents *h);
28
DesktopWindowEvents *getDesktopWindowHandler(void);
29
void kbd_down(int key, double x, double y);
30
void kbd_up(int key, double x, double y);
31
void mouse_press(int button, double x, double y);
32
void mouse_release(int button, double x, double y);
33
void kbd_special(int key, double x, double y);
34
void kbd_special_up(int key, double x, double y);
35
void mouse_motion(int button, double x, double y);
36
void reshape(double width, double height);
39
void PropertyChanged(int id, string name);
41
int grabMouse(Widget *w);
42
int grabKbd(Widget *w);
43
void releaseMouse(Widget *w);
44
void releaseKbd(Widget *w);
45
void setCursor(Pixmap *p);
46
void setBackground(Pixmap *p);
47
void setBackground(paint_f p);
48
void setHotspot(double x, double y);
49
void showTooltip(const string &text);
50
void PopupMenu(VMenu *vm);
51
int closeClicked(void);
54
friend void GLFWCALL guide_display(void);
55
friend void GLFWCALL guide_idle(void);
56
friend void GLFWCALL guide_kbd(int key, int state);
57
friend void GLFWCALL guide_mouse(int button, int state);
58
friend void GLFWCALL guide_special(int key, int state);
59
friend void GLFWCALL guide_motion(int x, int y);
60
friend void GLFWCALL guide_reshape(int width, int height);
61
friend void GLFWCALL guide_entry(int state);
62
friend int GLFWCALL guide_close();
66
void setup(int width, int height, const string &caption, int fullscreen);
67
DesktopWindowEvents *handler;
71
double cx, cy; //cursor position
72
double hx, hy; //cursor hotspot
75
paint_f painter_function;
78
extern DesktopWindow *root;