634 iFbs->SendCommand(EFbsMessShapeDelete,iHandle,PointerToOffset(aParam->iShapeHeader, iFbs->HeapBase())); |
638 iFbs->SendCommand(EFbsMessShapeDelete,iHandle,PointerToOffset(aParam->iShapeHeader, iFbs->HeapBase())); |
635 return KErrNone; |
639 return KErrNone; |
636 } |
640 } |
637 |
641 |
638 |
642 |
|
643 TInt CFbsFont::DoGetFontTable(TGetFontTableParam* aParam) const |
|
644 { |
|
645 TInt ret = KErrGeneral; |
|
646 |
|
647 TPckgBuf<TOffsetLen> retBuf; |
|
648 ret = iFbs->SendCommand(EFbsMessGetFontTable, |
|
649 TIpcArgs(iHandle, aParam->iTag, &retBuf)); |
|
650 |
|
651 if (KErrNone == ret) |
|
652 { |
|
653 aParam->iLength = retBuf().iLen; |
|
654 aParam->iContent = OffsetToPointer(retBuf().iOffset, iFbs->HeapBase()); |
|
655 } |
|
656 return ret; |
|
657 } |
|
658 |
|
659 |
|
660 TInt CFbsFont::DoGetGlyphOutline(TGetGlyphOutlineParam* aParam) const |
|
661 { |
|
662 TInt ret = KErrGeneral; |
|
663 |
|
664 TPckgBuf<TFBSGlyphOutlineParam> paramsBuf; |
|
665 TInt count = aParam->iCount; |
|
666 paramsBuf().iCount = aParam->iCount; |
|
667 paramsBuf().iHinted = aParam->iHinted; |
|
668 paramsBuf().iHandle = iHandle; |
|
669 |
|
670 TOffsetLen* offsetLen = (TOffsetLen *)User::Alloc(count * sizeof(TOffsetLen)); |
|
671 if (NULL == offsetLen) |
|
672 { |
|
673 return KErrNoMemory; |
|
674 } |
|
675 TPtr8 retBuf((TUint8 *)offsetLen, count * sizeof(TOffsetLen), |
|
676 count * sizeof(TOffsetLen)); |
|
677 TPtr8 codes((TUint8 *)(aParam->iCodes), count * sizeof(TUint), |
|
678 count * sizeof(TUint)); |
|
679 |
|
680 ret = iFbs->SendCommand( EFbsMessGetGlyphOutline, |
|
681 TIpcArgs(¶msBuf, &codes, &retBuf)); |
|
682 |
|
683 if (KErrNone == ret) |
|
684 { |
|
685 // server writes the offsets back to client, convert them |
|
686 // to local pointers. |
|
687 for (TInt i = 0; i < aParam->iCount; ++i) |
|
688 { |
|
689 aParam->iOutlines[i] = OffsetToPointer(offsetLen[i].iOffset, |
|
690 iFbs->HeapBase()); |
|
691 aParam->iLengths[i] = offsetLen[i].iLen; |
|
692 } |
|
693 } |
|
694 User::Free(offsetLen); |
|
695 return ret; |
|
696 } |
|
697 |
|
698 TInt CFbsFont::DoReleaseGlyphOutline(TReleaseGlyphOutlineParam* aParam) const |
|
699 { |
|
700 TInt ret = KErrGeneral; |
|
701 |
|
702 TPckgBuf<TFBSGlyphOutlineParam> params; |
|
703 TInt count = aParam->iCount; |
|
704 params().iCount = count; |
|
705 params().iHinted = aParam->iHinted; |
|
706 params().iHandle = iHandle; |
|
707 |
|
708 TPtr8 codes((unsigned char *)aParam->iCodes, count * sizeof(TUint), count * sizeof(TUint)); |
|
709 |
|
710 ret = iFbs->SendCommand(EFbsMessReleaseGlyphOutline, |
|
711 TIpcArgs(¶ms, &codes)); |
|
712 |
|
713 return ret; |
|
714 } |
|
715 |
|
716 TInt CFbsFont::DoReleaseFontTable(TUint32* aParam) const |
|
717 { |
|
718 TInt ret = KErrGeneral; |
|
719 |
|
720 ret = iFbs->SendCommand(EFbsMessReleaseFontTable, |
|
721 TIpcArgs(iHandle, *aParam)); |
|
722 |
|
723 return ret; |
|
724 } |
639 /** API extension system that enables the caller to access a particular API |
725 /** API extension system that enables the caller to access a particular API |
640 extension function. As an overload of this function in a derived class |
726 extension function. As an overload of this function in a derived class |
641 it calls its immediate parent implementation for any extension function Uid |
727 it calls its immediate parent implementation for any extension function Uid |
642 that it does not recognize and handle. |
728 that it does not recognize and handle. |
643 @param aInterfaceId UID of the required extension function |
729 @param aInterfaceId UID of the required extension function |
644 @param aParam Pointer to an arbitrary parameter block that can be used to |
730 @param aParam Pointer to an arbitrary parameter block that can be used to |
645 provide and/or return information to/from the particular extension function, |
731 provide and/or return information to/from the particular extension function, |
646 defaults to NULL. |
732 defaults to NULL. |
647 @return Integer return value from extension function, a system wide error code. |
733 @return Integer return value from extension function, a system wide error code. |
|
734 @panic FBSCLI 31, in debug builds only, if iExtra is NULL when it must not be. |
|
735 @panic FBSCLI 38, in debug builds only, if a reserved error code is returned |
|
736 from an extended function. |
648 @internalTechnology |
737 @internalTechnology |
649 @released |
738 @released |
650 */ |
739 */ |
651 EXPORT_C TInt CFbsFont::DoExtendedFunction(TUid aFunctionId, TAny* aParam) const |
740 EXPORT_C TInt CFbsFont::DoExtendedFunction(TUid aFunctionId, TAny* aParam) const |
652 { |
741 { |
672 else if (aFunctionId == KTextInContextWidthInPixelsUid) |
761 else if (aFunctionId == KTextInContextWidthInPixelsUid) |
673 { |
762 { |
674 TTextWidthInternal* contextParam = (TTextWidthInternal*)aParam; |
763 TTextWidthInternal* contextParam = (TTextWidthInternal*)aParam; |
675 return DoTextWidthInPixels(contextParam->iText,&contextParam->iParam); |
764 return DoTextWidthInPixels(contextParam->iText,&contextParam->iParam); |
676 } |
765 } |
|
766 else if (aFunctionId == KFontGetFontTable) |
|
767 { |
|
768 return DoGetFontTable(reinterpret_cast<TGetFontTableParam *>(aParam)); |
|
769 } |
|
770 else if (aFunctionId == KFontGetGlyphOutline) |
|
771 { |
|
772 return DoGetGlyphOutline(reinterpret_cast<TGetGlyphOutlineParam *>(aParam)); |
|
773 } |
|
774 else if (aFunctionId == KFontReleaseGlyphOutline) |
|
775 { |
|
776 return DoReleaseGlyphOutline(reinterpret_cast<TReleaseGlyphOutlineParam *>(aParam)); |
|
777 } |
|
778 else if (aFunctionId == KFontReleaseFontTable) |
|
779 { |
|
780 return DoReleaseFontTable(reinterpret_cast<TUint32 *>(aParam)); |
|
781 } |
677 } |
782 } |
678 return CFont::DoExtendedFunction(aFunctionId, aParam); |
783 return CFont::DoExtendedFunction(aFunctionId, aParam); |
679 } |
784 } |
680 |
785 |