I've no idea here...
[gtkD.git] / src / cairoLib / Version.d
blob8068f7e69a1cb2fc6b494db6b783b03028256efb
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = cairo-Version-Information.html
26 * outPack = cairoLib
27 * outFile = Version
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = Version
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * omit structs:
40 * omit prefixes:
41 * omit code:
42 * imports:
43 * - glib.Str
44 * structWrap:
45 * local aliases:
48 module cairoLib.Version;
50 private import cairoLib.cairoLibtypes;
52 private import lib.cairoLib;
54 private import glib.Str;
56 /**
57 * Description
58 * Cairo has a three-part version number scheme. In this scheme, we use
59 * even vs. odd numbers to distinguish fixed points in the software
60 * vs. in-progress development, (such as from CVS instead of a tar file,
61 * or as a "snapshot" tar file as opposed to a "release" tar file).
62 * _____ Major. Always 1, until we invent a new scheme.
63 * / ___ Minor. Even/Odd = Release/Snapshot (tar files) or Branch/Head (CVS)
64 * | / _ Micro. Even/Odd = Tar-file/CVS
65 * | | /
66 * 1.0.0
67 * Here are a few examples of versions that one might see.
68 * Releases
69 * --------
70 * 1.0.0 - A major release
71 * 1.0.2 - A subsequent maintenance release
72 * 1.2.0 - Another major release
73 * Snapshots
74 * ---------
75 * 1.1.2 - A snapshot (working toward the 1.2.0 release)
76 * In-progress development (eg. from CVS)
77 * --------------------------------------
78 * 1.0.1 - Development on a maintenance branch (toward 1.0.2 release)
79 * 1.1.1 - Development on head (toward 1.1.2 snapshot and 1.2.0 release)
80 * Compatibility
81 * The API/ABI compatibility guarantees for various versions are as
82 * follows. First, let's assume some cairo-using application code that is
83 * successfully using the API/ABI "from" one version of cairo. Then let's
84 * ask the question whether this same code can be moved "to" the API/ABI
85 * of another version of cairo.
86 * Moving from a release to any later version (release, snapshot,
87 * development) is always guaranteed to provide compatibility.
88 * Moving from a snapshot to any later version is not guaranteed to
89 * provide compatibility, since snapshots may introduce new API that ends
90 * up being removed before the next release.
91 * Moving from an in-development version (odd micro component) to any
92 * later version is not guaranteed to provide compatibility. In fact,
93 * there's not even a guarantee that the code will even continue to work
94 * with the same in-development version number. This is because these
95 * numbers don't correspond to any fixed state of the software, but
96 * rather the many states between snapshots and releases.
97 * <hr>
98 * Examining the version
99 * Cairo provides the ability to examine the version at either
100 * compile-time or run-time and in both a human-readable form as well as
101 * an encoded form suitable for direct comparison. Cairo also provides a
102 * macro (CAIRO_VERSION_ENCODE) to perform the encoding.
103 * Compile-time
104 * ------------
105 * CAIRO_VERSION_STRING Human-readable
106 * CAIRO_VERSION Encoded, suitable for comparison
107 * Run-time
108 * --------
109 * cairo_version_string() Human-readable
110 * cairo_version() Encoded, suitable for comparison
111 * For example, checking that the cairo version is greater than or equal
112 * to 1.0.0 could be achieved at compile-time or run-time as follows:
113 * #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 0, 0)
114 * printf ("Compiling with suitable cairo version: %s\n", CAIRO_VERSION_STRING);
115 * #endif
116 * if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 0, 0))
117 * printf ("Running with suitable cairo version: %s\n", cairo_version_string());
119 public class Version
132 * Returns the version of the cairo library encoded in a single
133 * integer as per CAIRO_VERSION_ENCODE. The encoding ensures that
134 * later versions compare greater than earlier versions.
135 * A run-time comparison to check that cairo's version is greater than
136 * or equal to version X.Y.Z could be performed as follows:
137 * if (cairo_version() >= CAIRO_VERSION_ENCODE(X,Y,Z)) {...}
138 * See also cairo_version_string() as well as the compile-time
139 * equivalents CAIRO_VERSION and CAIRO_VERSION_STRING.
140 * Returns:
141 * the encoded version.
143 public static int cairoVersion()
145 // int cairo_version (void);
146 return cairo_version();
150 * Returns the version of the cairo library as a human-readable string
151 * of the form "X.Y.Z".
152 * See also cairo_version() as well as the compile-time equivalents
153 * CAIRO_VERSION_STRING and CAIRO_VERSION.
154 * Returns:
155 * a string containing the version.
157 public static char[] cairoVersionString()
159 // const char* cairo_version_string (void);
160 return Str.toString(cairo_version_string() );