WIP: refactoring ongoing.

This commit is contained in:
Matthias Koefferlein 2020-02-07 01:27:24 +01:00
parent fa1b98c933
commit 68472e6e14
47 changed files with 179 additions and 178 deletions

View File

@ -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 ()));

View File

@ -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);

View File

@ -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 ()
{

View File

@ -33,12 +33,12 @@ void
PluginDeclaration::get_menu_entries (std::vector<lay::MenuEntry> &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 *

View File

@ -90,8 +90,8 @@ static gsi::Methods application_methods ()
method<C, bool> ("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<C, std::string, const std::string &> ("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<C, std::vector<std::string> > ("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<C, const std::string &, const std::string &> ("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<C> ("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<C, bool, const std::string &> ("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<C, bool, const std::string &> ("read_config", &C::read_config,
"@brief Reads the configuration from a file\n"

View File

@ -605,7 +605,7 @@ ApplicationBase::init_app ()
bool editable_from_config = false;
{
lay::Dispatcher cfg;
lay::Dispatcher cfg (0);
for (std::vector <std::string>::const_iterator c = m_config_files.begin (); c != m_config_files.end (); ++c) {
try {

View File

@ -52,7 +52,7 @@ public:
virtual void get_menu_entries (std::vector<lay::MenuEntry> &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

View File

@ -59,7 +59,7 @@ public:
virtual void get_menu_entries (std::vector<lay::MenuEntry> &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

View File

@ -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:

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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 ();

View File

@ -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<std::pair<std::string, std::string> >
get_custom_paths (lay::PluginRoot *root)
get_custom_paths (lay::Dispatcher *root)
{
std::vector <std::pair<std::string, std::string> > paths;
@ -2306,7 +2306,7 @@ get_custom_paths (lay::PluginRoot *root)
}
static void
set_custom_paths (lay::PluginRoot *root, const std::vector<std::pair<std::string, std::string> > &paths)
set_custom_paths (lay::Dispatcher *root, const std::vector<std::pair<std::string, std::string> > &paths)
{
std::string mp;

View File

@ -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 <std::string> 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 ());

View File

@ -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);

View File

@ -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::vector<std::pair<std::string, std::st
}
void
CustomizeMenuConfigPage::setup (lay::PluginRoot *root)
CustomizeMenuConfigPage::setup (lay::Dispatcher *root)
{
std::string packed_key_bindings;
root->config_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 ());

View File

@ -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),

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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<SearchReplacePropertiesWidget *> (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<SearchReplacePropertiesWidget *> (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;

View File

@ -164,7 +164,7 @@ public:
std::string text;
};
SearchReplaceDialog (lay::PluginRoot *root, lay::LayoutView *view);
SearchReplaceDialog (lay::Dispatcher *root, lay::LayoutView *view);
~SearchReplaceDialog ();
private:

View File

@ -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);
}

View File

@ -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 ()));

View File

@ -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;
};
/**

View File

@ -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 <lay::ConfigPage *>::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 <lay::ConfigPage *>::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;

View File

@ -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<lay::MenuEntry> &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;
}

View File

@ -903,7 +903,7 @@ Class<lay::Dispatcher> 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"
) +

View File

@ -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: <text>["("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: <text>["("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: <text>["("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

View File

@ -46,7 +46,6 @@ namespace lay
{
class LayoutView;
class PluginRoot;
class LAYBASIC_PUBLIC SaveLayoutAsOptionsDialog
: public QDialog, private Ui::SaveLayoutAsOptionsDialog

View File

@ -44,7 +44,7 @@ namespace db
namespace lay
{
class PluginRoot;
class Dispatcher;
class LayoutHandle;
/**

View File

@ -69,8 +69,8 @@ public:
virtual void get_menu_entries (std::vector<lay::MenuEntry> &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 {

View File

@ -63,11 +63,11 @@ public:
virtual void get_menu_entries (std::vector<lay::MenuEntry> &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;

View File

@ -478,10 +478,10 @@ public:
virtual void get_menu_entries (std::vector<lay::MenuEntry> &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);
}

View File

@ -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<lay::MenuEntry> &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);
}

View File

@ -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 ());

View File

@ -61,7 +61,7 @@ public:
virtual void get_menu_entries (std::vector<lay::MenuEntry> &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;

View File

@ -56,7 +56,7 @@ namespace tl
namespace lay
{
class PluginRoot;
class Dispatcher;
}
namespace lay

View File

@ -23,6 +23,7 @@
#include "layNetTracerConfig.h"
#include "layConverters.h"
#include "layDispatcher.h"
#include <QColorDialog>
#include <QPainter>
@ -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);

View File

@ -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);

View File

@ -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),

View File

@ -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);

View File

@ -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);
}

View File

@ -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<lay::MenuEntry> &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);
}

View File

@ -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 ()));