From: dyamy-lee Date: Thu, 8 Sep 2022 01:04:01 +0000 (+0900) Subject: replace name of result_cb to mmi_result_cb X-Git-Tag: accepted/tizen/unified/20220927.132357~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F281608%2F1;p=platform%2Fcore%2Fuifw%2Fmmi-framework.git replace name of result_cb to mmi_result_cb it chang the name of result_cb to mmi_result_cb for reducing unclear, especially consider ACR Change-Id: I9ef921a7f57b47d532a84ea77b8f311a922a3816 --- diff --git a/src/mmi-client.c b/src/mmi-client.c index 2685017..b363e32 100644 --- a/src/mmi-client.c +++ b/src/mmi-client.c @@ -57,7 +57,7 @@ int mmi_client_destroy(void) mmi_ipc_shutdown(); GList *iter = NULL; - result_cb_s *data = NULL; + mmi_result_cb_s *data = NULL; if (g_list_length(mmi_h->result_cb_list) > 0) { iter = g_list_first(mmi_h->result_cb_list); @@ -82,7 +82,7 @@ int mmi_client_destroy(void) return MMI_ERROR_NONE; } -int mmi_client_set_result_cb(int input_event_type, result_cb callback, void* user_data) +int mmi_client_set_result_cb(int input_event_type, mmi_result_cb callback, void* user_data) { LOGI("Set result cb about input event type(%d) to client", input_event_type); @@ -91,7 +91,7 @@ int mmi_client_set_result_cb(int input_event_type, result_cb callback, void* use return MMI_ERROR_INVALID_PARAMETER; } - result_cb_s* input_result_callback = (result_cb_s*)calloc(1, sizeof(result_cb_s)); + mmi_result_cb_s* input_result_callback = (mmi_result_cb_s*)calloc(1, sizeof(mmi_result_cb_s)); if (input_result_callback == NULL) { LOGE("[ERROR] Fail to allocate memory"); return MMI_ERROR_OUT_OF_MEMORY; diff --git a/src/mmi-client.h b/src/mmi-client.h index d59b66f..6f5cc81 100644 --- a/src/mmi-client.h +++ b/src/mmi-client.h @@ -34,9 +34,8 @@ typedef mmi_struct_s* mmi_handle; typedef struct { int input_event_type; - int input_event_state; - result_cb result_callback; -} result_cb_s; + mmi_result_cb result_callback; +} mmi_result_cb_s; #ifdef __cplusplus extern "C" { @@ -44,7 +43,7 @@ extern "C" { int mmi_client_create(void); int mmi_client_destroy(void); -int mmi_client_set_result_cb(int input_event_type, result_cb callback, void* user_data); +int mmi_client_set_result_cb(int input_event_type, mmi_result_cb callback, void* user_data); mmi_handle mmi_client_get(void); #ifdef __cplusplus diff --git a/src/mmi.c b/src/mmi.c index f0f1b07..284f6a0 100644 --- a/src/mmi.c +++ b/src/mmi.c @@ -41,7 +41,7 @@ MMI_API int mmi_deinitialize(void) return MMI_ERROR_NONE; } -MMI_API int mmi_set_result_cb(int input_event_type, result_cb callback, void* user_data) +MMI_API int mmi_set_result_cb(int input_event_type, mmi_result_cb callback, void* user_data) { LOGI("Set result cb about input event type(%d)", input_event_type); diff --git a/src/mmi.h b/src/mmi.h index 2fd64db..9cbb665 100644 --- a/src/mmi.h +++ b/src/mmi.h @@ -43,7 +43,7 @@ typedef enum { MMI_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< MMI NOT supported */ } mmi_error_e; -typedef void (*result_cb)(void *user_data, int input_event_type, const char *result_out); +typedef void (*mmi_result_cb)(void *user_data, int input_event_type, const char *result_out); typedef enum { MMI_VOICE_TOUCH, @@ -56,7 +56,7 @@ extern "C" { MMI_API int mmi_initialize(void); MMI_API int mmi_deinitialize(void); -MMI_API int mmi_set_result_cb(int input_event_type, result_cb callback, void* user_data); +MMI_API int mmi_set_result_cb(int input_event_type, mmi_result_cb callback, void* user_data); #ifdef __cplusplus } diff --git a/tests/mmi-main-test.cpp b/tests/mmi-main-test.cpp index a8ac6bc..4bcea40 100644 --- a/tests/mmi-main-test.cpp +++ b/tests/mmi-main-test.cpp @@ -76,11 +76,11 @@ TEST_F(MMIMainTest, MMIClientSetResultCbSuccess) mmi_handle mmi_client = mmi_client_get(); GList* iter = NULL; - result_cb_s *data = NULL; + mmi_result_cb_s *data = NULL; iter = g_list_first(mmi_client->result_cb_list); if(NULL != iter) { - data = (result_cb_s*)iter->data; + data = (mmi_result_cb_s*)iter->data; EXPECT_NE(data->result_callback, nullptr); EXPECT_EQ(data->result_callback, voice_touch_callback); EXPECT_EQ(data->input_event_type, input_event_type);