projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make member variable underscores a suffix instead of a prefix
[pulseview.git]
/
pv
/
view
/
cursorpair.h
diff --git
a/pv/view/cursorpair.h
b/pv/view/cursorpair.h
index 05035cc26385560af3c80f8c8e2771e0f05a9f41..f7eb51cacaabe9a79cf2d715c487eed94f5ab222 100644
(file)
--- a/
pv/view/cursorpair.h
+++ b/
pv/view/cursorpair.h
@@
-23,6
+23,8
@@
#include "cursor.h"
#include "cursor.h"
+#include <memory>
+
#include <QPainter>
class QPainter;
#include <QPainter>
class QPainter;
@@
-32,34
+34,29
@@
namespace view {
class CursorPair
{
class CursorPair
{
+private:
+ static const int DeltaPadding;
+
public:
/**
* Constructor.
* @param view A reference to the view that owns this cursor pair.
*/
public:
/**
* Constructor.
* @param view A reference to the view that owns this cursor pair.
*/
- CursorPair(
const
View &view);
+ CursorPair(View &view);
/**
/**
- * Returns a
reference
to the first cursor.
+ * Returns a
pointer
to the first cursor.
*/
*/
-
Cursor& first()
;
+
std::shared_ptr<Cursor> first() const
;
/**
/**
- * Returns a
reference to the first
cursor.
+ * Returns a
pointer to the second
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;
+ std::shared_ptr<Cursor> second() const;
public:
public:
+ QRectF get_label_rect(const QRect &rect) const;
+
void draw_markers(QPainter &p,
const QRect &rect, unsigned int prefix);
void draw_markers(QPainter &p,
const QRect &rect, unsigned int prefix);
@@
-67,9
+64,15
@@
public:
void draw_viewport_foreground(QPainter &p, const QRect &rect);
void draw_viewport_foreground(QPainter &p, const QRect &rect);
+ void compute_text_size(QPainter &p, unsigned int prefix);
+
+ std::pair<float, float> get_cursor_offsets() const;
+
private:
private:
- Cursor _first, _second;
- const View &_view;
+ std::shared_ptr<Cursor> first_, second_;
+ const View &view_;
+
+ QSizeF text_size_;
};
} // namespace view
};
} // namespace view