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