static void _item_up_cb(void *data, Evas_Object *obj, const char* emission, const char* source) { Evas_Object *icon_image; Evas_Object *item; item = evas_object_data_get(obj, "item"); ret_if(NULL == item); _D("ITEM: mouse up event callback is invoked for %p", item); PRINT_APPFWK(); icon_image = evas_object_data_get(item, "icon_image"); evas_object_color_set(icon_image, 255, 255, 255, 255); ret_if(NULL == item_event_info.pressed_item); if (item_event_info.pressed_item == item) { bool item_enable_long_press; item_enable_long_press = (bool) evas_object_data_get(item, "item_enable_long_press"); _D("Not Edit Mode"); if (mouse_is_scrolling()) { return; } item_launch(item); } item_event_info.pressed_item = NULL; }
static void __bt_telephony_gdbus_init(void) { GDBusConnection *g_conn; GError *g_err = NULL; BT_DBG("+"); ret_if(bluetooth_telephony_obj != NULL); g_conn = _bt_init_system_gdbus_conn(); ret_if(g_conn == NULL); bluetooth_telephony_obj = org_tizen_csd_call_instance_skeleton_new(); g_signal_connect(bluetooth_telephony_obj, "handle-answer", G_CALLBACK(bluetooth_telephony_method_answer), NULL); g_signal_connect(bluetooth_telephony_obj, "handle-release", G_CALLBACK(bluetooth_telephony_method_release), NULL); g_signal_connect(bluetooth_telephony_obj, "handle-reject", G_CALLBACK(bluetooth_telephony_method_reject), NULL); g_signal_connect(bluetooth_telephony_obj, "handle-threeway", G_CALLBACK(bluetooth_telephony_method_threeway), NULL); g_signal_connect(bluetooth_telephony_obj, "handle-send-dtmf", G_CALLBACK(bluetooth_telephony_method_send_dtmf), NULL); if (g_dbus_interface_skeleton_export( G_DBUS_INTERFACE_SKELETON(bluetooth_telephony_obj), g_conn, "/", &g_err) == FALSE) { if (g_err) { BT_ERR("Export error: %s", g_err->message); g_clear_error(&g_err); } g_object_unref(bluetooth_telephony_obj); bluetooth_telephony_obj = NULL; g_dbus_connection_close_sync(gdbus_conn, NULL, NULL); gdbus_conn = NULL; return; } gdbus_conn = g_conn; BT_DBG("-"); }
static void _show_status_text(void *data, char *text) { ugdata_t *ug_data = (ugdata_t *)data; LOGD("[%s(): %d] BEGIN>>>>", __FUNCTION__, __LINE__); ret_if(ug_data == NULL); ret_if(text == NULL); status_message_post(text); ug_destroy_me(ug_data->nfc_share_ug); LOGD("[%s(): %d] END>>>>", __FUNCTION__, __LINE__); }
HAPI void layout_enable_block(Evas_Object *layout) { ret_if(NULL == layout); _D("Enable layout blocker"); edje_object_signal_emit(_EDJ(layout), "block", "layout"); }
void page_destroy(Evas_Object *scroller, Evas_Object *page) { Evas_Object *mapbuf; Evas_Object *bg; Evas_Object *item; Evas_Object *box; Evas_Object *index; Evas_Object *tab; Eina_List *pending_list; register unsigned int i; int page_max_app; unsigned int count; evas_object_event_callback_del(page, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb); page_max_app = (int) evas_object_data_get(scroller, "page_max_app"); for (i = 0; i < page_max_app; i ++) { item = page_unpack_item_at(page, i); if (!item) continue; item_destroy(item); } pending_list = evas_object_data_get(page, "pending,list"); eina_list_free(pending_list); bg = evas_object_data_get(page, "bg"); evas_object_del(bg); box = evas_object_data_get(scroller, "box"); ret_if(NULL == box); mapbuf = mapbuf_get_mapbuf(page); if (mapbuf) { elm_box_unpack(box, mapbuf); mapbuf_unbind(mapbuf); } else { elm_box_unpack(box, page); } index = evas_object_data_get(scroller, "index"); if (index) { tab = evas_object_data_get(scroller, "tab"); count = page_scroller_count_page(scroller); index_update(tab, index, count); } evas_object_data_del(page, "win"); evas_object_data_del(page, "layout"); evas_object_data_del(page, "controlbar"); evas_object_data_del(page, "tab"); evas_object_data_del(page, "scroller"); evas_object_data_del(page, "page_edje"); evas_object_data_del(page, "page_max_app"); evas_object_data_del(page, "bg"); evas_object_data_del(page, "pending,list"); evas_object_data_del(page, "dirty"); layout_unload_edj(page); }
static void _uninstall_up_cb(void *item, Evas_Object *obj, const char* emission, const char* source) { Evas_Object *win; ret_if(mouse_is_scrolling()); win = menu_screen_get_win(); ret_if(NULL == win); _D("Uninstall button is up"); obj = evas_object_data_get(obj, "evas_object"); ret_if(NULL == obj); ret_if(NULL == evas_object_data_get(obj, "removing")); evas_object_data_del(obj, "removing"); }
void _bt_obex_transfer_completed(const char *transfer_path, const char *file_path, gboolean success) { bt_transfer_info_t *transfer_info; int result; BT_DBG("Transfer [%s] Success [%d] \n", transfer_path, success); result = (success == TRUE) ? BLUETOOTH_ERROR_NONE : BLUETOOTH_ERROR_CANCEL; transfer_info = __bt_find_transfer_by_path(transfer_path); ret_if(transfer_info == NULL); _bt_send_event(BT_OPP_SERVER_EVENT, BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED, DBUS_TYPE_INT32, &result, DBUS_TYPE_STRING, &transfer_info->filename, DBUS_TYPE_STRING, &transfer_info->type, DBUS_TYPE_STRING, &transfer_info->device_name, DBUS_TYPE_STRING, &file_path, DBUS_TYPE_UINT64, &transfer_info->file_size, DBUS_TYPE_INT32, &transfer_info->transfer_id, DBUS_TYPE_INT32, &agent_info.server_type, DBUS_TYPE_INVALID); transfers = g_slist_remove(transfers, transfer_info); __bt_free_transfer_info(transfer_info); }
static void __bt_opp_client_agent_deinit(void) { ret_if(opc_obex_agent == NULL); g_object_unref(opc_obex_agent); opc_obex_agent = NULL; }
static void __bt_free_server_info(bt_server_info_t *server_info) { ret_if(server_info == NULL); g_free(server_info->sender); g_free(server_info->dest_path); g_free(server_info); }
// Gesture Setting 이 눌렸을 때 static void _setting_cb(void *data, Evas_Object *obj, void *event_info) { _D("%s", __func__); appdata_s *ad = (appdata_s *) data; ret_if(!ad); // bt_mgr_initialize(ad, BT_MGR_WAIT); }
static void __bt_free_auth_info(bt_auth_info_t *auto_info) { ret_if(auto_info == NULL); g_free(auto_info->filename); g_free(auto_info->transfer_path); g_free(auto_info->device_name); g_free(auto_info); }
static void __bt_send_files_cb(DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) { GError *error = NULL; int result = BLUETOOTH_ERROR_NONE; if (dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_INVALID) == FALSE) { BT_ERR("%s", error->message); g_error_free(error); result = BLUETOOTH_ERROR_INTERNAL; } g_object_unref(proxy); ret_if(sending_info == NULL); sending_info->sending_proxy = NULL; /* Send the event in only error none case */ _bt_send_event(BT_OPP_CLIENT_EVENT, BLUETOOTH_EVENT_OPC_CONNECTED, DBUS_TYPE_INT32, &result, DBUS_TYPE_STRING, &sending_info->address, DBUS_TYPE_INT32, &sending_info->request_id, DBUS_TYPE_INVALID); if (result != BLUETOOTH_ERROR_NONE) { __bt_free_sending_info(sending_info); sending_info = NULL; /* Operate remain works */ if (g_slist_length(transfer_list) > 0) { bt_sending_data_t *data = NULL; data = transfer_list->data; if (data == NULL) goto fail; transfer_list = g_slist_remove(transfer_list, data); if (__bt_opp_client_start_sending(data->request_id, data->address, data->file_path, data->file_count) != BLUETOOTH_ERROR_NONE) { goto fail; } } } return; fail: g_slist_free_full(transfer_list, (GDestroyNotify)__bt_free_sending_data); transfer_list = NULL; }
static void __bt_free_transfer_info(bt_transfer_info_t *transfer_info) { ret_if(transfer_info == NULL); g_free(transfer_info->path); g_free(transfer_info->filename); g_free(transfer_info->type); g_free(transfer_info->device_name); g_free(transfer_info); }
void list_free_values(app_info_t *ai) { ret_if(NULL == ai); /* Origin field */ if (ai->package) free(ai->package); if (ai->exec) free(ai->exec); if (ai->name) free(ai->name); if (ai->icon) free(ai->icon); }
static void __bt_free_sending_info(bt_sending_info_t *info) { ret_if(info == NULL); /* Free the sending variable */ __bt_free_transfer_info(info->transfer_info); g_free(info->address); g_free(info); }
static void __bt_free_transfer_info(bt_transfer_info_t *info) { ret_if(info == NULL); if (info->proxy) g_object_unref(info->proxy); g_free(info->transfer_name); g_free(info->file_name); g_free(info); }
static void __bt_telephony_event_cb(int event, int result, void *param_data) { telephony_event_param_t bt_event = { 0, }; bt_event.event = event; bt_event.result = result; bt_event.param_data = param_data; ret_if(telephony_info.cb == NULL); telephony_info.cb(bt_event.event, &bt_event, telephony_info.user_data); return; }
static void _item_up_cb(void *data, Evas_Object *obj, const char* emission, const char* source) { Evas_Object *icon_image; Evas_Object *item; item = evas_object_data_get(obj, "item"); ret_if(NULL == item); _D("ITEM: mouse up event callback is invoked for %p", item); PRINT_APPFWK(); icon_image = evas_object_data_get(item, "icon_image"); evas_object_color_set(icon_image, 255, 255, 255, 255); ret_if(NULL == item_event_info.pressed_item); if (item != item_event_info.pressed_item) { item_event_info.pressed_item = NULL; return; } item_event_info.pressed_item = NULL; }
HAPI void layout_unload_edj(Evas_Object *layout) { Evas_Object *evas_object; ret_if(NULL == layout); evas_object = evas_object_data_get(_EDJ(layout), "evas_object"); if (evas_object) { evas_object_data_del(_EDJ(layout), "evas_object"); } evas_object_del(layout); }
static void __bt_free_sending_data(gpointer data) { int i; bt_sending_data_t *info = data; ret_if(info == NULL); for (i = 0; i < info->file_count; i++) { g_free(info->file_path[i]); } _bt_delete_request_id(info->request_id); g_free(info->file_path); g_free(info->address); g_free(info); }
void _bt_obex_transfer_progress(const char *transfer_path, int total, int transferred) { bt_transfer_info_t *transfer_info; int progress = 0; int result = BLUETOOTH_ERROR_NONE; transfer_info = __bt_find_transfer_by_path(transfer_path); ret_if(transfer_info == NULL); progress = (int)(((gdouble)transferred /(gdouble)total) * 100); _bt_send_event(BT_OPP_SERVER_EVENT, BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS, DBUS_TYPE_INT32, &result, DBUS_TYPE_STRING, &transfer_info->filename, DBUS_TYPE_STRING, &transfer_info->type, DBUS_TYPE_UINT64, &transfer_info->file_size, DBUS_TYPE_INT32, &transfer_info->transfer_id, DBUS_TYPE_INT32, &progress, DBUS_TYPE_INT32, &agent_info.server_type, DBUS_TYPE_INVALID); }
void _bt_share_event_handler(int event, bluetooth_event_param_t *param, void *user_data) { int ret; static int send_cnt = 0; static char *name = NULL; char str[NOTIFICATION_TEXT_LEN_MAX] = { 0 }; char opc_cnt[NOTIFICATION_TEXT_LEN_MAX] = { 0 }; int percentage = 0; notification_h noti = NULL; bt_obex_server_authorize_into_t *auth_info; bt_obex_server_transfer_info_t *transfer_info; opc_transfer_info_t *node = NULL; struct bt_appdata *ad = app_state; bt_tr_data_t *info = NULL; bt_opc_transfer_info_t *client_info = NULL; if (bt_transfer_list) node = bt_transfer_list->data; DBG("OPC event : [0x%x] \n", event); switch (event) { case BLUETOOTH_EVENT_DISABLED: g_free(server_auth_info.filename); server_auth_info.filename = NULL; _bt_terminate_app(); break; case BLUETOOTH_EVENT_OPC_CONNECTED: DBG("BLUETOOTH_EVENT_OPC_CONNECTED, result [%d] \n", param->result); if (param->result != BLUETOOTH_ERROR_NONE) { _bt_create_warning_popup(param->result); if (NULL != node && node->file_cnt > send_cnt) { while (NULL != ad->tr_next_data) { info = (bt_tr_data_t *)(ad->tr_next_data)->data; if (info == NULL) break; _bt_update_sent_data_status(info->id, BT_TR_FAIL); ad->send_data.tr_fail++; ad->tr_next_data = g_slist_next(ad->tr_next_data); } _bt_delete_notification(BT_NOTI_T, SEND_NOTI_PRIV_ID); noti = _bt_create_notification(BT_NOTI_T, SEND_NOTI_PRIV_ID); snprintf(str, sizeof(str), BT_TR_STATUS, ad->send_data.tr_success, ad->send_data.tr_fail); DBG("str = [%s] \n", str); _bt_set_notification_app_launch(noti, CREATE_TR_LIST, NOTI_TR_TYPE_OUT, NULL, NULL); _bt_set_notification_property(noti, QP_NO_DELETE); _bt_insert_notification(noti, BT_STR_SEND_NOTI, str, BT_ICON_QP_SEND); } send_cnt = 0; _remove_transfer_info(node); _bt_update_transfer_list_view(BT_OUTBOUND_TABLE); } else { _bt_share_block_sleep(TRUE); _bt_set_transfer_indicator(TRUE); } break; case BLUETOOTH_EVENT_OPC_TRANSFER_STARTED: DBG("BLUETOOTH_EVENT_OPC_TRANSFER_STARTED \n"); ret_if(node == NULL); name = __get_file_name(send_cnt++, node->file_path); snprintf(opc_cnt, sizeof(opc_cnt), "%d/%d", send_cnt, node->file_cnt); noti = _bt_create_notification(BT_ONGOING_T, SEND_PRIV_ID); _bt_set_notification_app_launch(noti, CREATE_PROGRESS, NOTI_TR_TYPE_OUT, name, opc_cnt); _bt_set_notification_property(noti, QP_NO_TICKER); _bt_insert_notification(noti, name, opc_cnt, BT_ICON_QP_SEND); if (ad->tr_next_data == NULL) { ERR("ad->tr_next_data is NULL \n"); break; } info = (bt_tr_data_t *)(ad->tr_next_data)->data; if (info == NULL) break; ad->current_tr_uid = info->id; DBG("ad->current_tr_uid = [%d] \n", ad->current_tr_uid); ad->tr_next_data = g_slist_next(ad->tr_next_data); break; case BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS: client_info = (bt_opc_transfer_info_t *)param->param_data; ret_if(client_info == NULL); percentage = client_info->percentage; _bt_update_notification_progress(NULL, SEND_PRIV_ID, percentage); _bt_send_message_to_ui(SEND_PRIV_ID, name, percentage, FALSE, BLUETOOTH_ERROR_NONE); break; case BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE: DBG("BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE \n"); client_info = (bt_opc_transfer_info_t *)param->param_data; ret_if(client_info == NULL); DBG("client_info->filename = [%s] \n", client_info->filename); DBG("ad->current_tr_uid = [%d] \n", ad->current_tr_uid); _bt_send_message_to_ui(SEND_PRIV_ID, name, 100, TRUE, param->result); _bt_delete_notification(BT_ONGOING_T, SEND_PRIV_ID); _bt_delete_notification(BT_NOTI_T, SEND_NOTI_PRIV_ID); DBG("ad->send_data.tr_fail = %d, ad->send_data.tr_success= %d \n", ad->send_data.tr_fail, ad->send_data.tr_success); if (param->result != BLUETOOTH_ERROR_NONE) ad->send_data.tr_fail++; else ad->send_data.tr_success++; noti = _bt_create_notification(BT_NOTI_T, SEND_NOTI_PRIV_ID); if (noti != NULL) { snprintf(str, sizeof(str), BT_TR_STATUS, ad->send_data.tr_success, ad->send_data.tr_fail); DBG("str = [%s] \n", str); _bt_set_notification_app_launch(noti, CREATE_TR_LIST, NOTI_TR_TYPE_OUT, NULL, NULL); _bt_set_notification_property(noti, QP_NO_DELETE); _bt_insert_notification(noti, BT_STR_SEND_NOTI, str, BT_ICON_QP_SEND); } if (param->result != BLUETOOTH_ERROR_NONE) { _bt_update_sent_data_status(ad->current_tr_uid, BT_TR_FAIL); _bt_create_warning_popup(param->result); } else { _bt_update_sent_data_status(ad->current_tr_uid, BT_TR_SUCCESS); } _bt_update_transfer_list_view(BT_OUTBOUND_TABLE); break; case BLUETOOTH_EVENT_OPC_DISCONNECTED: DBG("BLUETOOTH_EVENT_OPC_DISCONNECTED \n"); if (node->file_cnt > send_cnt) { while (NULL != ad->tr_next_data) { info = (bt_tr_data_t *)(ad->tr_next_data)->data; if (info == NULL) break; _bt_update_sent_data_status(info->id, BT_TR_FAIL); ad->send_data.tr_fail++; ad->tr_next_data = g_slist_next(ad->tr_next_data); } _bt_delete_notification(BT_NOTI_T, SEND_NOTI_PRIV_ID); noti = _bt_create_notification(BT_NOTI_T, SEND_NOTI_PRIV_ID); snprintf(str, sizeof(str), BT_TR_STATUS, ad->send_data.tr_success, ad->send_data.tr_fail); DBG("str = [%s] \n", str); _bt_set_notification_app_launch(noti, CREATE_TR_LIST, NOTI_TR_TYPE_OUT, NULL, NULL); _bt_set_notification_property(noti, QP_NO_DELETE); _bt_insert_notification(noti, BT_STR_SEND_NOTI, str, BT_ICON_QP_SEND); } send_cnt = 0; _bt_share_block_sleep(FALSE); _bt_set_transfer_indicator(FALSE); _remove_transfer_info(node); DBG("gList len : %d\n", g_slist_length(bt_transfer_list)); if (g_slist_length(bt_transfer_list) > 0) { DBG("One more job existed !!\n"); ret = _request_file_send(bt_transfer_list->data); if (ret != BLUETOOTH_ERROR_NONE) { g_slist_free_full(bt_transfer_list, (GDestroyNotify)_free_transfer_info); bt_transfer_list = NULL; } } break; case BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE: DBG("BT_EVENT_OBEX_TRANSFER_AUTHORIZE \n"); if (param->result == BLUETOOTH_ERROR_NONE) { g_free(server_auth_info.filename); server_auth_info.filename = NULL; auth_info = param->param_data; server_auth_info.filename = g_strdup(auth_info->filename); server_auth_info.length = auth_info->length; if (server_auth_info.filename) __bt_obex_file_push_auth(&server_auth_info); } break; case BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED: DBG("BT_EVENT_OBEX_TRANSFER_STARTED \n"); transfer_info = param->param_data; DBG(" %s \n", transfer_info->type); noti = _bt_create_notification(BT_ONGOING_T, transfer_info->transfer_id); _bt_set_notification_app_launch(noti, CREATE_PROGRESS, NOTI_TR_TYPE_IN, transfer_info->filename, NULL); _bt_set_notification_property(noti, QP_NO_TICKER); if (0 == g_strcmp0(transfer_info->type, TRANSFER_GET)) { _bt_insert_notification(noti, transfer_info->filename, NULL, BT_ICON_QP_SEND); _bt_update_notification_progress(NULL, transfer_info->transfer_id, 0); _bt_set_transfer_indicator(TRUE); } else { _bt_insert_notification(noti, transfer_info->filename, NULL, BT_ICON_QP_RECEIVE); _bt_set_transfer_indicator(TRUE); } _bt_share_block_sleep(TRUE); break; case BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS: DBG("BT_EVENT_OBEX_TRANSFER_PROGRESS \n"); if (param->result == BLUETOOTH_ERROR_NONE) { transfer_info = param->param_data; if (0 == g_strcmp0(transfer_info->type, TRANSFER_GET)) { _bt_update_notification_progress(NULL, transfer_info->transfer_id, transfer_info->percentage); } else { _bt_update_notification_progress(NULL, transfer_info->transfer_id, transfer_info->percentage); } _bt_send_message_to_ui(transfer_info->transfer_id, transfer_info->filename, transfer_info->percentage, FALSE, BLUETOOTH_ERROR_NONE); } break; case BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED: DBG("BT_EVENT_OBEX_TRANSFER_COMPLETED \n"); transfer_info = param->param_data; _bt_share_block_sleep(FALSE); _bt_set_transfer_indicator(FALSE); _bt_send_message_to_ui(transfer_info->transfer_id, transfer_info->filename, transfer_info->percentage, TRUE, param->result); if (param->result == BLUETOOTH_ERROR_NONE) { _bt_obex_writeclose(param->param_data); _bt_update_notification_progress(NULL, transfer_info->transfer_id, 100); } else { DBG("param->result = %d \n", param->result); _bt_create_warning_popup(param->result); } _bt_delete_notification(BT_ONGOING_T, transfer_info->transfer_id); if (0 == g_strcmp0(transfer_info->type, TRANSFER_PUT)) { if (param->result != BLUETOOTH_ERROR_NONE) { ad->recv_data.tr_fail++; _bt_add_recv_transfer_status_data( transfer_info->device_name, transfer_info->filename, BT_TR_FAIL); } else { ad->recv_data.tr_success++; _bt_add_recv_transfer_status_data( transfer_info->device_name, transfer_info->filename, BT_TR_SUCCESS); } snprintf(str, sizeof(str), BT_TR_STATUS, ad->recv_data.tr_success, ad->recv_data.tr_fail); DBG("str = [%s] \n", str); _bt_delete_notification(BT_NOTI_T, RECV_NOTI_PRIV_ID); noti = _bt_create_notification(BT_NOTI_T, RECV_NOTI_PRIV_ID); _bt_set_notification_app_launch(noti, CREATE_TR_LIST, NOTI_TR_TYPE_IN, NULL, NULL); _bt_set_notification_property(noti, QP_NO_DELETE); _bt_insert_notification(noti, BT_STR_RECEIVED_NOTI, str, BT_ICON_QP_RECEIVE); } _bt_update_transfer_list_view(BT_INBOUND_TABLE); break; default: DBG("Unhandled event %x", event); break; } }