From 4bdfcd45493ac55d32965c553059300b98199ea1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 18 Oct 2023 20:55:18 +0200 Subject: [PATCH 01/14] Fixed issue #1511 (typo) --- src/doc/doc/manual/drc_runsets.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/doc/doc/manual/drc_runsets.xml b/src/doc/doc/manual/drc_runsets.xml index 7642c4c16..4e3274524 100644 --- a/src/doc/doc/manual/drc_runsets.xml +++ b/src/doc/doc/manual/drc_runsets.xml @@ -444,8 +444,7 @@ output(w, "width violations") | (or), - (not), ^ (xor), - + (xor), - join + + (join),
  • Sizing:
    size, From 3c297a28d8029eeec6d5cd5b9e20410b0aa60830 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 18 Oct 2023 21:21:05 +0200 Subject: [PATCH 02/14] Fixed issue #1512 ('get_image' of LayoutView should also work on inactive views) --- src/laybasic/laybasic/layLayoutViewBase.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/laybasic/laybasic/layLayoutViewBase.cc b/src/laybasic/laybasic/layLayoutViewBase.cc index 9f4fa5b47..53056d630 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.cc +++ b/src/laybasic/laybasic/layLayoutViewBase.cc @@ -3693,6 +3693,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 From f8268746e32950da8d82d649aae22c5c32897799 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 19 Oct 2023 01:58:19 +0200 Subject: [PATCH 03/14] Fixed a typo --- src/buddies/src/bd/bdReaderOptions.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buddies/src/bd/bdReaderOptions.cc b/src/buddies/src/bd/bdReaderOptions.cc index 3d3b9f75e..448febe1f 100644 --- a/src/buddies/src/bd/bdReaderOptions.cc +++ b/src/buddies/src/bd/bdReaderOptions.cc @@ -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 + From 67d934194fd84a447324dc0c9f56c001e23ba9fe Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 19 Oct 2023 01:58:38 +0200 Subject: [PATCH 04/14] Added line style selection widget --- src/laybasic/laybasic/layLineStyles.cc | 39 +++-- src/laybasic/laybasic/layLineStyles.h | 3 +- src/layui/layui/layWidgets.cc | 194 +++++++++++++++++++++++++ src/layui/layui/layWidgets.h | 62 ++++++++ 4 files changed, 281 insertions(+), 17 deletions(-) diff --git a/src/laybasic/laybasic/layLineStyles.cc b/src/laybasic/laybasic/layLineStyles.cc index a4a3856f8..06667092b 100644 --- a/src/laybasic/laybasic/layLineStyles.cc +++ b/src/laybasic/laybasic/layLineStyles.cc @@ -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)); + } } } diff --git a/src/laybasic/laybasic/layLineStyles.h b/src/laybasic/laybasic/layLineStyles.h index b29dbcb6e..b2317d574 100644 --- a/src/laybasic/laybasic/layLineStyles.h +++ b/src/laybasic/laybasic/layLineStyles.h @@ -150,8 +150,9 @@ public: * * @param width The desired width (-1 for default) * @param height The desired height (-1 for default) + * @param The intended frame width in pixels */ - QBitmap get_bitmap (int width = -1, int height = -1) const; + QBitmap get_bitmap (int width = -1, int height = -1, int frame_width = 1) const; #endif /** diff --git a/src/layui/layui/layWidgets.cc b/src/layui/layui/layWidgets.cc index 2a9272412..06c6807dc 100644 --- a/src/layui/layui/layWidgets.cc +++ b/src/layui/layui/layWidgets.cc @@ -46,6 +46,7 @@ #include "tlInternational.h" #include "laySelectStippleForm.h" +#include "laySelectLineStyleForm.h" #include @@ -246,6 +247,199 @@ DitherPatternSelectionButton::update_menu () } catch (...) { } } +// ------------------------------------------------------------- +// LineStyleSelectionButton implementation + +LineStyleSelectionButton::LineStyleSelectionButton (QWidget *parent) + : QPushButton (parent), mp_view (0), m_line_style (-1) +{ + setMenu (new QMenu (this)); + update_pattern (); + connect (menu (), SIGNAL (aboutToShow ()), this, SLOT (menu_about_to_show ())); +} + +LineStyleSelectionButton::~LineStyleSelectionButton () +{ + // .. nothing yet .. +} + +void +LineStyleSelectionButton::set_view (lay::LayoutViewBase *view) +{ + if (view != mp_view) { + mp_view = view; + update_menu (); + } +} + +void +LineStyleSelectionButton::set_line_style (int ls) +{ + if (ls != m_line_style) { + m_line_style = ls; + update_pattern (); + } +} + +int +LineStyleSelectionButton::line_style () const +{ + return m_line_style; +} + +void +LineStyleSelectionButton::menu_selected () +{ + QAction *action = dynamic_cast (sender ()); + if (action) { + + m_line_style = action->data ().toInt (); + update_pattern (); + emit (line_style_changed (m_line_style)); + + } +} + +void +LineStyleSelectionButton::browse_selected () +{ + if (mp_view) { + + SelectLineStyleForm styles_form (0, mp_view->line_styles (), true); + styles_form.set_selected (m_line_style); + + if (styles_form.exec ()) { + + m_line_style = styles_form.selected (); + update_pattern (); + emit (line_style_changed (m_line_style)); + + } + + } else { + + // Use the default (non-custom) pattern if no view is set. + lay::LineStyles default_pattern; + + SelectLineStyleForm styles_form (0, default_pattern, true); + styles_form.set_selected (m_line_style); + + if (styles_form.exec ()) { + + m_line_style = styles_form.selected (); + update_pattern (); + emit (line_style_changed (m_line_style)); + + } + + } +} + +void +LineStyleSelectionButton::update_pattern () +{ + QPushButton::setText (QString::fromUtf8 (" ")); + + QString text = QString::fromUtf8 ("XXXXXXX"); + QFontMetrics fm (font (), this); + QRect rt (fm.boundingRect (text)); // dummy text to be compliant with the other color button + + QPushButton::setIconSize (QSize (rt.width (), rt.height ())); + +#if QT_VERSION >= 0x050000 + double dpr = devicePixelRatio (); +#else + double dpr = 1.0; +#endif + + if (m_line_style < 0) { + + QPixmap pixmap (rt.width () * dpr, rt.height () * dpr); +#if QT_VERSION >= 0x050000 + pixmap.setDevicePixelRatio (dpr); +#endif + pixmap.fill (QColor (0, 0, 0, 0)); + + QPainter pxpainter (&pixmap); + pxpainter.setFont (font ()); + QColor text_color = palette ().color (QPalette::Active, QPalette::Text); + pxpainter.setPen (QPen (text_color)); + + QRectF r (0, 0, rt.width () - pxpainter.pen ().widthF (), rt.height () - pxpainter.pen ().widthF ()); + pxpainter.drawText (r, Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextSingleLine, QObject::tr ("None")); + + QPushButton::setIcon (QIcon (pixmap)); + + } else { + + const lay::LineStyleInfo *dp_info; + if (mp_view) { + dp_info = & mp_view->line_styles ().style ((unsigned int) m_line_style); + } else { + static lay::LineStyles default_pattern; + dp_info = & default_pattern.style ((unsigned int) m_line_style); + } + + QPushButton::setIcon (dp_info->get_bitmap (rt.width () * dpr, rt.height () * dpr, dpr)); + + } +} + +void +LineStyleSelectionButton::menu_about_to_show () +{ + update_menu (); +} + +void +LineStyleSelectionButton::update_menu () +{ + menu ()->clear (); + menu ()->addAction (QObject::tr ("None"), this, SLOT (menu_selected ()))->setData (-1); + menu ()->addAction (QObject::tr ("Choose ..."), this, SLOT (browse_selected ())); + menu ()->addSeparator (); + + // from_string might throw an exception ... + try { + + lay::LineStyles patterns; + + std::string s; + if (lay::Dispatcher::instance ()) { + lay::Dispatcher::instance ()->config_get (cfg_line_style_palette, s); + } + lay::LineStylePalette palette = lay::LineStylePalette::default_palette (); + if (! s.empty ()) { + palette.from_string (s); + } + + // fill the list of stipple palette items + for (unsigned int i = 0; i < palette.styles (); ++i) { + + unsigned int n = palette.style_by_index (i); + if (int (n) < std::distance (patterns.begin (), patterns.end ())) { + +#if QT_VERSION > 0x050000 + double dpr = devicePixelRatio (); +#else + double dpr = 1.0; +#endif + + lay::LineStyleInfo info = patterns.begin () [n]; + + std::string name (info.name ()); + if (name.empty ()) { + name = tl::sprintf ("#%d", n); + } + + menu ()->addAction (QIcon (info.get_bitmap (16, 8)), tl::to_qstring (name), this, SLOT (menu_selected ()))->setData (n); + + } + } + + } catch (...) { } +} + // ------------------------------------------------------------- // CellViewSelectionComboBox implementation diff --git a/src/layui/layui/layWidgets.h b/src/layui/layui/layWidgets.h index adfa708b6..787d171e5 100644 --- a/src/layui/layui/layWidgets.h +++ b/src/layui/layui/layWidgets.h @@ -115,6 +115,68 @@ private: void update_menu (); }; +/** + * @brief A selection button for dither pattern + */ +class LAYUI_PUBLIC LineStyleSelectionButton + : public QPushButton +{ +Q_OBJECT + +public: + /** + * @brief Constructor + */ + LineStyleSelectionButton (QWidget *parent); + + /** + * @brief Destructor + */ + ~LineStyleSelectionButton (); + + /** + * @brief Associate with a view + * + * This method is required to select the proper dither pattern + */ + void set_view (lay::LayoutViewBase *view); + + /** + * @brief Set the line style index + */ + void set_line_style (int ls); + + /** + * @brief Get the line style index + */ + int line_style () const; + + /** + * @brief Override setText + */ + void setText (const QString &) { } + + /** + * @brief Override setPixmap + */ + void setPixmap (const QPixmap &) { } + +signals: + void line_style_changed (int); + +private slots: + void browse_selected (); + void menu_selected (); + void menu_about_to_show (); + +private: + lay::LayoutViewBase *mp_view; + int m_line_style; + + void update_pattern (); + void update_menu (); +}; + /** * @brief A library selection combo box * From 45f3216530564ffcac5b7356d8eacb89f2ad7c05 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 19 Oct 2023 02:00:31 +0200 Subject: [PATCH 05/14] Fixed issue #1510 (cross hair cursor, with options to enable from menu, color and line style can be configured) --- src/lay/lay/layMainWindow.cc | 3 +- src/laybasic/laybasic/layLayoutViewBase.cc | 4 ++ src/laybasic/laybasic/layLayoutViewConfig.cc | 4 ++ src/laybasic/laybasic/layMouseTracker.cc | 71 +++++++++++++++++++- src/laybasic/laybasic/layMouseTracker.h | 9 +++ src/laybasic/laybasic/layMove.h | 2 +- src/laybasic/laybasic/laybasicConfig.h | 3 + src/layui/layui/LayoutViewConfigPage2d.ui | 65 +++++++++++++++++- src/layui/layui/layLayoutViewConfigPages.cc | 17 ++++- 9 files changed, 171 insertions(+), 7 deletions(-) diff --git a/src/lay/lay/layMainWindow.cc b/src/lay/lay/layMainWindow.cc index 8e80edf82..52138e745 100644 --- a/src/lay/lay/layMainWindow.cc +++ b/src/lay/lay/layMainWindow.cc @@ -4333,7 +4333,8 @@ public: 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")))); diff --git a/src/laybasic/laybasic/layLayoutViewBase.cc b/src/laybasic/laybasic/layLayoutViewBase.cc index 53056d630..ff7cec227 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.cc +++ b/src/laybasic/laybasic/layLayoutViewBase.cc @@ -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; diff --git a/src/laybasic/laybasic/layLayoutViewConfig.cc b/src/laybasic/laybasic/layLayoutViewConfig.cc index a21e172e4..519458b67 100644 --- a/src/laybasic/laybasic/layLayoutViewConfig.cc +++ b/src/laybasic/laybasic/layLayoutViewConfig.cc @@ -72,11 +72,15 @@ public: options.push_back (std::pair (cfg_sel_line_width, "1")); options.push_back (std::pair (cfg_sel_vertex_size, "3")); options.push_back (std::pair (cfg_sel_dither_pattern, "1")); + options.push_back (std::pair (cfg_sel_line_style, "0")); options.push_back (std::pair (cfg_sel_halo, "true")); options.push_back (std::pair (cfg_sel_transient_mode, "true")); options.push_back (std::pair (cfg_sel_inside_pcells_mode, "false")); options.push_back (std::pair (cfg_tracking_cursor_enabled, "true")); options.push_back (std::pair (cfg_tracking_cursor_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_crosshair_cursor_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_crosshair_cursor_line_style, "0")); + options.push_back (std::pair (cfg_crosshair_cursor_enabled, "false")); options.push_back (std::pair (cfg_background_color, cc.to_string (tl::Color ()))); options.push_back (std::pair (cfg_ctx_color, cc.to_string (tl::Color ()))); options.push_back (std::pair (cfg_ctx_dimming, "50")); diff --git a/src/laybasic/laybasic/layMouseTracker.cc b/src/laybasic/laybasic/layMouseTracker.cc index 818088d8f..93b9930fb 100644 --- a/src/laybasic/laybasic/layMouseTracker.cc +++ b/src/laybasic/laybasic/layMouseTracker.cc @@ -24,20 +24,69 @@ #include "layMouseTracker.h" #include "layLayoutCanvas.h" #include "layLayoutViewBase.h" +#include "layConverters.h" +#include "laybasicConfig.h" namespace lay { MouseTracker::MouseTracker (lay::LayoutViewBase *view) - : lay::ViewService (view->canvas ()), mp_view (view) + : lay::ViewService (view->canvas ()), mp_view (view), + m_cursor_color (tl::Color ()), m_cursor_line_style (0), m_cursor_enabled (false) { ui ()->grab_mouse (this, false); } +bool +MouseTracker::leave_event (bool) +{ + mp_markers.clear (); + return false; +} + +bool +MouseTracker::configure (const std::string &name, const std::string &value) +{ + if (name == cfg_crosshair_cursor_color) { + + tl::Color color; + lay::ColorConverter ().from_string (value, color); + + // Change the color + if (lay::test_and_set (m_cursor_color, color)) { + mp_markers.clear (); + } + + } else if (name == cfg_crosshair_cursor_line_style) { + + int dp = 0; + tl::from_string (value, dp); + + // Change the vertex_size + if (lay::test_and_set (m_cursor_line_style, dp)) { + mp_markers.clear (); + } + + } else if (name == cfg_crosshair_cursor_enabled) { + + bool f = m_cursor_enabled; + tl::from_string (value, f); + if (f != m_cursor_enabled) { + m_cursor_enabled = f; + mp_markers.clear (); + } + + } + + return false; // not taken +} + bool MouseTracker::mouse_move_event (const db::DPoint &p, unsigned int /*buttons*/, bool prio) { - if (prio) { + // NOTE: by catching events with low prio, the tracking position was already set by consumers + // with high prio + if (! prio) { // NOTE: because the tracker grabs first and grabbers are registered first gets served last, the // tracker will receive the event after all other mouse grabbers have been served and had their @@ -50,6 +99,24 @@ MouseTracker::mouse_move_event (const db::DPoint &p, unsigned int /*buttons*/, b mp_view->current_pos (tp.x (), tp.y ()); + mp_markers.clear (); + + if (m_cursor_enabled) { + + double max_coord = 1e30; // big enough I guess + + mp_markers.push_back (new lay::DMarker (mp_view)); + mp_markers.back ()->set_line_style (m_cursor_line_style); + mp_markers.back ()->set_color (m_cursor_color); + mp_markers.back ()->set (db::DEdge (db::DPoint (tp.x (), -max_coord), db::DPoint (tp.x (), max_coord))); + + mp_markers.push_back (new lay::DMarker (mp_view)); + mp_markers.back ()->set_line_style (m_cursor_line_style); + mp_markers.back ()->set_color (m_cursor_color); + mp_markers.back ()->set (db::DEdge (db::DPoint (-max_coord, tp.y ()), db::DPoint (max_coord, tp.y ()))); + + } + } return false; diff --git a/src/laybasic/laybasic/layMouseTracker.h b/src/laybasic/laybasic/layMouseTracker.h index 0fe26f5a9..b2ecbb27b 100644 --- a/src/laybasic/laybasic/layMouseTracker.h +++ b/src/laybasic/laybasic/layMouseTracker.h @@ -25,6 +25,8 @@ #define HDR_layMouseTracker #include "layViewObject.h" +#include "layMarker.h" +#include "tlObject.h" class QMouseEvent; @@ -38,10 +40,17 @@ class MouseTracker { public: MouseTracker (lay::LayoutViewBase *view); + virtual bool mouse_move_event (const db::DPoint &p, unsigned int buttons, bool prio); + bool leave_event (bool prio); + bool configure (const std::string &name, const std::string &value); private: lay::LayoutViewBase *mp_view; + tl::shared_collection mp_markers; + tl::Color m_cursor_color; + int m_cursor_line_style; + bool m_cursor_enabled; }; } diff --git a/src/laybasic/laybasic/layMove.h b/src/laybasic/laybasic/layMove.h index a51884d6c..bed2a18cb 100644 --- a/src/laybasic/laybasic/layMove.h +++ b/src/laybasic/laybasic/layMove.h @@ -41,7 +41,7 @@ public: MoveService (lay::LayoutViewBase *view); ~MoveService (); - virtual bool configure (const std::string &name, const std::string &value); + bool configure (const std::string &name, const std::string &value); bool begin_move (db::Transaction *transaction = 0, bool transient_selection = false); private: diff --git a/src/laybasic/laybasic/laybasicConfig.h b/src/laybasic/laybasic/laybasicConfig.h index 5731b82be..ba148ee60 100644 --- a/src/laybasic/laybasic/laybasicConfig.h +++ b/src/laybasic/laybasic/laybasicConfig.h @@ -77,6 +77,9 @@ static const std::string cfg_sel_inside_pcells_mode ("sel-inside-pcells-mode"); static const std::string cfg_tracking_cursor_color ("tracking-cursor-color"); static const std::string cfg_tracking_cursor_enabled ("tracking-cursor-enabled"); +static const std::string cfg_crosshair_cursor_color ("crosshair-cursor-color"); +static const std::string cfg_crosshair_cursor_line_style ("crosshair-cursor-line-style"); +static const std::string cfg_crosshair_cursor_enabled ("crosshair-cursor-enabled"); static const std::string cfg_markers_visible ("markers-visible"); diff --git a/src/layui/layui/LayoutViewConfigPage2d.ui b/src/layui/layui/LayoutViewConfigPage2d.ui index 0a9fc17f5..ad779f091 100644 --- a/src/layui/layui/LayoutViewConfigPage2d.ui +++ b/src/layui/layui/LayoutViewConfigPage2d.ui @@ -6,8 +6,8 @@ 0 0 - 608 - 318 + 696 + 420 @@ -120,6 +120,62 @@ + + + + Crosshair cursor + + + true + + + + + + Cursor color + + + + + + + Qt::Horizontal + + + + 508 + 31 + + + + + + + + The color in which the rulers are drawn + + + + + + + + + + Line style + + + + + + + + + + + + + @@ -142,6 +198,11 @@ QPushButton
    layWidgets.h
    + + lay::LineStyleSelectionButton + QPushButton +
    layWidgets.h
    +
    color_pb diff --git a/src/layui/layui/layLayoutViewConfigPages.cc b/src/layui/layui/layLayoutViewConfigPages.cc index d8e2ccb4e..ac7070ca5 100644 --- a/src/layui/layui/layLayoutViewConfigPages.cc +++ b/src/layui/layui/layLayoutViewConfigPages.cc @@ -424,9 +424,21 @@ LayoutViewConfigPage2d::setup (lay::Dispatcher *root) root->config_get (cfg_tracking_cursor_color, color, lay::ColorConverter ()); mp_ui->color_pb->set_color (color); - bool enabled = 0; + bool enabled = false; root->config_get (cfg_tracking_cursor_enabled, enabled); mp_ui->tracking_cb->setChecked (enabled); + + color = QColor (); + root->config_get (cfg_crosshair_cursor_color, color, lay::ColorConverter ()); + mp_ui->color_chc->set_color (color); + + int line_style = 0; + root->config_get (cfg_crosshair_cursor_line_style, line_style); + mp_ui->line_style_chc->set_line_style (line_style); + + enabled = false; + root->config_get (cfg_crosshair_cursor_enabled, enabled); + mp_ui->crosshair_cursor_cb->setChecked (enabled); } void @@ -435,6 +447,9 @@ LayoutViewConfigPage2d::commit (lay::Dispatcher *root) lay::ColorConverter cc; root->config_set (cfg_tracking_cursor_color, mp_ui->color_pb->get_color (), cc); root->config_set (cfg_tracking_cursor_enabled, mp_ui->tracking_cb->isChecked ()); + root->config_set (cfg_crosshair_cursor_color, mp_ui->color_chc->get_color (), cc); + root->config_set (cfg_crosshair_cursor_line_style, mp_ui->line_style_chc->line_style ()); + root->config_set (cfg_crosshair_cursor_enabled, mp_ui->crosshair_cursor_cb->isChecked ()); } // ------------------------------------------------------------ From f76b6eda4545e848d1131332cabdfe2c0121e037 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 19 Oct 2023 21:02:48 +0200 Subject: [PATCH 06/14] Added option -k for copying the log to a file --- src/klayout_main/klayout_main/klayout.cc | 76 +++++++++++++++++++++++- src/lay/lay/layApplication.cc | 6 ++ 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/klayout_main/klayout_main/klayout.cc b/src/klayout_main/klayout_main/klayout.cc index f813f404b..f8ea6924d 100644 --- a/src/klayout_main/klayout_main/klayout.cc +++ b/src/klayout_main/klayout_main/klayout.cc @@ -87,6 +87,8 @@ FORCE_LINK_GSI_QTUITOOLS #include #include +#include +#include #include int klayout_main (int &argc, char **argv); @@ -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 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 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 @@ -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) { @@ -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; diff --git a/src/lay/lay/layApplication.cc b/src/lay/lay/layApplication.cc index e7c54f768..12db519c5 100644 --- a/src/lay/lay/layApplication.cc +++ b/src/lay/lay/layApplication.cc @@ -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]; @@ -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 Add the given path to the macro project paths")) + "\n"; + r += tl::to_string (QObject::tr (" -k Write log to the given file plus stdout/stderr")) + "\n"; r += tl::to_string (QObject::tr (" -l 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"; From 58f609ab0fcf5ab1271adfc4ab5e919eb6d99299 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 19 Oct 2023 22:02:22 +0200 Subject: [PATCH 07/14] LEF/DEF: Removing VIA size tagging of upper and lower metals of vias in map file --- src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc index 0c74b0633..d68858e5a 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc @@ -227,12 +227,12 @@ RuleBasedViaGenerator::create_cell (LEFDEFReaderState &reader, Layout &layout, d std::set dl; - dl = reader.open_layer (layout, m_bottom_layer, ViaGeometry, mask_bottom, via_box.enlarged (m_be)); + dl = reader.open_layer (layout, m_bottom_layer, ViaGeometry, mask_bottom); for (std::set::const_iterator l = dl.begin (); l != dl.end (); ++l) { cell.shapes (*l).insert (db::Polygon (via_box.enlarged (m_be).moved (m_bo))); } - dl = reader.open_layer (layout, m_top_layer, ViaGeometry, mask_top, via_box.enlarged (m_te)); + dl = reader.open_layer (layout, m_top_layer, ViaGeometry, mask_top); for (std::set::const_iterator l = dl.begin (); l != dl.end (); ++l) { cell.shapes (*l).insert (db::Polygon (via_box.enlarged (m_te).moved (m_to))); } From d6728afd5c2c8ef5b7058d609ed9237e662b2de8 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 19 Oct 2023 22:06:35 +0200 Subject: [PATCH 08/14] LEF/DEF - Removing via size from warning message --- src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc index d68858e5a..71de91d1b 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc @@ -1322,9 +1322,12 @@ LEFDEFReaderState::open_layer (db::Layout &layout, const std::string &n, LayerPu if (mask > 0) { tl::warn << tl::to_string (tr (" Mask ")) << mask << tl::noendl; } +// not printing via size - too confusing? +#if 0 if (via_size != db::DVector ()) { tl::warn << tl::to_string (tr (" Via size ")) << via_size.to_string () << tl::noendl; } +#endif tl::warn << tl::to_string (tr (" - layer is ignored")); } From 969ceb84bb0c8ee4b0e3f9118b70886a97631ce8 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 11 Nov 2023 23:09:05 +0100 Subject: [PATCH 09/14] FEATURE: Added Layout#error_layer. --- src/db/db/dbLayoutLayers.cc | 4 ++-- src/db/db/gsiDeclDbLayout.cc | 6 ++++++ src/db/unit_tests/dbLayoutTests.cc | 13 +++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/db/db/dbLayoutLayers.cc b/src/db/db/dbLayoutLayers.cc index 1b069e04c..9be8cf84c 100644 --- a/src/db/db/dbLayoutLayers.cc +++ b/src/db/db/dbLayoutLayers.cc @@ -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 (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; diff --git a/src/db/db/gsiDeclDbLayout.cc b/src/db/db/gsiDeclDbLayout.cc index 550e8b5de..2dd2defbf 100644 --- a/src/db/db/gsiDeclDbLayout.cc +++ b/src/db/db/gsiDeclDbLayout.cc @@ -1670,6 +1670,12 @@ Class 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" diff --git a/src/db/unit_tests/dbLayoutTests.cc b/src/db/unit_tests/dbLayoutTests.cc index 3b438bce5..d21a08ef5 100644 --- a/src/db/unit_tests/dbLayoutTests.cc +++ b/src/db/unit_tests/dbLayoutTests.cc @@ -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); +} From 1b1e2f573c9d0fd77a40c7e1415c04b9fd71496d Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 12 Nov 2023 00:29:00 +0100 Subject: [PATCH 10/14] Compatibility with Qt 6.6 --- scripts/mkqtdecl6/mkqtdecl.conf | 9 ++++++--- src/gsiqt/qt6/QtCore/QtCore.pri | 1 - src/gsiqt/qt6/QtCore/gsiQtExternals.h | 4 ---- src/gsiqt/qt6/QtSql/gsiDeclQSqlResult.cc | 20 -------------------- 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/scripts/mkqtdecl6/mkqtdecl.conf b/scripts/mkqtdecl6/mkqtdecl.conf index bd15c83e9..d780f9490 100644 --- a/scripts/mkqtdecl6/mkqtdecl.conf +++ b/scripts/mkqtdecl6/mkqtdecl.conf @@ -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" @@ -1304,6 +1305,11 @@ include "QSql", [ "" ] 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 @@ -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 diff --git a/src/gsiqt/qt6/QtCore/QtCore.pri b/src/gsiqt/qt6/QtCore/QtCore.pri index 8437c5e51..6f70a8192 100644 --- a/src/gsiqt/qt6/QtCore/QtCore.pri +++ b/src/gsiqt/qt6/QtCore/QtCore.pri @@ -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 \ diff --git a/src/gsiqt/qt6/QtCore/gsiQtExternals.h b/src/gsiqt/qt6/QtCore/gsiQtExternals.h index 41be0e1c6..5855ed7a2 100644 --- a/src/gsiqt/qt6/QtCore/gsiQtExternals.h +++ b/src/gsiqt/qt6/QtCore/gsiQtExternals.h @@ -61,10 +61,6 @@ class QAbstractTableModel; namespace gsi { GSI_QTCORE_PUBLIC gsi::Class &qtdecl_QAbstractTableModel (); } -struct QAdoptSharedDataTag; - -namespace gsi { GSI_QTCORE_PUBLIC gsi::Class &qtdecl_QAdoptSharedDataTag (); } - class QAnimationDriver; namespace gsi { GSI_QTCORE_PUBLIC gsi::Class &qtdecl_QAnimationDriver (); } diff --git a/src/gsiqt/qt6/QtSql/gsiDeclQSqlResult.cc b/src/gsiqt/qt6/QtSql/gsiDeclQSqlResult.cc index f1b16ca51..af246e403 100644 --- a/src/gsiqt/qt6/QtSql/gsiDeclQSqlResult.cc +++ b/src/gsiqt/qt6/QtSql/gsiDeclQSqlResult.cc @@ -122,11 +122,6 @@ public: return QSqlResult::boundValueName(pos); } - // [expose] QList &QSqlResult::boundValues() - QList & fp_QSqlResult_boundValues_c0 () const { - return QSqlResult::boundValues(); - } - // [expose] void QSqlResult::clear() void fp_QSqlResult_clear_0 () { QSqlResult::clear(); @@ -873,20 +868,6 @@ static void _call_fp_boundValueName_c767 (const qt_gsi::GenericMethod * /*decl*/ } -// exposed QList &QSqlResult::boundValues() - -static void _init_fp_boundValues_c0 (qt_gsi::GenericMethod *decl) -{ - decl->set_return & > (); -} - -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 &)((QSqlResult_Adaptor *)cls)->fp_QSqlResult_boundValues_c0 ()); -} - - // exposed void QSqlResult::clear() static void _init_fp_clear_0 (qt_gsi::GenericMethod *decl) @@ -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 &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); From 6d55f6bc7d08b0ed7e9390d4b1f9fa04c40018fb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 12 Nov 2023 22:01:45 +0100 Subject: [PATCH 11/14] Trying to improve curl implementation by providing a seek implementation --- src/tl/tl/tlHttpStreamCurl.cc | 73 +++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/src/tl/tl/tlHttpStreamCurl.cc b/src/tl/tl/tlHttpStreamCurl.cc index e5a90b2ad..b59df6585 100644 --- a/src/tl/tl/tlHttpStreamCurl.cc +++ b/src/tl/tl/tlHttpStreamCurl.cc @@ -258,6 +258,7 @@ private: public: ChunkedBuffer () + : m_current_chunk (m_chunks.end ()) { // .. nothing yet .. } @@ -265,6 +266,7 @@ public: void clear () { m_chunks.clear (); + m_current_chunk = m_chunks.end (); } void push (const char *data, size_t bytes) @@ -272,6 +274,9 @@ public: if (bytes > 0) { m_chunks.push_back (ChunkInfo ()); m_chunks.back ().set (data, bytes); + if (m_current_chunk == m_chunks.end ()) { + --m_current_chunk; + } } } @@ -279,13 +284,13 @@ public: { char *start = data; - while (bytes > 0 && ! m_chunks.empty ()) { + while (bytes > 0 && m_current_chunk != m_chunks.end ()) { - size_t n = m_chunks.front ().fetch (data, bytes); + size_t n = m_current_chunk->fetch (data, bytes); data += n; bytes -= n; - if (m_chunks.front ().empty ()) { - m_chunks.pop_front (); + if (m_current_chunk->empty ()) { + ++m_current_chunk; } } @@ -322,7 +327,38 @@ public: return true; } + size_t pos () const + { + size_t p = 0; + for (std::list::const_iterator c = m_chunks.begin (); c != m_current_chunk; ++c) { + p += c->size; + } + if (m_current_chunk != m_chunks.end ()) { + p += (m_current_chunk->pos - m_current_chunk->start); + } + return p; + } + + void seek (size_t pos) + { + for (std::list::iterator c = m_chunks.begin (); c != m_chunks.end (); ++c) { + c->pos = c->start; + } + + m_current_chunk = m_chunks.end (); + for (std::list::iterator c = m_chunks.begin (); c != m_chunks.end (); ++c) { + if (pos < c->size) { + m_current_chunk = c; + c->pos = c->start + pos; + break; + } else { + pos -= c->size; + } + } + } + std::list m_chunks; + std::list::iterator m_current_chunk; }; // --------------------------------------------------------------- @@ -452,12 +488,14 @@ private: friend class CurlNetworkManager; friend size_t read_func (char *buffer, size_t size, size_t nitems, void *userdata); + friend size_t seek_func (void *userdata, curl_off_t offset, int origin); friend size_t write_func (char *ptr, size_t size, size_t nmemb, void *userdata); friend size_t write_header_func (char *ptr, size_t size, size_t nmemb, void *userdata); void add_read_data (const char *data, size_t n); void add_header_data (const char *data, size_t n); size_t fetch_data (char *buffer, size_t nbytes); + int seek (curl_off_t offset, int origin); void finished (int status); void init (); @@ -687,6 +725,7 @@ InputHttpStream::timeout () const // CurlConnection implementation size_t read_func (char *buffer, size_t size, size_t nitems, void *userdata); +size_t seek_func (void *userdata, curl_off_t offset, int origin); size_t write_func (char *ptr, size_t size, size_t nmemb, void *userdata); size_t write_header_func (char *ptr, size_t size, size_t nmemb, void *userdata); @@ -801,6 +840,18 @@ size_t CurlConnection::fetch_data (char *buffer, size_t nbytes) return m_data.fetch (buffer, nbytes); } +int CurlConnection::seek (curl_off_t offset, int origin) +{ + if (origin == SEEK_CUR) { + m_data.seek (size_t (curl_off_t (m_data.pos ()) + offset)); + } else if (origin == SEEK_END) { + m_data.seek (size_t (curl_off_t (m_data.size ()) + offset)); + } else { + m_data.seek (size_t (offset)); + } + return CURL_SEEKFUNC_OK; +} + void CurlConnection::send () { tl_assert (mp_handle != 0); @@ -837,6 +888,8 @@ void CurlConnection::send () curl_easy_setopt (mp_handle, CURLOPT_READFUNCTION, &read_func); curl_easy_setopt (mp_handle, CURLOPT_READDATA, (void *) this); + curl_easy_setopt (mp_handle, CURLOPT_SEEKFUNCTION, &seek_func); + curl_easy_setopt (mp_handle, CURLOPT_SEEKDATA, (void *) this); curl_easy_setopt (mp_handle, CURLOPT_WRITEFUNCTION, &write_func); curl_easy_setopt (mp_handle, CURLOPT_WRITEDATA, (void *) this); curl_easy_setopt (mp_handle, CURLOPT_HEADERFUNCTION, &write_header_func); @@ -998,20 +1051,26 @@ void CurlConnection::finished (int status) finished_event (); } -size_t read_func(char *buffer, size_t size, size_t nitems, void *userdata) +size_t read_func (char *buffer, size_t size, size_t nitems, void *userdata) { CurlConnection *connection = (CurlConnection *) userdata; return connection->fetch_data (buffer, size * nitems); } -size_t write_func(char *buffer, size_t size, size_t nitems, void *userdata) +size_t seek_func (void *userdata, curl_off_t offset, int origin) +{ + CurlConnection *connection = (CurlConnection *) userdata; + return connection->seek (offset, origin); +} + +size_t write_func (char *buffer, size_t size, size_t nitems, void *userdata) { CurlConnection *connection = (CurlConnection *) userdata; connection->add_read_data (buffer, size * nitems); return size * nitems; } -size_t write_header_func(char *buffer, size_t size, size_t nitems, void *userdata) +size_t write_header_func (char *buffer, size_t size, size_t nitems, void *userdata) { CurlConnection *connection = (CurlConnection *) userdata; connection->add_header_data (buffer, size * nitems); From 139723ed5d350707f4320e3237a2dcde17bc32e8 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 12 Nov 2023 22:25:53 +0100 Subject: [PATCH 12/14] Enabling db resource for the '-without-qt' case, specifically the default font --- src/db/db/db.pro | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/db/db/db.pro b/src/db/db/db.pro index a4ac89867..37d7f0cbf 100644 --- a/src/db/db/db.pro +++ b/src/db/db/db.pro @@ -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 From 80241ae7c2691d356050679784354b310f81daf3 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 12 Nov 2023 22:31:39 +0100 Subject: [PATCH 13/14] Compatibility with libgit <0.28.0 --- src/tl/tl/tlGit.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tl/tl/tlGit.cc b/src/tl/tl/tlGit.cc index 5573b199d..47a3f4674 100644 --- a/src/tl/tl/tlGit.cc +++ b/src/tl/tl/tlGit.cc @@ -260,8 +260,13 @@ credentials_cb (git_cred ** /*out*/, const char * /*url*/, const char * /*userna #endif { // no credentials aquired +#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) git_error_set_str (GIT_ERROR_NONE, "anonymous access is supported only, but server requests credentials"); +#else + git_error_set_str (GITERR_NONE, "anonymous access is supported only, but server requests credentials"); +#endif return GIT_EUSER; + } void From 284182cf3a890a2b471a115711934f3c6014cfc7 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 12 Nov 2023 22:57:40 +0100 Subject: [PATCH 14/14] Compatibility with libgit <0.28.0 --- src/tl/tl/tlGit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tl/tl/tlGit.cc b/src/tl/tl/tlGit.cc index 47a3f4674..851e8fcd1 100644 --- a/src/tl/tl/tlGit.cc +++ b/src/tl/tl/tlGit.cc @@ -263,7 +263,7 @@ credentials_cb (git_cred ** /*out*/, const char * /*url*/, const char * /*userna #if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) git_error_set_str (GIT_ERROR_NONE, "anonymous access is supported only, but server requests credentials"); #else - git_error_set_str (GITERR_NONE, "anonymous access is supported only, but server requests credentials"); + giterr_set_str (GITERR_NONE, "anonymous access is supported only, but server requests credentials"); #endif return GIT_EUSER;