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  = gio-GBytesIcon.html
27  * outPack = gio
28  * outFile = BytesIcon
29  * strct   = GBytesIcon
30  * realStrct=
31  * ctorStrct=GIcon
32  * clss    = FileIcon
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- LoadableIconIF
40  * prefixes:
41  * 	- g_bytes_icon_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Bytes
48  * 	- gio.LoadableIconT
49  * 	- gio.LoadableIconIF
50  * structWrap:
51  * 	- GBytes* -> Bytes
52  * module aliases:
53  * local aliases:
54  * overrides:
55  */
56 
57 module gio.BytesIcon;
58 
59 public  import gtkc.giotypes;
60 
61 private import gtkc.gio;
62 private import glib.ConstructionException;
63 private import gobject.ObjectG;
64 
65 
66 private import glib.Bytes;
67 private import gio.LoadableIconT;
68 private import gio.LoadableIconIF;
69 
70 
71 
72 
73 /**
74  * GBytesIcon specifies an image held in memory in a common format (usually
75  * png) to be used as icon.
76  */
77 public class FileIcon : LoadableIconIF
78 {
79 	
80 	/** the main Gtk struct */
81 	protected GBytesIcon* gBytesIcon;
82 	
83 	
84 	public GBytesIcon* getFileIconStruct()
85 	{
86 		return gBytesIcon;
87 	}
88 	
89 	
90 	/** the main Gtk struct as a void* */
91 	protected void* getStruct()
92 	{
93 		return cast(void*)gBytesIcon;
94 	}
95 	
96 	/**
97 	 * Sets our main struct and passes it to the parent class
98 	 */
99 	public this (GBytesIcon* gBytesIcon)
100 	{
101 		this.gBytesIcon = gBytesIcon;
102 	}
103 	
104 	// add the LoadableIcon capabilities
105 	mixin LoadableIconT!(GBytesIcon);
106 	
107 	/**
108 	 */
109 	
110 	/**
111 	 * Creates a new icon for a bytes.
112 	 * Since 2.38
113 	 * Params:
114 	 * bytes = a GBytes.
115 	 * Throws: ConstructionException GTK+ fails to create the object.
116 	 */
117 	public this (Bytes bytes)
118 	{
119 		// GIcon * g_bytes_icon_new (GBytes *bytes);
120 		auto p = g_bytes_icon_new((bytes is null) ? null : bytes.getBytesStruct());
121 		if(p is null)
122 		{
123 			throw new ConstructionException("null returned by g_bytes_icon_new((bytes is null) ? null : bytes.getBytesStruct())");
124 		}
125 		this(cast(GBytesIcon*) p);
126 	}
127 	
128 	/**
129 	 * Gets the GBytes associated with the given icon.
130 	 * Since 2.38
131 	 * Returns: a GBytes, or NULL. [transfer none]
132 	 */
133 	public Bytes getBytes()
134 	{
135 		// GBytes * g_bytes_icon_get_bytes (GBytesIcon *icon);
136 		auto p = g_bytes_icon_get_bytes(gBytesIcon);
137 		
138 		if(p is null)
139 		{
140 			return null;
141 		}
142 		
143 		return ObjectG.getDObject!(Bytes)(cast(GBytes*) p);
144 	}
145 }