Changeset 21303

Show
Ignore:
Timestamp:
2007-05-08 07:31:11 (1 year ago)
Author:
spadma
Message:

yaharon, reviewed by <reviewer>

DESC: S60 3.2 Touch: Scrolling initial implementatoin
http://bugs.webkit.org/show_bug.cgi?id=13561

  • BrowserCore/Formcontrols/src/FControlInputWidget.cpp:
    (CControlInputWidget::ConstructTextEditorL):
  • BrowserView/inc/PointerEventHandler.h:
  • BrowserView/inc/ScrollingIndicatorDrawer.h: Added.
  • BrowserView/inc/WebKitView.h:
  • BrowserView/src/PointerEventHandler.cpp:
    (ContentScrollCallback):
    (CPointerEventHandler::~CPointerEventHandler):
    (CPointerEventHandler::HandlePointerEventL):
    (CPointerEventHandler::CheckSmartTextEntry):
    (CPointerEventHandler::GetFrameAt):
    (CPointerEventHandler::HandleScrollingPointerEventL):
    (CPointerEventHandler::HandleShouldStartScrollingL):
    (CPointerEventHandler::HandleDragL):
    (CPointerEventHandler::HandleContentScroll):
    (CPointerEventHandler::UpdateCursor):
  • BrowserView/src/ScrollingIndicatorDrawer.cpp: Added.
    (CScrollingIndicatorDrawer::NewL):
    (CScrollingIndicatorDrawer::CScrollingIndicatorDrawer):
    (CScrollingIndicatorDrawer::~CScrollingIndicatorDrawer):
    (CScrollingIndicatorDrawer::ConstructSprite):
    (CScrollingIndicatorDrawerEdge::CScrollingIndicatorDrawerEdge):
    (CScrollingIndicatorDrawerEdge::ConstructL):
    (CScrollingIndicatorDrawerEdge::~CScrollingIndicatorDrawerEdge):
    (CScrollingIndicatorDrawerEdge::UpdateBitmapPositionL):
    (CScrollingIndicatorDrawerEdge::CreateBitmapAndContextL):
    (CScrollingIndicatorDrawerEdge::UpdateMaskL):
    (CScrollingIndicatorDrawerAccelerated::CScrollingIndicatorDrawerAccelerated):
    (CScrollingIndicatorDrawerAccelerated::ConstructL):
    (CScrollingIndicatorDrawerAccelerated::~CScrollingIndicatorDrawerAccelerated):
    (CScrollingIndicatorDrawerAccelerated::UpdateBitmapPositionL):
    (CScrollingIndicatorDrawerAccelerated::CheckNeedRefrech):
    (CScrollingIndicatorDrawerAccelerated::CreateBitmapAndContextL):
    (CScrollingIndicatorDrawerAccelerated::UpdateMaskL):
    (CScrollingIndicatorDrawerAccelerated::UpdateMaskExL):
  • BrowserView/src/WebKitCursor.cpp:
    (CWebKitCursor::CursorUpdate):
  • BrowserView/src/WebKitView.cpp:
    (CWebKitView::ContentIsScrolling):
  • ChangeLog:
  • Plugin/inc/PluginWin.h:
  • Plugin/src/PluginWin.cpp:
    (CPluginWin::PluginConstructedL):
    (CPluginWin::ForceRedraw):
    (CPluginWin::HitRegionContains):
  • group/BrowserView.mmp:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • S60/trunk/WebKit/BrowserCore/Formcontrols/src/FControlInputWidget.cpp

    r21189 r21303  
    6161#include <centralrepository.h> 
    6262#include <AknFepInternalCRKeys.h> 
    63  
     63#include <eikon.hrh> 
    6464 
    6565#include <eikseced.h>       // for secret editor 
     
    300300                         maxLength, 
    301301                         flags ); 
     302    iEditor->SetAknEditorFlags( iEditor->AknEdwinFlags() | EAknEditorFlagDeliverVirtualKeyEventsToApplication); 
    302303    iEditor->EnableT9( t9Allowed); 
    303304    iEditor->SetBorderViewMargins( aMargins ); 
  • S60/trunk/WebKit/BrowserView/inc/PointerEventHandler.h

    r18891 r21303  
    4949#include <coedef.h> 
    5050#include <w32std.h> 
     51#include "ScrollingIndicatorDrawer.h" 
    5152 
    5253 
     
    112113        * @return 
    113114        */ 
     115        TBool ContentIsScrolling() { return iContentIsScrolling;} 
     116 
     117        /** 
     118        * @since 3.2 
     119        * @param 
     120        * @return 
     121        */ 
    114122        void AutoScroll(); 
    115123 
     
    126134        * @return 
    127135        */ 
    128         void CheckSmartTextEntry(); 
     136        void HandleContentScroll(); 
     137 
     138        /** 
     139        * @since 3.2 
     140        * @param 
     141        * @return 
     142        */ 
     143        void CheckSmartTextEntry(TPoint aPoint); 
    129144 
    130145        /** 
     
    135150        TRect& ElementRect() { return iElementRect; } 
    136151 
     152        /** 
     153        * @since 3.2 
     154        * param 
     155        * return 
     156        */ 
     157        TBool HandleScrollingPointerEventL(const TPointerEvent& aPointerEvent); 
     158 
     159        /** 
     160        * @since 3.2 
     161        * param 
     162        * return 
     163        */ 
     164        TBool HandleShouldStartScrollingL(const TPointerEvent& aPointerEvent); 
     165 
     166        /** 
     167        * @since 3.2 
     168        * param 
     169        * return 
     170        */ 
     171        TBool HandleDragL(const TPointerEvent& aPointerEvent); 
     172 
    137173    private: // New functions 
    138174        /** 
     
    142178        */ 
    143179        CWebKitFrame* GetFrameAt(TPoint aPoint); 
     180 
     181        /** 
     182        * @since 3.2 
     183        * @param 
     184        * @return 
     185        */ 
     186        void UpdateCursor(TPoint aPoint); 
    144187 
    145188    private:    // Data 
     
    149192        CPeriodic* iAutoScrollPeriodic; 
    150193        TPointerEvent iLastPointerEvent; 
    151         TBool iTouchScrolling; 
     194        TBool iTouchScrolling; // in page overview mode 
    152195        TTime iTimeNow; 
    153196        TBool iEnableToolBar; 
     
    156199        CPeriodic* iLongtapTimer; 
    157200        TBool iActiveWidgetConsumes; 
     201        TBool iContentIsScrolling; // in content view 
     202        RArray<TPointerEvent> iPreScrollingEvents; 
     203        CScrollingIndicatorDrawer* iScrollingIndicatorDrawer; 
     204  CScrollingIndicatorDrawer::TScrollingType iScrollingType; 
    158205    }; 
    159206 
  • S60/trunk/WebKit/BrowserView/inc/WebKitView.h

    r18891 r21303  
    222222        void HandlePointerEventL(const TPointerEvent& /*aPointerEvent*/); 
    223223 
     224        /** 
     225        * Return if the user is currently scrolling the content while using the styles 
     226        *  
     227        * 
     228        */ 
     229        TBool ContentIsScrolling(); 
     230 
    224231    protected: // From CCoeControl 
    225232 
  • S60/trunk/WebKit/BrowserView/src/PointerEventHandler.cpp

    r18891 r21303  
    5656#include "SmartLinkHandler.h" 
    5757#include "PopupDrawer.h" 
     58#include "ScrollingIndicatorDrawer.h" 
     59//#include <flogger.h> 
     60#include <f32file.h> 
     61#include <e32math.h> 
    5862 
    5963// constants 
    6064const TInt KAutoScrollPeriodic = 20 * 1000; // Update frequently for faster, smoother scrolling 
    6165const TInt KMicroInterval = 300000; 
    62 const TInt KLongtapTimeout = 300000; // After 800 ms, a tap is considered longtap 
    63 //const TTimeIntervalMicroSeconds KMicroInterval = 300000; 
    64 //const TTimeIntervalMicroSeconds32 KLongtapTimeout = 800000; // After 800 ms, a tap is considered longtap 
     66const TInt KLongtapTimeout = 800000; // After 800 ms, a tap is considered longtap 
     67const TInt KContentScrollPeriodic = 200 * 1000; 
     68const TInt KScrollJump = 20; 
     69 
    6570_LIT(KElementType, "ElType"); 
    6671_LIT(KPointX, "PointX"); 
     
    7984    } 
    8085 
     86TInt ContentScrollCallback(TAny* aPtr) 
     87    { 
     88    static_cast<CPointerEventHandler*>(aPtr)->HandleContentScroll(); 
     89    return KErrNone; 
     90    } 
     91 
     92/** / 
     93//Uncomment to log pointer events 
     94void Log(const TPointerEvent& aPointerEvent, TPtrC aText) 
     95    { 
     96    _LIT(KDown, "down"); 
     97    _LIT(KDrag, "drag"); 
     98    _LIT(KUp, "up"); 
     99    _LIT(KUnknown, "Unknown"); 
     100    TPtrC pDown(KDown); 
     101    TPtrC pDrag(KDrag); 
     102    TPtrC pUp(KUp); 
     103    TPtrC p(KUnknown); 
     104    _LIT(KK,"time: %u %u, point=(%d, %d) Event=%S %S\0"); 
     105    TTime timeNow; 
     106    timeNow.UniversalTime(); 
     107    TInt64 now = timeNow.Int64(); 
     108    TInt nowHigh = I64HIGH(now); 
     109    TInt nowLow = I64LOW(now); 
     110    switch (aPointerEvent.iType) 
     111        { 
     112        case TPointerEvent::EButton1Down: 
     113            p.Set(pDown); 
     114            break; 
     115        case TPointerEvent::EDrag: 
     116            p.Set(pDrag); 
     117            break; 
     118        case TPointerEvent::EButton1Up: 
     119            p.Set(pUp); 
     120            break; 
     121        } 
     122    RFileLogger::WriteFormat(_L("Browser"),_L("pointer.log"),EFileLoggingModeAppend,KK, nowHigh, nowLow, aPointerEvent.iPosition.iX, 
     123        aPointerEvent.iPosition.iY, &p, &aText); 
     124    } 
     125/**/ 
    81126 
    82127// ============================ MEMBER FUNCTIONS =============================== 
     
    131176        delete iLongtapTimer; 
    132177        } 
    133     } 
     178    iPreScrollingEvents.Reset(); 
     179    delete iScrollingIndicatorDrawer; 
     180    } 
     181 
    134182void CPointerEventHandler::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
    135183    { 
     184    //Log(aPointerEvent, _L("HandlePointerEvent")); 
    136185    if (AknLayoutUtils::PenEnabled()) 
    137186        { 
     
    160209        // Handle input box 
    161210        CCoeControl* activeWidget = iWebKitView->ActiveWidget(); 
    162         if (activeWidget && (iWebKitView->ActiveWidgetRect().Contains(aPointerEvent.iPosition) || iActiveWidgetConsumes)) 
     211        if (activeWidget) 
     212            { 
     213            if ((iWebKitView->ActiveWidgetRect().Contains(aPointerEvent.iPosition) || iActiveWidgetConsumes)) 
    163214            { 
    164215            if(aPointerEvent.iType == TPointerEvent::EButton1Down) 
     
    168219            return activeWidget->HandlePointerEventL(aPointerEvent); 
    169220            } 
     221            activeWidget->HandlePointerEventL(aPointerEvent); 
     222            } 
     223 
     224        // Handle plugin 
     225        if (iWebKitView->FocusedElementType() == TBrCtlDefs::EElementActivatedObjectBox ) 
     226            { 
     227            iWebKitView->DeActivate(EFalse); 
     228            } 
     229 
    170230        TPoint absCursorPos = iWebKitView->MainFrame().ToDocCoords(aPointerEvent.iPosition) + iWebKitView->MainFrame().ContentPosition(); 
    171231        absCursorPos = iWebKitView->MainFrame().ToViewCoords(absCursorPos); 
     
    181241        if (elType == TBrCtlDefs::EElementNone) 
    182242            { 
    183             CheckSmartTextEntry(); 
    184             } 
    185  
     243            CheckSmartTextEntry(aPointerEvent.iPosition); 
     244            } 
     245 
     246        if (HandleScrollingPointerEventL(aPointerEvent)) 
     247            { 
     248            return; 
     249            } 
     250 
     251        if (iLongtapTimer) 
     252            { 
     253            iLongtapTimer->Cancel(); 
     254            } 
    186255        TPointerEvent pointerEvent = aPointerEvent; 
    187256        pointerEvent.iPosition = absCursorPos; 
    188257 
    189         if (iWebKitView->Cursor()) 
    190              { 
    191              iWebKitView->Cursor()->ResetTransparency(); 
    192              iWebKitView->Cursor()->CursorUpdate(ETrue); 
    193              iWebKitView->Cursor()->SetPosition(aPointerEvent.iPosition); 
    194              } 
     258        UpdateCursor(aPointerEvent.iPosition); 
    195259        frame->WebKitBridge().WebCoreBridge().PointerEvent(pointerEvent); 
    196260 
     
    199263            iLastPointerEvent = aPointerEvent; 
    200264            iElementRect = elRect; 
    201             if (iLongtapTimer) 
    202                 { 
    203                 iLongtapTimer->Cancel(); 
    204                 } 
    205             else 
     265            if (!iLongtapTimer) 
    206266                { 
    207267                iLongtapTimer = CPeriodic::NewL(CActive::EPriorityLow); 
     
    209269            iLongtapTimer->Start(KLongtapTimeout, KLongtapTimeout, TCallBack(&LongTapCallback, this)); 
    210270            } 
    211         else 
    212             { 
    213             if (iLongtapTimer) 
    214                 { 
    215                 iLongtapTimer->Cancel(); 
    216                 } 
    217         if (pointerEvent.iType == TPointerEvent::EButton1Up) 
     271        else if (pointerEvent.iType == TPointerEvent::EButton1Up) 
    218272            { 
    219273            if (elRect == iElementRect) // down and up on same element? 
    220274                { 
    221                     if (iWebKitView->FocusedElementType() != TBrCtlDefs::EElementNone) // WebCore crashes on empty page 
    222                         {                     
    223                 frame->WebKitBridge().WebCoreBridge().ActivateEvent(absCursorPos); 
    224                 } 
    225                     // special handling for broken image 
    226                     if (iWebKitView->FocusedElementType() == TBrCtlDefs::EElementBrokenImage) 
    227                         { 
    228                         frame->WebKitBridge().WebCoreBridge().LoadFocusedImage(absCursorPos); 
    229             } 
    230                     // special handling for e-mail address 
    231                     if (iWebKitView->FocusedElementType() == TBrCtlDefs::EElementSmartLinkEmail) 
    232             { 
    233                         frame->SmartLinkHandler()->HandleSendMessage(); 
    234                         } 
     275                if (iWebKitView->FocusedElementType() != TBrCtlDefs::EElementNone) // WebCore crashes on empty page 
     276                    {                     
     277                    frame->WebKitBridge().WebCoreBridge().ActivateEvent(absCursorPos); 
     278                    } 
     279                // special handling for broken image 
     280                if (iWebKitView->FocusedElementType() == TBrCtlDefs::EElementBrokenImage) 
     281                    { 
     282                    frame->WebKitBridge().WebCoreBridge().LoadFocusedImage(absCursorPos); 
     283                    } 
     284                // special handling for e-mail address 
     285                if (iWebKitView->FocusedElementType() == TBrCtlDefs::EElementSmartLinkEmail) 
     286                    { 
     287                    frame->SmartLinkHandler()->HandleSendMessage(); 
    235288                    } 
    236289                } 
     
    380433    } 
    381434 
    382 void CPointerEventHandler::CheckSmartTextEntry(
    383     { 
    384     CWebKitFrame* focused = GetFrameAt(iLastPointerEvent.iPosition); 
     435void CPointerEventHandler::CheckSmartTextEntry(TPoint aPoint
     436    { 
     437    CWebKitFrame* focused = GetFrameAt(aPoint); 
    385438    if (focused) 
    386439        {              
    387         TPoint ptCursor = focused->ViewCoordsInFrameCoords(iLastPointerEvent.iPosition); 
     440        TPoint ptCursor = focused->ViewCoordsInFrameCoords(aPoint); 
    388441        CSmartLink* entry = focused->SmartLinkMap()->GetEntry(TRect(ptCursor,TSize(1,1))); 
    389442        if ( entry != NULL) 
     
    412465 
    413466 
     467TBool CPointerEventHandler::HandleScrollingPointerEventL(const TPointerEvent& aPointerEvent) 
     468    { 
     469    TBool ret = EFalse; 
     470    if (iContentIsScrolling) 
     471        { 
     472        return HandleDragL(aPointerEvent); 
     473        } 
     474    else 
     475        { 
     476        return HandleShouldStartScrollingL(aPointerEvent); 
     477        } 
     478    return ret; 
     479    } 
     480 
     481TBool CPointerEventHandler::HandleShouldStartScrollingL(const TPointerEvent& aPointerEvent) 
     482    { 
     483    TBool ret = EFalse;     
     484    if (iWebKitView->MainFrame().ContentSize().iWidth > iWebKitView->Rect().Width() ||  
     485        iWebKitView->MainFrame().ContentSize().iHeight > iWebKitView->Rect().Height()) 
     486        { 
     487        switch (aPointerEvent.iType) 
     488            { 
     489            case TPointerEvent::EButton1Down: 
     490                { 
     491                // Handle plugins separately 
     492                if (iWebKitView->FocusedElementType() == TBrCtlDefs::EElementObjectBox) 
     493                    { 
     494                    break; 
     495                    } 
     496                iPreScrollingEvents.Reset(); 
     497                iPreScrollingEvents.AppendL(aPointerEvent); 
     498                break; 
     499                } 
     500            case TPointerEvent::EDrag: 
     501                { 
     502                if (iLastPointerEvent.iPosition == aPointerEvent.iPosition) 
     503                    { 
     504                    return ETrue; // Ignore the event 
     505                    } 
     506                switch (iPreScrollingEvents.Count()) 
     507                    { 
     508                    case 1: // wait for more dragging events 
     509                        iPreScrollingEvents.AppendL(aPointerEvent); 
     510                        break; 
     511                    case 2: 
     512                        if (!iWebKitView->ActiveWidget()) 
     513                            { 
     514                            iContentIsScrolling = ETrue; 
     515                            ret = ETrue; 
     516                            iPreScrollingEvents.AppendL(aPointerEvent); 
     517                            // Cancel the TPointerEvent::EButton1Down event in WebCore by sending a fake TPointerEvent::EButton1Up event 
     518                            TPointerEvent pointerEvent; 
     519                            pointerEvent.iPosition = TPoint(-1, -1); 
     520                            pointerEvent.iType = TPointerEvent::EButton1Up; 
     521                            GetFrameAt(aPointerEvent.iPosition)->WebKitBridge().WebCoreBridge().PointerEvent(pointerEvent); 
     522                            if (iWebKitView->Cursor()) 
     523                                { 
     524                                iWebKitView->Cursor()->CursorUpdate(EFalse); 
     525                                } 
     526/* 
     527                                // easy way for selecting one of the 2 scrolling algorithms.  
     528                                // Will be removed when an algorithm is selected 
     529                                RFs rfs; 
     530                                User::LeaveIfError(rfs.Connect()); 
     531                                CleanupClosePushL(rfs); 
     532                                TUint att; 
     533                                if (rfs.Att(_L("c:\\a"), att) == KErrNone) 
     534                                    { 
     535                                    iScrollingType = CScrollingIndicatorDrawer::EScrollingTypeEdge; 
     536                                    } 
     537                                else 
     538                                    { 
     539                                    iScrollingType = CScrollingIndicatorDrawer::EScrollingTypeAccelerated; 
     540                                    } 
     541                              CleanupStack::PopAndDestroy(); // rfs 
     542*/ 
     543                            iScrollingIndicatorDrawer = CScrollingIndicatorDrawer::NewL(*iWebKitView, iScrollingType); 
     544                            iScrollingIndicatorDrawer->UpdateBitmapPositionL(iPreScrollingEvents[0].iPosition); 
     545                            iScrollingIndicatorDrawer->UpdateBitmapPositionL(iPreScrollingEvents[2].iPosition); 
     546                            } 
     547                        break; 
     548                    default: 
     549                        break; 
     550                    } // switch (iPreScrollingEvents.Count()) 
     551                break; 
     552                } 
     553            case TPointerEvent::EButton1Up: // Normal tap 
     554                break; 
     555            default: 
     556                break; 
     557            } // switch (aPointerEvent.iType) 
     558        } 
     559    return ret; 
     560    } 
     561 
     562TBool CPointerEventHandler::HandleDragL(const TPointerEvent& aPointerEvent) 
     563    { 
     564    TBool ret = ETrue; 
     565    if (aPointerEvent.iType == TPointerEvent::EDrag) 
     566        {       
     567        if (!iAutoScrollPeriodic) 
     568            { 
     569            iAutoScrollPeriodic = CPeriodic::NewL(CActive::EPriorityStandard); 
     570            iAutoScrollPeriodic->Start(KContentScrollPeriodic, KContentScrollPeriodic, TCallBack(&ContentScrollCallback, this)); 
     571            } 
     572        // Keep the last pointer event 
     573        iPreScrollingEvents[1] = iPreScrollingEvents[2]; 
     574        iPreScrollingEvents[2] = aPointerEvent; 
     575        UpdateCursor(aPointerEvent.iPosition); 
     576        iScrollingIndicatorDrawer->UpdateBitmapPositionL(iPreScrollingEvents[2].iPosition); 
     577        } 
     578    else if (aPointerEvent.iType == TPointerEvent::EButton1Up) 
     579        { 
     580        if (iAutoScrollPeriodic) 
     581            { 
     582            iAutoScrollPeriodic->Cancel(); 
     583            delete iAutoScrollPeriodic; 
     584            iAutoScrollPeriodic = NULL; 
     585            } 
     586        delete iScrollingIndicatorDrawer; 
     587        iScrollingIndicatorDrawer = NULL; 
     588        iContentIsScrolling = EFalse; 
     589        ret = EFalse; 
     590        iWebKitView->DrawNow(); 
     591        } 
     592    return ret; 
     593    } 
     594 
     595void CPointerEventHandler::HandleContentScroll() 
     596    { 
     597    //Log(iPreScrollingEvents[2], _L("HandleContentScroll")); 
     598    TInt halfSize = iScrollingIndicatorDrawer->ScrollingIndicatorSize() / 2; 
     599    TInt deltaX = 0; 
     600    TInt deltaY = 0; 
     601    TReal r = 1; 
     602    TInt i = 1; 
     603    TInt dirX = 1; 
     604    TInt dirY = 1; 
     605    TReal power; 
     606 
     607    switch (iScrollingType) 
     608        { 
     609        case CScrollingIndicatorDrawer::EScrollingTypeEdge: 
     610            {             
     611            power = 1.0; 
     612            if (iPreScrollingEvents[2].iPosition.iX < halfSize) 
     613                { 
     614                deltaX = halfSize - iPreScrollingEvents[2].iPosition.iX; 
     615                dirX = -1; 
     616                } 
     617            else if (iPreScrollingEvents[2].iPosition.iX > iWebKitView->Rect().iBr.iX - halfSize) 
     618                { 
     619                deltaX = iPreScrollingEvents[2].iPosition.iX - iWebKitView->Rect().iBr.iX + halfSize; 
     620                } 
     621 
     622            if (iPreScrollingEvents[2].iPosition.iY < halfSize) 
     623                { 
     624                deltaY = halfSize - iPreScrollingEvents[2].iPosition.iY; 
     625                dirY = -1; 
     626                } 
     627            else if (iPreScrollingEvents[2].iPosition.iY > iWebKitView->Rect().iBr.iY - halfSize) 
     628                { 
     629                deltaY = iPreScrollingEvents[2].iPosition.iY -iWebKitView->Rect().iBr.iY + halfSize; 
     630                } 
     631            break; 
     632            } 
     633        case CScrollingIndicatorDrawer::EScrollingTypeAccelerated: 
     634            { 
     635            power = 0.8; 
     636            if (iPreScrollingEvents[2].iPosition.iX < iPreScrollingEvents[0].iPosition.iX - halfSize) 
     637                { 
     638                deltaX = iPreScrollingEvents[0].iPosition.iX - halfSize - iPreScrollingEvents[2].iPosition.iX; 
     639                dirX = -1; 
     640                } 
     641            else if (iPreScrollingEvents[2].iPosition.iX > iPreScrollingEvents[0].iPosition.iX + halfSize) 
     642                { 
     643                deltaX = iPreScrollingEvents[2].iPosition.iX - iPreScrollingEvents[0].iPosition.iX - halfSize; 
     644                } 
     645 
     646            if (iPreScrollingEvents[2].iPosition.iY < iPreScrollingEvents[0].iPosition.iY - halfSize) 
     647                { 
     648                deltaY = iPreScrollingEvents[0].iPosition.iY - halfSize - iPreScrollingEvents[2].iPosition.iY; 
     649                dirY = -1; 
     650                } 
     651            else if (iPreScrollingEvents[2].iPosition.iY > iPreScrollingEvents[0].iPosition.iY + halfSize) 
     652                { 
     653                deltaY = iPreScrollingEvents[2].iPosition.iY - iPreScrollingEvents[0].iPosition.iY - halfSize; 
     654                } 
     655            break; 
     656            } 
     657    } 
     658 
     659    if (deltaX) 
     660        { 
     661        Math::Pow(r, deltaX, power); 
     662        i = r; 
     663        deltaX = i * dirX * KScrollJump; 
     664        } 
     665    if (deltaY) 
     666        { 
     667        Math::Pow(r, deltaY, power); 
     668        i = r; 
     669        deltaY = i * dirY * KScrollJump; 
     670        } 
     671 
     672    if (deltaX || deltaY) 
     673        { 
     674        iWebKitView->MainFrame().ScrollTo(iWebKitView->MainFrame().ContentPosition() + TPoint(deltaX, deltaY)); 
     675        } 
     676    iScrollingIndicatorDrawer->UpdateBitmapPositionL(iPreScrollingEvents[2].iPosition); 
     677    } 
     678 
     679void CPointerEventHandler::UpdateCursor(TPoint aPoint) 
     680    { 
     681    if (iWebKitView->Cursor()) 
     682        { 
     683        iWebKitView->Cursor()->ResetTransparency(); 
     684        iWebKitView->Cursor()->CursorUpdate(!iContentIsScrolling); 
     685        iWebKitView->Cursor()->SetPosition(aPoint); 
     686        } 
     687    } 
     688 
     689 
    414690//  End of File 
  • S60/trunk/WebKit/BrowserView/src/WebKitCursor.cpp

    r19654 r21303  
    192192    iIsVisible = aVisibility; 
    193193    iSprite.SetPosition( iPosition ); 
    194     if ( aVisibility
     194    if ( aVisibility && !iView->ContentIsScrolling()
    195195        { 
    196196        TSpriteMember spriteMem; 
  • S60/trunk/WebKit/BrowserView/src/WebKitView.cpp

    r20806 r21303  
    18061806 
    18071807//------------------------------------------------------------------------------- 
     1808// ContentIsScrolling 
     1809// Returns if the user is currently using the stylus to scroll 
     1810//------------------------------------------------------------------------------- 
     1811TBool CWebKitView::ContentIsScrolling() 
     1812    { 
     1813    return iPointerEventHandler->ContentIsScrolling(); 
     1814    } 
     1815 
     1816//------------------------------------------------------------------------------- 
    18081817// NodeUnderPointer() 
    18091818// Checks if there is any Node under pointer 
  • S60/trunk/WebKit/ChangeLog

    r21236 r21303  
     1yaharon, reviewed by <reviewer> 
     2 DESC:  S60 3.2 Touch: Scrolling initial implementatoin 
     3 http://bugs.webkit.org/show_bug.cgi?id=13561 
     4 
     5        * BrowserCore/Formcontrols/src/FControlInputWidget.cpp: 
     6        (CControlInputWidget::ConstructTextEditorL): 
     7        * BrowserView/inc/PointerEventHandler.h: 
     8        * BrowserView/inc/ScrollingIndicatorDrawer.h: Added. 
     9        * BrowserView/inc/WebKitView.h: 
     10        * BrowserView/src/PointerEventHandler.cpp: 
     11        (ContentScrollCallback): 
     12        (CPointerEventHandler::~CPointerEventHandler): 
     13        (CPointerEventHandler::HandlePointerEventL): 
     14        (CPointerEventHandler::CheckSmartTextEntry): 
     15        (CPointerEventHandler::GetFrameAt): 
     16        (CPointerEventHandler::HandleScrollingPointerEventL): 
     17        (CPointerEventHandler::HandleShouldStartScrollingL): 
     18        (CPointerEventHandler::HandleDragL): 
     19        (CPointerEventHandler::HandleContentScroll): 
     20        (CPointerEventHandler::UpdateCursor): 
     21        * BrowserView/src/ScrollingIndicatorDrawer.cpp: Added. 
     22        (CScrollingIndicatorDrawer::NewL): 
     23        (CScrollingIndicatorDrawer::CScrollingIndicatorDrawer): 
     24        (CScrollingIndicatorDrawer::~CScrollingIndicatorDrawer): 
     25        (CScrollingIndicatorDrawer::ConstructSprite): 
     26        (CScrollingIndicatorDrawerEdge::CScrollingIndicatorDrawerEdge): 
     27        (CScrollingIndicatorDrawerEdge::ConstructL): 
     28        (CScrollingIndicatorDrawerEdge::~CScrollingIndicatorDrawerEdge): 
     29        (CScrollingIndicatorDrawerEdge::UpdateBitmapPositionL): 
     30        (CScrollingIndicatorDrawerEdge::CreateBitmapAndContextL): 
     31        (CScrollingIndicatorDrawerEdge::UpdateMaskL): 
     32        (CScrollingIndicatorDrawerAccelerated::CScrollingIndicatorDrawerAccelerated): 
     33        (CScrollingIndicatorDrawerAccelerated::ConstructL): 
     34        (CScrollingIndicatorDrawerAccelerated::~CScrollingIndicatorDrawerAccelerated): 
     35        (CScrollingIndicatorDrawerAccelerated::UpdateBitmapPositionL): 
     36        (CScrollingIndicatorDrawerAccelerated::CheckNeedRefrech): 
     37        (CScrollingIndicatorDrawerAccelerated::CreateBitmapAndContextL): 
     38        (CScrollingIndicatorDrawerAccelerated::UpdateMaskL): 
     39        (CScrollingIndicatorDrawerAccelerated::UpdateMaskExL): 
     40        * BrowserView/src/WebKitCursor.cpp: 
     41        (CWebKitCursor::CursorUpdate): 
     42        * BrowserView/src/WebKitView.cpp: 
     43        (CWebKitView::ContentIsScrolling): 
     44        * ChangeLog: 
     45        * Plugin/inc/PluginWin.h: 
     46        * Plugin/src/PluginWin.cpp: 
     47        (CPluginWin::PluginConstructedL): 
     48        (CPluginWin::ForceRedraw): 
     49        (CPluginWin::HitRegionContains): 
     50        * group/BrowserView.mmp: 
     51 
     52 
     53 
    154brmorris, reviewed by sachin 
    255 DESC: stub this out in SDK development environment: 
  • S60/trunk/WebKit/Plugin/inc/PluginWin.h

    r21075 r21303  
    9999                    public MPluginAdapter, 
    100100                    public MCoeControlObserver, 
    101                     public MCoeForegroundObserver 
     101                    public MCoeForegroundObserver, 
     102                    public MCoeControlHitTest 
    102103    { 
    103104 
     
    510511        */ 
    511512        void ForceRedraw(TBool aDrawNow); 
     513 
     514    public: // Functions from MCoeControlHitTest 
     515        TBool HitRegionContains(const TPoint &aPoint, const CCoeControl &aControl) const; 
    512516 
    513517    protected: // New functions 
  • S60/trunk/WebKit/Plugin/src/PluginWin.cpp

    r21075 r21303  
    12091209    iPluginControl = aControl; 
    12101210    iDeleted = EFalse; 
     1211    aControl->SetHitTest(this); 
    12111212    } 
    12121213 
     
    12921293 
    12931294// ----------------------------------------------------------------------------- 
     1295// CPluginWin::HitRegionContains 
     1296// ----------------------------------------------------------------------------- 
     1297//   
     1298TBool CPluginWin::HitRegionContains(const TPoint &aPoint, const CCoeControl &/*aControl*/) const 
     1299    { 
     1300    if (iPluginSkin->WebKitControl()->WebKitView().FocusedElementType() != TBrCtlDefs::EElementActivatedObjectBox) 
     1301        { 
     1302        TPoint point = iPluginSkin->Rect().iTl + aPoint; 
     1303        iPluginSkin->Frame()->WebKitBridge().WebCoreBridge().ActivateEvent(point); 
     1304        iPluginSkin->WebKitControl()->WebKitView().WebKitControl().OpenPluginPlayer(); 
     1305        } 
     1306    return ETrue; 
     1307    } 
     1308 
     1309// ----------------------------------------------------------------------------- 
    12941310// CPluginWin::IsContentInteractive() 
    12951311// Tells  that plugin content can accept user interaction. 
  • S60/trunk/WebKit/group/BrowserView.mmp

    r20117 r21303  
    7676SOURCE          SmartLinkHandler.cpp 
    7777SOURCE          SmartLinkMap.cpp 
    78 SOURCE                  PopupDrawer.cpp 
     78SOURCE          PopupDrawer.cpp 
     79SOURCE          ScrollingIndicatorDrawer.cpp 
    7980#ifdef  RD_BROWSER_WIDGETS 
    8081SOURCE          WidgetExtension.cpp