1 /*
2 * Authors:
3 * MenTaLguY <mental@rydia.net>
4 *
5 * Copyright (C) 2003 MenTaLguY
6 *
7 * Released under GNU GPL, read the file 'COPYING' for more information
8 */
10 #ifndef SEEN_INKSCAPE_VERSION_H
11 #define SEEN_INKSCAPE_VERSION_H
13 #include <glib/gtypes.h>
15 #define SVG_VERSION "1.1"
17 namespace Inkscape {
19 struct Version {
20 Version() {}
21 Version(unsigned mj, unsigned mn) {
22 // somebody pollutes our namespace with major() and minor()
23 // macros, so we can't use new-style initializers
24 major = mj;
25 minor = mn;
26 }
28 unsigned major;
29 unsigned minor;
31 bool operator>(Version const &other) const {
32 return major > other.major ||
33 ( major == other.major && minor > other.minor );
34 }
35 bool operator==(Version const &other) const {
36 return major == other.major && minor == other.minor;
37 }
38 bool operator!=(Version const &other) const {
39 return major != other.major || minor != other.minor;
40 }
41 bool operator<(Version const &other) const {
42 return major < other.major ||
43 ( major == other.major && minor < other.minor );
44 }
45 };
47 }
49 #define SP_VERSION_IS_ZERO (v) (!(v).major && !(v).minor)
51 gboolean sp_version_from_string (const gchar *string, Inkscape::Version *version);
52 gchar *sp_version_to_string (Inkscape::Version version);
53 gboolean sp_version_inside_range (Inkscape::Version version,
54 unsigned major_min, unsigned minor_min,
55 unsigned major_max, unsigned minor_max);
57 #endif