mirror of https://github.com/KLayout/klayout.git
commit
cabd7aae95
|
|
@ -45,24 +45,6 @@ namespace ant
|
|||
|
||||
static PluginDeclaration *sp_instance = 0;
|
||||
|
||||
PluginDeclaration::PluginDeclaration ()
|
||||
: m_current_template (0),
|
||||
m_current_template_updated (true), m_templates_updated (true)
|
||||
{
|
||||
sp_instance = this;
|
||||
}
|
||||
|
||||
PluginDeclaration::~PluginDeclaration ()
|
||||
{
|
||||
sp_instance = 0;
|
||||
}
|
||||
|
||||
PluginDeclaration *
|
||||
PluginDeclaration::instance ()
|
||||
{
|
||||
return sp_instance;
|
||||
}
|
||||
|
||||
static std::vector<ant::Template> make_standard_templates ()
|
||||
{
|
||||
std::vector<ant::Template> templates;
|
||||
|
|
@ -92,6 +74,24 @@ static std::vector<ant::Template> make_standard_templates ()
|
|||
return templates;
|
||||
}
|
||||
|
||||
PluginDeclaration::PluginDeclaration ()
|
||||
: m_current_template (0),
|
||||
m_current_template_updated (true), m_templates_updated (true)
|
||||
{
|
||||
sp_instance = this;
|
||||
}
|
||||
|
||||
PluginDeclaration::~PluginDeclaration ()
|
||||
{
|
||||
sp_instance = 0;
|
||||
}
|
||||
|
||||
PluginDeclaration *
|
||||
PluginDeclaration::instance ()
|
||||
{
|
||||
return sp_instance;
|
||||
}
|
||||
|
||||
void
|
||||
PluginDeclaration::get_options (std::vector < std::pair<std::string, std::string> > &options) const
|
||||
{
|
||||
|
|
@ -281,25 +281,24 @@ PluginDeclaration::update_current_template ()
|
|||
return;
|
||||
}
|
||||
|
||||
if (m_current_template >= 0 && m_current_template < int (m_templates.size ())) {
|
||||
|
||||
std::vector<std::string> menu_entries = mp->menu ()->group ("ruler_mode_group");
|
||||
for (std::vector<std::string>::const_iterator m = menu_entries.begin (); m != menu_entries.end (); ++m) {
|
||||
lay::Action *action = mp->menu ()->action (*m);
|
||||
std::vector<std::string> menu_entries = mp->menu ()->group ("ruler_mode_group");
|
||||
for (std::vector<std::string>::const_iterator m = menu_entries.begin (); m != menu_entries.end (); ++m) {
|
||||
lay::Action *action = mp->menu ()->action (*m);
|
||||
if (m_current_template >= 0 && m_current_template < int (m_templates.size ())) {
|
||||
action->set_title (m_templates [m_current_template].title ());
|
||||
} else {
|
||||
action->set_title (std::string ());
|
||||
}
|
||||
|
||||
if (m_templates.size () > 1) {
|
||||
}
|
||||
|
||||
tl::weak_collection<lay::ConfigureAction>::iterator it = m_actions.begin ();
|
||||
int index = 0;
|
||||
for (std::vector<Template>::const_iterator tt = m_templates.begin (); tt != m_templates.end () && it != m_actions.end (); ++tt, ++it, ++index) {
|
||||
if (it.operator -> ()) {
|
||||
it->set_checked (index == m_current_template);
|
||||
}
|
||||
if (m_templates.size () > 1) {
|
||||
tl::weak_collection<lay::ConfigureAction>::iterator it = m_actions.begin ();
|
||||
int index = 0;
|
||||
for (std::vector<Template>::const_iterator tt = m_templates.begin (); tt != m_templates.end () && it != m_actions.end (); ++tt, ++it, ++index) {
|
||||
if (it.operator -> ()) {
|
||||
it->set_checked (index == m_current_template);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
m_current_template_updated = false;
|
||||
|
|
@ -313,15 +312,13 @@ PluginDeclaration::update_menu ()
|
|||
return;
|
||||
}
|
||||
|
||||
if (m_current_template < 0 || m_current_template >= int (m_templates.size ())) {
|
||||
m_current_template = 0;
|
||||
}
|
||||
|
||||
if (m_current_template >= 0 && m_current_template < int (m_templates.size ())) {
|
||||
std::vector<std::string> menu_entries = mp->menu ()->group ("ruler_mode_group");
|
||||
for (std::vector<std::string>::const_iterator m = menu_entries.begin (); m != menu_entries.end (); ++m) {
|
||||
lay::Action *action = mp->menu ()->action (*m);
|
||||
std::vector<std::string> menu_entries = mp->menu ()->group ("ruler_mode_group");
|
||||
for (std::vector<std::string>::const_iterator m = menu_entries.begin (); m != menu_entries.end (); ++m) {
|
||||
lay::Action *action = mp->menu ()->action (*m);
|
||||
if (m_current_template >= 0 && m_current_template < int (m_templates.size ())) {
|
||||
action->set_title (m_templates [m_current_template].title ());
|
||||
} else {
|
||||
action->set_title (std::string ());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -531,6 +531,8 @@ Layout::operator= (const Layout &d)
|
|||
|
||||
m_tech_name = d.m_tech_name;
|
||||
|
||||
m_prop_id = d.m_prop_id;
|
||||
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@
|
|||
this can be a web server or a folder on
|
||||
a file server. KLayout talks WebDAV, so the web server needs to offer WebDAV
|
||||
access. A subversion (SVN) server provides WebDAV by default, so this is a good
|
||||
choice. For the packages themselves Git or WebDAV/Subversion can be used. You
|
||||
choice. For the packages themselves, Git or WebDAV/Subversion can be used. You
|
||||
need to specify the protocol in the package URL (see below).
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -277,7 +277,10 @@ static unsigned int show_layout1 (lay::LayoutViewBase *view, db::Layout *layout,
|
|||
{
|
||||
// the layout gets held by the LayoutHandle object
|
||||
layout->keep ();
|
||||
lay::LayoutHandle *handle = new lay::LayoutHandle (layout, std::string ());
|
||||
lay::LayoutHandle *handle = lay::LayoutHandle::find_layout (layout);
|
||||
if (! handle) {
|
||||
handle = new lay::LayoutHandle (layout, std::string ());
|
||||
}
|
||||
return view->add_layout (handle, add_cellview);
|
||||
}
|
||||
|
||||
|
|
@ -285,7 +288,10 @@ static unsigned int show_layout2 (lay::LayoutViewBase *view, db::Layout *layout,
|
|||
{
|
||||
// the layout gets held by the LayoutHandle object
|
||||
layout->keep ();
|
||||
lay::LayoutHandle *handle = new lay::LayoutHandle (layout, std::string ());
|
||||
lay::LayoutHandle *handle = lay::LayoutHandle::find_layout (layout);
|
||||
if (! handle) {
|
||||
handle = new lay::LayoutHandle (layout, std::string ());
|
||||
}
|
||||
handle->set_tech_name (tech);
|
||||
return view->add_layout (handle, add_cellview);
|
||||
}
|
||||
|
|
@ -294,7 +300,10 @@ static unsigned int show_layout3 (lay::LayoutViewBase *view, db::Layout *layout,
|
|||
{
|
||||
// the layout gets held by the LayoutHandle object
|
||||
layout->keep ();
|
||||
lay::LayoutHandle *handle = new lay::LayoutHandle (layout, std::string ());
|
||||
lay::LayoutHandle *handle = lay::LayoutHandle::find_layout (layout);
|
||||
if (! handle) {
|
||||
handle = new lay::LayoutHandle (layout, std::string ());
|
||||
}
|
||||
handle->set_tech_name (tech);
|
||||
return view->add_layout (handle, add_cellview, initialize_layers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,6 +272,17 @@ LayoutHandle::find (const std::string &name)
|
|||
}
|
||||
}
|
||||
|
||||
LayoutHandle *
|
||||
LayoutHandle::find_layout (const db::Layout *layout)
|
||||
{
|
||||
for (auto h = ms_dict.begin (); h != ms_dict.end (); ++h) {
|
||||
if (h->second->mp_layout == layout) {
|
||||
return h->second;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
LayoutHandle::get_names (std::vector <std::string> &names)
|
||||
{
|
||||
|
|
@ -484,6 +495,10 @@ LayoutHandleRef::operator= (const LayoutHandleRef &r)
|
|||
void
|
||||
LayoutHandleRef::set (LayoutHandle *h)
|
||||
{
|
||||
if (mp_handle == h) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mp_handle) {
|
||||
mp_handle->remove_ref ();
|
||||
mp_handle = 0;
|
||||
|
|
|
|||
|
|
@ -144,6 +144,14 @@ public:
|
|||
*/
|
||||
static LayoutHandle *find (const std::string &name);
|
||||
|
||||
/**
|
||||
* @brief Finds a handle by layout object
|
||||
*
|
||||
* @param layout The Layout object bound to the handle
|
||||
* @return 0, if there is no layout object with this name. Otherwise a pointer to its handle
|
||||
*/
|
||||
static LayoutHandle *find_layout (const db::Layout *layout);
|
||||
|
||||
/**
|
||||
* @brief Gets the names of all registered layout objects
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1506,6 +1506,18 @@ MarkerBrowserPage::MarkerBrowserPage (QWidget * /*parent*/)
|
|||
markers_list->header ()->setSortIndicatorShown (true);
|
||||
markers_list->header ()->setMinimumSectionSize (24);
|
||||
|
||||
QAction *select_all_info_action = new QAction (this);
|
||||
select_all_info_action->setText (tr ("Select All"));
|
||||
connect (select_all_info_action, SIGNAL (triggered ()), info_text, SLOT (selectAll ()));
|
||||
|
||||
QAction *copy_info_action = new QAction (this);
|
||||
copy_info_action->setText (tr ("Copy"));
|
||||
connect (copy_info_action, SIGNAL (triggered ()), info_text, SLOT (copy ()));
|
||||
|
||||
info_text->addAction (select_all_info_action);
|
||||
info_text->addAction (copy_info_action);
|
||||
info_text->setContextMenuPolicy (Qt::ActionsContextMenu);
|
||||
|
||||
list_shapes_cb->setChecked (m_list_shapes);
|
||||
|
||||
connect (markers_list, SIGNAL (doubleClicked (const QModelIndex &)), this, SLOT (marker_double_clicked (const QModelIndex &)));
|
||||
|
|
|
|||
|
|
@ -2082,6 +2082,24 @@ class DBLayoutTests1_TestClass < TestBase
|
|||
|
||||
end
|
||||
|
||||
def test_24
|
||||
|
||||
ly = RBA::Layout::new
|
||||
ly.set_property("k1", 17)
|
||||
ly.set_property(17, "42")
|
||||
|
||||
assert_equal(17, ly.property("k1"))
|
||||
assert_equal("42", ly.property(17))
|
||||
assert_equal(nil, ly.property(42))
|
||||
|
||||
ly_dup = ly.dup
|
||||
|
||||
assert_equal(17, ly_dup.property("k1"))
|
||||
assert_equal("42", ly_dup.property(17))
|
||||
assert_equal(nil, ly_dup.property(42))
|
||||
|
||||
end
|
||||
|
||||
# Iterating while flatten
|
||||
def test_issue200
|
||||
|
||||
|
|
|
|||
|
|
@ -550,6 +550,26 @@ class LAYLayoutView_TestClass < TestBase
|
|||
|
||||
end
|
||||
|
||||
# issue-1533
|
||||
def test_8
|
||||
|
||||
if !RBA.constants.member?(:Application)
|
||||
return
|
||||
end
|
||||
|
||||
app = RBA::Application.instance
|
||||
mw = app.main_window
|
||||
mw.close_all
|
||||
mw.create_view
|
||||
|
||||
ly = RBA::Layout::new
|
||||
mw.current_view.show_layout(ly, false)
|
||||
|
||||
# was crashing
|
||||
mw.current_view.show_layout(ly, false)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
load("test_epilogue.rb")
|
||||
|
|
|
|||
Loading…
Reference in New Issue