mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-22 05:57:41 +02:00
WIP: working on further consolidation of non-Qt case
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "libForceLink.h"
|
||||
#include "rdbForceLink.h"
|
||||
#include "lymMacro.h"
|
||||
#include "lymMacroCollection.h"
|
||||
|
||||
struct RunnerData
|
||||
{
|
||||
@@ -83,7 +84,13 @@ BD_PUBLIC int strmrun (int argc, char *argv[])
|
||||
python.define_variable (v->first, v->second);
|
||||
}
|
||||
|
||||
// @@@ ... add Python and Ruby built-in macro collections, autorun-early and autorun ...
|
||||
// install the built-in macros so we can run DRC and LVS scripts
|
||||
lym::MacroCollection &lym_root = lym::MacroCollection::root ();
|
||||
lym_root.add_folder (tl::to_string (tr ("Built-In")), ":/built-in-macros", "macros", true);
|
||||
lym_root.add_folder (tl::to_string (tr ("Built-In")), ":/built-in-pymacros", "pymacros", true);
|
||||
|
||||
lym_root.autorun_early ();
|
||||
lym_root.autorun ();
|
||||
|
||||
std::string script = tl::absolute_file_path (data.script);
|
||||
|
||||
|
||||
+1
-1
@@ -392,7 +392,7 @@ HEADERS = \
|
||||
dbShapeCollection.h \
|
||||
dbShapeCollectionUtils.h
|
||||
|
||||
!equals(HAVE_QT, "0") {
|
||||
!equals(HAVE_QT, "0") || !equals(HAVE_PYTHON, "0") {
|
||||
|
||||
RESOURCES = \
|
||||
dbResources.qrc \
|
||||
|
||||
+1
-10
@@ -147,20 +147,11 @@ TextGenerator::text_as_region (const std::string &t, double target_dbu, double m
|
||||
return region;
|
||||
}
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
void
|
||||
TextGenerator::load_from_resource (const std::string &name)
|
||||
{
|
||||
QResource res (tl::to_qstring (name));
|
||||
if (res.size () == 0) {
|
||||
throw tl::Exception (tl::to_string (tr ("Unable to load font resource from ")) + name);
|
||||
}
|
||||
|
||||
QByteArray data = qUncompress (QByteArray ((const char *) res.data (), int (res.size ())));
|
||||
|
||||
load_from_data (data.constData (), data.size (), tl::to_string (QFileInfo (tl::to_qstring (name)).baseName ()), name);
|
||||
load_from_file (name);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
TextGenerator::load_from_data (const char *data, size_t ndata, const std::string &name, const std::string &description)
|
||||
|
||||
@@ -76,12 +76,10 @@ public:
|
||||
*/
|
||||
TextGenerator ();
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
/**
|
||||
* @brief Loads the font from the given resource
|
||||
*/
|
||||
void load_from_resource (const std::string &name);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Loads from the given binary data
|
||||
|
||||
@@ -65,12 +65,11 @@ static std::vector<const db::TextGenerator *> generators ()
|
||||
}
|
||||
|
||||
Class<db::TextGenerator> decl_TextGenerator ("db", "TextGenerator",
|
||||
#if defined(HAVE_QT)
|
||||
method ("load_from_resource", &db::TextGenerator::load_from_resource, arg ("resource_path"),
|
||||
"@brief Loads the given resource data (as layout data) into the generator\n"
|
||||
"The resource path has to start with a colon, i.e. ':/my/resource.gds'. "
|
||||
"See the description of the class how the layout data is read."
|
||||
) +
|
||||
#endif
|
||||
method ("load_from_file", &db::TextGenerator::load_from_file, arg ("path"),
|
||||
"@brief Loads the given file into the generator\n"
|
||||
"See the description of the class how the layout data is read."
|
||||
|
||||
@@ -3265,6 +3265,15 @@ CODE
|
||||
self.data.is_a?(RBA::EdgePairs)
|
||||
end
|
||||
|
||||
# %DRC%
|
||||
# @name texts?
|
||||
# @brief Returns true, if the layer is a text collection
|
||||
# @synopsis layer.texts?
|
||||
|
||||
def texts?
|
||||
self.data.is_a?(RBA::Texts)
|
||||
end
|
||||
|
||||
# %DRC%
|
||||
# @name is_deep?
|
||||
# @brief Returns true, if the layer is a deep (hierarchical) layer
|
||||
|
||||
@@ -96,56 +96,6 @@ Class<lay::LayoutView> decl_LayoutView (decl_LayoutViewBase, "lay", "LayoutView"
|
||||
"This object controls these aspects of the view and controls the appearance of the data. "
|
||||
);
|
||||
|
||||
static lay::CellViewRef get_active_cellview_ref ()
|
||||
{
|
||||
lay::LayoutView *view = 0; // @@@ lay::LayoutView::current ();
|
||||
if (! view) {
|
||||
return lay::CellViewRef ();
|
||||
}
|
||||
if (view->active_cellview_index () >= 0) {
|
||||
return view->active_cellview_ref ();
|
||||
} else {
|
||||
return lay::CellViewRef ();
|
||||
}
|
||||
}
|
||||
|
||||
static lay::LayoutView *get_view (lay::CellViewRef *cv)
|
||||
{
|
||||
return cv->view ()->ui ();
|
||||
}
|
||||
|
||||
static ClassExt<lay::CellViewRef> extdecl_CellView (
|
||||
method ("active", &get_active_cellview_ref,
|
||||
"@brief Gets the active CellView\n"
|
||||
"The active CellView is the one that is selected in the current layout view. This method is "
|
||||
"equivalent to\n"
|
||||
"@code\n"
|
||||
"RBA::LayoutView::current.active_cellview\n"
|
||||
"@/code\n"
|
||||
"If no CellView is active, this method returns nil.\n"
|
||||
"\n"
|
||||
"This method has been introduced in version 0.23."
|
||||
) +
|
||||
method_ext ("view", &get_view,
|
||||
"@brief Gets the view the cellview resides in\n"
|
||||
"This reference will be nil if the cellview is not a valid one.\n"
|
||||
"This method has been added in version 0.25.\n"
|
||||
)
|
||||
);
|
||||
|
||||
static lay::LayoutView *get_view_from_lp (lay::LayerPropertiesNode *node)
|
||||
{
|
||||
return node->view ()->ui ();
|
||||
}
|
||||
|
||||
static ClassExt<lay::LayerPropertiesNode> extdecl_LayerPropertiesNode (
|
||||
method_ext ("view", &get_view_from_lp,
|
||||
"@brief Gets the view this node lives in\n"
|
||||
"\n"
|
||||
"This reference can be nil if the node is a orphan node that lives outside a view."
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -171,56 +171,6 @@ Class<lay::LayoutView> decl_LayoutView (decl_LayoutViewBase, "lay", "LayoutView"
|
||||
"This object controls these aspects of the view and controls the appearance of the data. "
|
||||
);
|
||||
|
||||
static lay::CellViewRef get_active_cellview_ref ()
|
||||
{
|
||||
lay::LayoutView *view = lay::LayoutView::current ();
|
||||
if (! view) {
|
||||
return lay::CellViewRef ();
|
||||
}
|
||||
if (view->active_cellview_index () >= 0) {
|
||||
return view->active_cellview_ref ();
|
||||
} else {
|
||||
return lay::CellViewRef ();
|
||||
}
|
||||
}
|
||||
|
||||
static lay::LayoutView *get_view (lay::CellViewRef *cv)
|
||||
{
|
||||
return cv->view ()->ui ();
|
||||
}
|
||||
|
||||
static ClassExt<lay::CellViewRef> extdecl_CellView (
|
||||
method ("active", &get_active_cellview_ref,
|
||||
"@brief Gets the active CellView\n"
|
||||
"The active CellView is the one that is selected in the current layout view. This method is "
|
||||
"equivalent to\n"
|
||||
"@code\n"
|
||||
"RBA::LayoutView::current.active_cellview\n"
|
||||
"@/code\n"
|
||||
"If no CellView is active, this method returns nil.\n"
|
||||
"\n"
|
||||
"This method has been introduced in version 0.23."
|
||||
) +
|
||||
method_ext ("view", &get_view,
|
||||
"@brief Gets the view the cellview resides in\n"
|
||||
"This reference will be nil if the cellview is not a valid one.\n"
|
||||
"This method has been added in version 0.25.\n"
|
||||
)
|
||||
);
|
||||
|
||||
static lay::LayoutView *get_view_from_lp (lay::LayerPropertiesNode *node)
|
||||
{
|
||||
return node->view ()->ui ();
|
||||
}
|
||||
|
||||
static ClassExt<lay::LayerPropertiesNode> extdecl_LayerPropertiesNode (
|
||||
method_ext ("view", &get_view_from_lp,
|
||||
"@brief Gets the view this node lives in\n"
|
||||
"\n"
|
||||
"This reference can be nil if the node is a orphan node that lives outside a view."
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,7 @@ RESOURCES = \
|
||||
SOURCES = \
|
||||
layGridNet.cc \
|
||||
layviewForceLink.cc \
|
||||
gsiDeclLayAdditional.cc \
|
||||
|
||||
HEADERS = \
|
||||
layGridNet.h \
|
||||
|
||||
+6
-4
@@ -17,8 +17,10 @@ win32 {
|
||||
QMAKE_POST_LINK += $(COPY) $(DESTDIR)$(TARGET) $$DESTDIR_UT/$${TARGET}.ut
|
||||
}
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QT += testlib
|
||||
} else {
|
||||
CONFIG += qtestlib
|
||||
!equals(HAVE_QT, "0") {
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QT += testlib
|
||||
} else {
|
||||
CONFIG += qtestlib
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ DEPENDPATH += $$RBA_INC $$TL_INC $$DB_INC $$GSI_INC
|
||||
|
||||
LIBS += -L$$DESTDIR_UT -lklayout_rba -lklayout_tl -lklayout_db -lklayout_gsi
|
||||
|
||||
!equals(HAVE_QT, "0") {
|
||||
!equals(HAVE_QT, "0") || !equals(HAVE_PYTHON, "0") {
|
||||
RESOURCES = \
|
||||
unit_tests.qrc
|
||||
rba_unit_tests.qrc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user