-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[render] EventDrawer and BlockerEventDrawer are separate classes
- Loading branch information
1 parent
49a5784
commit 8d49e2a
Showing
7 changed files
with
238 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
vclib/render/include/vclib/render/concepts/blocker_event_drawer.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/***************************************************************************** | ||
* VCLib * | ||
* Visual Computing Library * | ||
* * | ||
* Copyright(C) 2021-2024 * | ||
* Visual Computing Lab * | ||
* ISTI - Italian National Research Council * | ||
* * | ||
* All rights reserved. * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the Mozilla Public License Version 2.0 as published * | ||
* by the Mozilla 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 * | ||
* Mozilla Public License Version 2.0 * | ||
* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * | ||
****************************************************************************/ | ||
|
||
#ifndef CONCEPTS_BLOCKER_EVENT_DRAWER_H | ||
#define CONCEPTS_BLOCKER_EVENT_DRAWER_H | ||
|
||
#include "event_drawer.h" | ||
|
||
#include <vclib/render/input.h> | ||
|
||
namespace vcl { | ||
|
||
template<typename T> | ||
concept BlockerEventDrawerConcept = | ||
EventDrawerConcept<T> && requires (T&& obj) { | ||
requires RemoveRef<T>::CAN_BLOCK_EVENT_PROPAGATION == true; | ||
|
||
// non const requirements | ||
requires IsConst<T> || requires { | ||
{ | ||
obj.onKeyPress(Key::Enum(), KeyModifiers()) | ||
} -> std::same_as<bool>; | ||
{ | ||
obj.onKeyRelease(Key::Enum(), KeyModifiers()) | ||
} -> std::same_as<bool>; | ||
{ | ||
obj.onMouseMove(double(), double(), KeyModifiers()) | ||
} -> std::same_as<bool>; | ||
{ | ||
obj.onMousePress( | ||
MouseButton::Enum(), double(), double(), KeyModifiers()) | ||
} -> std::same_as<bool>; | ||
{ | ||
obj.onMouseRelease( | ||
MouseButton::Enum(), double(), double(), KeyModifiers()) | ||
} -> std::same_as<bool>; | ||
{ | ||
obj.onMouseDoubleClick( | ||
MouseButton::Enum(), double(), double(), KeyModifiers()) | ||
} -> std::same_as<bool>; | ||
{ | ||
obj.onMouseScroll(double(), double(), KeyModifiers()) | ||
} -> std::same_as<bool>; | ||
}; | ||
}; | ||
|
||
} // namespace vcl | ||
|
||
#endif // CONCEPTS_BLOCKER_EVENT_DRAWER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.