|
Dave |
5a9475 |
#pragma once
|
|
Dave |
5a9475 |
|
|
Dave |
5a9475 |
#ifndef TVER_INCLUDED
|
|
Dave |
5a9475 |
#define TVER_INCLUDED
|
|
Dave |
5a9475 |
|
|
Dave |
5a9475 |
namespace TVER {
|
|
Dave |
5a9475 |
|
|
Dave |
5a9475 |
class ToonzVersion {
|
|
Dave |
5a9475 |
public:
|
|
Dave |
5a9475 |
std::string getAppName(void);
|
|
Dave |
5a9475 |
float getAppVersion(void);
|
|
Dave |
5a9475 |
float getAppRevision(void);
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
std::string getAppNote(void);
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
bool hasAppNote(void);
|
|
Dave |
5a9475 |
std::string getAppVersionString(void);
|
|
Dave |
5a9475 |
std::string getAppRevisionString(void);
|
|
Dave |
5a9475 |
std::string getAppVersionInfo(std::string msg);
|
|
Dave |
5a9475 |
|
|
Dave |
5a9475 |
private:
|
|
Dave |
5a9475 |
const char *applicationName = "OpenToonz";
|
|
shun-iwasawa |
3e9334 |
const float applicationVersion = 1.3;
|
|
shun-iwasawa |
3e9334 |
const float applicationRevision = 0;
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
const char *applicationNote = "";
|
|
Dave |
5a9475 |
};
|
|
Dave |
5a9475 |
|
|
Dave |
5a9475 |
std::string ToonzVersion::getAppName(void) {
|
|
Dave |
5a9475 |
std::string appname = applicationName;
|
|
Dave |
5a9475 |
return appname;
|
|
Dave |
5a9475 |
}
|
|
Dave |
5a9475 |
float ToonzVersion::getAppVersion(void) {
|
|
Dave |
5a9475 |
float appver = applicationVersion;
|
|
Dave |
5a9475 |
return appver;
|
|
Dave |
5a9475 |
}
|
|
Dave |
5a9475 |
float ToonzVersion::getAppRevision(void) {
|
|
Dave |
5a9475 |
float apprev = applicationRevision;
|
|
Dave |
5a9475 |
return apprev;
|
|
Dave |
5a9475 |
}
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
std::string ToonzVersion::getAppNote(void) {
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
std::string appnote = applicationNote;
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
return appnote;
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
}
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
bool ToonzVersion::hasAppNote(void) {
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
return *applicationNote != 0;
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
}
|
|
Dave |
5a9475 |
std::string ToonzVersion::getAppVersionString(void) {
|
|
Dave |
5a9475 |
char buffer[50];
|
|
Dave |
5a9475 |
sprintf(buffer, "%.1f", applicationVersion);
|
|
Dave |
5a9475 |
std::string appver = std::string(buffer);
|
|
Dave |
5a9475 |
return appver;
|
|
Dave |
5a9475 |
}
|
|
Dave |
5a9475 |
std::string ToonzVersion::getAppRevisionString(void) {
|
|
Dave |
5a9475 |
char buffer[50];
|
|
Dave |
5a9475 |
sprintf(buffer, "%g", applicationRevision);
|
|
Dave |
5a9475 |
std::string apprev = std::string(buffer);
|
|
Dave |
5a9475 |
return apprev;
|
|
Dave |
5a9475 |
}
|
|
Dave |
5a9475 |
std::string ToonzVersion::getAppVersionInfo(std::string msg) {
|
|
Dave |
5a9475 |
std::string appinfo = std::string(applicationName);
|
|
Dave |
5a9475 |
appinfo += " " + msg + " v";
|
|
Dave |
5a9475 |
appinfo += getAppVersionString();
|
|
Dave |
5a9475 |
appinfo += "." + getAppRevisionString();
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
if (hasAppNote())
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?d=retro&s=16) |
13b034 |
appinfo += " " + std::string(applicationNote);
|
|
Dave |
5a9475 |
return appinfo;
|
|
Dave |
5a9475 |
}
|
|
Dave |
5a9475 |
|
|
Dave |
5a9475 |
} // namespace TVER
|
|
Dave |
5a9475 |
|
|
Dave |
5a9475 |
#endif // TVER_INCLUDED
|