root/trunk/src/gio/IconT.d

Revision 938, 4.3 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  = GIcon.html
27  * outPack = gio
28  * outFile = IconT
29  * strct   = GIcon
30  * realStrct=
31  * ctorStrct=
32  * clss    = IconT
33  * interf  = IconIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  *  - TStruct
38  * extend  =
39  * implements:
40  * prefixes:
41  *  - g_icon_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  *  - g_icon_new_for_string
46  * omit signals:
47  * imports:
48  *  - glib.Str
49  *  - glib.ErrorG
50  *  - glib.GException
51  * structWrap:
52  * module aliases:
53  * local aliases:
54  * overrides:
55  *  - toString
56  */
57
58 module gio.IconT;
59
60 public  import gtkc.giotypes;
61
62 public import gtkc.gio;
63 public import glib.ConstructionException;
64
65
66 public import glib.Str;
67 public import glib.ErrorG;
68 public import glib.GException;
69
70
71
72
73 /**
74  * Description
75  * GIcon is a very minimal interface for icons. It provides functions
76  * for checking the equality of two icons, hashing of icons and
77  * serializing an icon to and from strings.
78  * GIcon does not provide the actual pixmap for the icon as this is out
79  * of GIO's scope, however implementations of GIcon may contain the name
80  * of an icon (see GThemedIcon), or the path to an icon (see GLoadableIcon).
81  * To obtain a hash of a GIcon, see g_icon_hash().
82  * To check if two GIcons are equal, see g_icon_equal().
83  * For serializing a GIcon, use g_icon_to_string() and
84  * g_icon_new_for_string().
85  * If your application or library provides one or more GIcon
86  * implementations you need to ensure that each GType is registered
87  * with the type system prior to calling g_icon_new_for_string().
88  */
89 public template IconT(TStruct)
90 {
91    
92     /** the main Gtk struct */
93     protected GIcon* gIcon;
94    
95    
96     public GIcon* getIconTStruct()
97     {
98         return cast(GIcon*)getStruct();
99     }
100    
101    
102     /**
103      */
104    
105     /**
106      * Gets a hash for an icon.
107      * Virtual: hash
108      * Params:
109      * icon = gconstpointer to an icon object.
110      * Returns: a guint containing a hash for the icon, suitable for use in a GHashTable or similar data structure.
111      */
112     public static uint hash(void* icon)
113     {
114         // guint g_icon_hash (gconstpointer icon);
115         return g_icon_hash(icon);
116     }
117    
118     /**
119      * Checks if two icons are equal.
120      * Params:
121      * icon2 = pointer to the second GIcon.
122      * Returns: TRUE if icon1 is equal to icon2. FALSE otherwise.
123      */
124     public int equal(GIcon* icon2)
125     {
126         // gboolean g_icon_equal (GIcon *icon1,  GIcon *icon2);
127         return g_icon_equal(getIconTStruct(), icon2);
128     }
129    
130     /**
131      * Generates a textual representation of icon that can be used for
132      * serialization such as when passing icon to a different process or
133      * saving it to persistent storage. Use g_icon_new_for_string() to
134      * get icon back from the returned string.
135      * The encoding of the returned string is proprietary to GIcon except
136      * in the following two cases
137      *  If icon is a GFileIcon, the returned string is a native path
138      *  (such as /path/to/my icon.png) without escaping
139      *  if the GFile for icon is a native file. If the file is not
140      *  native, the returned string is the result of g_file_get_uri()
141      *  (such as sftp://path/to/my%20icon.png).
142      *  If icon is a GThemedIcon with exactly one name, the encoding is
143      *  simply the name (such as network-server).
144      * Virtual: to_tokens
145      * Since 2.20
146      * Returns: An allocated NUL-terminated UTF8 string or NULL if icon can't be serialized. Use g_free() to free.
147      */
148     public override string toString()
149     {
150         // gchar * g_icon_to_string (GIcon *icon);
151         return Str.toString(g_icon_to_string(getIconTStruct()));
152     }
153 }
Note: See TracBrowser for help on using the browser.