extern void package_del_ctx_info(struct pkg_info *pkginfo, struct context_info *info);
extern void package_set_direct_input(struct pkg_info *info, int direct_input);
extern int package_direct_input(const struct pkg_info *info);
+extern void package_set_auto_align(struct pkg_info *info, int auto_align);
+extern int package_auto_align(const struct pkg_info *info);
extern const char *package_hw_acceleration(struct pkg_info *info);
extern int package_set_hw_acceleration(struct pkg_info *info, const char *hw_acceleration);
extern int package_faulted(struct pkg_info *info, int broadcast);
extern char *package_get_pkgid(const char *appid);
-extern int package_instance_count(struct pkg_info *info);
+extern int package_instance_count(struct pkg_info *info, int include_deleting);
extern char *package_meta_tag(const char *appid, const char *meta_tag);
/* End of a file */
extern void slave_load_package(struct slave_node *slave);
extern void slave_unload_package(struct slave_node *slave);
extern int const slave_loaded_package(struct slave_node *slave);
-extern struct slave_node *slave_find_available(const char *slave_pkgname, const char *abi, int secured, int network, const char *hw_acceleration);
+extern struct slave_node *slave_find_available(const char *slave_pkgname, const char *abi, int secured, int network, const char *hw_acceleration, int auto_align);
extern double const slave_ttl(const struct slave_node *slave);
Name: data-provider-master
Summary: Master service provider for widgetes
-Version: 1.2.0
+Version: 1.3.0
Release: 1
Group: Applications/Core Applications
License: Flora-1.1
CREATE TABLE i18n ( pkgid TEXT NOT NULL, lang TEXT COLLATE NOCASE, name TEXT, icon TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
CREATE TABLE option ( pkgid TEXT NOT NULL, option_id INTEGER, key TEXT NOT NULL, value TEXT NOT NULL, FOREIGN KEY(option_id) REFERENCES groupmap(option_id), FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
CREATE TABLE pkgmap ( pkgid TEXT PRIMARY KEY NOT NULL, appid TEXT, uiapp TEXT, prime INTEGER, category TEXT DEFAULT 'http://tizen.org/category/default' );
-CREATE TABLE provider ( pkgid TEXT PRIMARY KEY NOT NULL, network INTEGER, abi TEXT, secured INTEGER, box_type INTEGER, box_src TEXT, box_group TEXT, gbar_type INTEGER, gbar_src TEXT, gbar_group TEXT, libexec TEXT, timeout INTEGER, period TEXT, script TEXT, pinup INTEGER, count INTEGER, direct_input INTEGER DEFAULT 0, hw_acceleration TEXT DEFAULT '', FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE provider ( pkgid TEXT PRIMARY KEY NOT NULL, network INTEGER, abi TEXT, secured INTEGER, box_type INTEGER, box_src TEXT, box_group TEXT, gbar_type INTEGER, gbar_src TEXT, gbar_group TEXT, libexec TEXT, timeout INTEGER, period TEXT, script TEXT, pinup INTEGER, count INTEGER, direct_input INTEGER DEFAULT 0, hw_acceleration TEXT DEFAULT '', auto_align INTEGER DEFAULT 0, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
EOF
%pre
#define ErrPrintWithConsole(format, arg...) do { fprintf(stderr, "[%s/%s:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); } while (0)
#endif
-#define CUR_VER 5
+#define CUR_VER 6
#define DEFAULT_CATEGORY "http://tizen.org/category/default"
extern int begin_transaction(void);
#define ErrPrintWithConsole(format, arg...) do { fprintf(stderr, "[%s/%s:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); } while (0)
#endif
-#define CUR_VER 5
-#define DEFAULT_CATEGORY "http://tizen.org/category/default"
#define SCHEME_HTTP "http://"
#define SCHEME_HTTPS "https://"
#define SCHEME_FILE "file://"
*
*
* provider
- * +-------+---------+-----+---------+----------+---------+-----------+---------+--------+----------+---------+---------+--------+--------+-------+-----------------------+
- * | pkgid | network | abi | secured | box_type | box_src | box_group | gbar_type | gbar_src | gbar_group | libexec | timeout | period | script | pinup | count(from ver 4) | direct_input | hw_acceleration |
- * +-------+---------+-----+---------+----------+---------+-----------+---------+--------+----------+---------+---------+--------+--------+-------+-----------------------+-------|---------------|
- * | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
- * +-------+---------+-----+---------+----------+---------+-----------+---------+--------+----------+---------+---------+--------+--------+-------+-----------------------+-------|---------------|
- * CREATE TABLE provider ( pkgid TEXT PRIMARY KEY NOT NULL, network INTEGER, abi TEXT, secured INTEGER, box_type INTEGER, box_src TEXT, box_group TEXT, gbar_type TEXT, gbar_src TEXT, gbar_group TEXT, libexec TEXT, timeout INTEGER, period TEXT, script TEXT, pinup INTEGER, count INTEGER, direct_input INTEGER DEFAULT 0, hw_acceleration TEXT DEFAULT 'none', FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid))
+ * +-------+---------+-----+---------+----------+---------+-----------+-----------+----------+------------+---------+---------+--------+--------+-------+-------------------+--------------+-----------------+------------+
+ * | pkgid | network | abi | secured | box_type | box_src | box_group | gbar_type | gbar_src | gbar_group | libexec | timeout | period | script | pinup | count(from ver 4) | direct_input | hw_acceleration | auto_align |
+ * +-------+---------+-----+---------+----------+---------+-----------+-----------+----------+------------+---------+---------+--------+--------+-------+-------------------+--------------|-----------------+------------+
+ * | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
+ * +-------+---------+-----+---------+----------+---------+-----------+-----------+----------+------------+---------+---------+--------+--------+-------+-------------------+--------------|-----------------+------------+
+ * CREATE TABLE provider ( pkgid TEXT PRIMARY KEY NOT NULL, network INTEGER, abi TEXT, secured INTEGER, box_type INTEGER, box_src TEXT, box_group TEXT, gbar_type TEXT, gbar_src TEXT, gbar_group TEXT, libexec TEXT, timeout INTEGER, period TEXT, script TEXT, pinup INTEGER, count INTEGER, direct_input INTEGER DEFAULT 0, hw_acceleration TEXT DEFAULT 'none', auto_align INTEGER DEFAULT 0, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid))
*
* = box_type = { text | buffer | script | image }
* = gbar_type = { text | buffer | script }
xmlChar *gbar_group;
xmlChar *gbar_size; /* Default PD size */
xmlChar *hw_acceleration;
+ int auto_align;
struct dlist *i18n_list;
struct dlist *group_list;
const char *dbfile;
sqlite3 *handle;
} s_info = {
- .dbfile = "/usr/dbspace/.widget.db",
+ .dbfile = "/opt/dbspace/.widget.db",
.handle = NULL,
};
static inline xmlChar *abspath_strdup(xmlChar *src)
{
- return xmlMalloc(xmlStrlen(src) + 2);
+ return xmlMalloc(xmlStrlen(src) + 3);
}
int begin_transaction(void)
}
}
+/**
+ * From version 5 to 6
+ * "provider" table should have "auto_align" column.
+ * "auto_align" will be used for selecting engine for rendering of widget window.
+ * If it is "true", the widget will creates auto-alignment enabled window buffer.
+ */
+static void upgrade_to_version_6(void)
+{
+ char *err;
+ static const char *ddl;
+
+ /**
+ * Step 1
+ * Create a new column "auto_align" for provider table
+ */
+ ddl = "ALTER TABLE provider ADD COLUMN auto_align INTEGER DEFAULT 0";
+ if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+ ErrPrint("Failed to execute the DDL (%s)\n", err);
+ return;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ ErrPrint("No chages to DB\n");
+ }
+}
+
/*!
* \note
* From version 3 to 4
upgrade_to_version_4();
case 4:
upgrade_to_version_5();
+ case 5:
+ upgrade_to_version_6();
default:
/* Need to update version */
DbgPrint("Old version: %d\n", version);
"abi TEXT, secured INTEGER, box_type INTEGER, " \
"box_src TEXT, box_group TEXT, gbar_type INTEGER, " \
"gbar_src TEXT, gbar_group TEXT, libexec TEXT, timeout INTEGER, period TEXT, script TEXT, pinup INTEGER, "\
- "count INTEGER, direct_input INTEGER DEFAULT 0, hw_acceleration TEXT DEFAULT 'none', "\
+ "count INTEGER, direct_input INTEGER DEFAULT 0, hw_acceleration TEXT DEFAULT 'none', auto_align INTEGER DEFAULT 0, "\
"FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE)";
if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
char *period = (char *)widget->period;
char *script = (char *)widget->script;
char *hw_acceleration = (char *)widget->hw_acceleration;
+ int auto_align = widget->auto_align;
if (!abi) {
abi = "c";
hw_acceleration = "none";
}
- dml = "INSERT INTO provider ( pkgid, network, abi, secured, box_type, box_src, box_group, gbar_type, gbar_src, gbar_group, libexec, timeout, period, script, pinup, count, direct_input, hw_acceleration) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ dml = "INSERT INTO provider ( pkgid, network, abi, secured, box_type, box_src, box_group, gbar_type, gbar_src, gbar_group, libexec, timeout, period, script, pinup, count, direct_input, hw_acceleration, auto_align) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
if (ret != SQLITE_OK) {
ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
goto out;
}
+ ret = sqlite3_bind_int(stmt, 19, auto_align);
+ if (ret != SQLITE_OK) {
+ ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
+ ret = -EIO;
+ goto out;
+ }
+
ret = 0;
if (sqlite3_step(stmt) != SQLITE_DONE) {
ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
}
}
- if (xmlHasProp(node, (const xmlChar *)"need_frame")) {
+ if (xmlHasProp(node, (const xmlChar *)"need-frame")) {
+ xmlChar *need_frame;
+
+ need_frame = xmlGetProp(node, (const xmlChar *)"need-frame");
+ if (need_frame) {
+ widget->need_frame[idx] = !xmlStrcasecmp(need_frame, (const xmlChar *)"true");
+ xmlFree(need_frame);
+ } else {
+ widget->need_frame[idx] = widget->default_need_frame;
+ }
+ } else if (xmlHasProp(node, (const xmlChar *)"need_frame")) {
xmlChar *need_frame;
need_frame = xmlGetProp(node, (const xmlChar *)"need_frame");
widget->need_frame[idx] = widget->default_need_frame;
}
- if (xmlHasProp(node, (const xmlChar *)"touch_effect")) {
+
+ if (xmlHasProp(node, (const xmlChar *)"touch-effect")) {
+ xmlChar *touch_effect;
+
+ touch_effect = xmlGetProp(node, (const xmlChar *)"touch-effect");
+ if (touch_effect) {
+ widget->touch_effect[idx] = !xmlStrcasecmp(touch_effect, (const xmlChar *)"true");
+ xmlFree(touch_effect);
+ } else {
+ widget->touch_effect[idx] = widget->default_touch_effect;
+ }
+ } else if (xmlHasProp(node, (const xmlChar *)"touch_effect")) {
xmlChar *touch_effect;
touch_effect = xmlGetProp(node, (const xmlChar *)"touch_effect");
widget->touch_effect[idx] = widget->default_touch_effect;
}
- if (xmlHasProp(node, (const xmlChar *)"mouse_event")) {
+ if (xmlHasProp(node, (const xmlChar *)"mouse-event")) {
+ xmlChar *mouse_event;
+
+ mouse_event = xmlGetProp(node, (const xmlChar *)"mouse-event");
+ if (mouse_event) {
+ widget->mouse_event[idx] = !xmlStrcasecmp(mouse_event, (const xmlChar *)"true");
+ xmlFree(mouse_event);
+ } else {
+ widget->mouse_event[idx] = widget->default_mouse_event;
+ }
+ } else if (xmlHasProp(node, (const xmlChar *)"mouse_event")) {
xmlChar *mouse_event;
mouse_event = xmlGetProp(node, (const xmlChar *)"mouse_event");
}
}
- if (!xmlHasProp(node, (const xmlChar *)"mouse_event")) {
- widget->default_mouse_event = 0;
- } else {
+ /**
+ * @note
+ * mouse_event is internal style name of attribute.
+ * It should be replaced with "mouse-event" for public one.
+ * But we should keep the old style also.
+ * Try to find "mouse_event" first and if it fails, try to find "mouse-event"
+ */
+ if (xmlHasProp(node, (const xmlChar *)"mouse-event")) {
+ xmlChar *mouse_event;
+
+ mouse_event = xmlGetProp(node, (const xmlChar *)"mouse-event");
+ if (!mouse_event) {
+ ErrPrint("mouse_event is NIL\n");
+ widget->default_mouse_event = 0;
+ } else {
+ widget->default_mouse_event = !xmlStrcasecmp(mouse_event, (const xmlChar *)"true");
+ xmlFree(mouse_event);
+ }
+ } else if (xmlHasProp(node, (const xmlChar *)"mouse_event")) {
xmlChar *mouse_event;
mouse_event = xmlGetProp(node, (const xmlChar *)"mouse_event");
widget->default_mouse_event = !xmlStrcasecmp(mouse_event, (const xmlChar *)"true");
xmlFree(mouse_event);
}
+ } else {
+ widget->default_mouse_event = 0;
}
- if (!xmlHasProp(node, (const xmlChar *)"touch_effect")) {
- widget->default_touch_effect = 0;
- } else {
+ if (xmlHasProp(node, (const xmlChar *)"touch-effect")) {
+ xmlChar *touch_effect;
+
+ touch_effect = xmlGetProp(node, (const xmlChar *)"touch-effect");
+ if (!touch_effect) {
+ ErrPrint("default touch_effect is NIL\n");
+ widget->default_touch_effect = 0;
+ } else {
+ widget->default_touch_effect = !xmlStrcasecmp(touch_effect, (const xmlChar *)"true");
+ xmlFree(touch_effect);
+ }
+ } else if (xmlHasProp(node, (const xmlChar *)"touch_effect")) {
xmlChar *touch_effect;
touch_effect = xmlGetProp(node, (const xmlChar *)"touch_effect");
widget->default_touch_effect = !xmlStrcasecmp(touch_effect, (const xmlChar *)"true");
xmlFree(touch_effect);
}
+ } else {
+ widget->default_touch_effect = 0;
}
- if (!xmlHasProp(node, (const xmlChar *)"need_frame")) {
- widget->default_need_frame = 0;
- } else {
+ if (xmlHasProp(node, (const xmlChar *)"need-frame")) {
+ xmlChar *need_frame;
+
+ need_frame = xmlGetProp(node, (const xmlChar *)"need-frame");
+ if (!need_frame) {
+ ErrPrint("default need_frame is NIL\n");
+ widget->default_need_frame = 0;
+ } else {
+ widget->default_need_frame = !xmlStrcasecmp(need_frame, (const xmlChar *)"true");
+ xmlFree(need_frame);
+ }
+ } else if (xmlHasProp(node, (const xmlChar *)"need_frame")) {
xmlChar *need_frame;
need_frame = xmlGetProp(node, (const xmlChar *)"need_frame");
widget->default_need_frame = !xmlStrcasecmp(need_frame, (const xmlChar *)"true");
xmlFree(need_frame);
}
+ } else {
+ widget->default_need_frame = 0;
}
for (node = node->children; node; node = node->next) {
return 0;
}
- /**
- * @todo
- * Need to find a replacement of this API
- *
ret = pkgmgrinfo_appinfo_get_metadata_value(handle, meta_tag, &value);
if (ret != PMINFO_R_OK) {
pkgmgrinfo_appinfo_destroy_appinfo(handle);
return 0;
}
- */
ret = value && value[0] != '\0';
}
}
+ if (xmlHasProp(node, (const xmlChar *)"auto-align")) {
+ tmp = xmlGetProp(node, (const xmlChar *)"auto-align");
+ widget->auto_align = tmp && !xmlStrcasecmp(tmp, (const xmlChar *)"true");
+ xmlFree(tmp);
+ }
+
if (xmlHasProp(node, (const xmlChar *)"abi")) {
widget->abi = xmlGetProp(node, (const xmlChar *)"abi");
if (!widget->abi) {
widget->default_touch_effect = 0;
widget->default_need_frame = 0;
widget->size_list = WIDGET_SIZE_TYPE_2x2;
+ widget->auto_align = 0;
/**
* @note
inst->state = INST_ACTIVATED;
+ if (inst->requested_state == INST_DESTROYED) {
+ /**
+ * In this case, we should destroy the instance.
+ */
+ DbgPrint("Destroy Instance\n");
+ instance_destroy(inst, WIDGET_DESTROY_TYPE_DEFAULT);
+ }
+
instance_create_widget_buffer(inst, WIDGET_CONF_DEFAULT_PIXELS);
instance_broadcast_created_event(inst);
instance_thaw_updator(inst);
static inline int build_provider_info(struct pkg_info *info)
{
- static const char *dml = "SELECT provider.network, provider.abi, provider.secured, provider.box_type, provider.box_src, provider.box_group, provider.gbar_type, provider.gbar_src, provider.gbar_group, provider.libexec, provider.timeout, provider.period, provider.script, provider.pinup, pkgmap.appid, provider.direct_input, provider.hw_acceleration, pkgmap.category FROM provider, pkgmap WHERE pkgmap.pkgid = ? AND provider.pkgid = ?";
+ static const char *dml = "SELECT provider.network, provider.abi, provider.secured, provider.box_type, provider.box_src, provider.box_group, provider.gbar_type, provider.gbar_src, provider.gbar_group, provider.libexec, provider.timeout, provider.period, provider.script, provider.pinup, pkgmap.appid, provider.direct_input, provider.hw_acceleration, pkgmap.category, provider.auto_align FROM provider, pkgmap WHERE pkgmap.pkgid = ? AND provider.pkgid = ?";
sqlite3_stmt *stmt;
int ret;
const char *tmp;
package_set_direct_input(info, sqlite3_column_int(stmt, 15));
package_set_hw_acceleration(info, (const char *)sqlite3_column_text(stmt, 16));
package_set_category(info, (const char *)sqlite3_column_text(stmt, 17));
+ package_set_auto_align(info, sqlite3_column_int(stmt, 18));
sqlite3_reset(stmt);
sqlite3_clear_bindings(stmt);
unsigned int height;
} gbar;
- int network;
- int secured;
- int direct_input;
char *script; /* script type: edje, ... */
char *abi;
char *hw_acceleration;
Eina_List *inst_list;
Eina_List *ctx_list;
- int is_uninstalled;
+ union _pkg_flags {
+ struct _pkg_field {
+ unsigned int network: 1;
+ unsigned int secured: 1;
+ unsigned int direct_input: 1;
+ unsigned int auto_align: 1;
+ unsigned int is_uninstalled: 1;
+
+ unsigned int reserved: 27;
+ } field;
+ unsigned int mask;
+ } flags;
};
static struct {
}
info->widget.timeout = parser_timeout(parser);
- info->network = parser_network(parser);
+ info->flags.field.network = parser_network(parser);
info->widget.period = parser_period(parser);
if (info->widget.period < 0.0f) {
return WIDGET_ERROR_OUT_OF_MEMORY;
}
- info->secured = parser_secured(parser);
+ info->flags.field.secured = parser_secured(parser);
info->widget.pinup = parser_pinup(parser);
parser_get_gbar_size(parser, &info->gbar.width, &info->gbar.height);
HAPI const int const package_secured(const struct pkg_info *info)
{
- return info->secured;
+ return info->flags.field.secured;
}
HAPI void package_set_secured(struct pkg_info *info, int secured)
{
- info->secured = secured;
+ info->flags.field.secured = secured;
}
HAPI const char * const package_script(const struct pkg_info *info)
HAPI int package_network(struct pkg_info *info)
{
- return info->network;
+ return info->flags.field.network;
}
HAPI void package_set_network(struct pkg_info *info, int network)
{
- info->network = network;
+ info->flags.field.network = network;
}
HAPI void package_set_direct_input(struct pkg_info *info, int direct_input)
{
- info->direct_input = direct_input;
+ info->flags.field.direct_input = direct_input;
}
HAPI int package_direct_input(const struct pkg_info *info)
{
- return info->direct_input;
+ return info->flags.field.direct_input;
+}
+
+HAPI void package_set_auto_align(struct pkg_info *info, int auto_align)
+{
+ info->flags.field.auto_align = auto_align;
+}
+
+HAPI int package_auto_align(const struct pkg_info *info)
+{
+ return info->flags.field.auto_align;
}
HAPI const enum widget_gbar_type const package_gbar_type(const struct pkg_info *info)
}
DbgPrint("New slave[%s] is assigned for %s (using %s / abi[%s] / accel[%s]\n", s_name, info->widget_id, slave_pkgname, info->abi, info->hw_acceleration);
- info->slave = slave_create(s_name, info->secured, info->abi, slave_pkgname, info->network, info->hw_acceleration);
+ info->slave = slave_create(s_name, info->flags.field.secured, info->abi, slave_pkgname, info->flags.field.network, info->hw_acceleration);
DbgFree(s_name);
if (!info->slave) {
/*!
return WIDGET_ERROR_OUT_OF_MEMORY;
}
- info->slave = slave_find_available(slave_pkgname, info->abi, info->secured, info->network, info->hw_acceleration);
+ info->slave = slave_find_available(slave_pkgname, info->abi, info->flags.field.secured, info->flags.field.network, info->hw_acceleration, info->flags.field.auto_align);
if (!info->slave) {
int ret;
(void)slave_event_callback_add(info->slave, SLAVE_EVENT_ACTIVATE, slave_activated_cb, info);
(void)slave_event_callback_add(info->slave, SLAVE_EVENT_FAULT, slave_fault_cb, info);
- if (info->secured || (WIDGET_IS_INHOUSE(package_abi(info)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL)) {
+ if (info->flags.field.secured || (WIDGET_IS_INHOUSE(package_abi(info)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL)) {
(void)slave_event_callback_add(info->slave, SLAVE_EVENT_PAUSE, slave_paused_cb, info);
(void)slave_event_callback_add(info->slave, SLAVE_EVENT_RESUME, slave_resumed_cb, info);
slave_event_callback_del(info->slave, SLAVE_EVENT_DEACTIVATE, slave_deactivated_cb, info);
slave_event_callback_del(info->slave, SLAVE_EVENT_ACTIVATE, slave_activated_cb, info);
- if (info->secured || (WIDGET_IS_INHOUSE(package_abi(info)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL)) {
+ if (info->flags.field.secured || (WIDGET_IS_INHOUSE(package_abi(info)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL)) {
slave_event_callback_del(info->slave, SLAVE_EVENT_PAUSE, slave_paused_cb, info);
slave_event_callback_del(info->slave, SLAVE_EVENT_RESUME, slave_resumed_cb, info);
info->slave = NULL;
}
- if (info->is_uninstalled) {
+ if (info->flags.field.is_uninstalled) {
package_destroy(info);
}
return 0;
}
- info->is_uninstalled = 1;
+ info->flags.field.is_uninstalled = 1;
/*!
* \NOTE
return info ? info->fault_count : 0;
}
-HAPI int package_instance_count(struct pkg_info *info)
+HAPI int package_instance_count(struct pkg_info *info, int include_deleting)
{
Eina_List *l;
struct inst_info *inst;
break;
case INST_DESTROYED:
case INST_REQUEST_TO_DESTROY:
+ count += !!include_deleting;
default:
break;
}
} else if (util_free_space(WIDGET_CONF_IMAGE_PATH) <= WIDGET_CONF_MINIMUM_SPACE) {
ErrPrint("Not enough space\n");
ret = WIDGET_ERROR_FILE_NO_SPACE_ON_DEVICE;
- } else if (max_count && max_count <= package_instance_count(info)) {
- ErrPrint("Reached to the max count of widgets %d, %d\n", max_count, package_instance_count(info));
+ } else if (max_count && max_count <= package_instance_count(info, 1)) {
+ ErrPrint("Reached to the max count of widgets %d, %d\n", max_count, package_instance_count(info, 1));
ret = WIDGET_ERROR_CANCELED;
} else {
struct inst_info *inst;
ErrPrint("Failed to create a info socket\n");
}
- s_info.slave_fd = com_core_packet_server_init_with_permission(SLAVE_SOCKET, s_slave_table, NULL);
+ s_info.slave_fd = com_core_packet_server_init_with_permission("sdlocal://"SLAVE_SOCKET, s_slave_table, NULL);
if (s_info.slave_fd < 0) {
ErrPrint("Failed to create a slave socket\n");
}
- s_info.client_fd = com_core_packet_server_init_with_permission(CLIENT_SOCKET, s_client_table, NULL);
+ s_info.client_fd = com_core_packet_server_init_with_permission("sdlocal://"CLIENT_SOCKET, s_client_table, NULL);
if (s_info.client_fd < 0) {
ErrPrint("Failed to create a client socket\n");
}
- s_info.service_fd = com_core_packet_server_init_with_permission(SERVICE_SOCKET, s_service_table, NULL);
+ s_info.service_fd = com_core_packet_server_init_with_permission("sdlocal://"SERVICE_SOCKET, s_service_table, NULL);
if (s_info.service_fd < 0) {
ErrPrint("Faild to create a service socket\n");
}
* 4. Send accepted FD to provider via result packet.
* 5. Provider will send a packet to the viewer via that FD.
*/
- s_info.fd = com_core_packet_server_init(SHARED_SOCKET, s_table);
+ s_info.fd = com_core_packet_server_init("sdlocal://"SHARED_SOCKET, s_table);
if (s_info.fd < 0) {
- ErrPrint("Failed to make a server for %s\n", SHARED_SOCKET);
+ ErrPrint("Failed to make a server for %s\n", "sdlocal://"SHARED_SOCKET);
}
return WIDGET_ERROR_NONE;
char *name;
char *abi;
char *pkgname;
- int secured; /* Only A package(widget) is loaded for security requirements */
int refcnt;
int fault_count;
int critical_fault_count;
enum slave_state state;
- int network;
int loaded_instance;
int loaded_package;
- int reactivate_instances;
- int reactivate_slave;
+ union _slave_flags {
+ struct _slave_fields {
+ unsigned int reactivate_instances: 1;
+ unsigned int reactivate_slave: 1;
+ unsigned int secured: 1; /* Only A package(widget) is loaded for security requirements */
+ unsigned int network: 1;
+ unsigned int auto_align: 1;
+ unsigned int valid: 1;
+ unsigned int is_watch: 1; /*!< Specialized field. Only for the WATCH */
+ unsigned int wait_deactivation: 1;
+
+ unsigned int reserved: 24;
+ } field;
+ unsigned int mask;
+ } flags;
pid_t pid;
#endif
char *hw_acceleration;
- int valid;
char *extra_bundle_data;
- int is_watch; /*!< Specialized field. Only for the WATCH */
-
struct _resource {
struct _memory {
unsigned int soft;
unsigned int hard;
} memory;
} resources;
-
- int wait_deactivation;
};
struct event {
(void)slave_rpc_disconnect(slave);
} else if (slave->terminate_timer) {
ErrPrint("Terminate timer is already fired (%d)\n", slave->pid);
- } else if (!slave->extra_bundle_data && ((!no_timer && !slave->secured) || slave_is_app(slave)) && (!slave_is_watch(slave) && WIDGET_CONF_SLAVE_TERMINATE_TIME > 0.0f)) {
+ } else if (!slave->extra_bundle_data && ((!no_timer && !slave->flags.field.secured) || slave_is_app(slave)) && (!slave_is_watch(slave) && WIDGET_CONF_SLAVE_TERMINATE_TIME > 0.0f)) {
DbgPrint("Fire the terminate timer: %d (%d)\n", slave->pid, slave_is_app(slave));
slave->terminate_timer = ecore_timer_add(WIDGET_CONF_SLAVE_TERMINATE_TIME, terminate_timer_cb, slave);
if (!slave->terminate_timer) {
}
}
- slave->secured = is_secured;
+ slave->flags.field.secured = is_secured;
slave->pid = (pid_t)-1;
slave->state = SLAVE_TERMINATED;
- slave->network = network;
+ slave->flags.field.network = network;
slave->relaunch_count = WIDGET_CONF_SLAVE_RELAUNCH_COUNT;
xmonitor_add_event_callback(XMONITOR_PAUSED, xmonitor_pause_cb, slave);
}
if (!slave_is_app(slave)
- && !slave->secured
+ && !slave->flags.field.secured
&& !(WIDGET_IS_INHOUSE(slave_abi(slave)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL))
{
return 0;
slave = find_slave(name);
if (slave) {
- if (slave->secured != is_secured) {
+ if (slave->flags.field.secured != is_secured) {
ErrPrint("Exists slave and creating slave's security flag is not matched\n");
}
return slave;
bundle_add_str(param, WIDGET_CONF_BUNDLE_SLAVE_SECURED, ((WIDGET_IS_INHOUSE(slave_abi(slave)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL) || slave_is_secured(slave)) ? "true" : "false");
bundle_add_str(param, WIDGET_CONF_BUNDLE_SLAVE_ABI, slave_abi(slave));
bundle_add_str(param, WIDGET_CONF_BUNDLE_SLAVE_HW_ACCELERATION, slave->hw_acceleration);
+ bundle_add_str(param, WIDGET_CONF_BUNDLE_SLAVE_AUTO_ALIGN, slave->flags.field.auto_align ? "true" : "false");
} else {
ErrPrint("Failed to create a bundle\n");
}
}
if (WIDGET_CONF_DEBUG_MODE || g_conf.debug_mode) {
- DbgPrint("Debug Mode enabled. name[%s] secured[%d] abi[%s]\n", slave_name(slave), slave->secured, slave->abi);
+ DbgPrint("Debug Mode enabled. name[%s] secured[%d] abi[%s]\n", slave_name(slave), slave->flags.field.secured, slave->abi);
} else {
bundle *param;
double delay;
if (!(WIDGET_IS_INHOUSE(slave_abi(slave)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL)
- && ((!slave_is_app(slave) && !slave->secured) || !slave->ttl_timer))
+ && ((!slave_is_app(slave) && !slave->flags.field.secured) || !slave->ttl_timer))
{
return WIDGET_ERROR_INVALID_PARAMETER;
}
HAPI int slave_freeze_ttl(struct slave_node *slave)
{
if (!(WIDGET_IS_INHOUSE(slave_abi(slave)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL)
- && ((!slave_is_app(slave) && !slave->secured) || !slave->ttl_timer))
+ && ((!slave_is_app(slave) && !slave->flags.field.secured) || !slave->ttl_timer))
{
return WIDGET_ERROR_INVALID_PARAMETER;
}
double delay;
if (!(WIDGET_IS_INHOUSE(slave_abi(slave)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL)
- && ((!slave_is_app(slave) && !slave->secured) || !slave->ttl_timer))
+ && ((!slave_is_app(slave) && !slave->flags.field.secured) || !slave->ttl_timer))
{
return WIDGET_ERROR_INVALID_PARAMETER;
}
*/
if (!slave->extra_bundle_data /* Launched by SDK Viewer */
&& !slave_is_watch(slave) /* Not a watch */
- && ((WIDGET_IS_INHOUSE(slave_abi(slave)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL) || slave->secured == 1 || slave_is_app(slave))
+ && ((WIDGET_IS_INHOUSE(slave_abi(slave)) && WIDGET_CONF_SLAVE_LIMIT_TO_TTL) || slave->flags.field.secured == 1 || slave_is_app(slave))
&& WIDGET_CONF_SLAVE_TTL > 0.0f)
{
DbgPrint("Slave deactivation timer is added (%s - %lf)\n", slave_name(slave), WIDGET_CONF_SLAVE_TTL);
return NULL;
}
-HAPI struct slave_node *slave_find_available(const char *slave_pkgname, const char *abi, int secured, int network, const char *hw_acceleration)
+HAPI struct slave_node *slave_find_available(const char *slave_pkgname, const char *abi, int secured, int network, const char *hw_acceleration, int auto_align)
{
Eina_List *l;
struct slave_node *slave;
EINA_LIST_FOREACH(s_info.slave_list, l, slave) {
- if (slave->secured != secured) {
+ if (slave->flags.field.secured != secured) {
continue;
}
}
}
- if (slave->secured) {
+ if (slave->flags.field.auto_align != auto_align) {
+ continue;
+ }
+
+ if (slave->flags.field.secured) {
if (slave->loaded_package == 0) {
DbgPrint("Found secured slave - has no instances (%s)\n", slave_name(slave));
return slave;
}
- } else if (slave->network == network) {
- DbgPrint("slave[%s] loaded_package[%d] net: [%d]\n", slave_name(slave), slave->loaded_package, slave->network);
+ } else if (slave->flags.field.network == network) {
+ DbgPrint("slave[%s] loaded_package[%d] net: [%d]\n", slave_name(slave), slave->loaded_package, slave->flags.field.network);
if (!strcasecmp(abi, WIDGET_CONF_DEFAULT_ABI)) {
int max_load;
if (g_conf.slave_max_load < 0) {
HAPI const int const slave_is_secured(const struct slave_node *slave)
{
- return slave->secured;
+ return slave->flags.field.secured;
}
HAPI const int const slave_is_app(const struct slave_node *slave)
HAPI void slave_set_reactivate_instances(struct slave_node *slave, int reactivate)
{
- slave->reactivate_instances = reactivate;
+ slave->flags.field.reactivate_instances = !!reactivate;
}
HAPI int slave_need_to_reactivate_instances(struct slave_node *slave)
{
- return slave->reactivate_instances;
+ return slave->flags.field.reactivate_instances;
}
HAPI void slave_set_reactivation(struct slave_node *slave, int flag)
{
- slave->reactivate_slave = flag;
+ slave->flags.field.reactivate_slave = flag;
}
HAPI int slave_need_to_reactivate(struct slave_node *slave)
reactivate = 1;
}
- return reactivate && slave->reactivate_slave;
+ return reactivate && slave->flags.field.reactivate_slave;
}
HAPI int slave_network(const struct slave_node *slave)
{
- return slave->network;
+ return slave->flags.field.network;
}
HAPI void slave_set_network(struct slave_node *slave, int network)
{
- slave->network = network;
+ slave->flags.field.network = network;
}
HAPI int slave_deactivate_all(int reactivate, int reactivate_instances, int no_timer)
HAPI int slave_valid(const struct slave_node *slave)
{
- if (!slave->valid) {
+ if (!slave->flags.field.valid) {
DbgPrint("slave is invalid");
}
- return slave->valid;
+ return slave->flags.field.valid;
}
HAPI void slave_set_valid(struct slave_node *slave)
{
DbgPrint("slave is set valid\n");
- slave->valid = 1;
+ slave->flags.field.valid = 1;
}
HAPI void slave_set_extra_bundle_data(struct slave_node *slave, const char *extra_bundle_data)
HAPI int slave_is_watch(struct slave_node *slave)
{
- return slave ? slave->is_watch : 0;
+ return slave ? slave->flags.field.is_watch : 0;
}
HAPI void slave_set_is_watch(struct slave_node *slave, int flag)
return;
}
- slave->is_watch = flag;
+ slave->flags.field.is_watch = flag;
}
HAPI int slave_set_resource_limit(struct slave_node *slave, unsigned int soft, unsigned int hard)
HAPI void slave_set_wait_deactivation(struct slave_node *slave, int wait)
{
- slave->wait_deactivation = !!wait;
+ slave->flags.field.wait_deactivation = !!wait;
}
HAPI int slave_wait_deactivation(struct slave_node *slave)
{
- return slave->wait_deactivation;
+ return slave->flags.field.wait_deactivation;
}
/* End of a file */
return WIDGET_ERROR_ALREADY_STARTED;
}
- s_info.svc_ctx = service_common_create(UTILITY_SOCKET, UTILITY_SMACK_LABEL, service_thread_main, NULL);
+ s_info.svc_ctx = service_common_create("sdlocal://"UTILITY_SOCKET, UTILITY_SMACK_LABEL, service_thread_main, NULL);
if (!s_info.svc_ctx) {
ErrPrint("Unable to activate service thread\n");
return WIDGET_ERROR_FAULT;