Initial revision
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / eventbox.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_EVENTBOX_H
4 #define _GTKMM_EVENTBOX_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* eventbox.h
11  * 
12  * Copyright (C) 1998-2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Library General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28
29 #include <gtkmm/bin.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkEventBox GtkEventBox;
34 typedef struct _GtkEventBoxClass GtkEventBoxClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gtk
39 { class EventBox_Class; } // namespace Gtk
40 namespace Gtk
41 {
42
43 /** Event capturing box.
44  *
45  * This widget adds an X Window where one does not
46  * normally appear, allowing you to capture events.
47  * It will receive any event which is specified
48  * with set_events().
49  *
50  * This widget is generally used to add Gtk::Tooltips, button presses,
51  * and clipping to widgets derived from Gtk::Misc.
52  *
53  * @ingroup Widgets
54  */
55
56 class EventBox : public Bin
57 {
58   public:
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60   typedef EventBox CppObjectType;
61   typedef EventBox_Class CppClassType;
62   typedef GtkEventBox BaseObjectType;
63   typedef GtkEventBoxClass BaseClassType;
64 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
65
66   virtual ~EventBox();
67
68 #ifndef DOXYGEN_SHOULD_SKIP_THIS
69
70 private:
71   friend class EventBox_Class;
72   static CppClassType eventbox_class_;
73
74   // noncopyable
75   EventBox(const EventBox&);
76   EventBox& operator=(const EventBox&);
77
78 protected:
79   explicit EventBox(const Glib::ConstructParams& construct_params);
80   explicit EventBox(GtkEventBox* castitem);
81
82 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
83
84 public:
85 #ifndef DOXYGEN_SHOULD_SKIP_THIS
86   static GType get_type()      G_GNUC_CONST;
87   static GType get_base_type() G_GNUC_CONST;
88 #endif
89
90   ///Provides access to the underlying C GtkObject.
91   GtkEventBox*       gobj()       { return reinterpret_cast<GtkEventBox*>(gobject_); }
92
93   ///Provides access to the underlying C GtkObject.
94   const GtkEventBox* gobj() const { return reinterpret_cast<GtkEventBox*>(gobject_); }
95
96
97 public:
98   //C++ methods used to invoke GTK+ virtual functions:
99
100 protected:
101   //GTK+ Virtual Functions (override these to change behaviour):
102
103   //Default Signal Handlers::
104
105
106 private:
107
108 public:
109   EventBox();
110
111   
112   /** Returns whether the event box has a visible window.
113    * See set_visible_window() for details.
114    * @return <tt>true</tt> if the event box window is visible
115    * 
116    * Since: 2.4.
117    */
118   bool get_visible_window() const;
119   
120   /** Set whether the event box uses a visible or invisible child
121    * window. The default is to use visible windows.
122    * 
123    * In an invisible window event box, the window that that the
124    * event box creates is a Gdk::INPUT_ONLY window, which 
125    * means that it is invisible and only serves to receive
126    * events.
127    * 
128    * A visible window event box creates a visible (Gdk::INPUT_OUTPUT)
129    * window that acts as the parent window for all the widgets  
130    * contained in the event box.
131    * 
132    * You should generally make your event box invisible if
133    * you just want to trap events. Creating a visible window
134    * may cause artifacts that are visible to the user, especially
135    * if the user is using a theme with gradients or pixmaps.
136    * 
137    * The main reason to create a non input-only event box is if
138    * you want to set the background to a different color or
139    * draw on it.
140    * 
141    * &lt;note&gt;
142    * There is one unexpected issue for an invisible event box that has its
143    * window below the child. (See set_above_child().)
144    * Since the input-only window is not an ancestor window of any windows
145    * that descendent widgets of the event box create, events on these 
146    * windows aren't propagated up by the windowing system, but only by GTK+.
147    * The practical effect of this is if an event isn't in the event
148    * mask for the descendant window (see Gtk::Widget::add_events()),  
149    * it won't be received by the event box. 
150    * 
151    * This problem doesn't occur for visible event boxes, because in
152    * that case, the event box window is actually the ancestor of the
153    * descendant windows, not just at the same place on the screen.
154    * &lt;/note&gt;
155    * 
156    * Since: 2.4
157    * @param visible_window Boolean value.
158    */
159   void set_visible_window(bool visible_window = true);
160   
161   /** Returns whether the event box window is above or below the
162    * windows of its child. See set_above_child() for
163    * details.
164    * @return <tt>true</tt> if the event box window is above the window
165    * of its child.
166    * 
167    * Since: 2.4.
168    */
169   bool get_above_child() const;
170   
171   /** Set whether the event box window is positioned above the windows of its child,
172    * as opposed to below it. If the window is above, all events inside the
173    * event box will go to the event box. If the window is below, events
174    * in windows of child widgets will first got to that widget, and then
175    * to its parents.
176    * 
177    * The default is to keep the window below the child.
178    * 
179    * Since: 2.4
180    * @param above_child <tt>true</tt> if the event box window is above the windows of its child.
181    */
182   void set_above_child(bool above_child = true);
183
184   /** Whether the event box is visible
185    *
186    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
187    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
188    * the value of the property changes.
189    */
190   Glib::PropertyProxy<bool> property_visible_window() ;
191
192 /** Whether the event box is visible
193    *
194    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
195    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
196    * the value of the property changes.
197    */
198   Glib::PropertyProxy_ReadOnly<bool> property_visible_window() const;
199  
200   /** Whether the event-trapping window of the eventbox is above the window of the child widget as opposed to below it.
201    *
202    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
203    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
204    * the value of the property changes.
205    */
206   Glib::PropertyProxy<bool> property_above_child() ;
207
208 /** Whether the event-trapping window of the eventbox is above the window of the child widget as opposed to below it.
209    *
210    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
211    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
212    * the value of the property changes.
213    */
214   Glib::PropertyProxy_ReadOnly<bool> property_above_child() const;
215  
216
217 };
218
219 } /* namespace Gtk */
220
221
222 namespace Glib
223 {
224   /** @relates Gtk::EventBox
225    * @param object The C instance
226    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
227    * @result A C++ instance that wraps this C instance.
228    */
229   Gtk::EventBox* wrap(GtkEventBox* object, bool take_copy = false);
230 }
231 #endif /* _GTKMM_EVENTBOX_H */
232