34 #include <bldvariant.hrh> |
34 #include <bldvariant.hrh> |
35 #include <AknsUtils.h> |
35 #include <AknsUtils.h> |
36 #include <AknBidiTextUtils.h> |
36 #include <AknBidiTextUtils.h> |
37 #include <featmgr.h> |
37 #include <featmgr.h> |
38 #include <aknlayoutscalable_apps.cdl.h> |
38 #include <aknlayoutscalable_apps.cdl.h> |
39 #include <AknLayout2ScalableDef.h> |
39 #include <aknlayout2scalabledef.h> |
40 #include <applayout.cdl.h> |
40 #include <applayout.cdl.h> |
41 #include <layoutmetadata.cdl.h> |
41 #include <layoutmetadata.cdl.h> |
42 |
42 |
43 #include <AknsDrawUtils.h> |
43 #include <AknsDrawUtils.h> |
44 #include <akniconconfig.h> |
44 #include <akniconconfig.h> |
1463 CleanupStack::PopAndDestroy( 2, maskDev ); |
1463 CleanupStack::PopAndDestroy( 2, maskDev ); |
1464 CleanupStack::Pop( mask ); |
1464 CleanupStack::Pop( mask ); |
1465 } |
1465 } |
1466 |
1466 |
1467 // --------------------------------------------------------------------------- |
1467 // --------------------------------------------------------------------------- |
|
1468 // BubbleUtils::AddTransparencyToBubbleImageL |
|
1469 // --------------------------------------------------------------------------- |
|
1470 // |
|
1471 void BubbleUtils::AddTransparencyToBubbleImageL( |
|
1472 const TAknsItemID& aFrameID, |
|
1473 const TRect& aOuterRect, |
|
1474 const TRect& aInnerRect, |
|
1475 CEikImage*& aBubble ) |
|
1476 { |
|
1477 |
|
1478 const CFbsBitmap* currentMask = aBubble->Mask(); |
|
1479 TSize maskSize( currentMask->SizeInPixels() ); |
|
1480 TRect rect( maskSize ); |
|
1481 |
|
1482 // create transparency frame |
|
1483 CFbsBitmap* transparency = new(ELeave) CFbsBitmap; |
|
1484 CleanupStack::PushL( transparency ); |
|
1485 User::LeaveIfError( transparency->Create( aOuterRect.Size(), |
|
1486 EGray256 ) ); |
|
1487 CFbsBitmapDevice* transparencyDev = CFbsBitmapDevice::NewL( transparency ); |
|
1488 CleanupStack::PushL( transparencyDev ); |
|
1489 CFbsBitGc* transparencyCtx; |
|
1490 User::LeaveIfError( transparencyDev->CreateContext( transparencyCtx ) ); |
|
1491 CleanupStack::PushL( transparencyCtx ); |
|
1492 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
1493 AknsDrawUtils::DrawFrame( skin, |
|
1494 *transparencyCtx, |
|
1495 aOuterRect, |
|
1496 aInnerRect, |
|
1497 aFrameID, |
|
1498 KAknsIIDDefault, |
|
1499 KAknsDrawParamDefault ); |
|
1500 |
|
1501 CleanupStack::PopAndDestroy( 2, transparencyDev ); |
|
1502 |
|
1503 // create solid black mask |
|
1504 CFbsBitmap* solidBlack = new(ELeave) CFbsBitmap; |
|
1505 CleanupStack::PushL( solidBlack ); |
|
1506 User::LeaveIfError( solidBlack->Create( maskSize, EGray256 ) ); |
|
1507 CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( solidBlack ); |
|
1508 CleanupStack::PushL( dev ); |
|
1509 CFbsBitGc* gc; |
|
1510 User::LeaveIfError( dev->CreateContext( gc ) ); |
|
1511 CleanupStack::PushL( gc ); |
|
1512 |
|
1513 gc->SetBrushColor( KRgbBlack ); |
|
1514 gc->SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
1515 gc->DrawRect( rect ); |
|
1516 |
|
1517 // blit original mask on the black mask using transparency mask |
|
1518 gc->BitBltMasked( TPoint(0,0), |
|
1519 currentMask, |
|
1520 TRect( currentMask->SizeInPixels() ), |
|
1521 transparency, |
|
1522 ETrue ); |
|
1523 |
|
1524 CleanupStack::PopAndDestroy( 2, dev); |
|
1525 |
|
1526 CleanupStack::Pop(solidBlack); |
|
1527 aBubble->SetMask( solidBlack ); |
|
1528 |
|
1529 CleanupStack::PopAndDestroy( transparency ); |
|
1530 delete currentMask; |
|
1531 } |
|
1532 |
|
1533 // --------------------------------------------------------------------------- |
1468 // BubbleUtils::PrepareCallObjectToBubbleImageL |
1534 // BubbleUtils::PrepareCallObjectToBubbleImageL |
1469 // --------------------------------------------------------------------------- |
1535 // --------------------------------------------------------------------------- |
1470 // |
1536 // |
1471 void BubbleUtils::PrepareCallObjectToBubbleImageL( |
1537 void BubbleUtils::PrepareCallObjectToBubbleImageL( |
1472 const CFbsBitmap* aCOImage, |
1538 const CFbsBitmap* aCOImage, |