Changeset 166718 in webkit


Ignore:
Timestamp:
Apr 3, 2014 8:33:11 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WK2] Replacing zoom functionality of MiniBrowser from scale_set to page_zoom_set.
https://bugs.webkit.org/show_bug.cgi?id=130391

Patch by Andrzej Badowski <a.badowski@samsung.com> on 2014-04-03
Reviewed by Gyuyoung Kim.

Source/WebKit2:

Change the implementation of the zoom functionality from ewk_view_scale_set
to ewk_view_page_zoom_set. Adding to the API functions: ewk_view_page_zoom_set and
ewk_view_page_zoom_get to call appropriate WK functions.

  • UIProcess/API/efl/ewk_view.cpp:

(ewk_view_page_zoom_set):
(ewk_view_page_zoom_get):

  • UIProcess/API/efl/ewk_view.h:
  • UIProcess/API/efl/tests/test_ewk2_view.cpp:

(TEST_F):

Tools:

Change the implementation of the zoom functionality from ewk_view_scale_set
to ewk_view_page_zoom_set.

  • MiniBrowser/efl/main.c:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r166697 r166718  
     12014-04-03  Andrzej Badowski  <a.badowski@samsung.com>
     2
     3        [EFL][WK2] Replacing zoom functionality of MiniBrowser from scale_set to page_zoom_set.
     4        https://bugs.webkit.org/show_bug.cgi?id=130391
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Change the implementation of the zoom functionality from ewk_view_scale_set
     9        to ewk_view_page_zoom_set. Adding to the API functions: ewk_view_page_zoom_set and
     10        ewk_view_page_zoom_get to call appropriate WK functions.
     11
     12        * UIProcess/API/efl/ewk_view.cpp:
     13        (ewk_view_page_zoom_set):
     14        (ewk_view_page_zoom_get):
     15        * UIProcess/API/efl/ewk_view.h:
     16        * UIProcess/API/efl/tests/test_ewk2_view.cpp:
     17        (TEST_F):
     18
    1192014-04-02  Alexey Proskuryakov  <ap@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp

    r166566 r166718  
    239239}
    240240
     241Eina_Bool ewk_view_page_zoom_set(Evas_Object* ewkView, double zoomFactor)
     242{
     243    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
     244
     245    WKPageSetPageZoomFactor(impl->wkPage(), zoomFactor);
     246
     247    return true;
     248}
     249
     250double ewk_view_page_zoom_get(const Evas_Object* ewkView)
     251{
     252    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, -1);
     253
     254    return WKPageGetPageZoomFactor(impl->wkPage());
     255}
     256
    241257Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object* ewkView, float ratio)
    242258{
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h

    r166566 r166718  
    574574
    575575/**
     576 * Sets zoom of the current page.
     577 *
     578 * @param o view object to set the zoom level
     579 * @param zoom_factor a new level to set
     580 *
     581 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
     582 */
     583EAPI Eina_Bool ewk_view_page_zoom_set(Evas_Object *o, double zoom_factor);
     584
     585/**
     586 * Queries the current zoom factor of the page.
     587 *
     588 * It returns previous zoom factor after ewk_view_page_zoom_factor_set is called immediately
     589 * until zoom factor of page is really changed.
     590 *
     591 * @param o view object to get the zoom factor
     592 *
     593 * @return current zoom factor in use on success or @c -1.0 on failure
     594 */
     595EAPI double ewk_view_page_zoom_get(const Evas_Object *o);
     596
     597/**
    576598 * Queries the ratio between the CSS units and device pixels when the content is unscaled.
    577599 *
  • trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp

    r166566 r166718  
    11001100    ASSERT_EQ(255, red);
    11011101}
     1102
     1103TEST_F(EWK2ViewTest, ewk_view_page_zoom_set)
     1104{
     1105    ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
     1106
     1107    // Default zoom factor is 1.0
     1108    ASSERT_FLOAT_EQ(1, ewk_view_page_zoom_get(webView()));
     1109
     1110    ASSERT_TRUE(ewk_view_page_zoom_set(webView(), 0.67));
     1111    ASSERT_FLOAT_EQ(0.67, ewk_view_page_zoom_get(webView()));
     1112
     1113    ASSERT_TRUE(ewk_view_page_zoom_set(webView(), 1));
     1114    ASSERT_FLOAT_EQ(1, ewk_view_page_zoom_get(webView()));
     1115}
  • trunk/Tools/ChangeLog

    r166711 r166718  
     12014-04-03  Andrzej Badowski  <a.badowski@samsung.com>
     2
     3        [EFL][WK2] Replacing zoom functionality of MiniBrowser from scale_set to page_zoom_set.
     4        https://bugs.webkit.org/show_bug.cgi?id=130391
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Change the implementation of the zoom functionality from ewk_view_scale_set
     9        to ewk_view_page_zoom_set.
     10
     11        * MiniBrowser/efl/main.c:
     12
    1132014-04-03  Manuel Rego Casasnovas  <rego@igalia.com>
    214
  • trunk/Tools/MiniBrowser/efl/main.c

    r166639 r166718  
    7474        return EINA_FALSE;
    7575
    76     Evas_Coord ox, oy, mx, my, cx, cy;
    77     evas_pointer_canvas_xy_get(evas_object_evas_get(webview), &mx, &my); // Get current mouse position on window.
    78     evas_object_geometry_get(webview, &ox, &oy, NULL, NULL); // Get webview's position on window.
    79     cx = mx - ox; // current x position = mouse x position - webview x position
    80     cy = my - oy; // current y position = mouse y position - webview y position
    81 
    82     Eina_Bool result = ewk_view_scale_set(webview, zoomLevels[level], cx, cy);
    83     return result;
     76    return ewk_view_page_zoom_set(webview, zoomLevels[level]);
    8477}
    8578
Note: See TracChangeset for help on using the changeset viewer.