projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix #940 by updating the div spin boxes when needed
[pulseview.git]
/
pv
/
view
/
viewitempaintparams.hpp
diff --git
a/pv/view/viewitempaintparams.hpp
b/pv/view/viewitempaintparams.hpp
index 3128ef4802c3ce902f9791ccec2e607f803e1744..9f2125c86159271ab981df0b46e2d201eac6bdc4 100644
(file)
--- a/
pv/view/viewitempaintparams.hpp
+++ b/
pv/view/viewitempaintparams.hpp
@@
-14,45
+14,71
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
*/
-#ifndef PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H
-#define PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP
+
+#include "pv/util.hpp"
#include <QFont>
#include <QFont>
+#include <QRect>
namespace pv {
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class ViewItemPaintParams
{
public:
class ViewItemPaintParams
{
public:
- ViewItemPaintParams(int left, int right, double scale, double offset);
+ ViewItemPaintParams(
+ const QRect &rect, double scale, const pv::util::Timestamp& offset);
+
+ QRect rect() const {
+ return rect_;
+ }
+
+ double scale() const {
+ return scale_;
+ }
+
+ const pv::util::Timestamp& offset() const {
+ return offset_;
+ }
int left() const {
int left() const {
- return
left_
;
+ return
rect_.left()
;
}
int right() const {
}
int right() const {
- return r
ight_
;
+ return r
ect_.right()
;
}
}
-
double scale
() const {
- return
scale_
;
+
int top
() const {
+ return
rect_.top()
;
}
}
-
double offset
() const {
- return
offset_
;
+
int bottom
() const {
+ return
rect_.bottom()
;
}
int width() const {
}
int width() const {
- return right_ - left_;
+ return rect_.width();
+ }
+
+ int height() const {
+ return rect_.height();
}
double pixels_offset() const {
}
double pixels_offset() const {
- return offset_ / scale_;
+ return (offset_ / scale_).convert_to<double>();
+ }
+
+ bool next_bg_colour_state() {
+ const bool state = bg_colour_state_;
+ bg_colour_state_ = !bg_colour_state_;
+ return state;
}
public:
}
public:
@@
-61,13
+87,14
@@
public:
static int text_height();
private:
static int text_height();
private:
- int left_;
- int right_;
+ QRect rect_;
double scale_;
double scale_;
- double offset_;
+ pv::util::Timestamp offset_;
+ bool bg_colour_state_;
};
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW
_ROWITEMPAINTPARAMS_H
+#endif // PULSEVIEW_PV_VIEW
S_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP