|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Tnz6 includes
|
|
justburner |
a66c51 |
#include "crashhandler.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "mainwindow.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "flipbook.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tapp.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "iocommand.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "previewfxmanager.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "cleanupsettingspopup.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "filebrowsermodel.h"
|
|
shun-iwasawa |
4a3868 |
#include "expressionreferencemanager.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzTools includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tools/tool.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tools/toolcommandids.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzQt includes
|
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/dvdialog.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/menubarcommand.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/tmessageviewer.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/icongenerator.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/gutil.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/pluginloader.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzStdfx includes
|
|
Toshihiro Shimizu |
890ddd |
#include "stdfx/shaderfx.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzLib includes
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/preferences.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/toonzfolders.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/tproject.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/studiopalette.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/stylemanager.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/tscenehandle.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/txshsimplelevel.h"
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
#include "toonz/tproject.h"
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
#include "toonz/scriptengine.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzSound includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tnzsound.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzImage includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tnzimage.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzBase includes
|
|
Toshihiro Shimizu |
890ddd |
#include "permissionsmanager.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tenv.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tcli.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzCore includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tsystem.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tthread.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tthreadmessage.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tundo.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tconvert.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tiio_std.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "timagecache.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tofflinegl.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tpluginmanager.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tsimplecolorstyles.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/imagestyles.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tvectorbrushstyle.h"
|
|
manongjohn |
b66bc4 |
#include "tfont.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
manongjohn |
c5bc8d |
#include "kis_tablet_support_win8.h"
|
|
manongjohn |
c5bc8d |
|
|
Toshihiro Shimizu |
890ddd |
#ifdef MACOSX
|
|
Toshihiro Shimizu |
890ddd |
#include "tipc.h"
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Qt includes
|
|
Toshihiro Shimizu |
890ddd |
#include <qapplication></qapplication>
|
|
tomosu |
9cb984 |
#include <qabstracteventdispatcher></qabstracteventdispatcher>
|
|
tomosu |
9cb984 |
#include <qabstractnativeeventfilter></qabstractnativeeventfilter>
|
|
Toshihiro Shimizu |
890ddd |
#include <qsplashscreen></qsplashscreen>
|
|
Toshihiro Shimizu |
890ddd |
#include <qglpixelbuffer></qglpixelbuffer>
|
|
Toshihiro Shimizu |
890ddd |
#include <qtranslator></qtranslator>
|
|
Toshihiro Shimizu |
890ddd |
#include <qfileinfo></qfileinfo>
|
|
Toshihiro Shimizu |
890ddd |
#include <qsettings></qsettings>
|
|
shun-iwasawa |
e87e08 |
#include <qlibraryinfo></qlibraryinfo>
|
|
shun-iwasawa |
e3b189 |
#include <qhash></qhash>
|
|
Toshihiro Shimizu |
890ddd |
|
|
manongjohn |
4cb9ab |
#ifdef _WIN32
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
32866c |
#ifndef x64
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
32866c |
#include <float.h></float.h>
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
32866c |
#endif
|
|
manongjohn |
4cb9ab |
#include <qtplatformheaders qwindowswindowfunctions=""></qtplatformheaders>
|
|
manongjohn |
4cb9ab |
#endif
|
|
manongjohn |
4cb9ab |
|
|
Toshihiro Shimizu |
890ddd |
using namespace DVGui;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TEnv::IntVar EnvSoftwareCurrentFontSize("SoftwareCurrentFontSize", 12);
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
e3b189 |
const char *rootVarName = "TOONZROOT";
|
|
shun-iwasawa |
e3b189 |
const char *systemVarPrefix = "TOONZ";
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifdef MACOSX
|
|
Toshihiro Shimizu |
890ddd |
#include "tthread.h"
|
|
Shinya Kitaoka |
120a6e |
void postThreadMsg(TThread::Message *) {}
|
|
Toshihiro Shimizu |
890ddd |
void qt_mac_set_menubar_merge(bool enable);
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Modifica per toonz (non servono questo tipo di licenze)
|
|
Toshihiro Shimizu |
890ddd |
#define NO_LICENSE
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
ccd505 |
static void fatalError(QString msg) {
|
|
Shinya Kitaoka |
120a6e |
DVGui::MsgBoxInPopup(
|
|
shun-iwasawa |
f39ea0 |
CRITICAL,
|
|
shun-iwasawa |
f39ea0 |
msg + "\n" +
|
|
shun-iwasawa |
f39ea0 |
QObject::tr("Installing %1 again could fix the problem.")
|
|
shun-iwasawa |
f39ea0 |
.arg(QString::fromStdString(TEnv::getApplicationFullName())));
|
|
Shinya Kitaoka |
120a6e |
exit(0);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
ccd505 |
static void lastWarningError(QString msg) {
|
|
Shinya Kitaoka |
120a6e |
DVGui::error(msg);
|
|
Shinya Kitaoka |
120a6e |
// exit(0);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Campbell Barton |
ccd505 |
static void toonzRunOutOfContMemHandler(unsigned long size) {
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Shinya Kitaoka |
120a6e |
static bool firstTime = true;
|
|
Shinya Kitaoka |
120a6e |
if (firstTime) {
|
|
Shinya Kitaoka |
120a6e |
MessageBox(NULL, (LPCWSTR)L"Run out of contiguous physical memory: please save all and restart Toonz!",
|
|
Toshihiro Shimizu |
890ddd |
(LPCWSTR)L"Warning", MB_OK | MB_SYSTEMMODAL);
|
|
Shinya Kitaoka |
120a6e |
firstTime = false;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// todo.. da mettere in qualche .h
|
|
Toshihiro Shimizu |
890ddd |
DV_IMPORT_API void initStdFx();
|
|
Toshihiro Shimizu |
890ddd |
DV_IMPORT_API void initColorFx();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! Inizializzaza l'Environment di Toonz
|
|
Toshihiro Shimizu |
890ddd |
/*! In particolare imposta la projectRoot e
|
|
Toshihiro Shimizu |
890ddd |
la stuffDir, controlla se la directory di outputs esiste (e provvede a
|
|
Toshihiro Shimizu |
890ddd |
crearla in caso contrario) verifica inoltre che stuffDir esista.
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
shun-iwasawa |
e3b189 |
static void initToonzEnv(QHash<qstring, qstring=""> &argPathValues) {</qstring,>
|
|
Shinya Kitaoka |
120a6e |
StudioPalette::enable(true);
|
|
Shinya Kitaoka |
120a6e |
TEnv::setRootVarName(rootVarName);
|
|
Shinya Kitaoka |
120a6e |
TEnv::setSystemVarPrefix(systemVarPrefix);
|
|
Shinya Kitaoka |
120a6e |
|
|
shun-iwasawa |
e3b189 |
QHash<qstring, qstring="">::const_iterator i = argPathValues.constBegin();</qstring,>
|
|
shun-iwasawa |
e3b189 |
while (i != argPathValues.constEnd()) {
|
|
shun-iwasawa |
e3b189 |
if (!TEnv::setArgPathValue(i.key().toStdString(), i.value().toStdString()))
|
|
shun-iwasawa |
e3b189 |
DVGui::error(
|
|
shun-iwasawa |
e3b189 |
QObject::tr("The qualifier %1 is not a valid key name. Skipping.")
|
|
shun-iwasawa |
e3b189 |
.arg(i.key()));
|
|
shun-iwasawa |
e3b189 |
++i;
|
|
shun-iwasawa |
e3b189 |
}
|
|
shun-iwasawa |
e3b189 |
|
|
Shinya Kitaoka |
120a6e |
QCoreApplication::setOrganizationName("OpenToonz");
|
|
Shinya Kitaoka |
120a6e |
QCoreApplication::setOrganizationDomain("");
|
|
shun-iwasawa |
f39ea0 |
QCoreApplication::setApplicationName(
|
|
shun-iwasawa |
45fcf4 |
QString::fromStdString(TEnv::getApplicationName()));
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*-- TOONZROOTのPathの確認 --*/
|
|
Shinya Kitaoka |
120a6e |
// controllo se la xxxroot e' definita e corrisponde ad un folder esistente
|
|
shun-iwasawa |
e87e08 |
|
|
shun-iwasawa |
e87e08 |
/*-- ENGLISH: Confirm TOONZROOT Path
|
|
shun-iwasawa |
e87e08 |
Check if the xxxroot is defined and corresponds to an existing folder
|
|
cclark25 |
fcb9e4 |
--*/
|
|
shun-iwasawa |
e87e08 |
|
|
Shinya Kitaoka |
120a6e |
TFilePath stuffDir = TEnv::getStuffDir();
|
|
cclark25 |
fcb9e4 |
if (stuffDir == TFilePath())
|
|
shun-iwasawa |
e87e08 |
fatalError("Undefined or empty: \"" + toQString(TEnv::getRootVarPath()) +
|
|
shun-iwasawa |
e87e08 |
"\"");
|
|
cclark25 |
fcb9e4 |
else if (!TFileStatus(stuffDir).isDirectory())
|
|
shun-iwasawa |
e87e08 |
fatalError("Folder \"" + toQString(stuffDir) +
|
|
shun-iwasawa |
e87e08 |
"\" not found or not readable");
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
Tiio::defineStd();
|
|
Shinya Kitaoka |
120a6e |
initImageIo();
|
|
Shinya Kitaoka |
120a6e |
initSoundIo();
|
|
Shinya Kitaoka |
120a6e |
initStdFx();
|
|
Shinya Kitaoka |
120a6e |
initColorFx();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// TPluginManager::instance()->loadStandardPlugins();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TFilePath library = ToonzFolder::getLibraryFolder();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TRasterImagePatternStrokeStyle::setRootDir(library);
|
|
Shinya Kitaoka |
120a6e |
TVectorImagePatternStrokeStyle::setRootDir(library);
|
|
Shinya Kitaoka |
120a6e |
TVectorBrushStyle::setRootDir(library);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
CustomStyleManager::setRootPath(library);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// sembra indispensabile nella lettura dei .tab 2.2:
|
|
Shinya Kitaoka |
120a6e |
TPalette::setRootDir(library);
|
|
Shinya Kitaoka |
120a6e |
TImageStyle::setLibraryDir(library);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// TProjectManager::instance()->enableTabMode(true);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TProjectManager *projectManager = TProjectManager::instance();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*--
|
|
Shinya Kitaoka |
120a6e |
* TOONZPROJECTSのパスセットを取得する。(TOONZPROJECTSはセミコロンで区切って複数設定可能)
|
|
Shinya Kitaoka |
120a6e |
* --*/
|
|
Shinya Kitaoka |
120a6e |
TFilePathSet projectsRoots = ToonzFolder::getProjectsFolders();
|
|
Shinya Kitaoka |
120a6e |
TFilePathSet::iterator it;
|
|
Shinya Kitaoka |
120a6e |
for (it = projectsRoots.begin(); it != projectsRoots.end(); ++it)
|
|
Shinya Kitaoka |
120a6e |
projectManager->addProjectsRoot(*it);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*-- もしまだ無ければ、TOONZROOT/sandboxにsandboxプロジェクトを作る --*/
|
|
Shinya Kitaoka |
120a6e |
projectManager->createSandboxIfNeeded();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*
|
|
Shinya Kitaoka |
120a6e |
TProjectP project = projectManager->getCurrentProject();
|
|
Shinya Kitaoka |
120a6e |
Non dovrebbe servire per Tab:
|
|
Shinya Kitaoka |
120a6e |
project->setFolder(TProject::Drawings, TFilePath("$scenepath"));
|
|
Shinya Kitaoka |
120a6e |
project->setFolder(TProject::Extras, TFilePath("$scenepath"));
|
|
Shinya Kitaoka |
120a6e |
project->setUseScenePath(TProject::Drawings, false);
|
|
Shinya Kitaoka |
120a6e |
project->setUseScenePath(TProject::Extras, false);
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Shinya Kitaoka |
120a6e |
// Imposto la rootDir per ImageCache
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
/*-- TOONZCACHEROOTの設定 --*/
|
|
shun-iwasawa |
c54dfb |
TFilePath cacheDir = ToonzFolder::getCacheRootFolder();
|
|
Shinya Kitaoka |
120a6e |
if (cacheDir.isEmpty()) cacheDir = TEnv::getStuffDir() + "cache";
|
|
Shinya Kitaoka |
120a6e |
TImageCache::instance()->setRootDir(cacheDir);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
static void script_output(int type, const QString &value) {
|
|
shun-iwasawa |
20109a |
if (type == ScriptEngine::ExecutionError ||
|
|
shun-iwasawa |
20109a |
type == ScriptEngine::SyntaxError ||
|
|
shun-iwasawa |
20109a |
type == ScriptEngine::UndefinedEvaluationResult ||
|
|
shun-iwasawa |
20109a |
type == ScriptEngine::Warning)
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
std::cerr << value.toStdString() << std::endl;
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
else
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
std::cout << value.toStdString() << std::endl;
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
}
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
//-----------------------------------------------------------------------------
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
|
|
Shinya Kitaoka |
120a6e |
int main(int argc, char *argv[]) {
|
|
kusano |
52db95 |
#ifdef Q_OS_WIN
|
|
justburner |
a66c51 |
// Enable standard input/output on Windows Platform for debug
|
|
justburner |
a66c51 |
if (::AttachConsole(ATTACH_PARENT_PROCESS)) {
|
|
Shinya Kitaoka |
120a6e |
freopen("CON", "r", stdin);
|
|
Shinya Kitaoka |
120a6e |
freopen("CON", "w", stdout);
|
|
Shinya Kitaoka |
120a6e |
freopen("CON", "w", stderr);
|
|
justburner |
a66c51 |
atexit([]() {
|
|
justburner |
a66c51 |
::FreeConsole();
|
|
justburner |
a66c51 |
});
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
justburner |
a66c51 |
// Install signal handlers to catch crashes
|
|
justburner |
a66c51 |
CrashHandler::install();
|
|
justburner |
a66c51 |
|
|
shun-iwasawa |
e3b189 |
// parsing arguments and qualifiers
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
TFilePath loadFilePath;
|
|
shun-iwasawa |
e3b189 |
QString argumentLayoutFileName = "";
|
|
shun-iwasawa |
e3b189 |
QHash<qstring, qstring=""> argumentPathValues;</qstring,>
|
|
Shinya Kitaoka |
120a6e |
if (argc > 1) {
|
|
shun-iwasawa |
e3b189 |
TCli::Usage usage(argv[0]);
|
|
shun-iwasawa |
e3b189 |
TCli::UsageLine usageLine;
|
|
shun-iwasawa |
20109a |
TCli::FilePathArgument loadFileArg(
|
|
shun-iwasawa |
20109a |
"filePath", "Source scene file to open or script file to run");
|
|
shun-iwasawa |
e3b189 |
TCli::StringQualifier layoutFileQual(
|
|
shun-iwasawa |
e3b189 |
"-layout filename",
|
|
shun-iwasawa |
e3b189 |
"Custom layout file to be used, it should be saved in "
|
|
shun-iwasawa |
e3b189 |
"$TOONZPROFILES\\layouts\\personal\\[CurrentLayoutName].[UserName]\\. "
|
|
shun-iwasawa |
e3b189 |
"layouts.txt is used by default.");
|
|
shun-iwasawa |
e3b189 |
usageLine = usageLine + layoutFileQual;
|
|
shun-iwasawa |
e3b189 |
|
|
shun-iwasawa |
e3b189 |
// system path qualifiers
|
|
shun-iwasawa |
e3b189 |
std::map<qstring, std::unique_ptr<tcli::qualifiert<tfilepath="">>></qstring,>
|
|
shun-iwasawa |
e3b189 |
systemPathQualMap;
|
|
shun-iwasawa |
e3b189 |
QString qualKey = QString("%1ROOT").arg(systemVarPrefix);
|
|
shun-iwasawa |
e3b189 |
QString qualName = QString("-%1 folderpath").arg(qualKey);
|
|
shun-iwasawa |
e3b189 |
QString qualHelp =
|
|
shun-iwasawa |
e3b189 |
QString(
|
|
shun-iwasawa |
e3b189 |
"%1 path. It will automatically set other system paths to %1 "
|
|
shun-iwasawa |
e3b189 |
"unless individually specified with other qualifiers.")
|
|
shun-iwasawa |
e3b189 |
.arg(qualKey);
|
|
shun-iwasawa |
e3b189 |
systemPathQualMap[qualKey].reset(new TCli::QualifierT<tfilepath>(</tfilepath>
|
|
shun-iwasawa |
e3b189 |
qualName.toStdString(), qualHelp.toStdString()));
|
|
shun-iwasawa |
e3b189 |
usageLine = usageLine + *systemPathQualMap[qualKey];
|
|
shun-iwasawa |
e3b189 |
|
|
shun-iwasawa |
e3b189 |
const std::map<std::string, std::string=""> &spm = TEnv::getSystemPathMap();</std::string,>
|
|
shun-iwasawa |
e3b189 |
for (auto itr = spm.begin(); itr != spm.end(); ++itr) {
|
|
shun-iwasawa |
e3b189 |
qualKey = QString("%1%2")
|
|
shun-iwasawa |
e3b189 |
.arg(systemVarPrefix)
|
|
shun-iwasawa |
e3b189 |
.arg(QString::fromStdString((*itr).first));
|
|
shun-iwasawa |
e3b189 |
qualName = QString("-%1 folderpath").arg(qualKey);
|
|
shun-iwasawa |
e3b189 |
qualHelp = QString("%1 path.").arg(qualKey);
|
|
shun-iwasawa |
e3b189 |
systemPathQualMap[qualKey].reset(new TCli::QualifierT<tfilepath>(</tfilepath>
|
|
shun-iwasawa |
e3b189 |
qualName.toStdString(), qualHelp.toStdString()));
|
|
shun-iwasawa |
e3b189 |
usageLine = usageLine + *systemPathQualMap[qualKey];
|
|
shun-iwasawa |
e3b189 |
}
|
|
shun-iwasawa |
e3b189 |
usage.add(usageLine);
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
usage.add(usageLine + loadFileArg);
|
|
shun-iwasawa |
e3b189 |
|
|
shun-iwasawa |
e3b189 |
if (!usage.parse(argc, argv)) exit(1);
|
|
shun-iwasawa |
e3b189 |
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
loadFilePath = loadFileArg.getValue();
|
|
shun-iwasawa |
e3b189 |
if (layoutFileQual.isSelected())
|
|
shun-iwasawa |
e3b189 |
argumentLayoutFileName =
|
|
shun-iwasawa |
e3b189 |
QString::fromStdString(layoutFileQual.getValue());
|
|
shun-iwasawa |
e3b189 |
for (auto q_itr = systemPathQualMap.begin();
|
|
shun-iwasawa |
e3b189 |
q_itr != systemPathQualMap.end(); ++q_itr) {
|
|
shun-iwasawa |
e3b189 |
if (q_itr->second->isSelected())
|
|
shun-iwasawa |
e3b189 |
argumentPathValues.insert(q_itr->first,
|
|
shun-iwasawa |
e3b189 |
q_itr->second->getValue().getQString());
|
|
Shinya Kitaoka |
120a6e |
}
|
|
shun-iwasawa |
5d6c4b |
|
|
shun-iwasawa |
5d6c4b |
argc = 1;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
shun_iwasawa |
f8d751 |
// Enables high-DPI scaling. This attribute must be set before QApplication is
|
|
shun_iwasawa |
f8d751 |
// constructed. Available from Qt 5.6.
|
|
shun_iwasawa |
f8d751 |
#if QT_VERSION >= 0x050600
|
|
shun_iwasawa |
f8d751 |
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
shun_iwasawa |
f8d751 |
#endif
|
|
shun_iwasawa |
7c988d |
|
|
Shinya Kitaoka |
120a6e |
QApplication a(argc, argv);
|
|
Toshihiro Shimizu |
890ddd |
|
|
tomosu |
9cb984 |
#ifdef MACOSX
|
|
shun-iwasawa |
c54dfb |
// This workaround is to avoid missing left button problem on Qt5.6.0.
|
|
shun-iwasawa |
c54dfb |
// To invalidate m_rightButtonClicked in Qt/qnsview.mm, sending
|
|
shun-iwasawa |
c54dfb |
// NSLeftButtonDown event before NSLeftMouseDragged event propagated to
|
|
shun-iwasawa |
c54dfb |
// QApplication. See more details in ../mousedragfilter/mousedragfilter.mm.
|
|
tomosu |
9cb984 |
|
|
tomosu |
9cb984 |
#include "mousedragfilter.h"
|
|
tomosu |
9cb984 |
|
|
tomosu |
9cb984 |
class OSXMouseDragFilter final : public QAbstractNativeEventFilter {
|
|
tomosu |
9cb984 |
bool leftButtonPressed = false;
|
|
tomosu |
9cb984 |
|
|
tomosu |
9cb984 |
public:
|
|
tomosu |
9cb984 |
bool nativeEventFilter(const QByteArray &eventType, void *message,
|
|
tomosu |
9cb984 |
long *) Q_DECL_OVERRIDE {
|
|
tomosu |
9cb984 |
if (IsLeftMouseDown(message)) {
|
|
tomosu |
9cb984 |
leftButtonPressed = true;
|
|
tomosu |
9cb984 |
}
|
|
tomosu |
9cb984 |
if (IsLeftMouseUp(message)) {
|
|
tomosu |
9cb984 |
leftButtonPressed = false;
|
|
tomosu |
9cb984 |
}
|
|
tomosu |
9cb984 |
|
|
tomosu |
9cb984 |
if (eventType == "mac_generic_NSEvent") {
|
|
tomosu |
9cb984 |
if (IsLeftMouseDragged(message) && !leftButtonPressed) {
|
|
tomosu |
9cb984 |
std::cout << "force mouse press event" << std::endl;
|
|
tomosu |
9cb984 |
SendLeftMousePressEvent();
|
|
tomosu |
9cb984 |
return true;
|
|
tomosu |
9cb984 |
}
|
|
tomosu |
9cb984 |
}
|
|
tomosu |
9cb984 |
return false;
|
|
tomosu |
9cb984 |
}
|
|
tomosu |
9cb984 |
};
|
|
tomosu |
9cb984 |
|
|
tomosu |
9cb984 |
a.installNativeEventFilter(new OSXMouseDragFilter);
|
|
tomosu |
9cb984 |
#endif
|
|
tomosu |
9cb984 |
|
|
kusano |
52db95 |
#ifdef Q_OS_WIN
|
|
Shinya Kitaoka |
120a6e |
// Since currently OpenToonz does not work with OpenGL of software or
|
|
shun-iwasawa |
19cec1 |
// angle, force Qt to use desktop OpenGL
|
|
shun-iwasawa |
19cec1 |
// FIXME: This options should be called before constructing the application.
|
|
shun-iwasawa |
19cec1 |
// Thus, ANGLE seems to be enabled as of now.
|
|
Shinya Kitaoka |
120a6e |
a.setAttribute(Qt::AA_UseDesktopOpenGL, true);
|
|
kusano |
52db95 |
#endif
|
|
kusano |
52db95 |
|
|
luz paz |
6454c4 |
// Some Qt objects are destroyed badly without a living qApp. So, we must
|
|
Shinya Kitaoka |
120a6e |
// enforce a way to either
|
|
Shinya Kitaoka |
120a6e |
// postpone the application destruction until the very end, OR ensure that
|
|
Shinya Kitaoka |
120a6e |
// sensible objects are
|
|
Shinya Kitaoka |
120a6e |
// destroyed before.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Using a static QApplication only worked on Windows, and in any case C++
|
|
Shinya Kitaoka |
120a6e |
// respects the statics destruction
|
|
Shinya Kitaoka |
120a6e |
// order ONLY within the same library. On MAC, it made the app crash on exit
|
|
Shinya Kitaoka |
120a6e |
// o_o. So, nope.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
2a7129 |
std::unique_ptr<qobject> mainScope(new QObject(</qobject>
|
|
Shinya Kitaoka |
120a6e |
&a)); // A QObject destroyed before the qApp is therefore explicitly
|
|
Shinya Kitaoka |
120a6e |
mainScope->setObjectName("mainScope"); // provided. It can be accessed by
|
|
Shinya Kitaoka |
120a6e |
// looking in the qApp's children.
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
#ifndef x64
|
|
Shinya Kitaoka |
120a6e |
// Store the floating point control word. It will be re-set before Toonz
|
|
Shinya Kitaoka |
120a6e |
// initialization
|
|
Shinya Kitaoka |
120a6e |
// has ended.
|
|
Shinya Kitaoka |
120a6e |
unsigned int fpWord = 0;
|
|
Shinya Kitaoka |
120a6e |
_controlfp_s(&fpWord, 0, 0);
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Shinya Kitaoka |
120a6e |
// At least on windows, Qt's 4.5.2 native windows feature tend to create
|
|
Shinya Kitaoka |
120a6e |
// weird flickering effects when dragging panel separators.
|
|
Shinya Kitaoka |
120a6e |
a.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
shun_iwasawa |
7c988d |
|
|
shun_iwasawa |
380732 |
// Enable to render smooth icons on high dpi monitors
|
|
shun_iwasawa |
380732 |
a.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|
shun-iwasawa |
d75cc4 |
#if defined(_WIN32) && QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
|
shun-iwasawa |
d75cc4 |
// Compress tablet events with application attributes instead of implementing
|
|
shun-iwasawa |
d75cc4 |
// the delay-timer by ourselves
|
|
shun-iwasawa |
d75cc4 |
a.setAttribute(Qt::AA_CompressHighFrequencyEvents);
|
|
shun-iwasawa |
d75cc4 |
a.setAttribute(Qt::AA_CompressTabletEvents);
|
|
shun-iwasawa |
d75cc4 |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
d9989e |
#ifdef _WIN32
|
|
shun-iwasawa |
d9989e |
// This attribute is set to make menubar icon to be always (16 x devPixRatio).
|
|
shun-iwasawa |
d9989e |
// Without this attribute the menu bar icon size becomes the same as tool bar
|
|
shun-iwasawa |
d9989e |
// when Windows scale is in 125%. Currently hiding the menu bar icon is done
|
|
shun-iwasawa |
d9989e |
// by setting transparent pixmap only in menu bar icon size. So the size must
|
|
shun-iwasawa |
d9989e |
// be different between for menu bar and for tool bar.
|
|
shun-iwasawa |
d9989e |
a.setAttribute(Qt::AA_Use96Dpi);
|
|
shun-iwasawa |
d9989e |
#endif
|
|
shun-iwasawa |
d9989e |
|
|
Shinya Kitaoka |
120a6e |
// Set the app's locale for numeric stuff to standard C. This is important for
|
|
Shinya Kitaoka |
120a6e |
// atof() and similar
|
|
luz paz |
6454c4 |
// calls that are locale-dependent.
|
|
Shinya Kitaoka |
120a6e |
setlocale(LC_NUMERIC, "C");
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Set current directory to the bundle/application path - this is needed to have
|
|
Shinya Kitaoka |
120a6e |
// correct relative paths
|
|
Toshihiro Shimizu |
890ddd |
#ifdef MACOSX
|
|
Shinya Kitaoka |
120a6e |
{
|
|
Shinya Kitaoka |
120a6e |
QDir appDir(QApplication::applicationDirPath());
|
|
Shinya Kitaoka |
120a6e |
appDir.cdUp(), appDir.cdUp(), appDir.cdUp();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
bool ret = QDir::setCurrent(appDir.absolutePath());
|
|
Shinya Kitaoka |
120a6e |
assert(ret);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Kite |
521c84 |
// Set icon theme search paths
|
|
Kite |
521c84 |
QStringList themeSearchPathsList = {":/icons"};
|
|
Kite |
521c84 |
QIcon::setThemeSearchPaths(themeSearchPathsList);
|
|
Kite |
521c84 |
// qDebug() << "All icon theme search paths:" << QIcon::themeSearchPaths();
|
|
Kite |
521c84 |
|
|
Kite |
521c84 |
// Set show icons in menus flag (use iconVisibleInMenu to disable selectively)
|
|
Kite |
521c84 |
QApplication::instance()->setAttribute(Qt::AA_DontShowIconsInMenus, false);
|
|
Kite |
521c84 |
|
|
manongjohn |
e4c3c8 |
TEnv::setApplicationFileName(argv[0]);
|
|
manongjohn |
e4c3c8 |
|
|
Shinya Kitaoka |
120a6e |
// splash screen
|
|
shun_iwasawa |
4a5f42 |
QPixmap splashPixmap = QIcon(":Resources/splash.svg").pixmap(QSize(610, 344));
|
|
shun-iwasawa |
f2e168 |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Jeremy Bullock |
807052 |
QFont font("Segoe UI", -1);
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
shun_iwasawa |
01e417 |
QFont font("Helvetica", -1);
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
shun_iwasawa |
01e417 |
font.setPixelSize(13);
|
|
Jeremy Bullock |
807052 |
font.setWeight(50);
|
|
shun_iwasawa |
01e417 |
a.setFont(font);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QString offsetStr("\n\n\n\n\n\n\n\n");
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TSystem::hasMainLoop(true);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TMessageRepository::instance();
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
20109a |
bool isRunScript = (loadFilePath.getType() == "toonzscript");
|
|
shun-iwasawa |
20109a |
|
|
Shinya Kitaoka |
120a6e |
QSplashScreen splash(splashPixmap);
|
|
shun-iwasawa |
20109a |
if (!isRunScript) splash.show();
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(offsetStr + "Initializing QGLFormat...", Qt::AlignCenter,
|
|
Shinya Kitaoka |
120a6e |
Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// OpenGL
|
|
Shinya Kitaoka |
120a6e |
QGLFormat fmt;
|
|
Shinya Kitaoka |
120a6e |
fmt.setAlpha(true);
|
|
Shinya Kitaoka |
120a6e |
fmt.setStencil(true);
|
|
Shinya Kitaoka |
120a6e |
QGLFormat::setDefaultFormat(fmt);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
glutInit(&argc, argv);
|
|
Campbell Barton |
07f3e8 |
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(offsetStr + "Initializing Toonz environment ...",
|
|
Shinya Kitaoka |
120a6e |
Qt::AlignCenter, Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// Install run out of contiguous memory callback
|
|
Shinya Kitaoka |
120a6e |
TBigMemoryManager::instance()->setRunOutOfContiguousMemoryHandler(
|
|
Shinya Kitaoka |
120a6e |
&toonzRunOutOfContMemHandler);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// Toonz environment
|
|
shun-iwasawa |
e3b189 |
initToonzEnv(argumentPathValues);
|
|
Shinya Kitaoka |
120a6e |
|
|
shun-iwasawa |
215a5b |
// prepare for 30bit display
|
|
shun-iwasawa |
215a5b |
if (Preferences::instance()->is30bitDisplayEnabled()) {
|
|
shun-iwasawa |
215a5b |
QSurfaceFormat sFmt = QSurfaceFormat::defaultFormat();
|
|
shun-iwasawa |
215a5b |
sFmt.setRedBufferSize(10);
|
|
shun-iwasawa |
215a5b |
sFmt.setGreenBufferSize(10);
|
|
shun-iwasawa |
215a5b |
sFmt.setBlueBufferSize(10);
|
|
shun-iwasawa |
215a5b |
sFmt.setAlphaBufferSize(2);
|
|
shun-iwasawa |
215a5b |
QSurfaceFormat::setDefaultFormat(sFmt);
|
|
shun-iwasawa |
215a5b |
}
|
|
shun-iwasawa |
215a5b |
|
|
Shinya Kitaoka |
120a6e |
// Initialize thread components
|
|
Shinya Kitaoka |
120a6e |
TThread::init();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TProjectManager *projectManager = TProjectManager::instance();
|
|
Shinya Kitaoka |
120a6e |
if (Preferences::instance()->isSVNEnabled()) {
|
|
Shinya Kitaoka |
120a6e |
// Read Version Control repositories and add it to project manager as
|
|
Shinya Kitaoka |
120a6e |
// "special" svn project root
|
|
Shinya Kitaoka |
120a6e |
VersionControl::instance()->init();
|
|
Shinya Kitaoka |
120a6e |
QList<svnrepository> repositories =</svnrepository>
|
|
Shinya Kitaoka |
120a6e |
VersionControl::instance()->getRepositories();
|
|
Shinya Kitaoka |
120a6e |
int count = repositories.size();
|
|
Shinya Kitaoka |
120a6e |
for (int i = 0; i < count; i++) {
|
|
Shinya Kitaoka |
120a6e |
SVNRepository r = repositories.at(i);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TFilePath localPath(r.m_localPath.toStdWString());
|
|
Shinya Kitaoka |
120a6e |
if (!TFileStatus(localPath).doesExist()) {
|
|
Shinya Kitaoka |
120a6e |
try {
|
|
Shinya Kitaoka |
120a6e |
TSystem::mkDir(localPath);
|
|
Shinya Kitaoka |
120a6e |
} catch (TException &e) {
|
|
Shinya Kitaoka |
120a6e |
fatalError(QString::fromStdWString(e.getMessage()));
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
projectManager->addSVNProjectsRoot(localPath);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#if defined(MACOSX) && defined(__LP64__)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Load the shared memory settings
|
|
Shinya Kitaoka |
120a6e |
int shmmax = Preferences::instance()->getShmMax();
|
|
Shinya Kitaoka |
120a6e |
int shmseg = Preferences::instance()->getShmSeg();
|
|
Shinya Kitaoka |
120a6e |
int shmall = Preferences::instance()->getShmAll();
|
|
Shinya Kitaoka |
120a6e |
int shmmni = Preferences::instance()->getShmMni();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
if (shmall <
|
|
Shinya Kitaoka |
120a6e |
0) // Make sure that at least 100 MB of shared memory are available
|
|
Shinya Kitaoka |
120a6e |
shmall = (tipc::shm_maxSharedPages() < (100 << 8)) ? (100 << 8) : -1;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
tipc::shm_set(shmmax, shmseg, shmall, shmmni);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// DVDirModel must be instantiated after Version Control initialization...
|
|
Shinya Kitaoka |
120a6e |
FolderListenerManager::instance()->addListener(DvDirModel::instance());
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(offsetStr + "Loading Translator ...", Qt::AlignCenter,
|
|
Shinya Kitaoka |
120a6e |
Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Carico la traduzione contenuta in toonz.qm (se � presente)
|
|
Shinya Kitaoka |
120a6e |
QString languagePathString =
|
|
Shinya Kitaoka |
120a6e |
QString::fromStdString(::to_string(TEnv::getConfigDir() + "loc"));
|
|
Campbell Barton |
07f3e8 |
#ifndef WIN32
|
|
Shinya Kitaoka |
120a6e |
// the merge of menu on osx can cause problems with different languages with
|
|
Shinya Kitaoka |
120a6e |
// the Preferences menu
|
|
Shinya Kitaoka |
120a6e |
// qt_mac_set_menubar_merge(false);
|
|
Shinya Kitaoka |
120a6e |
languagePathString += "/" + Preferences::instance()->getCurrentLanguage();
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Shinya Kitaoka |
120a6e |
languagePathString += "\\" + Preferences::instance()->getCurrentLanguage();
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Shinya Kitaoka |
120a6e |
QTranslator translator;
|
|
Shinya Kitaoka |
120a6e |
translator.load("toonz", languagePathString);
|
|
Shinya Kitaoka |
1660e0 |
|
|
Shinya Kitaoka |
120a6e |
// La installo
|
|
Shinya Kitaoka |
120a6e |
a.installTranslator(&translator);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Carico la traduzione contenuta in toonzqt.qm (se e' presente)
|
|
Shinya Kitaoka |
120a6e |
QTranslator translator2;
|
|
Shinya Kitaoka |
120a6e |
translator2.load("toonzqt", languagePathString);
|
|
Shinya Kitaoka |
120a6e |
a.installTranslator(&translator2);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Carico la traduzione contenuta in tnzcore.qm (se e' presente)
|
|
Shinya Kitaoka |
120a6e |
QTranslator tnzcoreTranslator;
|
|
Shinya Kitaoka |
120a6e |
tnzcoreTranslator.load("tnzcore", languagePathString);
|
|
Shinya Kitaoka |
120a6e |
qApp->installTranslator(&tnzcoreTranslator);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Carico la traduzione contenuta in toonzlib.qm (se e' presente)
|
|
Shinya Kitaoka |
120a6e |
QTranslator toonzlibTranslator;
|
|
Shinya Kitaoka |
120a6e |
toonzlibTranslator.load("toonzlib", languagePathString);
|
|
Shinya Kitaoka |
120a6e |
qApp->installTranslator(&toonzlibTranslator);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Carico la traduzione contenuta in colorfx.qm (se e' presente)
|
|
Shinya Kitaoka |
120a6e |
QTranslator colorfxTranslator;
|
|
Shinya Kitaoka |
120a6e |
colorfxTranslator.load("colorfx", languagePathString);
|
|
Shinya Kitaoka |
120a6e |
qApp->installTranslator(&colorfxTranslator);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Carico la traduzione contenuta in tools.qm
|
|
Shinya Kitaoka |
120a6e |
QTranslator toolTranslator;
|
|
Shinya Kitaoka |
120a6e |
toolTranslator.load("tnztools", languagePathString);
|
|
Shinya Kitaoka |
120a6e |
qApp->installTranslator(&toolTranslator);
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
e87e08 |
// load translation for file writers properties
|
|
shun-iwasawa |
e87e08 |
QTranslator imageTranslator;
|
|
shun-iwasawa |
e87e08 |
imageTranslator.load("image", languagePathString);
|
|
shun-iwasawa |
e87e08 |
qApp->installTranslator(&imageTranslator);
|
|
shun-iwasawa |
e87e08 |
|
|
shun-iwasawa |
e87e08 |
QTranslator qtTranslator;
|
|
shun-iwasawa |
e87e08 |
qtTranslator.load("qt_" + QLocale::system().name(),
|
|
shun-iwasawa |
e87e08 |
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
|
shun-iwasawa |
e87e08 |
a.installTranslator(&qtTranslator);
|
|
shun-iwasawa |
e87e08 |
|
|
Shinya Kitaoka |
120a6e |
// Aggiorno la traduzione delle properties di tutti i tools
|
|
Shinya Kitaoka |
120a6e |
TTool::updateToolsPropertiesTranslation();
|
|
shun-iwasawa |
e87e08 |
// Apply translation to file writers properties
|
|
shun-iwasawa |
e87e08 |
Tiio::updateFileWritersPropertiesTranslation();
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
219f54 |
// Force to have left-to-right layout direction in any language environment.
|
|
Spekular |
a6afe7 |
// This function has to be called after installTranslator().
|
|
shun-iwasawa |
219f54 |
a.setLayoutDirection(Qt::LeftToRight);
|
|
shun-iwasawa |
219f54 |
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(offsetStr + "Loading styles ...", Qt::AlignCenter,
|
|
Shinya Kitaoka |
120a6e |
Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Kite |
521c84 |
// Set default start icon theme
|
|
Kite |
521c84 |
QIcon::setThemeName(Preferences::instance()->getIconTheme() ? "dark"
|
|
Kite |
521c84 |
: "light");
|
|
Kite |
521c84 |
// qDebug() << "Icon theme name:" << QIcon::themeName();
|
|
Kite |
521c84 |
|
|
Shinya Kitaoka |
120a6e |
// stile
|
|
Shinya Kitaoka |
120a6e |
QApplication::setStyle("windows");
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
IconGenerator::setFilmstripIconSize(Preferences::instance()->getIconSize());
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(offsetStr + "Loading shaders ...", Qt::AlignCenter,
|
|
Shinya Kitaoka |
120a6e |
Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
loadShaderInterfaces(ToonzFolder::getLibraryFolder() + TFilePath("shaders"));
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun_iwasawa |
5e0d4f |
splash.showMessage(offsetStr + "Initializing OpenToonz ...", Qt::AlignCenter,
|
|
shun_iwasawa |
5e0d4f |
Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TTool::setApplication(TApp::instance());
|
|
Shinya Kitaoka |
120a6e |
TApp::instance()->init();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(offsetStr + "Loading Plugins...", Qt::AlignCenter,
|
|
Shinya Kitaoka |
120a6e |
Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Shinya Kitaoka |
120a6e |
/* poll the thread ends:
|
|
Shinya Kitaoka |
120a6e |
絶対に必要なわけではないが PluginLoader は中で setup
|
|
Shinya Kitaoka |
120a6e |
ハンドラが常に固有のスレッドで呼ばれるよう main thread queue の blocking
|
|
Shinya Kitaoka |
120a6e |
をしているので
|
|
Shinya Kitaoka |
120a6e |
processEvents を行う必要がある
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
while (!PluginLoader::load_entries("")) {
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(offsetStr + "Creating main window ...", Qt::AlignCenter,
|
|
Shinya Kitaoka |
120a6e |
Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
/*-- Layoutファイル名をMainWindowのctorに渡す --*/
|
|
Shinya Kitaoka |
120a6e |
MainWindow w(argumentLayoutFileName);
|
|
justburner |
bc2c3b |
CrashHandler::attachParentWindow(&w);
|
|
justburner |
bc2c3b |
CrashHandler::reportProjectInfo(true);
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
20109a |
if (isRunScript) {
|
|
shun-iwasawa |
20109a |
// load script
|
|
shun-iwasawa |
20109a |
if (TFileStatus(loadFilePath).doesExist()) {
|
|
shun-iwasawa |
20109a |
// find project for this script file
|
|
shun-iwasawa |
20109a |
TProjectManager *pm = TProjectManager::instance();
|
|
shun-iwasawa |
20109a |
TProjectP sceneProject = pm->loadSceneProject(loadFilePath);
|
|
shun-iwasawa |
20109a |
TFilePath oldProjectPath;
|
|
shun-iwasawa |
20109a |
if (!sceneProject) {
|
|
shun-iwasawa |
20109a |
std::cerr << QObject::tr(
|
|
shun-iwasawa |
20109a |
"It is not possible to load the scene %1 because it "
|
|
shun-iwasawa |
20109a |
"does not "
|
|
shun-iwasawa |
20109a |
"belong to any project.")
|
|
shun-iwasawa |
20109a |
.arg(loadFilePath.getQString())
|
|
shun-iwasawa |
20109a |
.toStdString()
|
|
shun-iwasawa |
20109a |
<< std::endl;
|
|
shun-iwasawa |
20109a |
return 1;
|
|
shun-iwasawa |
20109a |
}
|
|
shun-iwasawa |
20109a |
if (sceneProject && !sceneProject->isCurrent()) {
|
|
shun-iwasawa |
20109a |
oldProjectPath = pm->getCurrentProjectPath();
|
|
shun-iwasawa |
20109a |
pm->setCurrentProjectPath(sceneProject->getProjectPath());
|
|
shun-iwasawa |
20109a |
}
|
|
shun-iwasawa |
20109a |
ScriptEngine engine;
|
|
shun-iwasawa |
20109a |
QObject::connect(&engine, &ScriptEngine::output, script_output);
|
|
shun-iwasawa |
20109a |
QString s = QString::fromStdWString(loadFilePath.getWideString())
|
|
shun-iwasawa |
20109a |
.replace("\\", "\\\\")
|
|
shun-iwasawa |
20109a |
.replace("\"", "\\\"");
|
|
shun-iwasawa |
20109a |
QString cmd = QString("run(\"%1\")").arg(s);
|
|
shun-iwasawa |
20109a |
engine.evaluate(cmd);
|
|
shun-iwasawa |
20109a |
engine.wait();
|
|
shun-iwasawa |
20109a |
if (!oldProjectPath.isEmpty()) pm->setCurrentProjectPath(oldProjectPath);
|
|
shun-iwasawa |
20109a |
return 1;
|
|
shun-iwasawa |
20109a |
} else {
|
|
shun-iwasawa |
20109a |
std::cerr << QObject::tr("Script file %1 does not exists.")
|
|
shun-iwasawa |
20109a |
.arg(loadFilePath.getQString())
|
|
shun-iwasawa |
20109a |
.toStdString()
|
|
shun-iwasawa |
20109a |
<< std::endl;
|
|
shun-iwasawa |
20109a |
return 1;
|
|
shun-iwasawa |
20109a |
}
|
|
shun-iwasawa |
20109a |
}
|
|
shun-iwasawa |
20109a |
|
|
manongjohn |
a51324 |
#ifdef _WIN32
|
|
manongjohn |
a51324 |
// http://doc.qt.io/qt-5/windows-issues.html#fullscreen-opengl-based-windows
|
|
shun-iwasawa |
47356e |
if (w.windowHandle())
|
|
shun-iwasawa |
47356e |
QWindowsWindowFunctions::setHasBorderInFullScreen(w.windowHandle(), true);
|
|
manongjohn |
a51324 |
#endif
|
|
manongjohn |
a51324 |
|
|
shun-iwasawa |
19cec1 |
// Qt have started to support Windows Ink from 5.12.
|
|
shun-iwasawa |
19cec1 |
// Unlike WinTab API used in Qt 5.9 the tablet behaviors are different and
|
|
shun-iwasawa |
19cec1 |
// are (at least, for OT) problematic. The customized Qt5.15.2 are made with
|
|
shun-iwasawa |
19cec1 |
// cherry-picking the WinTab feature to be officially introduced from 6.0.
|
|
shun-iwasawa |
19cec1 |
// See https://github.com/shun-iwasawa/qt5/releases/tag/v5.15.2_wintab for
|
|
shun-iwasawa |
19cec1 |
// details. The following feature can only be used with the customized Qt,
|
|
shun-iwasawa |
19cec1 |
// with WITH_WINTAB build option, and in Windows-x64 build.
|
|
shun-iwasawa |
19cec1 |
|
|
shun-iwasawa |
19cec1 |
#ifdef WITH_WINTAB
|
|
shun-iwasawa |
19cec1 |
bool useQtNativeWinInk = Preferences::instance()->isQtNativeWinInkEnabled();
|
|
shun-iwasawa |
19cec1 |
QWindowsWindowFunctions::setWinTabEnabled(!useQtNativeWinInk);
|
|
shun-iwasawa |
19cec1 |
#endif
|
|
shun-iwasawa |
19cec1 |
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(offsetStr + "Loading style sheet ...", Qt::AlignCenter,
|
|
Shinya Kitaoka |
120a6e |
Qt::white);
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Carico lo styleSheet
|
|
shun-iwasawa |
c54dfb |
QString currentStyle = Preferences::instance()->getCurrentStyleSheet();
|
|
Shinya Kitaoka |
120a6e |
a.setStyleSheet(currentStyle);
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
f39ea0 |
w.setWindowTitle(QString::fromStdString(TEnv::getApplicationFullName()));
|
|
Jeremy Bullock |
46512f |
if (TEnv::getIsPortable()) {
|
|
Jeremy Bullock |
46512f |
splash.showMessage(offsetStr + "Starting OpenToonz Portable ...",
|
|
Jeremy Bullock |
46512f |
Qt::AlignCenter, Qt::white);
|
|
Jeremy Bullock |
46512f |
} else {
|
|
Jeremy Bullock |
46512f |
splash.showMessage(offsetStr + "Starting main window ...", Qt::AlignCenter,
|
|
Jeremy Bullock |
46512f |
Qt::white);
|
|
Jeremy Bullock |
46512f |
}
|
|
Shinya Kitaoka |
120a6e |
a.processEvents();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TFilePath fp = ToonzFolder::getModuleFile("mainwindow.ini");
|
|
Shinya Kitaoka |
120a6e |
QSettings settings(toQString(fp), QSettings::IniFormat);
|
|
shun-iwasawa |
456ea9 |
if (settings.contains("MainWindowGeometry"))
|
|
shun-iwasawa |
456ea9 |
w.restoreGeometry(settings.value("MainWindowGeometry").toByteArray());
|
|
shun-iwasawa |
456ea9 |
else // maximize window on the first launch
|
|
shun-iwasawa |
456ea9 |
w.setWindowState(w.windowState() | Qt::WindowMaximized);
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
4a3868 |
ExpressionReferenceManager::instance()->init();
|
|
shun-iwasawa |
4a3868 |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef MACOSX
|
|
Shinya Kitaoka |
120a6e |
// Workaround for the maximized window case: Qt delivers two resize events,
|
|
Shinya Kitaoka |
120a6e |
// one in the normal geometry, before
|
|
Shinya Kitaoka |
120a6e |
// maximizing (why!?), the second afterwards - all inside the following show()
|
|
Shinya Kitaoka |
120a6e |
// call. This makes troublesome for
|
|
Shinya Kitaoka |
120a6e |
// the docking system to correctly restore the saved geometry. Fortunately,
|
|
Shinya Kitaoka |
120a6e |
// MainWindow::showEvent(..) gets called
|
|
Shinya Kitaoka |
120a6e |
// just between the two, so we can disable the currentRoom layout right before
|
|
Shinya Kitaoka |
120a6e |
// showing and re-enable it after
|
|
Shinya Kitaoka |
120a6e |
// the normal resize has happened.
|
|
Shinya Kitaoka |
120a6e |
if (w.isMaximized()) w.getCurrentRoom()->layout()->setEnabled(false);
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QRect splashGeometry = splash.geometry();
|
|
Shinya Kitaoka |
120a6e |
splash.finish(&w);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
a.setQuitOnLastWindowClosed(false);
|
|
Shinya Kitaoka |
120a6e |
// a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
|
|
shun-iwasawa |
133733 |
if (Preferences::instance()->isLatestVersionCheckEnabled())
|
|
shun-iwasawa |
133733 |
w.checkForUpdates();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
w.show();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Show floating panels only after the main window has been shown
|
|
Shinya Kitaoka |
120a6e |
w.startupFloatingPanels();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
CommandManager::instance()->execute(T_Hand);
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
if (!loadFilePath.isEmpty()) {
|
|
Shinya Kitaoka |
120a6e |
splash.showMessage(
|
|
![](https://seccdn.libravatar.org/avatar/2e5dd0bee1e7e619066117de357c8458fc7e847f4345b0cb8a7a5413aa2a45a0?s=16&d=retro) |
2e1c78 |
QString("Loading file '") + loadFilePath.getQString() + "'...",
|
|
Shinya Kitaoka |
120a6e |
Qt::AlignCenter, Qt::white);
|
|
shun-iwasawa |
20109a |
loadFilePath = loadFilePath.withType("tnz");
|
|
shun-iwasawa |
20109a |
if (TFileStatus(loadFilePath).doesExist()) IoCmd::loadScene(loadFilePath);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QFont *myFont;
|
|
manongjohn |
b66bc4 |
QString fontName = Preferences::instance()->getInterfaceFont();
|
|
manongjohn |
b66bc4 |
QString fontStyle = Preferences::instance()->getInterfaceFontStyle();
|
|
manongjohn |
b66bc4 |
|
|
manongjohn |
b66bc4 |
TFontManager *fontMgr = TFontManager::instance();
|
|
manongjohn |
b66bc4 |
std::vector<std::wstring> typefaces;</std::wstring>
|
|
manongjohn |
b66bc4 |
bool isBold = false, isItalic = false, hasKerning = false;
|
|
manongjohn |
0032d2 |
try {
|
|
manongjohn |
0032d2 |
fontMgr->loadFontNames();
|
|
manongjohn |
0032d2 |
fontMgr->setFamily(fontName.toStdWString());
|
|
manongjohn |
0032d2 |
fontMgr->getAllTypefaces(typefaces);
|
|
manongjohn |
0032d2 |
isBold = fontMgr->isBold(fontName, fontStyle);
|
|
manongjohn |
0032d2 |
isItalic = fontMgr->isItalic(fontName, fontStyle);
|
|
manongjohn |
0032d2 |
hasKerning = fontMgr->hasKerning();
|
|
manongjohn |
0032d2 |
} catch (TFontCreationError &) {
|
|
manongjohn |
0032d2 |
// Do nothing. A default font should load
|
|
manongjohn |
0032d2 |
}
|
|
manongjohn |
b66bc4 |
|
|
manongjohn |
b66bc4 |
myFont = new QFont(fontName);
|
|
Shinya Kitaoka |
120a6e |
myFont->setPixelSize(EnvSoftwareCurrentFontSize);
|
|
manongjohn |
b66bc4 |
myFont->setBold(isBold);
|
|
manongjohn |
b66bc4 |
myFont->setItalic(isItalic);
|
|
manongjohn |
b66bc4 |
myFont->setKerning(hasKerning);
|
|
manongjohn |
b66bc4 |
|
|
Shinya Kitaoka |
120a6e |
a.setFont(*myFont);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QAction *action = CommandManager::instance()->getAction("MI_OpenTMessage");
|
|
Shinya Kitaoka |
120a6e |
if (action)
|
|
Shinya Kitaoka |
120a6e |
QObject::connect(TMessageRepository::instance(),
|
|
Shinya Kitaoka |
120a6e |
SIGNAL(openMessageCenter()), action, SLOT(trigger()));
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QObject::connect(TUndoManager::manager(), SIGNAL(somethingChanged()),
|
|
Shinya Kitaoka |
120a6e |
TApp::instance()->getCurrentScene(), SLOT(setDirtyFlag()));
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
#ifndef x64
|
|
Shinya Kitaoka |
120a6e |
// On 32-bit architecture, there could be cases in which initialization could
|
|
Shinya Kitaoka |
120a6e |
// alter the
|
|
Shinya Kitaoka |
120a6e |
// FPU floating point control word. I've seen this happen when loading some
|
|
Shinya Kitaoka |
120a6e |
// AVI coded (VFAPI),
|
|
Shinya Kitaoka |
120a6e |
// where 80-bit internal precision was used instead of the standard 64-bit
|
|
Shinya Kitaoka |
120a6e |
// (much faster and
|
|
Shinya Kitaoka |
120a6e |
// sufficient - especially considering that x86 truncates to 64-bit
|
|
Shinya Kitaoka |
120a6e |
// representation anyway).
|
|
Shinya Kitaoka |
120a6e |
// IN ANY CASE, revert to the original control word.
|
|
Shinya Kitaoka |
120a6e |
// In the x64 case these precision changes simply should not take place up to
|
|
Shinya Kitaoka |
120a6e |
// _controlfp_s
|
|
Shinya Kitaoka |
120a6e |
// documentation.
|
|
Shinya Kitaoka |
120a6e |
_controlfp_s(0, fpWord, -1);
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
manongjohn |
c5bc8d |
#ifdef _WIN32
|
|
manongjohn |
c5bc8d |
if (Preferences::instance()->isWinInkEnabled()) {
|
|
manongjohn |
c5bc8d |
KisTabletSupportWin8 *penFilter = new KisTabletSupportWin8();
|
|
manongjohn |
c5bc8d |
if (penFilter->init()) {
|
|
manongjohn |
c5bc8d |
a.installNativeEventFilter(penFilter);
|
|
manongjohn |
c5bc8d |
} else {
|
|
manongjohn |
c5bc8d |
delete penFilter;
|
|
manongjohn |
c5bc8d |
}
|
|
manongjohn |
c5bc8d |
}
|
|
manongjohn |
c5bc8d |
#endif
|
|
manongjohn |
c5bc8d |
|
|
Shinya Kitaoka |
120a6e |
a.installEventFilter(TApp::instance());
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
int ret = a.exec();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TUndoManager::manager()->reset();
|
|
Shinya Kitaoka |
120a6e |
PreviewFxManager::instance()->reset();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
return ret;
|
|
Toshihiro Shimizu |
890ddd |
}
|