1 #ifndef DRAWING_WINDOW_H
2 #define DRAWING_WINDOW_H
8 class DrawingWindowPrivate;
10 class DrawingWindow: public QWidget {
12 typedef void (*ThreadFunction)(DrawingWindow &);
14 static const int DEFAULT_WIDTH = 640;
15 static const int DEFAULT_HEIGHT = 480;
17 DrawingWindow(ThreadFunction fun,
18 int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT);
19 DrawingWindow(QWidget *parent,
21 int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT);
22 DrawingWindow(QWidget *parent, Qt::WindowFlags flags,
24 int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT);
31 void setColor(float red, float green, float blue);
32 void setBgColor(float red, float green, float blue);
36 void drawPoint(int x, int y);
37 void drawLine(int x1, int y1, int x2, int y2);
38 void drawRect(int x1, int y1, int x2, int y2);
40 void sleep(unsigned long secs);
41 void msleep(unsigned long msecs);
42 void usleep(unsigned long usecs);
45 void closeEvent(QCloseEvent *ev);
46 void paintEvent(QPaintEvent *ev);
47 void showEvent(QShowEvent *ev);
48 void timerEvent(QTimerEvent *ev);
51 DrawingWindowPrivate * const d;
53 friend class DrawingWindowPrivate;
56 #endif // !DRAWING_WINDOW_H