1
// Copyright (c) 2005, Niels Martin Hansen
2
// All rights reserved.
4
// Redistribution and use in source and binary forms, with or without
5
// modification, are permitted provided that the following conditions are met:
7
// * Redistributions of source code must retain the above copyright notice,
8
// this list of conditions and the following disclaimer.
9
// * Redistributions in binary form must reproduce the above copyright notice,
10
// this list of conditions and the following disclaimer in the documentation
11
// and/or other materials provided with the distribution.
12
// * Neither the name of the Aegisub Group nor the names of its contributors
13
// may be used to endorse or promote products derived from this software
14
// without specific prior written permission.
16
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
// POSSIBILITY OF SUCH DAMAGE.
28
// -----------------------------------------------------------------------------
32
// Website: http://aegisub.cellosoft.com
33
// Contact: mailto:jiifurusu@gmail.com
38
#include <wx/string.h>
39
#include <wx/datetime.h>
43
#include "../build/svn-revision.h"
46
#ifndef BUILD_SVN_REVISION
47
#define BUILD_SVN_REVISION 0
52
#define _T_rec(X) _T(X)
53
#define _T_stringize(X) _T(#X)
54
#define _T_int(X) _T_stringize(X)
56
#define BUILD_TIMESTAMP _T_rec(__DATE__) _T(" ") _T_rec(__TIME__)
58
// Define FINAL_RELEASE to mark a build as a "final" version, ie. not pre-release version
59
// In that case it won't include the SVN revision information
61
struct VersionInfoStruct {
63
wxChar *VersionNumber;
70
// Nice strings for display
71
wxString LongVersionString;
72
wxString ShortVersionString;
74
// Generate the above data
78
SvnRev = BUILD_SVN_REVISION;
81
BuildTime = _T_rec(BUILD_SVN_DATE);
83
BuildTime = BUILD_TIMESTAMP;
87
BuildCredit = _T(BUILD_CREDIT);
100
VersionNumber = _T("2.1.9");
103
VersionNumber = _T("r") _T_int(BUILD_SVN_REVISION)
104
# ifdef BUILD_SVN_LOCALMODS
112
// Short is used in about box
113
ShortVersionString = wxString::Format(_T("%s (built from SVN revision %d)"), VersionNumber, SvnRev);
114
// Long is used in title bar
115
LongVersionString = VersionNumber;
121
buildcred += _T(", "); buildcred += BuildCredit;
123
ShortVersionString = wxString::Format(_T("%s (development version%s)"), VersionNumber, buildcred.c_str());
124
LongVersionString = ShortVersionString;
129
ShortVersionString += _T(" [DEBUG VERSION]");
130
LongVersionString += _T(" [DEBUG VERSION]");
136
VersionInfoStruct versioninfo;
139
wxString GetAegisubLongVersionString() {
140
return versioninfo.LongVersionString;
143
wxString GetAegisubShortVersionString() {
144
return versioninfo.ShortVersionString;
147
wxString GetAegisubBuildTime() {
148
return versioninfo.BuildTime;
151
wxString GetAegisubBuildCredit() {
152
return versioninfo.BuildCredit;
155
bool GetIsOfficialRelease() {
156
return versioninfo.IsRelease;
159
wxString GetVersionNumber() {
160
return versioninfo.VersionNumber;
163
int GetSVNRevision() {
164
return versioninfo.SvnRev;