]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/ruler.hpp
TabularDecView: Allow return/enter press and don't change scale
[pulseview.git] / pv / views / trace / ruler.hpp
index 8c1876cced37f5e2598f655a51e309eff0c4fbd7..55c156f5942e34f8a97912322b25a3b2df4c669b 100644 (file)
@@ -17,8 +17,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP
-#define PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP
+#define PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP
 
 #include <functional>
 #include <memory>
@@ -117,11 +117,18 @@ public:
                unsigned precision = 0,
                bool sign = true);
 
-       pv::util::Timestamp get_time_from_x_pos(uint32_t x);
+       pv::util::Timestamp get_absolute_time_from_x_pos(uint32_t x) const;
+       pv::util::Timestamp get_ruler_time_from_x_pos(uint32_t x) const;
+
+       pv::util::Timestamp get_ruler_time_from_absolute_time(const pv::util::Timestamp& abs_time) const;
+       pv::util::Timestamp get_absolute_time_from_ruler_time(const pv::util::Timestamp& ruler_time) const;
+
+       shared_ptr<TimeItem> get_reference_item() const;
 
 protected:
        virtual void contextMenuEvent(QContextMenuEvent *event) override;
        void resizeEvent(QResizeEvent*) override;
+       virtual void item_hover(const shared_ptr<ViewItem> &item, QPoint pos) override;
 
 private:
        /**
@@ -171,11 +178,13 @@ private:
                function<QString(const pv::util::Timestamp&)> format_function);
 
 private Q_SLOTS:
-       void hover_point_changed(const QPoint &hp);
+       void on_hover_point_changed(const QWidget* widget, const QPoint &hp);
 
        void invalidate_tick_position_cache();
 
        void on_createMarker();
+       void on_setZeroPosition();
+       void on_resetZeroPosition();
        void on_toggleHoverMarker();
 
 private:
@@ -185,6 +194,8 @@ private:
         */
        boost::optional<TickPositions> tick_position_cache_;
 
+       shared_ptr<TimeItem> hover_item_;
+
        uint32_t context_menu_x_pos_;
 };
 
@@ -192,4 +203,4 @@ private:
 } // namespace views
 } // namespace pv
 
-#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP