Changeset 21075 for S60/trunk/WebKit
- Timestamp:
- 04/24/07 13:37:17 (21 months ago)
- Location:
- S60/trunk/WebKit
- Files:
-
- 6 modified
-
BrowserView/src/PluginContentPlayer.cpp (modified) (8 diffs)
-
ChangeLog (modified) (1 diff)
-
Plugin/inc/PluginWin.h (modified) (17 diffs)
-
Plugin/src/NpnImplementation.cpp (modified) (8 diffs)
-
Plugin/src/PluginSkin.cpp (modified) (1 diff)
-
Plugin/src/PluginWin.cpp (modified) (34 diffs)
Legend:
- Unmodified
- Added
- Removed
-
S60/trunk/WebKit/BrowserView/src/PluginContentPlayer.cpp
r20806 r21075 9 9 * Copyright (c) 2006, Nokia Corporation 10 10 * All rights reserved. 11 * 11 * 12 12 * Redistribution and use in source and binary forms, with or without 13 13 * modification, are permitted provided that the following conditions 14 14 * are met: 15 * 15 * 16 16 * * Redistributions of source code must retain the above copyright 17 17 * notice, this list of conditions and the following disclaimer. … … 23 23 * contributors may be used to endorse or promote products derived 24 24 * from this software without specific prior written permission. 25 * 25 * 26 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 36 36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 37 37 * DAMAGE. 38 * 38 * 39 39 * Please see file patentlicense.txt for further grants. 40 40 * ============================================================================== … … 59 59 } 60 60 61 CPluginContentPlayer::CPluginContentPlayer( CBrCtl& aParent, CPluginWin* aPlugin ) 61 CPluginContentPlayer::CPluginContentPlayer( CBrCtl& aParent, CPluginWin* aPlugin ) 62 62 : iBrCtl( aParent ), iPlugin( aPlugin ) 63 63 { … … 90 90 TInt CPluginContentPlayer::CountComponentControls() const 91 91 { 92 if( iPlugin ) 92 if( iPlugin ) 93 93 return 1; 94 else 94 else 95 95 return 0; 96 96 } … … 113 113 114 114 iPlugin->SetParent( this ); 115 115 116 116 // try to guess what part the user wants to see, this way 117 117 // we can avoid unnecessary scrolling; … … 134 134 x = iOrgRect.iTl.iX; // both edges are clipped away 135 135 } 136 136 137 137 // vertical 138 138 if( y < 0 ) … … 148 148 iPlugin->SetRect( TRect( TPoint(x,y), iOrgRect.Size() ) ); 149 149 iPlugin->MakeVisible( ETrue ); 150 iPlugin->RefreshPlugin(); 150 151 CWindowGc& gc = SystemGc(); 152 iPlugin->RefreshPlugin(gc); 151 153 152 154 DrawNow(); -
S60/trunk/WebKit/ChangeLog
r21043 r21075 1 yadavall, reviewed by <sachin.padma@nokia.com> 2 DESC: Windowless plugin support 3 http://bugs.webkit.org/show_bug.cgi?id=13451 4 5 * BrowserView/src/PluginContentPlayer.cpp: 6 (CPluginContentPlayer::CPluginContentPlayer): 7 (CPluginContentPlayer::CountComponentControls): 8 (CPluginContentPlayer::Start): 9 * Plugin/inc/PluginWin.h: 10 (CPluginWin::IsPluginWindowed): 11 (CPluginWin::SetWindowedPlugin): 12 * Plugin/src/NpnImplementation.cpp: 13 (NpnGetValue): 14 (NpnSetValue): 15 (NpnInvalidateRect): 16 (NpnForceRedraw): 17 * Plugin/src/PluginSkin.cpp: 18 (CPluginSkin::Draw): 19 * Plugin/src/PluginWin.cpp: 20 (CPluginWin::CPluginWin): 21 (CPluginWin::ConstructL): 22 (CPluginWin::~CPluginWin): 23 (CPluginWin::NewL): 24 (CPluginWin::SizeChanged): 25 (CPluginWin::OfferKeyEventL): 26 (CPluginWin::CreateStreamL): 27 (CPluginWin::WriteStreamToFileL): 28 (CPluginWin::ProcessEventL): 29 (CPluginWin::RefreshPlugin): 30 (CPluginWin::MakeVisible): 31 (CPluginWin::HandleControlEventL): 32 (CPluginWin::HandleGainingForeground): 33 (CPluginWin::HandleLosingForeground): 34 (CPluginWin::PluginScriptableObject): 35 (CPluginWin::ForceRedraw): 36 (CPluginWin::IsContentInteractive): 37 1 38 yadavall, reviewed by <zbujtas@gmail.com> 2 39 DESC: Fix ROM image iby file -
S60/trunk/WebKit/Plugin/inc/PluginWin.h
r17905 r21075 11 11 * Copyright (c) 2006, Nokia Corporation 12 12 * All rights reserved. 13 * 13 * 14 14 * Redistribution and use in source and binary forms, with or without 15 15 * modification, are permitted provided that the following conditions 16 16 * are met: 17 * 17 * 18 18 * * Redistributions of source code must retain the above copyright 19 19 * notice, this list of conditions and the following disclaimer. … … 25 25 * contributors may be used to endorse or promote products derived 26 26 * from this software without specific prior written permission. 27 * 27 * 28 28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 38 38 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 39 39 * DAMAGE. 40 * 40 * 41 41 * Please see file patentlicense.txt for further grants. 42 42 * ============================================================================== … … 58 58 class CPluginSkin; 59 59 class CPluginHandler; 60 class CBitmapContext; 60 61 #ifdef RD_BROWSER_WIDGETS 61 62 class NPObject; … … 96 97 */ 97 98 class CPluginWin : public CCoeControl, 98 public MPluginAdapter, 99 public MCoeControlObserver, 99 public MPluginAdapter, 100 public MCoeControlObserver, 100 101 public MCoeForegroundObserver 101 102 { … … 122 123 const CDesCArray& aArgv, 123 124 CPluginSkin& aPluginSkin, 124 const CWebKitControl& aWebKitControl); 125 CWebKitControl& aWebKitControl 126 ); 125 127 126 128 /** … … 192 194 */ 193 195 void LoadPluginToViewerL(); 194 196 195 197 /** 196 198 * Procces a user interface event. … … 211 213 * @return The error code from the plugin 212 214 */ 213 TInt RefreshPlugin( );215 TInt RefreshPlugin(CBitmapContext &aBitmapContext); 214 216 215 217 /** … … 247 249 * @return void 248 250 */ 249 TBool IsContentInteractive() const ; 251 TBool IsContentInteractive() const ; 252 /** 253 * Check if the plugin is windowed or windowless 254 * 255 * @since 3.2 256 * @param None 257 * @return TBool 258 */ 259 TBool IsPluginWindowed() {return iWindowedPlugin;} 260 250 261 public: // Functions from CCoeControl 251 262 … … 456 467 457 468 /** 458 * HandleGainingForeground 469 * HandleGainingForeground 459 470 * @since 3.1 460 471 * @return none 461 472 */ 462 473 void HandleGainingForeground(); 463 464 474 475 465 476 /** 466 * HandleLosingForeground 477 * HandleLosingForeground 467 478 * @since 3.1 468 479 * @return none … … 472 483 #ifdef RD_BROWSER_WIDGETS 473 484 /** 474 * Return window object usable from scriptable plugins 485 * Return window object usable from scriptable plugins 475 486 * @since 3.1 476 487 * @return none 477 */ 478 NPObject* WindowScriptNPObject(); 488 */ 489 NPObject* WindowScriptNPObject(); 479 490 /** 480 491 * Get the scripting object from plugin … … 483 494 * @return 484 495 */ 485 void *PluginScriptableObject(); 496 void *PluginScriptableObject(); 486 497 #endif //RD_BROWSER_WIDGETS 498 499 /** 500 * Sets the plugin's behaviour as windowed or windowless 501 * @since 3.2 502 * @return 503 */ 504 void SetWindowedPlugin(TBool aWindowedPlugin) { iWindowedPlugin = aWindowedPlugin; } 505 506 /** 507 * Forces a redraw of the screen 508 * @since 3.2 509 * @return 510 */ 511 void ForceRedraw(TBool aDrawNow); 487 512 488 513 protected: // New functions … … 495 520 * @param aParent The parent control of the PluginInst. 496 521 */ 497 CPluginWin(CPluginSkin& aPluginSkin, TInt aHandle );522 CPluginWin(CPluginSkin& aPluginSkin, TInt aHandle,CWebKitControl& aWebKitControl); 498 523 499 524 /** … … 510 535 */ 511 536 void ConstructL(const TDesC& aMIMEType, const CDesCArray& aArgn, 512 const CDesCArray& aArgv ,const CWebKitControl& aWebKitControl);537 const CDesCArray& aArgv); 513 538 514 539 /** … … 601 626 602 627 RPointerArray<CPluginData> iPluginDataArray; 603 CDesCArrayFlat iPluginDataFileNamesArray; 628 CDesCArrayFlat iPluginDataFileNamesArray; 604 629 605 630 TBool iPluginFocus; … … 610 635 TBool iIsLoadComplete;// Flag to see if data load is complete 611 636 TInt iTransactionId; // The transaction id 612 HBufC* iTopUrl; 637 HBufC* iTopUrl; 613 638 TInt iReason; 614 639 615 640 MPluginNotifier* iPluginNotifier;// Pointer to the plugin notifier;allows the 616 641 // browser to send events to the plugin … … 618 643 // browser to send option menu commands to plugin 619 644 TBool iDeleted; // Flag to check if plugin control has been deleted 645 CWebKitControl* iWebKitControl; 646 647 TBool iWindowedPlugin;//Flag that is set to true for windowed plugin. 648 CFbsBitmap* iBitmap; //The bitmap for windowless plugin 620 649 }; 621 650 -
S60/trunk/WebKit/Plugin/src/NpnImplementation.cpp
r17301 r21075 9 9 * Copyright (c) 2006, Nokia Corporation 10 10 * All rights reserved. 11 * 11 * 12 12 * Redistribution and use in source and binary forms, with or without 13 13 * modification, are permitted provided that the following conditions 14 14 * are met: 15 * 15 * 16 16 * * Redistributions of source code must retain the above copyright 17 17 * notice, this list of conditions and the following disclaimer. … … 23 23 * contributors may be used to endorse or promote products derived 24 24 * from this software without specific prior written permission. 25 * 25 * 26 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 36 36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 37 37 * DAMAGE. 38 * 38 * 39 39 * Please see file patentlicense.txt for further grants. 40 40 * ============================================================================== … … 408 408 409 409 case NPNVnetscapeWindow: 410 { 410 { 411 411 CPluginWin* pluginWin = (CPluginWin*)aInstance->ndata; 412 412 if (pluginWin) … … 482 482 } 483 483 break; 484 484 case NPPVpluginWindowBool: 485 { 486 CPluginWin* pluginWin = (CPluginWin*)aInstance->ndata; 487 if (pluginWin) 488 { 489 NPBool* isWindowed = (NPBool*)aSetValue; 490 if (isWindowed) 491 { 492 pluginWin->SetWindowedPlugin(*isWindowed); 493 } 494 } 495 break; 496 } 485 497 default: 486 498 break; 487 499 } // end of switch 488 500 489 501 return NPERR_NO_ERROR; 490 502 } … … 496 508 // ----------------------------------------------------------------------------- 497 509 // 498 void NpnInvalidateRect(NPP /*aInstance*/, NPRect * /*aRect*/) 510 void NpnInvalidateRect(NPP aInstance, NPRect* /*aRect*/) 511 { 512 CPluginWin* pluginWin = (CPluginWin*)aInstance->ndata; 513 if( pluginWin ) 514 { 515 pluginWin->ForceRedraw(EFalse); 516 } 517 } 518 519 // ----------------------------------------------------------------------------- 520 // NpnInvalidateRegion 521 // 522 // Unsupported. 523 // ----------------------------------------------------------------------------- 524 // 525 void NpnInvalidateRegion(NPP /*aInstance*/, NPRegion /*aRegion*/) 499 526 { 500 527 // This function is not supported … … 502 529 503 530 // ----------------------------------------------------------------------------- 504 // NpnInvalidateRegion505 //506 // Unsupported.507 // -----------------------------------------------------------------------------508 //509 void NpnInvalidateRegion(NPP /*aInstance*/, NPRegion /*aRegion*/)510 {511 // This function is not supported512 }513 514 // -----------------------------------------------------------------------------515 531 // NpnForceRedraw 516 532 // … … 518 534 // ----------------------------------------------------------------------------- 519 535 // 520 void NpnForceRedraw(NPP /*aInstance*/) 521 { 522 // This function is not supported 523 } 524 525 536 void NpnForceRedraw(NPP aInstance) 537 { 538 CPluginWin* pluginWin = (CPluginWin*)aInstance->ndata; 539 if( pluginWin ) 540 { 541 pluginWin->ForceRedraw(ETrue); 542 } 543 } 544 545 -
S60/trunk/WebKit/Plugin/src/PluginSkin.cpp
r20804 r21075 344 344 345 345 // Force the control to be redrawn. 346 iPluginWin->RefreshPlugin(); 346 iPluginWin->RefreshPlugin(*gContext); 347 347 348 } 348 349 } -
S60/trunk/WebKit/Plugin/src/PluginWin.cpp
r20589 r21075 8 8 * Copyright (c) 2006, Nokia Corporation 9 9 * All rights reserved. 10 * 10 * 11 11 * Redistribution and use in source and binary forms, with or without 12 12 * modification, are permitted provided that the following conditions 13 13 * are met: 14 * 14 * 15 15 * * Redistributions of source code must retain the above copyright 16 16 * notice, this list of conditions and the following disclaimer. … … 22 22 * contributors may be used to endorse or promote products derived 23 23 * from this software without specific prior written permission. 24 * 24 * 25 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 35 35 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 36 36 * DAMAGE. 37 * 37 * 38 38 * Please see file patentlicense.txt for further grants. 39 39 * ============================================================================== … … 56 56 #include "WebKitBridge.h" 57 57 #include "WebKitCursor.h" 58 #include "WebKitSurface.h" 58 59 59 60 // CONSTANTS … … 72 73 // ----------------------------------------------------------------------------- 73 74 // 74 CPluginWin::CPluginWin(CPluginSkin& aPluginSkin, TInt aHandle ) :75 CPluginWin::CPluginWin(CPluginSkin& aPluginSkin, TInt aHandle, CWebKitControl& aWebKitControl) : 75 76 iHandle(aHandle), 76 77 iPluginSkin(&aPluginSkin), 78 iWebKitControl(&aWebKitControl), 77 79 iPluginDataArray(KPluginGranularity), 78 80 iPluginDataFileNamesArray(KPluginGranularity), 79 iDeleted(ETrue) 81 iDeleted(ETrue), 82 iWindowedPlugin(ETrue) 80 83 { 81 84 } … … 87 90 void CPluginWin::ConstructL( const TDesC& aMIMEType, 88 91 const CDesCArray& aArgn, 89 const CDesCArray& aArgv, 90 const CWebKitControl& aWebKitControl ) 92 const CDesCArray& aArgv ) 91 93 { 92 94 __ASSERT_DEBUG( aMIMEType.Ptr() != NULL, PanicPluginInt() ); … … 96 98 iInstance->pdata = NULL; 97 99 98 iPluginHandler = &( aWebKitControl.PluginHandler());100 iPluginHandler = &(iWebKitControl->PluginHandler()); 99 101 if ( iPluginHandler ) 100 102 { … … 102 104 } 103 105 104 105 CreateWindowL((CCoeControl*)&aWebKitControl.WebKitView()); 106 106 107 107 108 NPError err( NPERR_NO_ERROR ); … … 140 141 } 141 142 142 ActivateL(); 143 if( !iWindowedPlugin ) 144 { 145 SetContainerWindowL(*iWebKitControl->BrCtl().CCoeControlParent()); 146 iBitmap = new (ELeave) CFbsBitmap(); 147 iBitmap->Create(TSize(0,0),CStaticObjectContainer::Instance().SurfaceL().DisplayMode()); 148 } 149 else{ 150 CreateWindowL(&iWebKitControl->WebKitView()); 151 ActivateL(); 152 } 143 153 iDeleted = EFalse; 144 154 … … 147 157 SetExtent( TPoint(0,0), TSize(0,0) ); 148 158 149 // Add the focus/foreground observer 159 // Add the focus/foreground observer 150 160 ControlEnv()->AddForegroundObserverL( *this ) ; 151 161 } … … 160 170 TRAP_IGNORE( SetPluginFocusL( EFalse ) ); 161 171 162 // Remove the foreground observer 163 ControlEnv()->RemoveForegroundObserver( *this ); 172 // Remove the foreground observer 173 ControlEnv()->RemoveForegroundObserver( *this ); 164 174 165 175 // If soundstart destroy all the streams created … … 209 219 // If the ref count is zero, the DLL is unloaded. 210 220 iPluginHandler->UnloadPlugin( iHandle ); 211 221 212 222 // Delete the top url that was loaded for this plugin 213 223 delete iTopUrl; 224 delete iBitmap; 214 225 } 215 226 … … 222 233 const CDesCArray& aArgn, const CDesCArray& aArgv, 223 234 CPluginSkin& aPluginSkin, 224 constCWebKitControl& aWebKitControl )225 { 226 CPluginWin* self = new( ELeave ) CPluginWin( aPluginSkin, aHandle );235 CWebKitControl& aWebKitControl ) 236 { 237 CPluginWin* self = new( ELeave ) CPluginWin( aPluginSkin, aHandle, aWebKitControl ); 227 238 CleanupStack::PushL( self ); 228 self->ConstructL( aMIMEType, aArgn, aArgv , aWebKitControl);239 self->ConstructL( aMIMEType, aArgn, aArgv ); 229 240 CleanupStack::Pop(); 230 241 return self; … … 243 254 NPWindow window; 244 255 245 window.window = (MPluginAdapter*)this; 256 if( !iWindowedPlugin ) 257 { 258 iBitmap->Resize(rect.Size()); 259 window.window = (CFbsBitmap*) iBitmap; 260 } 261 else{ 262 window.window = (MPluginAdapter*)this; 263 } 246 264 247 265 // Coordinates for the plugin always start from (0,0) and are relative … … 251 269 window.width = rect.Width(); 252 270 window.height = rect.Height(); 253 271 window.type = iWindowedPlugin ? NPWindowTypeWindow : NPWindowTypeDrawable ; 254 272 TRect clipRect = iPluginSkin->PluginWinClipRect(); 255 273 window.clipRect.top = clipRect.iTl.iX; … … 257 275 window.clipRect.bottom =clipRect.iBr.iX; 258 276 window.clipRect.right = clipRect.iBr.iY; 259 260 window.type = NPWindowTypeDrawable; 277 26