1 // GTK_WND.H : write a short description here...
2 
3 // Copyright (C) 2005 Tommi Hassinen.
4 
5 // This package is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 
10 // This package is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 
15 // You should have received a copy of the GNU General Public License
16 // along with this package; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 /*################################################################################################*/
20 
21 //#include "ghemicalconfig2.h"
22 
23 #ifndef GTK_WND_H
24 #define GTK_WND_H
25 
26 class gtk_wnd;
27 
28 #include <oglappth/base_wnd.h>
29 
30 #include <gtk/gtk.h>
31 #include <gtk/gtkgl.h>
32 
33 #include <vector>
34 using namespace std;
35 
36 /*################################################################################################*/
37 
38 // gtk_wnd class encapsulates the properties of a GTK2-window.
39 
40 class gtk_wnd :
41 	public base_wnd
42 {
43 	private:
44 
45 	static vector<gtk_wnd *> iv;	// instance vector
46 
47 	protected:
48 
49 	GtkWidget * view_widget;
50 
51 /**	If the "##detached" pointer is different from NULL, it means that the view is
52 	displayed on a separate window (and not as a part of the GtkNotebook).
53 */
54 	GtkWidget * detached;
55 
56 	GtkWidget * label_widget;
57 	GtkWidget * popupmenu;
58 
59 	friend class gtk_project;
60 
61 	public:
62 
63 	gtk_wnd(bool);
64 	~gtk_wnd(void);
65 
66 	static gtk_wnd * iv_Find(GtkWidget *);
67 
68 	static void RealizeHandler(GtkWidget *, gpointer);
69 	static gint ExposeHandler(GtkWidget *, GdkEventExpose *);
70 	static gint ButtonHandler(GtkWidget *, GdkEventButton *);
71 	static gint MotionNotifyHandler(GtkWidget *, GdkEventMotion *);
72 	static gint ConfigureHandler(GtkWidget *, GdkEventConfigure *);
73 
74 	static gint DetachedDeleteHandler(GtkWidget *, GdkEvent *);
75 
76 	GtkWidget * GetViewWidget(void);
77 
78 	bool IsDetached(void);
79 
80 	void RequestUpdate(bool);		// virtual
81 	void RequestResize(int, int);		// virtual
82 
83 	bool SetCurrent(void);			// virtual
84 
85 	protected:
86 
87 	void TitleChanged(void);		// virtual
88 };
89 
90 /*################################################################################################*/
91 
92 #endif	// GTK_WND_H
93 
94 // eof
95