Update accessibility operation.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 10 Oct 2013 09:01:52 +0000 (18:01 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 10 Oct 2013 09:01:52 +0000 (18:01 +0900)
Change-Id: I59437b763192ca11ce8d046e532610df633627d6

packaging/data-provider-master.spec
src/script_handler.c
src/slave_life.c

index 18d8de2..1875cc5 100644 (file)
@@ -1,6 +1,6 @@
 Name: data-provider-master
 Summary: Master service provider for liveboxes.
-Version: 0.25.15
+Version: 0.25.16
 Release: 1
 Group: HomeTF/Livebox
 License: Flora License
index 13eec96..9d56c80 100644 (file)
@@ -51,6 +51,7 @@
 #define TYPE_INFO "info"
 #define TYPE_DRAG "drag"
 #define TYPE_ACCESS "access"
+#define TYPE_OPERATE_ACCESS "access,operation"
 
 #define INFO_SIZE "size"
 #define INFO_CATEGORY "category"
@@ -74,6 +75,7 @@ struct script_port {
        int (*update_text)(void *handle, Evas *e, const char *id, const char *part, const char *text);
        int (*update_image)(void *handle, Evas *e, const char *id, const char *part, const char *path, const char *option);
        int (*update_access)(void *handle, Evas *e, const char *id, const char *part, const char *text, const char *option);
+       int (*operate_access)(void *handle, Evas *e, const char *id, const char *part, const char *operation, const char *option);
        int (*update_script)(void *handle, Evas *e, const char *src_id, const char *target_id, const char *part, const char *path, const char *option);
        int (*update_signal)(void *handle, Evas *e, const char *id, const char *part, const char *signal);
        int (*update_drag)(void *handle, Evas *e, const char *id, const char *part, double x, double y);
@@ -217,6 +219,11 @@ static int load_all_ports(void)
                        goto errout;
                }
 
+               item->operate_access = dlsym(item->handle, "script_operate_access");
+               if (!item->operate_access) {
+                       goto errout;
+               }
+
                item->update_script = dlsym(item->handle, "script_update_script");
                if (!item->update_script) {
                        goto errout;
@@ -751,6 +758,36 @@ static int update_access(struct inst_info *inst, struct block *block, int is_pd)
        return LB_STATUS_SUCCESS;
 }
 
+static int operate_access(struct inst_info *inst, struct block *block, int is_pd)
+{
+       struct script_info *info;
+       Evas *e;
+
+       if (!block || !block->part) {
+               ErrPrint("Block or block->part is NIL\n");
+               return LB_STATUS_ERROR_INVALID;
+       }
+
+       info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
+       if (!info) {
+               ErrPrint("info is NIL (%d, %s)\n", is_pd, instance_id(inst));
+               return LB_STATUS_ERROR_FAULT;
+       }
+
+       if (!info->port) {
+               ErrPrint("info->port is NIL\n");
+               return LB_STATUS_ERROR_INVALID;
+       }
+
+       e = script_handler_evas(info);
+       if (e) {
+               info->port->operate_access(info->port_data, e, block->id, block->part, block->data, block->option);
+       } else {
+               ErrPrint("Evas: (nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
+       }
+       return LB_STATUS_SUCCESS;
+}
+
 static int update_script_script(struct inst_info *inst, struct block *block, int is_pd)
 {
        struct script_info *info;
@@ -978,6 +1015,10 @@ static inline void consuming_parsed_block(int lineno, struct inst_info *inst, in
                        .handler = update_access,
                },
                {
+                       .type = TYPE_OPERATE_ACCESS,
+                       .handler = operate_access,
+               },
+               {
                        .type = NULL,
                        .handler = NULL,
                },
index 781aefd..6283938 100644 (file)
@@ -854,8 +854,6 @@ HAPI struct slave_node *slave_deactivated_by_fault(struct slave_node *slave)
                } else {
                        slave->critical_fault_count = 0;
                }
-       } else {
-               ErrPrint("Failed to get time of day: %s\n", strerror(errno));
        }
 #else
        struct timeval faulted_at;