Changeset 143339 in webkit


Ignore:
Timestamp:
Feb 19, 2013 8:48:06 AM (11 years ago)
Author:
mikhail.pozdnyakov@intel.com
Message:

[WK2][EFL] Eliminate access to WK2 C++ internals from ewk_view functions
https://bugs.webkit.org/show_bug.cgi?id=109794

Reviewed by Anders Carlsson.

  • UIProcess/API/C/efl/WKView.cpp:

(WKViewSetShowsAsSource):
(WKViewGetShowsAsSource):

Added new WKView API to wrap WebPageProxy::setMainFrameInViewSourceMode()
and WebPageProxy::mainFrameInViewSourceMode() calls.

(WKViewExitFullScreen):

Added new WKView API to wrap WebFullScreenManagerProxy::exitFullScreen()
calls.

  • UIProcess/API/C/efl/WKView.h:
  • UIProcess/API/efl/EwkView.cpp:

(EwkView::feedTouchEvent):

Added feedTouchEvent() method so that: at first ewk_view_feed_touch_event()
is not invoked from EwkView class, secondly ewk_view_feed_touch_event() does
not access WebPage instance directly.

(EwkView::feedTouchEvents):

  • UIProcess/API/efl/EwkView.h:

(EwkView):

  • UIProcess/API/efl/ewk_view.cpp:

(ewk_view_feed_touch_event):
(ewk_view_pagination_mode_set):
(ewk_view_pagination_mode_get):
(ewk_view_fullscreen_exit):
(ewkViewPageContentsCallback):
(ewk_view_page_contents_get):
(ewk_view_source_mode_set):
(ewk_view_source_mode_get):

Those are now using exported C API.

  • UIProcess/efl/WebView.cpp:

(WebKit::WebView::setShowsAsSource):
(WebKit):
(WebKit::WebView::showsAsSource):
(WebKit::WebView::exitFullScreen):

  • UIProcess/efl/WebView.h:

(WebView):

Added WebView methods to support added WKView API.

