int overwrite_content;
int com_core_thread;
int use_xmonitor;
+
+ double scale_width_factor;
+ double scale_height_factor;
};
extern struct conf g_conf;
#define CR 13
#define LF 10
+#define SCALE_WIDTH_FACTOR g_conf.scale_width_factor
+#define SCALE_HEIGHT_FACTOR g_conf.scale_height_factor
+
#define USE_SW_BACKEND g_conf.use_sw_backend
#define PROVIDER_METHOD g_conf.provider_method
#define DEBUG_MODE g_conf.debug_mode
LB_VISIBLE_ERROR = 0xFFFFFFFF, /* To enlarge the size of this enumeration type */
};
+#define IS_PD 1
+#define IS_LB 0
+
struct inst_info;
struct pkg_info;
struct script_handle;
*/
extern int instance_unicast_created_event(struct inst_info *inst, struct client_node *client);
extern int instance_unicast_deleted_event(struct inst_info *inst, struct client_node *client);
+extern void instance_send_resized_event(struct inst_info *inst, int is_pd, int w, int h, int status);
extern int instance_create_lb_buffer(struct inst_info *inst);
extern int instance_create_pd_buffer(struct inst_info *inst);
Name: org.tizen.data-provider-master
Summary: Master service provider for liveboxes.
-Version: 0.16.11
+Version: 0.16.13
Release: 1
Group: framework/livebox
License: Flora License
.debug_mode = 0,
.overwrite_content = 0,
.com_core_thread = 1,
- .use_xmonitor = 1,
+ .use_xmonitor = 0,
+
+ .scale_width_factor = 1.0f,
+ .scale_height_factor = 1.0f,
};
static void conf_update_size(void)
{
ecore_x_window_size_get(0, &g_conf.width, &g_conf.height);
+ g_conf.scale_width_factor = (double)g_conf.width / (double)BASE_W;
+ g_conf.scale_height_factor = (double)g_conf.height / (double)BASE_H;
}
static void use_xmonitor(char *buffer)
return ret;
}
-static inline void send_size_changed_event(struct inst_info *inst, int is_pd, int w, int h, int status)
+HAPI void instance_send_resized_event(struct inst_info *inst, int is_pd, int w, int h, int status)
{
struct packet *packet;
const char *pkgname;
pkgname = package_name(inst->info);
id = inst->id;
+ DbgPrint("Size is changed to %dx%d (%s) %s\n", w, h, id, is_pd ? "pd" : "lb");
+
packet = packet_create_noack("size_changed", "ssiiii", pkgname, id, is_pd, w, h, status);
if (packet)
CLIENT_SEND_EVENT(inst, packet);
static int update_client_list(struct client_node *client, void *data)
{
struct inst_info *inst = data;
+
if (!instance_has_client(inst, client)) {
instance_add_client(inst, client);
}
+
return 0;
}
if (priority >= 0.0f && priority <= 1.0f)
inst->lb.priority = priority;
- if (inst->state == INST_ACTIVATED && (inst->lb.width != w || inst->lb.height != h)) {
- /*!
- */
- send_size_changed_event(inst, 0, w, h, 0);
- }
-
inst->lb.width = w;
inst->lb.height = h;
}
HAPI void instance_set_pd_info(struct inst_info *inst, int w, int h)
{
- if (inst->state == INST_ACTIVATED && (inst->pd.width != w || inst->pd.height != h)) {
- /*!
- */
- send_size_changed_event(inst, 1, w, h, 0);
- }
-
inst->pd.width = w;
inst->pd.height = h;
}
int ret;
if (!packet) {
+ ErrPrint("Invalid packet\n");
+ instance_send_resized_event(cbdata->inst, IS_LB, cbdata->inst->lb.width, cbdata->inst->lb.height, -EFAULT);
instance_unref(cbdata->inst);
DbgFree(cbdata);
return;
if (packet_get(packet, "i", &ret) != 1) {
ErrPrint("Invalid parameter\n");
+ instance_send_resized_event(cbdata->inst, IS_LB, cbdata->inst->lb.width, cbdata->inst->lb.height, -EINVAL);
instance_unref(cbdata->inst);
DbgFree(cbdata);
return;
}
if (ret == 0) {
- cbdata->inst->lb.width = cbdata->w;
- cbdata->inst->lb.height = cbdata->h;
+ /*!
+ * \note
+ * else waiting the first update with new size
+ */
+ } else {
+ DbgPrint("Livebox rejects the new size: %dx%d (%d)\n", cbdata->w, cbdata->h, ret);
+ instance_send_resized_event(cbdata->inst, IS_LB, cbdata->inst->lb.width, cbdata->inst->lb.height, ret);
}
- send_size_changed_event(cbdata->inst, 0, cbdata->w, cbdata->h, ret);
instance_unref(cbdata->inst);
DbgFree(cbdata);
}
}
if (!block->id) {
- if (is_pd)
+ int resized;
+
+ if (is_pd) {
+ resized = (instance_pd_width(inst) != w) || (instance_pd_height(inst) != h);
instance_set_pd_info(inst, w, h);
- else
+ } else {
+ /*!
+ * \note
+ * LB Size is already scaled by livebox-service.
+ * Each livebox uses the LB_SIZE_TYPE_XXX for its size.
+ */
+ resized = (instance_lb_width(inst) != w) || (instance_lb_height(inst) != h);
instance_set_lb_info(inst, w, h, NO_CHANGE, CONTENT_NO_CHANGE, TITLE_NO_CHANGE);
+ }
+
+ if (resized)
+ instance_send_resized_event(inst, is_pd, w, h, 0);
script_handler_resize(info, w, h);
} else {
inst = package_find_instance_by_id(pkgname, id);
if (!inst) {
- DbgPrint("There is no such instance: %s\n", id);
+ DbgPrint("There is a no such instance(%s)\n", id);
ret = -ENOENT;
} else if (instance_state(inst) == INST_DESTROYED) {
- ErrPrint("Instance is already destroyed (%s)\n", id);
+ ErrPrint("Instance(%s) is already destroyed\n", id);
ret = -EINVAL;
} else {
- DbgPrint("Destroy instance (%s)\n", id);
+ DbgPrint("Destroy instance(%s)\n", id);
ret = instance_destroy(inst);
}
ret = -EINVAL;
} else {
char *filename;
+ int resized;
+ resized = (instance_lb_width(inst) != w) || (instance_lb_height(inst) != h);
instance_set_lb_info(inst, w, h, priority, content_info, title);
switch (package_lb_type(instance_package(inst))) {
}
break;
case LB_TYPE_BUFFER:
- instance_lb_updated_by_instance(inst);
- ret = 0;
- break;
default:
/*!
* \check
* text format (inst)
*/
+ if (resized)
+ instance_send_resized_event(inst, IS_LB, w, h, 0);
instance_lb_updated_by_instance(inst);
ret = 0;
break;
ret = buffer_handler_load(info);
if (ret == 0) {
+ int resized;
+ resized = (instance_lb_width(inst) != w) || (instance_lb_height(inst) != h);
instance_set_lb_info(inst, w, h, -1.0f, NULL, NULL);
id = buffer_handler_id(info);
+ if (resized)
+ instance_send_resized_event(inst, IS_LB, w, h, 0);
DbgPrint("Buffer handler ID: %s\n", id);
} else {
DbgPrint("Failed to load a buffer(%d)\n", ret);
ret = buffer_handler_load(info);
if (ret == 0) {
+ int resized;
+ resized = (instance_pd_width(inst) != w) || (instance_pd_height(inst) != h);
instance_set_pd_info(inst, w, h);
id = buffer_handler_id(info);
+ if (resized)
+ instance_send_resized_event(inst, IS_PD, w, h, 0);
DbgPrint("Buffer handler ID: %s\n", id);
} else {
DbgPrint("Failed to load a buffer (%d)\n", ret);
* id is resued for newly assigned ID
*/
if (!ret) {
+ int resized;
+
id = buffer_handler_id(info);
+ resized = (instance_lb_width(inst) != w) || (instance_lb_height(inst) != h);
instance_set_lb_info(inst, w, h, -1.0f, NULL, NULL);
+ if (resized)
+ instance_send_resized_event(inst, IS_LB, w, h, 0);
}
}
}
* id is resued for newly assigned ID
*/
if (!ret) {
+ int resized;
id = buffer_handler_id(info);
- DbgPrint("Set PD Info: %dx%d\n", w, h);
+ resized = (instance_pd_width(inst) != w) || (instance_pd_height(inst) != h);
instance_set_pd_info(inst, w, h);
+ if (resized)
+ instance_send_resized_event(inst, IS_PD, w, h, 0);
}
}
}