)
SET(PACKAGE "${PROJECT_NAME}")
-SET(LOCALEDIR "/opt/apps/com.samsung.${PROJECT_NAME}/res/locale")
+#SET(LOCALEDIR "/opt/apps/com.samsung.${PROJECT_NAME}/res/locale")
SET(CMAKE_C_FLAGS "-Wall -fpie -Winline -Werror -fno-builtin-malloc -fno-omit-frame-pointer -g")
SET(CMAKE_EXE_LINKER_FLAGS "-pie")
ADD_DEFINITIONS("-DSLAVE_PKGNAME=\"com.samsung.data-provider-slave\"")
ADD_DEFINITIONS("-DSLAVE_WEB_PKGNAME=\"com.samsung.data-provider-webslave\"")
-ADD_DEFINITIONS("-DSOCKET_FILE=\"/opt/share/live_magazine/.live.socket\"")
+ADD_DEFINITIONS("-DSOCKET_FILE=\"/opt/usr/share/live_magazine/.live.socket\"")
ADD_DEFINITIONS("-DNDEBUG")
#ADD_DEFINITIONS("-DFLOG")
src/script_handler.c
src/buffer_handler.c
src/io.c
- src/virtual_canvas.c
src/xmonitor.c
src/slave_life.c
src/slave_rpc.c
max_log_file=3
sqilte_flush_max=1048576
db_path=/opt/dbspace/.livebox.db
-log_path=/opt/share/live_magazine/log
-error_image=/usr/share/data-provider-master/images/error.png
-share_path=/opt/share/live_magazine/
-script_port_path=/opt/live/script_port/
+log_path=/opt/usr/share/live_magazine/log
+share_path=/opt/usr/share/live_magazine/
+script_port_path=/opt/usr/live/script_port/
ping_interval=240.0
slave_max_load=30
vconf_sys_cluster=file/private/com.samsung.cluster-home/system_cluster
start ()
{
- rm /opt/share/live_magazine/*
- rm /opt/share/live_magazine/reader/*
+ rm /opt/usr/share/live_magazine/*
+ rm /opt/usr/share/live_magazine/reader/*
+ rm /opt/usr/share/live_magazine/log/*
rm /tmp/.stop.provider
launch_provider &
}
int max_size_type;
- char *quality;
- char *error;
-
int slave_max_load;
double ping_time;
#define SQLITE_FLUSH_MAX g_conf.sqlite_flush_max
#define DBFILE g_conf.path.db
-#define DEFAULT_QUALITY g_conf.quality
-
#define SLAVE_MAX_LOAD g_conf.slave_max_load
#define DEFAULT_PING_TIME g_conf.ping_time
extern int instance_set_period(struct inst_info *inst, double period);
extern int instance_clicked(struct inst_info *inst, const char *event, double timestamp, double x, double y);
extern int instance_text_signal_emit(struct inst_info *inst, const char *emission, const char *source, double sx, double sy, double ex, double ey);
+extern int instance_signal_emit(struct inst_info *inst, const char *emission, const char *source, double sx, double sy, double ex, double ey, double x, double y, int down);
extern int instance_change_group(struct inst_info *inst, const char *cluster, const char *category);
extern int instance_set_visible_state(struct inst_info *inst, enum livebox_visible_state state);
extern enum livebox_visible_state instance_visible_state(struct inst_info *inst);
+++ /dev/null
-/*
- * com.samsung.data-provider-master
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Sung-jae Park <nicesj.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
- *
- * 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.
- *
- */
-
-extern int virtual_canvas_flush_to_file(Evas *e, const char *filename, int w, int h);
-extern int virtual_canvas_flush_data_to_file(Evas *e, char *data, const char *filename, int w, int h);
-
-extern Evas *virtual_canvas_create(int w, int h);
-extern int virtual_canvas_destroy(Evas *e);
-
-/* End of a file */
Name: com.samsung.data-provider-master
Summary: Master data provider
-Version: 0.11.4
+Version: 0.11.5
Release: 1
Group: main/app
License: Samsung Proprietary License
fi
%post
-mkdir -p /opt/share/live_magazine
-chown 5000:5000 /opt/share/live_magazine
-chsmack -a "_" /opt/share/live_magazine
-chsmack -t /opt/share/live_magazine
+mkdir -p /opt/usr/share/live_magazine
+chown 5000:5000 /opt/usr/share/live_magazine
+chsmack -a "_" /opt/usr/share/live_magazine
+chsmack -t /opt/usr/share/live_magazine
# According to this transmute attribute, below log, reader folder will be set as same label
-mkdir -p /opt/share/live_magazine/log
-chown 5000:5000 /opt/share/live_magazine/log
+mkdir -p /opt/usr/share/live_magazine/log
+chown 5000:5000 /opt/usr/share/live_magazine/log
-mkdir -p /opt/share/live_magazine/reader
-chown 5000:5000 /opt/share/live_magazine/reader
+mkdir -p /opt/usr/share/live_magazine/reader
+chown 5000:5000 /opt/usr/share/live_magazine/reader
# End of a list of affected folder by the transmute attribute
snprintf(filename, len, "/libexec/liblive-%s.so", livebox->pkgid);
livebox->libexec = xmlStrdup((xmlChar *)filename);
+ DbgPrint("Use the default libexec: %s\n", filename);
free(filename);
if (!livebox->libexec) {
livebox_destroy(livebox);
return -ENOMEM;
}
-
- DbgPrint("Use the default libexec: %s\n", filename);
}
for (node = node->children; node; node = node->next) {
.sqlite_flush_max = 1048576,
.path = {
- .conf = "/opt/live/%s/etc/%s.conf",
- .image = "/opt/share/live_magazine/",
- .slave_log = "/opt/share/live_magazine/log",
- .script = "/opt/live/%s/res/script/%s.edj",
- .root = "/opt/live/",
- .script_port = "/opt/live/script_port/",
+ .conf = "/opt/usr/live/%s/etc/%s.conf",
+ .image = "/opt/usr/share/live_magazine/",
+ .slave_log = "/opt/usr/share/live_magazine/log",
+ .script = "/opt/usr/live/%s/res/script/%s.edj",
+ .root = "/opt/usr/live/",
+ .script_port = "/opt/usr/live/script_port/",
.db = "/opt/dbspace/.livebox.db",
},
},
.max_size_type = MAX_SIZE_LIST,
- .quality = "quality=100 compress=1",
- .error = "/opt/apps/com.samsung."PACKAGE"/res/images/error.png",
.ping_time = 240.0f,
.slave_max_load = 30,
.vconf_sys_cluster = "file/private/com.samsung.cluster-home/system_cluster",
ErrPrint("Heap: %s\n", strerror(errno));
}
-static void error_image_handler(char *buffer)
-{
- g_conf.error = strdup(buffer);
- if (!g_conf.error)
- ErrPrint("Heap: %s\n", strerror(errno));
-}
-
static void log_path_handler(char *buffer)
{
g_conf.path.slave_log = strdup(buffer);
.handler = log_path_handler,
},
{
- .name = "error_image",
- .handler = error_image_handler,
- },
- {
.name = "share_path",
.handler = share_path_handler,
},
#include <sys/types.h>
#include <unistd.h>
-#include "dlog.h"
+#include <dlog.h>
+
#include "conf.h"
#include "debug.h"
#include "util.h"
s_info.file_id = (s_info.file_id + 1) % MAX_LOG_FILE;
- namelen = strlen(s_info.filename) + strlen("/opt/var/log/") + 20;
+ namelen = strlen(s_info.filename) + strlen(SLAVE_LOG_PATH) + 20;
filename = malloc(namelen);
if (filename) {
- snprintf(filename, namelen, "/opt/var/log/%d_%s", s_info.file_id, s_info.filename);
+ snprintf(filename, namelen, "%s/%d_%s", SLAVE_LOG_PATH, s_info.file_id, s_info.filename);
if (s_info.fp)
fclose(s_info.fp);
return -ENOMEM;
}
- namelen = strlen(name) + strlen("/opt/var/log/") + 20;
+ namelen = strlen(name) + strlen(SLAVE_LOG_PATH) + 20;
filename = malloc(namelen);
if (!filename) {
return -ENOMEM;
}
- snprintf(filename, namelen, "/opt/var/log/%d_%s", s_info.file_id, name);
+ snprintf(filename, namelen, "%s/%d_%s", SLAVE_LOG_PATH, s_info.file_id, name);
s_info.fp = fopen(filename, "w+");
if (!s_info.fp) {
#include "instance.h"
#include "client_rpc.h"
#include "package.h"
+#include "conf.h"
static struct info {
Eina_List *call_list;
static void clear_log_file(struct slave_node *slave)
{
char filename[BUFSIZ];
- snprintf(filename, sizeof(filename), "/opt/share/live_magazine/log/slave.%d", slave_pid(slave));
+ snprintf(filename, sizeof(filename), "%s/slave.%d", SLAVE_LOG_PATH, slave_pid(slave));
unlink(filename);
}
int i;
char filename[BUFSIZ];
- snprintf(filename, sizeof(filename), "/opt/share/live_magazine/log/slave.%d", slave_pid(slave));
+ snprintf(filename, sizeof(filename), "%s/slave.%d", SLAVE_LOG_PATH, slave_pid(slave));
fp = fopen(filename, "rt");
if (!fp) {
ErrPrint("No log file found [%s]\n", strerror(errno));
}
option->item = item;
- item->option_list = eina_list_append(item->option_list, item);
+ item->option_list = eina_list_append(item->option_list, option);
return 0;
}
return slave_rpc_request_only(package_slave(inst->info), package_name(inst->info), packet, 0);
}
+int instance_signal_emit(struct inst_info *inst, const char *signal, const char *part, double sx, double sy, double ex, double ey, double x, double y, int down)
+{
+ const char *pkgname;
+ const char *id;
+ struct slave_node *slave;
+ struct packet *packet;
+ int ret;
+
+ pkgname = package_name(instance_package(inst));
+ id = instance_id(inst);
+ if (!pkgname || !id) {
+ ErrPrint("Invalid instance\n");
+ return -EINVAL;
+ }
+
+ DbgPrint("Package[%s], ID[%s]\n", pkgname, id);
+
+ slave = package_slave(instance_package(inst));
+ if (!slave) {
+ ErrPrint("Slave is not valid\n");
+ return -EINVAL;
+ }
+
+ packet = packet_create_noack("script", "ssssddddddi",
+ pkgname, id,
+ signal, part,
+ sx, sy, ex, ey,
+ x, y, down);
+ if (!packet) {
+ ErrPrint("Failed to create param\n");
+ return -EFAULT;
+ }
+
+ ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ return ret;
+}
+
int instance_text_signal_emit(struct inst_info *inst, const char *emission, const char *source, double sx, double sy, double ex, double ey)
{
struct packet *packet;
int ret;
const char *tmp;
const char *appid;
- char *path;
- int pathlen;
ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
if (ret != SQLITE_OK) {
package_set_lb_type(info, sqlite3_column_int(stmt, 3));
tmp = (const char *)sqlite3_column_text(stmt, 4);
if (tmp && strlen(tmp)) {
- pathlen = strlen("/opt/apps//") + strlen(appid) + strlen(tmp) + 1;
- path = malloc(pathlen);
- if (!path) {
- ErrPrint("Heap: %s\n", strerror(errno));
- sqlite3_reset(stmt);
- sqlite3_clear_bindings(stmt);
- sqlite3_finalize(stmt);
- return -ENOMEM;
- }
- snprintf(path, pathlen, "/opt/apps/%s/%s", appid, tmp);
-
- package_set_lb_path(info, path);
- DbgPrint("LB Path: %s\n", path);
- DbgFree(path);
+ package_set_lb_path(info, tmp);
+ DbgPrint("LB Path: %s\n", tmp);
tmp = (const char *)sqlite3_column_text(stmt, 5);
if (tmp && strlen(tmp))
package_set_pd_type(info, sqlite3_column_int(stmt, 6));
tmp = (const char *)sqlite3_column_text(stmt, 7);
if (tmp && strlen(tmp)) {
- pathlen = strlen("/opt/apps//") + strlen(appid) + strlen(tmp) + 1;
- path = malloc(pathlen);
- if (!path) {
- ErrPrint("Heap: %s\n", strerror(errno));
- sqlite3_reset(stmt);
- sqlite3_clear_bindings(stmt);
- sqlite3_finalize(stmt);
- return -ENOMEM;
- }
- snprintf(path, pathlen, "/opt/apps/%s/%s", appid, tmp);
- DbgPrint("PD Path: %s\n", path);
- package_set_pd_path(info, path);
- DbgFree(path);
+ package_set_pd_path(info, tmp);
+ DbgPrint("PD Path: %s\n", tmp);
tmp = (const char *)sqlite3_column_text(stmt, 8);
if (tmp && strlen(tmp))
{
Ecore_Evas *ee;
struct script_info *info;
- const char *pkgname;
- const char *id;
- struct slave_node *slave;
- struct packet *packet;
int ret;
ee = ecore_evas_ecore_evas_get(e);
if (!part || strlen(part) == 0)
part = "";
- pkgname = package_name(instance_package(info->inst));
- id = instance_id(info->inst);
- slave = package_slave(instance_package(info->inst));
- packet = packet_create_noack("script", "ssssddddddi",
- pkgname, id,
- signal, part,
- sx, sy, ex, ey,
- info->x, info->y, info->down);
- if (!packet) {
- ErrPrint("Failed to create param\n");
- return -EFAULT;
- }
-
- ret = slave_rpc_request_only(slave, pkgname, packet, 0);
+ ret = instance_signal_emit(info->inst, signal, part, sx, sy, ex, ey, info->x, info->y, info->down);
return ret;
}
slave_freeze_ttl(slave);
ret = instance_slave_open_pd(inst);
+ ret = instance_signal_emit(inst,
+ "pd,show", util_uri_to_path(instance_id(inst)),
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
/*!
* \note
if (slave)
slave_thaw_ttl(slave);
+ ret = instance_signal_emit(inst,
+ "pd,hide", util_uri_to_path(instance_id(inst)),
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
ret = instance_slave_close_pd(inst);
/*!
char *path;
len = strlen(pkgname) * 2;
- len += strlen("/opt/apps/%s/res/wgt/livebox/index.html");
+ len += strlen("/opt/usr/apps/%s/res/wgt/livebox/index.html");
path = malloc(len + 1);
if (!path) {
return -ENOMEM;
}
- snprintf(path, len, "/opt/apps/%s/res/wgt/livebox/index.html", pkgname);
+ snprintf(path, len, "/opt/usr/apps/%s/res/wgt/livebox/index.html", pkgname);
if (access(path, F_OK | R_OK) != 0) {
ErrPrint("%s is not a valid package\n", pkgname);
DbgFree(path);
+++ /dev/null
-/*
- * data-provider-master
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Sung-jae Park <nicesj.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
- *
- * 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 <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <Evas.h>
-#include <Ecore_X.h>
-#include <Ecore_Evas.h>
-
-#include <dlog.h>
-
-#include "virtual_canvas.h"
-#include "debug.h"
-#include "conf.h"
-#include "util.h"
-
-Evas *virtual_canvas_create(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) {
- ErrPrint("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);
- ErrPrint("Faield to get Evas object\n");
- return NULL;
- }
-
- return internal_e;
-}
-
-int virtual_canvas_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) {
- ErrPrint("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) {
- ErrPrint("Failed to get pixel data\n");
- return -EFAULT;
- }
-
- ret = virtual_canvas_flush_data_to_file(e, data, filename, w, h);
- return ret;
-}
-
-int virtual_canvas_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) {
- ErrPrint("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, DEFAULT_QUALITY)
- == EINA_FALSE) {
- evas_object_del(output);
- ErrPrint("Faield to save a captured image (%s)\n", filename);
- return -EFAULT;
- }
-
- evas_object_del(output);
-
- if (access(filename, F_OK) != 0) {
- ErrPrint("File %s is not found (%s)\n", filename, strerror(errno));
- return -EFAULT;
- }
-
- return 0;
-}
-
-int virtual_canvas_destroy(Evas *e)
-{
- Ecore_Evas *ee;
-
- ee = ecore_evas_ecore_evas_get(e);
- if (!ee) {
- ErrPrint("Failed to ecore evas object\n");
- return -EFAULT;
- }
-
- ecore_evas_free(ee);
- return 0;
-}
-
-/* End of a file */
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Wall -Werror")
ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
-ADD_DEFINITIONS("-DSOCKET_FILE=\"/opt/share/live_magazine/.live.socket\"")
+ADD_DEFINITIONS("-DSOCKET_FILE=\"/opt/usr/share/live_magazine/.live.socket\"")
ADD_EXECUTABLE(${PROJECT_NAME}
src/liveinfo.c