X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Fcursorpair.h;fp=pv%2Fview%2Fcursorpair.h;h=8c721bb63407a648044538627211160491bd7f3b;hb=b42d25c43e52c900cbdd3e5cde0282961b8721e7;hp=0000000000000000000000000000000000000000;hpb=140181a46034cf65739ba4bf0bf1260ab94ac736;p=pulseview.git diff --git a/pv/view/cursorpair.h b/pv/view/cursorpair.h new file mode 100644 index 00000000..8c721bb6 --- /dev/null +++ b/pv/view/cursorpair.h @@ -0,0 +1,68 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2013 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_CURSORPAIR_H +#define PULSEVIEW_PV_VIEW_CURSORPAIR_H + +#include "cursor.h" + +class QPainter; + +namespace pv { +namespace view { + +class CursorPair +{ +public: + /** + * Constructor. + * @param view A reference to the view that owns this cursor pair. + */ + CursorPair(const View &view); + + /** + * Returns a reference to the first cursor. + */ + Cursor& first(); + + /** + * Returns a reference to the first cursor. + */ + const Cursor& first() const; + + /** + * Returns a reference to the second cursor. + */ + Cursor& second(); + + /** + * Returns a reference to the second cursor. + */ + const Cursor& second() const; + +private: + Cursor _first, _second; + const View &_view; +}; + +} // namespace view +} // namespace pv + +#endif // PULSEVIEW_PV_VIEW_CURSORPAIR_H