summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2010-07-13 17:48:30 -0700
committer Dianne Hackborn <hackbod@google.com> 2010-07-13 18:36:46 -0700
commitce838a265d9da5b4bd3a0c833b01db6dbaa623f5 (patch)
tree3fd61e9ba4fb0a9233bc1c3e9971f16f9fc816dd
parent8575a87b0d61d21c286321afdf193f4fac53d681 (diff)
IME events are now dispatched to native applications.
And also: - APIs to show and hide the IME, and control its interaction with the app. - APIs to tell the app when its window resizes and needs to be redrawn. - API to tell the app the content rectangle of its window (to layout around the IME or status bar). There is still a problem with IME interaction -- we need a way for the app to deliver events to the IME before it handles them, so that for example the back key will close the IME instead of finishing the app. Change-Id: I37b75fc2ec533750ef36ca3aedd2f0cc0b5813cd
-rw-r--r--include/ui/Input.h4
-rw-r--r--include/ui/InputTransport.h26
-rw-r--r--libs/ui/InputTransport.cpp19
3 files changed, 3 insertions, 46 deletions
diff --git a/include/ui/Input.h b/include/ui/Input.h
index a2e0ba06a2..a7d23d4854 100644
--- a/include/ui/Input.h
+++ b/include/ui/Input.h
@@ -43,7 +43,9 @@ enum {
/*
* Declare a concrete type for the NDK's input event forward declaration.
*/
-struct AInputEvent { };
+struct AInputEvent {
+ virtual ~AInputEvent() { }
+};
namespace android {
diff --git a/include/ui/InputTransport.h b/include/ui/InputTransport.h
index 11714d5362..226d1d5a4b 100644
--- a/include/ui/InputTransport.h
+++ b/include/ui/InputTransport.h
@@ -331,30 +331,4 @@ private:
} // namespace android
-/*
- * NDK input queue API.
- */
-struct AInputQueue {
-public:
- /* Creates a consumer associated with an input channel. */
- explicit AInputQueue(const android::sp<android::InputChannel>& channel);
-
- /* Destroys the consumer and releases its input channel. */
- virtual ~AInputQueue();
-
- inline android::InputConsumer& getConsumer() { return mConsumer; }
-
- android::status_t consume(android::InputEvent** event);
-
- void setPollLoop(const android::sp<android::PollLoop>& pollLoop) { mPollLoop = pollLoop; }
- const android::sp<android::PollLoop> getPollLoop() const { return mPollLoop; }
-
- virtual void doDefaultKey(android::KeyEvent* keyEvent) = 0;
-
-private:
- android::InputConsumer mConsumer;
- android::PreallocatedInputEventFactory mInputEventFactory;
- android::sp<android::PollLoop> mPollLoop;
-};
-
#endif // _UI_INPUT_TRANSPORT_H
diff --git a/libs/ui/InputTransport.cpp b/libs/ui/InputTransport.cpp
index 25def3c18c..fc83e316de 100644
--- a/libs/ui/InputTransport.cpp
+++ b/libs/ui/InputTransport.cpp
@@ -690,22 +690,3 @@ void InputConsumer::populateMotionEvent(MotionEvent* motionEvent) const {
}
} // namespace android
-
-// --- AInputQueue ---
-
-using android::InputEvent;
-using android::InputChannel;
-using android::InputConsumer;
-using android::sp;
-using android::status_t;
-
-AInputQueue::AInputQueue(const sp<InputChannel>& channel) :
- mConsumer(channel) {
-}
-
-AInputQueue::~AInputQueue() {
-}
-
-status_t AInputQueue::consume(InputEvent** event) {
- return mConsumer.consume(&mInputEventFactory, event);
-}