mirror of https://github.com/KLayout/klayout.git
Merge branch 'master' of github.com:KLayout/klayout
This commit is contained in:
commit
b81cc99bee
|
|
@ -45,24 +45,6 @@ namespace ant
|
||||||
|
|
||||||
static PluginDeclaration *sp_instance = 0;
|
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 ()
|
static std::vector<ant::Template> make_standard_templates ()
|
||||||
{
|
{
|
||||||
std::vector<ant::Template> templates;
|
std::vector<ant::Template> templates;
|
||||||
|
|
@ -92,6 +74,24 @@ static std::vector<ant::Template> make_standard_templates ()
|
||||||
return 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
|
void
|
||||||
PluginDeclaration::get_options (std::vector < std::pair<std::string, std::string> > &options) const
|
PluginDeclaration::get_options (std::vector < std::pair<std::string, std::string> > &options) const
|
||||||
{
|
{
|
||||||
|
|
@ -281,25 +281,24 @@ PluginDeclaration::update_current_template ()
|
||||||
return;
|
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) {
|
||||||
std::vector<std::string> menu_entries = mp->menu ()->group ("ruler_mode_group");
|
lay::Action *action = mp->menu ()->action (*m);
|
||||||
for (std::vector<std::string>::const_iterator m = menu_entries.begin (); m != menu_entries.end (); ++m) {
|
if (m_current_template >= 0 && m_current_template < int (m_templates.size ())) {
|
||||||
lay::Action *action = mp->menu ()->action (*m);
|
|
||||||
action->set_title (m_templates [m_current_template].title ());
|
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 ();
|
if (m_templates.size () > 1) {
|
||||||
int index = 0;
|
tl::weak_collection<lay::ConfigureAction>::iterator it = m_actions.begin ();
|
||||||
for (std::vector<Template>::const_iterator tt = m_templates.begin (); tt != m_templates.end () && it != m_actions.end (); ++tt, ++it, ++index) {
|
int index = 0;
|
||||||
if (it.operator -> ()) {
|
for (std::vector<Template>::const_iterator tt = m_templates.begin (); tt != m_templates.end () && it != m_actions.end (); ++tt, ++it, ++index) {
|
||||||
it->set_checked (index == m_current_template);
|
if (it.operator -> ()) {
|
||||||
}
|
it->set_checked (index == m_current_template);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_current_template_updated = false;
|
m_current_template_updated = false;
|
||||||
|
|
@ -313,15 +312,13 @@ PluginDeclaration::update_menu ()
|
||||||
return;
|
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");
|
||||||
m_current_template = 0;
|
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 ())) {
|
||||||
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);
|
|
||||||
action->set_title (m_templates [m_current_template].title ());
|
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_tech_name = d.m_tech_name;
|
||||||
|
|
||||||
|
m_prop_id = d.m_prop_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
this can be a web server or a folder on
|
this can be a web server or a folder on
|
||||||
a file server. KLayout talks WebDAV, so the web server needs to offer WebDAV
|
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
|
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).
|
need to specify the protocol in the package URL (see below).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,10 @@ static unsigned int show_layout1 (lay::LayoutViewBase *view, db::Layout *layout,
|
||||||
{
|
{
|
||||||
// the layout gets held by the LayoutHandle object
|
// the layout gets held by the LayoutHandle object
|
||||||
layout->keep ();
|
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);
|
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
|
// the layout gets held by the LayoutHandle object
|
||||||
layout->keep ();
|
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);
|
handle->set_tech_name (tech);
|
||||||
return view->add_layout (handle, add_cellview);
|
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
|
// the layout gets held by the LayoutHandle object
|
||||||
layout->keep ();
|
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);
|
handle->set_tech_name (tech);
|
||||||
return view->add_layout (handle, add_cellview, initialize_layers);
|
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
|
void
|
||||||
LayoutHandle::get_names (std::vector <std::string> &names)
|
LayoutHandle::get_names (std::vector <std::string> &names)
|
||||||
{
|
{
|
||||||
|
|
@ -484,6 +495,10 @@ LayoutHandleRef::operator= (const LayoutHandleRef &r)
|
||||||
void
|
void
|
||||||
LayoutHandleRef::set (LayoutHandle *h)
|
LayoutHandleRef::set (LayoutHandle *h)
|
||||||
{
|
{
|
||||||
|
if (mp_handle == h) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (mp_handle) {
|
if (mp_handle) {
|
||||||
mp_handle->remove_ref ();
|
mp_handle->remove_ref ();
|
||||||
mp_handle = 0;
|
mp_handle = 0;
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,14 @@ public:
|
||||||
*/
|
*/
|
||||||
static LayoutHandle *find (const std::string &name);
|
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
|
* @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 ()->setSortIndicatorShown (true);
|
||||||
markers_list->header ()->setMinimumSectionSize (24);
|
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);
|
list_shapes_cb->setChecked (m_list_shapes);
|
||||||
|
|
||||||
connect (markers_list, SIGNAL (doubleClicked (const QModelIndex &)), this, SLOT (marker_double_clicked (const QModelIndex &)));
|
connect (markers_list, SIGNAL (doubleClicked (const QModelIndex &)), this, SLOT (marker_double_clicked (const QModelIndex &)));
|
||||||
|
|
|
||||||
|
|
@ -2082,6 +2082,24 @@ class DBLayoutTests1_TestClass < TestBase
|
||||||
|
|
||||||
end
|
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
|
# Iterating while flatten
|
||||||
def test_issue200
|
def test_issue200
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -550,6 +550,26 @@ class LAYLayoutView_TestClass < TestBase
|
||||||
|
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
load("test_epilogue.rb")
|
load("test_epilogue.rb")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue