1 | #ifndef _ORXONOX_GUI_H |
---|
2 | #define _ORXONOX_GUI_H |
---|
3 | |
---|
4 | #include <stdlib.h> |
---|
5 | #include <string.h> |
---|
6 | #include <gtk/gtkmain.h> |
---|
7 | #include <gtk/gtkwindow.h> |
---|
8 | #include <gtk/gtkframe.h> |
---|
9 | #include <gtk/gtkhbox.h> |
---|
10 | #include <gtk/gtkvbox.h> |
---|
11 | #include <gtk/gtkbutton.h> |
---|
12 | #include <gtk/gtkcheckbutton.h> |
---|
13 | #include <gtk/gtkhscale.h> |
---|
14 | #include <gtk/gtkoptionmenu.h> |
---|
15 | #include <gtk/gtkmenu.h> |
---|
16 | #include <gtk/gtkmenuitem.h> |
---|
17 | #include <gtk/gtklabel.h> |
---|
18 | #include <gtk/gtkimage.h> |
---|
19 | #include <gtk/gtkeventbox.h> |
---|
20 | |
---|
21 | class OrxonoxGui |
---|
22 | { |
---|
23 | public: |
---|
24 | OrxonoxGui (int argc, char *argv[]); |
---|
25 | ~OrxonoxGui (); |
---|
26 | |
---|
27 | }; |
---|
28 | |
---|
29 | class Widget |
---|
30 | { |
---|
31 | public: |
---|
32 | Widget* next; |
---|
33 | GtkWidget* widget; |
---|
34 | int is_option; |
---|
35 | |
---|
36 | //virtual void create (); |
---|
37 | // void addWidget (); |
---|
38 | void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *)); |
---|
39 | void connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *)); |
---|
40 | void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *)); |
---|
41 | void show (); |
---|
42 | void listOptions (); |
---|
43 | void setOptions (); |
---|
44 | |
---|
45 | }; |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | class Container : public Widget |
---|
50 | { |
---|
51 | private: |
---|
52 | int borderwidth; |
---|
53 | int policy; |
---|
54 | char* label; |
---|
55 | |
---|
56 | public: |
---|
57 | Widget* down; |
---|
58 | void setBorderWidth (int borderwidth); |
---|
59 | virtual void setTitle (char* title) = 0; |
---|
60 | void fill (Widget *lowerWidget); |
---|
61 | }; |
---|
62 | |
---|
63 | class Window : public Container |
---|
64 | { |
---|
65 | public: |
---|
66 | Window (char* windowName); |
---|
67 | Window (void); |
---|
68 | ~Window (); |
---|
69 | |
---|
70 | void setTitle (char* title); |
---|
71 | void showall (); |
---|
72 | static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data); |
---|
73 | }; |
---|
74 | |
---|
75 | class Frame :public Container |
---|
76 | { |
---|
77 | public: |
---|
78 | Frame (char* frameName); |
---|
79 | Frame (void); |
---|
80 | ~Frame (); |
---|
81 | |
---|
82 | void setTitle (char* title); |
---|
83 | }; |
---|
84 | |
---|
85 | class EventBox : public Container |
---|
86 | { |
---|
87 | public: |
---|
88 | EventBox (char* eventBoxName); |
---|
89 | EventBox (void); |
---|
90 | ~EventBox (); |
---|
91 | |
---|
92 | void setTitle (char* title); |
---|
93 | }; |
---|
94 | |
---|
95 | class Box : public Widget |
---|
96 | { |
---|
97 | public: |
---|
98 | Box (void); |
---|
99 | Box (char boxtype); |
---|
100 | ~Box (void); |
---|
101 | |
---|
102 | Widget* down; |
---|
103 | void fill (Widget* lowerWidget); |
---|
104 | |
---|
105 | }; |
---|
106 | |
---|
107 | class Image : public Widget |
---|
108 | { |
---|
109 | public: |
---|
110 | Image (char* imgaename); |
---|
111 | ~Image (); |
---|
112 | }; |
---|
113 | |
---|
114 | class Option : public Widget |
---|
115 | { |
---|
116 | public: |
---|
117 | //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data); |
---|
118 | |
---|
119 | int value; |
---|
120 | char* option_name; |
---|
121 | char* flag_name; |
---|
122 | char* flag_name_short; |
---|
123 | int default_value; |
---|
124 | |
---|
125 | void setFlagName (char* flagname, int defaultvalue); |
---|
126 | void setFlagName (char* flagname, char* flagnameshort, int defaultvalue); |
---|
127 | virtual void redraw () = 0; |
---|
128 | }; |
---|
129 | |
---|
130 | class Button : public Option |
---|
131 | { |
---|
132 | public: |
---|
133 | Button (char* buttonname); |
---|
134 | ~Button (void); |
---|
135 | |
---|
136 | void redraw(); |
---|
137 | }; |
---|
138 | |
---|
139 | class CheckButton : public Option |
---|
140 | { |
---|
141 | public: |
---|
142 | CheckButton (char* buttonname); |
---|
143 | ~CheckButton (void); |
---|
144 | static gint OptionChange (GtkWidget* widget, Widget* checkbutton); |
---|
145 | void redraw (); |
---|
146 | }; |
---|
147 | |
---|
148 | class Slider : public Option |
---|
149 | { |
---|
150 | public: |
---|
151 | Slider (char* slidername,int start, int end); |
---|
152 | ~Slider (); |
---|
153 | static gint OptionChange (GtkWidget* widget, Widget* slider); |
---|
154 | void redraw(); |
---|
155 | }; |
---|
156 | |
---|
157 | class Menu : public Option |
---|
158 | { |
---|
159 | public: |
---|
160 | Menu (char* menuname, ...); |
---|
161 | ~Menu (); |
---|
162 | |
---|
163 | static gint OptionChange (GtkWidget* widget, Widget* menu); |
---|
164 | void redraw(); |
---|
165 | }; |
---|
166 | |
---|
167 | class Label : public Widget |
---|
168 | { |
---|
169 | public: |
---|
170 | Label (); |
---|
171 | Label (char* text); |
---|
172 | ~Label (); |
---|
173 | |
---|
174 | void setText (char * text); |
---|
175 | char* getText (); |
---|
176 | }; |
---|
177 | |
---|
178 | //gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data); |
---|
179 | |
---|
180 | #endif /* _ORXONOX_GUI_H */ |
---|