diff options
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/Input.h | 7 | ||||
-rw-r--r-- | include/ui/InputTransport.h | 20 |
2 files changed, 25 insertions, 2 deletions
diff --git a/include/ui/Input.h b/include/ui/Input.h index 979d6e8..32f85b3 100644 --- a/include/ui/Input.h +++ b/include/ui/Input.h @@ -40,6 +40,11 @@ enum { */ #define MAX_POINTERS 10 +/* + * Declare a concrete type for the NDK's input event forward declaration. + */ +struct input_event_t { }; + namespace android { /* @@ -128,8 +133,6 @@ struct PointerCoords { /* * Input events. */ -struct input_event_t { }; - class InputEvent : public input_event_t { public: virtual ~InputEvent() { } diff --git a/include/ui/InputTransport.h b/include/ui/InputTransport.h index 7b182f3..d6bded6 100644 --- a/include/ui/InputTransport.h +++ b/include/ui/InputTransport.h @@ -330,4 +330,24 @@ private: } // namespace android +/* + * NDK input queue API. + */ +struct input_queue_t { +public: + /* Creates a consumer associated with an input channel. */ + explicit input_queue_t(const android::sp<android::InputChannel>& channel); + + /* Destroys the consumer and releases its input channel. */ + ~input_queue_t(); + + inline android::InputConsumer& getConsumer() { return mConsumer; } + + android::status_t consume(android::InputEvent** event); + +private: + android::InputConsumer mConsumer; + android::PreallocatedInputEventFactory mInputEventFactory; +}; + #endif // _UI_INPUT_TRANSPORT_H |