capi-network-wifi
network)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations")
+
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
ecore
+wifi-efl-ug (0.5.2-6) precise; urgency=low
+
+ * Add managed idler & Fix build warnings
+ * Git: magnolia/apps/home/ug-wifi-efl
+ * Tag: wifi-efl-ug_0.5.2-5
+
+ -- sunil85.kim <isurit@sunil85.kim> Tue, 26 Mar 2013 12:22:31 +0900
+
wifi-efl-ug (0.5.2-5) precise; urgency=low
* Apply new UX for editfield widget
Name: wifi-efl-ug
Summary: Wi-Fi UI Gadget
-Version: 0.5.2_5
+Version: 0.5.2_6
Release: 1
Group: App/Network
License: Flora License
elm_object_item_signal_emit(entry_info->item, "elm,state,rename,show", "");
}
-static void _gl_eap_entry_eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+static void _gl_eap_entry_eraser_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
common_utils_entry_info_t *entry_info = (common_utils_entry_info_t *)data;
if (!entry_info)
common_utils_edit_box_focus_set(eap_data->eap_pw_item, EINA_FALSE);
ip_info_close_all_keypads(eap_data->ip_info_list);
- int i = 0;
+ unsigned int i = 0;
eap_type_t eap_type;
eap_auth_t auth_type;
INFO_LOG(UG_NAME_RESP, "depth = %d", eap_data->expandable_list_index);
__COMMON_FUNC_EXIT__;
}
-static Eina_Bool __common_eap_connect_show_ime(void *data)
+static gboolean __common_eap_connect_show_ime(void *data)
{
Elm_Object_Item *list_entry_item = (Elm_Object_Item *)data;
if (!list_entry_item)
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
Evas_Object *entry = elm_object_item_part_content_get(list_entry_item, "elm.icon.entry");
if (!entry)
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
g_eap_id_show_keypad = TRUE;
elm_genlist_item_update(list_entry_item);
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
-static Eina_Bool __common_eap_connect_load_ip_info_list_cb(void *data)
+static gboolean __common_eap_connect_load_ip_info_list_cb(void *data)
{
eap_connect_data_t *eap_data = (eap_connect_data_t *)data;
Elm_Object_Item *navi_it = NULL;
Evas_Object *list = NULL;
if (!eap_data)
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
if (eap_data->navi_frame) {
Evas_Object *layout = NULL;
/* Add a separator */
common_utils_add_dialogue_separator(list, "dialogue/separator");
- ecore_idler_add(__common_eap_connect_show_ime, eap_data->eap_id_item);
+ common_util_managed_idle_add(__common_eap_connect_show_ime, eap_data->eap_id_item);
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
eap_connect_data_t *create_eap_view(Evas_Object *win_main,
connect_btn);
/* Append ip info items and add a seperator */
- ecore_idler_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
+ common_util_managed_idle_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
/* Title Connect button */
connect_btn = elm_button_add(navi_frame);
list = _create_list(box, eap_data);
/* Append ip info items and add a seperator */
- ecore_idler_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
+ common_util_managed_idle_add(__common_eap_connect_load_ip_info_list_cb, eap_data);
/* Pack the list into the box */
elm_box_pack_end(box, list);
__COMMON_FUNC_EXIT__;
}
-static Eina_Bool __genlist_item_disable_later(void *data)
+static gboolean __genlist_item_disable_later(void *data)
{
elm_genlist_item_selected_set((Elm_Object_Item *)data, FALSE);
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
static void _gl_deselect_callback(void* data,
Evas_Object* obj, void* event_info)
{
- ecore_idler_add(__genlist_item_disable_later, event_info);
+ common_util_managed_idle_add(__genlist_item_disable_later, event_info);
}
static char* _ip_info_iptoggle_text_get(void *data, Evas_Object *obj,
elm_genlist_item_update(ip_info_list_data->ip_toggle_item);
elm_object_item_disabled_set(ip_info_list_data->ip_toggle_item, FALSE);
- ecore_idler_add(__genlist_item_disable_later, event_info);
+ common_util_managed_idle_add(__genlist_item_disable_later, event_info);
__COMMON_FUNC_EXIT__;
}
#include <vconf.h>
#include <syspopup_caller.h>
-
#include <aul.h>
+
#include "common.h"
#include "common_utils.h"
#include "i18nmanager.h"
char *info_str;
} two_line_disp_data_t;
+static GSList *managed_idler_list = NULL;
+
static char *__common_utils_2line_text_get(void *data, Evas_Object *obj, const char *part)
{
two_line_disp_data_t *item_data = (two_line_disp_data_t *)data;
bundle_add(b, "_AP_NAME_", ssid);
ret = aul_launch_app("net.netpopup", b);
+
bundle_free(b);
return ret;
__COMMON_FUNC_EXIT__;
return value;
}
+
+struct managed_idle_data {
+ GSourceFunc func;
+ gpointer user_data;
+ guint id;
+};
+
+static void __managed_idle_destroy_cb(gpointer data)
+{
+ if (!data)
+ return;
+
+ managed_idler_list = g_slist_remove(managed_idler_list, data);
+}
+
+static gboolean __managed_idle_hook_cb(gpointer user_data)
+{
+ struct managed_idle_data *data = user_data;
+
+ if (!data)
+ return FALSE;
+
+ return data->func(data->user_data);
+}
+
+guint common_util_managed_idle_add(GSourceFunc func, gpointer user_data)
+{
+ guint id;
+ struct managed_idle_data *data;
+
+ if (!func)
+ return 0;
+
+ data = g_new0(struct managed_idle_data, 1);
+ if (!data)
+ return 0;
+
+ data->func = func;
+ data->user_data = user_data;
+
+ id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, __managed_idle_hook_cb, data,
+ __managed_idle_destroy_cb);
+ if (!id) {
+ g_free(data);
+ return id;
+ }
+
+ data->id = id;
+
+ managed_idler_list = g_slist_append(managed_idler_list, data);
+
+ return id;
+}
+
+void common_util_managed_idle_cleanup(void)
+{
+ GSList *cur = managed_idler_list;
+ GSource *src;
+ struct managed_idle_data *data;
+
+ for (;cur; cur = cur->next) {
+ data = cur->data;
+
+ src = g_main_context_find_source_by_id(g_main_context_default(),
+ data->id);
+ if (src) {
+ g_source_destroy(src);
+ }
+
+ g_free(data);
+ }
+
+ g_slist_free (managed_idler_list);
+ managed_idler_list = NULL;
+
+}
#endif
#include <Elementary.h>
+
+/* Fix build warning (redefine '_()' in appcore-common.h) */
+#ifdef _
+#undef _
+#endif
#include <appcore-common.h>
#include "wlan_manager.h"
int common_util_set_system_registry(const char *key, int value);
int common_util_get_system_registry(const char *key);
+guint common_util_managed_idle_add(GSourceFunc func, gpointer user_data);
+void common_util_managed_idle_cleanup(void);
+
#ifdef __cplusplus
}
#endif
void *specific_scan_user_data;
};
-static struct _wifi_cb_s wifi_callbacks = {0,};
+static struct _wifi_cb_s wifi_callbacks = {NULL, NULL};
int wifi_set_specific_scan_cb(wifi_specific_scan_finished_cb cb, void *data)
{
void *user_data;
};
-static struct wlan_connection current_item = { NULL, };
-static struct wlan_connection next_item = { NULL, };
+static struct wlan_connection current_item = { NULL, NULL, NULL };
+static struct wlan_connection next_item = { NULL, NULL, NULL };
static void wlan_connect_debug(wifi_ap_h ap)
{
return di_s0;
}
-static Eina_Bool _refresh_ui(void *data)
+static gboolean _refresh_ui(void *data)
{
manager_object->refresh_func();
manager_object->b_scan_blocked = FALSE;
manager_object->b_ui_refresh = FALSE;
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
void wlan_manager_enable_scan_result_update(void)
DEBUG_LOG(COMMON_NAME_LIB, "Refresh the UI with last scan update");
/* Delayed rendering in order to get smooth effect of popup close */
- ecore_idler_add(_refresh_ui, NULL);
+ common_util_managed_idle_add(_refresh_ui, NULL);
} else
manager_object->b_scan_blocked = FALSE;
}
elm_naviframe_item_pop(viewer_manager_get_naviframe());
- g_idle_add(__forget_wifi_ap, (gpointer)ap);
+ common_util_managed_idle_add(__forget_wifi_ap, (gpointer)ap);
__COMMON_FUNC_EXIT__;
}
return;
}
-static Eina_Bool __view_detail_load_ip_info_list_cb(void *data)
+static gboolean __view_detail_load_ip_info_list_cb(void *data)
{
Elm_Object_Item *navi_it = NULL;
Evas_Object *list = NULL;
view_detail_data *_detail_data = (view_detail_data *)data;
if (!_detail_data)
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
navi_it = elm_naviframe_top_item_get(viewer_manager_get_naviframe());
layout = elm_object_item_part_content_get(navi_it, "elm.swallow.content");
common_utils_add_dialogue_separator(list, "dialogue/separator");
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main)
}
/* Append the ip info details */
- ecore_idler_add(__view_detail_load_ip_info_list_cb, _detail_data);
+ common_util_managed_idle_add(__view_detail_load_ip_info_list_cb, _detail_data);
__COMMON_FUNC_EXIT__;
}
__COMMON_FUNC_EXIT__;
}
-void _lbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
+static void _lbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
__COMMON_FUNC_EXIT__;
}
-void _rbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
+static void _rbutton_click_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
__COMMON_FUNC_EXIT__;
}
-void _back_sk_cb(void *data, Evas_Object *obj, void *event_info)
+static void _back_sk_cb(void *data, Evas_Object *obj, void *event_info)
{
__COMMON_FUNC_ENTER__;
/* TODO: need to check VIEW_MANAGER_VIEW_TYPE_MAIN ?
* Evas_Object* navi_frame = viewer_manager_get_naviframe();
* view_manager_view_type_t top_view_id =
- * (view_manager_view_type_t)evas_object_data_get(navi_frame,
- * SCREEN_TYPE_ID_KEY);
+ * (view_manager_view_type_t)evas_object_data_get(navi_frame,
+ * SCREEN_TYPE_ID_KEY);
*/
if (show_state == EINA_TRUE)
return EINA_TRUE;
}
+#if 0
+/* Unused function */
Eina_Bool viewer_manager_genlist_item_update(Elm_Object_Item* item)
{
__COMMON_FUNC_ENTER__;
__COMMON_FUNC_EXIT__;
return EINA_FALSE;
}
-
+
elm_genlist_item_update(item);
__COMMON_FUNC_EXIT__;
return EINA_FALSE;
}
+#endif
void viewer_manager_update_hidden_btn(void)
{
ui_gadget_h ug;
};
-static Eina_Bool __wifi_efl_ug_del_found_ap_noti(void *data)
+UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops);
+UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops);
+UG_MODULE_API int setting_plugin_reset(bundle *data, void *priv);
+
+static gboolean __wifi_efl_ug_del_found_ap_noti(void *data)
{
common_utils_send_message_to_net_popup(NULL, NULL,
"del_found_ap_noti", NULL);
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
static void __make_scan_if_bss_expired(void)
VCONFKEY_WIFI_UG_RUN_STATE_ON_FOREGROUND);
/* Remove the "WiFi networks found" from the notification tray.*/
- ecore_idler_add(__wifi_efl_ug_del_found_ap_noti, NULL);
+ common_util_managed_idle_add(__wifi_efl_ug_del_found_ap_noti, NULL);
memset(&g_pending_call, 0, sizeof(wifi_pending_call_info_t));
{
__COMMON_FUNC_ENTER__;
- g_idle_add(load_initial_ap_list, NULL);
+ common_util_managed_idle_add(load_initial_ap_list, NULL);
connman_request_scan_mode_set(WIFI_BGSCAN_MODE_PERIODIC);
ugd->base = NULL;
}
+ common_util_managed_idle_cleanup();
+
__COMMON_FUNC_EXIT__;
}
gboolean highlighted;
} syspopup_genlist_data_t;
-int wifi_syspopup_create(void);
int wifi_syspopup_destroy(void);
#ifdef __cplusplus
Evas_Object *view_main_create(Evas_Object* parent);
int view_main_destroy(void);
void view_main_item_state_set(wifi_ap_h ap, ITEM_CONNECTION_MODES state);
-Eina_Bool view_main_show(void *data);
+gboolean view_main_show(void *data);
#ifdef __cplusplus
}
}
}
+#if 0
+/* Unused function */
Elm_Object_Item *__view_main_get_item_in_mode(ITEM_CONNECTION_MODES mode)
{
Elm_Object_Item* it = NULL;
__COMMON_FUNC_EXIT__;
return NULL;
}
+#endif
static void __gl_sel(void *data, Evas_Object *obj, void *event_info)
{
return true;
}
-Eina_Bool view_main_show(void *data)
+gboolean view_main_show(void *data)
{
__COMMON_FUNC_ENTER__;
ERROR_LOG( SP_NAME_NORMAL, "list is NULL!!" );
__COMMON_FUNC_EXIT__;
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
view_main_scan_ui_clear();
int state = wlan_manager_state_get();
if (WLAN_MANAGER_ERROR == state || WLAN_MANAGER_OFF == state) {
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
itc.item_style = "2text.2icon.4";
WARN_LOG(SP_NAME_NORMAL, "scan size is ZERO");
__COMMON_FUNC_EXIT__;
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
evas_object_show(list);
__COMMON_FUNC_EXIT__;
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
INFO_LOG(SP_NAME_NORMAL, "Wi-Fi QS launch");
- ecore_idler_add(view_main_show, NULL);
+ common_util_managed_idle_add(view_main_show, NULL);
__COMMON_FUNC_EXIT__;
return;
return 1;
}
-int wifi_syspopup_create(void)
+static int wifi_syspopup_create(void)
{
__COMMON_FUNC_ENTER__;
int rotate_angle;
return 1;
}
-int wifi_syspopup_init()
+static int wifi_syspopup_init()
{
__COMMON_FUNC_ENTER__;
.def_timeout_fn = mytimeout
};
-static Eina_Bool __wifi_syspopup_del_found_ap_noti(void *data)
+static gboolean __wifi_syspopup_del_found_ap_noti(void *data)
{
common_utils_send_message_to_net_popup(NULL, NULL,
"del_found_ap_noti", NULL);
- return ECORE_CALLBACK_CANCEL;
+ return FALSE;
}
static gboolean load_initial_ap_list(gpointer data)
vconf_ignore_key_changed(VCONFKEY_PWLOCK_STATE, __pw_lock_state_change_cb);
wifi_syspopup_create();
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, (void *)syspopup_app_state);
- g_idle_add(load_initial_ap_list, NULL);
+ common_util_managed_idle_add(load_initial_ap_list, NULL);
}
INFO_LOG(SP_NAME_NORMAL, "pwlock state = %d", pw_lock_state);
assertm_if(NULL == b, "bundle is NULL!!");
/* Remove the "WiFi networks found" from the notification tray.*/
- ecore_idler_add(__wifi_syspopup_del_found_ap_noti, NULL);
+ common_util_managed_idle_add(__wifi_syspopup_del_found_ap_noti, NULL);
if (syspopup_has_popup(b)) {
INFO_LOG(SP_NAME_NORMAL, "Wi-Fi device picker is already launched");
+
syspopup_reset(b);
} else {
win_main = appcore_create_win(PACKAGE);
return 0;
} else {
syspopup_app_state->syspopup_type = WIFI_SYSPOPUP_WITH_AP_LIST;
+
int wlan_ret = wifi_syspopup_init();
if (WLAN_MANAGER_ERR_NONE != wlan_ret ||
_power_on_check() == FALSE) {
wifi_syspopup_create();
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, (void *)syspopup_app_state);
- g_idle_add(load_initial_ap_list, NULL);
+ common_util_managed_idle_add(load_initial_ap_list, NULL);
}
INFO_LOG(SP_NAME_NORMAL, "pwlock state = %d", pw_lock_state);