Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip2 #1529

Merged
merged 15 commits into from
Nov 13, 2023
Merged

Wip2 #1529

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scripts/mkqtdecl6/mkqtdecl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ drop_class "QAbstractConcatenable"
drop_class "QAbstractFileEngineHandler"
drop_class "QAbstractFileEngineIterator"
drop_class "QAbstractFileEngine" # read requires char *
drop_class "QAdoptSharedDataTag" # not available on Qt 6.6
drop_class "QAlgorithmsPrivate"
drop_class "QApplicationPermission"
drop_class "QArgument"
Expand Down Expand Up @@ -1304,6 +1305,11 @@ include "QSql", [ "<QtSql>" ]
drop_class "QSqlDriverCreator" # is a template
drop_class "QSqlDriverPlugin" # not required ?

drop_method "QSqlResult", /QSqlResult::boundValues/ # returns a reference, different types on different Qt versions

rename "QSqlDriver", /QSqlDriver::notification\(const\s+QString\s*\&\s*\w*\s*\)/, "notification" # disambiguator
rename "QSqlDriver", /QSqlDriver::notification\(const\s+QString\s*\&\s*\w*\s*,/, "notification_withData" # disambiguator

# --------------------------------------------------------------
# QtMultimedia

Expand Down Expand Up @@ -1594,9 +1600,6 @@ rename "QVideoDeviceSelectorControl", /QVideoDeviceSelectorControl::selectedDevi

rename "QNetworkSession", /QNetworkSession::error\(QNetworkSession::/, "error_sig" # disambiguator

rename "QSqlDriver", /QSqlDriver::notification\(const\s+QString\s*\&\s*\w*\s*\)/, "notification" # disambiguator
rename "QSqlDriver", /QSqlDriver::notification\(const\s+QString\s*\&\s*\w*\s*,/, "notification_withData" # disambiguator

# --------------------------------------------------------------
# QtUiTools

Expand Down
2 changes: 1 addition & 1 deletion src/buddies/src/bd/bdReaderOptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ GenericReaderOptions::add_options (tl::CommandLineOptions &cmd)
"* 1: produce LEF geometry always and ignore FOREIGN\n"
"* 2: Never produce LEF geometry and assume FOREIGN always\n"
"\n"
"In case of FOREIGN macros in mode 1 or always in mode 2, the '--" + m_long_prefix + "lefdef-lef-layouts' option is available to specify "
"In case of FOREIGN macros in mode 0 or always in mode 2, the '--" + m_long_prefix + "lefdef-lef-layouts' option is available to specify "
"external layout files for providing the LEF macro layouts.\n"
)
<< tl::arg (group +
Expand Down
8 changes: 2 additions & 6 deletions src/db/db/db.pro
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,8 @@ HEADERS = \
dbShapeCollection.h \
dbShapeCollectionUtils.h

!equals(HAVE_QT, "0") {

RESOURCES = \
dbResources.qrc \

}
RESOURCES = \
dbResources.qrc \

INCLUDEPATH += $$TL_INC $$GSI_INC
DEPENDPATH += $$TL_INC $$GSI_INC
Expand Down
4 changes: 2 additions & 2 deletions src/db/db/dbLayoutLayers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ unsigned int
LayoutLayers::error_layer () const
{
if (m_error_layer < 0) {
// create the waste layer (since that layer is cached we can do
// create the error layer (since that layer is cached we can do
// this in a "const" fashion.
db::LayoutLayers *self = const_cast<db::LayoutLayers *> (this);
self->m_error_layer = (int) self->insert_special_layer (db::LayerProperties ("WASTE"));
self->m_error_layer = (int) self->insert_special_layer (db::LayerProperties ("ERROR"));
}

return (unsigned int) m_error_layer;
Expand Down
6 changes: 6 additions & 0 deletions src/db/db/gsiDeclDbLayout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,12 @@ Class<db::Layout> decl_Layout ("db", "Layout",
"\n"
"This method has been added in version 0.22.\n"
) +
gsi::method ("error_layer", &db::Layout::error_layer,
"@brief Returns the index of the error layer\n"
"The error layer is used to place error texts on it, for example when a PCell evaluation fails.\n"
"\n"
"This method has been added in version 0.23.13.\n"
) +
gsi::method ("insert_special_layer", (unsigned int (db::Layout::*) (const db::LayerProperties &)) &db::Layout::insert_special_layer, gsi::arg ("props"),
"@brief Inserts a new special layer with the given properties\n"
"\n"
Expand Down
13 changes: 13 additions & 0 deletions src/db/unit_tests/dbLayoutTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -795,3 +795,16 @@ TEST(8_MetaInfo)
EXPECT_EQ (ly.has_context_info (ci), false);
EXPECT_EQ (ly.meta_info (ci, "a").value.to_string (), "nil");
}

TEST(9_ErrorLayer)
{
db::Manager m;
db::Layout l (&m);

EXPECT_EQ (l.is_valid_layer (0), false);
EXPECT_EQ (l.guiding_shape_layer (), (unsigned int) 0);
EXPECT_EQ (l.is_valid_layer (1), false);
EXPECT_EQ (l.error_layer (), (unsigned int) 1);
EXPECT_EQ (l.is_special_layer (1), true);
EXPECT_EQ (int (l.layers ()), 2);
}
3 changes: 1 addition & 2 deletions src/doc/doc/manual/drc_runsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@ output(w, "width violations")</pre>
<a href="/about/drc_ref_layer.xml#|">| (or)</a>,
<a href="/about/drc_ref_layer.xml#-">- (not)</a>,
<a href="/about/drc_ref_layer.xml#^">^ (xor)</a>,
<a href="/about/drc_ref_layer.xml#+">+ (xor)</a>,
<a href="/about/drc_ref_layer.xml#join">join</a>
<a href="/about/drc_ref_layer.xml#+">+ (join)</a>,
</li>
<li>Sizing:<br/>
<a href="/about/drc_ref_layer.xml#size">size</a>,
Expand Down
1 change: 0 additions & 1 deletion src/gsiqt/qt6/QtCore/QtCore.pri
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ SOURCES += \
$$PWD/gsiDeclQAbstractNativeEventFilter.cc \
$$PWD/gsiDeclQAbstractProxyModel.cc \
$$PWD/gsiDeclQAbstractTableModel.cc \
$$PWD/gsiDeclQAdoptSharedDataTag.cc \
$$PWD/gsiDeclQAnimationDriver.cc \
$$PWD/gsiDeclQAnimationGroup.cc \
$$PWD/gsiDeclQAnyStringView.cc \
Expand Down
4 changes: 0 additions & 4 deletions src/gsiqt/qt6/QtCore/gsiQtExternals.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ class QAbstractTableModel;

namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QAbstractTableModel> &qtdecl_QAbstractTableModel (); }

struct QAdoptSharedDataTag;

namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QAdoptSharedDataTag> &qtdecl_QAdoptSharedDataTag (); }

class QAnimationDriver;

namespace gsi { GSI_QTCORE_PUBLIC gsi::Class<QAnimationDriver> &qtdecl_QAnimationDriver (); }
Expand Down
20 changes: 0 additions & 20 deletions src/gsiqt/qt6/QtSql/gsiDeclQSqlResult.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ class QSqlResult_Adaptor : public QSqlResult, public qt_gsi::QtObjectBase
return QSqlResult::boundValueName(pos);
}

// [expose] QList<QVariant> &QSqlResult::boundValues()
QList<QVariant> & fp_QSqlResult_boundValues_c0 () const {
return QSqlResult::boundValues();
}

// [expose] void QSqlResult::clear()
void fp_QSqlResult_clear_0 () {
QSqlResult::clear();
Expand Down Expand Up @@ -873,20 +868,6 @@ static void _call_fp_boundValueName_c767 (const qt_gsi::GenericMethod * /*decl*/
}


// exposed QList<QVariant> &QSqlResult::boundValues()

static void _init_fp_boundValues_c0 (qt_gsi::GenericMethod *decl)
{
decl->set_return<QList<QVariant> & > ();
}

static void _call_fp_boundValues_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
{
__SUPPRESS_UNUSED_WARNING(args);
ret.write<QList<QVariant> & > ((QList<QVariant> &)((QSqlResult_Adaptor *)cls)->fp_QSqlResult_boundValues_c0 ());
}


// exposed void QSqlResult::clear()

static void _init_fp_clear_0 (qt_gsi::GenericMethod *decl)
Expand Down Expand Up @@ -1662,7 +1643,6 @@ static gsi::Methods methods_QSqlResult_Adaptor () {
methods += new qt_gsi::GenericMethod ("*boundValue", "@brief Method QVariant QSqlResult::boundValue(int pos)\nThis method is protected and can only be called from inside a derived class.", true, &_init_fp_boundValue_c767, &_call_fp_boundValue_c767);
methods += new qt_gsi::GenericMethod ("*boundValueCount", "@brief Method int QSqlResult::boundValueCount()\nThis method is protected and can only be called from inside a derived class.", true, &_init_fp_boundValueCount_c0, &_call_fp_boundValueCount_c0);
methods += new qt_gsi::GenericMethod ("*boundValueName", "@brief Method QString QSqlResult::boundValueName(int pos)\nThis method is protected and can only be called from inside a derived class.", true, &_init_fp_boundValueName_c767, &_call_fp_boundValueName_c767);
methods += new qt_gsi::GenericMethod ("*boundValues", "@brief Method QList<QVariant> &QSqlResult::boundValues()\nThis method is protected and can only be called from inside a derived class.", true, &_init_fp_boundValues_c0, &_call_fp_boundValues_c0);
methods += new qt_gsi::GenericMethod ("*clear", "@brief Method void QSqlResult::clear()\nThis method is protected and can only be called from inside a derived class.", false, &_init_fp_clear_0, &_call_fp_clear_0);
methods += new qt_gsi::GenericMethod ("*data", "@brief Virtual method QVariant QSqlResult::data(int i)\nThis method can be reimplemented in a derived class.", false, &_init_cbs_data_767_0, &_call_cbs_data_767_0);
methods += new qt_gsi::GenericMethod ("*data", "@hide", false, &_init_cbs_data_767_0, &_call_cbs_data_767_0, &_set_callback_cbs_data_767_0);
Expand Down
76 changes: 75 additions & 1 deletion src/klayout_main/klayout_main/klayout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ FORCE_LINK_GSI_QTUITOOLS
#include <QTextCodec>

#include <iostream>
#include <fstream>
#include <memory>
#include <cstdlib>

int klayout_main (int &argc, char **argv);
Expand Down Expand Up @@ -202,6 +204,74 @@ void custom_message_handler(QtMsgType type, const char *msg)

static int klayout_main_cont (int &argc, char **argv);

namespace {

class LogFileWriter
: public tl::Channel
{
public:
static std::unique_ptr<std::ofstream> m_os;

LogFileWriter (int min_verbosity, const std::string &prefix)
: m_min_verbosity (min_verbosity), m_prefix (prefix), m_new_line (true)
{ }

static bool open (const std::string &path)
{
m_os.reset (new std::ofstream (path));
return m_os->good ();
}

void puts (const char *s)
{
if (m_os && tl::verbosity () >= m_min_verbosity) {
m_os->write (s, strlen (s));
}
}

void endl ()
{
puts ("\n");
m_new_line = true;
}

void end ()
{
if (m_os && tl::verbosity () >= m_min_verbosity) {
m_os->flush ();
}
}

void begin ()
{
if (m_new_line) {
puts (m_prefix.c_str ());
m_new_line = false;
}
}

void yield () { }

private:
int m_min_verbosity;
std::string m_prefix;
bool m_new_line;
};

std::unique_ptr<std::ofstream> LogFileWriter::m_os;

}

static void set_log_file (const std::string &log_file)
{
if (LogFileWriter::open (log_file)) {
tl::info.add (new LogFileWriter (0, std::string ()), true);
tl::log.add (new LogFileWriter (10, std::string ()), true);
tl::warn.add (new LogFileWriter (0, std::string ("Warning: ")), true);
tl::error.add (new LogFileWriter (0, std::string ("ERROR: ")), true);
}
}

/**
* @brief The basic entry point
* Note that by definition, klayout_main receives arguments in UTF-8
Expand Down Expand Up @@ -229,7 +299,7 @@ klayout_main (int &argc, char **argv)
about_text += prg_about_text;
lay::Version::set_about_text (about_text.c_str ());

// Capture the shortcut command line arguments and the verbosity settings
// Capture the shortcut command line arguments, log file and the verbosity settings
// for early errors and warnings

for (int i = 1; i < argc; ++i) {
Expand All @@ -244,6 +314,10 @@ klayout_main (int &argc, char **argv)
tl::info << lay::ApplicationBase::usage () << tl::noendl;
return 0;

} else if (argv [i] == std::string ("-k") && (i + 1) < argc) {

set_log_file (argv [++i]);

} else if (argv [i] == std::string ("-d") && (i + 1) < argc) {

int v = 0;
Expand Down
6 changes: 6 additions & 0 deletions src/lay/lay/layApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ ApplicationBase::parse_cmd (int &argc, char **argv)
}
tl::verbosity (v);

} else if (a == "-k" && (i + 1) < argc) {

// ignored (handled earlier)
++i;

} else if (a == "-l" && (i + 1) < argc) {

m_layer_props_file = args [++i];
Expand Down Expand Up @@ -1055,6 +1060,7 @@ ApplicationBase::usage ()
r += tl::to_string (QObject::tr (" -i Disable undo buffering (less memory requirements)")) + "\n";
r += tl::to_string (QObject::tr (" -ni Enable undo buffering (default, overrides previous -i option)")) + "\n";
r += tl::to_string (QObject::tr (" -j <path> Add the given path to the macro project paths")) + "\n";
r += tl::to_string (QObject::tr (" -k <log file> Write log to the given file plus stdout/stderr")) + "\n";
r += tl::to_string (QObject::tr (" -l <lyp file> Use layer properties file")) + "\n";
r += tl::to_string (QObject::tr (" -lx With -l: add other layers as well")) + "\n";
r += tl::to_string (QObject::tr (" -lf With -l: use the lyp file as it is (no expansion to multiple layouts)")) + "\n";
Expand Down
3 changes: 2 additions & 1 deletion src/lay/lay/layMainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4333,7 +4333,8 @@ class MainWindowPluginDeclaration
menu_entries.push_back (lay::menu_item ("cm_reset_window_state", "reset_window_state", at, tl::to_string (QObject::tr ("Restore Window")))),
menu_entries.push_back (lay::separator ("selection_group", at));
menu_entries.push_back (lay::config_menu_item ("transient_selection", at, tl::to_string (QObject::tr ("Highlight Object Under Mouse")), cfg_sel_transient_mode, "?"));
menu_entries.push_back (lay::config_menu_item ("mouse_tracking", at, tl::to_string (QObject::tr ("Mouse tracking")), cfg_tracking_cursor_enabled, "?"));
menu_entries.push_back (lay::config_menu_item ("mouse_tracking", at, tl::to_string (QObject::tr ("Mouse Tracking")), cfg_tracking_cursor_enabled, "?"));
menu_entries.push_back (lay::config_menu_item ("crosshair_cursor", at, tl::to_string (QObject::tr ("Crosshair Cursor")), cfg_crosshair_cursor_enabled, "?"));

at = "help_menu.end";
menu_entries.push_back (lay::menu_item ("cm_show_all_tips", "show_all_tips", at, tl::to_string (QObject::tr ("Show All Tips"))));
Expand Down
7 changes: 7 additions & 0 deletions src/laybasic/laybasic/layLayoutViewBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,10 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
return true;
}

if (mp_tracker && mp_tracker->configure (name, value)) {
return true;
}

if (name == cfg_default_lyp_file) {

m_def_lyp_file = value;
Expand Down Expand Up @@ -3693,6 +3697,9 @@ LayoutViewBase::refresh ()

// Issue a "tick" to execute all other pending tasks
timer ();

// Update the view ops as this is not always guaranteed (issue #1512)
set_view_ops ();
}

void
Expand Down
4 changes: 4 additions & 0 deletions src/laybasic/laybasic/layLayoutViewConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ class LayoutViewBasicConfigDeclaration
options.push_back (std::pair<std::string, std::string> (cfg_sel_line_width, "1"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_vertex_size, "3"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_dither_pattern, "1"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_line_style, "0"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_halo, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_transient_mode, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_inside_pcells_mode, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_tracking_cursor_enabled, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_tracking_cursor_color, cc.to_string (tl::Color ())));
options.push_back (std::pair<std::string, std::string> (cfg_crosshair_cursor_color, cc.to_string (tl::Color ())));
options.push_back (std::pair<std::string, std::string> (cfg_crosshair_cursor_line_style, "0"));
options.push_back (std::pair<std::string, std::string> (cfg_crosshair_cursor_enabled, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_background_color, cc.to_string (tl::Color ())));
options.push_back (std::pair<std::string, std::string> (cfg_ctx_color, cc.to_string (tl::Color ())));
options.push_back (std::pair<std::string, std::string> (cfg_ctx_dimming, "50"));
Expand Down
39 changes: 23 additions & 16 deletions src/laybasic/laybasic/layLineStyles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,31 +175,38 @@ LineStyleInfo::is_bit_set (unsigned int n) const

#if defined(HAVE_QT)
QBitmap
LineStyleInfo::get_bitmap (int width, int height) const
LineStyleInfo::get_bitmap (int w, int h, int fw) const
{
if (height < 0) {
height = 5;
}
if (width < 0) {
width = 34;
}

unsigned int height = h < 0 ? 5 : (unsigned int) h;
unsigned int width = w < 0 ? 34 : (unsigned int) w;
unsigned int frame_width = fw <= 0 ? 1 : (unsigned int) fw;
unsigned int stride = (width + 7) / 8;

unsigned char *data = new unsigned char[stride * height];
memset (data, 0x00, size_t (stride * height));

for (unsigned int i = 0; i < (unsigned int)(height - 2); ++i) {
if (is_bit_set (i)) {
data [(height - 2 - i) * stride] |= 0x01;
data [(height - 2 - i) * stride + (width - 1) / 8] |= (1 << ((width - 1) % 8));
unsigned int hv = height - 2 * frame_width;

for (unsigned int i = 0; i < hv; ++i) {
if (is_bit_set (i / frame_width + 1)) {
unsigned int y = height - 1 - frame_width - i;
for (unsigned int x = 0; x < frame_width; ++x) {
data [y * stride + x / 8] |= (1 << (x % 8));
}
for (unsigned int x = width - frame_width; x < width; ++x) {
data [y * stride + x / 8] |= (1 << (x % 8));
}
}
}

for (unsigned int i = 1; i < (unsigned int)(width - 1); ++i) {
if (is_bit_set (i)) {
data [stride + i / 8] |= (1 << (i % 8));
data [(height - 2) * stride + i / 8] |= (1 << (i % 8));
for (unsigned int i = 0; i < width; ++i) {
if (is_bit_set (i / frame_width)) {
for (unsigned int y = 0; y < frame_width; ++y) {
data [y * stride + i / 8] |= (1 << (i % 8));
}
for (unsigned int y = height - frame_width; y < height; ++y) {
data [y * stride + i / 8] |= (1 << (i % 8));
}
}
}

Expand Down
Loading