Merge branch 'master' into devel

This commit is contained in:
Matthias Koefferlein
2025-03-06 19:35:32 +01:00
97 changed files with 2618 additions and 1557 deletions
@@ -607,7 +607,7 @@ LAYBASIC_PUBLIC Class<lay::LayoutViewBase> decl_LayoutViewBase ("lay", "LayoutVi
"\n"
"See \\set_title and \\title for a description about how titles are handled."
) +
gsi::method ("title", static_cast<std::string (lay::LayoutViewBase::*) () const> (&lay::LayoutViewBase::title),
gsi::method ("title", static_cast<const std::string &(lay::LayoutViewBase::*) () const> (&lay::LayoutViewBase::title),
"@brief Returns the view's title string\n"
"\n"
"@return The title string\n"
+66 -59
View File
@@ -542,7 +542,7 @@ void LayoutViewBase::update_event_handlers ()
ly.dbu_changed_event.add (this, &LayoutViewBase::signal_bboxes_changed);
ly.prop_ids_changed_event.add (this, &LayoutViewBase::signal_prop_ids_changed);
ly.layer_properties_changed_event.add (this, &LayoutViewBase::signal_layer_properties_changed);
ly.cell_name_changed_event.add (this, &LayoutViewBase::signal_cell_name_changed);
ly.cell_name_changed_event.add (this, &LayoutViewBase::signal_cell_name_changed, i);
cellview (i)->apply_technology_with_sender_event.add (this, &LayoutViewBase::signal_apply_technology);
}
@@ -688,13 +688,30 @@ LayoutViewBase::is_dirty () const
return m_dirty;
}
std::string
const std::string &
LayoutViewBase::title () const
{
return m_current_title;
}
void
LayoutViewBase::update_title ()
{
if (! m_title.empty ()) {
return m_title;
if (m_title != m_current_title) {
m_current_title = m_title;
emit_title_changed ();
}
} else if (cellviews () == 0) {
return tl::to_string (tr ("<empty>"));
static std::string empty_title = tl::to_string (tr ("<empty>"));
if (m_current_title != empty_title) {
m_current_title = empty_title;
emit_title_changed ();
}
} else {
int cv_index = active_cellview_index ();
@@ -717,27 +734,25 @@ LayoutViewBase::title () const
t += " ...";
}
return t;
if (t != m_current_title) {
m_current_title = t;
emit_title_changed ();
}
}
}
void
LayoutViewBase::set_title (const std::string &t)
{
if (m_title != t) {
m_title = t;
emit_title_changed ();
}
m_title = t;
update_title ();
}
void
LayoutViewBase::reset_title ()
{
if (! m_title.empty ()) {
m_title = "";
emit_title_changed ();
}
m_title.clear ();
update_title ();
}
bool
@@ -1980,9 +1995,9 @@ LayoutViewBase::replace_layer_node (unsigned int index, const LayerPropertiesCon
manager ()->clear ();
}
if (index == current_layer_list ()) {
begin_layer_updates ();
}
if (index == current_layer_list ()) {
begin_layer_updates ();
}
LayerPropertiesIterator non_const_iter (get_properties (index), iter.uint ());
*non_const_iter = node;
@@ -2345,9 +2360,13 @@ LayoutViewBase::signal_bboxes_changed ()
}
void
LayoutViewBase::signal_cell_name_changed ()
LayoutViewBase::signal_cell_name_changed (unsigned int cv_index)
{
cell_visibility_changed_event (); // HINT: that is not what actually is intended, but it serves the function ...
cellview_changed_event (int (cv_index));
// Because the title reflects the active cell, emit a title changed event
update_title ();
redraw_later (); // needs redraw
}
@@ -2494,10 +2513,7 @@ LayoutViewBase::erase_cellview (unsigned int index)
finish_cellviews_changed ();
update_content ();
if (m_title.empty ()) {
emit_title_changed ();
}
update_title ();
}
void
@@ -2527,9 +2543,7 @@ LayoutViewBase::clear_cellviews ()
finish_cellviews_changed ();
if (m_title.empty ()) {
emit_title_changed ();
}
update_title ();
}
const CellView &
@@ -2597,9 +2611,7 @@ LayoutViewBase::set_layout (const lay::CellView &cv, unsigned int cvindex)
// the layouts are released as far as possible. This is important for reload () for example.
update_content_for_cv (cvindex);
if (m_title.empty ()) {
emit_title_changed ();
}
update_title ();
}
void
@@ -3781,21 +3793,25 @@ LayoutViewBase::timer ()
emit_dirty_changed ();
}
if (m_prop_changed) {
do_prop_changed ();
m_prop_changed = false;
}
if (is_activated ()) {
tl::Clock current_time = tl::Clock::current ();
if ((current_time - m_last_checked).seconds () > animation_interval) {
m_last_checked = current_time;
if (m_animated) {
set_view_ops ();
do_set_phase (int (m_phase));
if (m_prop_changed) {
do_prop_changed ();
m_prop_changed = false;
}
tl::Clock current_time = tl::Clock::current ();
if ((current_time - m_last_checked).seconds () > animation_interval) {
m_last_checked = current_time;
if (m_animated) {
++m_phase;
set_view_ops ();
do_set_phase (int (m_phase));
if (m_animated) {
++m_phase;
}
}
}
}
}
@@ -4871,9 +4887,7 @@ LayoutViewBase::cellview_changed (unsigned int index)
cellview_changed_event (index);
if (m_title.empty ()) {
emit_title_changed ();
}
update_title ();
}
const lay::CellView &
@@ -4966,10 +4980,8 @@ LayoutViewBase::enable_active_cellview_changed_event (bool enable, bool silent)
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 ();
}
// Because the title reflects the active cell, emit a title changed event
update_title ();
}
@@ -4992,10 +5004,8 @@ LayoutViewBase::active_cellview_changed (int index)
active_cellview_changed_event ();
active_cellview_changed_with_index_event (index);
// Because the title reflects the active one, emit a title changed event
if (title_string ().empty ()) {
emit_title_changed ();
}
// Because the title reflects the active cell, emit a title changed event
update_title ();
} else {
m_active_cellview_changed_events.insert (index);
@@ -5941,14 +5951,11 @@ LayoutViewBase::update_content_for_cv (int /*cellview_index*/)
void
LayoutViewBase::rename_cellview (const std::string &name, int cellview_index)
{
if (cellview_index >= 0 && cellview_index < int (m_cellviews.size ())) {
if ((*cellview_iter (cellview_index))->name () != name) {
(*cellview_iter (cellview_index))->rename (name);
update_content_for_cv (cellview_index);
if (m_title.empty ()) {
emit_title_changed ();
}
}
if (cellview_index >= 0 && cellview_index < int (m_cellviews.size ()) &&
(*cellview_iter (cellview_index))->name () != name) {
(*cellview_iter (cellview_index))->rename (name);
update_content_for_cv (cellview_index);
update_title ();
}
}
+5 -2
View File
@@ -2614,7 +2614,7 @@ public:
/**
* @brief Gets the window title of the view
*/
std::string title () const;
const std::string &title () const;
/**
* @brief Sets the window title to an explicit string
@@ -2837,7 +2837,7 @@ private:
void signal_bboxes_changed ();
void signal_prop_ids_changed ();
void signal_layer_properties_changed ();
void signal_cell_name_changed ();
void signal_cell_name_changed (unsigned int cv_index);
void signal_annotations_changed ();
void signal_plugin_enabled_changed ();
void signal_apply_technology (lay::LayoutHandle *layout_handle);
@@ -2854,6 +2854,7 @@ private:
lay::AnnotationShapes m_annotation_shapes;
std::vector <std::set <cell_index_type> > m_hidden_cells;
std::string m_title;
std::string m_current_title;
tl::vector <rdb::Database *> m_rdbs;
tl::vector <db::LayoutToNetlist *> m_l2ndbs;
std::string m_def_lyp_file;
@@ -3007,6 +3008,8 @@ private:
void init_layer_properties (LayerProperties &props, const LayerPropertiesList &lp_list) const;
void merge_dither_pattern (lay::LayerPropertiesList &props);
void update_title ();
protected:
/**
* @brief Constructor for calling from a LayoutView