Code

add breton win32 installer translation
[inkscape.git] / src / version.h
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.0"
16 #define SODIPODI_VERSION "0.32"
18 namespace Inkscape {
20 struct Version {
21         Version() {}
22         Version(unsigned mj, unsigned mn) {
23                 // somebody pollutes our namespace with major() and minor()
24                 // macros, so we can't use new-style initializers
25                 major = mj;
26                 minor = mn;
27         }
29         unsigned major;
30         unsigned minor;
32         bool operator>(Version const &other) const {
33                 return major > other.major ||
34                        ( major == other.major && minor > other.minor );
35         }
36         bool operator==(Version const &other) const {
37                 return major == other.major && minor == other.minor;
38         }
39         bool operator!=(Version const &other) const {
40                 return major != other.major || minor != other.minor;
41         }
42         bool operator<(Version const &other) const {
43                 return major < other.major ||
44                        ( major == other.major && minor < other.minor );
45         }
46 };
48 }
50 #define SP_VERSION_IS_ZERO (v) (!(v).major && !(v).minor)
52 gboolean sp_version_from_string (const gchar *string, Inkscape::Version *version);
53 gchar *sp_version_to_string (Inkscape::Version version);
54 gboolean sp_version_inside_range (Inkscape::Version version,
55                                   unsigned major_min, unsigned minor_min,
56                                   unsigned major_max, unsigned minor_max);
58 #endif