From b68e73448104714e8f12f89a1e00fb10b5fd14c4 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Mon, 8 Apr 2013 17:08:19 +0900 Subject: [PATCH] Cleanup the include paths Change-Id: Ic93d39e230170cfc9f5be6d81d42006e1a61e347 --- native/jni/Android.mk | 27 +++++++++---------- native/jni/jni_common.cpp | 4 +-- native/jni/src/dictionary.cpp | 9 ++++--- .../suggest/core/dictionary/shortcut_utils.h | 2 +- .../jni/src/suggest/core/policy/traversal.h | 3 +++ .../jni/src/suggest/core/policy/weighting.cpp | 11 ++++---- .../jni/src/suggest/core/policy/weighting.h | 1 + .../core/session/dic_traverse_session.cpp | 5 ++-- .../core/session/dic_traverse_session.h | 2 +- native/jni/src/suggest/core/suggest.cpp | 18 +++++++------ native/jni/src/suggest/core/suggest.h | 4 +-- .../policyimpl/typing/scoring_params.cpp | 2 +- .../policyimpl/typing/typing_scoring.cpp | 2 +- .../policyimpl/typing/typing_scoring.h | 4 +-- .../typing/typing_suggest_policy.cpp | 2 +- .../policyimpl/typing/typing_suggest_policy.h | 8 +++--- .../policyimpl/typing/typing_traversal.cpp | 2 +- .../policyimpl/typing/typing_traversal.h | 10 +++---- .../policyimpl/typing/typing_weighting.cpp | 7 ++--- .../policyimpl/typing/typing_weighting.h | 7 ++--- 20 files changed, 69 insertions(+), 61 deletions(-) diff --git a/native/jni/Android.mk b/native/jni/Android.mk index 9c1ac6346..463cd71da 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 1ea204102..8e5c50880 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 12aca4a87..ed6ddb517 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 // TODO: remove #include #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 e592136cc..c411408ec 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 1d5082ff8..02c358aec 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 4d08fa0fa..e62b70423 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 83a0f4b45..b92dbe278 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 1f781dd43..ef6616e40 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 af036f82b..62e1d1ab9 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 #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 7fba1d504..1e97a9176 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 75d646bdd..a1e7e7a94 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 90985d0fe..0fa684f01 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 53f68f20f..d8c6175e2 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 ed941f0ae..90e2133e7 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 cdde626d8..0c2763967 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 55668fc25..35f48097c 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 68c614e77..66f8ba9fa 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 16153f8bb..f22029a2c 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 6e4b2fb6a..1500341bd 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 e8075f41a..52d54eb0f 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 {