mirror of https://github.com/KLayout/klayout.git
Fixed a flaw: PCellDeclarationHelper documentation was not visible for Python
This commit is contained in:
parent
d35e21be29
commit
aa6f49fc1c
|
|
@ -933,7 +933,7 @@ gsi::EnumIn<db::CompoundRegionOperationNode, db::RegionBBoxFilter::parameter_typ
|
|||
gsi::enum_const ("BoxAverageDim", db::RegionBBoxFilter::BoxAverageDim,
|
||||
"@brief Measures the average of width and height of the bounding box\n"
|
||||
),
|
||||
"@brief This class represents the parameter type enum used in \\CompoundRegionOperationNode#new_bbox_filter\n"
|
||||
"@brief This class represents the parameter type enum used in CompoundRegionOperationNode#new_bbox_filter\n"
|
||||
"\n"
|
||||
"This enum has been introduced in version 0.27."
|
||||
);
|
||||
|
|
@ -948,7 +948,7 @@ gsi::EnumIn<db::CompoundRegionOperationNode, db::RegionRatioFilter::parameter_ty
|
|||
gsi::enum_const ("RelativeHeight", db::RegionRatioFilter::RelativeHeight,
|
||||
"@brief Measures the relative height (height / width)\n"
|
||||
),
|
||||
"@brief This class represents the parameter type enum used in \\CompoundRegionOperationNode#new_ratio_filter\n"
|
||||
"@brief This class represents the parameter type enum used in CompoundRegionOperationNode#new_ratio_filter\n"
|
||||
"\n"
|
||||
"This enum has been introduced in version 0.27."
|
||||
);
|
||||
|
|
|
|||
|
|
@ -513,7 +513,7 @@ static db::Text dtext_to_text (const db::DText *t, double dbu)
|
|||
}
|
||||
|
||||
Class<db::DText> decl_DText ("db", "DText",
|
||||
constructor ("new", &dtext_from_itext, gsi::arg ("Text"),
|
||||
constructor ("new", &dtext_from_itext, gsi::arg ("text"),
|
||||
"@brief Creates a floating-point coordinate text from an integer coordinate text\n"
|
||||
"\n"
|
||||
"This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'."
|
||||
|
|
|
|||
|
|
@ -558,6 +558,16 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Identifies the interpreter running the class
|
||||
*
|
||||
* The category is a disambiguator for external class (i.e. Python and Ruby versions).
|
||||
*/
|
||||
virtual std::string interpreter_name () const
|
||||
{
|
||||
return std::string ();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Post-construction initialization
|
||||
*
|
||||
|
|
|
|||
|
|
@ -316,6 +316,12 @@ static std::string make_qualified_name (const gsi::ClassBase *cls)
|
|||
|
||||
}
|
||||
|
||||
if (! cls->interpreter_name ().empty ()) {
|
||||
qname += "(";
|
||||
qname += cls->interpreter_name ();
|
||||
qname += ")";
|
||||
}
|
||||
|
||||
return qname;
|
||||
}
|
||||
|
||||
|
|
@ -925,49 +931,22 @@ GSIHelpProvider::produce_class_doc (const std::string &cls) const
|
|||
|
||||
const gsi::ClassBase *cls_obj = 0;
|
||||
|
||||
std::vector<std::string> comp = tl::split (cls, "::");
|
||||
if (comp.empty ()) {
|
||||
return "Invalid class name: " + cls;
|
||||
}
|
||||
|
||||
std::vector<std::string> cp = comp;
|
||||
|
||||
for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_classes (); c != gsi::ClassBase::end_classes (); ++c) {
|
||||
if (c->name () == cp.front ()) {
|
||||
cls_obj = &*c;
|
||||
cp.erase (cp.begin ());
|
||||
auto cl = gsi::ClassBase::classes_in_definition_order ();
|
||||
for (auto c = cl.begin (); c != cl.end (); ++c) {
|
||||
if (make_qualified_name (*c) == cls) {
|
||||
cls_obj = *c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! cls_obj) {
|
||||
return "Unknown class: " + cls;
|
||||
}
|
||||
|
||||
while (! cp.empty ()) {
|
||||
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl
|
||||
<< "<!DOCTYPE language SYSTEM \"klayout_doc.dtd\">" << std::endl
|
||||
<< "<doc><title>Error</title><p><tt>Unknown class: " << escape_xml (cls) << "</tt></p></doc>"
|
||||
<< std::endl;
|
||||
|
||||
const gsi::ClassBase *pc = cls_obj;
|
||||
|
||||
cls_obj = 0;
|
||||
while (pc && !cls_obj) {
|
||||
|
||||
for (tl::weak_collection<gsi::ClassBase>::const_iterator sc = pc->begin_child_classes (); sc != pc->end_child_classes (); ++sc) {
|
||||
if (sc->name () == cp.front ()) {
|
||||
cls_obj = sc.operator-> ();
|
||||
cp.erase (cp.begin ());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Try the base classes too - since we might have skipped some of the classes in the
|
||||
// inheritance hierarchy, the child may be in a base class.
|
||||
pc = pc->base ();
|
||||
|
||||
}
|
||||
|
||||
if (! cls_obj) {
|
||||
return "Unknown class: " + cls;
|
||||
}
|
||||
return os.str ();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -896,17 +896,17 @@ class ExternalClass
|
|||
: public gsi::ClassBase
|
||||
{
|
||||
public:
|
||||
ExternalClass (const std::string &module, const std::string &name, const std::string &category, const gsi::ClassBase *base, const std::string &doc, const gsi::Methods &mm)
|
||||
: gsi::ClassBase (doc, mm), m_category (category)
|
||||
ExternalClass (const std::string &module, const std::string &name, const std::string &interpreter_name, const gsi::ClassBase *base, const std::string &doc, const gsi::Methods &mm)
|
||||
: gsi::ClassBase (doc, mm), m_interpreter_name (interpreter_name)
|
||||
{
|
||||
set_module (module);
|
||||
set_name (name);
|
||||
set_base (base);
|
||||
}
|
||||
|
||||
const std::string &category () const
|
||||
virtual std::string interpreter_name () const
|
||||
{
|
||||
return m_category;
|
||||
return m_interpreter_name;
|
||||
}
|
||||
|
||||
virtual bool consolidate () const
|
||||
|
|
@ -927,7 +927,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
std::string m_category;
|
||||
std::string m_interpreter_name;
|
||||
};
|
||||
|
||||
void Macro::install_doc () const
|
||||
|
|
@ -976,8 +976,8 @@ void Macro::install_doc () const
|
|||
|
||||
for (gsi::ClassBase::class_iterator c = gsi::ClassBase::begin_classes (); c != gsi::ClassBase::end_classes (); ++c) {
|
||||
if (c->name () == cls_name) {
|
||||
const ExternalClass *ec = dynamic_cast<const ExternalClass *> (&*c);
|
||||
if (!ec || ec->category () == category ()) {
|
||||
const ExternalClass *ec = dynamic_cast<const ExternalClass *> (c.operator-> ());
|
||||
if (!ec || ec->interpreter_name () == interpreter_name ()) {
|
||||
cls = const_cast <gsi::ClassBase *> (&*c);
|
||||
}
|
||||
}
|
||||
|
|
@ -1000,7 +1000,7 @@ void Macro::install_doc () const
|
|||
if (! cls) {
|
||||
// create a new class declaration
|
||||
static tl::stable_vector<ExternalClass> ext_classes;
|
||||
ExternalClass *ext_cls = new ExternalClass (module, cls_name, category (), super_cls, doc, gsi::Methods ());
|
||||
ExternalClass *ext_cls = new ExternalClass (module, cls_name, interpreter_name (), super_cls, doc, gsi::Methods ());
|
||||
ext_classes.push_back (ext_cls);
|
||||
cls = ext_cls;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue