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