webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp
changeset 27 60c5402cb945
parent 17 c8a366e56285
child 36 0ed94ceaa377
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp	Thu Sep 24 12:53:48 2009 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp	Mon Oct 26 08:28:45 2009 +0200
@@ -341,7 +341,7 @@
 // Refresh the plugin. - Called by PluginSkin
 // -----------------------------------------------------------------------------
 //
-TInt PluginWin::refreshPlugin(CFbsBitGc& bitmapContext)
+TInt PluginWin::refreshPlugin(CFbsBitGc& bitmapContext,TRect aRect)
 {
     if (m_control && IsVisible() && m_control->DrawableWindow())
         m_control->DrawNow();
@@ -352,12 +352,7 @@
         if (m_pluginskin->getNPPluginFucs() && m_pluginskin->getNPPluginFucs()->event) {
             m_pluginskin->getNPPluginFucs()->event(m_pluginskin->getNPP(), static_cast<void*>(&event));
         }
-        WebFrameView* fv = m_pluginskin->frame()->frameView();
-        TRect rect(Rect());
-        rect = TRect(fv->viewCoordsInFrameCoords(Rect().iTl), fv->viewCoordsInFrameCoords(Rect().iBr));
-        rect = fv->toViewCoords(rect);
-        rect.SetSize(m_bitmap->SizeInPixels()); // toViewCoords sometimes grows the rect by 1, which wil cause the bitmap to not draw
-        bitmapContext.DrawBitmap(rect, m_bitmap, rect.Size());
+        bitmapContext.DrawBitmap(aRect, m_bitmap);
     }
     return KErrNone;
 }
@@ -758,6 +753,21 @@
                                                          static_cast<void*>(&event));
         }
     }
+    else if(!m_windowedPlugin && m_pluginskin->getNPPluginFucs() && m_pluginskin->getNPPluginFucs()->event){
+        TRect cliprect = m_pluginskin->getClipRect();
+        TPoint newpos = aEvent.CurrentPos();
+        if(cliprect.Contains(newpos)){
+           TGestureEvent gestEvent(aEvent);
+           NPEvent event;
+           NPEventPointer ev;
+           event.event = ENppEventPointer;
+           ev.reserved = &gestEvent;
+           ev.pointerEvent = NULL;
+           event.param = &ev;
+           ret = m_pluginskin->getNPPluginFucs()->event(m_pluginskin->getNPP(), 
+                                                         static_cast<void*>(&event));
+        }
+    }    
     return ret;
 
 }