diff options
author | 2012-06-30 08:53:33 +0900 | |
---|---|---|
committer | 2012-07-02 20:20:42 +0900 | |
commit | 8658e552f350167bb8f5af7b9e991775f2cc6a6d (patch) | |
tree | dd2045310f65d25f74ad9ef390595620b72a397a /native/jni/src/gesture/impl/gesture_decoder_impl.cpp | |
parent | 26c45718a595e96a3fffd4fc6307e926a8c2ad70 (diff) | |
download | latinime-8658e552f350167bb8f5af7b9e991775f2cc6a6d.tar.gz latinime-8658e552f350167bb8f5af7b9e991775f2cc6a6d.tar.xz latinime-8658e552f350167bb8f5af7b9e991775f2cc6a6d.zip |
Makefile and source code structure update for LatinIME AOSP build
Change-Id: Ia2ab54651ef96521fce01fe4755147909b818803
Diffstat (limited to 'native/jni/src/gesture/impl/gesture_decoder_impl.cpp')
-rw-r--r-- | native/jni/src/gesture/impl/gesture_decoder_impl.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/native/jni/src/gesture/impl/gesture_decoder_impl.cpp b/native/jni/src/gesture/impl/gesture_decoder_impl.cpp index 59937a4d8..035850ead 100644 --- a/native/jni/src/gesture/impl/gesture_decoder_impl.cpp +++ b/native/jni/src/gesture/impl/gesture_decoder_impl.cpp @@ -15,7 +15,26 @@ */ #include "gesture_decoder_impl.h" +#include "incremental_decoder_interface.h" namespace latinime { + +// A factory method for GestureDecoderImpl +static IncrementalDecoderInterface *getDecoderInstance(int maxWordLength, int maxWords) { + return new GestureDecoderImpl(maxWordLength, maxWords); +} + +// An ad-hoc internal class to register the factory method defined above +class GestureDecoderFactoryRegisterer { + public: + GestureDecoderFactoryRegisterer() { + IncrementalDecoderInterface::setGestureDecoderFactoryMethod(getDecoderInstance); + } + private: + DISALLOW_COPY_AND_ASSIGN(GestureDecoderFactoryRegisterer); }; -// namespace latinime + +// To invoke the GestureDecoderFactoryRegisterer constructor in the global constructor +// Not sure, but can be static? +GestureDecoderFactoryRegisterer gestureDecoderFactoryRegisterer; +} // namespace latinime |