X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Fruler.hpp;h=1efd8737c9c938fb568bdf0948a8b9f5c0bc62d8;hb=HEAD;hp=d13a31b8e7a0a0826b50b9244829429ee293e9a9;hpb=bb4a0e8e0b337988264e43a368b6ce5950d2d6cd;p=pulseview.git diff --git a/pv/view/ruler.hpp b/pv/view/ruler.hpp deleted file mode 100644 index d13a31b8..00000000 --- a/pv/view/ruler.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * 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_RULER_H -#define PULSEVIEW_PV_VIEW_RULER_H - -#include - -#include "marginwidget.hpp" - -namespace pv { -namespace view { - -class TimeItem; -class ViewItem; - -class Ruler : public MarginWidget -{ - Q_OBJECT - -private: - - /// Height of the ruler in multipes of the text height - static const float RulerHeight; - - static const int MinorTickSubdivision; - - /// Height of the hover arrow in multiples of the text height - static const float HoverArrowSize; - -public: - Ruler(View &parent); - -public: - QSize sizeHint() const; - - /** - * The extended area that the header widget would like to be sized to. - * @remarks This area is the area specified by sizeHint, extended by - * the area to overlap the viewport. - */ - QSize extended_size_hint() const; - -private: - /** - * Gets the time items. - */ - std::vector< std::shared_ptr > items(); - - /** - * Gets the first view item which has a label that contains @c pt . - * @param pt the point to search with. - * @return the view item that has been found, or and empty - * @c shared_ptr if no item was found. - */ - std::shared_ptr get_mouse_over_item( - const QPoint &pt); - -private: - void paintEvent(QPaintEvent *event); - - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *); - - void mouseDoubleClickEvent(QMouseEvent *e); - -private: - /** - * Draw a hover arrow under the cursor position. - * @param p The painter to draw into. - * @param text_height The height of a single text ascent. - */ - void draw_hover_mark(QPainter &p, int text_height); - - int calculate_text_height() const; - -private Q_SLOTS: - void hover_point_changed(); -}; - -} // namespace view -} // namespace pv - -#endif // PULSEVIEW_PV_VIEW_RULER_H