From d767c84022559e55708f24a3a264853c0142135e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 8 Nov 2020 01:14:38 +0200 Subject: libcamera: Move EventDispatcher to internal API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no user of the EventDispatcher (and the related EventNotifier and Timer classes) outside of libcamera. Move those classes to the internal API. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- include/libcamera/internal/event_notifier.h | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 include/libcamera/internal/event_notifier.h (limited to 'include/libcamera/internal/event_notifier.h') diff --git a/include/libcamera/internal/event_notifier.h b/include/libcamera/internal/event_notifier.h new file mode 100644 index 00000000..a37b02ee --- /dev/null +++ b/include/libcamera/internal/event_notifier.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2019, Google Inc. + * + * event_notifier.h - File descriptor event notifier + */ +#ifndef __LIBCAMERA_EVENT_NOTIFIER_H__ +#define __LIBCAMERA_EVENT_NOTIFIER_H__ + +#include +#include + +namespace libcamera { + +class Message; + +class EventNotifier : public Object +{ +public: + enum Type { + Read, + Write, + Exception, + }; + + EventNotifier(int fd, Type type, Object *parent = nullptr); + virtual ~EventNotifier(); + + Type type() const { return type_; } + int fd() const { return fd_; } + + bool enabled() const { return enabled_; } + void setEnabled(bool enable); + + Signal activated; + +protected: + void message(Message *msg) override; + +private: + int fd_; + Type type_; + bool enabled_; +}; + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_EVENT_NOTIFIER_H__ */ -- cgit v1.2.1