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