491 iData->iOpacity = aOpacity; |
494 iData->iOpacity = aOpacity; |
492 } |
495 } |
493 } |
496 } |
494 } |
497 } |
495 |
498 |
|
499 |
|
500 // --------------------------------------------------------------------------- |
|
501 // CreateSetWindowAreaL |
|
502 // --------------------------------------------------------------------------- |
|
503 // |
|
504 TAny* CAlfWindow::CreateSetWindowAreaL( |
|
505 TInt& aOffset, TInt aScreenNumber, const TPoint& aOrigin, const TRegion& aRegion) |
|
506 { |
|
507 const TInt size = ( 4*aRegion.Count() + 4 ) * sizeof(TInt32); |
|
508 TAny* data = (TAny*)iData->iWindowManager->Bridge()->AppendVarDataL( size, aOffset ); |
|
509 |
|
510 RMemWriteStream str( data, size ); |
|
511 str.WriteInt32L( aScreenNumber ); |
|
512 str.WriteInt32L( aOrigin.iX ); |
|
513 str.WriteInt32L( aOrigin.iY ); |
|
514 str.WriteInt32L( aRegion.Count() ); |
|
515 |
|
516 for (TInt i = 0; i < aRegion.Count(); ++i ) |
|
517 { |
|
518 const TRect rect(aRegion[i]); |
|
519 str.WriteInt32L(rect.iTl.iX); |
|
520 str.WriteInt32L(rect.iTl.iY); |
|
521 str.WriteInt32L(rect.iBr.iX); |
|
522 str.WriteInt32L(rect.iBr.iY); |
|
523 } |
|
524 |
|
525 return data; |
|
526 } |
|
527 |
|
528 // --------------------------------------------------------------------------- |
|
529 // SetWindowArea |
|
530 // --------------------------------------------------------------------------- |
|
531 // |
|
532 void CAlfWindow::SetWindowArea() |
|
533 { |
|
534 if ( iData->iWindowArea.Count() ) |
|
535 { |
|
536 // Now inserted to scene - forward |
|
537 SetWindowArea(iData->iWindowAreaOrigin, iData->iWindowArea); |
|
538 iData->iWindowArea.Clear(); |
|
539 } |
|
540 } |
|
541 |
|
542 // --------------------------------------------------------------------------- |
|
543 // SetWindowArea |
|
544 // --------------------------------------------------------------------------- |
|
545 // |
|
546 void CAlfWindow::SetWindowArea(const TPoint& aOrigin, const TRegion& aRegion) |
|
547 { |
|
548 if ( WsInfo().iNodeType != MWsWindowTreeNode::EWinTreeNodeClient ) |
|
549 { |
|
550 return; |
|
551 } |
|
552 |
|
553 if (!IsInsertedToScene()) |
|
554 { |
|
555 // Cache data to be able to send once this is inserted to scene |
|
556 iData->iWindowAreaOrigin = aOrigin; |
|
557 iData->iWindowArea.Copy(aRegion); |
|
558 if ( iData->iWindowArea.CheckError() ) |
|
559 { |
|
560 iData->iWindowArea.Clear(); |
|
561 } |
|
562 return; |
|
563 } |
|
564 |
|
565 TAlfWServInfo wservInfo = WsInfo(); |
|
566 TInt offset = 0; |
|
567 TAny* data = NULL; |
|
568 |
|
569 TRAP_IGNORE(data = CreateSetWindowAreaL( offset, wservInfo.iScreenNumber, aOrigin, aRegion )); |
|
570 |
|
571 if (data) |
|
572 { |
|
573 TAlfBridgerData d; |
|
574 d.Set(EAlfDSSetWindowArea, |
|
575 wservInfo.iRefId.iWindowGroupId, |
|
576 wservInfo.iRefId.iWindowIdentifer, |
|
577 (TAny*)offset); |
|
578 |
|
579 iData->iWindowManager->PostIt(d); |
|
580 } |
|
581 } |
|
582 |
|
583 // --------------------------------------------------------------------------- |
|
584 // SetTransparencyAlphaChannel |
|
585 // --------------------------------------------------------------------------- |
|
586 // |
|
587 void CAlfWindow::SetTransparencyAlphaChannel(TBool aActive) |
|
588 { |
|
589 if ( WsInfo().iNodeType != MWsWindowTreeNode::EWinTreeNodeClient ) |
|
590 { |
|
591 return; |
|
592 } |
|
593 |
|
594 if (!IsInsertedToScene()) |
|
595 { |
|
596 iData->iTransparencyAlphaChannel = aActive; |
|
597 return; |
|
598 } |
|
599 |
|
600 TAlfWServInfo wservInfo = WsInfo(); |
|
601 |
|
602 TInt offset; |
|
603 TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset); |
|
604 if ( windowAttributes ) |
|
605 { |
|
606 windowAttributes->iActive = aActive; |
|
607 windowAttributes->iScreenNumber = wservInfo.iScreenNumber; |
|
608 |
|
609 TAlfBridgerData d; |
|
610 d.Set(EAlfDSSetTransparencyAlphaChannel, |
|
611 wservInfo.iRefId.iWindowGroupId, |
|
612 wservInfo.iRefId.iWindowIdentifer, |
|
613 (TAny*)offset); |
|
614 |
|
615 if (iData->iWindowManager->PostIt(d)) |
|
616 { |
|
617 iData->iTransparencyAlphaChannel = aActive; |
|
618 } |
|
619 } |
|
620 } |
|
621 |
|
622 // --------------------------------------------------------------------------- |
|
623 // TransparencyAlphaChannel |
|
624 // --------------------------------------------------------------------------- |
|
625 // |
|
626 TBool CAlfWindow::TransparencyAlphaChannel() const |
|
627 { |
|
628 return iData->iTransparencyAlphaChannel; |
|
629 } |
|
630 |
|
631 // --------------------------------------------------------------------------- |
|
632 // IsIncludedToVisibilityCalculation |
|
633 // --------------------------------------------------------------------------- |
|
634 // |
|
635 TBool CAlfWindow::IsIncludedToVisibilityCalculation() const |
|
636 { |
|
637 return iData->iIncludeToVisibilityCalculation; |
|
638 } |
|
639 |
|
640 // --------------------------------------------------------------------------- |
|
641 // IncludeToVisibilityCalculation |
|
642 // --------------------------------------------------------------------------- |
|
643 // |
|
644 void CAlfWindow::IncludeToVisibilityCalculation(TBool aActive) |
|
645 { |
|
646 if (!IsInsertedToScene()) |
|
647 { |
|
648 iData->iIncludeToVisibilityCalculation = aActive; |
|
649 return; |
|
650 } |
|
651 |
|
652 TAlfWServInfo wservInfo = WsInfo(); |
|
653 |
|
654 TInt offset; |
|
655 TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset); |
|
656 if ( windowAttributes ) |
|
657 { |
|
658 windowAttributes->iActive = aActive; |
|
659 windowAttributes->iScreenNumber = wservInfo.iScreenNumber; |
|
660 windowAttributes->iWindowNodeType = wservInfo.iNodeType; |
|
661 |
|
662 TAlfBridgerData d; |
|
663 d.Set(EAlfDSIncludeToVisibilityCalculation, |
|
664 wservInfo.iRefId.iWindowGroupId, |
|
665 wservInfo.iRefId.iWindowIdentifer, |
|
666 (TAny*)offset); |
|
667 |
|
668 if (iData->iWindowManager->PostIt(d)) |
|
669 { |
|
670 iData->iIncludeToVisibilityCalculation = aActive; |
|
671 } |
|
672 } |
|
673 } |
|
674 |
|
675 |
496 // --------------------------------------------------------------------------- |
676 // --------------------------------------------------------------------------- |
497 // SetWsInfo |
677 // SetWsInfo |
498 // --------------------------------------------------------------------------- |
678 // --------------------------------------------------------------------------- |
499 // |
679 // |
500 void CAlfWindow::SetWsInfo(const TAlfWServInfo& aInfo) |
680 void CAlfWindow::SetWsInfo(const TAlfWServInfo& aInfo) |
520 { |
700 { |
521 iData = new (ELeave) TAlfWindowData; |
701 iData = new (ELeave) TAlfWindowData; |
522 memset(iData, 0, sizeof(TAlfWindowData)); // initialize all values to zero |
702 memset(iData, 0, sizeof(TAlfWindowData)); // initialize all values to zero |
523 iData->iWindowManager = &aOwner; |
703 iData->iWindowManager = &aOwner; |
524 iData->iIdentifier = aId; |
704 iData->iIdentifier = aId; |
525 iData->iIsActive = ETrue; |
705 iData->iIsActive = EFalse; |
526 iData->iOpacity = 1.0f; |
706 iData->iOpacity = 1.0f; |
|
707 iData->iWindowArea = RRegion(); |
|
708 iData->iTransparencyAlphaChannel = EFalse; |
|
709 iData->iIncludeToVisibilityCalculation = EFalse; |
|
710 |
527 SetSize(aSizeInPixels); |
711 SetSize(aSizeInPixels); |
528 } |
712 } |
529 |
713 |
530 // --------------------------------------------------------------------------- |
714 // --------------------------------------------------------------------------- |
531 // CreateInBufferL |
715 // CreateInBufferL |