diff --git a/native/jni/Android.mk b/native/jni/Android.mk index 9c1ac63462c7af15d334b11642214881a0a20e08..463cd71da3d6861cdee63f286482266e220fb614 100644 --- a/native/jni/Android.mk +++ b/native/jni/Android.mk @@ -26,12 +26,7 @@ include $(CLEAR_VARS) LATIN_IME_SRC_DIR := src LATIN_IME_SRC_FULLPATH_DIR := $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) -LOCAL_C_INCLUDES += \ - $(LATIN_IME_SRC_FULLPATH_DIR) \ - $(LATIN_IME_SRC_FULLPATH_DIR)/suggest \ - $(LATIN_IME_SRC_FULLPATH_DIR)/suggest/core \ - $(addprefix $(LATIN_IME_SRC_FULLPATH_DIR)/suggest/core/, dicnode dictionary policy session) \ - $(addprefix $(LATIN_IME_SRC_FULLPATH_DIR)/suggest/policyimpl/, gesture typing) +LOCAL_C_INCLUDES += $(LATIN_IME_SRC_FULLPATH_DIR) LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \ -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers @@ -65,18 +60,20 @@ LATIN_IME_CORE_SRC_FILES := \ proximity_info_state_utils.cpp \ unigram_dictionary.cpp \ words_priority_queue.cpp \ - suggest/core/dicnode/dic_node.cpp \ - suggest/core/dicnode/dic_nodes_cache.cpp \ - suggest/core/dicnode/dic_node_utils.cpp \ + $(addprefix suggest/core/dicnode/, \ + dic_node.cpp \ + dic_node_utils.cpp \ + dic_nodes_cache.cpp) \ + suggest/core/suggest.cpp \ suggest/core/policy/weighting.cpp \ suggest/core/session/dic_traverse_session.cpp \ - suggest/core/suggest.cpp \ suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp \ - suggest/policyimpl/typing/scoring_params.cpp \ - suggest/policyimpl/typing/typing_scoring.cpp \ - suggest/policyimpl/typing/typing_suggest_policy.cpp \ - suggest/policyimpl/typing/typing_traversal.cpp \ - suggest/policyimpl/typing/typing_weighting.cpp + $(addprefix suggest/policyimpl/typing/, \ + scoring_params.cpp \ + typing_scoring.cpp \ + typing_suggest_policy.cpp \ + typing_traversal.cpp \ + typing_weighting.cpp) LOCAL_SRC_FILES := \ $(LATIN_IME_JNI_SRC_FILES) \ diff --git a/native/jni/jni_common.cpp b/native/jni/jni_common.cpp index 1ea204102a8a3acef4358d738e2be2358acfef12..8e5c508801a39f106fd9efd909e0c0554c124bd9 100644 --- a/native/jni/jni_common.cpp +++ b/native/jni/jni_common.cpp @@ -16,12 +16,12 @@ #define LOG_TAG "LatinIME: jni" +#include "jni_common.h" + #include "com_android_inputmethod_keyboard_ProximityInfo.h" #include "com_android_inputmethod_latin_BinaryDictionary.h" #include "com_android_inputmethod_latin_DicTraverseSession.h" #include "defines.h" -#include "jni.h" -#include "jni_common.h" /* * Returns the JNI version on success, -1 on failure. diff --git a/native/jni/src/dictionary.cpp b/native/jni/src/dictionary.cpp index 12aca4a872e4bcd385f4436470fc27bd4e561dad..ed6ddb517217a4d1d2436bcbcbc866119ad829f7 100644 --- a/native/jni/src/dictionary.cpp +++ b/native/jni/src/dictionary.cpp @@ -16,17 +16,18 @@ #define LOG_TAG "LatinIME: dictionary.cpp" +#include "dictionary.h" + #include <map> // TODO: remove #include <stdint.h> #include "bigram_dictionary.h" #include "binary_format.h" #include "defines.h" -#include "dictionary.h" #include "dic_traverse_wrapper.h" -#include "gesture_suggest_policy_factory.h" -#include "suggest.h" -#include "typing_suggest_policy_factory.h" +#include "suggest/core/suggest.h" +#include "suggest/policyimpl/gesture/gesture_suggest_policy_factory.h" +#include "suggest/policyimpl/typing/typing_suggest_policy_factory.h" #include "unigram_dictionary.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dictionary/shortcut_utils.h b/native/jni/src/suggest/core/dictionary/shortcut_utils.h index e592136cc33c305ec2a53cb9276f46c701879016..c411408ec43343b6ab01ccd75e7c9a7803ff8a6b 100644 --- a/native/jni/src/suggest/core/dictionary/shortcut_utils.h +++ b/native/jni/src/suggest/core/dictionary/shortcut_utils.h @@ -18,7 +18,7 @@ #define LATINIME_SHORTCUT_UTILS #include "defines.h" -#include "dic_node_utils.h" +#include "suggest/core/dicnode/dic_node_utils.h" #include "terminal_attributes.h" namespace latinime { diff --git a/native/jni/src/suggest/core/policy/traversal.h b/native/jni/src/suggest/core/policy/traversal.h index 1d5082ff87075ae8ac3dfc38be0903855b8b333b..02c358aec77ef95a613e6a4aeda5a393025a5fa2 100644 --- a/native/jni/src/suggest/core/policy/traversal.h +++ b/native/jni/src/suggest/core/policy/traversal.h @@ -20,6 +20,9 @@ #include "defines.h" namespace latinime { + +class DicTraverseSession; + class Traversal { public: virtual int getMaxPointerCount() const = 0; diff --git a/native/jni/src/suggest/core/policy/weighting.cpp b/native/jni/src/suggest/core/policy/weighting.cpp index 4d08fa0fa9d9319e3c395ff4650048ebf97badae..e62b70423dfb6c557ab80b410a804d7c750bee7c 100644 --- a/native/jni/src/suggest/core/policy/weighting.cpp +++ b/native/jni/src/suggest/core/policy/weighting.cpp @@ -14,14 +14,15 @@ * limitations under the License. */ +#include "suggest/core/policy/weighting.h" + #include "char_utils.h" #include "defines.h" -#include "dic_node.h" -#include "dic_node_profiler.h" -#include "dic_node_utils.h" -#include "dic_traverse_session.h" #include "hash_map_compat.h" -#include "weighting.h" +#include "suggest/core/dicnode/dic_node.h" +#include "suggest/core/dicnode/dic_node_profiler.h" +#include "suggest/core/dicnode/dic_node_utils.h" +#include "suggest/core/session/dic_traverse_session.h" namespace latinime { diff --git a/native/jni/src/suggest/core/policy/weighting.h b/native/jni/src/suggest/core/policy/weighting.h index 83a0f4b450688a2fc083eb81c6fd43889e68b82b..b92dbe278ad74fcf5af3a8604ffa243d0b46bdd7 100644 --- a/native/jni/src/suggest/core/policy/weighting.h +++ b/native/jni/src/suggest/core/policy/weighting.h @@ -18,6 +18,7 @@ #define LATINIME_WEIGHTING_H #include "defines.h" +#include "hash_map_compat.h" namespace latinime { diff --git a/native/jni/src/suggest/core/session/dic_traverse_session.cpp b/native/jni/src/suggest/core/session/dic_traverse_session.cpp index 1f781dd430d71f1e6488514ce144bf7458625e87..ef6616e40160019ce913c81ebae0b01e175a7ae4 100644 --- a/native/jni/src/suggest/core/session/dic_traverse_session.cpp +++ b/native/jni/src/suggest/core/session/dic_traverse_session.cpp @@ -14,12 +14,13 @@ * limitations under the License. */ +#include "suggest/core/session/dic_traverse_session.h" + #include "defines.h" #include "dictionary.h" -#include "dic_node_utils.h" -#include "dic_traverse_session.h" #include "dic_traverse_wrapper.h" #include "jni.h" +#include "suggest/core/dicnode/dic_node_utils.h" namespace latinime { diff --git a/native/jni/src/suggest/core/session/dic_traverse_session.h b/native/jni/src/suggest/core/session/dic_traverse_session.h index af036f82bb5d3a35ae6755b4b8ba220e48f3eae6..62e1d1ab9f61a4143d6c32c3e59e14c0d44ea409 100644 --- a/native/jni/src/suggest/core/session/dic_traverse_session.h +++ b/native/jni/src/suggest/core/session/dic_traverse_session.h @@ -21,10 +21,10 @@ #include <vector> #include "defines.h" -#include "dic_nodes_cache.h" #include "hash_map_compat.h" #include "jni.h" #include "proximity_info_state.h" +#include "suggest/core/dicnode/dic_nodes_cache.h" namespace latinime { diff --git a/native/jni/src/suggest/core/suggest.cpp b/native/jni/src/suggest/core/suggest.cpp index 7fba1d50455829ec029218301a463090839a572f..1e97a917622ae07e2350aafe50f278d555c66b01 100644 --- a/native/jni/src/suggest/core/suggest.cpp +++ b/native/jni/src/suggest/core/suggest.cpp @@ -14,18 +14,20 @@ * limitations under the License. */ +#include "suggest/core/suggest.h" + #include "char_utils.h" #include "dictionary.h" -#include "dic_node_priority_queue.h" -#include "dic_node_vector.h" -#include "dic_traverse_session.h" #include "proximity_info.h" -#include "scoring.h" -#include "shortcut_utils.h" -#include "suggest.h" +#include "suggest/core/dicnode/dic_node.h" +#include "suggest/core/dicnode/dic_node_priority_queue.h" +#include "suggest/core/dicnode/dic_node_vector.h" +#include "suggest/core/dictionary/shortcut_utils.h" +#include "suggest/core/policy/scoring.h" +#include "suggest/core/policy/traversal.h" +#include "suggest/core/policy/weighting.h" +#include "suggest/core/session/dic_traverse_session.h" #include "terminal_attributes.h" -#include "traversal.h" -#include "weighting.h" namespace latinime { diff --git a/native/jni/src/suggest/core/suggest.h b/native/jni/src/suggest/core/suggest.h index 75d646bdd72f4e7bb89251c46c1467fc4c427a4f..a1e7e7a945179a68aeafe26bd742aebf817bb333 100644 --- a/native/jni/src/suggest/core/suggest.h +++ b/native/jni/src/suggest/core/suggest.h @@ -18,8 +18,8 @@ #define LATINIME_SUGGEST_IMPL_H #include "defines.h" -#include "suggest_interface.h" -#include "suggest_policy.h" +#include "suggest/core/suggest_interface.h" +#include "suggest/core/policy/suggest_policy.h" namespace latinime { diff --git a/native/jni/src/suggest/policyimpl/typing/scoring_params.cpp b/native/jni/src/suggest/policyimpl/typing/scoring_params.cpp index 90985d0fe589153650f7585319e88ea39cff8491..0fa684f019e693ec8898113bda3bb7424d13a77d 100644 --- a/native/jni/src/suggest/policyimpl/typing/scoring_params.cpp +++ b/native/jni/src/suggest/policyimpl/typing/scoring_params.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "scoring_params.h" +#include "suggest/policyimpl/typing/scoring_params.h" namespace latinime { // TODO: RENAME all diff --git a/native/jni/src/suggest/policyimpl/typing/typing_scoring.cpp b/native/jni/src/suggest/policyimpl/typing/typing_scoring.cpp index 53f68f20f5cb5a4b3e9009fc61e71c87bf95310d..d8c6175e22d101c7ed0868750081390c3a0a3766 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_scoring.cpp +++ b/native/jni/src/suggest/policyimpl/typing/typing_scoring.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "typing_scoring.h" +#include "suggest/policyimpl/typing/typing_scoring.h" namespace latinime { const TypingScoring TypingScoring::sInstance; diff --git a/native/jni/src/suggest/policyimpl/typing/typing_scoring.h b/native/jni/src/suggest/policyimpl/typing/typing_scoring.h index ed941f0ae9ee2f82144a4bb519970dc5dab2e194..90e2133e7ec889ee0d9f54925c9f311c2c5834ac 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_scoring.h +++ b/native/jni/src/suggest/policyimpl/typing/typing_scoring.h @@ -18,8 +18,8 @@ #define LATINIME_TYPING_SCORING_H #include "defines.h" -#include "scoring.h" -#include "scoring_params.h" +#include "suggest/core/policy/scoring.h" +#include "suggest/policyimpl/typing/scoring_params.h" namespace latinime { diff --git a/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.cpp b/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.cpp index cdde626d8f667cdd209261c46af3753b3c488764..0c2763967556944ed2c9755e6b2788aecd4fc274 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.cpp +++ b/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "typing_suggest_policy.h" +#include "suggest/policyimpl/typing/typing_suggest_policy.h" namespace latinime { const TypingSuggestPolicy TypingSuggestPolicy::sInstance; diff --git a/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.h b/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.h index 55668fc252a8bd24ef6d2a2ed5c3374d288a75fc..35f48097c9c33ef6d806f9678b7027351dbf2785 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.h +++ b/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.h @@ -18,10 +18,10 @@ #define LATINIME_TYPING_SUGGEST_POLICY_H #include "defines.h" -#include "suggest_policy.h" -#include "typing_scoring.h" -#include "typing_traversal.h" -#include "typing_weighting.h" +#include "suggest/core/policy/suggest_policy.h" +#include "suggest/policyimpl/typing/typing_scoring.h" +#include "suggest/policyimpl/typing/typing_traversal.h" +#include "suggest/policyimpl/typing/typing_weighting.h" namespace latinime { diff --git a/native/jni/src/suggest/policyimpl/typing/typing_traversal.cpp b/native/jni/src/suggest/policyimpl/typing/typing_traversal.cpp index 68c614e77be87f02f5f5a96b68d3cea363f39892..66f8ba9fa99ef29a41018d57eb4a9bc03d311457 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_traversal.cpp +++ b/native/jni/src/suggest/policyimpl/typing/typing_traversal.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "typing_traversal.h" +#include "suggest/policyimpl/typing/typing_traversal.h" namespace latinime { const bool TypingTraversal::CORRECT_OMISSION = true; diff --git a/native/jni/src/suggest/policyimpl/typing/typing_traversal.h b/native/jni/src/suggest/policyimpl/typing/typing_traversal.h index 16153f8bb37d0e5a90d899ed69fa3f33c169df81..f22029a2ccd650bc4c4c7cbf32279dd0efaeaa9e 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_traversal.h +++ b/native/jni/src/suggest/policyimpl/typing/typing_traversal.h @@ -21,12 +21,12 @@ #include "char_utils.h" #include "defines.h" -#include "dic_node.h" -#include "dic_node_vector.h" -#include "dic_traverse_session.h" #include "proximity_info_state.h" -#include "scoring_params.h" -#include "traversal.h" +#include "suggest/core/dicnode/dic_node.h" +#include "suggest/core/dicnode/dic_node_vector.h" +#include "suggest/core/policy/traversal.h" +#include "suggest/core/session/dic_traverse_session.h" +#include "suggest/policyimpl/typing/scoring_params.h" namespace latinime { class TypingTraversal : public Traversal { diff --git a/native/jni/src/suggest/policyimpl/typing/typing_weighting.cpp b/native/jni/src/suggest/policyimpl/typing/typing_weighting.cpp index 6e4b2fb6adf902f063c56dcfe9b6d1fa2b68436b..1500341bdd9a7fff721e83c6a8fc7749ddd7f257 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_weighting.cpp +++ b/native/jni/src/suggest/policyimpl/typing/typing_weighting.cpp @@ -14,9 +14,10 @@ * limitations under the License. */ -#include "dic_node.h" -#include "scoring_params.h" -#include "typing_weighting.h" +#include "suggest/policyimpl/typing/typing_weighting.h" + +#include "suggest/core/dicnode/dic_node.h" +#include "suggest/policyimpl/typing/scoring_params.h" namespace latinime { const TypingWeighting TypingWeighting::sInstance; diff --git a/native/jni/src/suggest/policyimpl/typing/typing_weighting.h b/native/jni/src/suggest/policyimpl/typing/typing_weighting.h index e8075f41a42f6325f5150f59d7c7d5f95a817aae..52d54eb0f17b07be62dd05e814ed08df479d3f99 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_weighting.h +++ b/native/jni/src/suggest/policyimpl/typing/typing_weighting.h @@ -18,9 +18,10 @@ #define LATINIME_TYPING_WEIGHTING_H #include "defines.h" -#include "dic_node_utils.h" -#include "dic_traverse_session.h" -#include "weighting.h" +#include "suggest/core/dicnode/dic_node_utils.h" +#include "suggest/core/policy/weighting.h" +#include "suggest/core/session/dic_traverse_session.h" +#include "suggest/policyimpl/typing/scoring_params.h" namespace latinime {