WIP: refactoring ongoing.

This commit is contained in:
Matthias Koefferlein 2020-02-07 01:00:46 +01:00
parent d6589f1d0e
commit 674d4b45ad
35 changed files with 238 additions and 224 deletions

View File

@ -519,14 +519,14 @@ Class<lay::MainWindow> decl_MainWindow (QT_EXTERNAL_BASE (QMainWindow) "lay", "M
) +
gsi::method ("call_menu", &lay::MainWindow::menu_activated,
"@brief Calls the menu item with the provided symbol.\n"
"To obtain all symbols, use get_menu_symbols.\n"
"To obtain all symbols, use menu_symbols.\n"
"\n"
"This method has been introduced in version 0.27 and replaces the previous cm_... methods. "
"Instead of calling a specific cm_... method, use LayoutView#call_menu with 'cm_...' as the symbol."
) +
gsi::method ("get_menu_symbols", &lay::MainWindow::menu_symbols,
"@brief Calls the menu item with the provided symbol.\n"
"To obtain all available symbols, use get_menu_symbols.\n"
gsi::method ("menu_symbols", &lay::MainWindow::menu_symbols,
"@brief Gets all available menu symbols (see \\call_menu).\n"
"NOTE: currently this method delivers a superset of all available symbols. Depending on the context, no all symbols may trigger actual functionality.\n"
"\n"
"This method has been introduced in version 0.27."
) +

View File

@ -539,9 +539,9 @@ Class<lay::LayoutView> decl_LayoutView (QT_EXTERNAL_BASE (QWidget) "lay", "Layou
"\n"
"This method has been introduced in version 0.27."
) +
gsi::method ("get_menu_symbols", &lay::LayoutView::get_menu_symbols,
"@brief Calls the menu item with the provided symbol.\n"
"To obtain all available symbols, use get_menu_symbols.\n"
gsi::method ("menu_symbols", &lay::LayoutView::menu_symbols,
"@brief Gets all available menu symbols (see \\call_menu).\n"
"NOTE: currently this method delivers a superset of all available symbols. Depending on the context, no all symbols may trigger actual functionality.\n"
"\n"
"This method has been introduced in version 0.27."
) +

View File

@ -24,7 +24,6 @@
#include "layBookmarksView.h"
#include "layLayoutView.h"
#include "layAbstractMenu.h"
#include "layAbstractMenuProvider.h"
#include "laybasicConfig.h"
@ -206,9 +205,9 @@ public:
at = "@bookmarks_context_menu.end";
menu_entries.push_back (lay::config_menu_item ("follow_selection", at, tl::to_string (QObject::tr ("Follow Selection")), cfg_bookmarks_follow_selection, "?")),
menu_entries.push_back (lay::separator ("ops_group", at));
menu_entries.push_back (lay::menu_item ("cm_manage_bookmarks", "manage_bookmarks", at, tl::to_string (QObject::tr ("Manage Bookmarks")));
menu_entries.push_back (lay::menu_item ("cm_load_bookmarks", "load_bookmarks", at, tl::to_string (QObject::tr ("Load Bookmarks")));
menu_entries.push_back (lay::menu_item ("cm_save_bookmarks", "save_bookmarks", at, tl::to_string (QObject::tr ("Save Bookmarks")));
menu_entries.push_back (lay::menu_item ("cm_manage_bookmarks", "manage_bookmarks", at, tl::to_string (QObject::tr ("Manage Bookmarks"))));
menu_entries.push_back (lay::menu_item ("cm_load_bookmarks", "load_bookmarks", at, tl::to_string (QObject::tr ("Load Bookmarks"))));
menu_entries.push_back (lay::menu_item ("cm_save_bookmarks", "save_bookmarks", at, tl::to_string (QObject::tr ("Save Bookmarks"))));
}
};

View File

@ -76,10 +76,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 ("browse_instances::show", "browse_instances", "tools_menu.end", tl::to_string (QObject::tr ("Browse Instances"))));
menu_entries.push_back (lay::menu_item ("browse_instances::show", "browse_instances", "tools_menu.end", tl::to_string (QObject::tr ("Browse Instances"))));
}
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 BrowseInstancesForm (root, view);
}
@ -175,7 +175,7 @@ BrowseInstancesConfigPage::BrowseInstancesConfigPage (QWidget *parent)
}
void
BrowseInstancesConfigPage::setup (lay::PluginRoot *root)
BrowseInstancesConfigPage::setup (lay::Dispatcher *root)
{
std::string value;
@ -221,7 +221,7 @@ BrowseInstancesConfigPage::window_changed (int m)
}
void
BrowseInstancesConfigPage::commit (lay::PluginRoot *root)
BrowseInstancesConfigPage::commit (lay::Dispatcher *root)
{
double dim = 1.0;
tl::from_string (tl::to_string (le_window->text ()), dim);
@ -289,7 +289,7 @@ private:
// ------------------------------------------------------------
BrowseInstancesForm::BrowseInstancesForm (lay::PluginRoot *root, lay::LayoutView *vw)
BrowseInstancesForm::BrowseInstancesForm (lay::Dispatcher *root, lay::LayoutView *vw)
: lay::Browser (root, vw),
Ui::BrowseInstancesForm (),
m_cv_index (0),

View File

@ -46,8 +46,8 @@ class BrowseInstancesConfigPage
public:
BrowseInstancesConfigPage (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 context_changed (int);
@ -64,7 +64,7 @@ public:
enum mode_type { ToCellView = 0, AnyTop, Parent };
enum window_type { DontChange = 0, FitCell, FitMarker, Center, CenterSize };
BrowseInstancesForm (lay::PluginRoot *root, lay::LayoutView *view);
BrowseInstancesForm (lay::Dispatcher *root, lay::LayoutView *view);
~BrowseInstancesForm ();
bool eventFilter (QObject *watched, QEvent *event);

View File

@ -76,11 +76,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 ("browser_group", "tools_menu.end"));
menu_entries.push_back (lay::MenuEntry ("browse_shapes::show", "browse_shapes", "tools_menu.end", tl::to_string (QObject::tr ("Browse Shapes"))));
menu_entries.push_back (lay::separator ("browser_group", "tools_menu.end"));
menu_entries.push_back (lay::menu_item ("browse_shapes::show", "browse_shapes", "tools_menu.end", tl::to_string (QObject::tr ("Browse Shapes"))));
}
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 BrowseShapesForm (root, view);
}
@ -177,7 +177,7 @@ BrowseShapesConfigPage::BrowseShapesConfigPage (QWidget *parent)
}
void
BrowseShapesConfigPage::setup (lay::PluginRoot *root)
BrowseShapesConfigPage::setup (lay::Dispatcher *root)
{
std::string value;
@ -228,7 +228,7 @@ BrowseShapesConfigPage::window_changed (int m)
}
void
BrowseShapesConfigPage::commit (lay::PluginRoot *root)
BrowseShapesConfigPage::commit (lay::Dispatcher *root)
{
double dim = 1.0;
tl::from_string (tl::to_string (le_window->text ()), dim);
@ -388,7 +388,7 @@ private:
// ------------------------------------------------------------
BrowseShapesForm::BrowseShapesForm (lay::PluginRoot *root, lay::LayoutView *vw)
BrowseShapesForm::BrowseShapesForm (lay::Dispatcher *root, lay::LayoutView *vw)
: lay::Browser (root, vw),
Ui::BrowseShapesForm (),
m_cv_index (-1),

View File

@ -45,8 +45,8 @@ class BrowseShapesConfigPage
public:
BrowseShapesConfigPage (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 context_changed (int);
@ -63,7 +63,7 @@ public:
enum mode_type { ToCellView = 0, AnyTop, Local };
enum window_type { DontChange = 0, FitCell, FitMarker, Center, CenterSize };
BrowseShapesForm (lay::PluginRoot *root, lay::LayoutView *view);
BrowseShapesForm (lay::Dispatcher *root, lay::LayoutView *view);
~BrowseShapesForm ();
bool eventFilter (QObject *watched, QEvent *event);

View File

@ -32,9 +32,9 @@ namespace lay
{
#if QT_VERSION >= 0x050000
Browser::Browser (lay::PluginRoot *root, lay::LayoutView *view, const char *name, Qt::WindowFlags fl)
Browser::Browser (lay::Dispatcher *root, lay::LayoutView *view, const char *name, Qt::WindowFlags fl)
#else
Browser::Browser (lay::PluginRoot *root, lay::LayoutView *view, const char *name, Qt::WFlags fl)
Browser::Browser (lay::Dispatcher *root, lay::LayoutView *view, const char *name, Qt::WFlags fl)
#endif
// TODO: clarify whether to keep the browsers as separate (potentially hidden) windows
: QDialog (0 /*view*/, fl),

View File

@ -36,7 +36,7 @@ namespace lay
{
class LayoutView;
class PluginRoot;
class Dispatcher;
class LAYBASIC_PUBLIC Browser
: public QDialog,
@ -47,9 +47,9 @@ public:
* @brief Constructor
*/
#if QT_VERSION >= 0x050000
Browser (lay::PluginRoot *root, lay::LayoutView *view, const char *name = "", Qt::WindowFlags fl = Qt::Window /*adds minimize button for example*/);
Browser (lay::Dispatcher *root, lay::LayoutView *view, const char *name = "", Qt::WindowFlags fl = Qt::Window /*adds minimize button for example*/);
#else
Browser (lay::PluginRoot *root, lay::LayoutView *view, const char *name = "", Qt::WFlags fl = Qt::Window /*adds minimize button for example*/);
Browser (lay::Dispatcher *root, lay::LayoutView *view, const char *name = "", Qt::WFlags fl = Qt::Window /*adds minimize button for example*/);
#endif
/**
@ -101,7 +101,7 @@ public:
/**
* @brief Returns the pointer to the root configuration object
*/
lay::PluginRoot *root ()
lay::Dispatcher *root ()
{
return mp_root;
}
@ -133,7 +133,7 @@ public:
private:
bool m_active;
lay::LayoutView *mp_view;
lay::PluginRoot *mp_root;
lay::Dispatcher *mp_root;
void closeEvent (QCloseEvent *);
void accept ();

View File

@ -76,12 +76,12 @@ CellSelectionForm::CellSelectionForm (QWidget *parent, lay::LayoutView *view, co
mp_case_sensitive->setChecked (true);
mp_case_sensitive->setText (tr ("Case sensitive search"));
if (lay::PluginRoot::instance ()) {
if (lay::Dispatcher::instance ()) {
bool cs = true;
lay::PluginRoot::instance ()->config_get (cfg_cell_selection_search_case_sensitive, cs);
lay::Dispatcher::instance ()->config_get (cfg_cell_selection_search_case_sensitive, cs);
mp_case_sensitive->setChecked (cs);
bool ue = true;
lay::PluginRoot::instance ()->config_get (cfg_cell_selection_search_use_expressions, ue);
lay::Dispatcher::instance ()->config_get (cfg_cell_selection_search_use_expressions, ue);
mp_use_regular_expressions->setChecked (ue);
}
@ -285,9 +285,9 @@ CellSelectionForm::reject ()
void
CellSelectionForm::store_config ()
{
if (lay::PluginRoot::instance ()) {
lay::PluginRoot::instance ()->config_set (cfg_cell_selection_search_case_sensitive, mp_case_sensitive->isChecked ());
lay::PluginRoot::instance ()->config_set (cfg_cell_selection_search_use_expressions, mp_use_regular_expressions->isChecked ());
if (lay::Dispatcher::instance ()) {
lay::Dispatcher::instance ()->config_set (cfg_cell_selection_search_case_sensitive, mp_case_sensitive->isChecked ());
lay::Dispatcher::instance ()->config_set (cfg_cell_selection_search_use_expressions, mp_use_regular_expressions->isChecked ());
}
}

View File

@ -28,6 +28,7 @@
#include "ui_ConfigurationDialog.h"
#include "layConfigurationDialog.h"
#include "layPlugin.h"
#include "layDispatcher.h"
#include "tlLog.h"
@ -36,7 +37,7 @@ namespace lay
// -------------------------------------------------------------
ConfigurationDialog::ConfigurationDialog (QWidget *parent, lay::PluginRoot *root, const std::string &plugin_name, const char *name)
ConfigurationDialog::ConfigurationDialog (QWidget *parent, lay::Dispatcher *root, const std::string &plugin_name, const char *name)
: QDialog (parent),
mp_root (root)
{
@ -56,7 +57,7 @@ ConfigurationDialog::ConfigurationDialog (QWidget *parent, lay::PluginRoot *root
}
}
ConfigurationDialog::ConfigurationDialog (QWidget *parent, lay::PluginRoot *root, lay::PluginDeclaration *decl, const char *name)
ConfigurationDialog::ConfigurationDialog (QWidget *parent, lay::Dispatcher *root, lay::PluginDeclaration *decl, const char *name)
: QDialog (parent),
mp_root (root)
{

View File

@ -38,7 +38,7 @@ namespace Ui
namespace lay
{
class PluginRoot;
class Dispatcher;
class ConfigPage;
class PluginDeclaration;
@ -48,8 +48,8 @@ class LAYBASIC_PUBLIC ConfigurationDialog
Q_OBJECT
public:
ConfigurationDialog (QWidget *parent, lay::PluginRoot *root, lay::PluginDeclaration *decl, const char *name = "");
ConfigurationDialog (QWidget *parent, lay::PluginRoot *root, const std::string &plugin_name, const char *name = "");
ConfigurationDialog (QWidget *parent, lay::Dispatcher *root, lay::PluginDeclaration *decl, const char *name = "");
ConfigurationDialog (QWidget *parent, lay::Dispatcher *root, const std::string &plugin_name, const char *name = "");
~ConfigurationDialog ();
void commit ();
@ -58,7 +58,7 @@ public slots:
virtual void ok_clicked ();
private:
lay::PluginRoot *mp_root;
lay::Dispatcher *mp_root;
std::vector <lay::ConfigPage *> m_config_pages;
Ui::ConfigurationDialog *mp_ui;

View File

@ -134,7 +134,7 @@ GridNetConfigPage::~GridNetConfigPage ()
}
void
GridNetConfigPage::setup (lay::PluginRoot *root)
GridNetConfigPage::setup (lay::Dispatcher *root)
{
std::string value;
@ -176,7 +176,7 @@ GridNetConfigPage::setup (lay::PluginRoot *root)
}
void
GridNetConfigPage::commit (lay::PluginRoot *root)
GridNetConfigPage::commit (lay::Dispatcher *root)
{
root->config_set (cfg_grid_visible, mp_ui->grid_group->isChecked ());
root->config_set (cfg_grid_show_ruler, mp_ui->show_ruler->isChecked ());

View File

@ -46,7 +46,6 @@
#include "layCellTreeModel.h"
#include "layLayoutView.h"
#include "layAbstractMenu.h"
#include "layAbstractMenuProvider.h"
#include "layDialogs.h"
#include "tlExceptions.h"
#include "laybasicConfig.h"
@ -1186,26 +1185,26 @@ public:
}
menu_entries.push_back (lay::separator ("operations_group", at));
menu_entries.push_back (lay::menu_item ("cm_new_cell", "new_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("New Cell")));
menu_entries.push_back (lay::menu_item ("cm_cell_delete", "delete_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("Delete Cell")));
menu_entries.push_back (lay::menu_item ("cm_cell_rename", "rename_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("Rename Cell")));
menu_entries.push_back (lay::menu_item ("cm_cell_replace", "replace_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("Replace Cell")));
menu_entries.push_back (lay::menu_item ("cm_cell_flatten", "flatten_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("Flatten Cell")));
menu_entries.push_back (lay::menu_item ("cm_cell_user_properties", "cell_user_properties", at, tl::to_string (QObject::tr ("User Properties")));
menu_entries.push_back (lay::menu_item ("cm_new_cell", "new_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("New Cell"))));
menu_entries.push_back (lay::menu_item ("cm_cell_delete", "delete_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("Delete Cell"))));
menu_entries.push_back (lay::menu_item ("cm_cell_rename", "rename_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("Rename Cell"))));
menu_entries.push_back (lay::menu_item ("cm_cell_replace", "replace_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("Replace Cell"))));
menu_entries.push_back (lay::menu_item ("cm_cell_flatten", "flatten_cell:edit:edit_mode", at, tl::to_string (QObject::tr ("Flatten Cell"))));
menu_entries.push_back (lay::menu_item ("cm_cell_user_properties", "cell_user_properties", at, tl::to_string (QObject::tr ("User Properties"))));
menu_entries.push_back (lay::separator ("clipboard_group:edit_mode", at));
menu_entries.push_back (lay::menu_item ("cm_cell_copy", "copy:edit_mode", at, tl::to_string (QObject::tr ("Copy")));
menu_entries.push_back (lay::menu_item ("cm_cell_cut", "cut:edit_mode", at, tl::to_string (QObject::tr ("Cut")));
menu_entries.push_back (lay::menu_item ("cm_cell_paste", "paste:edit_mode", at, tl::to_string (QObject::tr ("Paste")));
menu_entries.push_back (lay::menu_item ("cm_cell_copy", "copy:edit_mode", at, tl::to_string (QObject::tr ("Copy"))));
menu_entries.push_back (lay::menu_item ("cm_cell_cut", "cut:edit_mode", at, tl::to_string (QObject::tr ("Cut"))));
menu_entries.push_back (lay::menu_item ("cm_cell_paste", "paste:edit_mode", at, tl::to_string (QObject::tr ("Paste"))));
menu_entries.push_back (lay::separator ("select_group", at));
menu_entries.push_back (lay::menu_item ("cm_cell_select", "show_as_top", at, tl::to_string (QObject::tr ("Show As New Top")));
menu_entries.push_back (lay::menu_item ("cm_cell_select", "show_as_top", at, tl::to_string (QObject::tr ("Show As New Top"))));
menu_entries.push_back (lay::separator ("visibility_group", at));
menu_entries.push_back (lay::menu_item ("cm_cell_hide", "hide_cell", at, tl::to_string (QObject::tr ("Hide")));
menu_entries.push_back (lay::menu_item ("cm_cell_show", "show_cell", at, tl::to_string (QObject::tr ("Show")));
menu_entries.push_back (lay::menu_item ("cm_cell_show_all", "show_all", at, tl::to_string (QObject::tr ("Show All")));
menu_entries.push_back (lay::menu_item ("cm_cell_hide", "hide_cell", at, tl::to_string (QObject::tr ("Hide"))));
menu_entries.push_back (lay::menu_item ("cm_cell_show", "show_cell", at, tl::to_string (QObject::tr ("Show"))));
menu_entries.push_back (lay::menu_item ("cm_cell_show_all", "show_all", at, tl::to_string (QObject::tr ("Show All"))));
menu_entries.push_back (lay::separator ("utils_group", at));
menu_entries.push_back (lay::menu_item ("cm_open_current_cell", "open_current", at, tl::to_string (QObject::tr ("Where Am I?")));
menu_entries.push_back (lay::menu_item ("cm_open_current_cell", "open_current", at, tl::to_string (QObject::tr ("Where Am I?"))));
menu_entries.push_back (lay::separator ("file_group", at));
menu_entries.push_back (lay::menu_item ("cm_save_current_cell_as", "save_cell_as:hide_vo", at, tl::to_string (QObject::tr ("Save Selected Cells As")));
menu_entries.push_back (lay::menu_item ("cm_save_current_cell_as", "save_cell_as:hide_vo", at, tl::to_string (QObject::tr ("Save Selected Cells As"))));
}
};

View File

@ -33,7 +33,6 @@
#include "laybasicConfig.h"
#include "layDialogs.h"
#include "layLayoutCanvas.h"
#include "layAbstractMenuProvider.h"
#include "layAbstractMenu.h"
#include "tlExceptions.h"
#include "tlInternational.h"
@ -2335,7 +2334,7 @@ public:
at = "@lcp_context_menu.end";
menu_entries.push_back (lay::menu_item ("cm_lv_select_all", "select_all", at, tl::to_string (QObject::tr ("Select All")));
menu_entries.push_back (lay::menu_item ("cm_lv_select_all", "select_all", at, tl::to_string (QObject::tr ("Select All"))));
// It is not sure, whether "expandAll" destabilizes the tree widget:
// menu_entries.push_back (lay::menu_item ("cm_lv_expand_all", "expand_all", at, tl::to_string (QObject::tr ("Expand All")));
menu_entries.push_back (lay::separator ("tab_group", at));
@ -2343,68 +2342,68 @@ public:
{
std::string at = "@lcp_context_menu.tab_menu.end";
menu_entries.push_back (lay::menu_item ("cm_lv_new_tab", "new_tab", at, tl::to_string (QObject::tr ("New Tab")));
menu_entries.push_back (lay::menu_item ("cm_lv_remove_tab", "remove_tab", at, tl::to_string (QObject::tr ("Remove Tab")));
menu_entries.push_back (lay::menu_item ("cm_lv_rename_tab", "rename_tab", at, tl::to_string (QObject::tr ("Rename Tab")));
menu_entries.push_back (lay::menu_item ("cm_lv_new_tab", "new_tab", at, tl::to_string (QObject::tr ("New Tab"))));
menu_entries.push_back (lay::menu_item ("cm_lv_remove_tab", "remove_tab", at, tl::to_string (QObject::tr ("Remove Tab"))));
menu_entries.push_back (lay::menu_item ("cm_lv_rename_tab", "rename_tab", at, tl::to_string (QObject::tr ("Rename Tab"))));
}
menu_entries.push_back (lay::separator ("visibility_group", at));
menu_entries.push_back (lay::menu_item ("cm_lv_hide", "hide", at, tl::to_string (QObject::tr ("Hide")));
menu_entries.push_back (lay::menu_item ("cm_lv_hide_all", "hide_all", at, tl::to_string (QObject::tr ("Hide All")));
menu_entries.push_back (lay::menu_item ("cm_lv_show", "show", at, tl::to_string (QObject::tr ("Show")));
menu_entries.push_back (lay::menu_item ("cm_lv_show_all", "show_all", at, tl::to_string (QObject::tr ("Show All")));
menu_entries.push_back (lay::menu_item ("cm_lv_show_only", "show_only", at, tl::to_string (QObject::tr ("Show Only Selected")));
menu_entries.push_back (lay::menu_item ("cm_lv_make_valid", "valid", at, tl::to_string (QObject::tr ("Make Valid")));
menu_entries.push_back (lay::menu_item ("cm_lv_make_invalid", "invvalid", at, tl::to_string (QObject::tr ("Make Invalid")));
menu_entries.push_back (lay::menu_item ("cm_lv_rename", "rename", at, tl::to_string (QObject::tr ("Rename")));
menu_entries.push_back (lay::menu_item ("cm_lv_hide", "hide", at, tl::to_string (QObject::tr ("Hide"))));
menu_entries.push_back (lay::menu_item ("cm_lv_hide_all", "hide_all", at, tl::to_string (QObject::tr ("Hide All"))));
menu_entries.push_back (lay::menu_item ("cm_lv_show", "show", at, tl::to_string (QObject::tr ("Show"))));
menu_entries.push_back (lay::menu_item ("cm_lv_show_all", "show_all", at, tl::to_string (QObject::tr ("Show All"))));
menu_entries.push_back (lay::menu_item ("cm_lv_show_only", "show_only", at, tl::to_string (QObject::tr ("Show Only Selected"))));
menu_entries.push_back (lay::menu_item ("cm_lv_make_valid", "valid", at, tl::to_string (QObject::tr ("Make Valid"))));
menu_entries.push_back (lay::menu_item ("cm_lv_make_invalid", "invvalid", at, tl::to_string (QObject::tr ("Make Invalid"))));
menu_entries.push_back (lay::menu_item ("cm_lv_rename", "rename", at, tl::to_string (QObject::tr ("Rename"))));
menu_entries.push_back (lay::separator ("options_group", at));
menu_entries.push_back (lay::config_menu_item ("hide_empty_layers", at, tl::to_string (QObject::tr ("Hide Empty Layers")), cfg_hide_empty_layers, "?"));
menu_entries.push_back (lay::config_menu_item ("test_shapes_in_view", at, tl::to_string (QObject::tr ("Test For Shapes In View")), cfg_test_shapes_in_view, "?"));
menu_entries.push_back (lay::separator ("source_group", at));
menu_entries.push_back (lay::menu_item ("cm_lv_source", "select_source", at, tl::to_string (QObject::tr ("Select Source")));
menu_entries.push_back (lay::menu_item ("cm_lv_source", "select_source", at, tl::to_string (QObject::tr ("Select Source"))));
menu_entries.push_back (lay::separator ("sort_group", at));
menu_entries.push_back (lay::submenu ("sort_menu", at, tl::to_string (QObject::tr ("Sort By"))));
{
std::string at = "@lcp_context_menu.sort_menu.end";
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_ild", "sort_ild", at, tl::to_string (QObject::tr ("Layout Index, Layer And Datatype")));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_idl", "sort_idl", at, tl::to_string (QObject::tr ("Layout Index, Datatype And Layer")));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_ldi", "sort_ldi", at, tl::to_string (QObject::tr ("Layer, Datatype And Layout Index")));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_dli", "sort_dli", at, tl::to_string (QObject::tr ("Datatype, Layer And Layout Index")));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_name", "sort_name", at, tl::to_string (QObject::tr ("Name")));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_ild", "sort_ild", at, tl::to_string (QObject::tr ("Layout Index, Layer And Datatype"))));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_idl", "sort_idl", at, tl::to_string (QObject::tr ("Layout Index, Datatype And Layer"))));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_ldi", "sort_ldi", at, tl::to_string (QObject::tr ("Layer, Datatype And Layout Index"))));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_dli", "sort_dli", at, tl::to_string (QObject::tr ("Datatype, Layer And Layout Index"))));
menu_entries.push_back (lay::menu_item ("cm_lv_sort_by_name", "sort_name", at, tl::to_string (QObject::tr ("Name"))));
}
menu_entries.push_back (lay::separator ("view_group", at));
menu_entries.push_back (lay::menu_item ("cm_lv_delete", "del", at, tl::to_string (QObject::tr ("Delete Layer Entry")));
menu_entries.push_back (lay::menu_item ("cm_lv_insert", "insert", at, tl::to_string (QObject::tr ("Insert Layer Entry")));
menu_entries.push_back (lay::menu_item ("cm_lv_add_missing", "add_others", at, tl::to_string (QObject::tr ("Add Other Layer Entries")));
menu_entries.push_back (lay::menu_item ("cm_lv_remove_unused", "clean_up", at, tl::to_string (QObject::tr ("Clean Up Layer Entries")));
menu_entries.push_back (lay::menu_item ("cm_lv_delete", "del", at, tl::to_string (QObject::tr ("Delete Layer Entry"))));
menu_entries.push_back (lay::menu_item ("cm_lv_insert", "insert", at, tl::to_string (QObject::tr ("Insert Layer Entry"))));
menu_entries.push_back (lay::menu_item ("cm_lv_add_missing", "add_others", at, tl::to_string (QObject::tr ("Add Other Layer Entries"))));
menu_entries.push_back (lay::menu_item ("cm_lv_remove_unused", "clean_up", at, tl::to_string (QObject::tr ("Clean Up Layer Entries"))));
menu_entries.push_back (lay::separator ("grouping_group", at));
menu_entries.push_back (lay::menu_item ("cm_lv_group", "group", at, tl::to_string (QObject::tr ("Group")));
menu_entries.push_back (lay::menu_item ("cm_lv_ungroup", "ungroup", at, tl::to_string (QObject::tr ("Ungroup")));
menu_entries.push_back (lay::menu_item ("cm_lv_group", "group", at, tl::to_string (QObject::tr ("Group"))));
menu_entries.push_back (lay::menu_item ("cm_lv_ungroup", "ungroup", at, tl::to_string (QObject::tr ("Ungroup"))));
menu_entries.push_back (lay::submenu ("regroup_menu", at, tl::to_string (QObject::tr ("Regroup Layer Entries"))));
{
std::string at = "@lcp_context_menu.regroup_menu.end";
menu_entries.push_back (lay::menu_item ("cm_lv_regroup_by_index", "grp_i", at, tl::to_string (QObject::tr ("By Layout Index")));
menu_entries.push_back (lay::menu_item ("cm_lv_regroup_by_datatype", "grp_d", at, tl::to_string (QObject::tr ("By Datatype")));
menu_entries.push_back (lay::menu_item ("cm_lv_regroup_by_layer", "grp_l", at, tl::to_string (QObject::tr ("By Layer")));
menu_entries.push_back (lay::menu_item ("cm_lv_regroup_flatten", "flatten", at, tl::to_string (QObject::tr ("Flatten")));
menu_entries.push_back (lay::menu_item ("cm_lv_regroup_by_index", "grp_i", at, tl::to_string (QObject::tr ("By Layout Index"))));
menu_entries.push_back (lay::menu_item ("cm_lv_regroup_by_datatype", "grp_d", at, tl::to_string (QObject::tr ("By Datatype"))));
menu_entries.push_back (lay::menu_item ("cm_lv_regroup_by_layer", "grp_l", at, tl::to_string (QObject::tr ("By Layer"))));
menu_entries.push_back (lay::menu_item ("cm_lv_regroup_flatten", "flatten", at, tl::to_string (QObject::tr ("Flatten"))));
}
menu_entries.push_back (lay::separator ("copy_paste_group", at));
menu_entries.push_back (lay::menu_item ("cm_lv_copy", "copy", at, tl::to_string (QObject::tr ("Copy")));
menu_entries.push_back (lay::menu_item ("cm_lv_cut", "cut", at, tl::to_string (QObject::tr ("Cut")));
menu_entries.push_back (lay::menu_item ("cm_lv_paste", "paste", at, tl::to_string (QObject::tr ("Paste")));
menu_entries.push_back (lay::menu_item ("cm_lv_copy", "copy", at, tl::to_string (QObject::tr ("Copy"))));
menu_entries.push_back (lay::menu_item ("cm_lv_cut", "cut", at, tl::to_string (QObject::tr ("Cut"))));
menu_entries.push_back (lay::menu_item ("cm_lv_paste", "paste", at, tl::to_string (QObject::tr ("Paste"))));
at = ".end";
menu_entries.push_back (lay::submenu ("@lcp_tabs_context_menu", at, std::string ()));
{
std::string at = "@lcp_tabs_context_menu.end";
menu_entries.push_back (lay::menu_item ("cm_lv_new_tab", "new_tab", at, tl::to_string (QObject::tr ("New Tab")));
menu_entries.push_back (lay::menu_item ("cm_lv_remove_tab", "remove_tab", at, tl::to_string (QObject::tr ("Remove Tab")));
menu_entries.push_back (lay::menu_item ("cm_lv_rename_tab", "rename_tab", at, tl::to_string (QObject::tr ("Rename Tab")));
menu_entries.push_back (lay::menu_item ("cm_lv_new_tab", "new_tab", at, tl::to_string (QObject::tr ("New Tab"))));
menu_entries.push_back (lay::menu_item ("cm_lv_remove_tab", "remove_tab", at, tl::to_string (QObject::tr ("Remove Tab"))));
menu_entries.push_back (lay::menu_item ("cm_lv_rename_tab", "rename_tab", at, tl::to_string (QObject::tr ("Rename Tab"))));
}
}
};

View File

@ -24,6 +24,7 @@
#include "layLayoutViewConfigPages.h"
#include "laybasicConfig.h"
#include "layConverters.h"
#include "layDispatcher.h"
#include "ui_LayoutViewConfigPage.h"
#include "ui_LayoutViewConfigPage1.h"
@ -74,7 +75,7 @@ LayoutViewConfigPage::~LayoutViewConfigPage ()
}
void
LayoutViewConfigPage::setup (lay::PluginRoot *root)
LayoutViewConfigPage::setup (lay::Dispatcher *root)
{
lay::ColorConverter cc;
QColor color;
@ -84,7 +85,7 @@ LayoutViewConfigPage::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage::commit (lay::PluginRoot *root)
LayoutViewConfigPage::commit (lay::Dispatcher *root)
{
lay::ColorConverter cc;
root->config_set (cfg_background_color, mp_ui->bkgnd_color_pb->get_color (), cc);
@ -107,7 +108,7 @@ LayoutViewConfigPage1::~LayoutViewConfigPage1 ()
}
void
LayoutViewConfigPage1::setup (lay::PluginRoot *root)
LayoutViewConfigPage1::setup (lay::Dispatcher *root)
{
lay::ColorConverter cc;
@ -152,7 +153,7 @@ LayoutViewConfigPage1::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage1::commit (lay::PluginRoot *root)
LayoutViewConfigPage1::commit (lay::Dispatcher *root)
{
lay::ColorConverter cc;
@ -192,7 +193,7 @@ LayoutViewConfigPage2a::~LayoutViewConfigPage2a ()
}
void
LayoutViewConfigPage2a::setup (lay::PluginRoot *root)
LayoutViewConfigPage2a::setup (lay::Dispatcher *root)
{
QColor color;
root->config_get (cfg_cell_box_color, color, ColorConverter ());
@ -238,7 +239,7 @@ LayoutViewConfigPage2a::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage2a::commit (lay::PluginRoot *root)
LayoutViewConfigPage2a::commit (lay::Dispatcher *root)
{
root->config_set (cfg_cell_box_text_transform, mp_ui->cell_xform_text_cbx->isChecked ());
root->config_set (cfg_cell_box_text_font, mp_ui->cell_font_cb->currentIndex ());
@ -274,7 +275,7 @@ LayoutViewConfigPage2b::~LayoutViewConfigPage2b ()
}
void
LayoutViewConfigPage2b::setup (lay::PluginRoot *root)
LayoutViewConfigPage2b::setup (lay::Dispatcher *root)
{
QColor color;
root->config_get (cfg_text_color, color, ColorConverter ());
@ -307,7 +308,7 @@ LayoutViewConfigPage2b::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage2b::commit (lay::PluginRoot *root)
LayoutViewConfigPage2b::commit (lay::Dispatcher *root)
{
root->config_set (cfg_text_color, mp_ui->text_color_pb->get_color (), ColorConverter ());
root->config_set (cfg_apply_text_trans, mp_ui->text_apply_trans_cbx->isChecked ());
@ -339,7 +340,7 @@ LayoutViewConfigPage2c::~LayoutViewConfigPage2c ()
}
void
LayoutViewConfigPage2c::setup (lay::PluginRoot *root)
LayoutViewConfigPage2c::setup (lay::Dispatcher *root)
{
QColor color;
root->config_get (cfg_sel_color, color, lay::ColorConverter ());
@ -375,7 +376,7 @@ LayoutViewConfigPage2c::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage2c::commit (lay::PluginRoot *root)
LayoutViewConfigPage2c::commit (lay::Dispatcher *root)
{
lay::ColorConverter cc;
root->config_set (cfg_sel_color, mp_ui->color_pb->get_color (), cc);
@ -405,7 +406,7 @@ LayoutViewConfigPage3a::~LayoutViewConfigPage3a ()
}
void
LayoutViewConfigPage3a::setup (lay::PluginRoot *root)
LayoutViewConfigPage3a::setup (lay::Dispatcher *root)
{
bool flag = true;
@ -418,7 +419,7 @@ LayoutViewConfigPage3a::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage3a::commit (lay::PluginRoot *root)
LayoutViewConfigPage3a::commit (lay::Dispatcher *root)
{
root->config_set (cfg_fit_new_cell, mp_ui->fit_new_cell_cbx->isChecked ());
root->config_set (cfg_full_hier_new_cell, mp_ui->full_hier_new_cell_cbx->isChecked ());
@ -442,7 +443,7 @@ LayoutViewConfigPage3b::~LayoutViewConfigPage3b ()
}
void
LayoutViewConfigPage3b::setup (lay::PluginRoot *root)
LayoutViewConfigPage3b::setup (lay::Dispatcher *root)
{
bool flag = true;
double pd = 0.0;
@ -462,7 +463,7 @@ LayoutViewConfigPage3b::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage3b::commit (lay::PluginRoot *root)
LayoutViewConfigPage3b::commit (lay::Dispatcher *root)
{
root->config_set (cfg_mouse_wheel_mode, mp_ui->alt_mouse_wheel_mode_cbx->isChecked () ? 1 : 0);
@ -501,7 +502,7 @@ LayoutViewConfigPage3c::~LayoutViewConfigPage3c ()
}
void
LayoutViewConfigPage3c::setup (lay::PluginRoot *root)
LayoutViewConfigPage3c::setup (lay::Dispatcher *root)
{
bool flag = true;
@ -512,7 +513,7 @@ LayoutViewConfigPage3c::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage3c::commit (lay::PluginRoot *root)
LayoutViewConfigPage3c::commit (lay::Dispatcher *root)
{
root->config_set (cfg_dbu_units, mp_ui->dbu_units_cbx->isChecked ());
root->config_set (cfg_abs_units, mp_ui->abs_units_cbx->isChecked ());
@ -535,7 +536,7 @@ LayoutViewConfigPage3f::~LayoutViewConfigPage3f ()
}
void
LayoutViewConfigPage3f::setup (lay::PluginRoot *root)
LayoutViewConfigPage3f::setup (lay::Dispatcher *root)
{
int workers = 1;
bool flag = true;
@ -567,7 +568,7 @@ LayoutViewConfigPage3f::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage3f::commit (lay::PluginRoot *root)
LayoutViewConfigPage3f::commit (lay::Dispatcher *root)
{
root->config_set (cfg_drawing_workers, mp_ui->drawing_workers_spbx->value ());
@ -654,7 +655,7 @@ LayoutViewConfigPage4::set_edit_order (bool edit_order)
}
void
LayoutViewConfigPage4::setup (lay::PluginRoot *root)
LayoutViewConfigPage4::setup (lay::Dispatcher *root)
{
m_manager.clear ();
@ -678,7 +679,7 @@ LayoutViewConfigPage4::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage4::commit (lay::PluginRoot *root)
LayoutViewConfigPage4::commit (lay::Dispatcher *root)
{
root->config_set (cfg_color_palette, m_palette.to_string ());
}
@ -876,7 +877,7 @@ LayoutViewConfigPage5::~LayoutViewConfigPage5 ()
}
void
LayoutViewConfigPage5::setup (lay::PluginRoot *root)
LayoutViewConfigPage5::setup (lay::Dispatcher *root)
{
std::string lyp_file;
root->config_get (cfg_default_lyp_file, lyp_file);
@ -901,7 +902,7 @@ LayoutViewConfigPage5::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage5::commit (lay::PluginRoot *root)
LayoutViewConfigPage5::commit (lay::Dispatcher *root)
{
if (mp_ui->lyp_file_gbx->isChecked ()) {
root->config_set (cfg_default_lyp_file, tl::to_string (mp_ui->lyp_file_le->text ()));
@ -988,7 +989,7 @@ LayoutViewConfigPage6::set_edit_order (bool edit_order)
}
void
LayoutViewConfigPage6::setup (lay::PluginRoot *root)
LayoutViewConfigPage6::setup (lay::Dispatcher *root)
{
m_manager.clear ();
@ -1016,7 +1017,7 @@ LayoutViewConfigPage6::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage6::commit (lay::PluginRoot *root)
LayoutViewConfigPage6::commit (lay::Dispatcher *root)
{
if (m_palette.stipples () == 0) {
throw tl::Exception (tl::to_string (QObject::tr ("No stipples set")));
@ -1266,7 +1267,7 @@ LayoutViewConfigPage6a::~LayoutViewConfigPage6a ()
}
void
LayoutViewConfigPage6a::setup (lay::PluginRoot *root)
LayoutViewConfigPage6a::setup (lay::Dispatcher *root)
{
m_manager.clear ();
@ -1289,7 +1290,7 @@ LayoutViewConfigPage6a::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage6a::commit (lay::PluginRoot *root)
LayoutViewConfigPage6a::commit (lay::Dispatcher *root)
{
if (m_palette.styles () == 0) {
throw tl::Exception (tl::to_string (QObject::tr ("No styles set")));
@ -1440,7 +1441,7 @@ LayoutViewConfigPage7::~LayoutViewConfigPage7 ()
}
void
LayoutViewConfigPage7::setup (lay::PluginRoot *root)
LayoutViewConfigPage7::setup (lay::Dispatcher *root)
{
int oversampling = 1;
root->config_get (cfg_bitmap_oversampling, oversampling);
@ -1466,7 +1467,7 @@ LayoutViewConfigPage7::setup (lay::PluginRoot *root)
}
void
LayoutViewConfigPage7::commit (lay::PluginRoot *root)
LayoutViewConfigPage7::commit (lay::Dispatcher *root)
{
root->config_set (cfg_bitmap_oversampling, mp_ui->oversampling->currentIndex () + 1);
root->config_set (cfg_default_font_size, mp_ui->default_font_size->currentIndex ());

View File

@ -48,7 +48,6 @@
#include "layCellTreeModel.h"
#include "layLayoutView.h"
#include "layAbstractMenu.h"
#include "layAbstractMenuProvider.h"
#include "layDialogs.h"
#include "tlExceptions.h"
#include "laybasicConfig.h"

View File

@ -197,7 +197,7 @@ LoadLayoutOptionsDialog::update ()
}
bool
LoadLayoutOptionsDialog::edit_global_options (lay::PluginRoot *config_root, db::Technologies *technologies)
LoadLayoutOptionsDialog::edit_global_options (lay::Dispatcher *config_root, db::Technologies *technologies)
{
m_opt_array.clear ();
m_tech_array.clear ();

View File

@ -22,6 +22,7 @@
#include "layNetExportDialog.h"
#include "layPlugin.h"
#include "layDispatcher.h"
#include "layQtTools.h"
#include "tlExceptions.h"
@ -165,7 +166,7 @@ END_PROTECTED
}
int
NetExportDialog::exec_dialog (lay::PluginRoot *plugin_root)
NetExportDialog::exec_dialog (lay::Dispatcher *plugin_root)
{
std::string v;
plugin_root->config_get (cfg_l2ndb_export_net_cell_prefix, v);

View File

@ -39,7 +39,7 @@ namespace Ui
namespace lay
{
class PluginRoot;
class Dispatcher;
/**
* @brief A dialog showing the details of a net
@ -74,7 +74,7 @@ public:
void set_start_layer_number (int ln);
int start_layer_number ();
int exec_dialog (lay::PluginRoot *mp_plugin_root);
int exec_dialog (lay::Dispatcher *mp_plugin_root);
protected:
void accept ();

View File

@ -23,8 +23,8 @@
#include "laybasicCommon.h"
#include "layNetlistBrowserDialog.h"
#include "layConverters.h"
#include "layDispatcher.h"
#include <set>
@ -105,7 +105,7 @@ NetlistBrowserConfigPage::NetlistBrowserConfigPage (QWidget *parent)
}
void
NetlistBrowserConfigPage::setup (lay::PluginRoot *root)
NetlistBrowserConfigPage::setup (lay::Dispatcher *root)
{
// window mode
lay::NetlistBrowserConfig::net_window_type wmode = lay::NetlistBrowserConfig::FitNet;
@ -133,7 +133,7 @@ NetlistBrowserConfigPage::window_changed (int m)
}
void
NetlistBrowserConfigPage::commit (lay::PluginRoot *root)
NetlistBrowserConfigPage::commit (lay::Dispatcher *root)
{
double dim = 1.0;
tl::from_string (tl::to_string (le_window->text ()), dim);
@ -195,7 +195,7 @@ NetlistBrowserConfigPage2::color_button_clicked ()
}
void
NetlistBrowserConfigPage2::setup (lay::PluginRoot *root)
NetlistBrowserConfigPage2::setup (lay::Dispatcher *root)
{
bool cycle_enabled = false;
root->config_get (cfg_l2ndb_marker_cycle_colors_enabled, cycle_enabled);
@ -287,7 +287,7 @@ NetlistBrowserConfigPage2::update_colors ()
}
void
NetlistBrowserConfigPage2::commit (lay::PluginRoot *root)
NetlistBrowserConfigPage2::commit (lay::Dispatcher *root)
{
root->config_set (cfg_l2ndb_marker_cycle_colors_enabled, cycle_colors_cb->isChecked ());
root->config_set (cfg_l2ndb_marker_cycle_colors, m_palette.to_string ());
@ -373,10 +373,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 ("netlist_browser::show", "browse_netlists", "tools_menu.end", tl::to_string (QObject::tr ("Netlist Browser"))));
menu_entries.push_back (lay::menu_item ("netlist_browser::show", "browse_netlists", "tools_menu.end", tl::to_string (QObject::tr ("Netlist Browser"))));
}
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 lay::NetlistBrowserDialog (root, view);
}

View File

@ -56,7 +56,7 @@ extern const std::string cfg_l2ndb_max_shapes_highlighted;
extern const std::string cfg_l2ndb_show_all;
extern const std::string cfg_l2ndb_window_state;
NetlistBrowserDialog::NetlistBrowserDialog (lay::PluginRoot *root, lay::LayoutView *vw)
NetlistBrowserDialog::NetlistBrowserDialog (lay::Dispatcher *root, lay::LayoutView *vw)
: lay::Browser (root, vw),
lay::ViewService (vw->view_object_widget ()),
Ui::NetlistBrowserDialog (),
@ -76,7 +76,7 @@ NetlistBrowserDialog::NetlistBrowserDialog (lay::PluginRoot *root, lay::LayoutVi
{
Ui::NetlistBrowserDialog::setupUi (this);
browser_page->set_plugin_root (root);
browser_page->set_dispatcher (root);
if (view ()) {
view ()->cellviews_changed_event.add (this, &NetlistBrowserDialog::cellviews_changed);
@ -132,7 +132,7 @@ NetlistBrowserDialog::configure_clicked ()
{
release_mouse ();
lay::ConfigurationDialog config_dialog (this, lay::PluginRoot::instance (), "NetlistBrowserPlugin");
lay::ConfigurationDialog config_dialog (this, lay::Dispatcher::instance (), "NetlistBrowserPlugin");
config_dialog.exec ();
}
@ -747,8 +747,8 @@ NetlistBrowserDialog::deactivated ()
{
release_mouse ();
if (lay::PluginRoot::instance ()) {
lay::PluginRoot::instance ()->config_set (cfg_l2ndb_window_state, lay::save_dialog_state (this, false /*don't store the section sizes*/).c_str ());
if (lay::Dispatcher::instance ()) {
lay::Dispatcher::instance ()->config_set (cfg_l2ndb_window_state, lay::save_dialog_state (this, false /*don't store the section sizes*/).c_str ());
}
browser_page->set_l2ndb (0);

View File

@ -41,7 +41,7 @@ class NetlistBrowserDialog
Q_OBJECT
public:
NetlistBrowserDialog (lay::PluginRoot *root, lay::LayoutView *view);
NetlistBrowserDialog (lay::Dispatcher *root, lay::LayoutView *view);
~NetlistBrowserDialog ();
void load (int lay_index, int cv_index);

View File

@ -219,7 +219,7 @@ NetlistBrowserPage::is_netlist_mode ()
}
void
NetlistBrowserPage::set_plugin_root (lay::PluginRoot *pr)
NetlistBrowserPage::set_dispatcher (lay::Dispatcher *pr)
{
mp_plugin_root = pr;
}

View File

@ -42,7 +42,7 @@ namespace lay
{
class LayoutView;
class PluginRoot;
class Dispatcher;
class Marker;
class NetInfoDialog;
class LayerPropertiesConstIterator;
@ -76,7 +76,7 @@ public:
/**
* @brief Sets the plugin root object for this object
*/
void set_plugin_root (lay::PluginRoot *pr);
void set_dispatcher (lay::Dispatcher *pr);
/**
* @brief Attaches the page to a view
@ -199,7 +199,7 @@ private:
bool m_use_original_colors;
lay::LayoutView *mp_view;
unsigned int m_cv_index;
lay::PluginRoot *mp_plugin_root;
lay::Dispatcher *mp_plugin_root;
tl::weak_ptr<db::LayoutToNetlist> mp_database;
std::vector<void *> m_history;
size_t m_history_ptr;

View File

@ -243,7 +243,7 @@ PluginDeclaration::init_menu (lay::Dispatcher *dispatcher)
// the primary mouse modes (special for LayoutView)
implements_primary_mouse_modes (modes);
for (std::vector<std::pair<std::string, int> >::const_iterator m = modes.begin (); m != modes.end (); ++m) {
for (std::vector<std::pair<std::string, std::pair<std::string, int> > >::const_iterator m = modes.begin (); m != modes.end (); ++m) {
// extract first part, which is the name, separated by a tab from the title.
std::string name;
@ -501,4 +501,57 @@ Plugin::do_config_set (const std::string &name, const std::string &value, bool f
return false;
}
// ---------------------------------------------------------------------------------------------------
// Menu item generators
MenuEntry separator (const std::string &menu_name, const std::string &insert_pos)
{
MenuEntry e;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
return e;
}
MenuEntry menu_item (const std::string &symbol, const std::string &menu_name, const std::string &insert_pos, const std::string &title)
{
MenuEntry e;
e.symbol = symbol;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
e.title = title;
return e;
}
MenuEntry submenu (const std::string &menu_name, const std::string &insert_pos, const std::string &title)
{
MenuEntry e;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
e.title = title;
e.sub_menu = true;
return e;
}
MenuEntry submenu (const std::string &symbol, const std::string &menu_name, const std::string &insert_pos, const std::string &title)
{
MenuEntry e;
e.symbol = symbol;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
e.title = title;
e.sub_menu = true;
return e;
}
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)
{
MenuEntry e;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
e.title = title;
e.cname = cname;
e.cvalue = cvalue;
return e;
}
}

View File

@ -121,13 +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)
{
MenuEntry e;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
return e;
}
MenuEntry separator (const std::string &menu_name, const std::string &insert_pos);
/**
* @brief Creates a normal menu entry
@ -137,15 +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)
{
MenuEntry e;
e.symbol = symbol;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
e.title = title;
return e;
}
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
@ -154,15 +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)
{
MenuEntry e;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
e.title = title;
e.sub_menu = true;
return e;
}
MenuEntry submenu (const std::string &menu_name, const std::string &insert_pos, const std::string &title);
/**
* @brief Creates a submenu entry
@ -172,16 +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)
{
MenuEntry e;
e.symbol = symbol;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
e.title = title;
e.sub_menu = true;
return e;
}
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
@ -192,16 +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 ())
{
MenuEntry e;
e.menu_name = menu_name;
e.insert_pos = insert_pos;
e.title = title;
e.cname = cname;
e.cvalue = cvalue;
return e;
}
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

@ -230,7 +230,7 @@ SaveLayoutOptionsDialog::update ()
}
bool
SaveLayoutOptionsDialog::edit_global_options (lay::PluginRoot *config_root, db::Technologies *technologies)
SaveLayoutOptionsDialog::edit_global_options (lay::Dispatcher *config_root, db::Technologies *technologies)
{
m_opt_array.clear ();
m_tech_array.clear ();

View File

@ -24,6 +24,7 @@
#include "layTipDialog.h"
#include "laybasicConfig.h"
#include "layPlugin.h"
#include "layDispatcher.h"
#include "layDialogs.h"
#include "layQtTools.h"
@ -134,8 +135,8 @@ TipDialog::do_exec_dialog (button_type *button)
mp_res = button;
std::string th;
if (lay::PluginRoot::instance ()) {
lay::PluginRoot::instance ()->config_get (cfg_tip_window_hidden, th);
if (lay::Dispatcher::instance ()) {
lay::Dispatcher::instance ()->config_get (cfg_tip_window_hidden, th);
}
// test if we need to show this window
@ -172,8 +173,8 @@ TipDialog::accept ()
if (mp_ui->dont_show_cbx->isChecked ()) {
std::string th;
if (lay::PluginRoot::instance ()) {
lay::PluginRoot::instance ()->config_get (cfg_tip_window_hidden, th);
if (lay::Dispatcher::instance ()) {
lay::Dispatcher::instance ()->config_get (cfg_tip_window_hidden, th);
}
if (! th.empty ()) {
@ -183,8 +184,8 @@ TipDialog::accept ()
th += "=";
th += tl::to_string (int (*mp_res));
if (lay::PluginRoot::instance ()) {
lay::PluginRoot::instance ()->config_set (cfg_tip_window_hidden, th);
if (lay::Dispatcher::instance ()) {
lay::Dispatcher::instance ()->config_set (cfg_tip_window_hidden, th);
}
}

View File

@ -197,7 +197,7 @@ DitherPatternSelectionButton::update_menu ()
lay::DitherPattern patterns;
std::string s;
lay::PluginRoot::instance ()->config_get (cfg_stipple_palette, s);
lay::Dispatcher::instance ()->config_get (cfg_stipple_palette, s);
lay::StipplePalette palette;
palette.from_string (s);
@ -831,7 +831,7 @@ ColorButton::build_color_menu (QMenu *menu, QObject *receiver, const char *brows
try {
std::string s;
lay::PluginRoot::instance ()->config_get (cfg_color_palette, s);
lay::Dispatcher::instance ()->config_get (cfg_color_palette, s);
lay::ColorPalette palette;
palette.from_string (s);

View File

@ -26,6 +26,7 @@
#include "dbLayout.h"
#include "layConverters.h"
#include "layDispatcher.h"
#include <set>
@ -133,7 +134,7 @@ MarkerBrowserConfigPage::MarkerBrowserConfigPage (QWidget *parent)
}
void
MarkerBrowserConfigPage::setup (lay::PluginRoot *root)
MarkerBrowserConfigPage::setup (lay::Dispatcher *root)
{
// context mode
rdb::context_mode_type cmode = rdb::DatabaseTop;
@ -166,7 +167,7 @@ MarkerBrowserConfigPage::window_changed (int m)
}
void
MarkerBrowserConfigPage::commit (lay::PluginRoot *root)
MarkerBrowserConfigPage::commit (lay::Dispatcher *root)
{
double dim = 1.0;
tl::from_string (tl::to_string (le_window->text ()), dim);
@ -190,7 +191,7 @@ MarkerBrowserConfigPage2::MarkerBrowserConfigPage2 (QWidget *parent)
}
void
MarkerBrowserConfigPage2::setup (lay::PluginRoot *root)
MarkerBrowserConfigPage2::setup (lay::Dispatcher *root)
{
// marker color
QColor color;
@ -227,7 +228,7 @@ MarkerBrowserConfigPage2::setup (lay::PluginRoot *root)
}
void
MarkerBrowserConfigPage2::commit (lay::PluginRoot *root)
MarkerBrowserConfigPage2::commit (lay::Dispatcher *root)
{
QColor color (color_pb->get_color ());
root->config_set (cfg_rdb_marker_color, color, lay::ColorConverter ());
@ -295,13 +296,13 @@ 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 ("marker_browser::show", "browse_markers", "tools_menu.end", tl::to_string (QObject::tr ("Marker Browser"))));
menu_entries.push_back (lay::MenuEntry ("marker_browser::show", "shapes_to_markers", "tools_menu.end", tl::to_string (QObject::tr ("Shapes To Markers")), true));
menu_entries.push_back (lay::MenuEntry ("marker_browser::scan_layers", "scan_layers", "tools_menu.shapes_to_markers.end", tl::to_string (QObject::tr ("Hierarchical"))));
menu_entries.push_back (lay::MenuEntry ("marker_browser::scan_layers_flat", "scan_layers_flat", "tools_menu.shapes_to_markers.end", tl::to_string (QObject::tr ("Flat"))));
menu_entries.push_back (lay::menu_item ("marker_browser::show", "browse_markers", "tools_menu.end", tl::to_string (QObject::tr ("Marker Browser"))));
menu_entries.push_back (lay::submenu ("marker_browser::show", "shapes_to_markers", "tools_menu.end", tl::to_string (QObject::tr ("Shapes To Markers"))));
menu_entries.push_back (lay::menu_item ("marker_browser::scan_layers", "scan_layers", "tools_menu.shapes_to_markers.end", tl::to_string (QObject::tr ("Hierarchical"))));
menu_entries.push_back (lay::menu_item ("marker_browser::scan_layers_flat", "scan_layers_flat", "tools_menu.shapes_to_markers.end", tl::to_string (QObject::tr ("Flat"))));
}
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 rdb::MarkerBrowserDialog (root, view);
}

View File

@ -54,7 +54,7 @@ extern std::string cfg_rdb_marker_vertex_size;
extern std::string cfg_rdb_marker_halo;
extern std::string cfg_rdb_marker_dither_pattern;
MarkerBrowserDialog::MarkerBrowserDialog (lay::PluginRoot *root, lay::LayoutView *vw)
MarkerBrowserDialog::MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView *vw)
: lay::Browser (root, vw),
Ui::MarkerBrowserDialog (),
m_context (rdb::AnyCell),
@ -70,7 +70,7 @@ MarkerBrowserDialog::MarkerBrowserDialog (lay::PluginRoot *root, lay::LayoutView
{
Ui::MarkerBrowserDialog::setupUi (this);
browser_frame->set_plugin_root (root);
browser_frame->set_dispatcher (root);
if (view ()) {
view ()->cellviews_changed_event.add (this, &MarkerBrowserDialog::cellviews_changed);
@ -122,7 +122,7 @@ MarkerBrowserDialog::~MarkerBrowserDialog ()
void
MarkerBrowserDialog::configure_clicked ()
{
lay::ConfigurationDialog config_dialog (this, lay::PluginRoot::instance (), "MarkerBrowserPlugin");
lay::ConfigurationDialog config_dialog (this, lay::Dispatcher::instance (), "MarkerBrowserPlugin");
config_dialog.exec ();
}
@ -703,8 +703,8 @@ MarkerBrowserDialog::update_content ()
void
MarkerBrowserDialog::deactivated ()
{
if (lay::PluginRoot::instance ()) {
lay::PluginRoot::instance ()->config_set (cfg_rdb_window_state, lay::save_dialog_state (this).c_str ());
if (lay::Dispatcher::instance ()) {
lay::Dispatcher::instance ()->config_set (cfg_rdb_window_state, lay::save_dialog_state (this).c_str ());
}
browser_frame->set_rdb (0);

View File

@ -38,7 +38,7 @@ class MarkerBrowserDialog
Q_OBJECT
public:
MarkerBrowserDialog (lay::PluginRoot *root, lay::LayoutView *view);
MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView *view);
~MarkerBrowserDialog ();
void load (int rdb_index, int cv_index);

View File

@ -1603,7 +1603,7 @@ MarkerBrowserPage::~MarkerBrowserPage ()
}
void
MarkerBrowserPage::set_plugin_root (lay::PluginRoot *pr)
MarkerBrowserPage::set_dispatcher (lay::Dispatcher *pr)
{
mp_plugin_root = pr;
}

View File

@ -37,7 +37,7 @@ namespace lay
{
class LayoutView;
class DMarker;
class PluginRoot;
class Dispatcher;
}
namespace rdb
@ -68,7 +68,7 @@ public:
/**
* @brief Sets the plugin root object for this object
*/
void set_plugin_root (lay::PluginRoot *pr);
void set_dispatcher (lay::Dispatcher *pr);
/**
* @brief Attach the page to a view
@ -206,7 +206,7 @@ private:
Qt::SortOrder m_marker_list_sort_order;
int m_directory_tree_sorted_section;
Qt::SortOrder m_directory_tree_sort_order;
lay::PluginRoot *mp_plugin_root;
lay::Dispatcher *mp_plugin_root;
tl::DeferredMethod<MarkerBrowserPage> dm_rerun_macro;
void release_markers ();