Title: [123974] trunk/Source/WebKit2
- Revision
- 123974
- Author
- [email protected]
- Date
- 2012-07-28 16:28:17 -0700 (Sat, 28 Jul 2012)
Log Message
[WK2][EFL] Add ewk_view_scale_{get|set} to EwkView.
https://bugs.webkit.org/show_bug.cgi?id=92446
Patch by Ryuan Choi <[email protected]> on 2012-07-28
Reviewed by Kenneth Rohde Christiansen.
Add methods to Ewk_View to get or set the scale factor of page.
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_scale_set):
(ewk_view_scale_get):
* UIProcess/API/efl/ewk_view.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (123973 => 123974)
--- trunk/Source/WebKit2/ChangeLog 2012-07-28 21:40:48 UTC (rev 123973)
+++ trunk/Source/WebKit2/ChangeLog 2012-07-28 23:28:17 UTC (rev 123974)
@@ -1,3 +1,17 @@
+2012-07-28 Ryuan Choi <[email protected]>
+
+ [WK2][EFL] Add ewk_view_scale_{get|set} to EwkView.
+ https://bugs.webkit.org/show_bug.cgi?id=92446
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add methods to Ewk_View to get or set the scale factor of page.
+
+ * UIProcess/API/efl/ewk_view.cpp:
+ (ewk_view_scale_set):
+ (ewk_view_scale_get):
+ * UIProcess/API/efl/ewk_view.h:
+
2012-07-28 Mario Sanchez Prada <[email protected]>
[WK2][GTK] Implement a new spell checker API for WebKit2GTK+
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (123973 => 123974)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-07-28 21:40:48 UTC (rev 123973)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-07-28 23:28:17 UTC (rev 123974)
@@ -884,6 +884,23 @@
return priv->pageClient->page()->estimatedProgress();
}
+Eina_Bool ewk_view_scale_set(Evas_Object* ewkView, double scaleFactor, int x, int y)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
+
+ priv->pageClient->page()->scalePage(scaleFactor, IntPoint(x, y));
+ return true;
+}
+
+double ewk_view_scale_get(const Evas_Object* ewkView)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, -1);
+ EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, -1);
+
+ return priv->pageClient->page()->pageScaleFactor();
+}
+
Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object* ewkView, float ratio)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h (123973 => 123974)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h 2012-07-28 21:40:48 UTC (rev 123973)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h 2012-07-28 23:28:17 UTC (rev 123974)
@@ -379,6 +379,30 @@
EAPI Eina_Bool ewk_view_html_string_load(Evas_Object *o, const char *html, const char *baseUrl, const char *unreachableUrl);
/**
+ * Scales the current page, centered at the given point.
+ *
+ * @param o view object to set the zoom level
+ * @param scale_factor a new level to set
+ * @param cx x of center coordinate
+ * @param cy y of center coordinate
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
+ */
+Eina_Bool ewk_view_scale_set(Evas_Object *o, double scaleFactor, int x, int y);
+
+/**
+ * Queries the current scale factor of the page.
+ *
+ * It returns previous scale factor after ewk_view_scale_set is called immediately
+ * until scale factor of page is really changed.
+ *
+ * @param o view object to get the scale factor
+ *
+ * @return current scale factor in use on success or @c -1.0 on failure
+ */
+double ewk_view_scale_get(const Evas_Object *o);
+
+/**
* Queries the ratio between the CSS units and device pixels when the content is unscaled.
*
* When designing touch-friendly contents, knowing the approximated target size on a device
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes