[2588] | 1 | /*! |
---|
[4048] | 2 | \file gui_exec.h |
---|
[2588] | 3 | \brief File that holds the class that creates the execute-Options. |
---|
| 4 | */ |
---|
| 5 | |
---|
[4048] | 6 | #ifndef _GUI_EXEC_H |
---|
| 7 | #define _GUI_EXEC_H |
---|
[2018] | 8 | |
---|
[4047] | 9 | #include "gui.h" |
---|
| 10 | #include "gui_element.h" |
---|
[4051] | 11 | #include "gui_gtk.h" |
---|
[4024] | 12 | |
---|
[4051] | 13 | class Widget; |
---|
| 14 | class CheckButton; |
---|
[2018] | 15 | using namespace std; |
---|
[1812] | 16 | |
---|
[2588] | 17 | //! Class that creates the execute-Options. |
---|
[4056] | 18 | class GuiExec : public GuiElement |
---|
[2018] | 19 | { |
---|
| 20 | private: |
---|
[3187] | 21 | CheckButton* saveSettings; //!< A CheckBox for if the Options should be saved. |
---|
[4051] | 22 | |
---|
[3625] | 23 | char* confDir; //!< The directory of the orxonox-configuration-files. |
---|
[4051] | 24 | char* confFile; //!< The name of the .orxonox.conf(ig)-file. |
---|
[3187] | 25 | FILE* CONFIG_FILE; //!< Filehandler for reading and writing. |
---|
[4051] | 26 | |
---|
[3423] | 27 | //! A struct that holds informations about variables. |
---|
| 28 | struct VarInfo |
---|
| 29 | { |
---|
| 30 | char* variableName; //!< The Name of this variable; |
---|
| 31 | char* variableValue; //!< The Value this variable gets. |
---|
| 32 | }; |
---|
[3187] | 33 | |
---|
[2018] | 34 | public: |
---|
[4056] | 35 | GuiExec(void); |
---|
| 36 | ~GuiExec(void); |
---|
[2018] | 37 | |
---|
[4051] | 38 | void setConfDir(const char* confDir); |
---|
| 39 | void setConfFile(const char* confFile); |
---|
| 40 | const char* getConfigFile(void) const; |
---|
[3423] | 41 | int shouldsave(void); |
---|
| 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); |
---|
[2634] | 46 | Widget* locateGroup(Widget* widget, char* groupName, int depth); |
---|
[1829] | 47 | |
---|
[3165] | 48 | #ifdef HAVE_GTK2 |
---|
[3423] | 49 | static int startOrxonox(GtkWidget *widget, void* data); |
---|
[4042] | 50 | static int quitGui(GtkWidget *widget, void* data); |
---|
[3423] | 51 | #else /* HAVE_GTK2 */ |
---|
| 52 | static int startOrxonox(void* widget, void* data); |
---|
[4042] | 53 | static int quitGui(void* widget, void* data); |
---|
[3165] | 54 | #endif /* HAVE_GTK2 */ |
---|
[3423] | 55 | }; |
---|
| 56 | |
---|
[3452] | 57 | //! A simple hashtable |
---|
[3423] | 58 | struct HashTable |
---|
| 59 | { |
---|
[3452] | 60 | char* name; //!< name of the entry |
---|
| 61 | char* value; //!< value of the entry |
---|
| 62 | HashTable* next; //!< pointer to the next entry |
---|
[3423] | 63 | }; |
---|
| 64 | |
---|
| 65 | |
---|
[4048] | 66 | #endif /* _GUI_EXEC_H */ |
---|