Use IWYU.

This commit is contained in:
ArthurSonzogni
2021-05-01 20:40:35 +02:00
parent eb399d20c5
commit 155758c073
119 changed files with 770 additions and 342 deletions

View File

@@ -1,11 +1,20 @@
#include "ftxui/component/component.hpp"
#include <assert.h>
#include <algorithm>
#include "ftxui/component/captured_mouse.hpp"
#include "ftxui/component/event.hpp"
#include "ftxui/component/screen_interactive.hpp"
namespace ftxui {
namespace {
class CaptureMouseImpl : public CapturedMouseInterface {
public:
~CaptureMouseImpl() override {}
};
}
Component::~Component() {
Detach();
}
@@ -97,6 +106,16 @@ void Component::TakeFocus() {
}
}
/// @brief Take the CapturedMouse if available. There is only one component of
/// them. It represents a component taking priority over others.
/// @argument event
/// @ingroup component
CapturedMouse Component::CaptureMouse(const Event& event) {
if (!event.screen_)
return std::make_unique<CaptureMouseImpl>();
return event.screen_->CaptureMouse();
}
/// @brief Detach this children from its parent.
/// @see Attach
/// @see Detach