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