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.BuildableT;
26 
27 public  import glib.Str;
28 public  import glib.c.functions;
29 public  import gtk.c.functions;
30 public  import gtk.c.types;
31 
32 
33 /**
34  * `GtkBuildable` allows objects to extend and customize their deserialization
35  * from ui files.
36  * 
37  * The interface includes methods for setting names and properties of objects,
38  * parsing custom tags and constructing child objects.
39  * 
40  * The `GtkBuildable` interface is implemented by all widgets and
41  * many of the non-widget objects that are provided by GTK. The
42  * main user of this interface is [class@Gtk.Builder]. There should be
43  * very little need for applications to call any of these functions directly.
44  * 
45  * An object only needs to implement this interface if it needs to extend the
46  * `GtkBuilder` XML format or run any extra routines at deserialization time.
47  */
48 public template BuildableT(TStruct)
49 {
50 	/** Get the main Gtk struct */
51 	public GtkBuildable* getBuildableStruct(bool transferOwnership = false)
52 	{
53 		if (transferOwnership)
54 			ownedRef = false;
55 		return cast(GtkBuildable*)getStruct();
56 	}
57 
58 
59 	/**
60 	 * Gets the ID of the @buildable object.
61 	 *
62 	 * `GtkBuilder` sets the name based on the ID attribute
63 	 * of the <object> tag used to construct the @buildable.
64 	 *
65 	 * Returns: the ID of the buildable object
66 	 */
67 	public string getBuildableId()
68 	{
69 		return Str.toString(gtk_buildable_get_buildable_id(getBuildableStruct()));
70 	}
71 }