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 module gtk.LayoutChild; 26 27 private import gobject.ObjectG; 28 private import gtk.LayoutManager; 29 private import gtk.Widget; 30 private import gtk.c.functions; 31 public import gtk.c.types; 32 33 34 /** 35 * `GtkLayoutChild` is the base class for objects that are meant to hold 36 * layout properties. 37 * 38 * If a `GtkLayoutManager` has per-child properties, like their packing type, 39 * or the horizontal and vertical span, or the icon name, then the layout 40 * manager should use a `GtkLayoutChild` implementation to store those properties. 41 * 42 * A `GtkLayoutChild` instance is only ever valid while a widget is part 43 * of a layout. 44 */ 45 public class LayoutChild : ObjectG 46 { 47 /** the main Gtk struct */ 48 protected GtkLayoutChild* gtkLayoutChild; 49 50 /** Get the main Gtk struct */ 51 public GtkLayoutChild* getLayoutChildStruct(bool transferOwnership = false) 52 { 53 if (transferOwnership) 54 ownedRef = false; 55 return gtkLayoutChild; 56 } 57 58 /** the main Gtk struct as a void* */ 59 protected override void* getStruct() 60 { 61 return cast(void*)gtkLayoutChild; 62 } 63 64 /** 65 * Sets our main struct and passes it to the parent class. 66 */ 67 public this (GtkLayoutChild* gtkLayoutChild, bool ownedRef = false) 68 { 69 this.gtkLayoutChild = gtkLayoutChild; 70 super(cast(GObject*)gtkLayoutChild, ownedRef); 71 } 72 73 74 /** */ 75 public static GType getType() 76 { 77 return gtk_layout_child_get_type(); 78 } 79 80 /** 81 * Retrieves the `GtkWidget` associated to the given @layout_child. 82 * 83 * Returns: a #GtkWidget 84 */ 85 public Widget getChildWidget() 86 { 87 auto __p = gtk_layout_child_get_child_widget(gtkLayoutChild); 88 89 if(__p is null) 90 { 91 return null; 92 } 93 94 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p); 95 } 96 97 /** 98 * Retrieves the `GtkLayoutManager` instance that created the 99 * given @layout_child. 100 * 101 * Returns: a `GtkLayoutManager` 102 */ 103 public LayoutManager getLayoutManager() 104 { 105 auto __p = gtk_layout_child_get_layout_manager(gtkLayoutChild); 106 107 if(__p is null) 108 { 109 return null; 110 } 111 112 return ObjectG.getDObject!(LayoutManager)(cast(GtkLayoutManager*) __p); 113 } 114 }