Slightly better kerning maybe?
[ipdf/code.git] / src / controlpanel.h
1 /**
2  * Declarations for Qt4 based control panel
3  */
4 #ifndef _CONTROLPANEL_H
5 #define _CONTROLPANEL_H
6
7 //#define CONTROLPANEL_DISABLED // To turn off the control panel
8
9 #ifndef CONTROLPANEL_DISABLED
10
11
12 #include <QPushButton>
13 #include <QMainWindow>
14 #include <QWidget>
15 #include <QAction>
16 #include <QMenu>
17 #include <QMenuBar>
18 #include <QApplication>
19
20
21
22 namespace IPDF
23 {
24         class View;
25         class Document;
26         class Screen;
27
28         /**
29          * Class to manage Qt control panel
30          * Should be a singleton from the point of view of View, Document, Screen
31          *  - Just call "Update"
32          */
33         class ControlPanel : public QMainWindow
34         {       
35                 Q_OBJECT // Having this causes shit about undefined vtables
36                                 // Not having it means things break
37                                 // Apparently you need "qmake" to build qt applications
38                                 // Or some bullshit -_-
39                 public:
40                         struct RunArgs
41                         {
42                                 int argc;
43                                 char ** argv;
44                                 View & view;
45                                 Document & doc;
46                                 Screen & screen;
47                         };
48                         
49                         static int Run(void * args);
50                         static void Update() {if (g_panel != NULL) g_panel->UpdateAll();};
51                         
52                         ControlPanel(RunArgs & a, QWidget * p = NULL);
53                         virtual ~ControlPanel() {}
54                         
55                 private slots:
56                         void SetGPURendering();
57                         void SetCPURendering();
58
59
60                 private:
61                         static ControlPanel * g_panel;
62
63                         
64                         void UpdateAll();
65                                         
66                         View & m_view;
67                         Document & m_doc;
68                         Screen & m_screen;
69                         
70                         QMenu * CreateMainMenu();
71                         QMenu * CreateViewMenu();
72                         QMenu * CreateDocumentMenu();
73                         QMenu * CreateScreenMenu();
74                         
75                         QAction * m_screen_gpu_rendering;
76                         QAction * m_screen_cpu_rendering;
77                         
78
79         };
80
81 }
82
83 #endif //CONTROLPANEL_DISABLED
84
85 #endif //_CONTROLPANEL_H

UCC git Repository :: git.ucc.asn.au