summaryrefslogtreecommitdiff
path: root/src/instance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/instance.c')
-rw-r--r--src/instance.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/instance.c b/src/instance.c
index db4ab42..32d18cc 100644
--- a/src/instance.c
+++ b/src/instance.c
@@ -1,7 +1,7 @@
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -184,7 +184,11 @@ static inline void timer_freeze(struct inst_info *inst)
if (ecore_timer_interval_get(inst->update_timer) <= 1.0f)
return;
- gettimeofday(&tv, NULL);
+ if (gettimeofday(&tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ }
inst->sleep_at = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
}
@@ -682,7 +686,7 @@ static inline int fork_package(struct inst_info *inst, const char *pkgname)
snprintf(inst->id, len, SCHEMA_FILE "%s%s_%d_%lf.png", IMAGE_PATH, package_name(info), client_pid(inst->client), inst->timestamp);
inst->lb.auto_launch = package_auto_launch(info);
- instance_set_pd_info(inst, package_pd_width(info), package_pd_height(info));
+ instance_set_pd_size(inst, package_pd_width(info), package_pd_height(info));
inst->lb.timeout = package_timeout(info);
inst->lb.period = package_period(info);
@@ -1149,7 +1153,8 @@ static void activate_cb(struct slave_node *slave, const struct packet *packet, v
* just increase the loaded instance counter
* And then reset jobs.
*/
- instance_set_lb_info(inst, w, h, priority, content, title);
+ instance_set_lb_size(inst, w, h);
+ instance_set_lb_info(inst, priority, content, title);
inst->state = INST_ACTIVATED;
@@ -1185,7 +1190,7 @@ static void activate_cb(struct slave_node *slave, const struct packet *packet, v
if (package_pd_type(inst->info) == PD_TYPE_SCRIPT) {
if (inst->pd.width == 0 && inst->pd.height == 0)
- instance_set_pd_info(inst, package_pd_width(inst->info), package_pd_height(inst->info));
+ instance_set_pd_size(inst, package_pd_width(inst->info), package_pd_height(inst->info));
inst->pd.canvas.script = script_handler_create(inst,
package_pd_path(inst->info),
@@ -1220,7 +1225,7 @@ out:
HAPI int instance_create_pd_buffer(struct inst_info *inst)
{
if (inst->pd.width == 0 && inst->pd.height == 0)
- instance_set_pd_info(inst, package_pd_width(inst->info), package_pd_height(inst->info));
+ instance_set_pd_size(inst, package_pd_width(inst->info), package_pd_height(inst->info));
if (!inst->pd.canvas.buffer) {
inst->pd.canvas.buffer = buffer_handler_create(inst, s_info.env_buf_type, inst->pd.width, inst->pd.height, sizeof(int));
@@ -1854,7 +1859,7 @@ HAPI int instance_active_update(struct inst_info *inst)
return inst->active_update;
}
-HAPI void instance_set_lb_info(struct inst_info *inst, int w, int h, double priority, const char *content, const char *title)
+HAPI void instance_set_lb_info(struct inst_info *inst, double priority, const char *content, const char *title)
{
char *_content = NULL;
char *_title = NULL;
@@ -1883,7 +1888,10 @@ HAPI void instance_set_lb_info(struct inst_info *inst, int w, int h, double prio
if (priority >= 0.0f && priority <= 1.0f)
inst->lb.priority = priority;
+}
+HAPI void instance_set_lb_size(struct inst_info *inst, int w, int h)
+{
if (inst->lb.width != w || inst->lb.height != h)
instance_send_resized_event(inst, IS_LB, w, h, LB_STATUS_SUCCESS);
@@ -1891,7 +1899,7 @@ HAPI void instance_set_lb_info(struct inst_info *inst, int w, int h, double prio
inst->lb.height = h;
}
-HAPI void instance_set_pd_info(struct inst_info *inst, int w, int h)
+HAPI void instance_set_pd_size(struct inst_info *inst, int w, int h)
{
if (inst->pd.width != w || inst->pd.height != h)
instance_send_resized_event(inst, IS_PD, w, h, LB_STATUS_SUCCESS);