1 | /*! |
---|
2 | * file gui_exec.h |
---|
3 | * File that holds the class that creates the execute-Options. |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _GUI_EXEC_H |
---|
7 | #define _GUI_EXEC_H |
---|
8 | |
---|
9 | #include "gui.h" |
---|
10 | #include "gui_element.h" |
---|
11 | #include "gui_gtk.h" |
---|
12 | |
---|
13 | class Widget; |
---|
14 | class CheckButton; |
---|
15 | using namespace std; |
---|
16 | class IniParser; |
---|
17 | |
---|
18 | //! Class that creates the execute-Options. |
---|
19 | class GuiExec : public GuiElement |
---|
20 | { |
---|
21 | private: |
---|
22 | CheckButton* saveSettings; //!< A CheckBox for if the Options should be saved. |
---|
23 | |
---|
24 | char* confDir; //!< The directory of the orxonox-configuration-files. |
---|
25 | char* confFile; //!< The name of the .orxonox.conf(ig)-file. |
---|
26 | |
---|
27 | //! A struct that holds informations about variables. |
---|
28 | struct VarInfo |
---|
29 | { |
---|
30 | const char* variableName; //!< The Name of this variable; |
---|
31 | const char* variableValue; //!< The Value this variable gets. |
---|
32 | }; |
---|
33 | |
---|
34 | public: |
---|
35 | GuiExec(); |
---|
36 | virtual ~GuiExec(); |
---|
37 | |
---|
38 | void setConfDir(const char* confDir); |
---|
39 | void setConfFile(const char* confFile); |
---|
40 | const char* getConfigFile() const; |
---|
41 | int shouldsave(); |
---|
42 | void writeToFile(Widget* widget); |
---|
43 | void writeFileText(Widget* widget, IniParser* parser, int depth); |
---|
44 | void readFromFile(Widget* widget); |
---|
45 | static void readFileText(Widget* widget, void* varInfo); |
---|
46 | Widget* locateGroup(Widget* widget, const char* groupName, int depth); |
---|
47 | |
---|
48 | #ifdef HAVE_GTK2 |
---|
49 | static int startOrxonox(GtkWidget *widget, void* data); |
---|
50 | static int quitGui(GtkWidget *widget, void* data); |
---|
51 | #else /* HAVE_GTK2 */ |
---|
52 | static int startOrxonox(void* widget, void* data); |
---|
53 | static int quitGui(void* widget, void* data); |
---|
54 | #endif /* HAVE_GTK2 */ |
---|
55 | }; |
---|
56 | |
---|
57 | //! A simple hashtable |
---|
58 | struct HashTable |
---|
59 | { |
---|
60 | char* name; //!< name of the entry |
---|
61 | char* value; //!< value of the entry |
---|
62 | HashTable* next; //!< pointer to the next entry |
---|
63 | }; |
---|
64 | |
---|
65 | |
---|
66 | #endif /* _GUI_EXEC_H */ |
---|