1 | /*! |
---|
2 | \file gui_exec.h |
---|
3 | \brief 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 | |
---|
17 | //! Class that creates the execute-Options. |
---|
18 | class GuiExec : public GuiElement |
---|
19 | { |
---|
20 | private: |
---|
21 | CheckButton* saveSettings; //!< A CheckBox for if the Options should be saved. |
---|
22 | |
---|
23 | char* confDir; //!< The directory of the orxonox-configuration-files. |
---|
24 | char* confFile; //!< The name of the .orxonox.conf(ig)-file. |
---|
25 | FILE* CONFIG_FILE; //!< Filehandler for reading and writing. |
---|
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 | ~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, 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 */ |
---|