%define tizen_feature_rotary_event_support 0
%define tizen_feature_web_ime_support 0
%define tizen_feature_watch_face_support 0
+%define tizen_feature_manual_rotate_support 1
%endif
%if "%{?profile}" == "wearable"
%define tizen_feature_rotary_event_support 1
%define tizen_feature_web_ime_support 1
%define tizen_feature_watch_face_support 1
+%define tizen_feature_manual_rotate_support 0
%endif
%if "%{?profile}" == "tv"
%define tizen_feature_rotary_event_support 0
%define tizen_feature_web_ime_support 1
%define tizen_feature_watch_face_support 0
+%define tizen_feature_manual_rotate_support 0
%endif
%if 0%{?tizen_feature_web_ime_support}
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_rotary_event_support=%{?tizen_feature_rotary_event_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_ime_support=%{?tizen_feature_web_ime_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_watch_face_support=%{?tizen_feature_watch_face_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_manual_rotate_support=%{?tizen_feature_manual_rotate_support}"
# Extension Path
GYP_OPTIONS="$GYP_OPTIONS -Dextension_path=%{extension_path}"
enable ? ELM_WIN_INDICATOR_TRANSPARENT : ELM_WIN_INDICATOR_OPAQUE);
}
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+void NativeWindow::EnableManualRotation(bool enable) {
+ LOGGER(DEBUG) << "set manual rotation : " << (enable ? "enabled" : "disabled");
+ elm_win_wm_rotation_manual_rotation_done_set(window_, enable ? EINA_TRUE : EINA_FALSE);
+}
+
+void NativeWindow::ManualRotationDone() {
+ if (EINA_TRUE == elm_win_wm_rotation_manual_rotation_done_get(window_)) {
+ elm_win_wm_rotation_manual_rotation_done(window_);
+ }
+}
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
+
} // namespace runtime
void FullScreen(bool enable);
ScreenOrientation natural_orientation() const { return natural_orientation_;}
Type type() const { return window_type_;}
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+ void EnableManualRotation(bool enable);
+ void ManualRotationDone();
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
protected:
virtual Evas_Object* CreateWindowInternal() = 0;
security_model_version_ = 1;
}
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+ // Set manual rotation
+ window_->EnableManualRotation(true);
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
+
return true;
}
window_->Active();
}
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+void WebApplication::OnRotatePrepared(WebView* /*view*/) {
+ window_->ManualRotationDone();
+}
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
+
void WebApplication::LaunchInspector(common::AppControl* appcontrol) {
unsigned int port = ewk_context_inspector_server_start(ewk_context_, 0);
std::stringstream ss;
virtual void OnRotaryEvent(
WebView* view, RotaryEventType type);
#endif // ROTARY_EVENT_FEATURE_SUPPORT
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+ virtual void OnRotatePrepared(WebView* view);
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
private:
bool Initialize();
WebView* /*view*/,
RotaryEventType /*type*/) {}
#endif // ROTARY_EVENT_FEATURE_SUPPORT
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+ virtual void OnRotatePrepared(WebView* /*view*/) {}
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
};
WebView(NativeWindow* window, Ewk_Context* context);
smart_callbacks_["load,finished"] = loadfinished_callback;
smart_callbacks_["load,progress"] = loadprogress_callback;
smart_callbacks_["frame,rendered"] = rendered_callback;
+
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+ // rotate prepared callback
+ auto rotateprepared_callback = [](void* user_data,
+ Evas_Object*,
+ void*) {
+ WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
+ if (self->listener_)
+ self->listener_->OnRotatePrepared(self->view_);
+ };
+ evas_object_smart_callback_add(ewk_view_,
+ "rotate,prepared",
+ rotateprepared_callback,
+ this);
+ smart_callbacks_["rotate,prepared"] = rotateprepared_callback;
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
}
void WebViewImpl::InitPolicyDecideCallback() {
[](void* user_data, Evas_Object* /*obj*/, void*) {
WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
self->internal_popup_opened_ = true;
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+ self->window_->EnableManualRotation(false);
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
}, this);
evas_object_smart_callback_add(ewk_view_,
"popup,reply,wait,finish",
[](void* user_data, Evas_Object* /*obj*/, void*) {
WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
self->internal_popup_opened_ = false;
+#ifdef MANUAL_ROTATE_FEATURE_SUPPORT
+ self->window_->EnableManualRotation(true);
+#endif // MANUAL_ROTATE_FEATURE_SUPPORT
}, this);
}
],
},
}],
+ ['tizen_feature_manual_rotate_support == 1', {
+ 'defines': ['MANUAL_ROTATE_FEATURE_SUPPORT'],
+ }],
],
}, # end of target 'xwalk_runtime'
{