00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _GTK_MAIN_WINDOW_H_
00009 #define _GTK_MAIN_WINDOW_H_
00010
00011
00012
00013
00014
00015
00016 #include "Interfaces/MainWindowInterface.h"
00017 #include <vector>
00018 #include <gtk/gtk.h>
00019
00020
00021
00022
00023
00024
00025 class CGTKMainWindowWidget;
00026
00027
00028
00029
00030
00031
00032
00033 class CGTKMainWindow : public CMainWindowInterface
00034 {
00035 public:
00036 CGTKMainWindow(int x, int y, int width, int height, const char *title);
00037 virtual ~CGTKMainWindow();
00038
00039
00040 WIDGET_HANDLE AddImage(int x, int y, int width, int height, WIDGET_HANDLE parent = 0);
00041 WIDGET_HANDLE AddButton(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
00042 WIDGET_HANDLE AddLabel(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
00043 WIDGET_HANDLE AddCheckBox(int x, int y, int width, int height, const char *text, bool checked, WIDGET_HANDLE parent = 0);
00044 WIDGET_HANDLE AddTextEdit(int x, int y, int width, int height, const char *text, WIDGET_HANDLE parent = 0);
00045 WIDGET_HANDLE AddSlider(int x, int y, int width, int height, int min_value, int max_value, int step, int value, WIDGET_HANDLE parent = 0);
00046 WIDGET_HANDLE AddComboBox(int x, int y, int width, int height, int num_entries, const char **entries, int current_entry, WIDGET_HANDLE parent = 0);
00047 WIDGET_HANDLE AddGLWidget(int x, int y, int width, int height, WIDGET_HANDLE parent = 0);
00048
00049
00050 bool GetText(WIDGET_HANDLE widget, char *text, int len);
00051 bool SetText(WIDGET_HANDLE widget, const char *text);
00052
00053 bool SetImage(WIDGET_HANDLE widget, const CByteImage *pImage);
00054
00055 bool GetValue(WIDGET_HANDLE widget, int &value);
00056 bool SetValue(WIDGET_HANDLE widget, int value);
00057
00058 bool SwapBuffersGLWidget(WIDGET_HANDLE widget);
00059 bool MakeCurrentGLWidget(WIDGET_HANDLE widget);
00060
00061
00062 void Show(WIDGET_HANDLE widget = 0);
00063 void Hide(WIDGET_HANDLE widget = 0);
00064
00065 int GetModifierKeyState();
00066
00067 void SetEventCallback(CMainWindowEventInterface *callback) {m_event_callback = callback;}
00068
00069
00070 CMainWindowEventInterface *GetEventCallback() { return m_event_callback; }
00071
00072 public:
00073 void Destroy(GtkWidget *widget);
00074
00075 private:
00076 CMainWindowEventInterface *m_event_callback;
00077
00078 std::vector<CGTKMainWindowWidget*> m_widgets;
00079
00080 GtkWidget *m_main_window;
00081 GtkWidget *m_fixed_container;
00082
00083 static int m_ref_count;
00084
00085 bool m_bDestroyed;
00086 };
00087
00088
00089
00090 #endif