1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD 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 Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GtkEventBox.html
27  * outPack = gtk
28  * outFile = EventBox
29  * strct   = GtkEventBox
30  * realStrct=
31  * ctorStrct=
32  * clss    = EventBox
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_event_box_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * structWrap:
47  * module aliases:
48  * local aliases:
49  * overrides:
50  */
51 
52 module gtk.EventBox;
53 
54 public  import gtkc.gtktypes;
55 
56 private import gtkc.gtk;
57 private import glib.ConstructionException;
58 private import gobject.ObjectG;
59 
60 
61 
62 
63 
64 private import gtk.Bin;
65 
66 /**
67  * The GtkEventBox widget is a subclass of GtkBin which also has its
68  * own window. It is useful since it allows you to catch events for widgets
69  * which do not have their own window.
70  */
71 public class EventBox : Bin
72 {
73 	
74 	/** the main Gtk struct */
75 	protected GtkEventBox* gtkEventBox;
76 	
77 	
78 	public GtkEventBox* getEventBoxStruct()
79 	{
80 		return gtkEventBox;
81 	}
82 	
83 	
84 	/** the main Gtk struct as a void* */
85 	protected override void* getStruct()
86 	{
87 		return cast(void*)gtkEventBox;
88 	}
89 	
90 	/**
91 	 * Sets our main struct and passes it to the parent class
92 	 */
93 	public this (GtkEventBox* gtkEventBox)
94 	{
95 		super(cast(GtkBin*)gtkEventBox);
96 		this.gtkEventBox = gtkEventBox;
97 	}
98 	
99 	protected override void setStruct(GObject* obj)
100 	{
101 		super.setStruct(obj);
102 		gtkEventBox = cast(GtkEventBox*)obj;
103 	}
104 	
105 	/**
106 	 */
107 	
108 	/**
109 	 * Creates a new GtkEventBox.
110 	 * Throws: ConstructionException GTK+ fails to create the object.
111 	 */
112 	public this ()
113 	{
114 		// GtkWidget * gtk_event_box_new (void);
115 		auto p = gtk_event_box_new();
116 		if(p is null)
117 		{
118 			throw new ConstructionException("null returned by gtk_event_box_new()");
119 		}
120 		this(cast(GtkEventBox*) p);
121 	}
122 	
123 	/**
124 	 * Set whether the event box window is positioned above the windows
125 	 * of its child, as opposed to below it. If the window is above, all
126 	 * events inside the event box will go to the event box. If the window
127 	 * is below, events in windows of child widgets will first got to that
128 	 * widget, and then to its parents.
129 	 * The default is to keep the window below the child.
130 	 * Since 2.4
131 	 * Params:
132 	 * aboveChild = TRUE if the event box window is above its child
133 	 */
134 	public void setAboveChild(int aboveChild)
135 	{
136 		// void gtk_event_box_set_above_child (GtkEventBox *event_box,  gboolean above_child);
137 		gtk_event_box_set_above_child(gtkEventBox, aboveChild);
138 	}
139 	
140 	/**
141 	 * Returns whether the event box window is above or below the
142 	 * windows of its child. See gtk_event_box_set_above_child()
143 	 * for details.
144 	 * Since 2.4
145 	 * Returns: TRUE if the event box window is above the window of its child
146 	 */
147 	public int getAboveChild()
148 	{
149 		// gboolean gtk_event_box_get_above_child (GtkEventBox *event_box);
150 		return gtk_event_box_get_above_child(gtkEventBox);
151 	}
152 	
153 	/**
154 	 * Set whether the event box uses a visible or invisible child
155 	 * window. The default is to use visible windows.
156 	 * In an invisible window event box, the window that the
157 	 * event box creates is a GDK_INPUT_ONLY window, which
158 	 * means that it is invisible and only serves to receive
159 	 * events.
160 	 * A visible window event box creates a visible (GDK_INPUT_OUTPUT)
161 	 * window that acts as the parent window for all the widgets
162 	 * contained in the event box.
163 	 * You should generally make your event box invisible if
164 	 * you just want to trap events. Creating a visible window
165 	 * may cause artifacts that are visible to the user, especially
166 	 * if the user is using a theme with gradients or pixmaps.
167 	 * The main reason to create a non input-only event box is if
168 	 * you want to set the background to a different color or
169 	 * draw on it.
170 	 * Note
171 	 * There is one unexpected issue for an invisible event box that has its
172 	 * window below the child. (See gtk_event_box_set_above_child().)
173 	 * Since the input-only window is not an ancestor window of any windows
174 	 * that descendent widgets of the event box create, events on these
175 	 * windows aren't propagated up by the windowing system, but only by GTK+.
176 	 * The practical effect of this is if an event isn't in the event
177 	 * mask for the descendant window (see gtk_widget_add_events()),
178 	 * it won't be received by the event box.
179 	 * This problem doesn't occur for visible event boxes, because in
180 	 * that case, the event box window is actually the ancestor of the
181 	 * descendant windows, not just at the same place on the screen.
182 	 * Since 2.4
183 	 * Params:
184 	 * visibleWindow = TRUE to make the event box have a visible window
185 	 */
186 	public void setVisibleWindow(int visibleWindow)
187 	{
188 		// void gtk_event_box_set_visible_window (GtkEventBox *event_box,  gboolean visible_window);
189 		gtk_event_box_set_visible_window(gtkEventBox, visibleWindow);
190 	}
191 	
192 	/**
193 	 * Returns whether the event box has a visible window.
194 	 * See gtk_event_box_set_visible_window() for details.
195 	 * Since 2.4
196 	 * Returns: TRUE if the event box window is visible
197 	 */
198 	public int getVisibleWindow()
199 	{
200 		// gboolean gtk_event_box_get_visible_window (GtkEventBox *event_box);
201 		return gtk_event_box_get_visible_window(gtkEventBox);
202 	}
203 }