Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Commit last experimental bits (dated December 6th, 2013).
[graphlib.git] / simpledw / SimpleDW.cpp
1 #include <QApplication>
2 #include <DrawingWindow.h>
3
4 extern void simpleDW_user_main_wrapper();
5
6 namespace {
7     DrawingWindow *global_w;
8     int global_argc;
9     char **global_argv;
10
11     void drawing_function(DrawingWindow& w)
12     {
13         global_w = &w;
14         simpleDW_user_main_wrapper();
15     }
16 }
17
18 int main(int argc, char *argv[])
19 {
20     QApplication application(argc, argv);
21     global_argc = argc;
22     global_argv = argv;
23     DrawingWindow window(drawing_function);
24     window.show();
25     return application.exec();
26 }
27
28 #include <SimpleDW.h>
29
30 void drawText(int x, int y, const char *text, int flags)
31 {
32     global_w->drawText(x, y, text, flags);
33 }
34
35 void drawText(int x, int y, const std::string &text, int flags)
36 {
37     global_w->drawText(x, y, text, flags);
38 }