diff --git a/src/img/img/imgLandmarksDialog.cc b/src/img/img/imgLandmarksDialog.cc index 68d20b1c3..5c56ed768 100644 --- a/src/img/img/imgLandmarksDialog.cc +++ b/src/img/img/imgLandmarksDialog.cc @@ -406,7 +406,7 @@ LandmarksDialog::LandmarksDialog (QWidget *parent, img::Object &img) setupUi (this); - mp_image = navigator->setup (lay::PluginRoot::instance (), &img); + mp_image = navigator->setup (lay::Dispatcher::instance (), &img); connect (new_pb, SIGNAL (clicked ()), this, SLOT (update_mode ())); connect (delete_pb, SIGNAL (clicked ()), this, SLOT (update_mode ())); diff --git a/src/img/img/imgNavigator.cc b/src/img/img/imgNavigator.cc index 20d30b90e..ed65e0132 100644 --- a/src/img/img/imgNavigator.cc +++ b/src/img/img/imgNavigator.cc @@ -48,7 +48,7 @@ Navigator::Navigator (QWidget *parent) } img::Object * -Navigator::setup (lay::PluginRoot *root, img::Object *img) +Navigator::setup (lay::Dispatcher *root, img::Object *img) { mp_view = new lay::LayoutView (0, false, root, this, "img_navigator_view", lay::LayoutView::LV_Naked + lay::LayoutView::LV_NoZoom + lay::LayoutView::LV_NoServices + lay::LayoutView::LV_NoGrid); mp_view->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding); diff --git a/src/img/img/imgNavigator.h b/src/img/img/imgNavigator.h index b9873c7d4..7fb9c7adc 100644 --- a/src/img/img/imgNavigator.h +++ b/src/img/img/imgNavigator.h @@ -28,7 +28,7 @@ namespace lay { - class PluginRoot; + class Dispatcher; class LayoutView; class ZoomService; class ViewService; @@ -52,7 +52,7 @@ public: ~Navigator (); void background_color (QColor c); - img::Object *setup (lay::PluginRoot *root, img::Object *img); + img::Object *setup (lay::Dispatcher *root, img::Object *img); lay::LayoutView *view () { diff --git a/src/img/img/imgPlugin.cc b/src/img/img/imgPlugin.cc index 48dfe7a5c..fa88fe549 100644 --- a/src/img/img/imgPlugin.cc +++ b/src/img/img/imgPlugin.cc @@ -33,12 +33,12 @@ void PluginDeclaration::get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("image_group", "edit_menu.end")); - menu_entries.push_back (lay::MenuEntry ("img::add_image", "add_image:edit", "edit_menu.end", tl::to_string (QObject::tr ("Add Image")))); - menu_entries.push_back (lay::MenuEntry ("img::image_menu", "image_menu:edit", "edit_menu.end", tl::to_string (QObject::tr ("Images")), true)); - menu_entries.push_back (lay::MenuEntry ("img::bring_to_front", "bring_to_front:edit", "edit_menu.image_menu.end", tl::to_string (QObject::tr ("Image Stack: Selected Images to Front")))); - menu_entries.push_back (lay::MenuEntry ("img::bring_to_back", "bring_to_back:edit", "edit_menu.image_menu.end", tl::to_string (QObject::tr ("Image Stack: Selected Images to Back")))); - menu_entries.push_back (lay::MenuEntry ("img::clear_all_images", "clear_all_images:edit", "edit_menu.image_menu.end", tl::to_string (QObject::tr ("Clear All Images")))); + menu_entries.push_back (lay::separator ("image_group", "edit_menu.end")); + menu_entries.push_back (lay::menu_item ("img::add_image", "add_image:edit", "edit_menu.end", tl::to_string (QObject::tr ("Add Image")))); + menu_entries.push_back (lay::submenu ("img::image_menu", "image_menu:edit", "edit_menu.end", tl::to_string (QObject::tr ("Images")))); + menu_entries.push_back (lay::menu_item ("img::bring_to_front", "bring_to_front:edit", "edit_menu.image_menu.end", tl::to_string (QObject::tr ("Image Stack: Selected Images to Front")))); + menu_entries.push_back (lay::menu_item ("img::bring_to_back", "bring_to_back:edit", "edit_menu.image_menu.end", tl::to_string (QObject::tr ("Image Stack: Selected Images to Back")))); + menu_entries.push_back (lay::menu_item ("img::clear_all_images", "clear_all_images:edit", "edit_menu.image_menu.end", tl::to_string (QObject::tr ("Clear All Images")))); } lay::Plugin * diff --git a/src/lay/lay/gsiDeclLayApplication.cc b/src/lay/lay/gsiDeclLayApplication.cc index 585971789..8c325a5ed 100644 --- a/src/lay/lay/gsiDeclLayApplication.cc +++ b/src/lay/lay/gsiDeclLayApplication.cc @@ -90,8 +90,8 @@ static gsi::Methods application_methods () method ("is_editable?", &C::is_editable, "@brief Returns true if the application is in editable mode\n" ) + - // TODO: basically this method belongs to PluginRoot (aka MainWindow). - // There is separate declaration for PluginRoot which we have to synchronize + // TODO: basically this method belongs to Dispatcher (aka MainWindow). + // There is separate declaration for Dispatcher which we have to synchronize // with this method. method ("get_config", &C::get_config, "@brief Gets the value for a configuration parameter\n" @@ -109,8 +109,8 @@ static gsi::Methods application_methods () "to the configuration parameter. The values delivered by this method correspond to the values stored " "in the configuration file " ) + - // TODO: basically this method belongs to PluginRoot (aka MainWindow). - // There is separate declaration for PluginRoot which we have to synchronize + // TODO: basically this method belongs to Dispatcher (aka MainWindow). + // There is separate declaration for Dispatcher which we have to synchronize // with this method. method > ("get_config_names", &C::get_config_names, "@brief Gets the configuration parameter names\n" @@ -120,8 +120,8 @@ static gsi::Methods application_methods () "This method returns the names of all known configuration parameters. These names can be used to " "get and set configuration parameter values." ) + - // TODO: basically this method belongs to PluginRoot (aka MainWindow). - // There is separate declaration for PluginRoot which we have to synchronize + // TODO: basically this method belongs to Dispatcher (aka MainWindow). + // There is separate declaration for Dispatcher which we have to synchronize // with this method. method ("set_config", &C::set_config, "@brief Sets a configuration parameter with the given name to the given value\n" @@ -138,8 +138,8 @@ static gsi::Methods application_methods () "It is possible to write an arbitrary name/value pair into the configuration database which then is " "written to the configuration file." ) + - // TODO: basically this method belongs to PluginRoot (aka MainWindow). - // There is separate declaration for PluginRoot which we have to synchronize + // TODO: basically this method belongs to Dispatcher (aka MainWindow). + // There is separate declaration for Dispatcher which we have to synchronize // with this method. method ("commit_config", &C::config_end, "@brief Commits the configuration settings\n" @@ -150,8 +150,8 @@ static gsi::Methods application_methods () "\n" "This method has been introduced in version 0.25.\n" ) + - // TODO: basically this method belongs to PluginRoot (aka MainWindow). - // There is separate declaration for PluginRoot which we have to synchronize + // TODO: basically this method belongs to Dispatcher (aka MainWindow). + // There is separate declaration for Dispatcher which we have to synchronize // with this method. method ("write_config", &C::write_config, "@brief Writes configuration to a file\n" @@ -161,8 +161,8 @@ static gsi::Methods application_methods () "If the configuration file cannot be written, \n" "is returned but no exception is thrown.\n" ) + - // TODO: basically this method belongs to PluginRoot (aka MainWindow). - // There is separate declaration for PluginRoot which we have to synchronize + // TODO: basically this method belongs to Dispatcher (aka MainWindow). + // There is separate declaration for Dispatcher which we have to synchronize // with this method. method ("read_config", &C::read_config, "@brief Reads the configuration from a file\n" diff --git a/src/lay/lay/layApplication.cc b/src/lay/lay/layApplication.cc index f7fd82d16..8609ff904 100644 --- a/src/lay/lay/layApplication.cc +++ b/src/lay/lay/layApplication.cc @@ -605,7 +605,7 @@ ApplicationBase::init_app () bool editable_from_config = false; { - lay::Dispatcher cfg; + lay::Dispatcher cfg (0); for (std::vector ::const_iterator c = m_config_files.begin (); c != m_config_files.end (); ++c) { try { diff --git a/src/lay/lay/layClipDialog.cc b/src/lay/lay/layClipDialog.cc index 5a0c1da46..f9346b3fb 100644 --- a/src/lay/lay/layClipDialog.cc +++ b/src/lay/lay/layClipDialog.cc @@ -52,7 +52,7 @@ public: virtual void get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("clip_tool::show", "clip_tool:edit_mode", "edit_menu.utils_menu.end", tl::to_string (QObject::tr ("Clip Tool")))); + menu_entries.push_back (lay::menu_item ("clip_tool::show", "clip_tool:edit_mode", "edit_menu.utils_menu.end", tl::to_string (QObject::tr ("Clip Tool")))); } virtual lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *root, lay::LayoutView *view) const diff --git a/src/lay/lay/layFillDialog.cc b/src/lay/lay/layFillDialog.cc index 3abd11490..dd6e40388 100644 --- a/src/lay/lay/layFillDialog.cc +++ b/src/lay/lay/layFillDialog.cc @@ -59,7 +59,7 @@ public: virtual void get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("fill_tool::show", "fill_tool:edit_mode", "edit_menu.utils_menu.end", tl::to_string (QObject::tr ("Fill Tool")))); + menu_entries.push_back (lay::menu_item ("fill_tool::show", "fill_tool:edit_mode", "edit_menu.utils_menu.end", tl::to_string (QObject::tr ("Fill Tool")))); } virtual lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *root, lay::LayoutView *view) const diff --git a/src/lay/lay/layFillDialog.h b/src/lay/lay/layFillDialog.h index 520ff4907..ecd2a4639 100644 --- a/src/lay/lay/layFillDialog.h +++ b/src/lay/lay/layFillDialog.h @@ -43,7 +43,7 @@ class FillDialog Q_OBJECT public: - FillDialog (lay::PluginRoot *root, lay::LayoutView *view); + FillDialog (lay::Dispatcher *root, lay::LayoutView *view); ~FillDialog (); public slots: diff --git a/src/lay/lay/layFontController.cc b/src/lay/lay/layFontController.cc index dc4e560ae..6c2525722 100644 --- a/src/lay/lay/layFontController.cc +++ b/src/lay/lay/layFontController.cc @@ -40,7 +40,7 @@ FontController::FontController () } void -FontController::initialize (lay::PluginRoot * /*root*/) +FontController::initialize (lay::Dispatcher * /*root*/) { // NOTE: we initialize the dirs in the stage once to have them available for the autorun // macros. We'll do that later again in order to pull in the dirs from the packages. @@ -48,7 +48,7 @@ FontController::initialize (lay::PluginRoot * /*root*/) } void -FontController::initialized (lay::PluginRoot * /*root*/) +FontController::initialized (lay::Dispatcher * /*root*/) { if (lay::SaltController::instance ()) { connect (lay::SaltController::instance (), SIGNAL (salt_changed ()), this, SLOT (sync_with_external_sources ())); @@ -64,7 +64,7 @@ FontController::initialized (lay::PluginRoot * /*root*/) } void -FontController::uninitialize (lay::PluginRoot * /*root*/) +FontController::uninitialize (lay::Dispatcher * /*root*/) { if (m_file_watcher) { disconnect (m_file_watcher, SIGNAL (fileChanged (const QString &)), this, SLOT (file_watcher_triggered ())); @@ -103,7 +103,7 @@ FontController::config_finalize() } bool -FontController::can_exit (lay::PluginRoot * /*root*/) const +FontController::can_exit (lay::Dispatcher * /*root*/) const { // .. nothing yet .. return true; diff --git a/src/lay/lay/layFontController.h b/src/lay/lay/layFontController.h index 5384621eb..ed02fb1a2 100644 --- a/src/lay/lay/layFontController.h +++ b/src/lay/lay/layFontController.h @@ -65,17 +65,17 @@ public: /** * @brief Reimplementation of the PluginDeclaration interface */ - virtual void initialize (lay::PluginRoot *root); + virtual void initialize (lay::Dispatcher *root); /** * @brief Reimplementation of the PluginDeclaration interface */ - virtual void initialized (lay::PluginRoot *root); + virtual void initialized (lay::Dispatcher *root); /** * @brief Reimplementation of the PluginDeclaration interface */ - virtual void uninitialize (lay::PluginRoot *root); + virtual void uninitialize (lay::Dispatcher *root); /** * @brief Reimplementation of the PluginDeclaration interface @@ -100,7 +100,7 @@ public: /** * @brief Reimplementation of the PluginDeclaration interface */ - bool can_exit (lay::PluginRoot *root) const; + bool can_exit (lay::Dispatcher *root) const; /** * @brief Gets the singleton instance for this object diff --git a/src/lay/lay/layLibraryController.cc b/src/lay/lay/layLibraryController.cc index 2636a4ede..b9b304d37 100644 --- a/src/lay/lay/layLibraryController.cc +++ b/src/lay/lay/layLibraryController.cc @@ -45,7 +45,7 @@ LibraryController::LibraryController () } void -LibraryController::initialize (lay::PluginRoot * /*root*/) +LibraryController::initialize (lay::Dispatcher * /*root*/) { // NOTE: we initialize the libraries in the stage once to have them available for the autorun // macros. We'll do that later again in order to pull in the libraries from the packages. @@ -53,7 +53,7 @@ LibraryController::initialize (lay::PluginRoot * /*root*/) } void -LibraryController::initialized (lay::PluginRoot * /*root*/) +LibraryController::initialized (lay::Dispatcher * /*root*/) { if (lay::SaltController::instance ()) { connect (lay::SaltController::instance (), SIGNAL (salt_changed ()), this, SLOT (sync_with_external_sources ())); @@ -69,7 +69,7 @@ LibraryController::initialized (lay::PluginRoot * /*root*/) } void -LibraryController::uninitialize (lay::PluginRoot * /*root*/) +LibraryController::uninitialize (lay::Dispatcher * /*root*/) { if (m_file_watcher) { disconnect (m_file_watcher, SIGNAL (fileChanged (const QString &)), this, SLOT (file_watcher_triggered ())); @@ -108,7 +108,7 @@ LibraryController::config_finalize() } bool -LibraryController::can_exit (lay::PluginRoot * /*root*/) const +LibraryController::can_exit (lay::Dispatcher * /*root*/) const { // .. nothing yet .. return true; diff --git a/src/lay/lay/layLibraryController.h b/src/lay/lay/layLibraryController.h index 1adf75370..86c0bfdcd 100644 --- a/src/lay/lay/layLibraryController.h +++ b/src/lay/lay/layLibraryController.h @@ -65,17 +65,17 @@ public: /** * @brief Reimplementation of the PluginDeclaration interface */ - virtual void initialize (lay::PluginRoot *root); + virtual void initialize (lay::Dispatcher *root); /** * @brief Reimplementation of the PluginDeclaration interface */ - virtual void initialized (lay::PluginRoot *root); + virtual void initialized (lay::Dispatcher *root); /** * @brief Reimplementation of the PluginDeclaration interface */ - virtual void uninitialize (lay::PluginRoot *root); + virtual void uninitialize (lay::Dispatcher *root); /** * @brief Reimplementation of the PluginDeclaration interface @@ -100,7 +100,7 @@ public: /** * @brief Reimplementation of the PluginDeclaration interface */ - bool can_exit (lay::PluginRoot *root) const; + bool can_exit (lay::Dispatcher *root) const; /** * @brief Gets the singleton instance for this object diff --git a/src/lay/lay/layMacroController.cc b/src/lay/lay/layMacroController.cc index e2847f728..adda83d33 100644 --- a/src/lay/lay/layMacroController.cc +++ b/src/lay/lay/layMacroController.cc @@ -169,7 +169,7 @@ MacroController::finish () } void -MacroController::initialized (lay::PluginRoot *root) +MacroController::initialized (lay::Dispatcher *root) { connect (&m_temp_macros, SIGNAL (menu_needs_update ()), this, SLOT (macro_collection_changed ())); connect (&m_temp_macros, SIGNAL (macro_collection_changed (lym::MacroCollection *)), this, SLOT (macro_collection_changed ())); @@ -205,7 +205,7 @@ MacroController::initialized (lay::PluginRoot *root) } void -MacroController::uninitialize (lay::PluginRoot * /*root*/) +MacroController::uninitialize (lay::Dispatcher * /*root*/) { disconnect (&lym::MacroCollection::root (), SIGNAL (menu_needs_update ()), this, SLOT (macro_collection_changed ())); disconnect (&lym::MacroCollection::root (), SIGNAL (macro_collection_changed (lym::MacroCollection *)), this, SLOT (macro_collection_changed ())); @@ -247,7 +247,7 @@ MacroController::config_finalize() } bool -MacroController::can_exit (lay::PluginRoot * /*root*/) const +MacroController::can_exit (lay::Dispatcher * /*root*/) const { if (mp_macro_editor) { return mp_macro_editor->can_exit (); diff --git a/src/lay/lay/layMacroEditorDialog.cc b/src/lay/lay/layMacroEditorDialog.cc index ec51d54a5..6fb47867b 100644 --- a/src/lay/lay/layMacroEditorDialog.cc +++ b/src/lay/lay/layMacroEditorDialog.cc @@ -228,7 +228,7 @@ public: static lay::MacroEditorDialog *s_macro_editor_instance = 0; -MacroEditorDialog::MacroEditorDialog (lay::PluginRoot *pr, lym::MacroCollection *root) +MacroEditorDialog::MacroEditorDialog (lay::Dispatcher *pr, lym::MacroCollection *root) : QDialog (0 /*show as individual top widget*/, Qt::Window), lay::Plugin (pr, true), mp_plugin_root (pr), @@ -2278,7 +2278,7 @@ MacroEditorDialog::ensure_writeable_collection_selected () } static std::vector > -get_custom_paths (lay::PluginRoot *root) +get_custom_paths (lay::Dispatcher *root) { std::vector > paths; @@ -2306,7 +2306,7 @@ get_custom_paths (lay::PluginRoot *root) } static void -set_custom_paths (lay::PluginRoot *root, const std::vector > &paths) +set_custom_paths (lay::Dispatcher *root, const std::vector > &paths) { std::string mp; diff --git a/src/lay/lay/layMacroEditorSetupPage.cc b/src/lay/lay/layMacroEditorSetupPage.cc index e615536f4..98c99ee14 100644 --- a/src/lay/lay/layMacroEditorSetupPage.cc +++ b/src/lay/lay/layMacroEditorSetupPage.cc @@ -25,6 +25,7 @@ #include "layMacroEditorPage.h" #include "layMacroEditorDialog.h" #include "layGenericSyntaxHighlighter.h" +#include "layDispatcher.h" #include "lymMacro.h" @@ -56,7 +57,7 @@ struct MacroEditorSetupDialogData int font_size; std::set ignore_exceptions_list; - void setup (lay::PluginRoot *root) + void setup (lay::Dispatcher *root) { lay::MacroEditorHighlighters highlighters (this); std::string styles; @@ -91,7 +92,7 @@ struct MacroEditorSetupDialogData } } - void commit (lay::PluginRoot *root) + void commit (lay::Dispatcher *root) { lay::MacroEditorHighlighters highlighters (this); @@ -201,7 +202,7 @@ MacroEditorSetupPage::update_font () } void -MacroEditorSetupPage::setup (PluginRoot *root) +MacroEditorSetupPage::setup (Dispatcher *root) { delete mp_data; mp_data = new MacroEditorSetupDialogData (this); @@ -268,7 +269,7 @@ MacroEditorSetupPage::setup (PluginRoot *root) } void -MacroEditorSetupPage::commit (PluginRoot *root) +MacroEditorSetupPage::commit (Dispatcher *root) { if (styles_list->currentItem ()) { commit_attributes (styles_list->currentItem ()); diff --git a/src/lay/lay/layMacroEditorSetupPage.h b/src/lay/lay/layMacroEditorSetupPage.h index 6845da572..bd884fc57 100644 --- a/src/lay/lay/layMacroEditorSetupPage.h +++ b/src/lay/lay/layMacroEditorSetupPage.h @@ -44,8 +44,8 @@ public: MacroEditorSetupPage (QWidget *parent); ~MacroEditorSetupPage (); - virtual void setup (PluginRoot *root); - virtual void commit (PluginRoot *root); + virtual void setup (Dispatcher *root); + virtual void commit (Dispatcher *root); protected slots: void current_attribute_changed (QListWidgetItem *current, QListWidgetItem *previous); diff --git a/src/lay/lay/layMainConfigPages.cc b/src/lay/lay/layMainConfigPages.cc index 1c3b37ffd..c3d63e1b6 100644 --- a/src/lay/lay/layMainConfigPages.cc +++ b/src/lay/lay/layMainConfigPages.cc @@ -116,7 +116,7 @@ MainConfigPage::~MainConfigPage () } void -MainConfigPage::setup (lay::PluginRoot *root) +MainConfigPage::setup (lay::Dispatcher *root) { double grid_micron = 0.0; root->config_get (cfg_grid, grid_micron); @@ -124,7 +124,7 @@ MainConfigPage::setup (lay::PluginRoot *root) } void -MainConfigPage::commit (lay::PluginRoot *root) +MainConfigPage::commit (lay::Dispatcher *root) { try { double g; @@ -150,7 +150,7 @@ MainConfigPage6::~MainConfigPage6 () } void -MainConfigPage6::setup (lay::PluginRoot *root) +MainConfigPage6::setup (lay::Dispatcher *root) { int cp = 32; root->config_get (cfg_circle_points, cp); @@ -158,7 +158,7 @@ MainConfigPage6::setup (lay::PluginRoot *root) } void -MainConfigPage6::commit (lay::PluginRoot *root) +MainConfigPage6::commit (lay::Dispatcher *root) { try { int cp = 32; @@ -185,7 +185,7 @@ MainConfigPage7::~MainConfigPage7 () } void -MainConfigPage7::setup (lay::PluginRoot *root) +MainConfigPage7::setup (lay::Dispatcher *root) { bool en = true; root->config_get (cfg_layout_file_watcher_enabled, en); @@ -193,7 +193,7 @@ MainConfigPage7::setup (lay::PluginRoot *root) } void -MainConfigPage7::commit (lay::PluginRoot *root) +MainConfigPage7::commit (lay::Dispatcher *root) { try { root->config_set (cfg_layout_file_watcher_enabled, mp_ui->check_for_updates->isChecked ()); @@ -217,7 +217,7 @@ MainConfigPage2::~MainConfigPage2 () } void -MainConfigPage2::setup (lay::PluginRoot *root) +MainConfigPage2::setup (lay::Dispatcher *root) { bool flag = false; root->config_get (cfg_synchronized_views, flag); @@ -225,7 +225,7 @@ MainConfigPage2::setup (lay::PluginRoot *root) } void -MainConfigPage2::commit (lay::PluginRoot *root) +MainConfigPage2::commit (lay::Dispatcher *root) { root->config_set (cfg_synchronized_views, mp_ui->sync_views_cbx->isChecked ()); } @@ -247,7 +247,7 @@ MainConfigPage3::~MainConfigPage3 () } void -MainConfigPage3::setup (lay::PluginRoot *root) +MainConfigPage3::setup (lay::Dispatcher *root) { std::string default_grids; root->config_get (cfg_default_grids, default_grids); @@ -255,7 +255,7 @@ MainConfigPage3::setup (lay::PluginRoot *root) } void -MainConfigPage3::commit (lay::PluginRoot *root) +MainConfigPage3::commit (lay::Dispatcher *root) { root->config_set (cfg_default_grids, tl::to_string (mp_ui->grids_edit->text ())); } @@ -277,7 +277,7 @@ MainConfigPage4::~MainConfigPage4 () } void -MainConfigPage4::setup (lay::PluginRoot *root) +MainConfigPage4::setup (lay::Dispatcher *root) { bool flag = true; root->config_get (cfg_edit_mode, flag); @@ -285,7 +285,7 @@ MainConfigPage4::setup (lay::PluginRoot *root) } void -MainConfigPage4::commit (lay::PluginRoot *root) +MainConfigPage4::commit (lay::Dispatcher *root) { root->config_set (cfg_edit_mode, mp_ui->edit_mode_cbx->isChecked ()); } @@ -307,7 +307,7 @@ MainConfigPage5::~MainConfigPage5 () } void -MainConfigPage5::setup (lay::PluginRoot *root) +MainConfigPage5::setup (lay::Dispatcher *root) { int d; d = 5; @@ -319,7 +319,7 @@ MainConfigPage5::setup (lay::PluginRoot *root) } void -MainConfigPage5::commit (lay::PluginRoot *root) +MainConfigPage5::commit (lay::Dispatcher *root) { root->config_set (cfg_micron_digits, mp_ui->micron_digits->value ()); root->config_set (cfg_dbu_digits, mp_ui->dbu_digits->value ()); @@ -502,7 +502,7 @@ CustomizeMenuConfigPage::apply (const std::vectorconfig_get (cfg_key_bindings, packed_key_bindings); @@ -516,7 +516,7 @@ CustomizeMenuConfigPage::setup (lay::PluginRoot *root) } void -CustomizeMenuConfigPage::commit (lay::PluginRoot *root) +CustomizeMenuConfigPage::commit (lay::Dispatcher *root) { current_changed (0, mp_ui->bindings_list->currentItem ()); diff --git a/src/lay/lay/layMainWindow.cc b/src/lay/lay/layMainWindow.cc index 74560e83e..4da3a5cf2 100644 --- a/src/lay/lay/layMainWindow.cc +++ b/src/lay/lay/layMainWindow.cc @@ -4073,7 +4073,7 @@ MainWindow::plugin_removed (lay::PluginDeclaration *cls) } // ------------------------------------------------------------ -// Implementation of the PluginRootToMainWindow bride +// Implementation of the DispatcherToMainWindow bride DispatcherToMainWindow::DispatcherToMainWindow () : lay::Dispatcher (0, false), diff --git a/src/lay/lay/laySaltController.cc b/src/lay/lay/laySaltController.cc index d5205d321..a89865250 100644 --- a/src/lay/lay/laySaltController.cc +++ b/src/lay/lay/laySaltController.cc @@ -43,14 +43,14 @@ SaltController::SaltController () } void -SaltController::initialize (lay::PluginRoot *root) +SaltController::initialize (lay::Dispatcher *root) { mp_mw = lay::MainWindow::instance (); mp_plugin_root = root; } void -SaltController::initialized (lay::PluginRoot * /*root*/) +SaltController::initialized (lay::Dispatcher * /*root*/) { if (! m_file_watcher) { m_file_watcher = new tl::FileSystemWatcher (this); @@ -62,7 +62,7 @@ SaltController::initialized (lay::PluginRoot * /*root*/) } void -SaltController::uninitialize (lay::PluginRoot * /*root*/) +SaltController::uninitialize (lay::Dispatcher * /*root*/) { disconnect (&m_salt, SIGNAL (collections_changed ()), this, SIGNAL (salt_changed ())); @@ -103,7 +103,7 @@ SaltController::config_finalize() } bool -SaltController::can_exit (lay::PluginRoot * /*root*/) const +SaltController::can_exit (lay::Dispatcher * /*root*/) const { // .. nothing yet .. return true; diff --git a/src/lay/lay/laySearchReplaceConfigPage.cc b/src/lay/lay/laySearchReplaceConfigPage.cc index 55226044f..f08d6c7df 100644 --- a/src/lay/lay/laySearchReplaceConfigPage.cc +++ b/src/lay/lay/laySearchReplaceConfigPage.cc @@ -22,6 +22,7 @@ #include "laySearchReplaceConfigPage.h" +#include "layDispatcher.h" namespace lay { @@ -76,7 +77,7 @@ SearchReplaceConfigPage::SearchReplaceConfigPage (QWidget *parent) } void -SearchReplaceConfigPage::setup (lay::PluginRoot *root) +SearchReplaceConfigPage::setup (lay::Dispatcher *root) { std::string value; @@ -106,7 +107,7 @@ SearchReplaceConfigPage::window_changed (int m) } void -SearchReplaceConfigPage::commit (lay::PluginRoot *root) +SearchReplaceConfigPage::commit (lay::Dispatcher *root) { double dim = 1.0; tl::from_string (tl::to_string (le_window->text ()), dim); diff --git a/src/lay/lay/laySearchReplaceConfigPage.h b/src/lay/lay/laySearchReplaceConfigPage.h index 9d7a38e86..8e126a068 100644 --- a/src/lay/lay/laySearchReplaceConfigPage.h +++ b/src/lay/lay/laySearchReplaceConfigPage.h @@ -55,8 +55,8 @@ class SearchReplaceConfigPage public: SearchReplaceConfigPage (QWidget *parent); - virtual void setup (lay::PluginRoot *root); - virtual void commit (lay::PluginRoot *root); + virtual void setup (lay::Dispatcher *root); + virtual void commit (lay::Dispatcher *root); public slots: void window_changed (int); diff --git a/src/lay/lay/laySearchReplaceDialog.cc b/src/lay/lay/laySearchReplaceDialog.cc index 617d71973..be058866a 100644 --- a/src/lay/lay/laySearchReplaceDialog.cc +++ b/src/lay/lay/laySearchReplaceDialog.cc @@ -697,7 +697,7 @@ fill_ctx_cbx (QComboBox *cbx) cbx->addItem (QObject::tr ("All cells")); } -SearchReplaceDialog::SearchReplaceDialog (lay::PluginRoot *root, lay::LayoutView *view) +SearchReplaceDialog::SearchReplaceDialog (lay::Dispatcher *root, lay::LayoutView *view) : lay::Browser (root, view), Ui::SearchReplaceDialog (), mp_view (view), @@ -768,7 +768,7 @@ SearchReplaceDialog::~SearchReplaceDialog () } static void -save_states (QStackedWidget *sw, const std::string &pfx, lay::PluginRoot *config_root) +save_states (QStackedWidget *sw, const std::string &pfx, lay::Dispatcher *config_root) { for (int i = 0; i < sw->count (); ++i) { SearchReplacePropertiesWidget *pw = dynamic_cast (sw->widget (i)); @@ -779,7 +779,7 @@ save_states (QStackedWidget *sw, const std::string &pfx, lay::PluginRoot *config } static void -restore_states (QStackedWidget *sw, const std::string &pfx, lay::PluginRoot *config_root) +restore_states (QStackedWidget *sw, const std::string &pfx, lay::Dispatcher *config_root) { for (int i = 0; i < sw->count (); ++i) { SearchReplacePropertiesWidget *pw = dynamic_cast (sw->widget (i)); @@ -813,7 +813,7 @@ ctx_from_index (int index) void SearchReplaceDialog::restore_state () { - lay::PluginRoot *config_root = root (); + lay::Dispatcher *config_root = root (); restore_states (find_properties, "sr-find", config_root); restore_states (delete_properties, "sr-find", config_root); @@ -881,7 +881,7 @@ SearchReplaceDialog::restore_state () void SearchReplaceDialog::save_state () { - lay::PluginRoot *config_root = root (); + lay::Dispatcher *config_root = root (); config_root->config_set (cfg_sr_window_state, lay::save_dialog_state (this)); @@ -1877,7 +1877,7 @@ SearchReplaceDialog::tab_index_changed (int index) { cancel (); - lay::PluginRoot *config_root = root (); + lay::Dispatcher *config_root = root (); std::string v; diff --git a/src/lay/lay/laySearchReplaceDialog.h b/src/lay/lay/laySearchReplaceDialog.h index f9faf99d4..56c2ea71e 100644 --- a/src/lay/lay/laySearchReplaceDialog.h +++ b/src/lay/lay/laySearchReplaceDialog.h @@ -164,7 +164,7 @@ public: std::string text; }; - SearchReplaceDialog (lay::PluginRoot *root, lay::LayoutView *view); + SearchReplaceDialog (lay::Dispatcher *root, lay::LayoutView *view); ~SearchReplaceDialog (); private: diff --git a/src/lay/lay/laySearchReplacePlugin.cc b/src/lay/lay/laySearchReplacePlugin.cc index c6649c3cf..41c04cfd5 100644 --- a/src/lay/lay/laySearchReplacePlugin.cc +++ b/src/lay/lay/laySearchReplacePlugin.cc @@ -56,14 +56,14 @@ public: lay::PluginDeclaration::get_menu_entries (menu_entries); // separator: - menu_entries.push_back (lay::MenuEntry ("search_replace_sep", "edit_menu.utils_group+")); + menu_entries.push_back (lay::separator ("search_replace_sep", "edit_menu.utils_group+")); // two entries - one for view mode and one for edit mode: - menu_entries.push_back (lay::MenuEntry ("search_replace::show", "search_replace_editor:edit:edit_mode", "edit_menu.utils_group+", tl::to_string (QObject::tr ("Search and Replace")))); - menu_entries.push_back (lay::MenuEntry ("search_replace::show", "search_replace_viewer:edit:view_mode", "edit_menu.utils_group+", tl::to_string (QObject::tr ("Search")))); + menu_entries.push_back (lay::menu_item ("search_replace::show", "search_replace_editor:edit:edit_mode", "edit_menu.utils_group+", tl::to_string (QObject::tr ("Search and Replace")))); + menu_entries.push_back (lay::menu_item ("search_replace::show", "search_replace_viewer:edit:view_mode", "edit_menu.utils_group+", tl::to_string (QObject::tr ("Search")))); } - virtual lay::Plugin *create_plugin (db::Manager *, lay::PluginRoot *root, lay::LayoutView *view) const + virtual lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *root, lay::LayoutView *view) const { return new SearchReplaceDialog (root, view); } diff --git a/src/lay/lay/laySearchReplacePropertiesWidgets.cc b/src/lay/lay/laySearchReplacePropertiesWidgets.cc index 79c9d1c00..c135d9307 100644 --- a/src/lay/lay/laySearchReplacePropertiesWidgets.cc +++ b/src/lay/lay/laySearchReplacePropertiesWidgets.cc @@ -325,7 +325,7 @@ public: setupUi (this); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_instance_cellname_op, v)) { @@ -336,7 +336,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_instance_cellname_op, tl::to_string (instance_cellname_op->currentText ())); config_root->config_set (pfx + cfg_suffix_instance_cellname_value, tl::to_string (instance_cellname_value->text ())); @@ -386,7 +386,7 @@ public: shape_layer->set_new_layer_enabled (false); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_shape_layer, v)) { @@ -406,7 +406,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_shape_layer, tl::to_string (shape_layer->currentText ())); config_root->config_set (pfx + cfg_suffix_shape_area_op, tl::to_string (shape_area_op->currentText ())); @@ -454,7 +454,7 @@ public: // .. nothing yet .. } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_polygon_layer, v)) { @@ -474,7 +474,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_polygon_layer, tl::to_string (shape_layer->currentText ())); config_root->config_set (pfx + cfg_suffix_polygon_area_op, tl::to_string (shape_area_op->currentText ())); @@ -527,7 +527,7 @@ public: box_layer->set_new_layer_enabled (false); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_box_layer, v)) { @@ -547,7 +547,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_box_layer, tl::to_string (box_layer->currentText ())); config_root->config_set (pfx + cfg_suffix_box_width_op, tl::to_string (box_width_op->currentText ())); @@ -602,7 +602,7 @@ public: path_layer->set_new_layer_enabled (false); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_path_layer, v)) { @@ -622,7 +622,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_path_layer, tl::to_string (path_layer->currentText ())); config_root->config_set (pfx + cfg_suffix_path_width_op, tl::to_string (path_width_op->currentText ())); @@ -675,7 +675,7 @@ public: text_layer->set_new_layer_enabled (false); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_text_layer, v)) { @@ -701,7 +701,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_text_layer, tl::to_string (text_layer->currentText ())); config_root->config_set (pfx + cfg_suffix_text_string_op, tl::to_string (text_string_op->currentText ())); @@ -753,7 +753,7 @@ public: setupUi (this); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_instance_cellname_value, v)) { @@ -761,7 +761,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_instance_cellname_value, tl::to_string (instance_cellname->text ())); } @@ -795,7 +795,7 @@ public: shape_layer->set_no_layer_available (true); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_shape_layer, v)) { @@ -803,7 +803,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_shape_layer, tl::to_string (shape_layer->currentText ())); } @@ -833,7 +833,7 @@ public: // .. nothing yet .. } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_polygon_layer, v)) { @@ -841,7 +841,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_polygon_layer, tl::to_string (shape_layer->currentText ())); } @@ -875,7 +875,7 @@ public: box_layer->set_no_layer_available (true); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_box_layer, v)) { @@ -889,7 +889,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_box_layer, tl::to_string (box_layer->currentText ())); config_root->config_set (pfx + cfg_suffix_box_width_value, tl::to_string (box_width->text ())); @@ -927,7 +927,7 @@ public: path_layer->set_no_layer_available (true); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_path_layer, v)) { @@ -938,7 +938,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_path_layer, tl::to_string (path_layer->currentText ())); config_root->config_set (pfx + cfg_suffix_path_width_value, tl::to_string (path_width->text ())); @@ -974,7 +974,7 @@ public: text_layer->set_no_layer_available (true); } - void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const + void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const { std::string v; if (config_root->config_get (pfx + cfg_suffix_text_layer, v)) { @@ -991,7 +991,7 @@ public: } } - void save_state (const std::string &pfx, lay::PluginRoot *config_root) const + void save_state (const std::string &pfx, lay::Dispatcher *config_root) const { config_root->config_set (pfx + cfg_suffix_text_layer, tl::to_string (text_layer->currentText ())); config_root->config_set (pfx + cfg_suffix_text_string_value, tl::to_string (text_string->text ())); diff --git a/src/lay/lay/laySearchReplacePropertiesWidgets.h b/src/lay/lay/laySearchReplacePropertiesWidgets.h index 1aecd3f51..397d25c1a 100644 --- a/src/lay/lay/laySearchReplacePropertiesWidgets.h +++ b/src/lay/lay/laySearchReplacePropertiesWidgets.h @@ -37,7 +37,7 @@ namespace db namespace lay { -class PluginRoot; +class Dispatcher; /** * @brief A base class for the search and replace properties widgets @@ -50,8 +50,8 @@ public: : QWidget (parent) { } - virtual void restore_state (const std::string &pfx, lay::PluginRoot *config_root) const = 0; - virtual void save_state (const std::string &pfx, lay::PluginRoot *config_root) const = 0; + virtual void restore_state (const std::string &pfx, lay::Dispatcher *config_root) const = 0; + virtual void save_state (const std::string &pfx, lay::Dispatcher *config_root) const = 0; }; /** diff --git a/src/lay/lay/laySettingsForm.cc b/src/lay/lay/laySettingsForm.cc index cc8fcb394..b1cde516e 100644 --- a/src/lay/lay/laySettingsForm.cc +++ b/src/lay/lay/laySettingsForm.cc @@ -42,7 +42,7 @@ namespace lay SettingsForm::SettingsForm (QWidget *parent, lay::Dispatcher *dispatcher, const char *name) : QDialog (parent), Ui::SettingsForm (), - mp_plugin_root (dispatcher), m_finalize_recursion (false) + mp_dispatcher (dispatcher), m_finalize_recursion (false) { setObjectName (QString::fromUtf8 (name)); @@ -237,7 +237,7 @@ SettingsForm::setup () // setup the custom config pages for (std::vector ::iterator cp = m_config_pages.begin (); cp != m_config_pages.end (); ++cp) { - (*cp)->setup (mp_plugin_root); + (*cp)->setup (mp_dispatcher); } } @@ -246,14 +246,14 @@ SettingsForm::commit () { // commit the custom config pages for (std::vector ::iterator cp = m_config_pages.begin (); cp != m_config_pages.end (); ++cp) { - (*cp)->commit (mp_plugin_root); + (*cp)->commit (mp_dispatcher); } m_finalize_recursion = true; try { // config_end will make the main window call setup on the settings form. // the recursion sentinel takes care of that. - mp_plugin_root->config_end (); + mp_dispatcher->config_end (); m_finalize_recursion = false; } catch (...) { m_finalize_recursion = false; diff --git a/src/lay/lay/layTechnologyController.cc b/src/lay/lay/layTechnologyController.cc index 66efa75eb..9a584f06c 100644 --- a/src/lay/lay/layTechnologyController.cc +++ b/src/lay/lay/layTechnologyController.cc @@ -70,7 +70,7 @@ TechnologyController::instance () } void -TechnologyController::initialize (lay::PluginRoot *root) +TechnologyController::initialize (lay::Dispatcher *root) { mp_plugin_root = root; mp_mw = lay::MainWindow::instance (); @@ -81,7 +81,7 @@ TechnologyController::initialize (lay::PluginRoot *root) } void -TechnologyController::initialized (lay::PluginRoot * /*root*/) +TechnologyController::initialized (lay::Dispatcher * /*root*/) { update_menu (); connect_events (); @@ -92,7 +92,7 @@ TechnologyController::initialized (lay::PluginRoot * /*root*/) } void -TechnologyController::uninitialize (lay::PluginRoot * /*root*/) +TechnologyController::uninitialize (lay::Dispatcher * /*root*/) { m_tech_actions.clear (); tl::Object::detach_from_all_events (); @@ -113,7 +113,7 @@ void TechnologyController::get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("technology_selector:apply_technology", "technology_selector:tech_selector_group", "@toolbar.end", tl::to_string (QObject::tr ("Technology<:techs.png>{Select technology (click to apply)}")))); + menu_entries.push_back (lay::menu_item ("technology_selector:apply_technology", "technology_selector:tech_selector_group", "@toolbar.end", tl::to_string (QObject::tr ("Technology<:techs.png>{Select technology (click to apply)}")))); } void @@ -193,7 +193,7 @@ TechnologyController::update_active_technology () #if 0 // Hint with this implementation, the current technology follows the current layout. // Although that's a nice way to display the current technology, it's pretty confusing - lay::PluginRoot *pr = mp_plugin_root; + lay::Dispatcher *pr = mp_plugin_root; if (pr) { pr->config_set (cfg_initial_technology, active_tech); } @@ -204,7 +204,7 @@ void TechnologyController::technologies_changed () { // update the configuration to reflect the persisted technologies - lay::PluginRoot *pr = mp_plugin_root; + lay::Dispatcher *pr = mp_plugin_root; if (pr) { m_configure_enabled = false; try { @@ -298,7 +298,7 @@ TechnologyController::menu_activated (const std::string &symbol) const void TechnologyController::update_current_technology () { - lay::AbstractMenuProvider *pr = lay::AbstractMenuProvider::instance (); + lay::Dispatcher *pr = lay::Dispatcher::instance (); if (! pr || ! pr->menu ()) { return; } @@ -325,7 +325,7 @@ TechnologyController::update_current_technology () void TechnologyController::update_menu () { - lay::AbstractMenuProvider *pr = lay::AbstractMenuProvider::instance (); + lay::Dispatcher *pr = lay::Dispatcher::instance (); if (! pr || ! pr->menu ()) { return; } diff --git a/src/laybasic/laybasic/gsiDeclLayPlugin.cc b/src/laybasic/laybasic/gsiDeclLayPlugin.cc index 4c81d652e..4a214ecc1 100644 --- a/src/laybasic/laybasic/gsiDeclLayPlugin.cc +++ b/src/laybasic/laybasic/gsiDeclLayPlugin.cc @@ -903,7 +903,7 @@ Class decl_Dispatcher ("lay", "Dispatcher", "@brief Clears the configuration parameters\n" ) + method ("instance", &dispatcher_instance, - "@brief Gets the singleton instance of the PluginRoot object\n" + "@brief Gets the singleton instance of the Dispatcher object\n" "\n" "@return The instance\n" ) + diff --git a/src/laybasic/laybasic/layPlugin.h b/src/laybasic/laybasic/layPlugin.h index e42a5e2fc..277777be4 100644 --- a/src/laybasic/laybasic/layPlugin.h +++ b/src/laybasic/laybasic/layPlugin.h @@ -121,7 +121,7 @@ struct LAYBASIC_PUBLIC MenuEntry * @param menu_name The name of the menu item (see layAbstractMenu.h) * @param insert_pos The position where to insert (see layAbstractMenu.h) */ -MenuEntry separator (const std::string &menu_name, const std::string &insert_pos); +LAYBASIC_PUBLIC MenuEntry separator (const std::string &menu_name, const std::string &insert_pos); /** * @brief Creates a normal menu entry @@ -131,7 +131,7 @@ MenuEntry separator (const std::string &menu_name, const std::string &insert_pos * @param insert_pos The position where to insert (see layAbstractMenu.h) * @param title The title to display plus optional icon resource and keyboard shortcut. The format of the string is: ["("shortcut")"]["<"icon-resource">"][{"tool-tip"}]. */ -MenuEntry menu_item (const std::string &symbol, const std::string &menu_name, const std::string &insert_pos, const std::string &title); +LAYBASIC_PUBLIC MenuEntry menu_item (const std::string &symbol, const std::string &menu_name, const std::string &insert_pos, const std::string &title); /** * @brief Creates a submenu entry @@ -140,7 +140,7 @@ MenuEntry menu_item (const std::string &symbol, const std::string &menu_name, co * @param insert_pos The position where to insert (see layAbstractMenu.h) * @param title The title to display plus optional icon resource and keyboard shortcut. The format of the string is: ["("shortcut")"]["<"icon-resource">"][{"tool-tip"}]. */ -MenuEntry submenu (const std::string &menu_name, const std::string &insert_pos, const std::string &title); +LAYBASIC_PUBLIC MenuEntry submenu (const std::string &menu_name, const std::string &insert_pos, const std::string &title); /** * @brief Creates a submenu entry @@ -150,7 +150,7 @@ MenuEntry submenu (const std::string &menu_name, const std::string &insert_pos, * @param insert_pos The position where to insert (see layAbstractMenu.h) * @param title The title to display plus optional icon resource and keyboard shortcut. The format of the string is: ["("shortcut")"]["<"icon-resource">"][{"tool-tip"}]. */ -MenuEntry submenu (const std::string &symbol, const std::string &menu_name, const std::string &insert_pos, const std::string &title); +LAYBASIC_PUBLIC MenuEntry submenu (const std::string &symbol, const std::string &menu_name, const std::string &insert_pos, const std::string &title); /** * @brief Creates a configuration entry @@ -161,7 +161,7 @@ MenuEntry submenu (const std::string &symbol, const std::string &menu_name, cons * @param cname The name of the configuration item * @param cvalue The value to set for the configuration item (optional for boolean configuration items) */ -MenuEntry config_menu_item (const std::string &menu_name, const std::string &insert_pos, const std::string &title, const std::string &cname, const std::string &cvalue = std::string ()); +LAYBASIC_PUBLIC MenuEntry config_menu_item (const std::string &menu_name, const std::string &insert_pos, const std::string &title, const std::string &cname, const std::string &cvalue = std::string ()); /** * @brief The configuration declaration diff --git a/src/laybasic/laybasic/laySaveLayoutOptionsDialog.h b/src/laybasic/laybasic/laySaveLayoutOptionsDialog.h index c14b587b7..cb94c8f2a 100644 --- a/src/laybasic/laybasic/laySaveLayoutOptionsDialog.h +++ b/src/laybasic/laybasic/laySaveLayoutOptionsDialog.h @@ -46,7 +46,6 @@ namespace lay { class LayoutView; -class PluginRoot; class LAYBASIC_PUBLIC SaveLayoutAsOptionsDialog : public QDialog, private Ui::SaveLayoutAsOptionsDialog diff --git a/src/laybasic/laybasic/layStream.h b/src/laybasic/laybasic/layStream.h index a3aad93f8..2058b25a5 100644 --- a/src/laybasic/laybasic/layStream.h +++ b/src/laybasic/laybasic/layStream.h @@ -44,7 +44,7 @@ namespace db namespace lay { -class PluginRoot; +class Dispatcher; class LayoutHandle; /** diff --git a/src/plugins/streamers/lefdef/lay_plugin/layLEFDEFImport.cc b/src/plugins/streamers/lefdef/lay_plugin/layLEFDEFImport.cc index 312d72c1c..3c8f051c2 100644 --- a/src/plugins/streamers/lefdef/lay_plugin/layLEFDEFImport.cc +++ b/src/plugins/streamers/lefdef/lay_plugin/layLEFDEFImport.cc @@ -69,8 +69,8 @@ public: virtual void get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("db::import_lef", "import_lef:edit", "file_menu.import_menu.end", tl::to_string (QObject::tr ("LEF")))); - menu_entries.push_back (lay::MenuEntry ("db::import_def", "import_def:edit", "file_menu.import_menu.end", tl::to_string (QObject::tr ("DEF/LEF")))); + menu_entries.push_back (lay::menu_item ("db::import_lef", "import_lef:edit", "file_menu.import_menu.end", tl::to_string (QObject::tr ("LEF")))); + menu_entries.push_back (lay::menu_item ("db::import_def", "import_def:edit", "file_menu.import_menu.end", tl::to_string (QObject::tr ("DEF/LEF")))); } virtual bool configure (const std::string &name, const std::string &value) @@ -115,7 +115,7 @@ public: lay::MainWindow::instance ()->cancel (); // store configuration - lay::PluginRoot *config_root = lay::PluginRoot::instance (); + lay::Dispatcher *config_root = lay::Dispatcher::instance (); if (import_lef) { config_root->config_set (cfg_lef_import_spec, data.to_string ()); } else { diff --git a/src/plugins/streamers/pcb/lay_plugin/layGerberImport.cc b/src/plugins/streamers/pcb/lay_plugin/layGerberImport.cc index 4ba5e4f99..d37683050 100644 --- a/src/plugins/streamers/pcb/lay_plugin/layGerberImport.cc +++ b/src/plugins/streamers/pcb/lay_plugin/layGerberImport.cc @@ -63,11 +63,11 @@ public: virtual void get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("db::import_gerber", "import_gerber_menu:edit", "file_menu.import_menu.end", tl::to_string (QObject::tr ("Gerber PCB")), true)); - menu_entries.push_back (lay::MenuEntry ("db::import_gerber_new", "import_gerber_new:edit", "file_menu.import_menu.import_gerber_menu.end", tl::to_string (QObject::tr ("New Project")))); - menu_entries.push_back (lay::MenuEntry ("db::import_gerber_new_free", "import_gerber_new_free:edit", "file_menu.import_menu.import_gerber_menu.end", tl::to_string (QObject::tr ("New Project - Free Layer Mapping")))); - menu_entries.push_back (lay::MenuEntry ("db::import_gerber_open", "import_gerber_open:edit", "file_menu.import_menu.import_gerber_menu.end", tl::to_string (QObject::tr ("Open Project")))); - menu_entries.push_back (lay::MenuEntry ("db::import_gerber_recent", "import_gerber_recent:edit", "file_menu.import_menu.import_gerber_menu.end", tl::to_string (QObject::tr ("Recent Project")))); + menu_entries.push_back (lay::submenu ("db::import_gerber", "import_gerber_menu:edit", "file_menu.import_menu.end", tl::to_string (QObject::tr ("Gerber PCB")))); + menu_entries.push_back (lay::menu_item ("db::import_gerber_new", "import_gerber_new:edit", "file_menu.import_menu.import_gerber_menu.end", tl::to_string (QObject::tr ("New Project")))); + menu_entries.push_back (lay::menu_item ("db::import_gerber_new_free", "import_gerber_new_free:edit", "file_menu.import_menu.import_gerber_menu.end", tl::to_string (QObject::tr ("New Project - Free Layer Mapping")))); + menu_entries.push_back (lay::menu_item ("db::import_gerber_open", "import_gerber_open:edit", "file_menu.import_menu.import_gerber_menu.end", tl::to_string (QObject::tr ("Open Project")))); + menu_entries.push_back (lay::menu_item ("db::import_gerber_recent", "import_gerber_recent:edit", "file_menu.import_menu.import_gerber_menu.end", tl::to_string (QObject::tr ("Recent Project")))); } virtual bool configure (const std::string &name, const std::string &value) @@ -125,7 +125,7 @@ public: } - lay::PluginRoot *config_root = lay::PluginRoot::instance (); + lay::Dispatcher *config_root = lay::Dispatcher::instance (); GerberImportDialog dialog (QApplication::activeWindow (), &data); db::GerberImporter importer; diff --git a/src/plugins/tools/bool/lay_plugin/layBooleanOperationsPlugin.cc b/src/plugins/tools/bool/lay_plugin/layBooleanOperationsPlugin.cc index aec42598b..d8623a105 100644 --- a/src/plugins/tools/bool/lay_plugin/layBooleanOperationsPlugin.cc +++ b/src/plugins/tools/bool/lay_plugin/layBooleanOperationsPlugin.cc @@ -478,10 +478,10 @@ public: virtual void get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("ops_group", "edit_menu.layer_menu.end")); - menu_entries.push_back (lay::MenuEntry ("lay::boolean", "boolean:edit:edit_mode", "edit_menu.layer_menu.end", tl::to_string (QObject::tr ("Boolean Operations")))); - menu_entries.push_back (lay::MenuEntry ("lay::merge", "merge:edit:edit_mode", "edit_menu.layer_menu.end", tl::to_string (QObject::tr ("Merge")))); - menu_entries.push_back (lay::MenuEntry ("lay::size", "size:edit:edit_mode", "edit_menu.layer_menu.end", tl::to_string (QObject::tr ("Size")))); + menu_entries.push_back (lay::separator ("ops_group", "edit_menu.layer_menu.end")); + menu_entries.push_back (lay::menu_item ("lay::boolean", "boolean:edit:edit_mode", "edit_menu.layer_menu.end", tl::to_string (QObject::tr ("Boolean Operations")))); + menu_entries.push_back (lay::menu_item ("lay::merge", "merge:edit:edit_mode", "edit_menu.layer_menu.end", tl::to_string (QObject::tr ("Merge")))); + menu_entries.push_back (lay::menu_item ("lay::size", "size:edit:edit_mode", "edit_menu.layer_menu.end", tl::to_string (QObject::tr ("Size")))); } virtual bool configure (const std::string & /*name*/, const std::string & /*value*/) @@ -494,7 +494,7 @@ public: // .. nothing yet .. } - lay::Plugin *create_plugin (db::Manager *, lay::PluginRoot *root, lay::LayoutView *view) const + lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *root, lay::LayoutView *view) const { return new BooleanOperationsPlugin (root, view); } diff --git a/src/plugins/tools/diff/lay_plugin/layDiffPlugin.cc b/src/plugins/tools/diff/lay_plugin/layDiffPlugin.cc index 8b444b3e6..f5b62eaab 100644 --- a/src/plugins/tools/diff/lay_plugin/layDiffPlugin.cc +++ b/src/plugins/tools/diff/lay_plugin/layDiffPlugin.cc @@ -20,10 +20,8 @@ */ - - - #include "layDiffToolDialog.h" +#include "layDispatcher.h" #include "layPlugin.h" @@ -91,7 +89,7 @@ public: virtual void get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("lay::diff_tool", "diff_tool:edit", "tools_menu.post_verification_group", tl::to_string (QObject::tr ("Diff Tool")))); + menu_entries.push_back (lay::menu_item ("lay::diff_tool", "diff_tool:edit", "tools_menu.post_verification_group", tl::to_string (QObject::tr ("Diff Tool")))); } virtual bool configure (const std::string & /*name*/, const std::string & /*value*/) @@ -104,7 +102,7 @@ public: // .. nothing yet .. } - lay::Plugin *create_plugin (db::Manager *, lay::PluginRoot *root, lay::LayoutView *view) const + lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *root, lay::LayoutView *view) const { return new DiffPlugin (root, view); } diff --git a/src/plugins/tools/diff/lay_plugin/layDiffToolDialog.cc b/src/plugins/tools/diff/lay_plugin/layDiffToolDialog.cc index a77ed0c4a..208856ef2 100644 --- a/src/plugins/tools/diff/lay_plugin/layDiffToolDialog.cc +++ b/src/plugins/tools/diff/lay_plugin/layDiffToolDialog.cc @@ -625,7 +625,7 @@ DiffToolDialog::exec_dialog (lay::LayoutView *view) mp_ui->layoutb->set_layout_view (view); } - lay::PluginRoot *config_root = lay::PluginRoot::instance (); + lay::Dispatcher *config_root = lay::Dispatcher::instance (); bool f = false; if (config_root->config_get (cfg_diff_run_xor, f)) { @@ -674,7 +674,7 @@ BEGIN_PROTECTED throw tl::Exception (tl::to_string (QObject::tr ("Trying to perform an Diff between identical layouts"))); } - lay::PluginRoot *config_root = lay::PluginRoot::instance (); + lay::Dispatcher *config_root = lay::Dispatcher::instance (); config_root->config_set (cfg_diff_run_xor, mp_ui->xor_cbx->isChecked ()); config_root->config_set (cfg_diff_detailed, mp_ui->detailed_cbx->isChecked ()); diff --git a/src/plugins/tools/import/lay_plugin/layStreamImport.cc b/src/plugins/tools/import/lay_plugin/layStreamImport.cc index 8bd0dabbd..b91304d50 100644 --- a/src/plugins/tools/import/lay_plugin/layStreamImport.cc +++ b/src/plugins/tools/import/lay_plugin/layStreamImport.cc @@ -61,7 +61,7 @@ public: virtual void get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("lay::import_stream", "import_stream:edit", "file_menu.import_menu.end", tl::to_string (QObject::tr ("Other Files Into Current")))); + menu_entries.push_back (lay::menu_item ("lay::import_stream", "import_stream:edit", "file_menu.import_menu.end", tl::to_string (QObject::tr ("Other Files Into Current")))); } virtual bool configure (const std::string &name, const std::string &value) @@ -95,7 +95,7 @@ public: data = StreamImportData (); } - lay::PluginRoot *config_root = lay::PluginRoot::instance (); + lay::Dispatcher *config_root = lay::Dispatcher::instance (); StreamImportDialog dialog (QApplication::activeWindow (), &data); lay::StreamImporter importer; diff --git a/src/plugins/tools/import/lay_plugin/layStreamImportDialog.h b/src/plugins/tools/import/lay_plugin/layStreamImportDialog.h index 532b2ef2c..bdeff7630 100644 --- a/src/plugins/tools/import/lay_plugin/layStreamImportDialog.h +++ b/src/plugins/tools/import/lay_plugin/layStreamImportDialog.h @@ -56,7 +56,7 @@ namespace tl namespace lay { - class PluginRoot; + class Dispatcher; } namespace lay diff --git a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerConfig.cc b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerConfig.cc index 64618b7cf..8de578356 100644 --- a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerConfig.cc +++ b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerConfig.cc @@ -23,6 +23,7 @@ #include "layNetTracerConfig.h" #include "layConverters.h" +#include "layDispatcher.h" #include #include @@ -128,7 +129,7 @@ NetTracerConfigPage::color_button_clicked () } void -NetTracerConfigPage::setup (lay::PluginRoot *root) +NetTracerConfigPage::setup (lay::Dispatcher *root) { // window mode lay::nt_window_type wmode = lay::NTFitNet; @@ -237,7 +238,7 @@ NetTracerConfigPage::window_changed (int m) } void -NetTracerConfigPage::commit (lay::PluginRoot *root) +NetTracerConfigPage::commit (lay::Dispatcher *root) { double dim = 1.0; tl::from_string (tl::to_string (le_window->text ()), dim); diff --git a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerConfig.h b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerConfig.h index 6990c4141..5257b1162 100644 --- a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerConfig.h +++ b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerConfig.h @@ -63,8 +63,8 @@ class NetTracerConfigPage public: NetTracerConfigPage (QWidget *parent); - virtual void setup (lay::PluginRoot *root); - virtual void commit (lay::PluginRoot *root); + virtual void setup (lay::Dispatcher *root); + virtual void commit (lay::Dispatcher *root); public slots: void window_changed (int); diff --git a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc index f82b4150f..04d035ea0 100644 --- a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc +++ b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc @@ -53,7 +53,7 @@ namespace lay // ----------------------------------------------------------------------------------- // NetTracerDialog implementation -NetTracerDialog::NetTracerDialog (lay::PluginRoot *root, lay::LayoutView *view) +NetTracerDialog::NetTracerDialog (lay::Dispatcher *root, lay::LayoutView *view) : lay::Browser (root, view, "net_tracer_dialog"), lay::ViewService (view->view_object_widget ()), m_cv_index (0), diff --git a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.h b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.h index 305741447..e011edb83 100644 --- a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.h +++ b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.h @@ -57,7 +57,7 @@ class NetTracerDialog Q_OBJECT public: - NetTracerDialog (lay::PluginRoot *root, lay::LayoutView *view); + NetTracerDialog (lay::Dispatcher *root, lay::LayoutView *view); virtual ~NetTracerDialog (); virtual bool mouse_move_event (const db::DPoint &p, unsigned int buttons, bool prio); diff --git a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerPlugin.cc b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerPlugin.cc index e4f8b3383..f9efb9a0c 100644 --- a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerPlugin.cc +++ b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerPlugin.cc @@ -67,15 +67,15 @@ public: { // TODO: where should that go? lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("net_trace_group", "tools_menu.end")); - menu_entries.push_back (lay::MenuEntry ("lay::net_trace", "net_trace", "tools_menu.end", tl::to_string (QObject::tr ("Trace Net")))); - menu_entries.push_back (lay::MenuEntry ("", "trace_all_nets_menu", "tools_menu.end", tl::to_string (QObject::tr ("Trace All Nets")), true)); - menu_entries.push_back (lay::MenuEntry ("lay::trace_all_nets", "trace_all_nets", "tools_menu.trace_all_nets_menu.end", tl::to_string (QObject::tr ("Hierarchical")))); - menu_entries.push_back (lay::MenuEntry ("lay::trace_all_nets_flat", "trace_all_nets_flat", "tools_menu.trace_all_nets_menu.end", tl::to_string (QObject::tr ("Flat")))); - menu_entries.push_back (lay::MenuEntry ("lay::edit_layer_stack", "edit_layer_stack", "tools_menu.end", tl::to_string (QObject::tr ("Edit Layer Stack")))); + menu_entries.push_back (lay::separator ("net_trace_group", "tools_menu.end")); + menu_entries.push_back (lay::menu_item ("lay::net_trace", "net_trace", "tools_menu.end", tl::to_string (QObject::tr ("Trace Net")))); + menu_entries.push_back (lay::submenu ("", "trace_all_nets_menu", "tools_menu.end", tl::to_string (QObject::tr ("Trace All Nets")))); + menu_entries.push_back (lay::menu_item ("lay::trace_all_nets", "trace_all_nets", "tools_menu.trace_all_nets_menu.end", tl::to_string (QObject::tr ("Hierarchical")))); + menu_entries.push_back (lay::menu_item ("lay::trace_all_nets_flat", "trace_all_nets_flat", "tools_menu.trace_all_nets_menu.end", tl::to_string (QObject::tr ("Flat")))); + menu_entries.push_back (lay::menu_item ("lay::edit_layer_stack", "edit_layer_stack", "tools_menu.end", tl::to_string (QObject::tr ("Edit Layer Stack")))); } - virtual lay::Plugin *create_plugin (db::Manager * /*manager*/, lay::PluginRoot *root, lay::LayoutView *view) const + virtual lay::Plugin *create_plugin (db::Manager * /*manager*/, lay::Dispatcher *root, lay::LayoutView *view) const { return new NetTracerDialog (root, view); } diff --git a/src/plugins/tools/xor/lay_plugin/layXORPlugin.cc b/src/plugins/tools/xor/lay_plugin/layXORPlugin.cc index d8e02d7b4..f5bd4895e 100644 --- a/src/plugins/tools/xor/lay_plugin/layXORPlugin.cc +++ b/src/plugins/tools/xor/lay_plugin/layXORPlugin.cc @@ -23,6 +23,7 @@ #include "layXORToolDialog.h" +#include "layDispatcher.h" #include "layPlugin.h" @@ -96,7 +97,7 @@ public: virtual void get_menu_entries (std::vector &menu_entries) const { lay::PluginDeclaration::get_menu_entries (menu_entries); - menu_entries.push_back (lay::MenuEntry ("lay::xor_tool", "xor_tool:edit", "tools_menu.post_verification_group", tl::to_string (QObject::tr ("XOR Tool")))); + menu_entries.push_back (lay::menu_item ("lay::xor_tool", "xor_tool:edit", "tools_menu.post_verification_group", tl::to_string (QObject::tr ("XOR Tool")))); } virtual bool configure (const std::string & /*name*/, const std::string & /*value*/) @@ -109,7 +110,7 @@ public: // .. nothing yet .. } - lay::Plugin *create_plugin (db::Manager *, lay::PluginRoot *root, lay::LayoutView *view) const + lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *root, lay::LayoutView *view) const { return new XORPlugin (root, view); } diff --git a/src/plugins/tools/xor/lay_plugin/layXORToolDialog.cc b/src/plugins/tools/xor/lay_plugin/layXORToolDialog.cc index ccb55afed..8a2f1f82d 100644 --- a/src/plugins/tools/xor/lay_plugin/layXORToolDialog.cc +++ b/src/plugins/tools/xor/lay_plugin/layXORToolDialog.cc @@ -207,7 +207,7 @@ XORToolDialog::exec_dialog (lay::LayoutView *view) } // take current settings from the configurations - lay::PluginRoot *config_root = lay::PluginRoot::instance (); + lay::Dispatcher *config_root = lay::Dispatcher::instance (); input_mode_t im = IMAll; if (config_root->config_get (cfg_xor_input_mode, im, InputModeConverter ())) { @@ -333,7 +333,7 @@ BEGIN_PROTECTED } } - lay::PluginRoot *config_root = lay::PluginRoot::instance (); + lay::Dispatcher *config_root = lay::Dispatcher::instance (); config_root->config_set (cfg_xor_input_mode, InputModeConverter ().to_string ((input_mode_t) mp_ui->input_layers_cbx->currentIndex ())); config_root->config_set (cfg_xor_output_mode, OutputModeConverter ().to_string ((output_mode_t) mp_ui->output_cbx->currentIndex ()));