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 private import gtk.Bin;
63 
64 /**
65  * The GtkEventBox widget is a subclass of GtkBin which also has its
66  * own window. It is useful since it allows you to catch events for widgets
67  * which do not have their own window.
68  */
69 public class EventBox : Bin
70 {
71 	
72 	/** the main Gtk struct */
73 	protected GtkEventBox* gtkEventBox;
74 	
75 	
76 	/** Get the main Gtk struct */
77 	public GtkEventBox* getEventBoxStruct()
78 	{
79 		return gtkEventBox;
80 	}
81 	
82 	
83 	/** the main Gtk struct as a void* */
84 	protected override void* getStruct()
85 	{
86 		return cast(void*)gtkEventBox;
87 	}
88 	
89 	/**
90 	 * Sets our main struct and passes it to the parent class
91 	 */
92 	public this (GtkEventBox* gtkEventBox)
93 	{
94 		super(cast(GtkBin*)gtkEventBox);
95 		this.gtkEventBox = gtkEventBox;
96 	}
97 	
98 	protected override void setStruct(GObject* obj)
99 	{
100 		super.setStruct(obj);
101 		gtkEventBox = cast(GtkEventBox*)obj;
102 	}
103 	
104 	/**
105 	 */
106 	
107 	/**
108 	 * Creates a new GtkEventBox.
109 	 * Throws: ConstructionException GTK+ fails to create the object.
110 	 */
111 	public this ()
112 	{
113 		// GtkWidget * gtk_event_box_new (void);
114 		auto p = gtk_event_box_new();
115 		if(p is null)
116 		{
117 			throw new ConstructionException("null returned by gtk_event_box_new()");
118 		}
119 		this(cast(GtkEventBox*) p);
120 	}
121 	
122 	/**
123 	 * Set whether the event box window is positioned above the windows
124 	 * of its child, as opposed to below it. If the window is above, all
125 	 * events inside the event box will go to the event box. If the window
126 	 * is below, events in windows of child widgets will first got to that
127 	 * widget, and then to its parents.
128 	 * The default is to keep the window below the child.
129 	 * Since 2.4
130 	 * Params:
131 	 * aboveChild = TRUE if the event box window is above its child
132 	 */
133 	public void setAboveChild(int aboveChild)
134 	{
135 		// void gtk_event_box_set_above_child (GtkEventBox *event_box,  gboolean above_child);
136 		gtk_event_box_set_above_child(gtkEventBox, aboveChild);
137 	}
138 	
139 	/**
140 	 * Returns whether the event box window is above or below the
141 	 * windows of its child. See gtk_event_box_set_above_child()
142 	 * for details.
143 	 * Since 2.4
144 	 * Returns: TRUE if the event box window is above the window of its child
145 	 */
146 	public int getAboveChild()
147 	{
148 		// gboolean gtk_event_box_get_above_child (GtkEventBox *event_box);
149 		return gtk_event_box_get_above_child(gtkEventBox);
150 	}
151 	
152 	/**
153 	 * Set whether the event box uses a visible or invisible child
154 	 * window. The default is to use visible windows.
155 	 * In an invisible window event box, the window that the
156 	 * event box creates is a GDK_INPUT_ONLY window, which
157 	 * means that it is invisible and only serves to receive
158 	 * events.
159 	 * A visible window event box creates a visible (GDK_INPUT_OUTPUT)
160 	 * window that acts as the parent window for all the widgets
161 	 * contained in the event box.
162 	 * You should generally make your event box invisible if
163 	 * you just want to trap events. Creating a visible window
164 	 * may cause artifacts that are visible to the user, especially
165 	 * if the user is using a theme with gradients or pixmaps.
166 	 * The main reason to create a non input-only event box is if
167 	 * you want to set the background to a different color or
168 	 * draw on it.
169 	 * Note
170 	 * There is one unexpected issue for an invisible event box that has its
171 	 * window below the child. (See gtk_event_box_set_above_child().)
172 	 * Since the input-only window is not an ancestor window of any windows
173 	 * that descendent widgets of the event box create, events on these
174 	 * windows aren't propagated up by the windowing system, but only by GTK+.
175 	 * The practical effect of this is if an event isn't in the event
176 	 * mask for the descendant window (see gtk_widget_add_events()),
177 	 * it won't be received by the event box.
178 	 * This problem doesn't occur for visible event boxes, because in
179 	 * that case, the event box window is actually the ancestor of the
180 	 * descendant windows, not just at the same place on the screen.
181 	 * Since 2.4
182 	 * Params:
183 	 * visibleWindow = TRUE to make the event box have a visible window
184 	 */
185 	public void setVisibleWindow(int visibleWindow)
186 	{
187 		// void gtk_event_box_set_visible_window (GtkEventBox *event_box,  gboolean visible_window);
188 		gtk_event_box_set_visible_window(gtkEventBox, visibleWindow);
189 	}
190 	
191 	/**
192 	 * Returns whether the event box has a visible window.
193 	 * See gtk_event_box_set_visible_window() for details.
194 	 * Since 2.4
195 	 * Returns: TRUE if the event box window is visible
196 	 */
197 	public int getVisibleWindow()
198 	{
199 		// gboolean gtk_event_box_get_visible_window (GtkEventBox *event_box);
200 		return gtk_event_box_get_visible_window(gtkEventBox);
201 	}
202 }