#define ENABLE_TIZEN_WEBKIT2_HIT_TEST 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Hit Test API implementation for WK2 */
#define ENABLE_TIZEN_WEBKIT2_PATCH_FOR_TC 1 /* Changhyup Jwa(ch.jwa@samsung.com) : Patchs to pass TC */
#define ENABLE_TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Patchs to get text style for supporting email requirement */
+
+#if ENABLE(TIZEN_PREFERENCE)
+#define ENABLE_TIZEN_WEBKIT2_TEXT_ZOOM 1 /* Changhyup Jwa(ch.jwa@samsung.com) : Enable/Disable text zoom on user's pinch zoom */
+#endif
#endif /* ENABLE(TIZEN_WEBKIT2) */
/* When displaying menu list using menu icon, a additional scrollbar is displayed in the screen center
macro(EnableDefaultKeypad, defaultKeypadEnabled, Bool, bool, true) \
macro(InteractiveFormValidationEnabled, interactiveFormValidationEnabled, Bool, bool, true) \
macro(GeolocationEnabled, geolocationEnabled, Bool, bool, true) \
+ macro(TextZoomEnabled, textZoomEnabled, Bool, bool, false) \
\
#define FOR_EACH_WEBKIT_TIZEN_DOUBLE_PREFERENCE(macro) \
#endif
}
+void WKPreferencesSetTextZoomEnabled(WKPreferencesRef preferencesRef, bool enable)
+{
+#if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+ toImpl(preferencesRef)->setTextZoomEnabled(enable);
+#endif
+}
+
+bool WKPreferencesGetTextZoomEnabled(WKPreferencesRef preferencesRef)
+{
+#if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+ return toImpl(preferencesRef)->textZoomEnabled();
+#else
+ return false;
+#endif
+}
WK_EXPORT bool WKPreferencesGetGeolocationEnabled(WKPreferencesRef preferencesRef);
// #endif
+// #if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetTextZoomEnabled(WKPreferencesRef preferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetTextZoomEnabled(WKPreferencesRef preferencesRef);
+// #endif
+
#ifdef __cplusplus
}
#endif
m_viewportConstraints.minimumScale = (float)viewSize().width() / size.width();
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
if (scaleFactor() == previousMinimumScale)
- setVisibleContentRect(m_page->scrollPosition(), m_viewportConstraints.minimumScale, FloatPoint());
+ setVisibleContentRect(scrollPosition(), m_viewportConstraints.minimumScale, FloatPoint());
+ else
+ setVisibleContentRect(scrollPosition(), scaleFactor(), FloatPoint());
#else
if (m_requestedScaleFactor == previousMinimumScale)
m_page->scalePage(m_viewportConstraints.minimumScale, scrollPosition());
#endif
// Adjust scaleFactor.
+#if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+ if (!page()->pageGroup()->preferences()->textZoomEnabled())
+ scaleFactor = adjustScaleWithViewport(scaleFactor);
+#else
scaleFactor = adjustScaleWithViewport(scaleFactor);
+#endif
// Adjust scrollPosition not to exceed contents boundary.
if (adjustToBoundary) {
}
#endif
+#if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+Eina_Bool ewk_setting_enable_text_zoom_set(Ewk_Setting* ewkSetting, Eina_Bool enable)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ewkSetting, false);
+
+ WKPreferencesSetTextZoomEnabled(ewkSetting->preferences.get(), enable);
+
+ return true;
+}
+
+Eina_Bool ewk_setting_enable_text_zoom_get(const Ewk_Setting* ewkSetting)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ewkSetting, false);
+
+ return WKPreferencesGetTextZoomEnabled(ewkSetting->preferences.get());
+}
+#endif
EAPI Eina_Bool ewk_setting_enable_geolocation_get(Ewk_Setting* ewkSetting);
//#endif
+// #if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+/**
+ * Requests setting use of text zoom.
+ *
+ * @param setting setting object to text zoom
+ * @param enable to text zoom.
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ */
+EAPI Eina_Bool ewk_setting_enable_text_zoom_set(Ewk_Setting* setting, Eina_Bool enable);
+
+/**
+ * Returns whether text zoom is enabled or not.
+ *
+ * @param setting setting object to text zoom
+ *
+ * @return @c EINA_TRUE if enable text zoom or @c EINA_FALSE.
+ */
+EAPI Eina_Bool ewk_setting_enable_text_zoom_get(const Ewk_Setting* setting);
+//#endif
+
#ifdef __cplusplus
}
#endif
#include "PageClientImpl.h"
#include "ewk_view_private.h"
+#if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+#include "WebPageGroup.h"
+#include "WebPreferences.h"
+#endif
+
using namespace WebCore;
using namespace WebKit;
void Zoom::update(const double zoom, const IntPoint& centerPoint)
{
PageClientImpl* pageClientImpl = ewkViewGetPageClient(m_viewWidget);
+#if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+ double newScaleFactor = m_baseScaleFactor * zoom;
+ if (!pageClientImpl->page()->pageGroup()->preferences()->textZoomEnabled())
+ newScaleFactor = pageClientImpl->adjustScaleWithViewport(newScaleFactor);
+#else
double newScaleFactor = pageClientImpl->adjustScaleWithViewport(m_baseScaleFactor * zoom);
+#endif
if (fabs(newScaleFactor - m_newScaleFactor) > s_scaleFactorThreshold)
m_newScaleFactor = newScaleFactor;
}
PageClientImpl* pageClientImpl = ewkViewGetPageClient(m_viewWidget);
+
+#if ENABLE(TIZEN_WEBKIT2_TEXT_ZOOM)
+ if (pageClientImpl->page()->pageGroup()->preferences()->textZoomEnabled()) {
+ double textScaleFactor = pageClientImpl->adjustScaleWithViewport(pageClientImpl->page()->textZoomFactor() * (m_newScaleFactor / m_baseScaleFactor));
+ pageClientImpl->page()->scale(m_baseScaleFactor, m_baseScrollPosition);
+ pageClientImpl->page()->setTextZoomFactor(textScaleFactor);
+ } else
+ pageClientImpl->page()->scale(m_newScaleFactor, m_newScrollPosition);
+#else
pageClientImpl->page()->scale(m_newScaleFactor, m_newScrollPosition);
+#endif
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
pageClientImpl->updateTextSelectionHandlesAndContextMenu(true);