root/trunk/src/gio/EmblemedIcon.d

Revision 938, 5.1 kB (checked in by Mike Wey, 3 months ago)

Update Gio to 2.28.

Line 
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  = GEmblemedIcon.html
27  * outPack = gio
28  * outFile = EmblemedIcon
29  * strct   = GEmblemedIcon
30  * realStrct=
31  * ctorStrct=GIcon
32  * clss    = EmblemedIcon
33  * interf  =
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  =
38  * implements:
39  *  - IconIF
40  * prefixes:
41  *  - g_emblemed_icon_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  *  - glib.ListG
48  *  - gio.Emblem
49  *  - gio.Icon
50  *  - gio.IconIF
51  *  - gio.IconT
52  * structWrap:
53  *  - GEmblem* -> Emblem
54  *  - GIcon* -> IconIF
55  *  - GList* -> ListG
56  * module aliases:
57  * local aliases:
58  * overrides:
59  */
60
61 module gio.EmblemedIcon;
62
63 public  import gtkc.giotypes;
64
65 private import gtkc.gio;
66 private import glib.ConstructionException;
67
68
69 private import glib.ListG;
70 private import gio.Emblem;
71 private import gio.Icon;
72 private import gio.IconIF;
73 private import gio.IconT;
74
75
76
77 private import gobject.ObjectG;
78
79 /**
80  * Description
81  * GEmblemedIcon is an implementation of GIcon that supports
82  * adding an emblem to an icon. Adding multiple emblems to an
83  * icon is ensured via g_emblemed_icon_add_emblem().
84  * Note that GEmblemedIcon allows no control over the position
85  * of the emblems. See also GEmblem for more information.
86  */
87 public class EmblemedIcon : ObjectG, IconIF
88 {
89    
90     /** the main Gtk struct */
91     protected GEmblemedIcon* gEmblemedIcon;
92    
93    
94     public GEmblemedIcon* getEmblemedIconStruct()
95     {
96         return gEmblemedIcon;
97     }
98    
99    
100     /** the main Gtk struct as a void* */
101     protected override void* getStruct()
102     {
103         return cast(void*)gEmblemedIcon;
104     }
105    
106     /**
107      * Sets our main struct and passes it to the parent class
108      */
109     public this (GEmblemedIcon* gEmblemedIcon)
110     {
111         if(gEmblemedIcon is null)
112         {
113             this = null;
114             return;
115         }
116         //Check if there already is a D object for this gtk struct
117         void* ptr = getDObject(cast(GObject*)gEmblemedIcon);
118         if( ptr !is null )
119         {
120             this = cast(EmblemedIcon)ptr;
121             return;
122         }
123         super(cast(GObject*)gEmblemedIcon);
124         this.gEmblemedIcon = gEmblemedIcon;
125     }
126    
127     protected override void setStruct(GObject* obj)
128     {
129         super.setStruct(obj);
130         gEmblemedIcon = cast(GEmblemedIcon*)obj;
131     }
132    
133     // add the Icon capabilities
134     mixin IconT!(GEmblemedIcon);
135    
136     /**
137      */
138    
139     /**
140      * Creates a new emblemed icon for icon with the emblem emblem.
141      * Since 2.18
142      * Params:
143      * icon = a GIcon
144      * emblem = a GEmblem, or NULL. [allow-none]
145      * Throws: ConstructionException GTK+ fails to create the object.
146      */
147     public this (IconIF icon, Emblem emblem)
148     {
149         // GIcon * g_emblemed_icon_new (GIcon *icon,  GEmblem *emblem);
150         auto p = g_emblemed_icon_new((icon is null) ? null : icon.getIconTStruct(), (emblem is null) ? null : emblem.getEmblemStruct());
151         if(p is null)
152         {
153             throw new ConstructionException("null returned by g_emblemed_icon_new((icon is null) ? null : icon.getIconTStruct(), (emblem is null) ? null : emblem.getEmblemStruct())");
154         }
155         this(cast(GEmblemedIcon*) p);
156     }
157    
158     /**
159      * Gets the main icon for emblemed.
160      * Since 2.18
161      * Returns: a GIcon that is owned by emblemed. [transfer none]
162      */
163     public IconIF getIcon()
164     {
165         // GIcon * g_emblemed_icon_get_icon (GEmblemedIcon *emblemed);
166         auto p = g_emblemed_icon_get_icon(gEmblemedIcon);
167         if(p is null)
168         {
169             return null;
170         }
171         return new Icon(cast(GIcon*) p);
172     }
173    
174     /**
175      * Gets the list of emblems for the icon.
176      * Since 2.18
177      * Returns: a GList of GEmblem s that is owned by emblemed. [element-type Gio.Emblem][transfer none]
178      */
179     public ListG getEmblems()
180     {
181         // GList * g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed);
182         auto p = g_emblemed_icon_get_emblems(gEmblemedIcon);
183         if(p is null)
184         {
185             return null;
186         }
187         return new ListG(cast(GList*) p);
188     }
189    
190     /**
191      * Adds emblem to the GList of GEmblem s.
192      * Since 2.18
193      * Params:
194      * emblem = a GEmblem
195      */
196     public void addEmblem(Emblem emblem)
197     {
198         // void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed,  GEmblem *emblem);
199         g_emblemed_icon_add_emblem(gEmblemedIcon, (emblem is null) ? null : emblem.getEmblemStruct());
200     }
201    
202     /**
203      * Removes all the emblems from icon.
204      * Since 2.28
205      */
206     public void clearEmblems()
207     {
208         // void g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed);
209         g_emblemed_icon_clear_emblems(gEmblemedIcon);
210     }
211 }
Note: See TracBrowser for help on using the browser.