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