+ if (content)
+ content_info = bundle_decode((const bundle_raw *)content, strlen(content));
+
+ if (cxt->callback.create)
+ ret = cxt->callback.create(context, content_info, w, h, cxt->data);
+ _D("%s is created %d", id);
+
+ if (ret < 0) {
+ _W("Create callback returns error(%d)", ret);
+ ret = __send_update_status(class_id, id,
+ WIDGET_INSTANCE_EVENT_CREATE_ABORTED, NULL);
+ __instance_drop(context);
+ } else {
+ ret = __send_update_status(class_id, id,
+ WIDGET_INSTANCE_EVENT_CREATE, NULL);
+
+ aul_widget_instance_add(class_id, id);
+ }
+
+ if (content_info)
+ bundle_free(content_info);
+}
+
+static void __stub_terminate(appcore_multiwindow_base_instance_h context, void *data)
+{
+ struct widget_class_context *class_cxt = data;
+ struct widget_extra *we;
+ bundle *b;
+ char *operation = NULL;
+ bundle *content_info;
+ widget_app_destroy_type_e reason = WIDGET_APP_DESTROY_TYPE_TEMPORARY;
+ int event = WIDGET_INSTANCE_EVENT_TERMINATE;
+ const char *id;
+ const char *class_id;
+
+ id = appcore_multiwindow_base_instance_get_id(context);
+ class_id = appcore_multiwindow_base_instance_get_class_id(context);
+ we = appcore_multiwindow_base_instance_get_extra((appcore_multiwindow_base_instance_h)context);
+ b = we->args;
+
+ if (b) {
+ bundle_get_str(b, WIDGET_K_OPERATION, &operation);
+ if (operation && strcmp(operation, "destroy") == 0)
+ reason = WIDGET_APP_DESTROY_TYPE_PERMANENT;
+ }
+
+ if (we->content)
+ content_info = bundle_decode((const bundle_raw *)we->content, strlen(we->content));
+ else
+ content_info = bundle_create();
+
+ if (class_cxt->callback.destroy)
+ class_cxt->callback.destroy(context, reason, content_info, class_cxt->data);
+ _D("%s is destroyed %d", id, reason);
+
+ if (reason == WIDGET_APP_DESTROY_TYPE_PERMANENT) {
+ event = WIDGET_INSTANCE_EVENT_DESTROY;
+ aul_widget_instance_del(class_id, id);
+ } else {
+ __send_update_status(class_id, id,
+ WIDGET_INSTANCE_EVENT_EXTRA_UPDATED, content_info);
+ }
+
+ if (content_info)
+ bundle_free(content_info);
+
+ __send_update_status(class_id, id, event, NULL);
+ appcore_multiwindow_base_class_on_terminate(context);
+}
+
+static void __stub_pause(appcore_multiwindow_base_instance_h context, void *data)
+{
+ struct widget_class_context *class_cxt = data;
+ const char *id;
+ const char *class_id;
+
+ appcore_multiwindow_base_class_on_pause(context);
+ id = appcore_multiwindow_base_instance_get_id(context);
+ class_id = appcore_multiwindow_base_instance_get_class_id(context);