]> sigrok.org Git - pulseview.git/blobdiff - pv/view/header.h
Initialise Trace widgets when the trace is received by the View
[pulseview.git] / pv / view / header.h
index ff058863c2d536a598b5b83a199801bd2ba9b1e5..22e8e4dbd2c3dbba58908d6a7a7a1208339bdfb0 100644 (file)
 #define PULSEVIEW_PV_VIEW_HEADER_H
 
 #include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
 
-#include <map>
+#include <list>
+#include <utility>
 
-#include <QWidget>
+#include "marginwidget.h"
 
 namespace pv {
 namespace view {
@@ -33,7 +35,7 @@ namespace view {
 class Signal;
 class View;
 
-class Header : public QWidget
+class Header : public MarginWidget
 {
        Q_OBJECT
 
@@ -44,6 +46,8 @@ private:
        boost::shared_ptr<pv::view::Signal> get_mouse_over_signal(
                const QPoint &pt);
 
+       void clear_selection();
+
 private:
        void paintEvent(QPaintEvent *event);
 
@@ -59,20 +63,23 @@ private:
        void contextMenuEvent(QContextMenuEvent *event);
 
 private slots:
+       void on_signals_changed();
+
        void on_action_set_name_triggered();
 
        void on_action_set_colour_triggered();
 
+       void on_signals_moved();
+
 signals:
        void signals_moved();
 
 private:
-       View &_view;
-
        QPoint _mouse_point;
        QPoint _mouse_down_point;
 
-       std::map<const Signal*, int> _mouse_down_signal_offsets;
+       std::list<std::pair<boost::weak_ptr<Signal>, int> >
+               _drag_sigs;
 
        boost::shared_ptr<Signal> _context_signal;
        QAction *_action_set_name;