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.Version;
26 
27 private import glib.Str;
28 private import gtk.c.functions;
29 public  import gtk.c.types;
30 public  import gtkc.gtktypes;
31 
32 
33 /** */
34 public struct Version
35 {
36 
37 	/**
38 	 * Checks that the GTK+ library in use is compatible with the
39 	 * given version. Generally you would pass in the constants
40 	 * #GTK_MAJOR_VERSION, #GTK_MINOR_VERSION, #GTK_MICRO_VERSION
41 	 * as the three arguments to this function; that produces
42 	 * a check that the library in use is compatible with
43 	 * the version of GTK+ the application or module was compiled
44 	 * against.
45 	 *
46 	 * Compatibility is defined by two things: first the version
47 	 * of the running library is newer than the version
48 	 * @required_major.required_minor.@required_micro. Second
49 	 * the running library must be binary compatible with the
50 	 * version @required_major.required_minor.@required_micro
51 	 * (same major version.)
52 	 *
53 	 * This function is primarily for GTK+ modules; the module
54 	 * can call this function to check that it wasn’t loaded
55 	 * into an incompatible version of GTK+. However, such a
56 	 * check isn’t completely reliable, since the module may be
57 	 * linked against an old version of GTK+ and calling the
58 	 * old version of gtk_check_version(), but still get loaded
59 	 * into an application using a newer version of GTK+.
60 	 *
61 	 * Params:
62 	 *     requiredMajor = the required major version
63 	 *     requiredMinor = the required minor version
64 	 *     requiredMicro = the required micro version
65 	 *
66 	 * Returns: %NULL if the GTK+ library is compatible with the
67 	 *     given version, or a string describing the version mismatch.
68 	 *     The returned string is owned by GTK+ and should not be modified
69 	 *     or freed.
70 	 */
71 	public static string checkVersion(uint requiredMajor, uint requiredMinor, uint requiredMicro)
72 	{
73 		return Str.toString(gtk_check_version(requiredMajor, requiredMinor, requiredMicro));
74 	}
75 
76 	/**
77 	 * Returns the binary age as passed to `libtool`
78 	 * when building the GTK+ library the process is running against.
79 	 * If `libtool` means nothing to you, don't
80 	 * worry about it.
81 	 *
82 	 * Returns: the binary age of the GTK+ library
83 	 *
84 	 * Since: 3.0
85 	 */
86 	public static uint getBinaryAge()
87 	{
88 		return gtk_get_binary_age();
89 	}
90 
91 	/**
92 	 * Returns the interface age as passed to `libtool`
93 	 * when building the GTK+ library the process is running against.
94 	 * If `libtool` means nothing to you, don't
95 	 * worry about it.
96 	 *
97 	 * Returns: the interface age of the GTK+ library
98 	 *
99 	 * Since: 3.0
100 	 */
101 	public static uint getInterfaceAge()
102 	{
103 		return gtk_get_interface_age();
104 	}
105 
106 	/**
107 	 * Returns the major version number of the GTK+ library.
108 	 * (e.g. in GTK+ version 3.1.5 this is 3.)
109 	 *
110 	 * This function is in the library, so it represents the GTK+ library
111 	 * your code is running against. Contrast with the #GTK_MAJOR_VERSION
112 	 * macro, which represents the major version of the GTK+ headers you
113 	 * have included when compiling your code.
114 	 *
115 	 * Returns: the major version number of the GTK+ library
116 	 *
117 	 * Since: 3.0
118 	 */
119 	public static uint getMajorVersion()
120 	{
121 		return gtk_get_major_version();
122 	}
123 
124 	/**
125 	 * Returns the micro version number of the GTK+ library.
126 	 * (e.g. in GTK+ version 3.1.5 this is 5.)
127 	 *
128 	 * This function is in the library, so it represents the GTK+ library
129 	 * your code is are running against. Contrast with the
130 	 * #GTK_MICRO_VERSION macro, which represents the micro version of the
131 	 * GTK+ headers you have included when compiling your code.
132 	 *
133 	 * Returns: the micro version number of the GTK+ library
134 	 *
135 	 * Since: 3.0
136 	 */
137 	public static uint getMicroVersion()
138 	{
139 		return gtk_get_micro_version();
140 	}
141 
142 	/**
143 	 * Returns the minor version number of the GTK+ library.
144 	 * (e.g. in GTK+ version 3.1.5 this is 1.)
145 	 *
146 	 * This function is in the library, so it represents the GTK+ library
147 	 * your code is are running against. Contrast with the
148 	 * #GTK_MINOR_VERSION macro, which represents the minor version of the
149 	 * GTK+ headers you have included when compiling your code.
150 	 *
151 	 * Returns: the minor version number of the GTK+ library
152 	 *
153 	 * Since: 3.0
154 	 */
155 	public static uint getMinorVersion()
156 	{
157 		return gtk_get_minor_version();
158 	}
159 }