summaryrefslogtreecommitdiffstats
path: root/include/ui/InputTransport.h
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-06-18 18:09:33 -0700
committerDianne Hackborn <hackbod@google.com>2010-06-22 11:21:50 -0700
commit4d96bb6ae38466a04acfbcce61cb202786239927 (patch)
tree5199b35ac2e3e338ef2f9e54fa89849325760987 /include/ui/InputTransport.h
parentbbc1e52b77453f90050e71328a97ca73a8b8ba08 (diff)
downloadframeworks_native-4d96bb6ae38466a04acfbcce61cb202786239927.zip
frameworks_native-4d96bb6ae38466a04acfbcce61cb202786239927.tar.gz
frameworks_native-4d96bb6ae38466a04acfbcce61cb202786239927.tar.bz2
First stab at attaching native event dispatching.
Provides the basic infrastructure for a NativeActivity's native code to get an object representing its event stream that can be used to read input events. Still work to do, probably some API changes, and reasonable default key handling (so that for example back will still work). Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
Diffstat (limited to 'include/ui/InputTransport.h')
-rw-r--r--include/ui/InputTransport.h20
1 files changed, 20 insertions, 0 deletions
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