From: Sung-jae Park Date: Sun, 27 May 2012 09:00:13 +0000 (+0900) Subject: Review codes. X-Git-Tag: submit/tizen_mobile/20150512.125148^2~1^2~15^2~8^2~248 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99657f4541ad5c6696d7881c4e50466e81773832;p=platform%2Fcore%2Fappfw%2Fdata-provider-slave.git Review codes. Remove unused code(virtual_canvas). Fix the invalid return code of dbus method. Change-Id: Id6a3a7e4fda63c3440c01af877641ed26f6df2bc --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e9aa5f1..c36d6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ ADD_EXECUTABLE(${PROJECT_NAME} src/so_handler.c src/fault.c src/update_monitor.c - src/virtual_canvas.c src/conf.c src/util.c src/livebox.c diff --git a/include/virtual_canvas.h b/include/virtual_canvas.h deleted file mode 100644 index 8833427..0000000 --- a/include/virtual_canvas.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * com.samsung.live-data-provider - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sung-jae Park , Youngjoo Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef __LIVE_DATA_PROVIDER_VIRTUAL_CANVAS_H__ -#define __LIVE_DATA_PROVIDER_VIRTUAL_CANVAS_H__ - -extern int flush_to_file(Evas *e, const char *filename, int w, int h); -extern int flush_data_to_file(Evas *e, char *data, const char *filename, int w, int h); - -extern Evas *create_virtual_canvas(int w, int h); -extern int destroy_virtual_canvas(Evas *e); -extern void get_screen_geometry(int *w, int *h); - -#endif - -// End of a file diff --git a/src/dbus.c b/src/dbus.c index 906e3b8..9784f4f 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -321,7 +321,10 @@ static void method_pause(GDBusMethodInvocation *inv, GVariant *param) double timestamp; g_variant_get(param, "(d)", ×tamp); - param = g_variant_new("(i)", timestamp, 0); + + DbgPrint("Pause at %lf\n", timestamp); + + param = g_variant_new("(i)", 0); g_dbus_method_invocation_return_value(inv, param); livebox_pause_all(); @@ -332,7 +335,10 @@ static void method_resume(GDBusMethodInvocation *inv, GVariant *param) double timestamp; g_variant_get(param, "(d)", ×tamp); - param = g_variant_new("(i)", timestamp, 0); + + DbgPrint("Resume at %lf\n", timestamp); + + param = g_variant_new("(i)", 0); g_dbus_method_invocation_return_value(inv, param); livebox_resume_all(); @@ -362,6 +368,17 @@ static void method_renew(GDBusMethodInvocation *inv, GVariant *param) &period, &cluster, &category, &pinup, &w, &h, &abi); ret = livebox_create(pkgname, filename, content, timeout, has_livebox_script, period, cluster, category, &lw, &lh, &priority, pinup, 1, abi); + DbgPrint("Recreate livebox: pkgname[%s], filename[%s], content[%s]" \ + ", timeout[%d]" \ + ", has_livebox_script[%d]" \ + ", period[%lf]" \ + ", cluster[%s]" \ + ", category[%s]" \ + ", w[%d], h[%d], priority[%lf]" \ + ", pinup[%d], skip_need_to_create[%d], abi[%s]\n", + pkgname, filename, content, + timeout, has_livebox_script, period, cluster, category, + w, h, priority, pinup, 1, abi); if (ret == 0) { if (lw != w || lh != h) { int tmp; @@ -402,8 +419,17 @@ static void method_new(GDBusMethodInvocation *inv, GVariant *param) /* TODO: timeout, livebox_script, period */ ret = livebox_create(pkgname, filename, content, timeout, has_livebox_script, period, cluster, category, &w, &h, &priority, pinup, skip_need_to_create, abi); - DbgPrint("Create livebox: pkgname[%s], filename[%s], content[%s], timeout[%d], has_livebox_script[%d], period[%lf], cluster[%s], category[%s], w[%d], h[%d], priority[%lf], pinup[%d], skip_need_to_create[%d], abi[%s]\n", - pkgname, filename, content, timeout, has_livebox_script, period, cluster, category, w, h, priority, pinup, skip_need_to_create, abi); + DbgPrint("Recreate livebox: pkgname[%s], filename[%s], content[%s]" \ + ", timeout[%d]" \ + ", has_livebox_script[%d]" \ + ", period[%lf]" \ + ", cluster[%s]" \ + ", category[%s]" \ + ", w[%d], h[%d], priority[%lf]" \ + ", pinup[%d], skip_need_to_create[%d], abi[%s]\n", + pkgname, filename, content, + timeout, has_livebox_script, period, cluster, category, + w, h, priority, pinup, skip_need_to_create, abi); param = g_variant_new("(iiid)", ret, w, h, priority); if (!param) @@ -489,7 +515,6 @@ static void method_handler(GDBusConnection *conn, return; } - DbgPrint("Request[%s] arrived\n", method); for (i = 0; method_table[i].name; i++) { if (!strcmp(method, method_table[i].name)) { if (!method_table[i].method) diff --git a/src/fault.c b/src/fault.c index e003156..a5d2b7d 100644 --- a/src/fault.c +++ b/src/fault.c @@ -103,6 +103,10 @@ int fault_init(void) int fault_fini(void) { + /*! + * \todo + * remove all signal handlers + */ return 0; } diff --git a/src/virtual_canvas.c b/src/virtual_canvas.c deleted file mode 100644 index 07decd7..0000000 --- a/src/virtual_canvas.c +++ /dev/null @@ -1,136 +0,0 @@ -/* - * com.samsung.live-data-provider - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Sung-jae Park , Youngjoo Park - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include -#include - -#include -#include -#include - -#include - -#include "virtual_canvas.h" -#include "debug.h" -#include "conf.h" - -Evas *create_virtual_canvas(int w, int h) -{ - Ecore_Evas *internal_ee; - Evas *internal_e; - - /* Create virtual canvas */ - internal_ee = ecore_evas_buffer_new(w, h); - if (!internal_ee) { - DbgPrint("Failed to create a new canvas buffer\n"); - return NULL; - } - - ecore_evas_alpha_set(internal_ee, EINA_TRUE); - ecore_evas_manual_render_set(internal_ee, EINA_TRUE); - - /* Get the "Evas" object from a virtual canvas */ - internal_e = ecore_evas_get(internal_ee); - if (!internal_e) { - ecore_evas_free(internal_ee); - DbgPrint("Faield to get Evas object\n"); - return NULL; - } - - return internal_e; -} - -int flush_to_file(Evas *e, const char *filename, int w, int h) -{ - void *data; - Ecore_Evas *internal_ee; - int ret; - - internal_ee = ecore_evas_ecore_evas_get(e); - if (!internal_ee) { - DbgPrint("Failed to get ecore evas\n"); - return -EFAULT; - } - - ecore_evas_manual_render(internal_ee); - - /* Get a pointer of a buffer of the virtual canvas */ - data = (void *)ecore_evas_buffer_pixels_get(internal_ee); - if (!data) { - DbgPrint("Failed to get pixel data\n"); - return -EFAULT; - } - - ret = flush_data_to_file(e, data, filename, w, h); - return ret; -} - -int flush_data_to_file(Evas *e, char *data, const char *filename, int w, int h) -{ - Evas_Object *output; - - output = evas_object_image_add(e); - if (!output) { - DbgPrint("Failed to create an image object\n"); - return -EFAULT; - } - - evas_object_image_data_set(output, NULL); - evas_object_image_colorspace_set(output, EVAS_COLORSPACE_ARGB8888); - evas_object_image_alpha_set(output, EINA_TRUE); - evas_object_image_size_set(output, w, h); - evas_object_image_smooth_scale_set(output, EINA_TRUE); - evas_object_image_data_set(output, data); - evas_object_image_data_update_add(output, 0, 0, w, h); - - if (evas_object_image_save(output, filename, NULL, g_conf.quality) - == EINA_FALSE) { - evas_object_del(output); - DbgPrint("Faield to save a captured image (%s)\n", filename); - return -EFAULT; - } - - evas_object_del(output); - - if (access(filename, F_OK) != 0) { - DbgPrint("File %s is not found\n", filename); - return -EFAULT; - } - - return 0; -} - -int destroy_virtual_canvas(Evas *e) -{ - Ecore_Evas *ee; - - ee = ecore_evas_ecore_evas_get(e); - if (!ee) { - DbgPrint("Failed to ecore evas object\n"); - return -EFAULT; - } - - ecore_evas_free(ee); - return 0; -} - -/* End of a file */