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