xfixes
dri2proto
xdamage
+ livebox-service # To import the error code
)
FOREACH(flag ${pkgs_CFLAGS})
Flora License
-Version 1.0, May, 2012
+Version 1.0, May, 2013
http://www.tizenopensource.org/license
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
Name: libprovider
Summary: Library for developing the livebox service provider.
-Version: 0.6.0
+Version: 0.6.2
Release: 1
-Group: framework/livebox
+Group: HomeTF/Livebox
License: Flora License
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake, gettext-tools, coreutils
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(dri2proto)
BuildRequires: pkgconfig(xdamage)
+BuildRequires: pkgconfig(livebox-service)
%description
Supporting the commnuncation channel with master service for livebox remote view.
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkg_LDFLAGS} "-ldl")
INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.${PROJECT_NAME}.xml DESTINATION /opt/share/packages)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.${PROJECT_NAME}.conf DESTINATION
- /opt/usr/live/org.tizen.${PROJECT_NAME}/etc)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/image/unknown.png DESTINATION
- /opt/usr/live/org.tizen.${PROJECT_NAME}/res/image)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.${PROJECT_NAME}.conf DESTINATION /opt/usr/live/org.tizen.${PROJECT_NAME}/etc)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/image/unknown.png DESTINATION /opt/usr/live/org.tizen.${PROJECT_NAME}/res/image)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION
/opt/usr/apps/org.tizen.${PROJECT_NAME}/bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
Group: main/app
License: Flora License
Source0: %{name}-%{version}.tar.gz
-BuildRequires: cmake, gettext-tools, coreutils
+BuildRequires: cmake, gettext-tools
BuildRequires: pkgconfig(appcore-efl)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(glib-2.0)
touch /opt/usr/live/org.tizen.live-app/libexec/liblive-org.tizen.live-app.so
%files -n org.tizen.live-app
-#%manifest org.tizen.data-provider-slave.manifest
+#%manifest org.tizen.live-app.manifest
%defattr(-,root,root,-)
/opt/usr/apps/org.tizen.live-app/bin/live-app
/opt/share/packages/*.xml
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
Group: main/app
License: Flora License
Source0: %{name}-%{version}.tar.gz
-BuildRequires: cmake, gettext-tools, coreutils
+BuildRequires: cmake, gettext-tools
BuildRequires: pkgconfig(appcore-efl)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(glib-2.0)
touch /opt/usr/live/org.tizen.live-video/libexec/liblive-org.tizen.live-video.so
%files -n org.tizen.live-video
-#%manifest org.tizen.data-provider-slave.manifest
+#%manifest org.tizen.live-video.manifest
%defattr(-,root,root,-)
/opt/usr/apps/org.tizen.live-video/bin/live-video
/opt/share/packages/*.xml
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
#include <tbm_bufmgr.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "debug.h"
#include "util.h"
s_info.disp = XOpenDisplay(NULL);
if (!s_info.disp) {
ErrPrint("Failed to open a display\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
s_info.disp_is_opened = 1;
if (!DRI2QueryExtension(s_info.disp, &s_info.evt_base, &s_info.err_base)) {
DbgPrint("DRI2 is not supported\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
if (!DRI2QueryVersion(s_info.disp, &dri2Major, &dri2Minor)) {
DbgPrint("DRI2 is not supported\n");
s_info.evt_base = 0;
s_info.err_base = 0;
- return 0;
+ return LB_STATUS_SUCCESS;
}
if (!DRI2Connect(s_info.disp, DefaultRootWindow(s_info.disp), &driverName, &deviceName)) {
DbgPrint("DRI2 is not supported\n");
s_info.evt_base = 0;
s_info.err_base = 0;
- return 0;
+ return LB_STATUS_SUCCESS;
}
s_info.fd = open(deviceName, O_RDWR);
DbgPrint("Failed to open a drm device: (%s)\n", strerror(errno));
s_info.evt_base = 0;
s_info.err_base = 0;
- return 0;
+ return LB_STATUS_SUCCESS;
}
drmGetMagic(s_info.fd, &magic);
s_info.fd = -1;
s_info.evt_base = 0;
s_info.err_base = 0;
- return 0;
+ return LB_STATUS_SUCCESS;
}
s_info.bufmgr = tbm_bufmgr_init(s_info.fd);
s_info.fd = -1;
s_info.evt_base = 0;
s_info.err_base = 0;
- return 0;
+ return LB_STATUS_SUCCESS;
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
int fb_fini(void)
s_info.screen = 0;
s_info.visual = NULL;
s_info.depth = 0;
- return 0;
+ return LB_STATUS_SUCCESS;
}
static inline int sync_for_file(struct fb_info *info)
buffer = info->buffer;
if (!buffer) {
DbgPrint("Buffer is NIL, skip sync\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
if (buffer->state != CREATED) {
ErrPrint("Invalid state of a FB\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (buffer->type != BUFFER_TYPE_FILE) {
DbgPrint("Ingore sync\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
fd = open(util_uri_to_path(info->id), O_WRONLY | O_CREAT, 0644);
if (fd < 0) {
ErrPrint("open %s: %s\n", util_uri_to_path(info->id), strerror(errno));
- return -EIO;
+ return LB_STATUS_ERROR_IO;
}
if (write(fd, buffer->data, info->bufsz) != info->bufsz) {
ErrPrint("write: %s\n", strerror(errno));
close(fd);
- return -EIO;
+ return LB_STATUS_ERROR_IO;
}
close(fd);
- return 0;
+ return LB_STATUS_SUCCESS;
}
static inline int sync_for_pixmap(struct fb_info *info)
buffer = info->buffer;
if (!buffer) {
DbgPrint("Buffer is NIL, skip sync\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
if (buffer->state != CREATED) {
ErrPrint("Invalid state of a FB\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (buffer->type != BUFFER_TYPE_PIXMAP) {
DbgPrint("Invalid buffer\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
if (info->handle == 0) {
DbgPrint("Pixmap ID is not valid\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (info->bufsz == 0) {
DbgPrint("Nothing can be sync\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
pixmap_info = (struct pixmap_info *)buffer->data;
*/
XShmPutImage(s_info.disp, (Pixmap)info->handle, pixmap_info->gc, pixmap_info->xim, 0, 0, 0, 0, info->w, info->h, False);
XSync(s_info.disp, False);
- return 0;
+ return LB_STATUS_SUCCESS;
}
int fb_sync(struct fb_info *info)
{
if (!info) {
ErrPrint("FB Handle is not valid\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (!info->id || info->id[0] == '\0') {
DbgPrint("Ingore sync\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
if (!strncasecmp(info->id, SCHEMA_FILE, strlen(SCHEMA_FILE))) {
} else if (!strncasecmp(info->id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
return sync_for_pixmap(info);
} else if (!strncasecmp(info->id, SCHEMA_SHM, strlen(SCHEMA_SHM))) {
- return 0;
+ return LB_STATUS_SUCCESS;
}
DbgPrint("Invalid URI: [%s]\n", info->id);
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
static inline struct fb_info *find_shm_by_pixmap(Pixmap id)
pixmap_info->si.shmid = shmget(IPC_PRIVATE, info->bufsz, IPC_CREAT | 0666);
if (pixmap_info->si.shmid < 0) {
ErrPrint("shmget: %s\n", strerror(errno));
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
DbgPrint("SHMID: %d (Size: %d)\n", pixmap_info->si.shmid, info->bufsz);
if (shmctl(pixmap_info->si.shmid, IPC_RMID, 0) < 0)
ErrPrint("shmctl: %s\n", strerror(errno));
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
DbgPrint("SHMADDR: 0x%p\n", pixmap_info->si.shmaddr);
if (shmctl(pixmap_info->si.shmid, IPC_RMID, 0) < 0)
ErrPrint("shmctl: %s\n", strerror(errno));
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
pixmap_info->xim->data = pixmap_info->si.shmaddr;
if (shmctl(pixmap_info->si.shmid, IPC_RMID, 0) < 0)
ErrPrint("shmctl: %s\n", strerror(errno));
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
s_info.shm_list = dlist_append(s_info.shm_list, info);
DbgPrint("Pixmap info is successfully created\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
static inline int destroy_pixmap_info(struct fb_info *info)
dlist_remove_data(s_info.shm_list, info);
DbgPrint("Successfully destroyed\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
static inline struct gem_data *create_gem(Pixmap pixmap, int w, int h, int depth)
}
free(gem);
- return 0;
+ return LB_STATUS_SUCCESS;
}
static inline void *acquire_gem(struct gem_data *gem)
{
if (info->gem) {
DbgPrint("Already created\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
info->gem = create_gem(info->handle, info->w, info->h, sizeof(int));
- return info->gem ? 0 : -EFAULT;
+ return info->gem ? LB_STATUS_SUCCESS : LB_STATUS_ERROR_FAULT;
}
int fb_destroy_gem(struct fb_info *info)
{
if (!info->gem) {
ErrPrint("GEM is not created\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
destroy_gem(info->gem);
info->gem = NULL;
- return 0;
+ return LB_STATUS_SUCCESS;
}
void *fb_acquire_gem(struct fb_info *info)
{
if (!info->gem) {
ErrPrint("Invalid FB info\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
release_gem(info->gem);
- return 0;
+ return LB_STATUS_SUCCESS;
}
int fb_destroy(struct fb_info *info)
{
if (!info) {
ErrPrint("Handle is not valid\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (info->buffer) {
free(info->id);
free(info);
- return 0;
+ return LB_STATUS_SUCCESS;
}
int fb_is_created(struct fb_info *info)
struct fb_info *info;
if (!data)
- return 0;
+ return LB_STATUS_SUCCESS;
info = find_shm_by_canvas(data);
if (info)
if (buffer->state != CREATED) {
ErrPrint("Invalid handle\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
switch (buffer->type) {
break;
default:
ErrPrint("Unknown type\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
- return 0;
+ return LB_STATUS_SUCCESS;
}
int fb_refcnt(void *data)
int ret;
if (!data)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
buffer = container_of(data, struct buffer, data);
if (buffer->state != CREATED) {
ErrPrint("Invalid handle\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
switch (buffer->type) {
case BUFFER_TYPE_SHM:
if (shmctl(buffer->refcnt, IPC_STAT, &buf) < 0) {
ErrPrint("shmctl: %s\n", strerror(errno));
- ret = -EFAULT;
+ ret = LB_STATUS_ERROR_FAULT;
break;
}
ret = buffer->refcnt;
break;
default:
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
break;
}
{
if (!info) {
ErrPrint("Handle is not valid\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
*w = info->w;
*h = info->h;
- return 0;
+ return LB_STATUS_SUCCESS;
}
int fb_size(struct fb_info *info)
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
#include <com-core_packet.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "dlist.h"
#include "util.h"
&(arg.info.content_event.info.pointer.down));
if (ret != 11) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
goto errout;
}
arg.type = EVENT_CONTENT_EVENT;
if (s_info.table.content_event)
- ret = s_info.table.content_event(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.content_event(&arg, s_info.data);
errout:
return NULL;
&arg.info.clicked.x, &arg.info.clicked.y);
if (ret != 6) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
goto errout;
}
arg.type = EVENT_CLICKED;
if (s_info.table.clicked)
- ret = s_info.table.clicked(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.clicked(&arg, s_info.data);
errout:
return NULL;
if (ret != 8) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
goto errout;
}
arg.type = EVENT_TEXT_SIGNAL;
if (s_info.table.text_signal)
- ret = s_info.table.text_signal(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.text_signal(&arg, s_info.data);
errout:
return NULL;
ret = packet_get(packet, "ss", &arg.pkgname, &arg.id);
if (ret != 2) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
if (s_info.table.lb_destroy)
ret = s_info.table.lb_destroy(&arg, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
result = packet_create_reply(packet, "i", ret);
ret = packet_get(packet, "ssii", &arg.pkgname, &arg.id, &arg.info.resize.w, &arg.info.resize.h);
if (ret != 4) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
if (s_info.table.resize)
ret = s_info.table.resize(&arg, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
result = packet_create_reply(packet, "i", ret);
&arg.info.lb_recreate.abi);
if (ret != 11) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
if (s_info.table.lb_recreate)
ret = s_info.table.lb_recreate(&arg, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
if (arg.info.lb_recreate.out_content)
&arg.info.lb_create.height);
if (ret != 12) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
if (s_info.table.lb_create)
ret = s_info.table.lb_create(&arg, &width, &height, &priority, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
if (arg.info.lb_create.out_content)
ret = packet_get(packet, "ssd", &arg.pkgname, &arg.id, &arg.info.set_period.period);
if (ret != 3) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
if (s_info.table.set_period)
ret = s_info.table.set_period(&arg, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
result = packet_create_reply(packet, "i", ret);
&arg.info.change_group.cluster, &arg.info.change_group.category);
if (ret != 4) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
if (s_info.table.change_group)
ret = s_info.table.change_group(&arg, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
result = packet_create_reply(packet, "i", ret);
ret = packet_get(packet, "ssi", &arg.pkgname, &arg.id, &arg.info.pinup.state);
if (ret != 3) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
if (s_info.table.pinup)
ret = s_info.table.pinup(&arg, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
content = "default";
ret = packet_get(packet, "ssss", &arg.pkgname, &arg.id, &arg.info.update_content.cluster, &arg.info.update_content.category);
if (ret != 4) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
goto errout;
}
arg.type = EVENT_UPDATE_CONTENT;
if (s_info.table.update_content)
- ret = s_info.table.update_content(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.update_content(&arg, s_info.data);
errout:
return NULL;
ret = packet_get(packet, "d", &arg.info.pause.timestamp);
if (ret != 1) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
arg.pkgname = NULL;
if (s_info.table.pause)
ret = s_info.table.pause(&arg, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
result = packet_create_reply(packet, "i", ret);
ret = packet_get(packet, "d", &arg.info.resume.timestamp);
if (ret != 1) {
ErrPrint("Parameter is not valid\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
goto errout;
}
if (s_info.table.resume)
ret = s_info.table.resume(&arg, s_info.data);
else
- ret = -ENOSYS;
+ ret = LB_STATUS_ERROR_NOT_IMPLEMENTED;
errout:
result = packet_create_reply(packet, "i", ret);
ret = packet_get(packet, "ssiidd", &arg.pkgname, &arg.id, &arg.info.pd_create.w, &arg.info.pd_create.h, &arg.info.pd_create.x, &arg.info.pd_create.y);
if (ret != 6) {
ErrPrint("Invalid packet\n");
- ret = -EINVAL;
goto out;
}
arg.type = EVENT_PD_CREATE;
if (s_info.table.pd_create)
- ret = s_info.table.pd_create(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.pd_create(&arg, s_info.data);
out:
return NULL;
ret = packet_get(packet, "ssiidd", &arg.pkgname, &arg.id, &arg.info.pd_move.w, &arg.info.pd_move.h, &arg.info.pd_move.x, &arg.info.pd_move.y);
if (ret != 6) {
ErrPrint("Invalid packet\n");
- ret = -EINVAL;
goto out;
}
arg.type = EVENT_PD_MOVE;
if (s_info.table.pd_move)
- ret = s_info.table.pd_move(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.pd_move(&arg, s_info.data);
out:
return NULL;
ret = packet_get(packet, "ss", &arg.pkgname, &arg.id);
if (ret != 2) {
ErrPrint("Invalid packet\n");
- ret = -EINVAL;
goto out;
}
arg.type = EVENT_PD_DESTROY;
if (s_info.table.pd_destroy)
- ret = s_info.table.pd_destroy(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.pd_destroy(&arg, s_info.data);
out:
return NULL;
double timestamp;
int ret;
- if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+ ret = packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
&arg.info.pd_access.w, &arg.info.pd_access.h,
×tamp,
- &arg.info.pd_access.x, &arg.info.pd_access.y) != 7)
- {
+ &arg.info.pd_access.x, &arg.info.pd_access.y);
+ if (ret != 7) {
ErrPrint("Invalid packet\n");
goto out;
}
arg.type = EVENT_PD_ACCESS;
arg.info.pd_access.event = ACCESS_READ;
if (s_info.table.pd_access)
- ret = s_info.table.pd_access(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.pd_access(&arg, s_info.data);
out:
return NULL;
arg.type = EVENT_PD_ACCESS;
arg.info.pd_access.event = ACCESS_READ_PREV;
if (s_info.table.pd_access)
- ret = s_info.table.pd_access(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.pd_access(&arg, s_info.data);
out:
return NULL;
arg.type = EVENT_PD_ACCESS;
arg.info.pd_access.event = ACCESS_READ_NEXT;
if (s_info.table.pd_access)
- ret = s_info.table.pd_access(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.pd_access(&arg, s_info.data);
out:
return NULL;
arg.type = EVENT_PD_ACCESS;
arg.info.pd_access.event = ACCESS_ACTIVATE;
if (s_info.table.pd_access)
- ret = s_info.table.pd_access(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.pd_access(&arg, s_info.data);
out:
return NULL;
arg.type = EVENT_LB_ACCESS;
arg.info.lb_access.event = ACCESS_READ;
if (s_info.table.lb_access)
- ret = s_info.table.lb_access(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.lb_access(&arg, s_info.data);
out:
return NULL;
double timestamp;
int ret;
- if (packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
+ ret = packet_get(packet, "ssiiddd", &arg.pkgname, &arg.id,
&arg.info.lb_access.w, &arg.info.lb_access.h,
×tamp,
- &arg.info.lb_access.x, &arg.info.lb_access.y) != 7)
- {
+ &arg.info.lb_access.x, &arg.info.lb_access.y);
+ if (ret != 7) {
ErrPrint("Invalid packet\n");
goto out;
}
arg.type = EVENT_LB_ACCESS;
arg.info.lb_access.event = ACCESS_READ_PREV;
if (s_info.table.lb_access)
- ret = s_info.table.lb_access(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.lb_access(&arg, s_info.data);
out:
return NULL;
&arg.info.lb_access.w, &arg.info.lb_access.h,
×tamp,
&arg.info.lb_access.x, &arg.info.lb_access.y);
- if (ret != 7)
- {
+ if (ret != 7) {
ErrPrint("Invalid packet\n");
goto out;
}
arg.type = EVENT_LB_ACCESS;
arg.info.lb_access.event = ACCESS_READ_NEXT;
if (s_info.table.lb_access)
- ret = s_info.table.lb_access(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.lb_access(&arg, s_info.data);
out:
return NULL;
arg.type = EVENT_LB_ACCESS;
arg.info.lb_access.event = ACCESS_ACTIVATE;
if (s_info.table.lb_access)
- ret = s_info.table.lb_access(&arg, s_info.data);
- else
- ret = -ENOSYS;
+ (void)s_info.table.lb_access(&arg, s_info.data);
out:
return NULL;
if (!name || !table) {
ErrPrint("Invalid argument\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (s_info.name) {
ErrPrint("Provider is already initialized\n");
- return -EALREADY;
+ return LB_STATUS_ERROR_ALREADY;
}
s_info.name = strdup(name);
if (!s_info.name) {
ErrPrint("Heap: %s\n", strerror(errno));
- return -ENOMEM;
+ return LB_STATUS_ERROR_MEMORY;
}
memcpy(&s_info.table, table, sizeof(*table));
ret = com_core_packet_client_init(SLAVE_SOCKET, 0, s_table);
if (ret < 0) {
ErrPrint("Failed to establish the connection with the master\n");
- return s_info.fd;
+ return LB_STATUS_ERROR_FAULT;
}
provider_buffer_init(disp);
DbgPrint("Slave is initialized\n");
- return 0;
+ return LB_STATUS_SUCCESS;
}
EAPI void *provider_fini(void)
if (!pkgname || !id || !funcname) {
ErrPrint("Invalid argument\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
packet = packet_create_noack("call", "ssss", s_info.name, pkgname, id, funcname);
if (!packet) {
ErrPrint("Failed to create a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
ret = com_core_packet_send_only(s_info.fd, packet);
packet_destroy(packet);
- return ret;
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
}
EAPI int provider_send_ret(const char *pkgname, const char *id, const char *funcname)
if (!pkgname || !id || !funcname) {
ErrPrint("Invalid argument\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
packet = packet_create_noack("ret", "ssss", s_info.name, pkgname, id, funcname);
if (!packet) {
ErrPrint("Failed to create a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
ret = com_core_packet_send_only(s_info.fd, packet);
packet_destroy(packet);
- return ret;
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
}
EAPI int provider_send_faulted(const char *pkgname, const char *id, const char *funcname)
if (!pkgname || !id || !funcname) {
ErrPrint("Invalid argument\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
packet = packet_create_noack("faulted", "ssss", s_info.name, pkgname, id, funcname);
if (!packet) {
ErrPrint("Failed to create a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
ret = com_core_packet_send_only(s_info.fd, packet);
packet_destroy(packet);
- return ret;
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
}
EAPI int provider_send_hello(void)
if (!s_info.name) {
ErrPrint("Provider is not initialized\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (s_info.fd < 0) {
ErrPrint("Connection is not established\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
packet = packet_create_noack("hello", "s", s_info.name);
if (!packet) {
ErrPrint("Failed to create a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
ret = com_core_packet_send_only(s_info.fd, packet);
packet_destroy(packet);
- return ret;
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
}
EAPI int provider_send_ping(void)
DbgPrint("name[%s]\n", s_info.name);
if (!s_info.name) {
ErrPrint("Provider is not initialized\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (s_info.fd < 0) {
ErrPrint("Connection is not established\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
packet = packet_create_noack("ping", "s", s_info.name);
if (!packet) {
ErrPrint("Failed to create a a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
ret = com_core_packet_send_only(s_info.fd, packet);
packet_destroy(packet);
- return ret;
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
}
static inline void keep_file_in_safe(const char *id)
if (s_info.prevent_overwrite)
return;
- if (access(path, R_OK | F_OK) != 0)
+ if (access(path, R_OK | F_OK) != 0) {
+ ErrPrint("[%s] %s\n", path, strerror(errno));
return;
+ }
len = strlen(path);
base_idx = len - 1;
if (!pkgname || !id) {
ErrPrint("Invalid argument\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (!content_info)
if (s_info.fd < 0) {
ErrPrint("Connection is not established\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
keep_file_in_safe(id);
s_info.name, pkgname, id, w, h, priority, content_info, title);
if (!packet) {
ErrPrint("failed to build a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
ret = com_core_packet_send_only(s_info.fd, packet);
packet_destroy(packet);
- return ret;
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
}
EAPI int provider_send_desc_updated(const char *pkgname, const char *id, const char *descfile)
if (!pkgname || !id) {
ErrPrint("Invalid argument\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (s_info.fd < 0) {
ErrPrint("Connection is not established\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (!descfile)
packet = packet_create_noack("desc_updated", "ssss", s_info.name, pkgname, id, descfile);
if (!packet) {
ErrPrint("Failed to build a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
ret = com_core_packet_send_only(s_info.fd, packet);
packet_destroy(packet);
- return ret;
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
}
EAPI int provider_send_deleted(const char *pkgname, const char *id)
if (!pkgname || !id) {
ErrPrint("Invalid arguement\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (s_info.fd < 0) {
ErrPrint("Connection is not established\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
packet = packet_create_noack("deleted", "sss", s_info.name, pkgname, id);
if (!packet) {
ErrPrint("Failed to build a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
ret = com_core_packet_send_only(s_info.fd, packet);
packet_destroy(packet);
- return ret;
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
}
const char *provider_name(void)
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
#include <com-core_packet.h>
#include <dlog.h>
+#include <livebox-errno.h>
#include "dlist.h"
#include "util.h"
packet = packet_create("release_buffer", "isss", type, provider_name(), pkgname, id);
if (!packet) {
ErrPrint("Failed to build a packet\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
result = com_core_packet_oneshot_send(SLAVE_SOCKET, packet, 0.0f);
packet_destroy(packet);
if (!result) {
ErrPrint("Failed to send a request\n");
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid result packet\n");
- ret = -EINVAL;
+ ret = LB_STATUS_ERROR_INVALID;
}
packet_unref(result);
{
if (!handle || handle->state != BUFFER_CREATED) {
ErrPrint("info is not valid\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
handle->user_data = data;
- return 0;
+ return LB_STATUS_SUCCESS;
}
EAPI void *provider_buffer_user_data(struct livebox_buffer *handle)
if (!info || info->state != BUFFER_CREATED) {
ErrPrint("info is not valid\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
fb = send_resize_request(info->type, info->pkgname, info->id, w, h);
if (!fb)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
/*!
* \note
* it only can be destroyed when there is no reference exists.
*/
info->fb = fb;
- return 0;
+ return LB_STATUS_SUCCESS;
}
EAPI void *provider_buffer_ref(struct livebox_buffer *info)
{
if (!ptr) {
ErrPrint("PTR is not valid\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
return fb_release_buffer(ptr);
if (!info || info->state != BUFFER_CREATED) {
ErrPrint("Buffer handler is NULL\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
dlist_remove_data(s_info.buffer_list, info);
free(info->pkgname);
free(info->id);
free(info);
- return 0;
+ return LB_STATUS_SUCCESS;
}
EAPI int provider_buffer_sync(struct livebox_buffer *info)
{
if (!info || info->state != BUFFER_CREATED) {
ErrPrint("Buffer handler is NULL\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
return fb_sync(info->fb);
{
if (!info || info->state != BUFFER_CREATED) {
ErrPrint("Buffer handler is NULL\n");
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
}
if (w)
if (pixel_size)
*pixel_size = info->pixel_size;
- return 0;
+ return LB_STATUS_SUCCESS;
}
EAPI const char *provider_buffer_uri(struct livebox_buffer *info)
EAPI int provider_buffer_pixmap_create_hw(struct livebox_buffer *info)
{
if (!fb_has_gem(info->fb))
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
return fb_create_gem(info->fb);
}
EAPI int provider_buffer_pixmap_destroy_hw(struct livebox_buffer *info)
{
if (!fb_has_gem(info->fb))
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
return fb_destroy_gem(info->fb);
}
EAPI int provider_buffer_pre_render(struct livebox_buffer *info)
{
- int ret = 0;
+ int ret = LB_STATUS_SUCCESS;
if (fb_has_gem(info->fb))
ret = fb_acquire_gem(info->fb) ? 0 : -EFAULT;
EAPI int provider_buffer_post_render(struct livebox_buffer *info)
{
- int ret = 0;
+ int ret = LB_STATUS_SUCCESS;
if (fb_has_gem(info->fb))
ret = fb_release_gem(info->fb);
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.