- DrawingWindow(DrawingArea &a);
- DrawingWindow(QWidget *parent, DrawingArea &a);
- DrawingWindow(QWidget *parent, Qt::WindowFlags flags, DrawingArea &a);
+ typedef void (*ThreadFunction)(DrawingWindow &);
+
+ static const int DEFAULT_WIDTH = 640;
+ static const int DEFAULT_HEIGHT = 480;
+
+ DrawingWindow(ThreadFunction fun,
+ int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT);
+ DrawingWindow(QWidget *parent,
+ ThreadFunction fun,
+ int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT);
+ DrawingWindow(QWidget *parent, Qt::WindowFlags flags,
+ ThreadFunction fun,
+ int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT);
+
+ ~DrawingWindow();
+
+ const int width;
+ const int height;
+
+ void setColor(float red, float green, float blue);
+ void setBgColor(float red, float green, float blue);
+
+ void clearGraph();
+
+ void drawPoint(int x, int y);
+ void drawLine(int x1, int y1, int x2, int y2);
+ void drawRect(int x1, int y1, int x2, int y2);
+
+ bool sync(unsigned long time = ULONG_MAX);
+
+ void sleep(unsigned long secs);
+ void msleep(unsigned long msecs);
+ void usleep(unsigned long usecs);