diff options
author | David Robillard <d@drobilla.net> | 2022-05-22 18:26:35 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-11-11 09:54:18 -0500 |
commit | 91051e9059b67b8d633e385afb48a36d4f9467ba (patch) | |
tree | 0d221ea736e27dec7f405acfe2b866b4f81398e3 /bindings/cpp | |
parent | c59e88aa6fa60c6f7424da737fcaf0496a0bf3d6 (diff) | |
download | pugl-91051e9059b67b8d633e385afb48a36d4f9467ba.tar.gz pugl-91051e9059b67b8d633e385afb48a36d4f9467ba.tar.bz2 pugl-91051e9059b67b8d633e385afb48a36d4f9467ba.zip |
Add action parameter to puglAcceptOffer()
Diffstat (limited to 'bindings/cpp')
-rw-r--r-- | bindings/cpp/include/pugl/pugl.hpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/bindings/cpp/include/pugl/pugl.hpp b/bindings/cpp/include/pugl/pugl.hpp index 18dd015..d691123 100644 --- a/bindings/cpp/include/pugl/pugl.hpp +++ b/bindings/cpp/include/pugl/pugl.hpp @@ -141,6 +141,9 @@ using ViewStyleFlags = PuglViewStyleFlags; /// @copydoc PuglClipboard using Clipboard = PuglClipboard; +/// @copydoc PuglAction +using Action = PuglAction; + /// @copydoc PuglRealizeEvent using RealizeEvent = Event<PUGL_REALIZE, PuglRealizeEvent>; @@ -665,15 +668,22 @@ public: the `typeIndex` argument to the call of puglGetClipboardType() that returned the accepted type. - @param region The region of the view that will accept the data. This may - be used by the system to avoid sending redundant events. + @param action The action that will be performed when the data is dropped. + This may be used to provide visual feedback to the user, for example by + having the drag source change the cursor. + + @param region The region of the view that will accept this drop. This may + be used by the system to avoid sending redundant events when the item is + dragged within the region. This is only an optimization, an all-zero + region can safely be passed. */ Status acceptOffer(const DataOfferEvent& offer, const uint32_t typeIndex, + const Action action, const Rect& region) { return static_cast<Status>( - puglAcceptOffer(cobj(), &offer, typeIndex, region)); + puglAcceptOffer(cobj(), &offer, typeIndex, action, region)); } /// @copydoc puglSetViewStyle |