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 = cairo-Version-Information.html 27 * outPack = cairo 28 * outFile = Version 29 * strct = 30 * realStrct= 31 * ctorStrct= 32 * clss = Version 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * omit structs: 41 * omit prefixes: 42 * omit code: 43 * omit signals: 44 * imports: 45 * - glib.Str 46 * structWrap: 47 * module aliases: 48 * local aliases: 49 * overrides: 50 */ 51 52 module cairo.Version; 53 54 public import gtkc.cairotypes; 55 56 private import gtkc.cairo; 57 private import glib.ConstructionException; 58 59 60 private import glib.Str; 61 62 63 64 65 /** 66 * Description 67 * Cairo has a three-part version number scheme. In this scheme, we use 68 * even vs. odd numbers to distinguish fixed points in the software 69 * vs. in-progress development, (such as from git instead of a tar file, 70 * or as a "snapshot" tar file as opposed to a "release" tar file). 71 * $(DDOC_COMMENT example) 72 * Here are a few examples of versions that one might see. 73 * $(DDOC_COMMENT example) 74 * Compatibility 75 * The API/ABI compatibility guarantees for various versions are as 76 * follows. First, let's assume some cairo-using application code that is 77 * successfully using the API/ABI "from" one version of cairo. Then let's 78 * ask the question whether this same code can be moved "to" the API/ABI 79 * of another version of cairo. 80 * Moving from a release to any later version (release, snapshot, 81 * development) is always guaranteed to provide compatibility. 82 * Moving from a snapshot to any later version is not guaranteed to 83 * provide compatibility, since snapshots may introduce new API that ends 84 * up being removed before the next release. 85 * Moving from an in-development version (odd micro component) to any 86 * later version is not guaranteed to provide compatibility. In fact, 87 * there's not even a guarantee that the code will even continue to work 88 * with the same in-development version number. This is because these 89 * numbers don't correspond to any fixed state of the software, but 90 * rather the many states between snapshots and releases. 91 * <hr> 92 * Examining the version 93 * Cairo provides the ability to examine the version at either 94 * compile-time or run-time and in both a human-readable form as well as 95 * an encoded form suitable for direct comparison. Cairo also provides the 96 * macro CAIRO_VERSION_ENCODE() to perform the encoding. 97 * $(DDOC_COMMENT example) 98 * For example, checking that the cairo version is greater than or equal 99 * to 1.0.0 could be achieved at compile-time or run-time as follows: 100 * $(DDOC_COMMENT example) 101 */ 102 public class Version 103 { 104 105 /** 106 */ 107 108 /** 109 * Returns the version of the cairo library encoded in a single 110 * integer as per CAIRO_VERSION_ENCODE. The encoding ensures that 111 * later versions compare greater than earlier versions. 112 * A run-time comparison to check that cairo's version is greater than 113 * Returns: the encoded version. 114 */ 115 public static int cairoVersion() 116 { 117 // int cairo_version (void); 118 return cairo_version(); 119 } 120 121 /** 122 * Returns the version of the cairo library as a human-readable string 123 * of the form "X.Y.Z". 124 * See also cairo_version() as well as the compile-time equivalents 125 * CAIRO_VERSION_STRING and CAIRO_VERSION. 126 * Returns: a string containing the version. 127 */ 128 public static string cairoVersionString() 129 { 130 // const char * cairo_version_string (void); 131 return Str.toString(cairo_version_string()); 132 } 133 }