Location:
trunk/Source/WebKit2
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r143335 r143339  
     12013-02-19  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
     2
     3        [WK2][EFL] Eliminate access to WK2 C++ internals from ewk_view functions
     4        https://bugs.webkit.org/show_bug.cgi?id=109794
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/API/C/efl/WKView.cpp:
     9        (WKViewSetShowsAsSource):
     10        (WKViewGetShowsAsSource):
     11
     12            Added new WKView API to wrap WebPageProxy::setMainFrameInViewSourceMode()
     13            and WebPageProxy::mainFrameInViewSourceMode() calls.
     14
     15        (WKViewExitFullScreen):
     16
     17            Added new WKView API to wrap WebFullScreenManagerProxy::exitFullScreen()
     18            calls.
     19
     20        * UIProcess/API/C/efl/WKView.h:
     21        * UIProcess/API/efl/EwkView.cpp:
     22        (EwkView::feedTouchEvent):
     23
     24            Added feedTouchEvent() method so that: at first ewk_view_feed_touch_event()
     25            is not invoked from EwkView class, secondly ewk_view_feed_touch_event() does
     26            not access WebPage instance directly.
     27
     28        (EwkView::feedTouchEvents):
     29        * UIProcess/API/efl/EwkView.h:
     30        (EwkView):
     31        * UIProcess/API/efl/ewk_view.cpp:
     32        (ewk_view_feed_touch_event):
     33        (ewk_view_pagination_mode_set):
     34        (ewk_view_pagination_mode_get):
     35        (ewk_view_fullscreen_exit):
     36        (ewkViewPageContentsCallback):
     37        (ewk_view_page_contents_get):
     38        (ewk_view_source_mode_set):
     39        (ewk_view_source_mode_get):
     40
     41            Those are now using exported C API.
     42
     43        * UIProcess/efl/WebView.cpp:
     44        (WebKit::WebView::setShowsAsSource):
     45        (WebKit):
     46        (WebKit::WebView::showsAsSource):
     47        (WebKit::WebView::exitFullScreen):
     48        * UIProcess/efl/WebView.h:
     49        (WebView):
     50
     51            Added WebView methods to support added WKView API.
     52
    1532013-02-19  Andras Becsi  <andras.becsi@digia.com>
    254
  • trunk/Source/WebKit2/UIProcess/API/C/efl/WKView.cpp

    r142750 r143339  
    9898}
    9999
     100void WKViewSetShowsAsSource(WKViewRef viewRef, bool flag)
     101{
     102    toImpl(viewRef)->setShowsAsSource(flag);
     103}
     104
     105bool WKViewGetShowsAsSource(WKViewRef viewRef)
     106{
     107    return toImpl(viewRef)->showsAsSource();
     108}
     109
     110void WKViewExitFullScreen(WKViewRef viewRef)
     111{
     112#if ENABLE(FULLSCREEN_API)
     113    toImpl(viewRef)->exitFullScreen();
     114#else
     115    UNUSED_PARAM(viewRef);
     116#endif
     117}
     118
    100119Evas_Object* WKViewGetEvasObject(WKViewRef viewRef)
    101120{
  • trunk/Source/WebKit2/UIProcess/API/C/efl/WKView.h

    r142750 r143339  
    7171WK_EXPORT void WKViewResumeActiveDOMObjectsAndAnimations(WKViewRef);
    7272
     73WK_EXPORT void WKViewSetShowsAsSource(WKViewRef, bool);
     74WK_EXPORT bool WKViewGetShowsAsSource(WKViewRef);
     75
     76WK_EXPORT void WKViewExitFullScreen(WKViewRef);
     77
    7378// FIXME: The long term plan is to get rid of this, so keep usage to a bare minimum.
    7479WK_EXPORT Evas_Object* WKViewGetEvasObject(WKViewRef);
  • trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp

    r143275 r143339  
    749749
    750750#if ENABLE(TOUCH_EVENTS)
     751void EwkView::feedTouchEvent(Ewk_Touch_Event_Type type, const Eina_List* points, const Evas_Modifier* modifiers)
     752{
     753    page()->handleTouchEvent(NativeWebTouchEvent(type, points, modifiers, transformFromScene(), transformToScreen(), ecore_time_get()));
     754}
     755
    751756void EwkView::setTouchEventsEnabled(bool enabled)
    752757{
     
    13061311    }
    13071312
    1308     ewk_view_feed_touch_event(m_evasObject, type, points, evas_key_modifier_get(sd->base.evas));
     1313    feedTouchEvent(type, points, evas_key_modifier_get(sd->base.evas));
    13091314
    13101315    void* data;
  • trunk/Source/WebKit2/UIProcess/API/efl/EwkView.h

    r143275 r143339  
    157157    void setMouseEventsEnabled(bool enabled);
    158158#if ENABLE(TOUCH_EVENTS)
     159    void feedTouchEvent(Ewk_Touch_Event_Type type, const Eina_List* points, const Evas_Modifier* modifiers);
    159160    bool touchEventsEnabled() const { return m_touchEventsEnabled; }
    160161    void setTouchEventsEnabled(bool enabled);
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp

    r143190 r143339  
    3131#include "PageViewportController.h"
    3232#include "PageViewportControllerClientEfl.h"
    33 #include "WKAPICast.h"
    34 #include "WKEinaSharedString.h"
    35 #include "WKFindOptions.h"
    36 #include "WKInspector.h"
    37 #include "WKRetainPtr.h"
    38 #include "WKString.h"
    39 #include "WKURL.h"
    40 #include "WKView.h"
    41 #include "WebContext.h"
    42 #include "WebData.h"
    43 #include "WebFullScreenManagerProxy.h"
    44 #include "WebPageGroup.h"
    45 #include "WebPreferences.h"
    4633#include "ewk_back_forward_list_private.h"
    4734#include "ewk_context.h"
     
    5138#include "ewk_settings_private.h"
    5239#include <Ecore_Evas.h>
     40#include <WebKit2/WKAPICast.h>
     41#include <WebKit2/WKData.h>
     42#include <WebKit2/WKEinaSharedString.h>
     43#include <WebKit2/WKFindOptions.h>
     44#include <WebKit2/WKInspector.h>
    5345#include <WebKit2/WKPageGroup.h>
     46#include <WebKit2/WKRetainPtr.h>
     47#include <WebKit2/WKString.h>
     48#include <WebKit2/WKURL.h>
     49#include <WebKit2/WKView.h>
    5450#include <wtf/UnusedParam.h>
    5551#include <wtf/text/CString.h>
     
    377373    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
    378374
    379     impl->page()->handleTouchEvent(NativeWebTouchEvent(type, points, modifiers, impl->transformFromScene(), impl->transformToScreen(), ecore_time_get()));
     375    impl->feedTouchEvent(type, points, modifiers);
    380376
    381377    return true;
     
    458454{
    459455    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
    460    
    461     impl->page()->setPaginationMode(static_cast<WebCore::Pagination::Mode>(mode));
     456    // FIXME: move to exported C WKPage API when it appears.
     457    toImpl(impl->wkPage())->setPaginationMode(static_cast<WebCore::Pagination::Mode>(mode));
    462458
    463459    return true;
     
    467463{
    468464    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EWK_PAGINATION_MODE_INVALID);
    469 
    470     return static_cast<Ewk_Pagination_Mode>(impl->page()->paginationMode());
     465    // FIXME: move to exported C WKPage API when it appears.
     466    return static_cast<Ewk_Pagination_Mode>(toImpl(impl->wkPage())->paginationMode());
    471467}
    472468
     
    476472    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
    477473
    478     impl->page()->fullScreenManager()->requestExitFullScreen();
     474    WKViewExitFullScreen(impl->wkView());
    479475
    480476    return true;
     
    511507    EINA_SAFETY_ON_NULL_RETURN(context);
    512508
    513     RefPtr<WebData> webData = toImpl(wkData);
    514509    Ewk_Page_Contents_Context* contentsContext= static_cast<Ewk_Page_Contents_Context*>(context);
    515     contentsContext->callback(contentsContext->type, reinterpret_cast<const char*>(webData->bytes()));
     510    contentsContext->callback(contentsContext->type, reinterpret_cast<const char*>(WKDataGetBytes(wkData)));
    516511
    517512    delete contentsContext;
     
    531526    context->callback = callback;
    532527
    533     impl->page()->getContentsAsMHTMLData(DataCallback::create(context, ewkViewPageContentsCallback), false);
     528    WKPageGetContentsAsMHTMLData(impl->wkPage(), false, context, ewkViewPageContentsCallback);
    534529
    535530    return true;
     
    540535    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
    541536
    542     impl->page()->setMainFrameInViewSourceMode(enabled);
     537    WKViewSetShowsAsSource(impl->wkView(), enabled);
    543538
    544539    return true;
     
    549544    EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
    550545
    551     return impl->page()->mainFrameInViewSourceMode();
    552 }
     546    return WKViewGetShowsAsSource(impl->wkView());
     547}
  • trunk/Source/WebKit2/UIProcess/efl/WebView.cpp

    r143275 r143339  
    119119}
    120120
     121void WebView::setShowsAsSource(bool showsAsSource)
     122{
     123    m_page->setMainFrameInViewSourceMode(showsAsSource);
     124}
     125
     126bool WebView::showsAsSource() const
     127{
     128    return m_page->mainFrameInViewSourceMode();
     129}
     130
     131#if ENABLE(FULLSCREEN_API)
     132void WebView::exitFullScreen()
     133{
     134    m_page->fullScreenManager()->requestExitFullScreen();
     135}
     136#endif
     137
    121138void WebView::initializeClient(const WKViewClient* client)
    122139{
  • trunk/Source/WebKit2/UIProcess/efl/WebView.h

    r143004 r143339  
    6464    void suspendActiveDOMObjectsAndAnimations();
    6565    void resumeActiveDOMObjectsAndAnimations();
     66
     67    void setShowsAsSource(bool);
     68    bool showsAsSource() const;
     69
     70#if ENABLE(FULLSCREEN_API)
     71    void exitFullScreen();
     72#endif
    6673
    6774    // View client.
Note: See TracChangeset for help on using the changeset viewer.