bool MovieEventHandlers::Call(string type, Movie *target) { PrepareTable(); const table_t::iterator it = table.find(type); if (it == table.end()) return false; Call((Type)it->second, target); return true; }
void MovieEventHandlers::Clear(string type) { PrepareTable(); const table_t::iterator it = table.find(type); if (it == table.end()) return; m_handlers[it->second].clear(); UpdateEmpty(); }
bool ButtonEventHandlers::Add( int eventId, string type, const ButtonEventHandler &h) { PrepareTable(); const table_t::iterator it = table.find(type); if (it == table.end()) return false; ButtonEventHandlerDictionary handlers; handlers[type] = h; Add(it->second, handlers, nullptr); return true; }
bool MovieEventHandlers::Add( int eventId, string type, const MovieEventHandler &h) { PrepareTable(); const table_t::iterator it = table.find(type); if (it == table.end()) return false; MovieEventHandlerDictionary handlers; handlers[type] = h; Add(eventId, handlers); return true; }
void ButtonEventHandlers::Clear(string type) { if (type == "keyPress") { m_keyPressHandler.clear(); } else { PrepareTable(); const table_t::iterator it = table.find(type); if (it == table.end()) return; m_handlers[it->second].clear(); } UpdateEmpty(); }
void MovieEventHandlers::Add(int eventId, const MovieEventHandlerDictionary &h) { MovieEventHandlerDictionary::const_iterator it(h.begin()), itend(h.end()); PrepareTable(); table_t::const_iterator titend(table.end()); for (; it != itend; ++it) { table_t::const_iterator tit(table.begin()); for (; tit != titend; ++tit) { if (it->first == tit->first) { m_handlers[tit->second].push_back( make_pair(eventId, it->second)); } } } if (m_empty) UpdateEmpty(); }
cKeyframeAnimation::cKeyframeAnimation(cInterface *_interface, cKeyframes *_frames, cImage *_image, QWidget *_imageWidget, cParameterContainer *_params, cFractalContainer *_fractal, QObject *parent) : QObject(parent), mainInterface(_interface), keyframes(_frames) { image = _image; imageWidget = _imageWidget; params = _params; fractalParams = _fractal; if (mainInterface->mainWindow) { ui = mainInterface->mainWindow->ui; QApplication::connect(ui->pushButton_add_keyframe, SIGNAL(clicked()), this, SLOT(slotAddKeyframe())); QApplication::connect(ui->pushButton_insert_keyframe, SIGNAL(clicked()), this, SLOT(slotInsertKeyframe())); QApplication::connect(ui->pushButton_delete_keyframe, SIGNAL(clicked()), this, SLOT(slotDeleteKeyframe())); QApplication::connect(ui->pushButton_modify_keyframe, SIGNAL(clicked()), this, SLOT(slotModifyKeyframe())); QApplication::connect(ui->pushButton_render_keyframe_animation, SIGNAL(clicked()), this, SLOT(slotRenderKeyframes())); QApplication::connect(ui->pushButton_delete_all_keyframe_images, SIGNAL(clicked()), this, SLOT(slotDeleteAllImages())); QApplication::connect(ui->pushButton_show_keyframe_animation, SIGNAL(clicked()), this, SLOT(slotShowAnimation())); QApplication::connect(ui->pushButton_refresh_keyframe_table, SIGNAL(clicked()), this, SLOT(slotRefreshTable())); QApplication::connect(ui->pushButton_keyframe_to_flight_export, SIGNAL(clicked()), this, SLOT(slotExportKeyframesToFlight())); QApplication::connect(ui->pushButton_check_for_collisions, SIGNAL(clicked()), this, SLOT(slotValidate())); QApplication::connect(ui->pushButton_set_constant_target_distance, SIGNAL(clicked()), this, SLOT(slotSetConstantTargetDistance())); QApplication::connect(ui->button_selectAnimKeyframeImageDir, SIGNAL(clicked()), this, SLOT(slotSelectKeyframeAnimImageDir())); QApplication::connect(ui->tableWidget_keyframe_animation, SIGNAL(cellChanged(int, int)), this, SLOT(slotTableCellChanged(int, int))); QApplication::connect(ui->spinboxInt_keyframe_first_to_render, SIGNAL(valueChanged(int)), this, SLOT(slotMovedSliderFirstFrame(int))); QApplication::connect(ui->spinboxInt_keyframe_last_to_render, SIGNAL(valueChanged(int)), this, SLOT(slotMovedSliderLastFrame(int))); QApplication::connect(ui->spinboxInt_frames_per_keyframe, SIGNAL(valueChanged(int)), this, SLOT(UpdateLimitsForFrameRange())); QApplication::connect(ui->tableWidget_keyframe_animation, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(slotCellDoubleClicked(int, int))); QApplication::connect(this, SIGNAL(QuestionMessage(const QString, const QString, QMessageBox::StandardButtons, QMessageBox::StandardButton*)), mainInterface->mainWindow, SLOT(slotQuestionMessage(const QString, const QString, QMessageBox::StandardButtons, QMessageBox::StandardButton*))); table = ui->tableWidget_keyframe_animation; //add default parameters for animation if (keyframes->GetListOfUsedParameters().size() == 0) { keyframes->AddAnimatedParameter("camera", params->GetAsOneParameter("camera")); keyframes->AddAnimatedParameter("target", params->GetAsOneParameter("target")); keyframes->AddAnimatedParameter("camera_top", params->GetAsOneParameter("camera_top")); if (mainInterface->mainWindow) PrepareTable(); } }