Skip to content

Commit

Permalink
Merge pull request #1933 from KLayout/wip
Browse files Browse the repository at this point in the history
Wip
  • Loading branch information
klayoutmatthias authored Nov 30, 2024
2 parents ec21809 + 22d8709 commit 637660c
Show file tree
Hide file tree
Showing 36 changed files with 805 additions and 312 deletions.
3 changes: 0 additions & 3 deletions src/ant/ant/antService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1382,9 +1382,6 @@ dragging_what (const ant::Object *robj, const db::DBox &search_dbox, ant::Servic
bool
Service::begin_move (lay::Editable::MoveMode mode, const db::DPoint &p, lay::angle_constraint_type /*ac*/)
{
// cancel any pending move or drag operations, reset mp_active_ruler
ui ()->drag_cancel (); // KLUDGE: every service does this to the same service manager

clear_transient_selection ();

// choose move mode
Expand Down
16 changes: 15 additions & 1 deletion src/db/db/dbLayoutQuery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1938,9 +1938,11 @@ struct SelectFilterPropertyIDs
SelectFilterPropertyIDs (LayoutQuery *q)
{
data = q->register_property ("data", LQ_variant);
expressions = q->register_property ("expressions", LQ_variant);
}

unsigned int data; // data -> An array of the selected values
unsigned int expressions; // data -> An array with the expressions
};

class DB_PUBLIC SelectFilterReportingState
Expand Down Expand Up @@ -2037,7 +2039,16 @@ class DB_PUBLIC SelectFilterState
}
}

virtual void reset (FilterStateBase *previous)
void get_expressions (tl::Variant &v)
{
std::vector<tl::Variant> vd;
v = tl::Variant (vd.begin (), vd.end ());
for (std::vector<tl::Expression>::const_iterator e = m_expressions.begin (); e != m_expressions.end (); ++e) {
v.push (e->text ());
}
}

virtual void reset (FilterStateBase *previous)
{
if (m_has_sorting) {

Expand Down Expand Up @@ -2082,6 +2093,9 @@ class DB_PUBLIC SelectFilterState
if (id == m_pids.data) {
get_data (v);
return true;
} else if (id == m_pids.expressions) {
get_expressions (v);
return true;
} else if (m_in_data_eval) {
return FilterStateBase::get_property (id, v);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/db/db/dbLayoutToNetlistReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef l2n_std_format::keys<true> skeys;
typedef l2n_std_format::keys<false> lkeys;

LayoutToNetlistStandardReader::LayoutToNetlistStandardReader (tl::InputStream &stream)
: m_stream (stream), m_path (stream.absolute_path ()), m_dbu (0.0),
: m_stream (stream), m_path (stream.absolute_file_path ()), m_dbu (0.0),
m_progress (tl::to_string (tr ("Reading L2N database")), 1000)
{
m_progress.set_format (tl::to_string (tr ("%.0fk lines")));
Expand Down
4 changes: 2 additions & 2 deletions src/db/db/dbNetlistSpiceReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ SpiceReaderStream::line_number () const
std::string
SpiceReaderStream::source () const
{
return mp_stream->absolute_path ();
return mp_stream->absolute_file_path ();
}

bool
Expand Down Expand Up @@ -495,7 +495,7 @@ SpiceCircuitDict::read (tl::InputStream &stream)
m_global_net_names.clear ();
m_global_nets.clear ();

m_file_id = file_id (stream.absolute_path ());
m_file_id = file_id (stream.absolute_file_path ());

while (! at_end ()) {
read_card ();
Expand Down
14 changes: 9 additions & 5 deletions src/db/db/dbTechnology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,10 @@ std::string
Technology::correct_path (const std::string &fp) const
{
std::string bp = base_path ();
if (bp.empty ()) {
if (bp.empty () || ! tl::InputStream::is_file_path (fp) || ! tl::InputStream::is_file_path (bp)) {
return fp;
} else {
return tl::relative_path (bp, fp);
return tl::relative_path (tl::InputStream::as_file_path (bp), tl::InputStream::as_file_path (fp));
}
}

Expand All @@ -494,7 +494,11 @@ Technology::load (const std::string &fn)
xml_struct.parse (source, *this);

// use the tech file's path as the default base path
set_default_base_path (tl::absolute_path (fn));
if (tl::InputStream::is_file_path (fn)) {
set_default_base_path (tl::absolute_path (fn));
} else {
set_default_base_path (std::string ());
}

set_tech_file_path (fn);
}
Expand All @@ -515,10 +519,10 @@ Technology::build_effective_path (const std::string &p) const
return p;
}

if (tl::is_absolute (p)) {
if (tl::InputStream::is_absolute (p)) {
return p;
} else {
return tl::combine_path (bp, p);
return tl::InputStream::combine (bp, p);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/edt/edt/edtPartialService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ PartialService::mouse_move_event (const db::DPoint &p, unsigned int buttons, boo
if (snap_details.object_snap == lay::PointSnapToObjectResult::NoObject) {
m_current = m_start + snap_move (p - m_start);
} else {
m_current = snap_details.snapped_point;
m_current = m_start + snap_move (snap_details.snapped_point - m_start);
mouse_cursor_from_snap_details (snap_details);
}

Expand Down
3 changes: 0 additions & 3 deletions src/img/img/imgService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,6 @@ Service::mouse_move_event (const db::DPoint & /*p*/, unsigned int /*buttons*/, b
bool
Service::begin_move (lay::Editable::MoveMode mode, const db::DPoint &p, lay::angle_constraint_type /*ac*/)
{
// cancel any pending move or drag operations
widget ()->drag_cancel (); // KLUDGE: every service does this to the same service manager

// compute search box
double l = catch_distance ();
db::DBox search_dbox = db::DBox (p, p).enlarged (db::DVector (l, l));
Expand Down
1 change: 0 additions & 1 deletion src/klayout.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ equals(HAVE_RUBY, "1") {

!equals(HAVE_QT, "0") {

# TODO: make buddies able to build without Qt
SUBDIRS += \
klayout_main \
lay \
Expand Down
Loading

0 comments on commit 637660c

Please sign in to comment.