Skip to content

Commit 637660c

Browse files
Merge pull request #1933 from KLayout/wip
Wip
2 parents ec21809 + 22d8709 commit 637660c

36 files changed

+805
-312
lines changed

src/ant/ant/antService.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,9 +1382,6 @@ dragging_what (const ant::Object *robj, const db::DBox &search_dbox, ant::Servic
13821382
bool
13831383
Service::begin_move (lay::Editable::MoveMode mode, const db::DPoint &p, lay::angle_constraint_type /*ac*/)
13841384
{
1385-
// cancel any pending move or drag operations, reset mp_active_ruler
1386-
ui ()->drag_cancel (); // KLUDGE: every service does this to the same service manager
1387-
13881385
clear_transient_selection ();
13891386

13901387
// choose move mode

src/db/db/dbLayoutQuery.cc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,9 +1938,11 @@ struct SelectFilterPropertyIDs
19381938
SelectFilterPropertyIDs (LayoutQuery *q)
19391939
{
19401940
data = q->register_property ("data", LQ_variant);
1941+
expressions = q->register_property ("expressions", LQ_variant);
19411942
}
19421943

19431944
unsigned int data; // data -> An array of the selected values
1945+
unsigned int expressions; // data -> An array with the expressions
19441946
};
19451947

19461948
class DB_PUBLIC SelectFilterReportingState
@@ -2037,7 +2039,16 @@ class DB_PUBLIC SelectFilterState
20372039
}
20382040
}
20392041

2040-
virtual void reset (FilterStateBase *previous)
2042+
void get_expressions (tl::Variant &v)
2043+
{
2044+
std::vector<tl::Variant> vd;
2045+
v = tl::Variant (vd.begin (), vd.end ());
2046+
for (std::vector<tl::Expression>::const_iterator e = m_expressions.begin (); e != m_expressions.end (); ++e) {
2047+
v.push (e->text ());
2048+
}
2049+
}
2050+
2051+
virtual void reset (FilterStateBase *previous)
20412052
{
20422053
if (m_has_sorting) {
20432054

@@ -2082,6 +2093,9 @@ class DB_PUBLIC SelectFilterState
20822093
if (id == m_pids.data) {
20832094
get_data (v);
20842095
return true;
2096+
} else if (id == m_pids.expressions) {
2097+
get_expressions (v);
2098+
return true;
20852099
} else if (m_in_data_eval) {
20862100
return FilterStateBase::get_property (id, v);
20872101
} else {

src/db/db/dbLayoutToNetlistReader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef l2n_std_format::keys<true> skeys;
6060
typedef l2n_std_format::keys<false> lkeys;
6161

6262
LayoutToNetlistStandardReader::LayoutToNetlistStandardReader (tl::InputStream &stream)
63-
: m_stream (stream), m_path (stream.absolute_path ()), m_dbu (0.0),
63+
: m_stream (stream), m_path (stream.absolute_file_path ()), m_dbu (0.0),
6464
m_progress (tl::to_string (tr ("Reading L2N database")), 1000)
6565
{
6666
m_progress.set_format (tl::to_string (tr ("%.0fk lines")));

src/db/db/dbNetlistSpiceReader.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ SpiceReaderStream::line_number () const
183183
std::string
184184
SpiceReaderStream::source () const
185185
{
186-
return mp_stream->absolute_path ();
186+
return mp_stream->absolute_file_path ();
187187
}
188188

189189
bool
@@ -495,7 +495,7 @@ SpiceCircuitDict::read (tl::InputStream &stream)
495495
m_global_net_names.clear ();
496496
m_global_nets.clear ();
497497

498-
m_file_id = file_id (stream.absolute_path ());
498+
m_file_id = file_id (stream.absolute_file_path ());
499499

500500
while (! at_end ()) {
501501
read_card ();

src/db/db/dbTechnology.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,10 @@ std::string
479479
Technology::correct_path (const std::string &fp) const
480480
{
481481
std::string bp = base_path ();
482-
if (bp.empty ()) {
482+
if (bp.empty () || ! tl::InputStream::is_file_path (fp) || ! tl::InputStream::is_file_path (bp)) {
483483
return fp;
484484
} else {
485-
return tl::relative_path (bp, fp);
485+
return tl::relative_path (tl::InputStream::as_file_path (bp), tl::InputStream::as_file_path (fp));
486486
}
487487
}
488488

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

496496
// use the tech file's path as the default base path
497-
set_default_base_path (tl::absolute_path (fn));
497+
if (tl::InputStream::is_file_path (fn)) {
498+
set_default_base_path (tl::absolute_path (fn));
499+
} else {
500+
set_default_base_path (std::string ());
501+
}
498502

499503
set_tech_file_path (fn);
500504
}
@@ -515,10 +519,10 @@ Technology::build_effective_path (const std::string &p) const
515519
return p;
516520
}
517521

518-
if (tl::is_absolute (p)) {
522+
if (tl::InputStream::is_absolute (p)) {
519523
return p;
520524
} else {
521-
return tl::combine_path (bp, p);
525+
return tl::InputStream::combine (bp, p);
522526
}
523527
}
524528

src/edt/edt/edtPartialService.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,7 @@ PartialService::mouse_move_event (const db::DPoint &p, unsigned int buttons, boo
18111811
if (snap_details.object_snap == lay::PointSnapToObjectResult::NoObject) {
18121812
m_current = m_start + snap_move (p - m_start);
18131813
} else {
1814-
m_current = snap_details.snapped_point;
1814+
m_current = m_start + snap_move (snap_details.snapped_point - m_start);
18151815
mouse_cursor_from_snap_details (snap_details);
18161816
}
18171817

src/img/img/imgService.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,6 @@ Service::mouse_move_event (const db::DPoint & /*p*/, unsigned int /*buttons*/, b
588588
bool
589589
Service::begin_move (lay::Editable::MoveMode mode, const db::DPoint &p, lay::angle_constraint_type /*ac*/)
590590
{
591-
// cancel any pending move or drag operations
592-
widget ()->drag_cancel (); // KLUDGE: every service does this to the same service manager
593-
594591
// compute search box
595592
double l = catch_distance ();
596593
db::DBox search_dbox = db::DBox (p, p).enlarged (db::DVector (l, l));

src/klayout.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ equals(HAVE_RUBY, "1") {
2525

2626
!equals(HAVE_QT, "0") {
2727

28-
# TODO: make buddies able to build without Qt
2928
SUBDIRS += \
3029
klayout_main \
3130
lay \

0 commit comments

Comments
 (0)