projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
32218d3
)
RowItemOwner: Added depth() method
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sun, 16 Nov 2014 19:47:13 +0000
(19:47 +0000)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Wed, 19 Nov 2014 10:23:31 +0000
(10:23 +0000)
pv/view/rowitemowner.h
patch
|
blob
|
history
pv/view/tracegroup.cpp
patch
|
blob
|
history
pv/view/tracegroup.h
patch
|
blob
|
history
pv/view/view.cpp
patch
|
blob
|
history
pv/view/view.h
patch
|
blob
|
history
diff --git
a/pv/view/rowitemowner.h
b/pv/view/rowitemowner.h
index c2d38134e2080027d4b12bafa8faea4874851513..0fda9aa27b1778dbabfdf6c3d797fd3e4206065a 100644
(file)
--- a/
pv/view/rowitemowner.h
+++ b/
pv/view/rowitemowner.h
@@
-65,6
+65,11
@@
public:
virtual int owner_v_offset() const = 0;
virtual int owner_v_offset() const = 0;
+ /**
+ * Returns the number of nested parents that this row item owner has.
+ */
+ virtual unsigned int depth() const = 0;
+
/**
* Returns a list of row items owned by this object.
*/
/**
* Returns a list of row items owned by this object.
*/
diff --git
a/pv/view/tracegroup.cpp
b/pv/view/tracegroup.cpp
index 05a72dda021633fa4479dc6e292a390dc2ca3771..3058cec5158ba90e1979a82ba3dd9d790b43ef56 100644
(file)
--- a/
pv/view/tracegroup.cpp
+++ b/
pv/view/tracegroup.cpp
@@
-155,6
+155,11
@@
int TraceGroup::owner_v_offset() const
return _owner ? layout_v_offset() + _owner->owner_v_offset() : 0;
}
return _owner ? layout_v_offset() + _owner->owner_v_offset() : 0;
}
+unsigned int TraceGroup::depth() const
+{
+ return _owner ? _owner->depth() + 1 : 0;
+}
+
void TraceGroup::on_ungroup()
{
const vector< shared_ptr<RowItem> > items(
void TraceGroup::on_ungroup()
{
const vector< shared_ptr<RowItem> > items(
diff --git
a/pv/view/tracegroup.h
b/pv/view/tracegroup.h
index 218f42b11d3df54d548f1c3e4cf41f49d2bdf411..a950eac91451ba188ab0bd898430b4d83ebdef2e 100644
(file)
--- a/
pv/view/tracegroup.h
+++ b/
pv/view/tracegroup.h
@@
-110,6
+110,11
@@
public:
*/
int owner_v_offset() const;
*/
int owner_v_offset() const;
+ /**
+ * Returns the number of nested parents that this row item owner has.
+ */
+ unsigned int depth() const;
+
public:
void appearance_changed(bool label, bool content);
public:
void appearance_changed(bool label, bool content);
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index d8925c1aaa2acc1f2d3f0b4bc5a39bf3d420d3c0..ba095fb808d083a98397740554de5bc3a4096c0e 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-186,6
+186,11
@@
int View::owner_v_offset() const
return -_v_offset;
}
return -_v_offset;
}
+unsigned int View::depth() const
+{
+ return 0;
+}
+
void View::zoom(double steps)
{
zoom(steps, _viewport->width() / 2);
void View::zoom(double steps)
{
zoom(steps, _viewport->width() / 2);
diff --git
a/pv/view/view.h
b/pv/view/view.h
index 71a38f11888b0034ce3c916a6a19d5939107459d..2f7462978943a84362ff295f95a29011bef6599d 100644
(file)
--- a/
pv/view/view.h
+++ b/
pv/view/view.h
@@
-99,6
+99,11
@@
public:
double offset() const;
int owner_v_offset() const;
double offset() const;
int owner_v_offset() const;
+ /**
+ * Returns the number of nested parents that this row item owner has.
+ */
+ unsigned int depth() const;
+
void zoom(double steps);
void zoom(double steps, int offset);
void zoom(double steps);
void zoom(double steps, int offset);