X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fviewitem.hpp;h=c445f609063df6386579d6fa6cebf74fd4a11c19;hp=e07b26b87912cc1f072c1f4fd12e2eff2cdbe9df;hb=af33d4cbacc745f4473f5c0f4fa1f9ebb8d84d0a;hpb=9e773fecf2d4ab8f2fc6e1cc880b9102c22ec228 diff --git a/pv/views/trace/viewitem.hpp b/pv/views/trace/viewitem.hpp index e07b26b8..c445f609 100644 --- a/pv/views/trace/viewitem.hpp +++ b/pv/views/trace/viewitem.hpp @@ -23,6 +23,7 @@ #include #include +#include #include "viewitempaintparams.hpp" @@ -52,12 +53,16 @@ public: public: ViewItem(); -public: /** * Returns true if the item is visible and enabled. */ virtual bool enabled() const = 0; + /** + * Returns true if the item may be selected. + */ + virtual bool is_selectable(QPoint pos) const; + /** * Returns true if the item has been selected by the user. */ @@ -71,7 +76,7 @@ public: /** * Returns true if the item may be dragged/moved. */ - virtual bool is_draggable() const; + virtual bool is_draggable(QPoint pos) const; /** * Returns true if the item is being dragged. @@ -145,7 +150,6 @@ public: */ virtual void paint_fore(QPainter &p, ViewItemPaintParams &pp); -public: /** * Gets the text color. * @remarks This color is computed by comparing the lightness @@ -157,12 +161,14 @@ public: public: virtual QMenu* create_header_context_menu(QWidget *parent); - virtual QMenu* create_view_context_menu(QWidget *parent); + virtual QMenu* create_view_context_menu(QWidget *parent, QPoint &click_pos); virtual pv::widgets::Popup* create_popup(QWidget *parent); virtual void delete_pressed(); + virtual void hover_point_changed(const QPoint &hp); + protected: static QPen highlight_pen();