void Filmstrip::hideEvent(QHideEvent *) { TApp *app = TApp::instance(); TXshLevelHandle *levelHandle = app->getCurrentLevel(); disconnect(levelHandle, SIGNAL(xshLevelSwitched(TXshLevel *)), this, SLOT(onLevelSwitched(TXshLevel *))); disconnect(levelHandle, SIGNAL(xshLevelChanged()), this, SLOT(onLevelChanged())); disconnect(TApp::instance()->getPaletteController()->getCurrentLevelPalette(), SIGNAL(colorStyleChangedOnMouseRelease()), this, SLOT(onLevelChanged())); disconnect(levelHandle, SIGNAL(xshLevelTitleChanged()), this, SLOT(onLevelChanged())); disconnect(m_frameArea->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(onSliderMoved(int))); TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene(); disconnect(sceneHandle, SIGNAL(sceneSwitched()), this, SLOT(updateChooseLevelComboItems())); disconnect(sceneHandle, SIGNAL(castChanged()), this, SLOT(updateChooseLevelComboItems())); disconnect(TApp::instance()->getCurrentXsheet(), SIGNAL(xsheetChanged()), this, SLOT(updateChooseLevelComboItems())); disconnect(TApp::instance()->getCurrentFrame(), SIGNAL(frameSwitched()), this, SLOT(onFrameSwitched())); }
int main() { TApp app; app.run(); app.shutDown(); return 0; }
void execute() { TApp *app = TApp::instance(); ToonzScene *scene = app->getCurrentScene()->getScene(); TLevelSet *levelSet = scene->getLevelSet(); std::set<TXshLevel *> usedLevels; scene->getTopXsheet()->getUsedLevels(usedLevels); std::vector<TXshLevel *> unused; for (int i = 0; i < levelSet->getLevelCount(); i++) { TXshLevel *xl = levelSet->getLevel(i); if (usedLevels.count(xl) == 0) unused.push_back(xl); } if (unused.empty()) { DVGui::error(QObject::tr("No unused levels")); return; } else { TUndoManager *um = TUndoManager::manager(); um->beginBlock(); for (int i = 0; i < (int)unused.size(); i++) { TXshLevel *xl = unused[i]; um->add(new DeleteLevelUndo(xl)); scene->getLevelSet()->removeLevel(xl); } TApp::instance()->getCurrentXsheet()->notifyXsheetChanged(); TApp::instance()->getCurrentScene()->notifyCastChange(); um->endBlock(); } }
TFx *InsertFxPopup::createFx() { TApp *app = TApp::instance(); ToonzScene *scene = app->getCurrentScene()->getScene(); TXsheet *xsh = scene->getXsheet(); QTreeWidgetItem *item = m_fxTree->currentItem(); QString text = item->data(0, Qt::UserRole).toString(); if (text.isEmpty()) return 0; TFx *fx; TFilePath path = TFilePath(text.toStdWString()); if (TFileStatus(path).doesExist() && TFileStatus(path.getParentDir()).isDirectory()) { std::string folder = path.getParentDir().getName(); if (folder == "macroFx") //Devo caricare una macro fx = createMacroFxByPath(path); else //Verifico se devo caricare un preset { folder = path.getParentDir().getParentDir().getName(); if (folder == "presets") //Devo caricare un preset fx = createPresetFxByName(path); } } else fx = createFxByName(text.toStdString()); if (fx) return fx; else return 0; }
void LayerHeaderPanel::mouseReleaseEvent(QMouseEvent *event) { TApp *app = TApp::instance(); TXsheet *xsh = m_viewer->getXsheet(); int col, totcols = xsh->getColumnCount(); bool sound_changed = false; if (m_doOnRelease != 0 && totcols > 0) { for (col = 0; col < totcols; col++) { if (!xsh->isColumnEmpty(col)) { TXshColumn *column = xsh->getColumn(col); if (m_doOnRelease == ToggleAllPreviewVisible) { column->setPreviewVisible(!column->isPreviewVisible()); } else if (m_doOnRelease == ToggleAllTransparency) { column->setCamstandVisible(!column->isCamstandVisible()); if (column->getSoundColumn()) sound_changed = true; } else if (m_doOnRelease == ToggleAllLock) { column->lock(!column->isLocked()); } } } if (sound_changed) { app->getCurrentXsheet()->notifyXsheetSoundChanged(); } app->getCurrentScene()->notifySceneChanged(); app->getCurrentXsheet()->notifyXsheetChanged(); } m_viewer->updateColumnArea(); update(); m_doOnRelease = 0; }
bool changeFrameSkippingHolds(QKeyEvent *e) { if ((e->modifiers() & Qt::ShiftModifier) == 0 || e->key() != Qt::Key_Down && e->key() != Qt::Key_Up) return false; TApp *app = TApp::instance(); TFrameHandle *fh = app->getCurrentFrame(); if (!fh->isEditingScene()) return false; int row = fh->getFrame(); int col = app->getCurrentColumn()->getColumnIndex(); TXsheet *xsh = app->getCurrentXsheet()->getXsheet(); TXshCell cell = xsh->getCell(row, col); if (e->key() == Qt::Key_Down) { if (cell.isEmpty()) { int r0, r1; if (xsh->getCellRange(col, r0, r1)) { while (row <= r1 && xsh->getCell(row, col).isEmpty()) row++; if (xsh->getCell(row, col).isEmpty()) return false; } else return false; } else { while (xsh->getCell(row, col) == cell) row++; } } else { // Key_Up while (row >= 0 && xsh->getCell(row, col) == cell) row--; if (row < 0) return false; cell = xsh->getCell(row, col); while (row > 0 && xsh->getCell(row - 1, col) == cell) row--; } fh->setFrame(row); return true; }
void SceneViewer::enterEvent(QEvent *) { if (m_isMouseEntered) return; m_isMouseEntered = true; TApp *app = TApp::instance(); modifiers = 0; TTool *tool = app->getCurrentTool()->getTool(); TXshLevel *level = app->getCurrentLevel()->getLevel(); if (level && level->getSimpleLevel()) m_dpiScale = getCurrentDpiScale(level->getSimpleLevel(), tool->getCurrentFid()); else m_dpiScale = TPointD(1, 1); if (m_freezedStatus != NO_FREEZED) return; invalidateToolStatus(); if (tool && tool->isEnabled()) { tool->setViewer(this); tool->updateMatrix(); tool->onEnter(); } setFocus(); updateGL(); }
void TKeyframeSelection::setKeyframes() { TApp *app = TApp::instance(); TXsheetHandle *xsheetHandle = app->getCurrentXsheet(); TXsheet *xsh = xsheetHandle->getXsheet(); TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId(); if (isEmpty()) return; Position pos = *m_positions.begin(); int row = pos.first; int col = pos.second; TStageObjectId id = col < 0 ? cameraId : TStageObjectId::ColumnId(col); TStageObject *pegbar = xsh->getStageObject(id); if (!pegbar) return; if (pegbar->isKeyframe(row)) { TStageObject::Keyframe key = pegbar->getKeyframe(row); pegbar->removeKeyframeWithoutUndo(row); UndoRemoveKeyFrame *undo = new UndoRemoveKeyFrame(id, row, key, xsheetHandle); undo->setObjectHandle(app->getCurrentObject()); TUndoManager::manager()->add(undo); } else { pegbar->setKeyframeWithoutUndo(row); UndoSetKeyFrame *undo = new UndoSetKeyFrame(id, row, xsheetHandle); undo->setObjectHandle(app->getCurrentObject()); TUndoManager::manager()->add(undo); } TApp::instance()->getCurrentScene()->setDirtyFlag(true); TApp::instance()->getCurrentObject()->notifyObjectIdChanged(false); }
void FilmstripFrames::onFrameSwitched() { // no. interferische con lo shift-click per la selezione. // m_selection->selectNone(); TApp *app = TApp::instance(); TFrameHandle *fh = app->getCurrentFrame(); TFrameId fid; if (fh->isEditingLevel()) fid = fh->getFid(); else { TXsheet *xsh = app->getCurrentXsheet()->getXsheet(); int col = app->getCurrentColumn()->getColumnIndex(); int row = fh->getFrame(); if (row < 0 || col < 0) return; TXshCell cell = xsh->getCell(row, col); if (cell.isEmpty()) return; fid = cell.getFrameId(); } int index = fid2index(fid); if (index >= 0) { exponeFrame(index); // clear selection and select only the destination frame select(index, ONLY_SELECT); } update(); }
void RowArea::mousePressEvent(QMouseEvent *event) { m_viewer->setQtModifiers(event->modifiers()); if (event->button() == Qt::LeftButton) { bool playRangeModifierisClicked = false; TApp *app = TApp::instance(); TXsheet *xsh = app->getCurrentScene()->getScene()->getXsheet(); TPoint pos(event->pos().x(), event->pos().y()); int row = m_viewer->yToRow(pos.y); QRect visibleRect = visibleRegion().boundingRect(); int playR0, playR1, step; XsheetGUI::getPlayRange(playR0, playR1, step); bool playRangeEnabled = playR0 <= playR1; if (!playRangeEnabled) { TXsheet *xsh = m_viewer->getXsheet(); playR1 = xsh->getFrameCount() - 1; playR0 = 0; } if (playR1 == -1) { //getFrameCount = 0 i.e. xsheet is empty setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer)); } else if (m_xa <= pos.x && pos.x <= m_xa + 10 && (row == playR0 || row == playR1)) { if (!playRangeEnabled) XsheetGUI::setPlayRange(playR0, playR1, step); setDragTool(XsheetGUI::DragTool::makePlayRangeModifierTool(m_viewer)); playRangeModifierisClicked = true; } else setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer)); //when shift+click the row area, select a single row region in the cell area if (!playRangeModifierisClicked && 0 != (event->modifiers() & Qt::ShiftModifier)) { int filledCol; for (filledCol = xsh->getColumnCount() - 1; filledCol >= 0; filledCol--) { TXshColumn *currentColumn = xsh->getColumn(filledCol); if (!currentColumn) continue; if (!currentColumn->isEmpty()) break; } m_viewer->getCellSelection()->selectNone(); m_viewer->getCellSelection()->selectCells(row, 0, row, tmax(0, filledCol)); m_viewer->updateCellRowAree(); } m_viewer->dragToolClick(event); event->accept(); } // left-click // pan by middle-drag else if (event->button() == Qt::MidButton) { m_pos = event->pos(); m_isPanning = true; } }
void BinarizePopup::hideEvent(QHideEvent *e) { TApp *app = TApp::instance(); bool ret = true; ret = ret && disconnect(app->getCurrentFrame(), 0, this, 0); ret = ret && disconnect(app->getCurrentColumn(), 0, this, 0); ret = ret && disconnect(app->getCurrentLevel(), 0, this, 0); assert(ret); }
void AntialiasPopup::showEvent(QShowEvent *se) { TApp *app = TApp::instance(); bool ret = true; ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this, SLOT(setCurrentSampleRaster())); ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this, SLOT(setCurrentSampleRaster())); ret = ret && connect(app->getCurrentColumn(), SIGNAL(columnIndexSwitched()), this, SLOT(setCurrentSampleRaster())); assert(ret); setCurrentSampleRaster(); }
bool onStyleChanged() override { TApp *app = TApp::instance(); int styleIndex = app->getPaletteController()->getCurrentLevelPalette()->getStyleIndex(); TSelection *currentSelection = app->getCurrentSelection()->getSelection(); StrokeSelection *ss = dynamic_cast<StrokeSelection *>(currentSelection); if (!ss || ss->isEmpty()) return false; ss->changeColorStyle(styleIndex); return true; }
void onDeliver() { if (m_error) { m_error = false; MsgBox(DVGui::CRITICAL, QObject::tr("There was an error saving frames for the %1 level.").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString()))); } bool isPreview = (m_fp.getType() == "noext"); TImageCache::instance()->remove(toString(m_fp.getWideString() + L".0")); TNotifier::instance()->notify(TSceneNameChange()); if (Preferences::instance()->isGeneratedMovieViewEnabled()) { if (!isPreview && (Preferences::instance()->isDefaultViewerEnabled()) && (m_fp.getType() == "mov" || m_fp.getType() == "avi" || m_fp.getType() == "3gp")) { QString name = QString::fromStdString(m_fp.getName()); int index; if ((index = name.indexOf("#RENDERID")) != -1) //!quite ugly I know.... m_fp = m_fp.withName(name.left(index).toStdWString()); if (!TSystem::showDocument(m_fp)) { QString msg(QObject::tr("It is not possible to display the file %1: no player associated with its format").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString()))); MsgBox(WARNING, msg); } } else { int r0, r1, step; TApp *app = TApp::instance(); ToonzScene *scene = app->getCurrentScene()->getScene(); TOutputProperties &outputSettings = isPreview ? *scene->getProperties()->getPreviewProperties() : *scene->getProperties()->getOutputProperties(); outputSettings.getRange(r0, r1, step); const TRenderSettings rs = outputSettings.getRenderSettings(); if (r0 == 0 && r1 == -1) r0 = 0, r1 = scene->getFrameCount() - 1; double timeStretchFactor = isPreview ? 1.0 : (double)outputSettings.getRenderSettings().m_timeStretchTo / outputSettings.getRenderSettings().m_timeStretchFrom; r0 = tfloor(r0 * timeStretchFactor); r1 = tceil((r1 + 1) * timeStretchFactor) - 1; TXsheet::SoundProperties *prop = new TXsheet::SoundProperties(); prop->m_frameRate = outputSettings.getFrameRate(); TSoundTrack *snd = app->getCurrentXsheet()->getXsheet()->makeSound(prop); if (outputSettings.getRenderSettings().m_stereoscopic) { assert(!isPreview); ::viewFile(m_fp.withName(m_fp.getName() + "_l"), r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true); ::viewFile(m_fp.withName(m_fp.getName() + "_r"), r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true); } else ::viewFile(m_fp, r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true); } } }
void LinesFadePopup::hideEvent(QHideEvent *he) { TApp *app = TApp::instance(); disconnect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this, SLOT(setCurrentSampleRaster())); disconnect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this, SLOT(setCurrentSampleRaster())); disconnect(app->getCurrentColumn(), SIGNAL(columnIndexSwitched()), this, SLOT(setCurrentSampleRaster())); Dialog::hideEvent(he); m_viewer->raster() = TRasterP(); m_startRas = TRaster32P(); }
void PaletteViewerPanel::onCurrentButtonToggled(bool isCurrent) { if (isActive() == isCurrent) return; TApp *app = TApp::instance(); TPaletteHandle *ph = app->getPaletteController()->getCurrentLevelPalette(); // Se sono sulla palette del livello corrente e le palette e' vuota non // consento di bloccare il pannello. if (isActive() && !ph->getPalette()) { m_isCurrentButton->setPressed(true); return; } setActive(isCurrent); m_paletteViewer->enableSaveAction(isCurrent); // Cambio il livello corrente if (isCurrent) { std::set<TXshSimpleLevel *> levels; TXsheet *xsheet = app->getCurrentXsheet()->getXsheet(); int row, column; findPaletteLevels(levels, row, column, m_paletteHandle->getPalette(), xsheet); // Se non trovo livelli riferiti alla palette setto il palette viewer alla // palette del livello corrente. if (levels.empty()) { m_paletteViewer->setPaletteHandle(ph); update(); return; } TXshSimpleLevel *level = *levels.begin(); // Se sto editando l'xsheet devo settare come corrente anche la colonna e il // frame. if (app->getCurrentFrame()->isEditingScene()) { int currentColumn = app->getCurrentColumn()->getColumnIndex(); if (currentColumn != column) app->getCurrentColumn()->setColumnIndex(column); int currentRow = app->getCurrentFrame()->getFrameIndex(); TXshCell cell = xsheet->getCell(currentRow, column); if (cell.isEmpty() || cell.getSimpleLevel() != level) app->getCurrentFrame()->setFrameIndex(row); TCellSelection *selection = dynamic_cast<TCellSelection *>( app->getCurrentSelection()->getSelection()); if (selection) selection->selectNone(); } app->getCurrentLevel()->setLevel(level); m_paletteViewer->setPaletteHandle(ph); } else { m_paletteHandle->setPalette(ph->getPalette()); m_paletteViewer->setPaletteHandle(m_paletteHandle); } update(); }
void SceneViewerContextMenu::onSetCurrent() { TStageObjectId id; id.setCode(qobject_cast<QAction *>(sender())->data().toUInt()); TApp *app = TApp::instance(); if (id.isColumn()) { app->getCurrentColumn()->setColumnIndex(id.getIndex()); app->getCurrentObject()->setObjectId(id); } else { app->getCurrentObject()->setObjectId(id); app->getCurrentTool()->setTool(T_Edit); } }
void SceneViewer::onButtonPressed(FlipConsole::EGadget button) { if (m_freezedStatus != NO_FREEZED) return; switch (button) { case FlipConsole::eSaveImg: { if (m_previewMode == NO_PREVIEW) { DVGui::warning(QObject::tr( "It is not possible to save images in camera stand view.")); return; } TApp *app = TApp::instance(); int row = app->getCurrentFrame()->getFrame(); Previewer *previewer = Previewer::instance(m_previewMode == SUBCAMERA_PREVIEW); if (!previewer->isFrameReady(row)) { DVGui::warning(QObject::tr("The preview images are not ready yet.")); return; } TRasterP ras = previewer->getRaster(row, m_visualSettings.m_recomputeIfNeeded); TImageCache::instance()->add(QString("TnzCompareImg"), TRasterImageP(ras->clone())); break; } case FlipConsole::eSave: Previewer::instance(m_previewMode == SUBCAMERA_PREVIEW) ->saveRenderedFrames(); break; case FlipConsole::eHisto: { QAction *action = CommandManager::instance()->getAction(MI_Histogram); action->trigger(); break; } case FlipConsole::eDefineSubCamera: m_editPreviewSubCamera = !m_editPreviewSubCamera; update(); break; // open locator. Create one for the first time case FlipConsole::eLocator: if (!m_locator) m_locator = new LocatorPopup(this); m_locator->show(); m_locator->raise(); m_locator->activateWindow(); break; } }
int main(int argc, char* argv[]){ TApp app; // Init application. app.Init(); // Run it. app.Run(); // Release resources. app.Done(); return 0; }//end main
void TColumnSelection::hideColumns() { TApp *app = TApp::instance(); ColumnFan *columnFan = app->getCurrentXsheet()->getXsheet()->getColumnFan(); std::set<int>::iterator it = m_indices.begin(); for (; it != m_indices.end(); ++it) columnFan->deactivate(*it); m_indices.clear(); app->getCurrentXsheet()->notifyXsheetChanged(); // DA FARE (non c'e una notica per il solo cambiamento della testa delle // colonne) // TApp::instance()->->notify(TColumnHeadChange()); app->getCurrentScene()->setDirtyFlag(true); }
bool removeLevel(TXshLevel *level) { TApp *app = TApp::instance(); ToonzScene *scene = app->getCurrentScene()->getScene(); if (scene->getChildStack()->getTopXsheet()->isLevelUsed(level)) DVGui::error(QObject::tr("It is not possible to delete the used level %1.").arg(QString::fromStdWString(level->getName()))); //"E_CantDeleteUsedLevel_%1" else { TUndoManager *um = TUndoManager::manager(); um->add(new DeleteLevelUndo(level)); scene->getLevelSet()->removeLevel(level); } return true; }
void InsertEmptyColumnsUndo::undo() const { TApp *app = TApp::instance(); TXsheet *xsh = app->getCurrentXsheet()->getXsheet(); std::vector<std::pair<int, int>>::const_iterator bt, bEnd = m_columnBlocks.end(); for (bt = m_columnBlocks.begin(); bt != bEnd; ++bt) for (int n = 0; n != bt->second; ++n) xsh->removeColumn(bt->first); app->getCurrentScene()->setDirtyFlag(true); app->getCurrentXsheet()->notifyXsheetChanged(); app->getCurrentObject()->notifyObjectIdSwitched(); }
void InsertFxPopup::onReplace() { TFx *fx = createFx(); if (fx) { TApp *app = TApp::instance(); TXsheetHandle *xshHandle = app->getCurrentXsheet(); QList<TFxP> fxs; FxSelection *selection = dynamic_cast<FxSelection *>(app->getCurrentSelection()->getSelection()); if (selection) fxs = selection->getFxs(); TFxCommand::replaceFx(fx, fxs, app->getCurrentXsheet(), app->getCurrentFx()); xshHandle->notifyXsheetChanged(); } }
void TKeyframeSelection::unselectLockedColumn() { TApp *app = TApp::instance(); assert(app); TXsheet *xsh = app->getCurrentXsheet()->getXsheet(); std::set<Position> positions; std::set<Position>::iterator it; for (it = m_positions.begin(); it != m_positions.end(); ++it) { int col = it->second; if (col >= 0 && xsh->getColumn(col) && xsh->getColumn(col)->isLocked()) continue; positions.insert(*it); } m_positions.swap(positions); }
//************************************************************************ int main(void) { int i; cityList=new char*[cCities]; numList=new char*[cCities]; for (i=0; i<cCities; i++) { cityList[i]=new char[wCity]; strcpy(cityList[i],aCityList[i]); numList[i]=new char[wCity]; strcpy(numList[i],aNumList[i]); } TApp myApp; myApp.run(); return 0; }
void TApp::Idle(DWORD timeout) { TApp *app = TApp::GetApp(); DWORD start = GetTickCount(); MSG msg; while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (app->PreProcMsg(&msg)) continue; ::TranslateMessage(&msg); ::DispatchMessage(&msg); if (GetTickCount() - start >= timeout) break; } }
void InsertEmptyColumnsUndo::redo() const { TApp *app = TApp::instance(); TXsheet *xsh = app->getCurrentXsheet()->getXsheet(); // If this is the very first column, add one now since there is always // 1 visible on the screen but its not actually there yet. if (!xsh->getColumnCount()) xsh->insertColumn(0); std::vector<std::pair<int, int>>::const_reverse_iterator bt, bEnd = m_columnBlocks.rend(); for (bt = m_columnBlocks.rbegin(); bt != bEnd; ++bt) for (int n = 0; n != bt->second; ++n) xsh->insertColumn(bt->first); app->getCurrentScene()->setDirtyFlag(true); app->getCurrentXsheet()->notifyXsheetChanged(); app->getCurrentObject()->notifyObjectIdSwitched(); }
LRESULT CALLBACK TApp::WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { TApp *app = TApp::GetApp(); TWin *win = app->SearchWnd(hWnd); if (win) return win->WinProc(uMsg, wParam, lParam); if ((win = app->preWnd)) { app->preWnd = NULL; app->AddWinByWnd(win, hWnd); return win->WinProc(uMsg, wParam, lParam); } return ::DefWindowProc(hWnd, uMsg, wParam, lParam); }
void TStyleSelection::toggleLink() { if (!m_palette || m_pageIndex < 0) return; int n = m_styleIndicesInPage.size(); if (n <= 0) return; bool somethingHasBeenLinked = false; bool currentStyleIsInSelection = false; TApp *app = TApp::instance(); TPaletteHandle *ph = app->getCurrentPalette(); TPalette::Page *page = m_palette->getPage(m_pageIndex); assert(page); for (std::set<int>::iterator it = m_styleIndicesInPage.begin(); it != m_styleIndicesInPage.end(); ++it) { TColorStyle *cs = page->getStyle(*it); assert(cs); wstring name = cs->getGlobalName(); if (name != L"" && (name[0] == L'-' || name[0] == L'+')) { name[0] = name[0] == L'-' ? L'+' : L'-'; cs->setGlobalName(name); if (name[0] == L'+') somethingHasBeenLinked = true; } if (*it == m_palette->getPage(m_pageIndex)->search(ph->getStyleIndex())) currentStyleIsInSelection = true; } if (somethingHasBeenLinked) StudioPalette::instance()->updateLinkedColors(m_palette.getPointer()); ph->notifyPaletteChanged(); if (currentStyleIsInSelection) ph->notifyColorStyleSwitched(); // DA FARE: e' giusto mettere la nofica del dirty flag a current scene // o e' meglio farlo al livello corrente!? app->getCurrentScene()->setDirtyFlag(true); // extern void setPaletteDirtyFlag(); // setPaletteDirtyFlag(); }
FxParamEditorPopup::FxParamEditorPopup() : QDialog(TApp::instance()->getMainWindow()) { setWindowTitle(tr("Fx Settings")); setMinimumSize(20, 20); TApp *app = TApp::instance(); TSceneHandle *hScene = app->getCurrentScene(); TPixel32 col1, col2; Preferences::instance()->getChessboardColors(col1, col2); FxSettings *fxSettings = new FxSettings(this, col1, col2); fxSettings->setSceneHandle(hScene); fxSettings->setFxHandle(app->getCurrentFx()); fxSettings->setFrameHandle(app->getCurrentFrame()); fxSettings->setXsheetHandle(app->getCurrentXsheet()); fxSettings->setLevelHandle(app->getCurrentLevel()); fxSettings->setObjectHandle(app->getCurrentObject()); fxSettings->setCurrentFx(); QVBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->setMargin(0); mainLayout->setSpacing(10); { mainLayout->addWidget(fxSettings); } setLayout(mainLayout); move(parentWidget()->geometry().center() - rect().bottomRight() / 2.0); }