summaryrefslogtreecommitdiff
path: root/FL/Fl_Widget_Tracker.H
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2025-11-17 21:10:01 +0100
committerGitHub <noreply@github.com>2025-11-17 21:10:01 +0100
commitfa65cd63214030011d7ac0a18818c644aff05750 (patch)
tree8d5b7c129955a258897a14816cda802778c36910 /FL/Fl_Widget_Tracker.H
parentd623ad08a9e7d91e8b0599189bdb57e6ee1dcc94 (diff)
Add pen/stylus/tablet API and driver for macOS (#1326)
* define the pen/tablet support API * add pen event handler stub as a fallback * add pen device test "penpal". * Add macOS pen/stylus/tablet driver. * Add Oxygen documentation.
Diffstat (limited to 'FL/Fl_Widget_Tracker.H')
-rw-r--r--FL/Fl_Widget_Tracker.H15
1 files changed, 13 insertions, 2 deletions
diff --git a/FL/Fl_Widget_Tracker.H b/FL/Fl_Widget_Tracker.H
index d0aad86c0..fb2182e5f 100644
--- a/FL/Fl_Widget_Tracker.H
+++ b/FL/Fl_Widget_Tracker.H
@@ -76,9 +76,20 @@ class FL_EXPORT Fl_Widget_Tracker {
public:
Fl_Widget_Tracker(Fl_Widget *wi);
+ // Rule of five. Note that we *can* implement these when we refactor widget
+ // tracking with a C++11 map or unordered_map, for example.
+ Fl_Widget_Tracker(const Fl_Widget_Tracker&) = delete;
+ Fl_Widget_Tracker(Fl_Widget_Tracker&&) = delete;
+ Fl_Widget_Tracker& operator=(const Fl_Widget_Tracker&) = delete;
+ Fl_Widget_Tracker& operator=(Fl_Widget_Tracker&&) = delete;
~Fl_Widget_Tracker();
/**
+ Clear the widget pointer.
+ */
+ void clear() { wp_ = nullptr; }
+
+ /**
Returns a pointer to the watched widget.
\return nullptr if the widget was deleted.
*/
@@ -88,13 +99,13 @@ public:
Check if the widget was deleted since the tracker was created.
\return 1 if the watched widget has been deleted, otherwise 0
*/
- int deleted() {return wp_ == 0;}
+ int deleted() {return wp_ == nullptr;}
/**
Check if the widget exists and was not deleted since the tracker was created.
\return 1 if the watched widget exists, otherwise 0
*/
- int exists() { return wp_ != 0; }
+ int exists() { return wp_ != nullptr; }
};