From 6ccd0b39eb23d02b479b87327698a5fb130dc59b Mon Sep 17 00:00:00 2001 From: JuWan Kim Date: Tue, 17 Mar 2015 16:25:21 +0900 Subject: [PATCH] Change c to cpp in ./ug/network * Changing to cpp is done. Change-Id: I18227bae986d87b8e11e3598b2fbd342ecb96a81 Signed-off-by: JuWan Kim --- ug/network/CMakeLists.txt | 18 ++--- .../src/{connection_mgr.c => connection_mgr.cpp} | 14 ++-- .../src/{ip_setting_view.c => ip_setting_view.cpp} | 88 +++++++++++----------- ug/network/src/{main_view.c => main_view.cpp} | 81 ++++++++------------ .../src/{network_viewmgr.c => network_viewmgr.cpp} | 17 +++-- ..._network_settings.c => ug_network_settings.cpp} | 18 +++-- ug/network/src/{util.c => util.cpp} | 0 ug/network/src/{vconf_mgr.c => vconf_mgr.cpp} | 0 ug/network/src/{wifi_mgr.c => wifi_mgr.cpp} | 28 +++---- ...wifi_passcode_view.c => wifi_passcode_view.cpp} | 43 +++++------ 10 files changed, 152 insertions(+), 155 deletions(-) rename ug/network/src/{connection_mgr.c => connection_mgr.cpp} (97%) rename ug/network/src/{ip_setting_view.c => ip_setting_view.cpp} (97%) rename ug/network/src/{main_view.c => main_view.cpp} (97%) rename ug/network/src/{network_viewmgr.c => network_viewmgr.cpp} (92%) rename ug/network/src/{ug_network_settings.c => ug_network_settings.cpp} (96%) rename ug/network/src/{util.c => util.cpp} (100%) rename ug/network/src/{vconf_mgr.c => vconf_mgr.cpp} (100%) rename ug/network/src/{wifi_mgr.c => wifi_mgr.cpp} (95%) rename ug/network/src/{wifi_passcode_view.c => wifi_passcode_view.cpp} (96%) diff --git a/ug/network/CMakeLists.txt b/ug/network/CMakeLists.txt index 64d88b6..e0df379 100644 --- a/ug/network/CMakeLists.txt +++ b/ug/network/CMakeLists.txt @@ -47,15 +47,15 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=hidden -Wall -W SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}") SET(SRCS - src/ug_network_settings.c - src/main_view.c - src/network_viewmgr.c - src/ip_setting_view.c - src/vconf_mgr.c - src/wifi_mgr.c - src/connection_mgr.c - src/util.c - src/wifi_passcode_view.c + src/ug_network_settings.cpp + src/main_view.cpp + src/network_viewmgr.cpp + src/ip_setting_view.cpp + src/vconf_mgr.cpp + src/wifi_mgr.cpp + src/connection_mgr.cpp + src/util.cpp + src/wifi_passcode_view.cpp ) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/ug/network/src/connection_mgr.c b/ug/network/src/connection_mgr.cpp similarity index 97% rename from ug/network/src/connection_mgr.c rename to ug/network/src/connection_mgr.cpp index 0c54513..f9da7c2 100644 --- a/ug/network/src/connection_mgr.c +++ b/ug/network/src/connection_mgr.cpp @@ -419,7 +419,7 @@ int connection_mgr_ip_dynamic_config( ret = connection_update_profile(connection, profile); if (ret != CONNECTION_ERROR_NONE) { _ERR("connection_update_profile failed, ret: %s.\n", - _convert_error_to_string(ret)); + _convert_error_to_string((connection_error_e) ret)); return RET_FAILED; } @@ -428,14 +428,14 @@ int connection_mgr_ip_dynamic_config( CONNECTION_IP_CONFIG_TYPE_DYNAMIC); if (ret != CONNECTION_ERROR_NONE) { _ERR("Fail to set ip method type[%s]\n", - _convert_error_to_string(ret)); + _convert_error_to_string((connection_error_e) ret)); return RET_FAILED; } ret = connection_update_profile(connection, profile); if (ret != CONNECTION_ERROR_NONE) { _ERR("connection_update_profile failed, ret: %s.\n", - _convert_error_to_string(ret)); + _convert_error_to_string((connection_error_e) ret)); return RET_FAILED; } @@ -533,7 +533,7 @@ int connection_mgr_set_ip_config( info->ip_addr); if (ret != CONNECTION_ERROR_NONE) { _ERR("set ip address fail, ret: %s\n", - _convert_error_to_string(ret)); + _convert_error_to_string((connection_error_e) ret)); return RET_FAILED; } @@ -542,7 +542,7 @@ int connection_mgr_set_ip_config( info->submask); if (ret != CONNECTION_ERROR_NONE) { _ERR("set subnet mask fail. %s\n", - _convert_error_to_string(ret)); + _convert_error_to_string((connection_error_e) ret)); return RET_FAILED; } @@ -551,7 +551,7 @@ int connection_mgr_set_ip_config( info->gateway); if (ret != CONNECTION_ERROR_NONE) { _ERR("set gateway address fail %s\n", - _convert_error_to_string(ret)); + _convert_error_to_string((connection_error_e) ret)); return RET_FAILED; } @@ -581,7 +581,7 @@ int connection_mgr_set_dns_config( info->dns); if (ret != CONNECTION_ERROR_NONE) { _ERR("set dns address fail %d\n", - _convert_error_to_string(ret)); + _convert_error_to_string((connection_error_e) ret)); return RET_FAILED; } diff --git a/ug/network/src/ip_setting_view.c b/ug/network/src/ip_setting_view.cpp similarity index 97% rename from ug/network/src/ip_setting_view.c rename to ug/network/src/ip_setting_view.cpp index 19fed36..5051c37 100644 --- a/ug/network/src/ip_setting_view.c +++ b/ug/network/src/ip_setting_view.cpp @@ -111,7 +111,7 @@ static struct _priv *_init_priv() { struct _priv *priv; - priv = calloc(1, sizeof(*priv)); + priv = (struct _priv *) calloc(1, sizeof(*priv)); return priv; } @@ -428,7 +428,7 @@ static void _popup_ok_cancel_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _del_confirm_popup(priv); @@ -534,7 +534,7 @@ static void _popup_dismissed_cb(void *data, Evas_Object *obj, void *ev) return; } - priv = data; + priv = (struct _priv *) data; _unset_layout_dim(priv); @@ -561,7 +561,7 @@ static void _ip_auto_mode_btn_clicked_cb(void *data, Evas_Object *obj, void *ev) return; } - priv = data; + priv = (struct _priv *) data; _disable_ip_btns(priv); @@ -595,7 +595,7 @@ static void _mode_sub_popup_dismissed_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _unset_layout_dim(priv); @@ -629,8 +629,8 @@ static void _mode_sub_popup_key_pressed_cb(void *data, Evas *evas, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -670,7 +670,7 @@ static void _ip_manual_mode_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _enable_ip_btns(priv); @@ -705,8 +705,8 @@ static void _ip_ctxpopup_key_pressed_cb(void *data, Evas *evas, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -742,8 +742,8 @@ static void _ctxpopup_pressed_cb(void *data, Evas *e, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -776,7 +776,7 @@ static void _ctxpopup_unfocused_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _unset_layout_dim(priv); evas_object_del(obj); @@ -846,7 +846,7 @@ static void _ip_setting_btn_clicked_cb(void *data, Evas_Object *obj, void *ev) return; } - priv = data; + priv = (struct _priv *) data; priv->cur_type = SETTING_IP; base = priv->base; @@ -1007,7 +1007,7 @@ static void _ip_btn_key_pressed_cb(void *data, Evas *evas, return; } - ev = ei; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -1076,22 +1076,22 @@ static void _set_the_value(struct _priv *priv) } value1 = NULL; - btn = evas_object_data_get(priv->config_popup, IP_VALUE1); + btn = (Evas_Object *) evas_object_data_get(priv->config_popup, IP_VALUE1); if (btn) value1 = elm_object_text_get(btn); value2 = NULL; - btn = evas_object_data_get(priv->config_popup, IP_VALUE2); + btn = (Evas_Object *) evas_object_data_get(priv->config_popup, IP_VALUE2); if (btn) value2 = elm_object_text_get(btn); value3 = NULL; - btn = evas_object_data_get(priv->config_popup, IP_VALUE3); + btn = (Evas_Object *) evas_object_data_get(priv->config_popup, IP_VALUE3); if (btn) value3 = elm_object_text_get(btn); value4 = NULL; - btn = evas_object_data_get(priv->config_popup, IP_VALUE4); + btn = (Evas_Object *) evas_object_data_get(priv->config_popup, IP_VALUE4); if (btn) value4 = elm_object_text_get(btn); @@ -1151,8 +1151,8 @@ static void _value_ctxpopup_key_pressed_cb(void *data, Evas *evas, return; } - ev = ei; - priv = data; + ev = (Evas_Event_Key_Down *) ei; + priv = (struct _priv *) data; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -1341,7 +1341,7 @@ static void _ip_address_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; priv->cur_type = SETTING_IP_ADDRESS; _create_value_popup(priv); @@ -1366,7 +1366,7 @@ static void _sub_mask_btn_clicked_cb(void *data, Evas_Object *obj, void *ev) return; } - priv = data; + priv = (struct _priv *) data; priv->cur_type = SETTING_SUBNET_MASK; _create_value_popup(priv); @@ -1391,7 +1391,7 @@ static void _gateway_btn_clicked_cb(void *data, Evas_Object *obj, void *ev) return; } - priv = data; + priv = (struct _priv *) data; priv->cur_type = SETTING_GATEWAY; _create_value_popup(priv); } @@ -1579,7 +1579,7 @@ static void _dns_auto_mode_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _disable_dns_btns(priv); @@ -1613,7 +1613,7 @@ static void _dns_manual_mode_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _enable_dns_btns(priv); @@ -1646,7 +1646,7 @@ static void _dns_ctxpopup_dismissed_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _unset_layout_dim(priv); @@ -1676,8 +1676,8 @@ static void _dns_ctxpopup_key_pressed_cb(void *data, Evas *evas, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -1717,7 +1717,7 @@ static void _dns_setting_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; priv->cur_type = SETTING_DNS; base = priv->base; @@ -1809,7 +1809,7 @@ static void _dns_server_btn_clicked_cb(void *data, Evas_Object *obj, void *ev) return; } - priv = data; + priv = (struct _priv *) data; priv->cur_type = SETTING_DNS_SERVER; _create_value_popup(priv); @@ -2232,7 +2232,7 @@ static void _retry_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _del_confirm_popup(priv); @@ -2359,7 +2359,7 @@ static void _ok_btn_clicked_cb(void *data, Evas_Object *obj, void *ev) return; } - priv = data; + priv = (struct _priv *) data; _config_network(priv); } @@ -2382,7 +2382,7 @@ static void _cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *ev) return; } - priv = data; + priv = (struct _priv *) data; if (priv && priv->vmgr) viewmgr_pop(priv->vmgr); @@ -2483,8 +2483,8 @@ static void _base_key_pressed_cb(void *data, Evas *evas, return; } - ev = ei; - priv = data; + ev = (Evas_Event_Key_Down *) ei; + priv = (struct _priv *) data; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -2528,7 +2528,7 @@ static Evas_Object *_create(struct viewmgr *vmgr, void *data) priv->ug = vmgr->ug; priv->vmgr = vmgr; - info = data; + info = (struct connection_info *) data; priv->connection = info->connection; priv->network_type = info->cur_type; priv->ap = info->ap; @@ -2599,7 +2599,7 @@ static void _destroy(Evas_Object *base) return; } - priv = evas_object_data_get(base, KEY_PRIV); + priv = (struct _priv *) evas_object_data_get(base, KEY_PRIV); if (!priv) return; @@ -2617,12 +2617,12 @@ static enum view_type _get_view_type(void) } static struct view_class _vclass = { - .create = _create, - .resume = NULL, - .pause = NULL, - .terminate = _destroy, - .message_handler = NULL, - .get_view_type = _get_view_type, + _create, + NULL, + NULL, + _destroy, + NULL, + _get_view_type, }; /** diff --git a/ug/network/src/main_view.c b/ug/network/src/main_view.cpp similarity index 97% rename from ug/network/src/main_view.c rename to ug/network/src/main_view.cpp index d795bc4..d2723c7 100644 --- a/ug/network/src/main_view.c +++ b/ug/network/src/main_view.cpp @@ -43,24 +43,9 @@ enum action_btn_enum { CLOSE }; -static char *action_button[] = { - [CONNECT] = TXT_CONNECT_BTN, - [REFRESH] = TXT_REFRESH_BTN, - [OTHER] = TXT_OTHER_BTN, - [CLOSE] = TXT_CLOSE_BTN -}; - -static char *button_swallow[] = { - [CONNECT] = PART_CONNECT_BTN, - [REFRESH] = PART_REFRESH_BTN, - [OTHER] = PART_OTHER_BTN, - [CLOSE] = PART_CLOSE_BTN -}; - -static char *popup_button[] = { - [TYPE_WIRELESS] = TXT_WIRELESS, - [TYPE_WIRED] = TXT_WIRED -}; +static char *action_button[4] = { TXT_CONNECT_BTN, TXT_REFRESH_BTN, TXT_OTHER_BTN, TXT_CLOSE_BTN }; +static char *button_swallow[4] = { PART_CONNECT_BTN, PART_REFRESH_BTN, PART_OTHER_BTN, PART_CLOSE_BTN }; +static char *popup_button[2] = { TXT_WIRELESS, TXT_WIRED }; struct _priv { ui_gadget_h ug; @@ -118,7 +103,7 @@ static struct _priv *_init_priv() { struct _priv *priv; - priv = calloc(1, sizeof(*priv)); + priv = (struct _priv *) calloc(1, sizeof(*priv)); if (!priv) { _ERR("calloc priv failed."); return NULL; @@ -283,8 +268,8 @@ static void _ctxpopup_pressed_cb(void *data, Evas *e, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -338,8 +323,8 @@ static void _main_ly_key_pressed_cb(void *data, Evas *e, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -667,7 +652,7 @@ static void _profie_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; if (priv->wired_conn) { elm_object_signal_emit(obj, SIG_STATE_UNSELECTED, ELM); @@ -821,7 +806,7 @@ static char *_item_ap_name_get(void *data, Evas_Object *obj, const char *part) return NULL; } - ap_info = data; + ap_info = (struct wifi_ap_info *) data; if (!strcmp(part, PART_ELM_TEXT)) return strdup(ap_info->essid); @@ -943,8 +928,8 @@ static void _item_select_cb(void *data, Evas_Object *obj, void *ei) return; } - priv = data; - gen_item = ei; + priv = (struct _priv *) data; + gen_item = (Elm_Object_Item *) ei; if (priv->last_item == gen_item) { elm_object_item_signal_emit(gen_item, SIG_STATE_UNSELECTED, ELM); @@ -972,7 +957,7 @@ static void _item_select_cb(void *data, Evas_Object *obj, void *ei) return; } - ap_info = eina_list_nth(priv->ap_list, index); + ap_info = (struct wifi_ap_info *) eina_list_nth(priv->ap_list, index); if (!ap_info) { _ERR("ap info is NULL."); return; @@ -1023,7 +1008,7 @@ static Eina_Bool _select_connected_cb(void *data) return ECORE_CALLBACK_CANCEL; } - priv = data; + priv = (struct _priv *) data; elm_object_item_signal_emit(priv->last_item, SIG_STATE_SELECTED, ELM); _enable_connect_btn(priv); @@ -1056,7 +1041,7 @@ static bool _wifi_found_ap_cb(wifi_ap_h ap, void *data) return EINA_FALSE; } - priv = data; + priv = (struct _priv *) data; ret = wifi_mgr_is_activated(&state); if (ret != WIFI_ERROR_NONE || state == 0) { @@ -1064,7 +1049,7 @@ static bool _wifi_found_ap_cb(wifi_ap_h ap, void *data) return EINA_FALSE; } - ap_info = calloc(1, sizeof(*ap_info)); + ap_info = (struct wifi_ap_info *) calloc(1, sizeof(*ap_info)); if (!ap_info) { _ERR("calloc failed"); return EINA_FALSE; @@ -1155,7 +1140,7 @@ static void _wifi_activated_cb(wifi_error_e result, void *data) return; } - priv = data; + priv = (struct _priv *) data; ret = wifi_mgr_scan_request(_wifi_scan_request_cb, data); if (ret != RET_SUCCESS) { @@ -1322,7 +1307,7 @@ static void _type_select_btn_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; value = elm_object_text_get(obj); if (!value) { @@ -1373,8 +1358,8 @@ static void _type_key_pressed_cb(void *data, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -1418,7 +1403,7 @@ static void _network_type_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; base = priv->base; _set_layout_dim(priv); @@ -1542,7 +1527,7 @@ static void _wifi_connected_cb(wifi_error_e error_code, void *user_data) return; } - priv = user_data; + priv = (struct _priv *) user_data; if (!priv->status_popup) return; @@ -1575,7 +1560,7 @@ static int _wifi_connect_ap(struct _priv *priv, int index) _show_progress_popup(priv); - ap_info = eina_list_nth(priv->ap_list, index); + ap_info = (struct wifi_ap_info *) eina_list_nth(priv->ap_list, index); if (!ap_info) { _ERR("ap info is NULL."); return RET_FAILED; @@ -1894,7 +1879,7 @@ static void _retry_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _del_status_popup(priv); @@ -1918,7 +1903,7 @@ static void _cancel_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _del_status_popup(priv); @@ -1942,7 +1927,7 @@ static void _ctxpopup_unfocused_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _unset_layout_dim(priv); @@ -2161,7 +2146,7 @@ static void _connect_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _connect_network(priv); } @@ -2183,7 +2168,7 @@ static void _refresh_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _clear_genlist_item_list(priv); @@ -2209,7 +2194,7 @@ static void _other_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; priv->cur_view = NETWORK_IP_SETTING_VIEW; @@ -2255,7 +2240,7 @@ static void _close_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; if (!priv->ug) return; @@ -2434,7 +2419,7 @@ static void _resume(Evas_Object *base) return; } - priv = evas_object_data_get(base, KEY_PRIV); + priv = (struct _priv *) evas_object_data_get(base, KEY_PRIV); if (!priv) { _ERR("priv got from base is NULL."); return; @@ -2471,7 +2456,7 @@ static void _message_handler(Evas_Object *base, return; } - priv = evas_object_data_get(base, KEY_PRIV); + priv = (struct _priv *) evas_object_data_get(base, KEY_PRIV); if (!priv) { _ERR("priv got from base is NULL."); return; @@ -2513,7 +2498,7 @@ static void _destroy(Evas_Object *base) return; } - priv = evas_object_data_get(base, KEY_PRIV); + priv = (struct _priv *) evas_object_data_get(base, KEY_PRIV); _fini_priv(priv); } diff --git a/ug/network/src/network_viewmgr.c b/ug/network/src/network_viewmgr.cpp similarity index 92% rename from ug/network/src/network_viewmgr.c rename to ug/network/src/network_viewmgr.cpp index 4fe384c..6534a2a 100644 --- a/ug/network/src/network_viewmgr.c +++ b/ug/network/src/network_viewmgr.cpp @@ -38,7 +38,7 @@ struct viewmgr *viewmgr_init() { struct viewmgr *vmgr; - vmgr = calloc(1, sizeof(*vmgr)); + vmgr = (struct viewmgr *) calloc(1, sizeof(*vmgr)); if (!vmgr) { _ERR("calloc vmgr failed."); return NULL; @@ -84,7 +84,7 @@ static void _view_deleted(void *data, Evas *e, Evas_Object *obj, void *ev) if (!data || !obj) return; - vclass = data; + vclass = (struct view_class *) data; if (vclass->terminate) vclass->terminate(obj); } @@ -108,7 +108,7 @@ Evas_Object *viewmgr_push(struct viewmgr *vmgr, if (!vmgr || !vmgr->win || !vclass || !vclass->create) return NULL; - vinfo = calloc(1, sizeof(*vinfo)); + vinfo = (struct _viewinfo *) calloc(1, sizeof(*vinfo)); if (!vinfo) return NULL; @@ -124,7 +124,7 @@ Evas_Object *viewmgr_push(struct viewmgr *vmgr, vinfo->vclass = vclass; vinfo->view_type = vclass->get_view_type(); - vinfo_pre = eina_list_data_get(vmgr->vlist); + vinfo_pre = (struct _viewinfo *) eina_list_data_get(vmgr->vlist); if (vinfo_pre && vinfo_pre->base && vinfo_pre->vclass->pause) vinfo_pre->vclass->pause(vinfo_pre->base); @@ -150,6 +150,7 @@ int viewmgr_send_message(struct viewmgr *vmgr, enum message_id msg_id, void *data) { struct _viewinfo *vinfo; + void *obj; struct view_class *vclass; Eina_List *list, *list_next; @@ -158,7 +159,9 @@ int viewmgr_send_message(struct viewmgr *vmgr, return RET_FAILED; } - EINA_LIST_FOREACH_SAFE(vmgr->vlist, list, list_next, vinfo) { + EINA_LIST_FOREACH_SAFE(vmgr->vlist, list, list_next, obj) { + vinfo = (struct _viewinfo *) obj; + if (!vinfo) { _ERR("vinfo is NULL."); continue; @@ -196,7 +199,7 @@ int viewmgr_pop(struct viewmgr *vmgr) return RET_FAILED; } - vinfo = eina_list_data_get(vmgr->vlist); + vinfo = (struct _viewinfo *) eina_list_data_get(vmgr->vlist); if (!vinfo) { _ERR("eina_list_data_get() failed."); return RET_FAILED; @@ -231,7 +234,7 @@ int viewmgr_resume(struct viewmgr *vmgr) return RET_FAILED; } - vinfo = eina_list_data_get(vmgr->vlist); + vinfo = (struct _viewinfo *) eina_list_data_get(vmgr->vlist); if (!vinfo || !vinfo->vclass || !vinfo->base) { _ERR("vinfo, vinfo->vclass, or vinfo->base is NULL."); return RET_FAILED; diff --git a/ug/network/src/ug_network_settings.c b/ug/network/src/ug_network_settings.cpp similarity index 96% rename from ug/network/src/ug_network_settings.c rename to ug/network/src/ug_network_settings.cpp index f3f38dc..6d117d5 100644 --- a/ug/network/src/ug_network_settings.c +++ b/ug/network/src/ug_network_settings.cpp @@ -27,6 +27,10 @@ #include "main_view.h" #include "network_viewmgr.h" +#if defined (__cplusplus) +extern "C" { +#endif + struct _ug_data { Evas_Object *win; Evas_Object *base; @@ -66,12 +70,12 @@ static void *_on_create(ui_gadget_h ug, enum ug_mode mode, return NULL; } - ugd = priv; + ugd = (struct _ug_data *) priv; ugd->ug = ug; elm_theme_extension_add(NULL, UG_NETWORK_EDJ_THEME); - win = ug_get_window(); + win = (Evas_Object *) ug_get_window(); if (!win) { _ERR("window get failed"); return NULL; @@ -172,7 +176,7 @@ static void _on_resume(ui_gadget_h ug, service_h service, void *priv) */ static void _on_destroy(ui_gadget_h ug, service_h service, void *priv) { - struct _ug_data *ugd = priv; + struct _ug_data *ugd = (struct _ug_data *) priv; if (!ug || !priv) { _ERR("Parameter error!"); @@ -259,7 +263,7 @@ UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) if (!ops) return -1; - ugd = calloc(1, sizeof(*ugd)); + ugd = (struct _ug_data *) calloc(1, sizeof(*ugd)); if (!ugd) return -1; @@ -294,7 +298,11 @@ UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) if (!ops) return; - ugd = ops->priv; + ugd = (struct _ug_data *) ops->priv; free(ugd); } + +#if defined (__cplusplus) +}; +#endif diff --git a/ug/network/src/util.c b/ug/network/src/util.cpp similarity index 100% rename from ug/network/src/util.c rename to ug/network/src/util.cpp diff --git a/ug/network/src/vconf_mgr.c b/ug/network/src/vconf_mgr.cpp similarity index 100% rename from ug/network/src/vconf_mgr.c rename to ug/network/src/vconf_mgr.cpp diff --git a/ug/network/src/wifi_mgr.c b/ug/network/src/wifi_mgr.cpp similarity index 95% rename from ug/network/src/wifi_mgr.c rename to ug/network/src/wifi_mgr.cpp index 7555aeb..d7b6aaa 100644 --- a/ug/network/src/wifi_mgr.c +++ b/ug/network/src/wifi_mgr.cpp @@ -116,7 +116,7 @@ int wifi_mgr_is_activated(bool *activated) ret = wifi_is_activated(activated); if (ret != WIFI_ERROR_NONE) { _ERR("Fail to wifi_is_activated %s\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } @@ -144,7 +144,7 @@ int wifi_mgr_scan_request(wifi_scan_finished_cb cb, void *data) ret = wifi_scan(cb, data); if (ret != WIFI_ERROR_NONE) { _ERR("Scan request failed [%s]\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } @@ -171,7 +171,7 @@ int wifi_mgr_foreach_found_aps(wifi_found_ap_cb cb, void *data) ret = wifi_foreach_found_aps(cb, data); if (ret != WIFI_ERROR_NONE) { - _ERR("Fail to get AP list %s.\n", wifi_mgr_error_dbg(ret)); + _ERR("Fail to get AP list %s.\n", wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } @@ -199,7 +199,7 @@ int wifi_mgr_activate(wifi_activated_cb cb, void *data) ret = wifi_activate(cb, data); if (ret != WIFI_ERROR_NONE) { _ERR("Fail to wifi_activate %s\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } @@ -346,14 +346,14 @@ int wifi_mgr_forget_last_ap(void) return RET_SUCCESS; } else if (ret != WIFI_ERROR_NONE) { _ERR("Fail to get connected AP [%s]\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } ret = wifi_ap_get_essid(ap, &name); if (ret != WIFI_ERROR_NONE) { _ERR("Fail to wifi_ap_get_essid AP [%s]\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); wifi_ap_destroy(ap); return RET_FAILED; } @@ -361,7 +361,7 @@ int wifi_mgr_forget_last_ap(void) ret = wifi_forget_ap(ap); if (ret != WIFI_ERROR_NONE) { _ERR("Fail to forget [%s],[%s].\n", name, - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); wifi_ap_destroy(ap); free(name); return RET_FAILED; @@ -393,7 +393,7 @@ int wifi_mgr_set_passphrase(wifi_ap_h ap, const char *passcode) ret = wifi_ap_set_passphrase(ap, passcode); if (ret != WIFI_ERROR_NONE) { _ERR("failed to set passcode. ret: %s.", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } @@ -423,7 +423,7 @@ int wifi_mgr_connect(wifi_ap_h ap, wifi_connected_cb cb, void *data) ret = wifi_connect(ap, cb, data); if (ret != WIFI_ERROR_NONE) { _ERR("failed to connect ap. ret: %s.", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } @@ -452,7 +452,7 @@ int wifi_mgr_ap_set_ip_config_type(wifi_ap_h ap, ret = wifi_ap_set_ip_config_type(ap, WIFI_ADDRESS_FAMILY_IPV4, type); if (ret != WIFI_ERROR_NONE) { _ERR("failed to connect ap. ret: %s.", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } @@ -542,19 +542,19 @@ int wifi_mgr_set_ip_config(wifi_ap_h ap, struct network_info *info) info->ip_addr); if (ret != WIFI_ERROR_NONE) _ERR("Fail to set ip address[%s]\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); ret = wifi_ap_set_subnet_mask(ap, WIFI_ADDRESS_FAMILY_IPV4, info->submask); if (ret != WIFI_ERROR_NONE) _ERR("Fail to set subnet mask[%s]\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); ret = wifi_ap_set_gateway_address(ap, WIFI_ADDRESS_FAMILY_IPV4, info->gateway); if (ret != WIFI_ERROR_NONE) _ERR("Fail to set gateway address[%s]\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_SUCCESS; } @@ -579,7 +579,7 @@ int wifi_mgr_set_dns_config(wifi_ap_h ap, struct network_info *info) info->dns); if (ret != WIFI_ERROR_NONE) { _ERR("Fail to set dns address[%s]\n", - wifi_mgr_error_dbg(ret)); + wifi_mgr_error_dbg((wifi_error_e) ret)); return RET_FAILED; } diff --git a/ug/network/src/wifi_passcode_view.c b/ug/network/src/wifi_passcode_view.cpp similarity index 96% rename from ug/network/src/wifi_passcode_view.c rename to ug/network/src/wifi_passcode_view.cpp index 0890265..dc5c936 100644 --- a/ug/network/src/wifi_passcode_view.c +++ b/ug/network/src/wifi_passcode_view.cpp @@ -65,7 +65,7 @@ static struct _priv *_init_priv(void) { struct _priv *priv; - priv = calloc(1, sizeof(*priv)); + priv = (struct _priv *) calloc(1, sizeof(*priv)); return priv; } @@ -176,8 +176,8 @@ static void _base_key_press_cb(void *data, Evas *e, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -230,7 +230,7 @@ static void _popup_ok_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; if (priv->ctxpopup) { evas_object_del(priv->ctxpopup); @@ -260,7 +260,7 @@ static void _ctxpopup_unfocused_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; _unset_layout_dim(priv); @@ -288,8 +288,8 @@ static void _ctxpopup_pressed_cb(void *data, Evas *e, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -401,7 +401,7 @@ static void _retry_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; if (priv->ctxpopup) { evas_object_del(priv->ctxpopup); @@ -438,7 +438,7 @@ static void _cancel_btn_clicked_cb(void *data, return; } - priv = data; + priv = (struct _priv *) data; if (priv->ctxpopup) { evas_object_del(priv->ctxpopup); @@ -649,7 +649,7 @@ static void _wifi_connected_cb(wifi_error_e error_code, void *user_data) return; } - priv = user_data; + priv = (struct _priv *) user_data; if (!priv->ctxpopup) return; @@ -683,7 +683,7 @@ static bool _wifi_found_ap_cb(wifi_ap_h ap, void *data) return false; } - priv = data; + priv = (struct _priv *) data; wifi_mgr_get_ap_info(ap, &ap_info); @@ -728,7 +728,7 @@ static void _wifi_scan_request_cb(wifi_error_e error_code, void *data) ret = wifi_mgr_foreach_found_aps(_wifi_found_ap_cb, data); if (ret != RET_SUCCESS) { _ERR("wifi_mgr_foreach_found_aps() failed."); - _show_confirm_popup(data); + _show_confirm_popup((struct _priv *) data); return; } } @@ -787,8 +787,8 @@ static void _entry_key_press_cb(void *data, Evas *e, return; } - priv = data; - ev = ei; + priv = (struct _priv *) data; + ev = (Evas_Event_Key_Down *) ei; if (!ev->keyname) { _ERR("ev->keyname is NULL."); @@ -888,7 +888,7 @@ static Evas_Object *_create(struct viewmgr *vmgr, void *data) priv->ug = vmgr->ug; priv->vmgr = vmgr; - ap_info = data; + ap_info = (struct wifi_ap_info *) data; strncpy(priv->ap_name, ap_info->essid, AP_NAME_LENTH); base = util_add_layout(priv->win, UG_NETWORK_EDJ_FILE, @@ -931,7 +931,7 @@ static void _destroy(Evas_Object *base) return; } - priv = evas_object_data_get(base, KEY_PRIV); + priv = (struct _priv *) evas_object_data_get(base, KEY_PRIV); if (!priv) return; @@ -950,11 +950,12 @@ static enum view_type _get_view_type(void) static struct view_class _vclass = { - .create = _create, - .resume = NULL, - .terminate = _destroy, - .message_handler = NULL, - .get_view_type = _get_view_type, + _create, + NULL, + NULL, + _destroy, + NULL, + _get_view_type, }; /** -- 2.7.4