diff --git a/toonz/sources/toonz/CMakeLists.txt b/toonz/sources/toonz/CMakeLists.txt index 9dda69e0..12c7927a 100644 --- a/toonz/sources/toonz/CMakeLists.txt +++ b/toonz/sources/toonz/CMakeLists.txt @@ -95,6 +95,7 @@ set(MOC_HEADERS scenesettingspopup.h sceneviewer.h sceneviewercontextmenu.h + sceneviewerevents.h scriptconsolepanel.h selectionutils.h shifttracetool.h diff --git a/toonz/sources/toonz/batchserversviewer.cpp b/toonz/sources/toonz/batchserversviewer.cpp index 3fafa208..425915b4 100644 --- a/toonz/sources/toonz/batchserversviewer.cpp +++ b/toonz/sources/toonz/batchserversviewer.cpp @@ -246,8 +246,8 @@ void BatchServersViewer::onCurrentItemChanged(QListWidgetItem *_item) { Inherits \b QFrame. */ -LineEdit *create(QGridLayout *layout, const QString &name, int &row, - bool readOnly = true) { +static LineEdit *create(QGridLayout *layout, const QString &name, int &row, + bool readOnly = true) { layout->addWidget(new QLabel(name), row, 0, Qt::AlignRight); LineEdit *ret = new LineEdit(); ret->setReadOnly(readOnly); diff --git a/toonz/sources/toonz/cellselection.cpp b/toonz/sources/toonz/cellselection.cpp index 45078850..d0a00568 100644 --- a/toonz/sources/toonz/cellselection.cpp +++ b/toonz/sources/toonz/cellselection.cpp @@ -1198,7 +1198,7 @@ void TCellSelection::copyCells() { //----------------------------------------------------------------------------- -void pasteStrokesInCell(int row, int col, const StrokesData *strokesData) { +static void pasteStrokesInCell(int row, int col, const StrokesData *strokesData) { PasteStrokesInCellUndo *undo = new PasteStrokesInCellUndo(row, col, strokesData); std::vector indices; @@ -1213,8 +1213,8 @@ void pasteStrokesInCell(int row, int col, const StrokesData *strokesData) { //----------------------------------------------------------------------------- -void pasteRasterImageInCell(int row, int col, - const RasterImageData *rasterImageData) { +static void pasteRasterImageInCell(int row, int col, + const RasterImageData *rasterImageData) { TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet(); TXshCell cell = xsh->getCell(row, col); bool createdFrame = false; @@ -1557,7 +1557,7 @@ void TCellSelection::openTimeStretchPopup() { //----------------------------------------------------------------------------- -bool operator<(const TXshCell &a, const TXshCell &b) { +static bool operator<(const TXshCell &a, const TXshCell &b) { if (a.getSimpleLevel() < b.getSimpleLevel()) return true; else if (a.getSimpleLevel() > b.getSimpleLevel()) @@ -1567,7 +1567,7 @@ bool operator<(const TXshCell &a, const TXshCell &b) { //----------------------------------------------------------------------------- -void dRenumberCells(int col, int r0, int r1) { +static void dRenumberCells(int col, int r0, int r1) { typedef std::vector> FramesMap; typedef std::map CellsMap; typedef std::map LevelsTable; @@ -1709,7 +1709,7 @@ public: // TODO: spostare queste funzioni in un posto piu' generale e riutilizzabile -int getLevelType(const TImageP &img) { +static int getLevelType(const TImageP &img) { if (img->getType() == TImage::RASTER) return OVL_XSHLEVEL; else if (img->getType() == TImage::VECTOR) @@ -1775,7 +1775,7 @@ void setNewDrawing(TXsheet *xsh, int row, int col, const TImageP &img) //----------------------------------------------------------------------------- -void createNewDrawing(TXsheet *xsh, int row, int col, int preferredLevelType) { +static void createNewDrawing(TXsheet *xsh, int row, int col, int preferredLevelType) { // search for the level TXshCell old = xsh->getCell(row, col); if (old.isEmpty()) { diff --git a/toonz/sources/toonz/columncommand.cpp b/toonz/sources/toonz/columncommand.cpp index 35561102..07f5d489 100644 --- a/toonz/sources/toonz/columncommand.cpp +++ b/toonz/sources/toonz/columncommand.cpp @@ -756,7 +756,7 @@ void ColumnCmd::insertEmptyColumn(int index) { // Copy Columns Command //************************************************************************* -void copyColumns_internal(const std::set &indices) { +static void copyColumns_internal(const std::set &indices) { assert(!indices.empty()); StageObjectsData *data = new StageObjectsData; @@ -821,7 +821,7 @@ void ColumnCmd::deleteColumn(int index) { // cutColumns //----------------------------------------------------------------------------- -void cutColumnsWithoutUndo(std::set *indices) { +static void cutColumnsWithoutUndo(std::set *indices) { copyColumns_internal(*indices); deleteColumnsWithoutUndo(indices); } diff --git a/toonz/sources/toonz/columnselection.cpp b/toonz/sources/toonz/columnselection.cpp index 088296f1..530bd7f1 100644 --- a/toonz/sources/toonz/columnselection.cpp +++ b/toonz/sources/toonz/columnselection.cpp @@ -98,7 +98,7 @@ void TColumnSelection::explodeChild() { //----------------------------------------------------------------------------- -bool canMergeColumns(int column, int mColumn, bool forMatchlines) { +static bool canMergeColumns(int column, int mColumn, bool forMatchlines) { TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet(); int start, end; xsh->getCellRange(column, start, end); diff --git a/toonz/sources/toonz/exportpanel.cpp b/toonz/sources/toonz/exportpanel.cpp index 408ab881..36a631a9 100644 --- a/toonz/sources/toonz/exportpanel.cpp +++ b/toonz/sources/toonz/exportpanel.cpp @@ -471,7 +471,7 @@ void ClipListViewer::getSelectedClips(std::vector &selectedClips) { //----------------------------------------------------------------------------- -QByteArray packStringList(const QStringList &lst) { +static QByteArray packStringList(const QStringList &lst) { QByteArray ba; QDataStream ds(&ba, QIODevice::WriteOnly); ds << (qint32)lst.size(); @@ -480,7 +480,7 @@ QByteArray packStringList(const QStringList &lst) { return ba; } -QStringList unpackStringList(const QByteArray &ba) { +static QStringList unpackStringList(const QByteArray &ba) { QStringList lst; QDataStream ds(ba); qint32 n = 0; diff --git a/toonz/sources/toonz/fileselection.cpp b/toonz/sources/toonz/fileselection.cpp index 2e0c3c9c..b5368956 100644 --- a/toonz/sources/toonz/fileselection.cpp +++ b/toonz/sources/toonz/fileselection.cpp @@ -432,7 +432,7 @@ void FileSelection::duplicateFiles() { //------------------------------------------------------------------------ -int collectAssets(TFilePath scenePath) { +static int collectAssets(TFilePath scenePath) { // bool dirtyFlag = TNotifier::instance()->getDirtyFlag(); ToonzScene scene; scene.load(scenePath); @@ -485,7 +485,7 @@ void FileSelection::collectAssets() { //------------------------------------------------------------------------ -int importScene(TFilePath scenePath) { +static int importScene(TFilePath scenePath) { // bool dirtyFlag = TNotifier::instance()->getDirtyFlag(); ToonzScene scene; try { diff --git a/toonz/sources/toonz/floatingpanelcommand.cpp b/toonz/sources/toonz/floatingpanelcommand.cpp index 7452de93..2e25ca08 100644 --- a/toonz/sources/toonz/floatingpanelcommand.cpp +++ b/toonz/sources/toonz/floatingpanelcommand.cpp @@ -18,7 +18,7 @@ // mette il widget al centro dello schermo e lo fa diventare la finestra // corrente -void activateWidget(QWidget *w) { +static void activateWidget(QWidget *w) { QDesktopWidget *desktop = qApp->desktop(); QRect screenRect = desktop->screenGeometry(w); diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cpp index 106c7e2f..47e83c37 100644 --- a/toonz/sources/toonz/iocommand.cpp +++ b/toonz/sources/toonz/iocommand.cpp @@ -1959,9 +1959,9 @@ std::vector // Trovare un metodo alternativo. //! Returns the number of actually loaded levels -int createSubXSheetFromPSDFolder(IoCmd::LoadResourceArguments &args, - TXsheet *xsh, int &col0, int psdLevelIndex, - PsdSettingsPopup *popup) { +static int createSubXSheetFromPSDFolder(IoCmd::LoadResourceArguments &args, + TXsheet *xsh, int &col0, int psdLevelIndex, + PsdSettingsPopup *popup) { assert(popup->isFolder(psdLevelIndex)); int row0 = 0; @@ -2016,8 +2016,8 @@ int createSubXSheetFromPSDFolder(IoCmd::LoadResourceArguments &args, // Load a psd file //! Returns the number of actually loaded levels -int loadPSDResource(IoCmd::LoadResourceArguments &args, bool updateRecentFile, - PsdSettingsPopup *popup) { +static int loadPSDResource(IoCmd::LoadResourceArguments &args, bool updateRecentFile, + PsdSettingsPopup *popup) { int &row0 = args.row0; int &col0 = args.col0; int &row1 = args.row1; diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp index 63bd5558..586d4e6f 100644 --- a/toonz/sources/toonz/main.cpp +++ b/toonz/sources/toonz/main.cpp @@ -117,7 +117,7 @@ void qt_mac_set_menubar_merge(bool enable); #define NO_LICENSE //----------------------------------------------------------------------------- -void fatalError(QString msg) { +static void fatalError(QString msg) { DVGui::MsgBoxInPopup( CRITICAL, msg + "\n" + QObject::tr("Installing %1 again could fix the problem.") @@ -126,13 +126,13 @@ void fatalError(QString msg) { } //----------------------------------------------------------------------------- -void lastWarningError(QString msg) { +static void lastWarningError(QString msg) { DVGui::error(msg); // exit(0); } //----------------------------------------------------------------------------- -void toonzRunOutOfContMemHandler(unsigned long size) { +static void toonzRunOutOfContMemHandler(unsigned long size) { #ifdef _WIN32 static bool firstTime = true; if (firstTime) { @@ -156,7 +156,7 @@ DV_IMPORT_API void initColorFx(); la stuffDir, controlla se la directory di outputs esiste (e provvede a crearla in caso contrario) verifica inoltre che stuffDir esista. */ -void initToonzEnv() { +static void initToonzEnv() { StudioPalette::enable(true); TEnv::setApplication(applicationName, applicationVersion, diff --git a/toonz/sources/toonz/matchline.cpp b/toonz/sources/toonz/matchline.cpp index 8392313b..f6c0540e 100644 --- a/toonz/sources/toonz/matchline.cpp +++ b/toonz/sources/toonz/matchline.cpp @@ -995,8 +995,8 @@ void DeleteInkDialog::setRange(const QString &str) { m_frames->setText(str); } DeleteLinesコマンドから呼ばれる場合:chooseInkがtrue --*/ -void doDeleteMatchlines(TXshSimpleLevel *sl, const std::set &fids, - bool chooseInk) { +static void doDeleteMatchlines(TXshSimpleLevel *sl, const std::set &fids, + bool chooseInk) { std::vector indexes; // vector images; std::vector frames; diff --git a/toonz/sources/toonz/mergecmapped.cpp b/toonz/sources/toonz/mergecmapped.cpp index defc15af..56f63d1e 100644 --- a/toonz/sources/toonz/mergecmapped.cpp +++ b/toonz/sources/toonz/mergecmapped.cpp @@ -321,7 +321,7 @@ TApp::instance()->getCurrentScene()->getScene(); } //namespace */ -bool removeLevel(TXshLevel *level) { +static bool removeLevel(TXshLevel *level) { TApp *app = TApp::instance(); ToonzScene *scene = app->getCurrentScene()->getScene(); // if(scene->getChildStack()->getTopXsheet()->isLevelUsed(level)) diff --git a/toonz/sources/toonz/pltgizmopopup.cpp b/toonz/sources/toonz/pltgizmopopup.cpp index b1e30769..390d7204 100644 --- a/toonz/sources/toonz/pltgizmopopup.cpp +++ b/toonz/sources/toonz/pltgizmopopup.cpp @@ -34,8 +34,8 @@ using namespace DVGui; //----------------------------------------------------------------------------- -void getStyles(std::vector &styles, - const TStyleSelection &selection, TPaletteP palette) { +static void getStyles(std::vector &styles, + const TStyleSelection &selection, TPaletteP palette) { styles.clear(); int pageIndex = selection.getPageIndex(); TPalette::Page *page = palette->getPage(pageIndex); @@ -50,7 +50,7 @@ void getStyles(std::vector &styles, //----------------------------------------------------------------------------- -void getStyleIds(std::vector &styleIds, const TStyleSelection &selection) { +static void getStyleIds(std::vector &styleIds, const TStyleSelection &selection) { styleIds.clear(); int pageIndex = selection.getPageIndex(); TPaletteP palette = selection.getPalette(); diff --git a/toonz/sources/toonz/print.cpp b/toonz/sources/toonz/print.cpp index d2871098..c76d5e7d 100644 --- a/toonz/sources/toonz/print.cpp +++ b/toonz/sources/toonz/print.cpp @@ -25,7 +25,7 @@ #include #include -void printCurrentFrame() { +static void printCurrentFrame() { QPrinter printer; QPrintDialog dialog(&printer, 0); if (!dialog.exec()) return; diff --git a/toonz/sources/toonz/psdsettingspopup.cpp b/toonz/sources/toonz/psdsettingspopup.cpp index d73ccf53..b4ad75e9 100644 --- a/toonz/sources/toonz/psdsettingspopup.cpp +++ b/toonz/sources/toonz/psdsettingspopup.cpp @@ -39,7 +39,7 @@ QStringList modesDescription = // Costruisce la stringa delle info della psd da caricare che comparirà nel // popup: // Path, Dimensioni, numero di livelli, ecc.. -void doPSDInfo(TFilePath psdpath, QTreeWidget *psdTree) { +static void doPSDInfo(TFilePath psdpath, QTreeWidget *psdTree) { psdTree->clear(); try { TPSDReader *psdreader = new TPSDReader(psdpath); diff --git a/toonz/sources/toonz/scanpopup.cpp b/toonz/sources/toonz/scanpopup.cpp index 718232c5..bc40d3ae 100644 --- a/toonz/sources/toonz/scanpopup.cpp +++ b/toonz/sources/toonz/scanpopup.cpp @@ -800,7 +800,7 @@ void MyScannerListener::cancelButtonPressed() { //============================================================================= // -void doScan() { +static void doScan() { if (!checkScannerDefinition()) return; ScanList scanList; if (scanList.areScannedFramesSelected()) { diff --git a/toonz/sources/toonz/sceneviewer.cpp b/toonz/sources/toonz/sceneviewer.cpp index 9cbb8f37..826eb7f3 100644 --- a/toonz/sources/toonz/sceneviewer.cpp +++ b/toonz/sources/toonz/sceneviewer.cpp @@ -314,7 +314,7 @@ void invalidateIcons() { //-------------------------------------------------------------- -void executeCheck(int checkType) { +static void executeCheck(int checkType) { ToonzCheck::instance()->toggleCheck(checkType); invalidateIcons(); } @@ -1021,7 +1021,7 @@ void SceneViewer::drawBackground() { } } -bool check_framebuffer_status() { +static bool check_framebuffer_status() { #ifdef _WIN32 PROC proc = wglGetProcAddress("glCheckFramebufferStatusEXT"); if (proc == nullptr) return true; @@ -1363,7 +1363,7 @@ void SceneViewer::drawOverlay() { //----------------------------------------------------------------------------- -void drawFpsGraph(int t0, int t1) { +static void drawFpsGraph(int t0, int t1) { glDisable(GL_BLEND); static std::deque> times; times.push_back(std::make_pair(t0, t1)); diff --git a/toonz/sources/toonz/sceneviewer.h b/toonz/sources/toonz/sceneviewer.h index 8923fbe6..68ed8ded 100644 --- a/toonz/sources/toonz/sceneviewer.h +++ b/toonz/sources/toonz/sceneviewer.h @@ -372,4 +372,8 @@ signals: void previewToggled(); }; +// Functions + +void invalidateIcons(); + #endif // SCENEVIEWER_H diff --git a/toonz/sources/toonz/sceneviewercontextmenu.cpp b/toonz/sources/toonz/sceneviewercontextmenu.cpp index 6ea36a12..c4134b09 100644 --- a/toonz/sources/toonz/sceneviewercontextmenu.cpp +++ b/toonz/sources/toonz/sceneviewercontextmenu.cpp @@ -39,8 +39,8 @@ #include #include -void addShowHideStageObjectCmd(QMenu *menu, const TStageObjectId &id, - bool isShow) { +static void addShowHideStageObjectCmd(QMenu *menu, const TStageObjectId &id, + bool isShow) { TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet(); TStageObject *pegbar = xsh->getStageObject(id); QString cmdStr; @@ -55,7 +55,7 @@ void addShowHideStageObjectCmd(QMenu *menu, const TStageObjectId &id, menu->addAction(showHideAction); } -void onShowHideSelectObject(QAction *action) { +static void onShowHideSelectObject(QAction *action) { TApp *app = TApp::instance(); TStageObjectId id; id.setCode(action->data().toInt()); @@ -80,7 +80,7 @@ void onShowHideSelectObject(QAction *action) { } } -int addShowHideStageObjectCmds(const std::vector &columnIndexes, +static int addShowHideStageObjectCmds(const std::vector &columnIndexes, QMenu *menu, bool isShow) { int ii, columnIndex = -1; bool flag = true; @@ -238,7 +238,7 @@ void SceneViewerContextMenu::addEnterGroupCommands(const TPointD &pos) { assert(ret); } -QString getName(TStageObject *obj) { +static QString getName(TStageObject *obj) { return QString::fromStdString(obj->getFullName()); } diff --git a/toonz/sources/toonz/sceneviewerevents.cpp b/toonz/sources/toonz/sceneviewerevents.cpp index 4eb457b2..17f3f3d4 100644 --- a/toonz/sources/toonz/sceneviewerevents.cpp +++ b/toonz/sources/toonz/sceneviewerevents.cpp @@ -6,6 +6,7 @@ // Tnz6 includes #include "sceneviewer.h" +#include "sceneviewerevents.h" #include "viewerpane.h" #include "tapp.h" #include "iocommand.h" diff --git a/toonz/sources/toonz/sceneviewerevents.h b/toonz/sources/toonz/sceneviewerevents.h new file mode 100644 index 00000000..49c7de49 --- /dev/null +++ b/toonz/sources/toonz/sceneviewerevents.h @@ -0,0 +1,8 @@ +#pragma once + +#ifndef SCENEVIEWEREVENTS_H +#define SCENEVIEWEREVENTS_H + +bool changeFrameSkippingHolds(QKeyEvent *e); + +#endif // SCENEVIEWEREVENTS_H diff --git a/toonz/sources/toonz/scriptconsolepanel.cpp b/toonz/sources/toonz/scriptconsolepanel.cpp index ed055b4b..1b0dd21a 100644 --- a/toonz/sources/toonz/scriptconsolepanel.cpp +++ b/toonz/sources/toonz/scriptconsolepanel.cpp @@ -24,7 +24,7 @@ #include #include -QScriptValue loadSceneFun(QScriptContext *context, QScriptEngine *engine) { +static QScriptValue loadSceneFun(QScriptContext *context, QScriptEngine *engine) { if (context->argumentCount() > 0) { QString fpArg = context->argument(0).toString(); TFilePath fp(fpArg.toStdWString()); @@ -33,7 +33,7 @@ QScriptValue loadSceneFun(QScriptContext *context, QScriptEngine *engine) { return QScriptValue(); } -QScriptValue saveSceneFun(QScriptContext *context, QScriptEngine *engine) { +static QScriptValue saveSceneFun(QScriptContext *context, QScriptEngine *engine) { if (context->argumentCount() > 0) { QString fpArg = context->argument(0).toString(); TFilePath fp(fpArg.toStdWString()); @@ -42,7 +42,7 @@ QScriptValue saveSceneFun(QScriptContext *context, QScriptEngine *engine) { return QScriptValue(); } -QScriptValue loadLevelFun(QScriptContext *context, QScriptEngine *engine) { +static QScriptValue loadLevelFun(QScriptContext *context, QScriptEngine *engine) { if (context->argumentCount() > 0) { QString fpArg = context->argument(0).toString(); TFilePath fp(fpArg.toStdWString()); @@ -68,11 +68,11 @@ QScriptValue loadLevelFun(QScriptContext *context, QScriptEngine *engine) { return QScriptValue(); } -QScriptValue dummyFun(QScriptContext *context, QScriptEngine *engine) { +static QScriptValue dummyFun(QScriptContext *context, QScriptEngine *engine) { return QScriptValue(engine, 0); } -QScriptValue viewFun(QScriptContext *context, QScriptEngine *engine) { +static QScriptValue viewFun(QScriptContext *context, QScriptEngine *engine) { TScriptBinding::Image *image = 0; TScriptBinding::Level *level = 0; @@ -101,8 +101,8 @@ QScriptValue viewFun(QScriptContext *context, QScriptEngine *engine) { return engine->globalObject().property("void"); } -QScriptValue evaluateOnMainThread(QScriptContext *context, - QScriptEngine *engine) { +static QScriptValue evaluateOnMainThread(QScriptContext *context, + QScriptEngine *engine) { QScriptValue fun = context->callee().data(); QObject *obj = fun.data().toQObject(); QString s = fun.toString(); @@ -110,8 +110,8 @@ QScriptValue evaluateOnMainThread(QScriptContext *context, return se->evaluateOnMainThread(fun, context->argumentsObject()); } -void def(ScriptEngine *teng, const QString &name, - QScriptEngine::FunctionSignature fun) { +static void def(ScriptEngine *teng, const QString &name, + QScriptEngine::FunctionSignature fun) { QScriptEngine *eng = teng->getQScriptEngine(); QScriptValue funVal = eng->newFunction(fun); funVal.setData(eng->newQObject(teng)); diff --git a/toonz/sources/toonz/shifttracetool.cpp b/toonz/sources/toonz/shifttracetool.cpp index db740ebd..96c54b72 100644 --- a/toonz/sources/toonz/shifttracetool.cpp +++ b/toonz/sources/toonz/shifttracetool.cpp @@ -24,8 +24,8 @@ //============================================================================= -bool circumCenter(TPointD &out, const TPointD &a, const TPointD &b, - const TPointD &c) { +static bool circumCenter(TPointD &out, const TPointD &a, const TPointD &b, + const TPointD &c) { double d = 2 * (a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y)); if (fabs(d) < 0.0001) { out = TPointD(); diff --git a/toonz/sources/toonz/tapp.cpp b/toonz/sources/toonz/tapp.cpp index 0e907427..a6ef8b25 100644 --- a/toonz/sources/toonz/tapp.cpp +++ b/toonz/sources/toonz/tapp.cpp @@ -629,7 +629,7 @@ void TApp::onLevelColorStyleSwitched() { //----------------------------------------------------------------------------- -void notifyPaletteChanged(TXshSimpleLevel *simpleLevel) { +static void notifyPaletteChanged(TXshSimpleLevel *simpleLevel) { simpleLevel->onPaletteChanged(); std::vector fids; simpleLevel->getFids(fids); diff --git a/toonz/sources/toonz/viewerdraw.cpp b/toonz/sources/toonz/viewerdraw.cpp index 84315432..49f56fce 100644 --- a/toonz/sources/toonz/viewerdraw.cpp +++ b/toonz/sources/toonz/viewerdraw.cpp @@ -37,6 +37,9 @@ TEnv::StringVar EnvSafeAreaName("SafeAreaName", "PR_safe"); +/* TODO, move to include */ +void getSafeAreaSizeList(QList> &_sizeList); + //============================================================================= //============================================================================= // SafeAreaData diff --git a/toonz/sources/toonz/xshcolumnviewer.cpp b/toonz/sources/toonz/xshcolumnviewer.cpp index 5fc6e8c8..b42d5864 100644 --- a/toonz/sources/toonz/xshcolumnviewer.cpp +++ b/toonz/sources/toonz/xshcolumnviewer.cpp @@ -110,7 +110,7 @@ namespace XsheetGUI { //----------------------------------------------------------------------------- -void getVolumeCursorRect(QRect &out, double volume, const QPoint &origin) { +static void getVolumeCursorRect(QRect &out, double volume, const QPoint &origin) { int ly = 60; int v = tcrop(0, ly, (int)(volume * ly)); out.setX(origin.x() + 11); diff --git a/toonz/sources/toonz/xsheetcmd.cpp b/toonz/sources/toonz/xsheetcmd.cpp index 00493be6..f378f604 100644 --- a/toonz/sources/toonz/xsheetcmd.cpp +++ b/toonz/sources/toonz/xsheetcmd.cpp @@ -203,7 +203,7 @@ void InsertSceneFrameUndo::doRemoveSceneFrame(int frame) { //----------------------------------------------------------------------------- -void insertSceneFrame(int frame) { +static void insertSceneFrame(int frame) { InsertSceneFrameUndo *undo = new InsertSceneFrameUndo(frame); TUndoManager::manager()->add(undo); @@ -298,7 +298,7 @@ public: //----------------------------------------------------------------------------- -void removeSceneFrame(int frame) { +static void removeSceneFrame(int frame) { RemoveSceneFrameUndo *undo = new RemoveSceneFrameUndo(frame); TUndoManager::manager()->add(undo); @@ -443,7 +443,7 @@ public: //----------------------------------------------------------------------------- -void insertGlobalKeyframe(int frame) { +static void insertGlobalKeyframe(int frame) { std::vector columns; ::getColumns(columns); @@ -536,7 +536,7 @@ public: //----------------------------------------------------------------------------- -void removeGlobalKeyframe(int frame) { +static void removeGlobalKeyframe(int frame) { std::vector columns; ::getColumns(columns); @@ -747,7 +747,7 @@ void DrawingSubtitutionUndo::setDrawing(const TFrameId &fid, int row, int col, //----------------------------------------------------------------------------- -void drawingSubstituion(int dir) { +static void drawingSubstituion(int dir) { // TTool::Application *app = TTool::getApplication(); // TCellSelection *selection = dynamic_cast(app->getCurrentSelection()->getSelection()); @@ -769,7 +769,7 @@ void drawingSubstituion(int dir) { undo->redo(); } -void drawingSubstituionGroup(int dir) { +static void drawingSubstituionGroup(int dir) { int row = TTool::getApplication()->getCurrentFrame()->getFrame(); int col = TTool::getApplication()->getCurrentColumn()->getColumnIndex(); DrawingSubtitutionGroupUndo *undo = @@ -1744,7 +1744,7 @@ void XsheetWriter::write(ostream &os) { } } -void makeHtml(TFilePath fp) { +static void makeHtml(TFilePath fp) { TApp *app = TApp::instance(); ToonzScene *scene = app->getCurrentScene()->getScene(); diff --git a/toonz/sources/toonz/xsheetdragtool.cpp b/toonz/sources/toonz/xsheetdragtool.cpp index 582477e0..3ea0ed48 100644 --- a/toonz/sources/toonz/xsheetdragtool.cpp +++ b/toonz/sources/toonz/xsheetdragtool.cpp @@ -1483,7 +1483,7 @@ XsheetGUI::DragTool *XsheetGUI::DragTool::makeColumnSelectionTool( // Column Movement //----------------------------------------------------------------------------- -void moveColumns(const std::set &indices, int delta) { +static void moveColumns(const std::set &indices, int delta) { if (indices.empty()) return; if (delta < 0 && *indices.begin() + delta < 0) delta = -*indices.begin(); if (delta == 0) return; diff --git a/toonz/sources/toonz/xsheetviewer.cpp b/toonz/sources/toonz/xsheetviewer.cpp index 24332c5e..ea355bab 100644 --- a/toonz/sources/toonz/xsheetviewer.cpp +++ b/toonz/sources/toonz/xsheetviewer.cpp @@ -1,6 +1,7 @@ #include "xsheetviewer.h" +#include "sceneviewerevents.h" #include "tapp.h" #include "floatingpanelcommand.h" #include "menubarcommandids.h" @@ -398,7 +399,7 @@ void XsheetViewer::setAutoPanSpeed(const QPoint &speed) { //----------------------------------------------------------------------------- -int getAutoPanSpeed(int pixels) { +static int getAutoPanSpeed(int pixels) { int f = 40; return std::min(100, (f - 1 + pixels * f) / 100); } @@ -771,7 +772,6 @@ void XsheetViewer::keyPressEvent(QKeyEvent *event) { } locals = {this}; - extern bool changeFrameSkippingHolds(QKeyEvent * e); if (changeFrameSkippingHolds(event)) return; int frameCount = getXsheet()->getFrameCount(); diff --git a/toonz/sources/toonzfarm/tfarm/tfarmexecutor.cpp b/toonz/sources/toonzfarm/tfarm/tfarmexecutor.cpp index 52513923..3f6faa0b 100644 --- a/toonz/sources/toonzfarm/tfarm/tfarmexecutor.cpp +++ b/toonz/sources/toonzfarm/tfarm/tfarmexecutor.cpp @@ -8,7 +8,7 @@ TFarmExecutor::TFarmExecutor(int port) : TTcpIpServer(port) {} //------------------------------------------------------------------------------ -int extractArgs(const QString &s, std::vector &argv) { +static int extractArgs(const QString &s, std::vector &argv) { argv.clear(); if (s == "") return 0; diff --git a/toonz/sources/toonzfarm/tfarm/tfarmtask.cpp b/toonz/sources/toonzfarm/tfarm/tfarmtask.cpp index 7897e247..9005f92b 100644 --- a/toonz/sources/toonzfarm/tfarm/tfarmtask.cpp +++ b/toonz/sources/toonzfarm/tfarm/tfarmtask.cpp @@ -375,7 +375,7 @@ QString toString(int value, int w, char c = ' ') { //------------------------------------------------------------------------------ -TFilePath getFilePath(const QStringList &l, int &i) { +static TFilePath getFilePath(const QStringList &l, int &i) { QString outStr = l.at(i++); if (outStr.startsWith('"')) { outStr = outStr.remove(0, 1); diff --git a/toonz/sources/toonzfarm/tfarm/ttcpipclient.cpp b/toonz/sources/toonzfarm/tfarm/ttcpipclient.cpp index 588b1870..db26f395 100644 --- a/toonz/sources/toonzfarm/tfarm/ttcpipclient.cpp +++ b/toonz/sources/toonzfarm/tfarm/ttcpipclient.cpp @@ -200,7 +200,7 @@ int TTcpIpClient::send(int sock, const QString &data) { //------------------------------------------------------------------------------ -int readData(int sock, QString &data) { +static int readData(int sock, QString &data) { int cnt = 0; char buff[1024]; memset(buff, 0, sizeof(buff)); diff --git a/toonz/sources/toonzfarm/tfarmcontroller/tfarmcontroller.cpp b/toonz/sources/toonzfarm/tfarmcontroller/tfarmcontroller.cpp index de2561ac..f29df708 100644 --- a/toonz/sources/toonzfarm/tfarmcontroller/tfarmcontroller.cpp +++ b/toonz/sources/toonzfarm/tfarmcontroller/tfarmcontroller.cpp @@ -424,7 +424,7 @@ void FarmServerProxy::removeTask(const QString &taskId) { //------------------------------------------------------------------------------ -bool doTestConnection(const QString &hostName, const QString &addr, int port) { +static bool doTestConnection(const QString &hostName, const QString &addr, int port) { TTcpIpClient client; int sock; diff --git a/toonz/sources/toonzfarm/tfarmserver/tfarmserver.cpp b/toonz/sources/toonzfarm/tfarmserver/tfarmserver.cpp index 51cd4f94..c05d0486 100644 --- a/toonz/sources/toonzfarm/tfarmserver/tfarmserver.cpp +++ b/toonz/sources/toonzfarm/tfarmserver/tfarmserver.cpp @@ -683,7 +683,7 @@ int inline STRICMP(const char *a, const char *b) { return str.compare(QString(b), Qt::CaseSensitive); } -bool loadServerData(const QString &hostname, QString &addr, int &port) { +static bool loadServerData(const QString &hostname, QString &addr, int &port) { TFilePath rootDir = getGlobalRoot(); TFilePath fp = rootDir + "config" + "servers.txt"; diff --git a/toonz/sources/toonzqt/addfxcontextmenu.cpp b/toonz/sources/toonzqt/addfxcontextmenu.cpp index 020f5e4e..b6bf3c2d 100644 --- a/toonz/sources/toonzqt/addfxcontextmenu.cpp +++ b/toonz/sources/toonzqt/addfxcontextmenu.cpp @@ -207,7 +207,7 @@ void AddFxContextMenu::fillMenus() { //--------------------------------------------------- -void scan_all_plugins(const std::string &basedir, QObject *listener) { +static void scan_all_plugins(const std::string &basedir, QObject *listener) { // clear_all_plugins(); new PluginLoadController(basedir, listener); } diff --git a/toonz/sources/toonzqt/docklayout.cpp b/toonz/sources/toonzqt/docklayout.cpp index 0e6b94b7..4b8ebb38 100644 --- a/toonz/sources/toonzqt/docklayout.cpp +++ b/toonz/sources/toonzqt/docklayout.cpp @@ -730,7 +730,7 @@ Region *DockLayout::dockItemPrivate(DockWidget *item, Region *r, int idx) { //------------------------------------------------------ //! A region is empty, if contains no item and no children. -bool isEmptyRegion(Region *r) { +static bool isEmptyRegion(Region *r) { if ((!r->getItem()) && (r->getChildList().size() == 0)) { delete r; // Be', e' un po' improprio, ma funziona... return true; @@ -863,8 +863,8 @@ bool DockLayout::undockItem(DockWidget *item) { //! Search for the \b nearest n-ple from a \b target one, under conditions: //!\b 1) nearest elements belong to \b fixed \b intervals; \b 2) their \b sum is //!\b fixed too. -void calculateNearest(std::vector target, std::vector &nearest, - std::vector> intervals, double sum) { +static void calculateNearest(std::vector target, std::vector &nearest, + std::vector> intervals, double sum) { // Solving a small Lagrange multipliers problem to find solution on constraint // (2) assert(target.size() == intervals.size()); diff --git a/toonz/sources/toonzqt/functionpanel.cpp b/toonz/sources/toonzqt/functionpanel.cpp index fd00d881..13a35af3 100644 --- a/toonz/sources/toonzqt/functionpanel.cpp +++ b/toonz/sources/toonzqt/functionpanel.cpp @@ -1500,8 +1500,8 @@ void FunctionPanel::fitRegion(double f0, double v0, double f1, double v1) {} //----------------------------------------------------------------------------- -void setSegmentType(FunctionSelection *selection, TDoubleParam *curve, - int segmentIndex, TDoubleKeyframe::Type type) { +static void setSegmentType(FunctionSelection *selection, TDoubleParam *curve, + int segmentIndex, TDoubleKeyframe::Type type) { selection->selectSegment(curve, segmentIndex); KeyframeSetter setter(curve, segmentIndex); setter.setType(type); diff --git a/toonz/sources/toonzqt/functionsegmentviewer.cpp b/toonz/sources/toonzqt/functionsegmentviewer.cpp index eeac2b79..5776c1d8 100644 --- a/toonz/sources/toonzqt/functionsegmentviewer.cpp +++ b/toonz/sources/toonzqt/functionsegmentviewer.cpp @@ -41,7 +41,7 @@ using namespace DVGui; //----------------------------------------------------------------------------- -LineEdit *createField() { +static LineEdit *createField() { LineEdit *field = new LineEdit(); /* field->setMaximumWidth(100); diff --git a/toonz/sources/toonzqt/imageutils.cpp b/toonz/sources/toonzqt/imageutils.cpp index 4ffcc93f..eb2b8694 100644 --- a/toonz/sources/toonzqt/imageutils.cpp +++ b/toonz/sources/toonzqt/imageutils.cpp @@ -110,13 +110,13 @@ namespace ImageUtils { // todo: spostare da qualche altra parte. rendere accessibile a tutti. // utilizzare // anche nella libreria dovunque si usi direttamente "_files" -TFilePath getResourceFolder(const TFilePath &scenePath) { +static TFilePath getResourceFolder(const TFilePath &scenePath) { return scenePath.getParentDir() + (scenePath.getName() + "_files"); } //----------------------------------------------------------------------------- -void copyScene(const TFilePath &dst, const TFilePath &src) { +static void copyScene(const TFilePath &dst, const TFilePath &src) { TSystem::copyFile(dst, src); if (TProjectManager::instance()->isTabModeEnabled()) TSystem::copyDir(getResourceFolder(dst), getResourceFolder(src)); @@ -337,11 +337,11 @@ void getStrokeStyleInformationInArea( } //-------------------------------------------------------------------- -void convertFromCM(const TLevelReaderP &lr, const TPaletteP &plt, - const TLevelWriterP &lw, const std::vector &frames, - const TAffine &aff, const TRop::ResampleFilterType &resType, - FrameTaskNotifier *frameNotifier, const TPixel &bgColor, - bool removeDotBeforeFrameNumber = false) { +static void convertFromCM(const TLevelReaderP &lr, const TPaletteP &plt, + const TLevelWriterP &lw, const std::vector &frames, + const TAffine &aff, const TRop::ResampleFilterType &resType, + FrameTaskNotifier *frameNotifier, const TPixel &bgColor, + bool removeDotBeforeFrameNumber = false) { for (int i = 0; i < (int)frames.size(); i++) { if (frameNotifier->abortTask()) break; try { @@ -402,10 +402,10 @@ void convertFromCM(const TLevelReaderP &lr, const TPaletteP &plt, //-------------------------------------------------------------------- -void convertFromVI(const TLevelReaderP &lr, const TPaletteP &plt, - const TLevelWriterP &lw, const std::vector &frames, - const TRop::ResampleFilterType &resType, int width, - FrameTaskNotifier *frameNotifier) { +static void convertFromVI(const TLevelReaderP &lr, const TPaletteP &plt, + const TLevelWriterP &lw, const std::vector &frames, + const TRop::ResampleFilterType &resType, int width, + FrameTaskNotifier *frameNotifier) { QString msg; int i; std::vector images; @@ -457,13 +457,13 @@ void convertFromVI(const TLevelReaderP &lr, const TPaletteP &plt, //----------------------------------------------------------------------- -void convertFromFullRaster(const TLevelReaderP &lr, const TLevelWriterP &lw, - const std::vector &_frames, - const TAffine &aff, - const TRop::ResampleFilterType &resType, - FrameTaskNotifier *frameNotifier, - const TPixel &bgColor, - bool removeDotBeforeFrameNumber = false) { +static void convertFromFullRaster(const TLevelReaderP &lr, const TLevelWriterP &lw, + const std::vector &_frames, + const TAffine &aff, + const TRop::ResampleFilterType &resType, + FrameTaskNotifier *frameNotifier, + const TPixel &bgColor, + bool removeDotBeforeFrameNumber = false) { std::vector frames = _frames; if (frames.empty() && lr->loadInfo()->getFrameCount() == @@ -540,9 +540,9 @@ ConvertPopup での指定に合わせて、[レベル名].[フレーム番号].[ //----------------------------------------------------------------------- -void convertFromVector(const TLevelReaderP &lr, const TLevelWriterP &lw, - const std::vector &_frames, - FrameTaskNotifier *frameNotifier) { +static void convertFromVector(const TLevelReaderP &lr, const TLevelWriterP &lw, + const std::vector &_frames, + FrameTaskNotifier *frameNotifier) { std::vector frames = _frames; TLevelP lv = lr->loadInfo(); if (frames.empty() && diff --git a/toonz/sources/toonzqt/pluginhost.cpp b/toonz/sources/toonzqt/pluginhost.cpp index faec52f3..3d271ced 100644 --- a/toonz/sources/toonzqt/pluginhost.cpp +++ b/toonz/sources/toonzqt/pluginhost.cpp @@ -669,7 +669,7 @@ static inline bool is_compatible(const toonz_if_version_t &v) { return v.major == compat_maj && v.minor == compat_min; } -int check_base_sanity(const toonz_param_page_t *p) { +static int check_base_sanity(const toonz_param_page_t *p) { int err = 0; if (!is_compatible(p->base)) err |= TOONZ_PARAM_ERROR_VERSION; @@ -678,7 +678,7 @@ int check_base_sanity(const toonz_param_page_t *p) { return err; } -int check_base_sanity(const toonz_param_group_t *p) { +static int check_base_sanity(const toonz_param_group_t *p) { int err = 0; if (!is_compatible(p->base)) err |= TOONZ_PARAM_ERROR_VERSION; @@ -688,7 +688,7 @@ int check_base_sanity(const toonz_param_group_t *p) { return err; } -int check_base_sanity(const toonz_param_desc_t *p) { +static int check_base_sanity(const toonz_param_desc_t *p) { int err = 0; if (!is_compatible(p->base)) err |= TOONZ_PARAM_ERROR_VERSION; @@ -1266,7 +1266,7 @@ T *interface_factory() { return interface_t::factory(); } -int query_interface(const UUID *uuid, void **interf) { +static int query_interface(const UUID *uuid, void **interf) { typedef std::pair uuid_dict_t; static const uuid_dict_t dict[] = { uuid_dict_t(&uuid_nodal_, 1), uuid_dict_t(&uuid_port_, 2), @@ -1325,7 +1325,7 @@ int query_interface(const UUID *uuid, void **interf) { return TOONZ_OK; } -void release_interface(void *interf) { +static void release_interface(void *interf) { if (interf) delete interf; } @@ -1357,9 +1357,9 @@ void Loader::walkDirectory_(const QString &path) { } #if defined(_WIN32) || defined(_CYGWIN_) -void end_library(HMODULE mod) { FreeLibrary(mod); } +static void end_library(HMODULE mod) { FreeLibrary(mod); } #else -void end_library(void *mod) { dlclose(mod); } +static void end_library(void *mod) { dlclose(mod); } #endif void Loader::doLoad(const QString &file) { diff --git a/toonz/sources/toonzqt/spreadsheetviewer.cpp b/toonz/sources/toonzqt/spreadsheetviewer.cpp index b99a83f8..353a0b52 100644 --- a/toonz/sources/toonzqt/spreadsheetviewer.cpp +++ b/toonz/sources/toonzqt/spreadsheetviewer.cpp @@ -558,7 +558,7 @@ void SpreadsheetViewer::setAutoPanSpeed(const QPoint &speed) { //----------------------------------------------------------------------------- -int getAutoPanSpeed(int pixels) { +static int getAutoPanSpeed(int pixels) { int f = 40; return std::min(100, (f - 1 + pixels * f) / 100); }