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 change21 // find conversion definition on APILookup.txt22 // implement new conversion functionalities on the wrap.utils pakage23 24 25 modulegio.EmblemedIcon;
26 27 privateimportgio.Emblem;
28 privateimportgio.IconIF;
29 privateimportgio.IconT;
30 privateimportgio.c.functions;
31 publicimportgio.c.types;
32 privateimportglib.ConstructionException;
33 privateimportglib.ListG;
34 privateimportgobject.ObjectG;
35 36 37 /**
38 * #GEmblemedIcon is an implementation of #GIcon that supports
39 * adding an emblem to an icon. Adding multiple emblems to an
40 * icon is ensured via g_emblemed_icon_add_emblem().
41 *
42 * Note that #GEmblemedIcon allows no control over the position
43 * of the emblems. See also #GEmblem for more information.
44 */45 publicclassEmblemedIcon : ObjectG, IconIF46 {
47 /** the main Gtk struct */48 protectedGEmblemedIcon* gEmblemedIcon;
49 50 /** Get the main Gtk struct */51 publicGEmblemedIcon* getEmblemedIconStruct(booltransferOwnership = false)
52 {
53 if (transferOwnership)
54 ownedRef = false;
55 returngEmblemedIcon;
56 }
57 58 /** the main Gtk struct as a void* */59 protectedoverridevoid* getStruct()
60 {
61 returncast(void*)gEmblemedIcon;
62 }
63 64 /**
65 * Sets our main struct and passes it to the parent class.
66 */67 publicthis (GEmblemedIcon* gEmblemedIcon, boolownedRef = false)
68 {
69 this.gEmblemedIcon = gEmblemedIcon;
70 super(cast(GObject*)gEmblemedIcon, ownedRef);
71 }
72 73 // add the Icon capabilities74 mixinIconT!(GEmblemedIcon);
75 76 77 /** */78 publicstaticGTypegetType()
79 {
80 returng_emblemed_icon_get_type();
81 }
82 83 /**
84 * Creates a new emblemed icon for @icon with the emblem @emblem.
85 *
86 * Params:
87 * icon = a #GIcon
88 * emblem = a #GEmblem, or %NULL
89 *
90 * Returns: a new #GIcon
91 *
92 * Since: 2.18
93 *
94 * Throws: ConstructionException GTK+ fails to create the object.
95 */96 publicthis(IconIFicon, Emblememblem)
97 {
98 auto__p = g_emblemed_icon_new((iconisnull) ? null : icon.getIconStruct(), (emblemisnull) ? null : emblem.getEmblemStruct());
99 100 if(__pisnull)
101 {
102 thrownewConstructionException("null returned by new");
103 }
104 105 this(cast(GEmblemedIcon*) __p, true);
106 }
107 108 /**
109 * Adds @emblem to the #GList of #GEmblems.
110 *
111 * Params:
112 * emblem = a #GEmblem
113 *
114 * Since: 2.18
115 */116 publicvoidaddEmblem(Emblememblem)
117 {
118 g_emblemed_icon_add_emblem(gEmblemedIcon, (emblemisnull) ? null : emblem.getEmblemStruct());
119 }
120 121 /**
122 * Removes all the emblems from @icon.
123 *
124 * Since: 2.28
125 */126 publicvoidclearEmblems()
127 {
128 g_emblemed_icon_clear_emblems(gEmblemedIcon);
129 }
130 131 /**
132 * Gets the list of emblems for the @icon.
133 *
134 * Returns: a #GList of
135 * #GEmblems that is owned by @emblemed
136 *
137 * Since: 2.18
138 */139 publicListGgetEmblems()
140 {
141 auto__p = g_emblemed_icon_get_emblems(gEmblemedIcon);
142 143 if(__pisnull)
144 {
145 returnnull;
146 }
147 148 returnnewListG(cast(GList*) __p);
149 }
150 151 /**
152 * Gets the main icon for @emblemed.
153 *
154 * Returns: a #GIcon that is owned by @emblemed
155 *
156 * Since: 2.18
157 */158 publicIconIFgetIcon()
159 {
160 auto__p = g_emblemed_icon_get_icon(gEmblemedIcon);
161 162 if(__pisnull)
163 {
164 returnnull;
165 }
166 167 returnObjectG.getDObject!(IconIF)(cast(GIcon*) __p);
168 }
169 }