mirror of https://github.com/KLayout/klayout.git
WIP
This commit is contained in:
parent
2378f7964e
commit
c4be80bb2f
|
|
@ -165,6 +165,9 @@ void
|
||||||
LayoutView::init_ui ()
|
LayoutView::init_ui ()
|
||||||
{
|
{
|
||||||
m_activated = true;
|
m_activated = true;
|
||||||
|
m_always_show_source = false;
|
||||||
|
m_always_show_ld = true;
|
||||||
|
m_always_show_layout_index = false;
|
||||||
|
|
||||||
QVBoxLayout *vbl = new QVBoxLayout (this);
|
QVBoxLayout *vbl = new QVBoxLayout (this);
|
||||||
vbl->setContentsMargins (0, 0, 0, 0);
|
vbl->setContentsMargins (0, 0, 0, 0);
|
||||||
|
|
@ -282,10 +285,6 @@ LayoutView::init_ui ()
|
||||||
mp_timer = new QTimer (this);
|
mp_timer = new QTimer (this);
|
||||||
connect (mp_timer, SIGNAL (timeout ()), this, SLOT (timer ()));
|
connect (mp_timer, SIGNAL (timeout ()), this, SLOT (timer ()));
|
||||||
mp_timer->start (timer_interval);
|
mp_timer->start (timer_interval);
|
||||||
|
|
||||||
create_plugins ();
|
|
||||||
|
|
||||||
config_setup ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LayoutView::~LayoutView ()
|
LayoutView::~LayoutView ()
|
||||||
|
|
@ -396,32 +395,8 @@ LayoutView *LayoutView::current ()
|
||||||
|
|
||||||
void LayoutView::create_plugins (const lay::PluginDeclaration *except_this)
|
void LayoutView::create_plugins (const lay::PluginDeclaration *except_this)
|
||||||
{
|
{
|
||||||
clear_plugins ();
|
LayoutViewBase::create_plugins (except_this);
|
||||||
|
|
||||||
// create the plugins
|
|
||||||
for (tl::Registrar<lay::PluginDeclaration>::iterator cls = tl::Registrar<lay::PluginDeclaration>::begin (); cls != tl::Registrar<lay::PluginDeclaration>::end (); ++cls) {
|
|
||||||
|
|
||||||
if (&*cls != except_this) {
|
|
||||||
|
|
||||||
// TODO: clean solution. The following is a HACK:
|
|
||||||
if (cls.current_name () == "ant::Plugin" || cls.current_name () == "img::Plugin") {
|
|
||||||
// ant and img are created always
|
|
||||||
create_plugin (&*cls);
|
|
||||||
} else if ((options () & LV_NoPlugins) == 0) {
|
|
||||||
// others: only create unless LV_NoPlugins is set
|
|
||||||
create_plugin (&*cls);
|
|
||||||
} else if ((options () & LV_NoGrid) == 0 && cls.current_name () == "GridNetPlugin") {
|
|
||||||
// except grid net plugin which is created on request
|
|
||||||
create_plugin (&*cls);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
dm_setup_editor_option_pages ();
|
dm_setup_editor_option_pages ();
|
||||||
|
|
||||||
mode (default_mode ());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
@ -559,6 +534,39 @@ LayoutView::configure (const std::string &name, const std::string &value)
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
} else if (name == cfg_layers_always_show_source) {
|
||||||
|
|
||||||
|
bool a = false;
|
||||||
|
tl::from_string (value, a);
|
||||||
|
if (a != m_always_show_source) {
|
||||||
|
m_always_show_source = a;
|
||||||
|
layer_list_changed_event (4);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} else if (name == cfg_layers_always_show_ld) {
|
||||||
|
|
||||||
|
bool a = false;
|
||||||
|
tl::from_string (value, a);
|
||||||
|
if (a != m_always_show_ld) {
|
||||||
|
m_always_show_ld = a;
|
||||||
|
layer_list_changed_event (4);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} else if (name == cfg_layers_always_show_layout_index) {
|
||||||
|
|
||||||
|
bool a = false;
|
||||||
|
tl::from_string (value, a);
|
||||||
|
if (a != m_always_show_layout_index) {
|
||||||
|
m_always_show_layout_index = a;
|
||||||
|
layer_list_changed_event (4);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -629,6 +637,12 @@ LayoutView::set_current_layer (const lay::LayerPropertiesConstIterator &l)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::do_set_current_layer (const lay::LayerPropertiesConstIterator &l)
|
||||||
|
{
|
||||||
|
set_current_layer (l);
|
||||||
|
}
|
||||||
|
|
||||||
lay::LayerPropertiesConstIterator
|
lay::LayerPropertiesConstIterator
|
||||||
LayoutView::current_layer () const
|
LayoutView::current_layer () const
|
||||||
{
|
{
|
||||||
|
|
@ -657,6 +671,37 @@ LayoutView::set_selected_layers (const std::vector<lay::LayerPropertiesConstIter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::ensure_layer_selected ()
|
||||||
|
{
|
||||||
|
if (! mp_control_panel->has_selection ()) {
|
||||||
|
const lay::LayerPropertiesList &lp = get_properties ();
|
||||||
|
lay::LayerPropertiesConstIterator li = lp.begin_const_recursive ();
|
||||||
|
while (! li.at_end () && li->has_children ()) {
|
||||||
|
++li;
|
||||||
|
}
|
||||||
|
if (! li.at_end ()) {
|
||||||
|
mp_control_panel->set_current_layer (li);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::remove_unused_layers ()
|
||||||
|
{
|
||||||
|
if (mp_control_panel) {
|
||||||
|
mp_control_panel->cm_remove_unused ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::begin_layer_updates ()
|
||||||
|
{
|
||||||
|
if (mp_control_panel) {
|
||||||
|
mp_control_panel->begin_updates ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutView::bookmark_current_view ()
|
LayoutView::bookmark_current_view ()
|
||||||
{
|
{
|
||||||
|
|
@ -764,6 +809,59 @@ LayoutView::do_set_background_color (lay::Color c, lay::Color contrast)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::do_set_no_stipples (bool no_stipples)
|
||||||
|
{
|
||||||
|
if (mp_control_panel) {
|
||||||
|
mp_control_panel->set_no_stipples (no_stipples);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::do_set_phase (int phase)
|
||||||
|
{
|
||||||
|
if (mp_control_panel) {
|
||||||
|
mp_control_panel->set_phase (phase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::enable_active_cellview_changed_event (bool enable, bool silent)
|
||||||
|
{
|
||||||
|
if (m_active_cellview_changed_event_enabled == enable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_active_cellview_changed_event_enabled = enable;
|
||||||
|
if (enable) {
|
||||||
|
|
||||||
|
if (!silent && ! m_active_cellview_changed_events.empty ()) {
|
||||||
|
|
||||||
|
// deliver stored events
|
||||||
|
|
||||||
|
// we need to cancel pending drawing or dragging operations to reflect the new cellview (different target, may have different technology etc.)
|
||||||
|
cancel_esc ();
|
||||||
|
|
||||||
|
// we need to setup the editor option pages because the technology may have changed
|
||||||
|
dm_setup_editor_option_pages ();
|
||||||
|
|
||||||
|
active_cellview_changed_event ();
|
||||||
|
for (std::set<int>::const_iterator i = m_active_cellview_changed_events.begin (); i != m_active_cellview_changed_events.end (); ++i) {
|
||||||
|
active_cellview_changed_with_index_event (*i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Because the title reflects the active one, emit a title changed event
|
||||||
|
if (title_string ().empty ()) {
|
||||||
|
emit title_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
m_active_cellview_changed_events.clear ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutView::active_cellview_changed (int index)
|
LayoutView::active_cellview_changed (int index)
|
||||||
{
|
{
|
||||||
|
|
@ -783,6 +881,8 @@ LayoutView::active_cellview_changed (int index)
|
||||||
emit title_changed ();
|
emit title_changed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
m_active_cellview_changed_events.insert (index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -799,6 +899,32 @@ LayoutView::active_library_changed (int /*index*/)
|
||||||
dispatcher ()->config_set (cfg_current_lib_view, lib_name);
|
dispatcher ()->config_set (cfg_current_lib_view, lib_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
LayoutView::set_hier_levels_basic (std::pair<int, int> l)
|
||||||
|
{
|
||||||
|
if (l != get_hier_levels ()) {
|
||||||
|
|
||||||
|
if (mp_min_hier_spbx) {
|
||||||
|
mp_min_hier_spbx->blockSignals (true);
|
||||||
|
mp_min_hier_spbx->setValue (l.first);
|
||||||
|
mp_min_hier_spbx->setMaximum (l.second);
|
||||||
|
mp_min_hier_spbx->blockSignals (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mp_max_hier_spbx) {
|
||||||
|
mp_max_hier_spbx->blockSignals (true);
|
||||||
|
mp_max_hier_spbx->setValue (l.second);
|
||||||
|
mp_max_hier_spbx->setMinimum (l.first);
|
||||||
|
mp_max_hier_spbx->blockSignals (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return LayoutViewBase::set_hier_levels_basic (l);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
LayoutView::has_selection ()
|
LayoutView::has_selection ()
|
||||||
{
|
{
|
||||||
|
|
@ -924,6 +1050,12 @@ LayoutView::deactivate ()
|
||||||
m_activated = false;
|
m_activated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
LayoutView::is_activated () const
|
||||||
|
{
|
||||||
|
return m_activated;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutView::deactivate_all_browsers ()
|
LayoutView::deactivate_all_browsers ()
|
||||||
{
|
{
|
||||||
|
|
@ -934,6 +1066,14 @@ LayoutView::deactivate_all_browsers ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::update_content_for_cv (int cellview_index)
|
||||||
|
{
|
||||||
|
if (mp_hierarchy_panel) {
|
||||||
|
mp_hierarchy_panel->do_update_content (cellview_index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutView::current_pos (double x, double y)
|
LayoutView::current_pos (double x, double y)
|
||||||
{
|
{
|
||||||
|
|
@ -952,12 +1092,72 @@ LayoutView::current_pos (double x, double y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::emit_edits_enabled_changed ()
|
||||||
|
{
|
||||||
|
emit edits_enabled_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::emit_title_changed ()
|
||||||
|
{
|
||||||
|
emit title_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::emit_dirty_changed ()
|
||||||
|
{
|
||||||
|
emit dirty_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::emit_layer_order_changed ()
|
||||||
|
{
|
||||||
|
emit layer_order_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::signal_selection_changed ()
|
||||||
|
{
|
||||||
|
if (selection_size () > 1) {
|
||||||
|
message (tl::sprintf (tl::to_string (tr ("selected: %ld objects")), selection_size ()));
|
||||||
|
}
|
||||||
|
|
||||||
|
lay::Editables::signal_selection_changed ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutView::message (const std::string &s, int timeout)
|
LayoutView::message (const std::string &s, int timeout)
|
||||||
{
|
{
|
||||||
emit show_message (s, timeout * 1000);
|
emit show_message (s, timeout * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutView::mode (int m)
|
||||||
|
{
|
||||||
|
if (mode () != m) {
|
||||||
|
|
||||||
|
LayoutViewBase::mode (m);
|
||||||
|
|
||||||
|
lay::EditorOptionsPages *eo_pages = editor_options_pages ();
|
||||||
|
if (eo_pages) {
|
||||||
|
|
||||||
|
// TODO: this is very inefficient as each "activate" will regenerate the tabs
|
||||||
|
for (std::vector<lay::EditorOptionsPage *>::const_iterator op = eo_pages->pages ().begin (); op != eo_pages->pages ().end (); ++op) {
|
||||||
|
bool is_active = false;
|
||||||
|
if ((*op)->plugin_declaration () == 0) {
|
||||||
|
is_active = true;
|
||||||
|
} else if (active_plugin () && active_plugin ()->plugin_declaration () == (*op)->plugin_declaration ()) {
|
||||||
|
is_active = true;
|
||||||
|
}
|
||||||
|
(*op)->activate (is_active);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutView::switch_mode (int m)
|
LayoutView::switch_mode (int m)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,19 @@ public:
|
||||||
*/
|
*/
|
||||||
void message (const std::string &s = "", int timeout = 10);
|
void message (const std::string &s = "", int timeout = 10);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Select a certain mode (by index)
|
||||||
|
*/
|
||||||
|
virtual void mode (int m);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the current mode
|
||||||
|
*/
|
||||||
|
int mode () const
|
||||||
|
{
|
||||||
|
return LayoutViewBase::mode ();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Switches the application's mode
|
* @brief Switches the application's mode
|
||||||
*
|
*
|
||||||
|
|
@ -179,7 +192,7 @@ public:
|
||||||
*
|
*
|
||||||
* If plugins already exist, they are deleted and created again
|
* If plugins already exist, they are deleted and created again
|
||||||
*/
|
*/
|
||||||
void create_plugins (const lay::PluginDeclaration *except_this = 0);
|
virtual void create_plugins (const lay::PluginDeclaration *except_this = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the currently active layer by layer properties and cell view index
|
* @brief Sets the currently active layer by layer properties and cell view index
|
||||||
|
|
@ -246,7 +259,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Select a certain cellview for the active one
|
* @brief Select a certain cellview for the active one
|
||||||
*/
|
*/
|
||||||
void set_active_cellview_index (int index);
|
virtual void set_active_cellview_index (int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Cell paths of the selected cells
|
* @brief Cell paths of the selected cells
|
||||||
|
|
@ -292,7 +305,7 @@ public:
|
||||||
* The current cell is the one highlighted in the browser with the focus rectangle. The
|
* The current cell is the one highlighted in the browser with the focus rectangle. The
|
||||||
* cell given by the path is highlighted and scrolled into view.
|
* cell given by the path is highlighted and scrolled into view.
|
||||||
*/
|
*/
|
||||||
void set_current_cell_path (int cv_index, const cell_path_type &path);
|
virtual void set_current_cell_path (int cv_index, const cell_path_type &path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the path to the current cell is the current cellview
|
* @brief Set the path to the current cell is the current cellview
|
||||||
|
|
@ -304,6 +317,35 @@ public:
|
||||||
set_current_cell_path (active_cellview_index (), path);
|
set_current_cell_path (active_cellview_index (), path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Remove unused layers
|
||||||
|
*/
|
||||||
|
void remove_unused_layers ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns true, if the layer source shall be shown always in the layer properties tree
|
||||||
|
*/
|
||||||
|
bool always_show_source () const
|
||||||
|
{
|
||||||
|
return m_always_show_source;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns true, if the layer/datatype shall be shown always in the layer properties tree
|
||||||
|
*/
|
||||||
|
bool always_show_ld () const
|
||||||
|
{
|
||||||
|
return m_always_show_ld;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns true, if the layout index shall be shown always in the layer properties tree
|
||||||
|
*/
|
||||||
|
bool always_show_layout_index () const
|
||||||
|
{
|
||||||
|
return m_always_show_layout_index;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Indicates the current position
|
* @brief Indicates the current position
|
||||||
*/
|
*/
|
||||||
|
|
@ -712,6 +754,10 @@ private:
|
||||||
QSpinBox *mp_max_hier_spbx;
|
QSpinBox *mp_max_hier_spbx;
|
||||||
BookmarkList m_bookmarks;
|
BookmarkList m_bookmarks;
|
||||||
bool m_active_cellview_changed_event_enabled;
|
bool m_active_cellview_changed_event_enabled;
|
||||||
|
std::set<int> m_active_cellview_changed_events;
|
||||||
|
bool m_always_show_source;
|
||||||
|
bool m_always_show_ld;
|
||||||
|
bool m_always_show_layout_index;
|
||||||
|
|
||||||
tl::DeferredMethod<lay::LayoutView> dm_setup_editor_option_pages;
|
tl::DeferredMethod<lay::LayoutView> dm_setup_editor_option_pages;
|
||||||
|
|
||||||
|
|
@ -734,6 +780,25 @@ protected:
|
||||||
virtual lay::Color default_background_color ();
|
virtual lay::Color default_background_color ();
|
||||||
virtual void do_set_background_color (lay::Color color, lay::Color contrast);
|
virtual void do_set_background_color (lay::Color color, lay::Color contrast);
|
||||||
virtual void do_paste ();
|
virtual void do_paste ();
|
||||||
|
virtual void begin_layer_updates ();
|
||||||
|
virtual void ensure_layer_selected ();
|
||||||
|
virtual void do_set_current_layer (const lay::LayerPropertiesConstIterator &l);
|
||||||
|
virtual void update_content_for_cv (int cv_index);
|
||||||
|
virtual void do_set_no_stipples (bool no_stipples);
|
||||||
|
virtual void do_set_phase (int phase);
|
||||||
|
virtual bool set_hier_levels_basic (std::pair<int, int> l);
|
||||||
|
virtual bool is_activated () const;
|
||||||
|
virtual void enable_active_cellview_changed_event (bool enable, bool silent = false);
|
||||||
|
|
||||||
|
// overrides Editables method to display a message
|
||||||
|
void signal_selection_changed ();
|
||||||
|
|
||||||
|
virtual void emit_edits_enabled_changed ();
|
||||||
|
virtual void emit_title_changed ();
|
||||||
|
virtual void emit_dirty_changed ();
|
||||||
|
virtual void emit_layer_order_changed ();
|
||||||
|
|
||||||
|
virtual QWidget *widget () { return this; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,10 @@
|
||||||
#include "gsi.h"
|
#include "gsi.h"
|
||||||
#include "gtf.h"
|
#include "gtf.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
|
# include <QImageWriter>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
namespace lay
|
namespace lay
|
||||||
|
|
@ -366,9 +370,6 @@ LayoutViewBase::init (db::Manager *mgr)
|
||||||
m_transient_selection_mode = true;
|
m_transient_selection_mode = true;
|
||||||
m_sel_inside_pcells = false;
|
m_sel_inside_pcells = false;
|
||||||
m_add_other_layers = false;
|
m_add_other_layers = false;
|
||||||
m_always_show_source = false;
|
|
||||||
m_always_show_ld = true;
|
|
||||||
m_always_show_layout_index = false;
|
|
||||||
m_search_range = 5;
|
m_search_range = 5;
|
||||||
m_search_range_box = 0;
|
m_search_range_box = 0;
|
||||||
|
|
||||||
|
|
@ -376,7 +377,11 @@ LayoutViewBase::init (db::Manager *mgr)
|
||||||
m_layer_properties_lists.back ()->attach_view (this, (unsigned int) (m_layer_properties_lists.size () - 1));
|
m_layer_properties_lists.back ()->attach_view (this, (unsigned int) (m_layer_properties_lists.size () - 1));
|
||||||
m_current_layer_list = 0;
|
m_current_layer_list = 0;
|
||||||
|
|
||||||
mp_canvas = new lay::LayoutCanvas (this); // @@@ Widget parent???
|
#if defined(HAVE_QT)
|
||||||
|
mp_canvas = new lay::LayoutCanvas (widget (), this);
|
||||||
|
#else
|
||||||
|
mp_canvas = new lay::LayoutCanvas (this);
|
||||||
|
#endif
|
||||||
|
|
||||||
mp_canvas->left_arrow_key_pressed.add (this, &LayoutViewBase::pan_left);
|
mp_canvas->left_arrow_key_pressed.add (this, &LayoutViewBase::pan_left);
|
||||||
mp_canvas->up_arrow_key_pressed.add (this, &LayoutViewBase::pan_up);
|
mp_canvas->up_arrow_key_pressed.add (this, &LayoutViewBase::pan_up);
|
||||||
|
|
@ -523,6 +528,35 @@ void LayoutViewBase::clear_plugins ()
|
||||||
delete *p;
|
delete *p;
|
||||||
}
|
}
|
||||||
mp_plugins.clear ();
|
mp_plugins.clear ();
|
||||||
|
mp_active_plugin = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayoutViewBase::create_plugins (const lay::PluginDeclaration *except_this)
|
||||||
|
{
|
||||||
|
clear_plugins ();
|
||||||
|
|
||||||
|
// create the plugins
|
||||||
|
for (tl::Registrar<lay::PluginDeclaration>::iterator cls = tl::Registrar<lay::PluginDeclaration>::begin (); cls != tl::Registrar<lay::PluginDeclaration>::end (); ++cls) {
|
||||||
|
|
||||||
|
if (&*cls != except_this) {
|
||||||
|
|
||||||
|
// TODO: clean solution. The following is a HACK:
|
||||||
|
if (cls.current_name () == "ant::Plugin" || cls.current_name () == "img::Plugin") {
|
||||||
|
// ant and img are created always
|
||||||
|
create_plugin (&*cls);
|
||||||
|
} else if ((options () & LV_NoPlugins) == 0) {
|
||||||
|
// others: only create unless LV_NoPlugins is set
|
||||||
|
create_plugin (&*cls);
|
||||||
|
} else if ((options () & LV_NoGrid) == 0 && cls.current_name () == "GridNetPlugin") {
|
||||||
|
// except grid net plugin which is created on request
|
||||||
|
create_plugin (&*cls);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
mode (default_mode ());
|
||||||
}
|
}
|
||||||
|
|
||||||
lay::Plugin *LayoutViewBase::create_plugin (const lay::PluginDeclaration *cls)
|
lay::Plugin *LayoutViewBase::create_plugin (const lay::PluginDeclaration *cls)
|
||||||
|
|
@ -604,29 +638,6 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
|
||||||
tl::from_string (value, m_add_other_layers);
|
tl::from_string (value, m_add_other_layers);
|
||||||
return false; // not taken - let others set it too.
|
return false; // not taken - let others set it too.
|
||||||
|
|
||||||
} else if (name == cfg_layers_always_show_source) {
|
|
||||||
|
|
||||||
bool a = false;
|
|
||||||
tl::from_string (value, a);
|
|
||||||
if (a != m_always_show_source) {
|
|
||||||
m_always_show_source = a;
|
|
||||||
layer_list_changed_event (4);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
} else if (name == cfg_layers_always_show_ld) {
|
|
||||||
|
|
||||||
tl::from_string (value, m_always_show_ld);
|
|
||||||
update_content ();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
} else if (name == cfg_layers_always_show_layout_index) {
|
|
||||||
|
|
||||||
tl::from_string (value, m_always_show_layout_index);
|
|
||||||
update_content ();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
} else if (name == cfg_background_color) {
|
} else if (name == cfg_background_color) {
|
||||||
|
|
||||||
lay::Color color;
|
lay::Color color;
|
||||||
|
|
@ -1184,7 +1195,7 @@ LayoutViewBase::enable_edits (bool enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edits_enabled () != is_enabled) {
|
if (edits_enabled () != is_enabled) {
|
||||||
emit edits_enabled_changed ();
|
emit_edits_enabled_changed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1415,8 +1426,8 @@ LayoutViewBase::set_properties (unsigned int index, const LayerPropertiesList &p
|
||||||
manager ()->clear ();
|
manager ()->clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mp_control_panel && index == current_layer_list ()) {
|
if (index == current_layer_list ()) {
|
||||||
mp_control_panel->begin_updates ();
|
begin_layer_updates ();
|
||||||
}
|
}
|
||||||
|
|
||||||
*m_layer_properties_lists [index] = props;
|
*m_layer_properties_lists [index] = props;
|
||||||
|
|
@ -1479,9 +1490,9 @@ LayoutViewBase::replace_layer_node (unsigned int index, const LayerPropertiesCon
|
||||||
manager ()->clear ();
|
manager ()->clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mp_control_panel && index == current_layer_list ()) {
|
if (index == current_layer_list ()) {
|
||||||
mp_control_panel->begin_updates ();
|
begin_layer_updates ();
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerPropertiesIterator non_const_iter (get_properties (index), iter.uint ());
|
LayerPropertiesIterator non_const_iter (get_properties (index), iter.uint ());
|
||||||
*non_const_iter = node;
|
*non_const_iter = node;
|
||||||
|
|
@ -1554,8 +1565,8 @@ LayoutViewBase::insert_layer (unsigned int index, const LayerPropertiesConstIter
|
||||||
manager ()->clear ();
|
manager ()->clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mp_control_panel && index == current_layer_list ()) {
|
if (index == current_layer_list ()) {
|
||||||
mp_control_panel->begin_updates ();
|
begin_layer_updates ();
|
||||||
}
|
}
|
||||||
|
|
||||||
const LayerPropertiesNode &ret = m_layer_properties_lists [index]->insert (LayerPropertiesIterator (*m_layer_properties_lists [index], before.uint ()), node);
|
const LayerPropertiesNode &ret = m_layer_properties_lists [index]->insert (LayerPropertiesIterator (*m_layer_properties_lists [index], before.uint ()), node);
|
||||||
|
|
@ -1579,8 +1590,8 @@ LayoutViewBase::delete_layer (unsigned int index, LayerPropertiesConstIterator &
|
||||||
|
|
||||||
lay::LayerPropertiesNode orig = *iter;
|
lay::LayerPropertiesNode orig = *iter;
|
||||||
|
|
||||||
if (mp_control_panel && index == current_layer_list ()) {
|
if (index == current_layer_list ()) {
|
||||||
mp_control_panel->begin_updates ();
|
begin_layer_updates ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete the element
|
// delete the element
|
||||||
|
|
@ -1603,16 +1614,6 @@ LayoutViewBase::delete_layer (unsigned int index, LayerPropertiesConstIterator &
|
||||||
iter.invalidate ();
|
iter.invalidate ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
LayoutViewBase::signal_selection_changed ()
|
|
||||||
{
|
|
||||||
if (selection_size () > 1) {
|
|
||||||
message (tl::sprintf (tl::to_string (tr ("selected: %ld objects")), selection_size ()));
|
|
||||||
}
|
|
||||||
|
|
||||||
lay::Editables::signal_selection_changed ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutViewBase::save_as (unsigned int index, const std::string &filename, tl::OutputStream::OutputStreamMode om, const db::SaveLayoutOptions &options, bool update, int keep_backups)
|
LayoutViewBase::save_as (unsigned int index, const std::string &filename, tl::OutputStream::OutputStreamMode om, const db::SaveLayoutOptions &options, bool update, int keep_backups)
|
||||||
{
|
{
|
||||||
|
|
@ -1942,9 +1943,7 @@ LayoutViewBase::erase_cellview (unsigned int index)
|
||||||
manager ()->clear ();
|
manager ()->clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mp_control_panel) {
|
begin_layer_updates ();
|
||||||
mp_control_panel->begin_updates ();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_cellviews.erase (cellview_iter (int (index)));
|
m_cellviews.erase (cellview_iter (int (index)));
|
||||||
|
|
||||||
|
|
@ -1985,7 +1984,7 @@ LayoutViewBase::erase_cellview (unsigned int index)
|
||||||
update_content ();
|
update_content ();
|
||||||
|
|
||||||
if (m_title.empty ()) {
|
if (m_title.empty ()) {
|
||||||
emit title_changed ();
|
emit_title_changed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2014,7 +2013,7 @@ LayoutViewBase::clear_cellviews ()
|
||||||
finish_cellviews_changed ();
|
finish_cellviews_changed ();
|
||||||
|
|
||||||
if (m_title.empty ()) {
|
if (m_title.empty ()) {
|
||||||
emit title_changed ();
|
emit_title_changed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2081,12 +2080,10 @@ LayoutViewBase::set_layout (const lay::CellView &cv, unsigned int cvindex)
|
||||||
// since the hierarchy panel may hold cellviews, we explicitly request an initialization
|
// since the hierarchy panel may hold cellviews, we explicitly request an initialization
|
||||||
// of the tree. This will release such references. This way, set_layout guarantees that
|
// of the tree. This will release such references. This way, set_layout guarantees that
|
||||||
// the layouts are released as far as possible. This is important for reload () for example.
|
// the layouts are released as far as possible. This is important for reload () for example.
|
||||||
if (mp_hierarchy_panel) {
|
update_content_for_cv (cvindex);
|
||||||
mp_hierarchy_panel->do_update_content (cvindex);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_title.empty ()) {
|
if (m_title.empty ()) {
|
||||||
emit title_changed ();
|
emit_title_changed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2291,7 +2288,7 @@ LayoutViewBase::add_new_layers (const std::vector <unsigned int> &layer_ids, int
|
||||||
set_properties (new_props);
|
set_properties (new_props);
|
||||||
|
|
||||||
if (was_empty) {
|
if (was_empty) {
|
||||||
set_current_layer (new_props.begin_const_recursive ());
|
do_set_current_layer (new_props.begin_const_recursive ());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2618,7 +2615,7 @@ LayoutViewBase::add_layout (lay::LayoutHandle *layout_handle, bool add_cellview,
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
m_active_cellview_changed_event_enabled = false;
|
enable_active_cellview_changed_event (false);
|
||||||
|
|
||||||
stop_redraw ();
|
stop_redraw ();
|
||||||
|
|
||||||
|
|
@ -2698,15 +2695,8 @@ LayoutViewBase::add_layout (lay::LayoutHandle *layout_handle, bool add_cellview,
|
||||||
}
|
}
|
||||||
|
|
||||||
// select the first layer if nothing else is selected
|
// select the first layer if nothing else is selected
|
||||||
if (cv_index == 0 && ! mp_control_panel->has_selection ()) {
|
if (cv_index == 0) {
|
||||||
const lay::LayerPropertiesList &lp = get_properties ();
|
ensure_layer_selected ();
|
||||||
lay::LayerPropertiesConstIterator li = lp.begin_const_recursive ();
|
|
||||||
while (! li.at_end () && li->has_children ()) {
|
|
||||||
++li;
|
|
||||||
}
|
|
||||||
if (! li.at_end ()) {
|
|
||||||
mp_control_panel->set_current_layer (li);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// signal to any observers
|
// signal to any observers
|
||||||
|
|
@ -2727,20 +2717,17 @@ LayoutViewBase::add_layout (lay::LayoutHandle *layout_handle, bool add_cellview,
|
||||||
set_active_cellview_index (cv_index);
|
set_active_cellview_index (cv_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_active_cellview_changed_event_enabled = true;
|
enable_active_cellview_changed_event (true);
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
||||||
update_content ();
|
update_content ();
|
||||||
|
|
||||||
m_active_cellview_changed_event_enabled = true;
|
enable_active_cellview_changed_event (true, true);
|
||||||
throw;
|
throw;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this event may not be generated otherwise, hence force it now.
|
|
||||||
active_cellview_changed (cv_index);
|
|
||||||
|
|
||||||
return cv_index;
|
return cv_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2824,7 +2811,7 @@ LayoutViewBase::load_layout (const std::string &filename, const db::LoadLayoutOp
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
m_active_cellview_changed_event_enabled = false;
|
enable_active_cellview_changed_event (false);
|
||||||
|
|
||||||
// select the cell with the largest area as the first top cell
|
// select the cell with the largest area as the first top cell
|
||||||
db::Layout::top_down_const_iterator top = cv->layout ().begin_top_down ();
|
db::Layout::top_down_const_iterator top = cv->layout ().begin_top_down ();
|
||||||
|
|
@ -2875,15 +2862,8 @@ LayoutViewBase::load_layout (const std::string &filename, const db::LoadLayoutOp
|
||||||
create_initial_layer_props (cv_index, lyp_file, add_other_layers);
|
create_initial_layer_props (cv_index, lyp_file, add_other_layers);
|
||||||
|
|
||||||
// select the first layer if nothing else is selected
|
// select the first layer if nothing else is selected
|
||||||
if (cv_index == 0 && ! mp_control_panel->has_selection ()) {
|
if (cv_index == 0) {
|
||||||
const lay::LayerPropertiesList &lp = get_properties ();
|
ensure_layer_selected ();
|
||||||
lay::LayerPropertiesConstIterator li = lp.begin_const_recursive ();
|
|
||||||
while (! li.at_end () && li->has_children ()) {
|
|
||||||
++li;
|
|
||||||
}
|
|
||||||
if (! li.at_end ()) {
|
|
||||||
mp_control_panel->set_current_layer (li);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// signal to any observers
|
// signal to any observers
|
||||||
|
|
@ -2896,20 +2876,17 @@ LayoutViewBase::load_layout (const std::string &filename, const db::LoadLayoutOp
|
||||||
}
|
}
|
||||||
update_content ();
|
update_content ();
|
||||||
|
|
||||||
m_active_cellview_changed_event_enabled = true;
|
enable_active_cellview_changed_event (true);
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
||||||
update_content ();
|
update_content ();
|
||||||
|
|
||||||
m_active_cellview_changed_event_enabled = true;
|
enable_active_cellview_changed_event (true, true /*silent*/);
|
||||||
throw;
|
throw;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this event may not be generated otherwise, hence force it now.
|
|
||||||
active_cellview_changed (cv_index);
|
|
||||||
|
|
||||||
return cv_index;
|
return cv_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3092,7 +3069,7 @@ LayoutViewBase::timer ()
|
||||||
|
|
||||||
if (dirty != m_dirty) {
|
if (dirty != m_dirty) {
|
||||||
m_dirty = dirty;
|
m_dirty = dirty;
|
||||||
emit dirty_changed ();
|
emit_dirty_changed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_prop_changed) {
|
if (m_prop_changed) {
|
||||||
|
|
@ -3105,9 +3082,7 @@ LayoutViewBase::timer ()
|
||||||
m_last_checked = current_time;
|
m_last_checked = current_time;
|
||||||
if (m_animated) {
|
if (m_animated) {
|
||||||
set_view_ops ();
|
set_view_ops ();
|
||||||
if (mp_control_panel) {
|
do_set_phase (int (m_phase));
|
||||||
mp_control_panel->set_phase (int (m_phase));
|
|
||||||
}
|
|
||||||
if (m_animated) {
|
if (m_animated) {
|
||||||
++m_phase;
|
++m_phase;
|
||||||
}
|
}
|
||||||
|
|
@ -3124,7 +3099,7 @@ LayoutViewBase::force_update_content ()
|
||||||
void
|
void
|
||||||
LayoutViewBase::update_content ()
|
LayoutViewBase::update_content ()
|
||||||
{
|
{
|
||||||
if (m_activated) {
|
if (is_activated ()) {
|
||||||
set_view_ops ();
|
set_view_ops ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3836,20 +3811,6 @@ LayoutViewBase::set_hier_levels_basic (std::pair<int, int> l)
|
||||||
{
|
{
|
||||||
if (l != get_hier_levels ()) {
|
if (l != get_hier_levels ()) {
|
||||||
|
|
||||||
if (mp_min_hier_spbx) {
|
|
||||||
mp_min_hier_spbx->blockSignals (true);
|
|
||||||
mp_min_hier_spbx->setValue (l.first);
|
|
||||||
mp_min_hier_spbx->setMaximum (l.second);
|
|
||||||
mp_min_hier_spbx->blockSignals (false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mp_max_hier_spbx) {
|
|
||||||
mp_max_hier_spbx->blockSignals (true);
|
|
||||||
mp_max_hier_spbx->setValue (l.second);
|
|
||||||
mp_max_hier_spbx->setMinimum (l.first);
|
|
||||||
mp_max_hier_spbx->blockSignals (false);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_from_level = l.first;
|
m_from_level = l.first;
|
||||||
m_to_level = l.second;
|
m_to_level = l.second;
|
||||||
|
|
||||||
|
|
@ -4122,17 +4083,21 @@ LayoutViewBase::select_cellviews_fit (const std::list <CellView> &cvs)
|
||||||
void
|
void
|
||||||
LayoutViewBase::cellview_changed (unsigned int index)
|
LayoutViewBase::cellview_changed (unsigned int index)
|
||||||
{
|
{
|
||||||
if (mp_hierarchy_panel) {
|
update_content_for_cv (index);
|
||||||
mp_hierarchy_panel->do_update_content (index);
|
|
||||||
}
|
|
||||||
|
|
||||||
cellview_changed_event (index);
|
cellview_changed_event (index);
|
||||||
|
|
||||||
if (m_title.empty ()) {
|
if (m_title.empty ()) {
|
||||||
emit title_changed ();
|
emit_title_changed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::set_current_cell_path (int /*cv_index*/, const cell_path_type & /*path*/)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutViewBase::select_cell_dispatch (const cell_path_type &path, int cellview_index)
|
LayoutViewBase::select_cell_dispatch (const cell_path_type &path, int cellview_index)
|
||||||
{
|
{
|
||||||
|
|
@ -4523,9 +4488,7 @@ LayoutViewBase::no_stipples (bool f)
|
||||||
{
|
{
|
||||||
if (m_no_stipples != f) {
|
if (m_no_stipples != f) {
|
||||||
m_no_stipples = f;
|
m_no_stipples = f;
|
||||||
if (mp_control_panel) {
|
do_set_no_stipples (f);
|
||||||
mp_control_panel->set_no_stipples (m_no_stipples);
|
|
||||||
}
|
|
||||||
update_content ();
|
update_content ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4613,43 +4576,24 @@ LayoutViewBase::paste_interactive ()
|
||||||
void
|
void
|
||||||
LayoutViewBase::copy ()
|
LayoutViewBase::copy ()
|
||||||
{
|
{
|
||||||
if (mp_hierarchy_panel && mp_hierarchy_panel->has_focus ()) {
|
if (! lay::Editables::has_selection ()) {
|
||||||
mp_hierarchy_panel->copy ();
|
// try to use the transient selection for the real one
|
||||||
} else if (mp_control_panel && mp_control_panel->has_focus ()) {
|
lay::Editables::transient_to_selection ();
|
||||||
mp_control_panel->copy ();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (! lay::Editables::has_selection ()) {
|
|
||||||
// try to use the transient selection for the real one
|
|
||||||
lay::Editables::transient_to_selection ();
|
|
||||||
}
|
|
||||||
|
|
||||||
lay::Editables::copy ();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lay::Editables::copy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutViewBase::cut ()
|
LayoutViewBase::cut ()
|
||||||
{
|
{
|
||||||
if (mp_hierarchy_panel && mp_hierarchy_panel->has_focus ()) {
|
if (! lay::Editables::has_selection ()) {
|
||||||
// TODO: currently the hierarchy panel's cut function does it's own transaction handling.
|
// try to use the transient selection for the real one
|
||||||
// Otherwise the cut function is not working propertly.
|
lay::Editables::transient_to_selection ();
|
||||||
mp_hierarchy_panel->cut ();
|
|
||||||
} else if (mp_control_panel && mp_control_panel->has_focus ()) {
|
|
||||||
db::Transaction trans (manager (), tl::to_string (QObject::tr ("Cut Layers")));
|
|
||||||
mp_control_panel->cut ();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (! lay::Editables::has_selection ()) {
|
|
||||||
// try to use the transient selection for the real one
|
|
||||||
lay::Editables::transient_to_selection ();
|
|
||||||
}
|
|
||||||
|
|
||||||
db::Transaction trans (manager (), tl::to_string (QObject::tr ("Cut")));
|
|
||||||
lay::Editables::cut ();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
db::Transaction trans (manager (), tl::to_string (QObject::tr ("Cut")));
|
||||||
|
lay::Editables::cut ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -4686,7 +4630,7 @@ LayoutViewBase::add_missing_layers ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit layer_order_changed ();
|
emit_layer_order_changed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerState
|
LayerState
|
||||||
|
|
@ -4742,15 +4686,7 @@ LayoutViewBase::add_new_layers (const LayerState &state)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needs_update) {
|
if (needs_update) {
|
||||||
emit layer_order_changed ();
|
emit_layer_order_changed ();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
LayoutViewBase::remove_unused_layers ()
|
|
||||||
{
|
|
||||||
if (mp_control_panel) {
|
|
||||||
mp_control_panel->cm_remove_unused ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4809,25 +4745,79 @@ LayoutViewBase::stop ()
|
||||||
deactivate_all_browsers ();
|
deactivate_all_browsers ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::begin_layer_updates ()
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::ensure_layer_selected ()
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::do_set_current_layer (const lay::LayerPropertiesConstIterator & /*l*/)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::do_set_no_stipples (bool /*no_stipples*/)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::do_set_phase (int /*phase*/)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::deactivate_all_browsers ()
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
LayoutViewBase::is_activated () const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutViewBase::switch_mode (int /*m*/)
|
LayoutViewBase::switch_mode (int /*m*/)
|
||||||
{
|
{
|
||||||
// .. nothing yet ..
|
// .. nothing yet ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::set_active_cellview_index (int /*index*/)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LayoutViewBase::enable_active_cellview_changed_event (bool /*enable*/, bool /*silent*/)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayoutViewBase::mode (int m)
|
LayoutViewBase::mode (int m)
|
||||||
{
|
{
|
||||||
if (m != m_mode) {
|
if (m != m_mode) {
|
||||||
|
|
||||||
m_mode = m;
|
m_mode = m;
|
||||||
lay::Plugin *active_plugin = 0;
|
mp_active_plugin = 0;
|
||||||
|
|
||||||
if (m > 0) {
|
if (m > 0) {
|
||||||
|
|
||||||
for (std::vector<lay::Plugin *>::iterator p = mp_plugins.begin (); p != mp_plugins.end (); ++p) {
|
for (std::vector<lay::Plugin *>::iterator p = mp_plugins.begin (); p != mp_plugins.end (); ++p) {
|
||||||
if ((*p)->plugin_declaration ()->id () == m) {
|
if ((*p)->plugin_declaration ()->id () == m) {
|
||||||
active_plugin = *p;
|
mp_active_plugin = *p;
|
||||||
mp_canvas->activate ((*p)->view_service_interface ());
|
mp_canvas->activate ((*p)->view_service_interface ());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -4839,22 +4829,6 @@ LayoutViewBase::mode (int m)
|
||||||
mp_canvas->activate (mp_move_service);
|
mp_canvas->activate (mp_move_service);
|
||||||
}
|
}
|
||||||
|
|
||||||
lay::EditorOptionsPages *eo_pages = editor_options_pages ();
|
|
||||||
if (eo_pages) {
|
|
||||||
|
|
||||||
// TODO: this is very inefficient as each "activate" will regenerate the tabs
|
|
||||||
for (std::vector<lay::EditorOptionsPage *>::const_iterator op = eo_pages->pages ().begin (); op != eo_pages->pages ().end (); ++op) {
|
|
||||||
bool is_active = false;
|
|
||||||
if ((*op)->plugin_declaration () == 0) {
|
|
||||||
is_active = true;
|
|
||||||
} else if (active_plugin && active_plugin->plugin_declaration () == (*op)->plugin_declaration ()) {
|
|
||||||
is_active = true;
|
|
||||||
}
|
|
||||||
(*op)->activate (is_active);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4911,15 +4885,21 @@ LayoutViewBase::menu_activated (const std::string &symbol)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
LayoutViewBase::update_content_for_cv (int /*cellview_index*/)
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
LayoutViewBase::rename_cellview (const std::string &name, int cellview_index)
|
LayoutViewBase::rename_cellview (const std::string &name, int cellview_index)
|
||||||
{
|
{
|
||||||
if (cellview_index >= 0 && cellview_index < int (m_cellviews.size ())) {
|
if (cellview_index >= 0 && cellview_index < int (m_cellviews.size ())) {
|
||||||
if ((*cellview_iter (cellview_index))->name () != name) {
|
if ((*cellview_iter (cellview_index))->name () != name) {
|
||||||
(*cellview_iter (cellview_index))->rename (name);
|
(*cellview_iter (cellview_index))->rename (name);
|
||||||
mp_hierarchy_panel->do_update_content (cellview_index);
|
update_content_for_cv (cellview_index);
|
||||||
if (m_title.empty ()) {
|
if (m_title.empty ()) {
|
||||||
emit title_changed ();
|
emit_title_changed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,10 @@
|
||||||
#include "tlTimer.h"
|
#include "tlTimer.h"
|
||||||
#include "dbInstElement.h"
|
#include "dbInstElement.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
|
class QWidget;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace rdb {
|
namespace rdb {
|
||||||
class Database;
|
class Database;
|
||||||
}
|
}
|
||||||
|
|
@ -1392,7 +1396,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Select a certain mode (by index)
|
* @brief Select a certain mode (by index)
|
||||||
*/
|
*/
|
||||||
void mode (int m);
|
virtual void mode (int m);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Test, if the view is currently in move mode.
|
* @brief Test, if the view is currently in move mode.
|
||||||
|
|
@ -2022,35 +2026,6 @@ public:
|
||||||
*/
|
*/
|
||||||
LayerState layer_snapshot () const;
|
LayerState layer_snapshot () const;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Remove unused layers
|
|
||||||
*/
|
|
||||||
void remove_unused_layers ();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Returns true, if the layer source shall be shown always in the layer properties tree
|
|
||||||
*/
|
|
||||||
bool always_show_source () const
|
|
||||||
{
|
|
||||||
return m_always_show_source;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Returns true, if the layer/datatype shall be shown always in the layer properties tree
|
|
||||||
*/
|
|
||||||
bool always_show_ld () const
|
|
||||||
{
|
|
||||||
return m_always_show_ld;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Returns true, if the layout index shall be shown always in the layer properties tree
|
|
||||||
*/
|
|
||||||
bool always_show_layout_index () const
|
|
||||||
{
|
|
||||||
return m_always_show_layout_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a marker database
|
* @brief Add a marker database
|
||||||
*
|
*
|
||||||
|
|
@ -2364,9 +2339,6 @@ private:
|
||||||
tl::vector <db::LayoutToNetlist *> m_l2ndbs;
|
tl::vector <db::LayoutToNetlist *> m_l2ndbs;
|
||||||
std::string m_def_lyp_file;
|
std::string m_def_lyp_file;
|
||||||
bool m_add_other_layers;
|
bool m_add_other_layers;
|
||||||
bool m_always_show_source;
|
|
||||||
bool m_always_show_ld;
|
|
||||||
bool m_always_show_layout_index;
|
|
||||||
bool m_synchronous;
|
bool m_synchronous;
|
||||||
int m_drawing_workers;
|
int m_drawing_workers;
|
||||||
|
|
||||||
|
|
@ -2461,6 +2433,8 @@ private:
|
||||||
|
|
||||||
std::vector<lay::Plugin *> mp_plugins;
|
std::vector<lay::Plugin *> mp_plugins;
|
||||||
|
|
||||||
|
lay::Plugin *mp_active_plugin;
|
||||||
|
|
||||||
bool m_visibility_changed;
|
bool m_visibility_changed;
|
||||||
|
|
||||||
tl::Clock m_clock, m_last_checked;
|
tl::Clock m_clock, m_last_checked;
|
||||||
|
|
@ -2484,7 +2458,6 @@ private:
|
||||||
void abstract_mode_enabled (bool e);
|
void abstract_mode_enabled (bool e);
|
||||||
bool has_max_hier () const;
|
bool has_max_hier () const;
|
||||||
int max_hier_level () const;
|
int max_hier_level () const;
|
||||||
bool set_hier_levels_basic (std::pair<int, int> l);
|
|
||||||
|
|
||||||
void update_event_handlers ();
|
void update_event_handlers ();
|
||||||
void viewport_changed ();
|
void viewport_changed ();
|
||||||
|
|
@ -2495,9 +2468,6 @@ private:
|
||||||
void init_layer_properties (LayerProperties &props, const LayerPropertiesList &lp_list) const;
|
void init_layer_properties (LayerProperties &props, const LayerPropertiesList &lp_list) const;
|
||||||
void merge_dither_pattern (lay::LayerPropertiesList &props);
|
void merge_dither_pattern (lay::LayerPropertiesList &props);
|
||||||
|
|
||||||
// overrides Editables method to display a message
|
|
||||||
void signal_selection_changed ();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
unsigned int options () const
|
unsigned int options () const
|
||||||
{
|
{
|
||||||
|
|
@ -2509,6 +2479,11 @@ protected:
|
||||||
return m_mode;
|
return m_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lay::Plugin *active_plugin () const
|
||||||
|
{
|
||||||
|
return mp_active_plugin;
|
||||||
|
}
|
||||||
|
|
||||||
bool configure (const std::string &name, const std::string &value);
|
bool configure (const std::string &name, const std::string &value);
|
||||||
void config_finalize ();
|
void config_finalize ();
|
||||||
|
|
||||||
|
|
@ -2517,6 +2492,7 @@ protected:
|
||||||
|
|
||||||
lay::Plugin *create_plugin (const lay::PluginDeclaration *cls);
|
lay::Plugin *create_plugin (const lay::PluginDeclaration *cls);
|
||||||
void clear_plugins ();
|
void clear_plugins ();
|
||||||
|
virtual void create_plugins (const lay::PluginDeclaration *except_this = 0);
|
||||||
|
|
||||||
void free_resources ();
|
void free_resources ();
|
||||||
|
|
||||||
|
|
@ -2524,6 +2500,27 @@ protected:
|
||||||
virtual void do_set_background_color (lay::Color color, lay::Color contrast);
|
virtual void do_set_background_color (lay::Color color, lay::Color contrast);
|
||||||
virtual void do_paste ();
|
virtual void do_paste ();
|
||||||
virtual void switch_mode (int m);
|
virtual void switch_mode (int m);
|
||||||
|
virtual void begin_layer_updates ();
|
||||||
|
virtual void ensure_layer_selected ();
|
||||||
|
virtual void do_set_current_layer (const lay::LayerPropertiesConstIterator &l);
|
||||||
|
virtual void do_set_no_stipples (bool no_stipples);
|
||||||
|
virtual void do_set_phase (int phase);
|
||||||
|
virtual void deactivate_all_browsers ();
|
||||||
|
virtual bool is_activated () const;
|
||||||
|
virtual void update_content_for_cv (int cv_index);
|
||||||
|
virtual void set_active_cellview_index (int index);
|
||||||
|
virtual void enable_active_cellview_changed_event (bool enable, bool silent = false);
|
||||||
|
virtual bool set_hier_levels_basic (std::pair<int, int> l);
|
||||||
|
virtual void set_current_cell_path (int cv_index, const cell_path_type &path);
|
||||||
|
|
||||||
|
virtual void emit_edits_enabled_changed () { }
|
||||||
|
virtual void emit_title_changed () { }
|
||||||
|
virtual void emit_dirty_changed () { }
|
||||||
|
virtual void emit_layer_order_changed () { }
|
||||||
|
|
||||||
|
#if defined(HAVE_QT)
|
||||||
|
virtual QWidget *widget () { return 0; }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue