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 = GtkHandleBox.html 27 * outPack = gtk 28 * outFile = HandleBox 29 * strct = GtkHandleBox 30 * realStrct= 31 * ctorStrct= 32 * clss = HandleBox 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_handle_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.HandleBox; 53 54 public import gtkc.gtktypes; 55 56 private import gtkc.gtk; 57 private import glib.ConstructionException; 58 private import gobject.ObjectG; 59 60 private import gobject.Signals; 61 public import gtkc.gdktypes; 62 63 64 65 66 private import gtk.Bin; 67 68 /** 69 * The GtkHandleBox widget allows a portion of a window to be "torn 70 * off". It is a bin widget which displays its child and a handle that 71 * the user can drag to tear off a separate window (the float 72 * window) containing the child widget. A thin 73 * ghost is drawn in the original location of the 74 * handlebox. By dragging the separate window back to its original 75 * location, it can be reattached. 76 * 77 * When reattaching, the ghost and float window, must be aligned 78 * along one of the edges, the snap edge. 79 * This either can be specified by the application programmer 80 * explicitely, or GTK+ will pick a reasonable default based 81 * on the handle position. 82 * 83 * To make detaching and reattaching the handlebox as minimally confusing 84 * as possible to the user, it is important to set the snap edge so that 85 * the snap edge does not move when the handlebox is deattached. For 86 * instance, if the handlebox is packed at the bottom of a VBox, then 87 * when the handlebox is detached, the bottom edge of the handlebox's 88 * allocation will remain fixed as the height of the handlebox shrinks, 89 * so the snap edge should be set to GTK_POS_BOTTOM. 90 * 91 * Note 92 * 93 * GtkHandleBox has been deprecated. It is very specialized, lacks features 94 * to make it useful and most importantly does not fit well into modern 95 * application design. Do not use it. There is no replacement. 96 */ 97 public class HandleBox : Bin 98 { 99 100 /** the main Gtk struct */ 101 protected GtkHandleBox* gtkHandleBox; 102 103 104 public GtkHandleBox* getHandleBoxStruct() 105 { 106 return gtkHandleBox; 107 } 108 109 110 /** the main Gtk struct as a void* */ 111 protected override void* getStruct() 112 { 113 return cast(void*)gtkHandleBox; 114 } 115 116 /** 117 * Sets our main struct and passes it to the parent class 118 */ 119 public this (GtkHandleBox* gtkHandleBox) 120 { 121 super(cast(GtkBin*)gtkHandleBox); 122 this.gtkHandleBox = gtkHandleBox; 123 } 124 125 protected override void setStruct(GObject* obj) 126 { 127 super.setStruct(obj); 128 gtkHandleBox = cast(GtkHandleBox*)obj; 129 } 130 131 /** 132 */ 133 int[string] connectedSignals; 134 135 void delegate(GtkWidget*, HandleBox)[] onChildAttachedListeners; 136 /** 137 * Warning 138 * GtkHandleBox::child-attached has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 139 * This signal is emitted when the contents of the 140 * handlebox are reattached to the main window. 141 */ 142 void addOnChildAttached(void delegate(GtkWidget*, HandleBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 143 { 144 if ( !("child-attached" in connectedSignals) ) 145 { 146 Signals.connectData( 147 getStruct(), 148 "child-attached", 149 cast(GCallback)&callBackChildAttached, 150 cast(void*)this, 151 null, 152 connectFlags); 153 connectedSignals["child-attached"] = 1; 154 } 155 onChildAttachedListeners ~= dlg; 156 } 157 extern(C) static void callBackChildAttached(GtkHandleBox* handleboxStruct, GtkWidget* widget, HandleBox _handleBox) 158 { 159 foreach ( void delegate(GtkWidget*, HandleBox) dlg ; _handleBox.onChildAttachedListeners ) 160 { 161 dlg(widget, _handleBox); 162 } 163 } 164 165 void delegate(GtkWidget*, HandleBox)[] onChildDetachedListeners; 166 /** 167 * Warning 168 * GtkHandleBox::child-detached has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 169 * This signal is emitted when the contents of the 170 * handlebox are detached from the main window. 171 */ 172 void addOnChildDetached(void delegate(GtkWidget*, HandleBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 173 { 174 if ( !("child-detached" in connectedSignals) ) 175 { 176 Signals.connectData( 177 getStruct(), 178 "child-detached", 179 cast(GCallback)&callBackChildDetached, 180 cast(void*)this, 181 null, 182 connectFlags); 183 connectedSignals["child-detached"] = 1; 184 } 185 onChildDetachedListeners ~= dlg; 186 } 187 extern(C) static void callBackChildDetached(GtkHandleBox* handleboxStruct, GtkWidget* widget, HandleBox _handleBox) 188 { 189 foreach ( void delegate(GtkWidget*, HandleBox) dlg ; _handleBox.onChildDetachedListeners ) 190 { 191 dlg(widget, _handleBox); 192 } 193 } 194 195 196 /** 197 * Warning 198 * gtk_handle_box_new has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 199 * Create a new handle box. 200 * Throws: ConstructionException GTK+ fails to create the object. 201 */ 202 public this () 203 { 204 // GtkWidget * gtk_handle_box_new (void); 205 auto p = gtk_handle_box_new(); 206 if(p is null) 207 { 208 throw new ConstructionException("null returned by gtk_handle_box_new()"); 209 } 210 this(cast(GtkHandleBox*) p); 211 } 212 213 /** 214 * Warning 215 * gtk_handle_box_set_shadow_type has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 216 * Sets the type of shadow to be drawn around the border 217 * of the handle box. 218 * Params: 219 * type = the shadow type. 220 */ 221 public void setShadowType(GtkShadowType type) 222 { 223 // void gtk_handle_box_set_shadow_type (GtkHandleBox *handle_box, GtkShadowType type); 224 gtk_handle_box_set_shadow_type(gtkHandleBox, type); 225 } 226 227 /** 228 * Warning 229 * gtk_handle_box_set_handle_position has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 230 * Sets the side of the handlebox where the handle is drawn. 231 * Params: 232 * position = the side of the handlebox where the handle should be drawn. 233 */ 234 public void setHandlePosition(GtkPositionType position) 235 { 236 // void gtk_handle_box_set_handle_position (GtkHandleBox *handle_box, GtkPositionType position); 237 gtk_handle_box_set_handle_position(gtkHandleBox, position); 238 } 239 240 /** 241 * Warning 242 * gtk_handle_box_set_snap_edge has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 243 * Sets the snap edge of a handlebox. The snap edge is 244 * the edge of the detached child that must be aligned 245 * with the corresponding edge of the "ghost" left 246 * behind when the child was detached to reattach 247 * the torn-off window. Usually, the snap edge should 248 * be chosen so that it stays in the same place on 249 * the screen when the handlebox is torn off. 250 * If the snap edge is not set, then an appropriate value 251 * will be guessed from the handle position. If the 252 * handle position is GTK_POS_RIGHT or GTK_POS_LEFT, 253 * then the snap edge will be GTK_POS_TOP, otherwise 254 * it will be GTK_POS_LEFT. 255 * Params: 256 * edge = the snap edge, or -1 to unset the value; in which 257 * case GTK+ will try to guess an appropriate value 258 * in the future. 259 */ 260 public void setSnapEdge(GtkPositionType edge) 261 { 262 // void gtk_handle_box_set_snap_edge (GtkHandleBox *handle_box, GtkPositionType edge); 263 gtk_handle_box_set_snap_edge(gtkHandleBox, edge); 264 } 265 266 /** 267 * Warning 268 * gtk_handle_box_get_handle_position has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 269 * Gets the handle position of the handle box. See 270 * gtk_handle_box_set_handle_position(). 271 * Returns: the current handle position. 272 */ 273 public GtkPositionType getHandlePosition() 274 { 275 // GtkPositionType gtk_handle_box_get_handle_position (GtkHandleBox *handle_box); 276 return gtk_handle_box_get_handle_position(gtkHandleBox); 277 } 278 279 /** 280 * Warning 281 * gtk_handle_box_get_shadow_type has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 282 * Gets the type of shadow drawn around the handle box. See 283 * gtk_handle_box_set_shadow_type(). 284 * Returns: the type of shadow currently drawn around the handle box. 285 */ 286 public GtkShadowType getShadowType() 287 { 288 // GtkShadowType gtk_handle_box_get_shadow_type (GtkHandleBox *handle_box); 289 return gtk_handle_box_get_shadow_type(gtkHandleBox); 290 } 291 292 /** 293 * Warning 294 * gtk_handle_box_get_snap_edge has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 295 * Gets the edge used for determining reattachment of the handle box. 296 * See gtk_handle_box_set_snap_edge(). 297 * Returns: the edge used for determining reattachment, or (GtkPositionType)-1 if this is determined (as per default) from the handle position. 298 */ 299 public GtkPositionType getSnapEdge() 300 { 301 // GtkPositionType gtk_handle_box_get_snap_edge (GtkHandleBox *handle_box); 302 return gtk_handle_box_get_snap_edge(gtkHandleBox); 303 } 304 305 /** 306 * Warning 307 * gtk_handle_box_get_child_detached has been deprecated since version 3.4 and should not be used in newly-written code. GtkHandleBox has been deprecated. 308 * Whether the handlebox's child is currently detached. 309 * Since 2.14 310 * Returns: TRUE if the child is currently detached, otherwise FALSE 311 */ 312 public int getChildDetached() 313 { 314 // gboolean gtk_handle_box_get_child_detached (GtkHandleBox *handle_box); 315 return gtk_handle_box_get_child_detached(gtkHandleBox); 316 } 317 }