+ DbgPrint("SKIP: Pre orientation event callback is called [%s], %s\n", id, info->id);
+ return WIDGET_ERROR_INVALID_PARAMETER;
+ }
+
+ widget_get_last_ctrl_mode(path, &cmd, &value);
+
+ if (cmd == WIDGET_CTRL_MODE_DUMP_FRAME) {
+ info->ctrl_mode.dump_to_file = !!value;
+ DbgPrint("CtrlMode: DumpToFile: %d\n", info->ctrl_mode.dump_to_file);
+ }
+
+ return WIDGET_ERROR_NONE;
+}
+
+static int pre_orientation_cb(const char *id, void *data)
+{
+ vwin_info_t info = data;
+ const char *path;
+ int orientation;
+
+ /* Try provider_app first */
+ if (!info || info->state != VWIN_INFO_CREATED || !id || !info->id) {
+ return WIDGET_ERROR_INVALID_PARAMETER;
+ }
+
+ path = widget_util_uri_to_path(id);
+ if (path && strcmp(info->id, path)) {
+ /* Skip */
+ DbgPrint("SKIP: Pre orientation event callback is called [%s], %s\n", id, info->id);
+ return WIDGET_ERROR_INVALID_PARAMETER;
+ }
+
+ DbgPrint("Pre orientation event callback is called [%s]\n", id);
+ orientation = widget_get_orientation(path);
+ if (orientation < 0) {
+ ErrPrint("Failed to get orientation: %X\n", orientation);
+ } else {
+ info->orientation = orientation;
+ }
+
+ return WIDGET_ERROR_NONE;
+}
+
+static int pre_destroy_cb(const char *id, void *data)
+{
+ vwin_info_t info = data;
+ const char *path = NULL;
+
+ if (!info || info->state != VWIN_INFO_CREATED) {
+ return WIDGET_ERROR_INVALID_PARAMETER;
+ }
+
+ if (id) {
+ path = widget_util_uri_to_path(id);
+
+ if (path && strcmp(info->id, path)) {
+ /* Skip */
+ DbgPrint("SKIP: Pre destroy event callback is called [%s], %s\n", id, info->id);
+ return WIDGET_ERROR_INVALID_PARAMETER;
+ }