Change define name.(PROFILE_WEARABLE => ROTARY_EVENT_FEATURE_SUPPORT)
authorJongHeon Choi <j-h.choi@samsung.com>
Thu, 28 Apr 2016 07:16:33 +0000 (16:16 +0900)
committerJongHeon Choi <j-h.choi@samsung.com>
Thu, 28 Apr 2016 07:16:45 +0000 (16:16 +0900)
packaging/crosswalk-tizen.spec
runtime/browser/web_application.cc
runtime/browser/web_application.h
runtime/browser/web_view.h
runtime/browser/web_view_impl.cc
runtime/browser/web_view_impl.h
runtime/runtime.gyp

index 03491d5..a7091e6 100755 (executable)
@@ -44,6 +44,19 @@ BuildRequires: pkgconfig(uuid)
 BuildRequires: pkgconfig(launchpad)
 BuildRequires: pkgconfig(ttrace)
 
+%if "%{?profile}" == "mobile"
+%define tizen_feature_rotary_event_support     0
+%endif
+
+%if "%{?profile}" == "wearable"
+%define tizen_feature_rotary_event_support     1
+%endif
+
+%if "%{?profile}" == "tv"
+%define tizen_feature_rotary_event_support     0
+%endif
+
+
 Requires: /usr/bin/systemctl
 
 %description
@@ -66,6 +79,9 @@ GYP_OPTIONS="$GYP_OPTIONS -Dbuild_type=Debug"
 GYP_OPTIONS="$GYP_OPTIONS -Dbuild_type=Release"
 %endif
 
+# Feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_rotary_event_support=%{?tizen_feature_rotary_event_support}"
+
 # Extension Path
 GYP_OPTIONS="$GYP_OPTIONS -Dextension_path=%{extension_path}"
 
index b338095..bbcad4d 100644 (file)
@@ -693,7 +693,7 @@ void WebApplication::OnSoftKeyboardChangeEvent(WebView* /*view*/,
     view_stack_.front()->EvalJavascript(kSoftKeyboardScript.c_str());
 }
 
-#ifdef PROFILE_WEARABLE
+#ifdef ROTARY_EVENT_FEATURE_SUPPORT
 void WebApplication::OnRotaryEvent(WebView* /*view*/,
                                    RotaryEventType type) {
   LOGGER(DEBUG) << "OnRotaryEvent";
@@ -715,7 +715,7 @@ void WebApplication::OnRotaryEvent(WebView* /*view*/,
   if (view_stack_.size() > 0 && view_stack_.front() != NULL)
     view_stack_.front()->EvalJavascript(kRotaryEventScript.c_str());
 }
-#endif  // PROFILE_WEARABLE
+#endif  // ROTARY_EVENT_FEATURE_SUPPORT
 
 bool WebApplication::OnContextMenuDisabled(WebView* /*view*/) {
   return !(app_data_->setting_info() != NULL
index f3c3989..6d81bf4 100755 (executable)
@@ -91,10 +91,10 @@ class WebApplication : public WebView::EventListener {
       std::function<void(bool)> result_handler);
   virtual void OnSoftKeyboardChangeEvent(
       WebView* view, SoftKeyboardChangeEventValue softkeyboard_value);
-#ifdef PROFILE_WEARABLE
+#ifdef ROTARY_EVENT_FEATURE_SUPPORT
   virtual void OnRotaryEvent(
       WebView* view, RotaryEventType type);
-#endif  // PROFILE_WEARABLE
+#endif  // ROTARY_EVENT_FEATURE_SUPPORT
 
  private:
   bool Initialize();
index 6456650..3aacf95 100644 (file)
@@ -102,11 +102,11 @@ class WebView {
     virtual void OnSoftKeyboardChangeEvent(
         WebView* /*view*/,
         SoftKeyboardChangeEventValue /*softkeyboard_value*/) {}
-#ifdef PROFILE_WEARABLE
+#ifdef ROTARY_EVENT_FEATURE_SUPPORT
     virtual void OnRotaryEvent(
         WebView* /*view*/,
         RotaryEventType /*type*/) {}
-#endif  // PROFILE_WEARABLE
+#endif  // ROTARY_EVENT_FEATURE_SUPPORT
   };
 
   WebView(NativeWindow* window, Ewk_Context* context);
index 2d3a7dc..74765ba 100644 (file)
@@ -202,9 +202,9 @@ void WebViewImpl::Initialize() {
   InitPopupWaitCallback();
   InitUsermediaCallback();
   InitEditorClientImeCallback();
-#ifdef PROFILE_WEARABLE
+#ifdef ROTARY_EVENT_FEATURE_SUPPORT
   InitRotaryEventCallback();
-#endif  // PROFILE_WEARABLE
+#endif  // ROTARY_EVENT_FEATURE_SUPPORT
 
   Ewk_Settings* settings = ewk_view_settings_get(ewk_view_);
   ewk_settings_scripts_can_open_windows_set(settings, EINA_TRUE);
@@ -882,7 +882,7 @@ void WebViewImpl::InitEditorClientImeCallback() {
   smart_callbacks_["editorclient,ime,closed"] = ime_closed_callback;
 }
 
-#ifdef PROFILE_WEARABLE
+#ifdef ROTARY_EVENT_FEATURE_SUPPORT
 void WebViewImpl::InitRotaryEventCallback() {
   auto rotary_callback = [](void* user_data,
                          Evas_Object*,
@@ -904,7 +904,7 @@ void WebViewImpl::InitRotaryEventCallback() {
   eext_rotary_object_event_callback_add(ewk_view_, rotary_callback, this);
   eext_rotary_object_event_activated_set(ewk_view_, EINA_TRUE);
 }
-#endif  // PROFILE_WEARABLE
+#endif  // ROTARY_EVENT_FEATURE_SUPPORT
 
 std::string WebViewImpl::GetUrl() {
   return std::string(ewk_view_url_get(ewk_view_));
index 9b6b3b1..d4fc65d 100644 (file)
@@ -76,9 +76,9 @@ class WebViewImpl {
   void InitPopupWaitCallback();
   void InitUsermediaCallback();
   void InitEditorClientImeCallback();
-#ifdef PROFILE_WEARABLE
+#ifdef ROTARY_EVENT_FEATURE_SUPPORT
   void InitRotaryEventCallback();
-#endif  // PROFILE_WEARABLE
+#endif  // ROTARY_EVENT_FEATURE_SUPPORT
 
   NativeWindow* window_;
   Ewk_Context* context_;
index 12606e9..2c962cd 100755 (executable)
@@ -60,6 +60,9 @@
         ['profile == "wearable"', {
           'defines': ['PROFILE_WEARABLE'],
         }],
+        ['tizen_feature_rotary_event_support == 1', {
+          'defines': ['ROTARY_EVENT_FEATURE_SUPPORT'],
+        }],
       ],
     }, # end of target 'xwalk_runtime'
     {