pv/view/logicsignal.cpp
pv/view/rowitem.cpp
pv/view/rowitemowner.cpp
- pv/view/rowitempaintparams.cpp
pv/view/ruler.cpp
pv/view/signal.cpp
pv/view/timeitem.cpp
pv/view/tracepalette.cpp
pv/view/view.cpp
pv/view/viewitem.cpp
+ pv/view/viewitempaintparams.cpp
pv/view/viewport.cpp
pv/widgets/colourbutton.cpp
pv/widgets/colourpopup.cpp
return make_pair(-NominalHeight / 2, NominalHeight / 2);
}
-void AnalogSignal::paint_back(QPainter &p, const RowItemPaintParams &pp)
+void AnalogSignal::paint_back(QPainter &p, const ViewItemPaintParams &pp)
{
if (channel_->enabled())
paint_axis(p, pp, get_visual_y());
}
-void AnalogSignal::paint_mid(QPainter &p, const RowItemPaintParams &pp)
+void AnalogSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
{
assert(data_);
assert(owner_);
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with..
**/
- void paint_back(QPainter &p, const RowItemPaintParams &pp);
+ void paint_back(QPainter &p, const ViewItemPaintParams &pp);
/**
* Paints the mid-layer of the signal with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with..
**/
- void paint_mid(QPainter &p, const RowItemPaintParams &pp);
+ void paint_mid(QPainter &p, const ViewItemPaintParams &pp);
private:
void paint_trace(QPainter &p,
{
/// @todo Replace this with an implementation that knows the true
/// height of the trace
- const int row_height = (RowItemPaintParams::text_height() * 6) / 4;
+ const int row_height = (ViewItemPaintParams::text_height() * 6) / 4;
return make_pair(-row_height / 2, row_height * 7 / 2);
}
-void DecodeTrace::paint_back(QPainter &p, const RowItemPaintParams &pp)
+void DecodeTrace::paint_back(QPainter &p, const ViewItemPaintParams &pp)
{
Trace::paint_back(p, pp);
paint_axis(p, pp, get_visual_y());
}
-void DecodeTrace::paint_mid(QPainter &p, const RowItemPaintParams &pp)
+void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
{
using namespace pv::data::decode;
- text_height_ = RowItemPaintParams::text_height();
+ text_height_ = ViewItemPaintParams::text_height();
row_height_ = (text_height_ * 6) / 4;
const int annotation_height = (text_height_ * 5) / 4;
draw_unresolved_period(p, annotation_height, pp.left(), pp.right());
}
-void DecodeTrace::paint_fore(QPainter &p, const RowItemPaintParams &pp)
+void DecodeTrace::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
{
using namespace pv::data::decode;
}
void DecodeTrace::draw_annotation(const pv::data::decode::Annotation &a,
- QPainter &p, int h, const RowItemPaintParams &pp, int y,
+ QPainter &p, int h, const ViewItemPaintParams &pp, int y,
size_t base_colour) const
{
double samples_per_pixel, pixels_offset;
}
void DecodeTrace::draw_error(QPainter &p, const QString &message,
- const RowItemPaintParams &pp)
+ const ViewItemPaintParams &pp)
{
const int y = get_visual_y();
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with..
**/
- void paint_back(QPainter &p, const RowItemPaintParams &pp);
+ void paint_back(QPainter &p, const ViewItemPaintParams &pp);
/**
* Paints the mid-layer of the trace with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
**/
- void paint_mid(QPainter &p, const RowItemPaintParams &pp);
+ void paint_mid(QPainter &p, const ViewItemPaintParams &pp);
/**
* Paints the foreground layer of the trace with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
**/
- void paint_fore(QPainter &p, const RowItemPaintParams &pp);
+ void paint_fore(QPainter &p, const ViewItemPaintParams &pp);
void populate_popup_form(QWidget *parent, QFormLayout *form);
private:
void draw_annotation(const pv::data::decode::Annotation &a, QPainter &p,
- int text_height, const RowItemPaintParams &pp, int y,
+ int text_height, const ViewItemPaintParams &pp, int y,
size_t base_colour) const;
void draw_instant(const pv::data::decode::Annotation &a, QPainter &p,
double end, int y) const;
void draw_error(QPainter &p, const QString &message,
- const RowItemPaintParams &pp);
+ const ViewItemPaintParams &pp);
void draw_unresolved_period(QPainter &p, int h, int left,
int right) const;
return make_pair(-SignalHeight - SignalMargin, SignalMargin);
}
-void LogicSignal::paint_back(QPainter &p, const RowItemPaintParams &pp)
+void LogicSignal::paint_back(QPainter &p, const ViewItemPaintParams &pp)
{
if (channel_->enabled())
paint_axis(p, pp, get_visual_y());
}
-void LogicSignal::paint_mid(QPainter &p, const RowItemPaintParams &pp)
+void LogicSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
{
QLineF *line;
delete[] cap_lines;
}
-void LogicSignal::paint_fore(QPainter &p, const RowItemPaintParams &pp)
+void LogicSignal::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
{
// Draw the trigger marker
if (!trigger_match_)
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with..
**/
- void paint_back(QPainter &p, const RowItemPaintParams &pp);
+ void paint_back(QPainter &p, const ViewItemPaintParams &pp);
/**
* Paints the mid-layer of the signal with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with..
**/
- void paint_mid(QPainter &p, const RowItemPaintParams &pp);
+ void paint_mid(QPainter &p, const ViewItemPaintParams &pp);
/**
* Paints the foreground layer of the signal with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
**/
- virtual void paint_fore(QPainter &p, const RowItemPaintParams &pp);
+ virtual void paint_fore(QPainter &p, const ViewItemPaintParams &pp);
private:
void paint_caps(QPainter &p, QLineF *const lines,
return QPoint(0, visual_v_offset());
}
-void RowItem::paint_back(QPainter &p, const RowItemPaintParams &pp)
+void RowItem::paint_back(QPainter &p, const ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
}
-void RowItem::paint_mid(QPainter &p, const RowItemPaintParams &pp)
+void RowItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
}
-void RowItem::paint_fore(QPainter &p, const RowItemPaintParams &pp)
+void RowItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
#include <QPropertyAnimation>
-#include "rowitempaintparams.hpp"
+#include "viewitempaintparams.hpp"
#include "viewitem.hpp"
namespace pv {
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
**/
- virtual void paint_back(QPainter &p, const RowItemPaintParams &pp);
+ virtual void paint_back(QPainter &p, const ViewItemPaintParams &pp);
/**
* Paints the mid-layer of the trace with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
**/
- virtual void paint_mid(QPainter &p, const RowItemPaintParams &pp);
+ virtual void paint_mid(QPainter &p, const ViewItemPaintParams &pp);
/**
* Paints the foreground layer of the trace with a QPainter
* @param p the QPainter to paint into.
* @param pp the painting parameters object to paint with.
**/
- virtual void paint_fore(QPainter &p, const RowItemPaintParams &pp);
+ virtual void paint_fore(QPainter &p, const ViewItemPaintParams &pp);
/**
* Paints the signal label.
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#include <cassert>
-
-#include <QApplication>
-#include <QFontMetrics>
-
-#include "rowitempaintparams.hpp"
-
-namespace pv {
-namespace view {
-
-RowItemPaintParams::RowItemPaintParams(
- int left, int right, double scale, double offset) :
- left_(left),
- right_(right),
- scale_(scale),
- offset_(offset) {
- assert(left <= right);
- assert(scale > 0.0);
-}
-
-QFont RowItemPaintParams::font()
-{
- return QApplication::font();
-}
-
-int RowItemPaintParams::text_height() {
- QFontMetrics m(font());
- return m.boundingRect(QRect(), 0, "Tg").height();
-}
-
-} // namespace view
-} // namespace pv
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H
-#define PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H
-
-#include <QFont>
-
-namespace pv {
-namespace view {
-
-class RowItemPaintParams
-{
-public:
- RowItemPaintParams(int left, int right, double scale, double offset);
-
- int left() const {
- return left_;
- }
-
- int right() const {
- return right_;
- }
-
- double scale() const {
- return scale_;
- }
-
- double offset() const {
- return offset_;
- }
-
- int width() const {
- return right_ - left_;
- }
-
- double pixels_offset() const {
- return offset_ / scale_;
- }
-
-public:
- static QFont font();
-
- static int text_height();
-
-private:
- int left_;
- int right_;
- double scale_;
- double offset_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H
label_size.height());
}
-void Trace::paint_axis(QPainter &p, const RowItemPaintParams &pp, int y)
+void Trace::paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y)
{
p.setPen(AxisPen);
p.drawLine(QPointF(pp.left(), y + 0.5f), QPointF(pp.right(), y + 0.5f));
* @param pp the painting parameters object to paint with.
* @param y the y-offset of the axis.
*/
- void paint_axis(QPainter &p, const RowItemPaintParams &pp, int y);
+ void paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y);
void add_colour_option(QWidget *parent, QFormLayout *form);
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#include <cassert>
+
+#include <QApplication>
+#include <QFontMetrics>
+
+#include "viewitempaintparams.hpp"
+
+namespace pv {
+namespace view {
+
+ViewItemPaintParams::ViewItemPaintParams(
+ int left, int right, double scale, double offset) :
+ left_(left),
+ right_(right),
+ scale_(scale),
+ offset_(offset) {
+ assert(left <= right);
+ assert(scale > 0.0);
+}
+
+QFont ViewItemPaintParams::font()
+{
+ return QApplication::font();
+}
+
+int ViewItemPaintParams::text_height() {
+ QFontMetrics m(font());
+ return m.boundingRect(QRect(), 0, "Tg").height();
+}
+
+} // namespace view
+} // namespace pv
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H
+#define PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H
+
+#include <QFont>
+
+namespace pv {
+namespace view {
+
+class ViewItemPaintParams
+{
+public:
+ ViewItemPaintParams(int left, int right, double scale, double offset);
+
+ int left() const {
+ return left_;
+ }
+
+ int right() const {
+ return right_;
+ }
+
+ double scale() const {
+ return scale_;
+ }
+
+ double offset() const {
+ return offset_;
+ }
+
+ int width() const {
+ return right_ - left_;
+ }
+
+ double pixels_offset() const {
+ return offset_ / scale_;
+ }
+
+public:
+ static QFont font();
+
+ static int text_height();
+
+private:
+ int left_;
+ int right_;
+ double scale_;
+ double offset_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H
#include <cmath>
#include <algorithm>
-#include "rowitempaintparams.hpp"
#include "signal.hpp"
#include "view.hpp"
+#include "viewitempaintparams.hpp"
#include "viewport.hpp"
#include <pv/session.hpp>
if (view_.cursors_shown())
view_.cursors()->draw_viewport_background(p, rect());
- const RowItemPaintParams pp(0, width(), view_.scale(), view_.offset());
+ const ViewItemPaintParams pp(0, width(), view_.scale(), view_.offset());
// Plot the signal
for (const shared_ptr<RowItem> r : row_items)
${PROJECT_SOURCE_DIR}/pv/view/logicsignal.cpp
${PROJECT_SOURCE_DIR}/pv/view/rowitem.cpp
${PROJECT_SOURCE_DIR}/pv/view/rowitemowner.cpp
- ${PROJECT_SOURCE_DIR}/pv/view/rowitempaintparams.cpp
${PROJECT_SOURCE_DIR}/pv/view/ruler.cpp
${PROJECT_SOURCE_DIR}/pv/view/signal.cpp
${PROJECT_SOURCE_DIR}/pv/view/timeitem.cpp
${PROJECT_SOURCE_DIR}/pv/view/tracepalette.cpp
${PROJECT_SOURCE_DIR}/pv/view/view.cpp
${PROJECT_SOURCE_DIR}/pv/view/viewitem.cpp
+ ${PROJECT_SOURCE_DIR}/pv/view/viewitempaintparams.cpp
${PROJECT_SOURCE_DIR}/pv/view/viewport.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.cpp