<Color B052L4D="#4CC7C7C7"/>\r
<Color B052L5="#FF70A9EE"/>\r
<Color B052L6="#FFBABABA"/>\r
- <Color B052L6P="#1970A9EE"/>\r
+ <Color B052L6P="#FF70A9EE"/>\r
<Color B052L7="#FF4093F7"/>\r
<Color B052L8="#FFFFFFFF"/>\r
<Color B052L8P="#FF4093F7"/>\r
#include <bundle.h>
#include <appsvc/appsvc.h>
+#include <unique_ptr.h>
#include <FBaseSysLog.h>
#include <FBaseColArrayList.h>
#include <FUi_WindowImpl.h>
#include <FUi_EcoreEvasMgr.h>
#include <FUi_EcoreEvas.h>
+#include <FUi_UiNotificationEvent.h>
+#include <FUi_UiEventManager.h>
#include <FUiCtrl_FrameImpl.h>
#include <FSys_PowerManagerImpl.h>
#include "FApp_UiAppImpl.h"
#include "FApp_AppArg.h"
+using namespace std;
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
{
// N_SE-24616, N_SE-24383 for OnForground() and visibility issue
OnResume();
- pEvas->ActivateWindow(pFrameImpl->GetCore());
+
+ //pEvas->ActivateWindow(pFrameImpl->GetCore());
+
+ unique_ptr<ArrayList> pEventArgs(new (std::nothrow) ArrayList());
+ SysTryReturnVoidResult(NID_APP, pEventArgs, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+ pEventArgs->Construct();
+
+ unique_ptr<String> pString(new (std::nothrow) Tizen::Base::String(L"ActivateFrame"));
+ SysTryReturnVoidResult(NID_APP, pString, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+ pEventArgs->Add(*(pString.get()));
+
+ _UiNotificationEvent event(pFrameImpl->GetCore().GetHandle(), pEventArgs.get());
+
+ result r = _UiEventManager::GetInstance()->PostEvent(event);
+ SysTryReturnVoidResult(NID_APP, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ pString.release();
+ pEventArgs.release();
}
}
}
}
result
-_Canvas::DrawBitmap(const Point& point, const _Bitmap& bitmap, const Point& pivot, double degree)
+_Canvas::DrawBitmap(const _Util::Point<double>& point, const _Bitmap& bitmap, const _Util::Point<double>& pivot, double degree)
{
SysTryReturnResult(NID_GRP, &bitmap && bitmap.IsValid(), E_INVALID_ARG, "The source bitmap is invalid.\n");
_ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
// angle, xOffset, yOffset
- Tizen::Graphics::_Effect::RotateDesc rotateDesc = { int(degree), pivot.x, pivot.y };
- bool pass = Tizen::Graphics::_Effect::RotateImage(dstImage, point.x - clipRect.x, point.y - clipRect.y, srcImage, rotateDesc, alphaConstant);
+ Tizen::Graphics::_Effect::RotateDesc rotateDesc = { int(degree), int(pivot.x), int(pivot.y) };
+ bool pass = Tizen::Graphics::_Effect::RotateImage(dstImage, int(point.x) - clipRect.x, int(point.y) - clipRect.y, srcImage, rotateDesc, alphaConstant);
SysTryReturnResult(NID_GRP, pass, E_INVALID_ARG, "The source bitmap is invalid.\n");
result DrawBitmap(const Rectangle& destRect, const _Bitmap& srcBitmap, const Rectangle& srcRect);
result DrawBitmapForNinePatchedBitmap(const Rectangle& destRect, const _Bitmap& srcBitmap, const Rectangle& srcRect);
result DrawBitmap(const Point& point, const _Bitmap& bitmap, FlipDirection dir);
- result DrawBitmap(const Point& point, const _Bitmap& bitmap, const Point& pivot, double degree);
+ result DrawBitmap(const _Util::Point<double>& point, const _Bitmap& bitmap, const _Util::Point<double>& pivot, double degree);
result DrawNinePatchedBitmap(const Rectangle& rect, const _Bitmap& bitmap);
result DrawNineTiledBitmap(const Rectangle& rect, const _Bitmap& bitmap);
{
SysTryReturnResult(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, "This instance is not constructed yet.");
- SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid.");
-
- EXTRACT_BITMAPEX(pBitmapEx, bitmap);
-
- if (_ResUtil::NeedToConvertCoord())
- {
- Tizen::Graphics::Dimension virSize;
- Tizen::Graphics::Dimension phySize;
- bool lazyScaling = Tizen::Graphics::_IsLazyScalingBitmap(bitmap, virSize, phySize);
-
- Point pcPoint = _ResUtil::ConvertToPhyCoord(vcPoint);
- Point pcPivot = _ResUtil::ConvertToPhyCoord(vcPivot);
-
- if (lazyScaling)
- {
- EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap);
-
- return this->_pNativeCanvas->DrawBitmap(pcPoint, *pScaledBitmapEx, pcPivot, double(degree));
- }
- else
- {
- return this->_pNativeCanvas->DrawBitmap(pcPoint, *pBitmapEx, pcPivot, double(degree));
- }
- }
- else
- {
- return this->_pNativeCanvas->DrawBitmap(vcPoint, *pBitmapEx, vcPivot, double(degree));
- }
+ return this->DrawBitmap(FloatPoint(float(vcPoint.x), float(vcPoint.y)), bitmap, FloatPoint(float(vcPivot.x), float(vcPivot.y)), float(degree));
}
result
FloatPoint pcPointF = _ResUtil::ConvertToPhyCoord(vcPointF);
FloatPoint pcPivotF = _ResUtil::ConvertToPhyCoord(vcPivotF);
- Point pcPoint(_FloatToIntForPos(pcPointF.x), _FloatToIntForPos(pcPointF.y));
- Point pcPivot(_FloatToIntForPos(pcPivotF.x), _FloatToIntForPos(pcPivotF.y));
+ _Util::Point<double> pcPointD = _Util::Convert<FloatPoint, _Util::Point<double> >(pcPointF);
+ _Util::Point<double> pcPivotD = _Util::Convert<FloatPoint, _Util::Point<double> >(pcPivotF);
if (lazyScaling)
{
EXTRACT_SCALED_BITMAPEX(pScaledBitmapEx, bitmap);
- return this->_pNativeCanvas->DrawBitmap(pcPoint, *pScaledBitmapEx, pcPivot, double(degree));
+ return this->_pNativeCanvas->DrawBitmap(pcPointD, *pScaledBitmapEx, pcPivotD, double(degree));
}
else
{
- return this->_pNativeCanvas->DrawBitmap(pcPoint, *pBitmapEx, pcPivot, double(degree));
+ return this->_pNativeCanvas->DrawBitmap(pcPointD, *pBitmapEx, pcPivotD, double(degree));
}
}
else
{
- Point vcPoint(_FloatToIntForPos(vcPointF.x), _FloatToIntForPos(vcPointF.y));
- Point vcPivot(_FloatToIntForPos(vcPivotF.x), _FloatToIntForPos(vcPivotF.y));
-
- return this->_pNativeCanvas->DrawBitmap(vcPoint, *pBitmapEx, vcPivot, double(degree));
+ return this->_pNativeCanvas->DrawBitmap(_Util::Convert<FloatPoint, _Util::Point<double> >(vcPointF), *pBitmapEx, _Util::Convert<FloatPoint, _Util::Point<double> >(vcPivotF), double(degree));
}
}
return transform;
}
+pixman_transform_t GetTransform(double xDest, double yDest, double degree, double xPivot, double yPivot)
+{
+ pixman_transform_t transform;
+
+ double c = cos(degree * 3.141592 / 180.0);
+ double s = sin(degree * 3.141592 / 180.0);
+
+ pixman_transform_init_identity(&transform);
+
+ pixman_transform_translate(&transform, NULL, pixman_double_to_fixed(-xDest), pixman_double_to_fixed(-yDest));
+ pixman_transform_rotate(&transform, NULL, pixman_double_to_fixed(c), pixman_double_to_fixed(s));
+ pixman_transform_translate(&transform, NULL, pixman_double_to_fixed(xPivot), pixman_double_to_fixed(yPivot));
+
+ return transform;
+}
+
pixman_transform_t GetTransform(int srcWidth, int srcHeight, int dstWidth, int dstHeight)
{
pixman_transform_t transform;
return CompositePixmap(dstImage, srcImage, rop, filter, transform, PIXMAN_REPEAT_NORMAL);
}
-bool RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, int xDest, int yDest, double degree, int xPivot, int yPivot)
+bool RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, double xDest, double yDest, double degree, double xPivot, double yPivot)
{
if (dstImage.width <= 0 || dstImage.height <= 0)
{
ResizePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapScalingQuality scalingQuality);
bool
-RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, int xDest, int yDest, double degree, int xPivot, int yPivot);
+RotatePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, double xDest, double yDest, double degree, double xPivot, double yPivot);
bool
FlipPixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, Tizen::Graphics::BitmapDrawingQuality drawingQuality, Tizen::Graphics::CompositeMode compositeMode, int xDest, int yDest);
_IFont::Glyph* pGlyph;
pEnum->GetCurrent(pGlyph);
- pBaseFont->UnloadGlyph(&pGlyph);
+ delete[] (char*) pGlyph;
+
+ // bidi cache underdevelop
+ //pBaseFont->UnloadGlyph(&pGlyph);
}
delete pEnum;
typedef _Util::Pair<int, int> Gap;
typedef _Util::AccumList<Gap> GapList;
- GapList::Iterator srcBegin = tempList.Begin();
+ GapList::Iterator dstBegin = outList.Begin();
int index = 0;
if (bidiProperty.length == int(tempList.Size()))
{
- for (GapList::Iterator dst = outList.Begin(); dst != outList.End(); ++dst)
+ for (GapList::ConstIterator src = tempList.Begin(); src != tempList.End(); ++src)
{
- *dst = *(srcBegin + bidiProperty.pBidiIndex[index++]);
+ *(dstBegin + bidiProperty.pBidiIndex[index++]) = *src;
}
}
else if (bidiProperty.length > int(tempList.Size()))
else // if (bidiProperty.length < tempList.Size())
{
// under development
- for (GapList::Iterator dst = outList.Begin(); dst != outList.End() && index < bidiProperty.length; ++dst)
+ for (GapList::ConstIterator src = tempList.Begin(); src != tempList.End() && index < bidiProperty.length; ++src)
{
- *dst = *(srcBegin + bidiProperty.pBidiIndex[index++]);
+ *(dstBegin + bidiProperty.pBidiIndex[index++]) = *src;
}
}
}
_IFont::Glyph* pGlyph;
pEnum->GetCurrent(pGlyph);
- pBaseFont->UnloadGlyph(&pGlyph);
+ delete[] (char*) pGlyph;
+
+ // bidi cache underdevelop
+ //pBaseFont->UnloadGlyph(&pGlyph);
}
delete pEnum;
}
else
{
+ bidiProperty->direction = (bidiProperty->pCharTypes[0] == FRIBIDI_TYPE_EN) ? FRIBIDI_PAR_ON : bidiProperty->direction;
CHECK_IF(fribidi_get_par_embedding_levels(bidiProperty->pCharTypes, len, &bidiProperty->direction, bidiProperty->pEmbeddingLevels));
}
typedef _Util::Pair<int, int> Gap;
typedef _Util::AccumList<Gap> GapList;
- GapList::ConstIterator srcBegin = inputList.Begin();
+ GapList::Iterator dstBegin = outList.Begin();
int index = 0;
- for (GapList::Iterator dst = outList.Begin(); dst != outList.End(); ++dst)
+ for (GapList::ConstIterator src = inputList.Begin(); src != inputList.End(); ++src)
{
// for safty
if (index >= length)
coIx &= 0x00FFFFFF;
- *dst = *(srcBegin + coIx);
+ *(dstBegin + coIx) = *src;
}
delete[] pCoIndex;
FT_UInt glyph_index = auxInfo.glyphIndex;
- _IFont::Glyph *pFontGlyphData;
-
- bool rtn = FindCache(glyph_index, __fontAttrib.size, __fontAttrib.style, &pFontGlyphData);
-
- if (rtn)
- {
- out.Add(pFontGlyphData);
- continue;
- }
+ // bidi cache underdevelop
+ //_IFont::Glyph *pFontGlyphData;
+ //
+ //bool rtn = FindCache(glyph_index, __fontAttrib.size, __fontAttrib.style, &pFontGlyphData);
+ //
+ //if (rtn)
+ //{
+ // out.Add(pFontGlyphData);
+ // continue;
+ //}
if (isSynthetic)
{
image.bytesPerLine = pSlot->bitmap.pitch;
image.pBitmap = pSlot->bitmap.buffer;
- pFontGlyphData = (_IFont::Glyph*) new (std::nothrow) char[sizeof(_IFont::Glyph) + (image.bytesPerLine * image.height)];
+ _IFont::Glyph *pFontGlyphData = (_IFont::Glyph*) new (std::nothrow) char[sizeof(_IFont::Glyph) + (image.bytesPerLine * image.height)];
if (pFontGlyphData == null)
{
out.Add(pFontGlyphData);
- AddCache(glyph_index, __fontAttrib.size, __fontAttrib.style, pFontGlyphData);
-
- if (pFontGlyphData != null)
- {
- pFontGlyphData->hasOwnerShip = 1;
- }
+ // bidi cache underdevelop
+ //AddCache(glyph_index, __fontAttrib.size, __fontAttrib.style, pFontGlyphData);
+ //
+ //if (pFontGlyphData != null)
+ //{
+ // pFontGlyphData->hasOwnerShip = 1;
+ //}
}
return true;
virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const;
- virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const;
-
- virtual result GetBlockRegion(int textIndex, int textLength, float& width, float& height) const;
-
virtual int GetHeight(void) const;
virtual float GetHeightF(void) const;
virtual int GetBaseline(void) const;
+ virtual float GetBaselineF(void) const;
+
virtual void SetForegroundColor(const Color& color);
virtual Color GetForegroundColor(void) const;
: public TextElement
{
public:
- TextImage(Bitmap& bitmap, TextElementSourceType sourceType = TEXT_ELEMENT_SOURCE_TYPE_INTERNAL, Rectangle* pRect = null,
+ TextImage(Bitmap& bitmap, TextElementSourceType sourceType = TEXT_ELEMENT_SOURCE_TYPE_INTERNAL,
TextObjectAlignment align = TextObjectAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP));
-
+
virtual ~TextImage(void);
public:
- virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
- int& actualLength, int& width, int& height);
-
virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
int& actualLength, float& width, float& height);
- virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment align, const TextObjectActionType action);
-
virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment align, const TextObjectActionType action);
virtual TextElement* CopyN(int textStart, int textLength);
- virtual result GetRegion(int textIndex, int startTextIndex, int& width, int& height) const;
-
virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const;
- virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const;
-
- virtual result GetBlockRegion(int textIndex, int textLength, float& width, float& height) const;
-
virtual int GetHeight(void) const;
virtual float GetHeightF(void) const;
virtual int GetBaseline(void) const;
+ virtual float GetBaselineF(void) const;
+
result SetBounds(const Rectangle& rect);
result SetBounds(const FloatRectangle& rect);
private:
Bitmap* __pBitmap;
- Rectangle __rect;
+ FloatRectangle __rect;
TextObjectAlignment __align;
private:
TextElement* GetElementAtTextIndex(int textIndex) const;
- int GetTextIndexFromPosition(int lcX, int lcY, bool cursorMode = true) const;
+ int GetTextIndexFromPosition(int x, int y, bool cursorMode = true) const;
- int GetTextIndexFromPosition(float lcX, float lcY, bool cursorMode = true) const;
+ int GetTextIndexFromPosition(float x, float y, bool cursorMode = true) const;
- int GetTextIndexFromPositionAtLine(int lineIndex, int lcX, bool cursorMode = true) const;
+ int GetTextIndexFromPositionAtLine(int lineIndex, int x, bool cursorMode = true) const;
- int GetTextIndexFromPositionAtLine(int lineIndex, float lcX, bool cursorMode = true) const;
+ int GetTextIndexFromPositionAtLine(int lineIndex, float x, bool cursorMode = true) const;
result ChangeTextOffset(wchar_t* pText, int textIndex, int gap);
int GetDisplayLineCount(void) const;
- int GetLineIndexAtPositionY(int lcY) const;
+ int GetLineIndexAtPositionY(int y) const;
- int GetLineIndexAtPositionY(float lcY) const;
+ int GetLineIndexAtPositionY(float y) const;
int GetFirstTextIndexAt(int lineIndex) const;
TextObjectAlignment GetElementVerticalAlignment(void) const;
- result SetBounds(const Rectangle& lcRect);
+ result SetBounds(const Rectangle& rect);
- result SetBounds(const FloatRectangle& lcRect);
+ result SetBounds(const FloatRectangle& rect);
Rectangle GetBounds(void) const;
FloatRectangle GetBoundsF(void) const;
- result SetLineSpace(int lcLineSpacing);
+ result SetLineSpace(int lineSpacing);
- result SetLineSpace(float lcLineSpacing);
+ result SetLineSpace(float lineSpacing);
int GetLineSpace(void) const;
void GetBlockRange(int& startTextIndex, int& textLength);
- result SetSlidingStep(int lcSlidingStep);
+ result SetSlidingStep(int slidingStep);
int GetSlidingStep(void) const;
int GetFirstDisplayLineIndex(void) const;
- result SetFirstDisplayPositionY(int lcY);
+ result SetFirstDisplayPositionY(int y);
- result SetFirstDisplayPositionY(float lcY);
+ result SetFirstDisplayPositionY(float y);
int GetFirstDisplayPositionY(void) const;
int GetTotalCutLinkElementCount(void) const;
- int GetCutLinkIndexFromPositionData(int lcX, int lcY) const;
+ int GetCutLinkIndexFromPositionData(int x, int y) const;
- int GetCutLinkIndexFromPositionData(float lcX, float lcY) const;
+ int GetCutLinkIndexFromPositionData(float x, float y) const;
TextElement* GetCutLinkElementAtCutLinkElementIndex(int linkIndex) const;
result GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float& height, float& absX, float& absY,
float& logicalX, float& logicalY) const;
- int GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode = true) const;
+ int GetTextIndexFromPositionInWrap(int x, int y, bool cursorMode = true) const;
- int GetTextIndexFromPositionInWrap(float pcX, float pcY, bool cursorMode = true) const;
+ int GetTextIndexFromPositionInWrap(float x, float y, bool cursorMode = true) const;
- int GetTextIndexFromPositionInNoneWrap(int pcX, int pcY, bool cursorMode = true) const;
+ int GetTextIndexFromPositionInNoneWrap(int x, int y, bool cursorMode = true) const;
- int GetTextIndexFromPositionInNoneWrap(float pcX, float pcY, bool cursorMode = true) const;
+ int GetTextIndexFromPositionInNoneWrap(float x, float y, bool cursorMode = true) const;
result UpdateChangedInfo(int startTextIndex, int textLength = -1, bool initTextWidthManager = true);
// Attribute
private:
- Rectangle __rect;
- Rectangle __pcRect;
+ FloatRectangle __rect;
TextObjectActionType __action;
TextObjectAlignment __align;
TextObjectWrapType __wrap;
virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const;
- virtual result GetBlockRegion(int textIndex, int textLength, int& width, int& height) const;
-
- virtual result GetBlockRegion(int textIndex, int textLength, float& width, float& height) const;
-
virtual int GetHeight(void) const;
virtual float GetHeightF(void) const;
virtual int GetBaseline(void) const;
+ virtual float GetBaselineF(void) const;
+
int GetTextOffset(void) const;
result SetFont(const Font* pFont);
}
result
-TextColumn::GetRegion(int textIndex, int textLength, int& width, int& height) const
+TextColumn::GetRegion(int textIndex, int textLength, float& width, float& height) const
{
result r = E_SUCCESS;
return __pCompositeText->GetRegion(textIndex, textLength, width, height);
}
- Rectangle lineBounds;
+ FloatRectangle lineBounds;
SimpleNode* pTextLineNode = null;
TextLine* pTextLine = null;
while (pTextLineNode)
{
pTextLine = static_cast < TextLine* >(pTextLineNode->pObject);
- SysTryReturn(NID_GRP
- , pTextLine
- , r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
- width = Math::Max(width, lineBounds.width);
+ width = (width > lineBounds.width) ? width : lineBounds.width;
height += lineBounds.height;
pTextLineNode = pTextLineNode->pNext;
return r;
}
-result
-TextColumn::GetRegion(int textIndex, int textLength, float& width, float& height) const
-{
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
-
- result r = GetRegion(textIndex, textLength, newWidth, newHeight);
-
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newWidth);
-
- return r;
-}
-
-int
-TextColumn::GetHeight(int textIndex) const
+float
+TextColumn::GetHeightF(int textIndex) const
{
if (textIndex < 0)
{
- return GetTotalHeight();
+ return GetTotalHeightF();
}
- return __pCompositeText->GetHeight(textIndex);
-}
-
-float
-TextColumn::GetHeightF(int textIndex) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetHeight(textIndex));
+ return __pCompositeText->GetHeightF(textIndex);
}
result
-TextColumn::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength,
+TextColumn::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment alignment, const TextObjectActionType action)
{
result r = E_SUCCESS;
TextLine* pTextLine = null;
SimpleNode* pTextLineNode = null;
TextObjectActionType lineAction = TEXT_OBJECT_ACTION_TYPE_NONE;
- Rectangle lineBounds;
+ FloatRectangle lineBounds;
__displayLineCount = 0;
__displayHeight = 0;
return E_SUCCESS;
}
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
if (__firstDisplayPositionY != lineBounds.y)
{
}
else
{
- Rectangle nextLineBounds;
+ FloatRectangle nextLineBounds;
if (__pLines->nodeCount < pNextTextLine->GetIndex())
{
return E_SUCCESS;
}
- nextLineBounds = pNextTextLine->GetBounds();
+ nextLineBounds = pNextTextLine->GetBoundsF();
if (displayRect.height < (lineBounds.height + nextLineBounds.height))
{
lineAction = TEXT_OBJECT_ACTION_TYPE_ABBREV;
return E_SUCCESS;
}
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
}
return E_SUCCESS;
}
result
-TextColumn::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment alignment, const TextObjectActionType action)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return Draw(canvasImpl, newDisplayRect, startTextIndex, textLength, alignment, action);
-}
-
-result
-TextColumn::CalculateDisplayableLineCount(Rectangle& displayRect, const TextObjectActionType action)
+TextColumn::CalculateDisplayableLineCount(FloatRectangle& displayRect, const TextObjectActionType action)
{
int displayLineCount = 0;
return -1;
}
- Rectangle lineBounds = pTextLine->GetBounds();
+ FloatRectangle lineBounds = pTextLine->GetBoundsF();
if (__firstDisplayPositionY != lineBounds.y)
{
}
else
{
- Rectangle nextLineBounds;
+ FloatRectangle nextLineBounds;
if (__pLines->nodeCount < pNextTextLine->GetIndex())
{
return -1;
}
- nextLineBounds = pNextTextLine->GetBounds();
+ nextLineBounds = pNextTextLine->GetBoundsF();
if (displayRect.height < (lineBounds.height + nextLineBounds.height))
{
displayLineCount++;
return -1;
}
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
}
return displayLineCount;
}
-result
-TextColumn::CalculateDisplayableLineCount(FloatRectangle& displayRect, const TextObjectActionType action)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return CalculateDisplayableLineCount(newDisplayRect, action);
-}
-
int
TextColumn::GetTextLength(void) const
{
TextLine* pTextLine = null;
int lineIndex = 0;
- Rectangle lineBounds;
+ FloatRectangle lineBounds;
if (GetTotalLineCount() == 0)
{
pTextLine = static_cast < TextLine* >(pTextLineNode->pObject);
SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
if (y >= lineBounds.y && y < lineBounds.y + lineBounds.height)
{
pTextLine = static_cast < TextLine* >(pTextLineNode->pObject);
SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
if (y >= lineBounds.y && y < lineBounds.y + lineBounds.height)
{
int
TextColumn::GetTotalHeight(void) const
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetTotalHeightF());
+}
+
+float
+TextColumn::GetTotalHeightF(void) const
+{
SimpleNode* pTextLineNode = null;
TextLine* pTextLine = null;
- Rectangle lineBounds;
- int height = 0;
+ FloatRectangle lineBounds;
+ float height = 0;
pTextLineNode = TextSimpleList::GetFirstNode(__pLines);
while (pTextLineNode)
{
pTextLine = static_cast < TextLine* >(pTextLineNode->pObject);
- SysTryReturn(NID_GRP
- , pTextLine
- , 0, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, 0, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
height += lineBounds.height;
pTextLineNode = pTextLineNode->pNext;
return height;
}
-float
-TextColumn::GetTotalHeightF(void) const
+int
+TextColumn::GetLineHeightAt(int index) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetTotalHeight());
+ return _CoordinateSystemUtils::ConvertToInteger(GetLineHeightAtF(index));
}
-int
-TextColumn::GetLineHeightAt(int index) const
+float
+TextColumn::GetLineHeightAtF(int index) const
{
TextLine* pTextLine = null;
pTextLine = static_cast < TextLine* >(TextSimpleList::GetNthObject(__pLines, index));
- SysTryReturn(NID_GRP
- , pTextLine
- , 0, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, 0, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- Rectangle lineRect;
- lineRect = pTextLine->GetBounds();
+ FloatRectangle lineRect;
+ lineRect = pTextLine->GetBoundsF();
return lineRect.height;
}
-float
-TextColumn::GetLineHeightAtF(int index) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetLineHeightAt(index));
-}
-
int
TextColumn::GetTextLengthAt(int lineIndex) const
{
TextLine* pTextLine = null;
pTextLine = static_cast < TextLine* >(TextSimpleList::GetNthObject(__pLines, lineIndex));
- SysTryReturn(NID_GRP
- , pTextLine
- , 0, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, 0, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
return pTextLine->GetTextLength();
}
TextLine* pTextLine = null;
pTextLine = static_cast < TextLine* >(TextSimpleList::GetNthObject(__pLines, lineIndex));
- SysTryReturn(NID_GRP
- , pTextLine
- , 0, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, 0, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
return pTextLine->GetTextOffset();
}
result
TextColumn::Append(TextLine* pTextLine)
{
- SysTryReturn(NID_GRP
- , pTextLine
- , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ SysTryReturn(NID_GRP, pTextLine, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
TextSimpleList::AppendObject(__pLines, pTextLine);
__totalLineCount++;
SimpleNode* pTextLineNode = null;
TextLine* pTextLine = null;
- Rectangle lineBounds;
+ FloatRectangle lineBounds;
if (__currentLineIndexToAddDuringCompose == 0)
{
}
pTextLineNode = TextSimpleList::GetNthNode(__pLines, __currentLineIndexToAddDuringCompose - 1);
- SysTryReturn(NID_GRP
- , pTextLineNode
- , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line node.");
+ SysTryReturn(NID_GRP, pTextLineNode, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line node.");
pTextLine = static_cast < TextLine* >(pTextLineNode->pObject);
- SysTryReturn(NID_GRP
- , pTextLine
- , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
- int nextLineY = lineBounds.y + lineBounds.height;
+ lineBounds = pTextLine->GetBoundsF();
+ float nextLineY = lineBounds.y + lineBounds.height;
pTextLineNode = TextSimpleList::GetNthNode(__pLines, __currentLineIndexToAddDuringCompose);
while (pTextLineNode != null)
{
pTextLine = static_cast < TextLine* >(pTextLineNode->pObject);
- SysTryReturn(NID_GRP
- , pTextLine
- , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
int lineOffset = pTextLine->GetTextOffset();
lineOffset += changedTextLength;
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
lineBounds.y = nextLineY;
nextLineY += lineBounds.height;
TextLine*
TextColumn::GetPrevLineChangedStartLine(void) const
{
- SysTryReturn(NID_GRP
- , __setChangeAction
- , null, E_INVALID_STATE, "[E_INVALID_STATE] This instance is set change action list yet.");
+ SysTryReturn(NID_GRP, __setChangeAction, null, E_INVALID_STATE
+ , "[E_INVALID_STATE] This instance is set change action list yet.");
if (__prevLineIndexBeforeChangedStartLine < 0)
{
}
TextLine* pTextLine = GetTextLine(__prevLineIndexBeforeChangedStartLine);
- SysTryReturn(NID_GRP
- , pTextLine
- , null, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, null, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
SetLastResult(E_SUCCESS);
result
TextColumn::RemoveLinesFrom(int lineIndex)
{
- SysTryReturn(NID_GRP
- , 0 <= lineIndex
- , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ SysTryReturn(NID_GRP, 0 <= lineIndex, E_INVALID_ARG, E_INVALID_ARG
+ , "[E_INVALID_ARG] The argument is invalid.");
TextLine* pTextLine = null;
int count = 0;
void
TextColumn::SetFirstDisplayPositionY(int y)
{
- __firstDisplayPositionY = y;
+ __firstDisplayPositionY = _CoordinateSystemUtils::ConvertToFloat(y);
}
void
TextColumn::SetFirstDisplayPositionY(float y)
{
- __firstDisplayPositionY = _CoordinateSystemUtils::ConvertToInteger(y);
+ __firstDisplayPositionY = y;
}
int
TextColumn::GetFirstDisplayPositionY(void) const
{
- return __firstDisplayPositionY;
+ return _CoordinateSystemUtils::ConvertToInteger(__firstDisplayPositionY);
}
float
TextColumn::GetFirstDisplayPositionYF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(__firstDisplayPositionY);
+ return __firstDisplayPositionY;
}
void
TextColumn::SetDisplayHeight(int height)
{
- __displayHeight = height;
+ __displayHeight = _CoordinateSystemUtils::ConvertToFloat(height);
}
void
TextColumn::SetDisplayHeight(float height)
{
- __displayHeight = _CoordinateSystemUtils::ConvertToInteger(height);
+ __displayHeight = height;
}
int
TextColumn::GetDisplayHeight(void) const
{
- return __displayHeight;
+ return _CoordinateSystemUtils::ConvertToInteger(__displayHeight);
}
float
TextColumn::GetDisplayHeightF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(__displayHeight);
+ return __displayHeight;
}
SimpleNode*
result
TextColumn::SetSlidingDimension(Dimension& slidingDimension)
{
- SysTryReturn(NID_GRP
- , slidingDimension.width >= 0 && slidingDimension.height >=0
+ SysTryReturn(NID_GRP, slidingDimension.width >= 0 && slidingDimension.height >=0
, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
__slidingDimension = slidingDimension;
}
int
-TextColumn::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
- int& actualLength, int& width, int& height)
-{
- return -1;
-}
-
-int
TextColumn::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
int& actualLength, float& width, float& height)
{
TextLine* pOldTextLine = null;
TextLine* pNewTextLine = null;
- Dimension newLineSize;
- Dimension oldLineSize;
+ FloatDimension newLineSize;
+ FloatDimension oldLineSize;
int sweepResult = 0;
- int sweepIn = 0;
- int sweepOut = 0;
- int prevLineSweepIn = 0;
- int prevLineSweepOut = 0;
+ float sweepIn = 0;
+ float sweepOut = 0;
+ float prevLineSweepIn = 0;
+ float prevLineSweepOut = 0;
int changedStartLineIndex = 0;
- int keyInputWidth = 0;
+ float keyInputWidth = 0;
if (TextSimpleList::GetCount(__pKeepLines) == 0)
{
keyInputWidth = __pCompositeText->GetWorkWidth();
pOldTextLineNode = TextSimpleList::GetFirstNode(__pKeepLines);
- SysTryReturn(NID_GRP
- , pOldTextLineNode
- , E_SYSTEM, E_SYSTEM
- , "[E_SYSTEM] Fail to get text line node.");
+ SysTryReturn(NID_GRP, pOldTextLineNode, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line node.");
pOldTextLine = static_cast < TextLine* >(pOldTextLineNode->pObject);
changedStartLineIndex = pOldTextLine->GetIndex();
pNewTextLineNode = TextSimpleList::GetNthNode(__pLines, changedStartLineIndex);
- SysTryReturn(NID_GRP
- , pNewTextLineNode
- , E_INVALID_STATE, E_INVALID_STATE
- , "[E_INVALID_STATE] This instance is not constructed yet. changedStartLineIndex = %d", changedStartLineIndex);
+ SysTryReturn(NID_GRP, pNewTextLineNode, E_INVALID_STATE, E_INVALID_STATE
+ , "[E_INVALID_STATE] This instance is not constructed yet. changedStartLineIndex = %d", changedStartLineIndex);
r = SetKeyInputLine(changedStartLineIndex, TextSimpleList::GetCount(__pLines) - changedStartLineIndex);
- SysTryReturn(NID_GRP
- , r == E_SUCCESS
- , r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
pOldTextLine = static_cast < TextLine* >(pOldTextLineNode->pObject);
pNewTextLine = static_cast < TextLine* >(pNewTextLineNode->pObject);
virtual ~TextColumn(void);
public:
- virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex,
- int textLength, const TextObjectAlignment alignment, const TextObjectActionType action);
-
virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex,
int textLength, const TextObjectAlignment alignment, const TextObjectActionType action);
- virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const;
-
virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const;
- virtual int GetHeight(int textIndex) const;
-
virtual float GetHeightF(int textIndex) const;
virtual int GetTextLength(void) const;
- virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
- int& actualLength, int& width, int& height);
-
virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
int& actualLength, float& width, float& height);
result CompareDeletedLine(void);
- result CalculateDisplayableLineCount(Rectangle& displayRect, const TextObjectActionType action);
-
result CalculateDisplayableLineCount(FloatRectangle& displayRect, const TextObjectActionType action);
private:
SimpleList* __pTextChangeActionList;
int __totalLineCount;
int __firstDisplayLineIndex;
- int __firstDisplayPositionY;
+ float __firstDisplayPositionY;
int __displayLineCount;
- int __displayHeight;
+ float __displayHeight;
Tizen::Graphics::Dimension __slidingDimension;
int __slidingPosition;
bool __setChangeAction;
bool __isComposeDone;
SimpleNode* __pCachedLineNode;
int __cachedLineIndex;
- int __cachedLinePositionY;
+ float __cachedLinePositionY;
SimpleList* __pKeepLines;
int __keepLineCount;
#include "FGrp_TextTextUtility.h"
#include "FGrp_CanvasImpl.h"
#include "FGrp_TextTextWidthManager.h"
-#include "../FGrp_Canvas.h"
#include "FGrp_CoordinateSystemUtils.h"
using namespace Tizen::Base;
namespace // unnamed
{
- const int LINE_FEED_WIDTH = 8;
+ const float LINE_FEED_WIDTH = 8.0f;
}
namespace Tizen { namespace Graphics
{
int prevTextOffset;
int prevTextLength;
- int prevWidth;
- int prevHeight;
+ float prevWidth;
+ float prevHeight;
int prevEndType;
};
TextComposite::TextComposite(TextElement* pTextElement)
{
__pTextElementList = new (std::nothrow) LinkedList;
- SysTryReturn(NID_GRP
- , __pTextElementList
- , , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
+ SysTryReturn(NID_GRP, __pTextElementList, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
__wrap = TEXT_OBJECT_WRAP_TYPE_WORD;
__workStart = 0;
TextComposite::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength,
int& width, int& height)
{
+ float maxWidthF = _CoordinateSystemUtils::ConvertToFloat(maxWidth);
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+
+ int r = ForwardAnalyze(startTextIndex, textLength, maxWidthF, wrap, actualLength, widthF, heightF);
+
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+
+ return r;
+}
+
+int
+TextComposite::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, int& actualLength,
+ float& width, float& height)
+{
SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < __length, -1, E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid. startTextIndex(%d)", startTextIndex);
SysTryReturn(NID_GRP, textLength <= __length, -1, E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid. textLength(%d)", textLength);
result r = E_SUCCESS;
- Dimension textSize;
+ FloatDimension textSize;
int elementTextOffset = 0;
int elementIndex = 0;
int textIndexFromElementOffset = 0;
- int remainingWidth = 0;
+ float remainingWidth = 0;
int remainingLength = 0;
int textCount = 0;
int currentLength = 0;
TextElement* pTextElement = null;
bool isFirstWord = true;
- Dimension tempTextSize;
+ FloatDimension tempTextSize;
int tempTextCount = 0;
actualLength = 0;
width = 0;
actualLength += textCount;
width += textSize.width;
- height = Math::Max(textSize.height, height);
+ height = (textSize.height > height) ? textSize.height : height;
if (__wrap == TEXT_OBJECT_WRAP_TYPE_WORD && ret != TEXT_RETBY_LIMITWIDTH)
{
}
int
-TextComposite::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, int& actualLength,
- float& width, float& height)
+TextComposite::ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength,
+ int& width, int& height, int& baseline)
{
- int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth);
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
+ float maxWidthF = _CoordinateSystemUtils::ConvertToFloat(maxWidth);
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+ float baselineF = _CoordinateSystemUtils::ConvertToFloat(baseline);
- int r = ForwardAnalyze(startTextIndex, textLength, newMaxWidth, wrap, actualLength, newWidth, newHeight);
+ int r = ForwardAnalyzeWithBaseline(startTextIndex, textLength, maxWidthF, wrap, actualLength, widthF, heightF, baselineF);
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newWidth);
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+ baseline = _CoordinateSystemUtils::ConvertToInteger(baselineF);
return r;
}
int
-TextComposite::ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength,
- int& width, int& height, int& baseline)
+TextComposite::ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, int& actualLength,
+ float& width, float& height, float& baseline)
{
SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < __length
, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. startTextIndex(%d)", startTextIndex);
result r = E_SUCCESS;
- Dimension textSize;
+ FloatDimension textSize;
int elementTextOffset = 0;
int elementIndex = 0;
int textIndexFromElementOffset = 0;
- int remainingWidth = 0;
+ float remainingWidth = 0;
int remainingLength = 0;
int textCount = 0;
int currentLength = 0;
TextElement* pTextElement = null;
bool isFirstWord = true;
- Dimension tempTextSize;
+ FloatDimension tempTextSize;
int tempTextCount = 0;
actualLength = 0;
width = 0;
remainingWidth = maxWidth;
remainingLength = textLength;
currentLength = Math::Min(remainingLength, currentLength);
- baseline = pTextElement->GetBaseline();
+ baseline = pTextElement->GetBaselineF();
pEnum = __pTextElementList->GetEnumeratorN();
for (int i = 0; i <= elementIndex; i++)
actualLength += textCount;
width += textSize.width;
- baseline = Math::Max(pTextElement->GetBaseline(), baseline);
+ baseline = (pTextElement->GetBaselineF() > baseline) ? pTextElement->GetBaselineF() : baseline;
+
if (height < textSize.height)
{
height = textSize.height;
return -1;
}
-int
-TextComposite::ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap, int& actualLength,
- float& width, float& height, int& baseline)
-{
- int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth);
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
-
- int r = ForwardAnalyzeWithBaseline(startTextIndex, textLength, newMaxWidth, wrap, actualLength, newWidth, newHeight, baseline);
-
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newWidth);
-
- return r;
-}
-
result
-TextComposite::GetRegion(int textIndex, int textLength, int& width, int& height) const
+TextComposite::GetRegion(int textIndex, int textLength, float& width, float& height) const
{
if (textLength == 0)
{
result r = E_SUCCESS;
IEnumerator* pEnum = null;
TextElement* pTextElement = null;
- Dimension textSize;
+ FloatDimension textSize;
int currentLength = 0;
int elementTextOffset = 0;
int elementIndex = 0;
pTextElement->GetRegion(textIndexFromElementOffset, currentLength, textSize.width, textSize.height);
width += textSize.width;
- height = Math::Max(height, textSize.height);
+ height = (height > textSize.height) ? height : textSize.height;
textLength -= currentLength;
if (pEnum->MoveNext() != E_SUCCESS)
return r;
}
-result
-TextComposite::GetRegion(int textIndex, int textLength, float& width, float& height) const
-{
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
-
- result r = GetRegion(textIndex, textLength, newWidth, newHeight);
-
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newWidth);
-
- return r;
-}
-
-int
-TextComposite::GetHeight(int textIndex) const
+float
+TextComposite::GetHeightF(int textIndex) const
{
if (__length == 0)
{
pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset);
SysTryCatch(NID_GRP, pTextElement, , E_SYSTEM, "[E_SYSTEM] Fail to get text element.");
- return pTextElement->GetHeight();
+ return pTextElement->GetHeightF();
CATCH:
return -1;
}
-float
-TextComposite::GetHeightF(int textIndex) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetHeight(textIndex));
-}
-
result
-TextComposite::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
+TextComposite::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
const TextObjectActionType action)
{
if (textLength == 0)
result r = E_SUCCESS;
IEnumerator* pEnum = null;
TextElement* pTextElement = null;
- Dimension textSize;
- Dimension spaceCharDim;
- Dimension abbrevTextDim;
- Rectangle adjustedRect = displayRect;
- Rectangle blockRect;
+ FloatDimension textSize;
+ FloatDimension spaceCharDim;
+ FloatDimension abbrevTextDim;
+ FloatRectangle adjustedRect = displayRect;
+ FloatRectangle blockRect;
int currentLength = 0;
int elementTextOffset = 0;
int elementIndex = 0;
int textIndexFromElementOffset = 0;
bool drawAbbrevText = false;
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance.");
if (__ignoreRearBlank && __rearSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE)
{
GetRegion(startTextIndex, textLength, textSize.width, textSize.height);
if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV)
{
- TextElement* pLastTextElement = null;
- pLastTextElement = (textLength == 0) ? GetElementAtTextIndex(startTextIndex) : GetElementAtTextIndex(startTextIndex + textLength - 1);
+ TextElement* pLastTextElement = (textLength == 0) ? GetElementAtTextIndex(startTextIndex) : GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r));
}
- blockRect = Rectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height);
+ blockRect = FloatRectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height);
currentLength = Math::Min(textLength, currentLength);
while (textLength > 0)
if (pTextElement->IsBackGroundDrawingModeEnable())
{
- DrawBackgroundBlock(canvasImpl, Rectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height), startTextIndex, currentLength, alignment, action);
+ DrawBackgroundBlock(canvasImpl, FloatRectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height), startTextIndex, currentLength, alignment, action);
}
bool isAlternateLookEnabled = (pTextElement->GetValue(SET_ALTERNATE_LOOK) > 0) ? true : false;
{
if (pTextElement->IsBackGroundDrawingModeEnable())
{
- r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, abbrevTextDim.width, displayRect.height));
+ r = canvasImpl.FillRectangle(pTextElement->GetBackgroundColor(), FloatRectangle(adjustedRect.x, displayRect.y, abbrevTextDim.width, displayRect.height));
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
}
result
-TextComposite::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
- const TextObjectActionType action)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return Draw(canvasImpl, newDisplayRect, startTextIndex, textLength, alignment, action);
-}
-
-result
-TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
+TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
const TextObjectActionType action, int baseline)
{
if (textLength == 0)
IEnumerator* pEnum = null;
TextElement* pTextElement = null;
- Dimension textSize;
- Dimension spaceCharDim;
- Dimension abbrevTextDim;
- Rectangle adjustedRect = displayRect;
- Rectangle blockRect;
+ FloatDimension textSize;
+ FloatDimension spaceCharDim;
+ FloatDimension abbrevTextDim;
+ FloatRectangle adjustedRect = displayRect;
+ FloatRectangle blockRect;
int currentLength = 0;
int elementTextOffset = 0;
int elementIndex = 0;
int textIndexFromElementOffset = 0;
bool drawAbbrevText = false;
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance.");
-
if (__ignoreRearBlank && __rearSpaceHideMode == TEXT_OBJECT_SPACE_HIDE_TYPE_ONE)
{
pTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset);
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r));
}
- blockRect = Rectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height);
+ blockRect = FloatRectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height);
adjustedRect.y = displayRect.y + displayRect.height - baseline;
canvasImpl.SetTextOrigin(TEXT_ORIGIN_BASELINE);
if (pTextElement->IsBackGroundDrawingModeEnable())
{
- DrawBackgroundBlock(canvasImpl, Rectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height), startTextIndex, currentLength, alignment, action);
+ DrawBackgroundBlock(canvasImpl, FloatRectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height), startTextIndex, currentLength, alignment, action);
}
bool isAlternateLookEnabled = (pTextElement->GetValue(SET_ALTERNATE_LOOK) > 0) ? true : false;
DrawBlock(canvasImpl, blockRect, startTextIndex, currentLength, alignment, action);
}
- Rectangle imageRect = adjustedRect;
+ FloatRectangle imageRect = adjustedRect;
imageRect.y -= textSize.height;
TextElementType objectType = pTextElement->GetType();
{
if (pTextElement->IsBackGroundDrawingModeEnable())
{
- r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, abbrevTextDim.width, displayRect.height));
+ r = canvasImpl.FillRectangle(pTextElement->GetBackgroundColor(), FloatRectangle(adjustedRect.x, displayRect.y, abbrevTextDim.width, displayRect.height));
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
}
result
-TextComposite::DrawWithBaseline(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
- const TextObjectActionType action, int baseline)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return DrawWithBaseline(canvasImpl, newDisplayRect, startTextIndex, textLength, alignment, action, baseline);
-}
-
-result
-TextComposite::DrawBlock(_CanvasImpl& canvasImpl, const Rectangle& displayRect, int startTextIndex, int textLength,
+TextComposite::DrawBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment align, const TextObjectActionType action)
{
int lineIndex = __pCurrentTextColumn->GetLineIndexAtTextIndex(startTextIndex);
return E_SUCCESS;
}
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance.");
-
- Rectangle lineBounds = pTextLine->GetBounds();
+ FloatRectangle lineBounds = pTextLine->GetBoundsF();
blockStartTextIndex -= lineOffset;
blockEndTextIndex -= lineOffset;
- Rectangle blockRect = displayRect;
+ FloatRectangle blockRect = displayRect;
blockRect.y = lineBounds.y;
- LinkedListT<_Util::Pair<int, int>* >* pGapList = pTextLine->GetTextExtentList();
-
- int left = 0;
- int right = 0;
- int blockStart = 0;
- int blockEnd = 0;
+ Collection::ArrayListT<_FloatPair>* pGapList = pTextLine->GetTextExtentList();
+
+ float left = 0;
+ float right = 0;
+ float blockStart = 0;
+ float blockEnd = 0;
- _Util::Pair<int, int>* pPair = null;
- IEnumeratorT<_Util::Pair<int, int>* >* pEnum = pGapList->GetEnumeratorN();
+ _FloatPair currentGap;
+ IEnumeratorT<_FloatPair >* pGapEnum = pGapList->GetEnumeratorN();
+ while (pGapEnum->MoveNext() == E_SUCCESS)
+ {
+ pGapEnum->GetCurrent(currentGap);
+ }
for (int i = 0; i <= blockStartTextIndex; i++)
{
- pEnum->MoveNext();
+ pGapEnum->MoveNext();
}
for (int count = 0; count < blockTextLength; count++)
{
- pEnum->GetCurrent(pPair);
- if (pPair)
+ pGapEnum->GetCurrent(currentGap);
+
+ if (right == currentGap.first || left == currentGap.second)
{
- if (right == pPair->first || left == pPair->second)
- {
- blockStart = (pPair->first < blockStart) ? pPair->first : blockStart;
- blockEnd = (pPair->second > blockEnd) ? pPair->second : blockEnd;
- }
- else
+ blockStart = (currentGap.first < blockStart) ? currentGap.first : blockStart;
+ blockEnd = (currentGap.second > blockEnd) ? currentGap.second : blockEnd;
+ }
+ else
+ {
+ if (blockStart != blockEnd)
{
- if (blockStart != blockEnd)
- {
- pCanvas->FillRectangle(__defaultBlockColor, Rectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height));
- }
-
- blockStart = pPair->first;
- blockEnd = pPair->second;
+ canvasImpl.FillRectangle(__defaultBlockColor, FloatRectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height));
}
- left = pPair->first;
- right = pPair->second;
+ blockStart = currentGap.first;
+ blockEnd = currentGap.second;
}
- pEnum->MoveNext();
+ left = currentGap.first;
+ right = currentGap.second;
+
+ pGapEnum->MoveNext();
}
if (blockStart != blockEnd)
{
- pCanvas->FillRectangle(__defaultBlockColor, Rectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height));
+ canvasImpl.FillRectangle(__defaultBlockColor, FloatRectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height));
}
if ((pTextLine->GetEndType() == TEXT_RETBY_LINEFEED) && (pTextLine->GetTextLength() == blockEndTextIndex))
{
- pCanvas->FillRectangle(__defaultBlockColor, Rectangle(blockRect.x + blockEnd, displayRect.y, LINE_FEED_WIDTH, displayRect.height));
+ canvasImpl.FillRectangle(__defaultBlockColor, FloatRectangle(blockRect.x + blockEnd, displayRect.y, LINE_FEED_WIDTH, displayRect.height));
}
- Release(pEnum);
+ Release(pGapEnum);
return E_SUCCESS;
}
result
-TextComposite::DrawBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment align, const TextObjectActionType action)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return DrawBlock(canvasImpl, newDisplayRect, startTextIndex, textLength, align, action);
-}
-
-result
-TextComposite::DrawBackgroundBlock(_CanvasImpl& canvasImpl, const Rectangle& displayRect, int startTextIndex, int textLength,
+TextComposite::DrawBackgroundBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment align, const TextObjectActionType action)
{
if (textLength == 0)
TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(__pCurrentTextColumn->GetLineIndexAtTextIndex(startTextIndex));
SysTryReturn(NID_GRP, pTextLine, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance.");
-
int blockEndTextIndex = startTextIndex + textLength;
- int prevLeft = 0;
- int prevRight = 0;
- int blockStart = 0;
- int blockEnd = 0;
+ float prevLeft = 0;
+ float prevRight = 0;
+ float blockStart = 0;
+ float blockEnd = 0;
int currentLength = 0;
int elementTextOffset = 0;
int elementIndex = 0;
int textIndexFromElementOffset = 0;
- Rectangle lineBounds = pTextLine->GetBounds();
+ FloatRectangle lineBounds = pTextLine->GetBoundsF();
blockEndTextIndex -= pTextLine->GetTextOffset();
- Rectangle blockRect = displayRect;
+ FloatRectangle blockRect = displayRect;
blockRect.y = lineBounds.y;
TextElement* pTextElement = GetElementAtTextIndex(startTextIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset);
if (pSimpleText != null)
{
Color backgroundColor = pSimpleText->GetBackgroundColor();
+ const wchar_t* pText = pSimpleText->GetTextSource();
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*const_cast < Font* >(pSimpleText->GetFont())));
- SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+ _FontImpl* pFontImpl = (_FontImpl::GetInstance(*const_cast < Font* >(pSimpleText->GetFont())));
+ SysTryReturn(NID_GRP, pFontImpl, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
- _Util::AccumList<_Util::Pair<int, int> > elemenGaptList;
- const wchar_t* pText = pSimpleText->GetTextSource();
- pFont->GetTextExtentList(_Util::String(pText, wcslen(pText), textIndexFromElementOffset, textLength), elemenGaptList);
+ Collection::ArrayListT<_FloatPair> elemenGapListF;
+ pFontImpl->GetTextExtentList(pText, textIndexFromElementOffset, textLength, elemenGapListF);
+
+ _FloatPair currentGap;
+ IEnumeratorT<_FloatPair >* pEnum = elemenGapListF.GetEnumeratorN();
- for (_Util::AccumList<_Util::Pair<int, int> >::Iterator iterator = elemenGaptList.Begin(); iterator != elemenGaptList.End(); iterator++)
+ while (pEnum->MoveNext() == E_SUCCESS)
{
- if (prevRight == iterator->first || prevLeft == iterator->second)
+ pEnum->GetCurrent(currentGap);
+
+ if (prevRight == currentGap.first || prevLeft == currentGap.second)
{
- blockStart = (iterator->first < blockStart) ? iterator->first : blockStart;
- blockEnd = (iterator->second > blockEnd) ? iterator->second : blockEnd;
+ blockStart = (currentGap.first < blockStart) ? currentGap.first : blockStart;
+ blockEnd = (currentGap.second > blockEnd) ? currentGap.second : blockEnd;
}
else
{
if (blockStart != blockEnd)
{
- pCanvas->FillRectangle(backgroundColor, Rectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height));
+ canvasImpl.FillRectangle(backgroundColor, FloatRectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height));
}
- blockStart = iterator->first;
- blockEnd = iterator->second;
+ blockStart = currentGap.first;
+ blockEnd = currentGap.second;
}
- prevLeft = iterator->first;
- prevRight = iterator->second;
+ prevLeft = currentGap.first;
+ prevRight = currentGap.second;
}
if (blockStart != blockEnd)
{
- pCanvas->FillRectangle(backgroundColor, Rectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height));
+ canvasImpl.FillRectangle(backgroundColor, FloatRectangle(blockRect.x + blockStart, displayRect.y, blockEnd - blockStart, displayRect.height));
}
if ((pTextLine->GetEndType() == TEXT_RETBY_LINEFEED) && (pTextLine->GetTextLength() == blockEndTextIndex))
{
- pCanvas->FillRectangle(backgroundColor, Rectangle(blockRect.x + blockEnd, displayRect.y, LINE_FEED_WIDTH, displayRect.height));
+ canvasImpl.FillRectangle(backgroundColor, FloatRectangle(blockRect.x + blockEnd, displayRect.y, LINE_FEED_WIDTH, displayRect.height));
}
+
+ Release(pEnum);
}
}
}
result
-TextComposite::DrawBackgroundBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment align, const TextObjectActionType action)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return DrawBackgroundBlock(canvasImpl, newDisplayRect, startTextIndex, textLength, align, action);
-}
-
-result
-TextComposite::DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const Rectangle& displayRect,
+TextComposite::DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const FloatRectangle& displayRect,
const TextObjectAlignment align, const TextObjectActionType action)
{
SysTryReturn(NID_GRP, pTextLine, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
int lineOffset = 0;
int lineLength = 0;
- Rectangle adjustedRect;
- Rectangle lineBounds;
- Dimension lineTextSize;
-
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance.");
+ FloatRectangle adjustedRect;
+ FloatRectangle lineBounds;
+ FloatDimension lineTextSize;
lineLength = pTextLine->GetTextLength();
lineOffset = pTextLine->GetTextOffset();
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
adjustedRect = displayRect;
}
result
-TextComposite::DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const FloatRectangle& displayRect,
- const TextObjectAlignment align, const TextObjectActionType action)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return DrawLine(canvasImpl, pTextLine, newDisplayRect, align, action);
-}
-
-result
TextComposite::GetValue(TextElement* pTextElement, TextComponentInfoValueType type, unsigned int* value) const
{
SysTryReturn(NID_GRP, pTextElement, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
}
int
-TextComposite::Compose(Rectangle& rect, TextColumn* pTextColumn)
+TextComposite::Compose(FloatRectangle& rect, TextColumn* pTextColumn)
{
SysTryReturn(NID_GRP, pTextColumn, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
return lineCount;
}
-int
-TextComposite::Compose(FloatRectangle& rect, TextColumn* pTextColumn)
-{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return Compose(newRect, pTextColumn);
-}
-
result
TextComposite::SetRange(int textStartIndex, int textLength)
{
int
TextComposite::GetFontSize(int textIndex) const
{
- unsigned int value = 0;
-
- result r = GetValue(textIndex, SET_FONT_SIZE, &value);
- SysTryReturn(NID_GRP, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return (int)value;
+ return _CoordinateSystemUtils::ConvertToInteger(GetFontSizeF(textIndex));
}
float
TextComposite::GetFontSizeF(int textIndex) const
{
- return _CoordinateSystemUtils::ConvertToInteger(GetFontSize(textIndex));
+ unsigned int value = 0;
+
+ result r = GetValue(textIndex, SET_FONT_SIZE, &value);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return (float)value;
}
result
TextComposite::ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength, int maxWidth,
int& cursorIndex, TextElementType& type)
{
+ return ForwardAnalyzeWithFocusedObjectType(textIndex, textLength
+ , _CoordinateSystemUtils::ConvertToFloat(maxWidth), cursorIndex, type);
+}
+
+int
+TextComposite::ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength, float maxWidth,
+ int& cursorIndex, TextElementType& type)
+{
result r = E_SUCCESS;
- Dimension textSize;
+ FloatDimension textSize;
int currentLength = 0;
int elementTextOffset = 0;
int elementIndex = 0;
int textIndexFromElementOffset = 0;
int textCount = 0;
- int remainingWidth = 0;
+ float remainingWidth = 0;
int remainingLength = 0;
int ret = TEXT_RETBY_NORMAL;
bool isFirstWord = true;
if ((objectType == TEXT_ELEMENT_TYPE_TEXT || objectType == TEXT_ELEMENT_TYPE_CUTLINK) && (ret == TEXT_RETBY_LIMITWIDTH))
{
- Dimension tempTextSize;
+ FloatDimension tempTextSize;
r = pTextElement->GetRegion(textIndexFromElementOffset, textCount + 1, tempTextSize.width, tempTextSize.height);
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return -1;
}
-int
-TextComposite::ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength, float maxWidth,
- int& cursorIndex, TextElementType& type)
-{
- int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth);
-
- return ForwardAnalyzeWithFocusedObjectType(textIndex, textLength, newMaxWidth, cursorIndex, type);
-}
-
void
TextComposite::HideFrontSpace(TextObjectSpaceHideType mode)
{
int
TextComposite::ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength, int maxWidth, int& textIndex)
{
+ return ForwardAnalyzeInNoneCursorMode(startTextIndex, textLength
+ , _CoordinateSystemUtils::ConvertToFloat(maxWidth), textIndex);
+}
+
+int
+TextComposite::ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength, float maxWidth, int& textIndex)
+{
result r = E_SUCCESS;
- Dimension textSize;
+ FloatDimension textSize;
int currentLength = 0;
int elementTextOffset = 0;
int elementIndex = 0;
int textIndexFromElementOffset = 0;
int textCount = 0;
- int remainingWidth = 0;
+ float remainingWidth = 0;
int remainingLength = 0;
int ret = TEXT_RETBY_NORMAL;
bool isFirstWord = true;
if ((objectType == TEXT_ELEMENT_TYPE_TEXT || objectType == TEXT_ELEMENT_TYPE_CUTLINK) && (ret == TEXT_RETBY_LIMITWIDTH))
{
- Dimension tempTextSize;
+ FloatDimension tempTextSize;
r = pTextElement->GetRegion(textIndexFromElementOffset, textCount + 1, tempTextSize.width, tempTextSize.height);
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
int
-TextComposite::ForwardAnalyzeInNoneCursorMode(int startTextIndex, int textLength, float maxWidth, int& textIndex)
-{
- int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth);
-
- return ForwardAnalyzeInNoneCursorMode(startTextIndex, textLength, newMaxWidth, textIndex);
-}
-
-int
TextComposite::GetCutLinkElementCount(void) const
{
return __pCutLinkListInfo->GetCutLinkElementCount();
}
int
-TextComposite::ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo)
+TextComposite::ComposeInNoneWrap(FloatRectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo)
{
SysTryReturn(NID_GRP, __pCurrentTextColumn, -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
TextLine* pTextLine = null;
- Rectangle lineBounds;
- Dimension textSize;
+ FloatRectangle lineBounds;
+ FloatDimension textSize;
int lineOffset = 0;
int lineLength = 0;
int endType = TEXT_RETBY_NORMAL;
bool isChanged = false;
- int baseline = 0;
+ float baseline = 0;
int textIndex = 0;
textIndex = (__workStart < 0) ? 0 : __workStart;
pTextLine = __pCurrentTextColumn->GetTextLine(0);
SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
endType = pTextLine->GetEndType();
if (lineBounds.width != rect.width)
}
else if (forwardSearch && textIndex >= lineOffset + lineLength)
{
- Dimension needDim;
+ FloatDimension needDim;
GetRegion(lineOffset + lineLength, textIndex - (lineOffset + lineLength) + 1, needDim.width, needDim.height);
int index = 0;
- int remainingWidth = needDim.width - (lineBounds.width - textSize.width);
+ float remainingWidth = needDim.width - (lineBounds.width - textSize.width);
- Dimension charDim;
+ FloatDimension charDim;
textSize.width += needDim.width;
lineLength += textIndex - (lineOffset + lineLength) + 1;
{
if (lineOffset > 0)
{
- Dimension lineTextSize;
+ FloatDimension lineTextSize;
int textCount = 0;
- int remainingWidth = 0;
+ float remainingWidth = 0;
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
remainingWidth = lineBounds.width - lineTextSize.width;
return 1;
}
-int
-TextComposite::ComposeInNoneWrap(FloatRectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo)
-{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return ComposeInNoneWrap(newRect, pNoneWrapComposeInfo);
-}
-
result
TextComposite::GetTextExtentList(TextLine* pTextLine) const
{
int currentLength = 0;
int textIndexFromElementOffset = 0;
int remainingLength = 0;
- int right = 0;
- int maxWidth = 0;
+ float right = 0;
+ float maxWidth = 0;
TextElement* pTextElement = GetElementAtTextIndex(lineOffset, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset);
SysTryReturn(NID_GRP, pTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text element.");
remainingLength = lineLength;
currentLength = Math::Min(remainingLength, currentLength);
- LinkedListT <_Util::Pair<int, int>* >* pGapList = new (std::nothrow) LinkedListT <_Util::Pair<int, int>* >;
- _Util::Pair<int, int>* pGap = null;
-
IEnumerator* pEnum = __pTextElementList->GetEnumeratorN();
for (int i = 0; i <= elementIndex; i++)
{
r = pEnum->MoveNext();
}
+ Collection::ArrayListT<_FloatPair>* pGapListF = new (std::nothrow) Collection::ArrayListT<_FloatPair>;
+ _FloatPair currentGap;
+
while (remainingLength != 0)
{
TextElementType objectType = pTextElement->GetType();
const Bitmap* pBitmap = pSimpleText->GetBitmap();
if (pBitmap)
{
- pGap = new (std::nothrow) _Util::Pair<int, int>;
- pGap->first = maxWidth;
- pGap->second = pGap->first + pBitmap->GetWidth() ;
+ currentGap.first = maxWidth;
+ currentGap.second = currentGap.first + pBitmap->GetWidth();
- pGapList->Add(pGap);
- right = (right < pGap->second) ? pGap->second : right;
+ pGapListF->Add(currentGap);
+ right = (right < currentGap.second) ? currentGap.second : right;
}
else
{
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*const_cast < Font* >(pSimpleText->GetFont())));
- SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+ _FontImpl* pFontImpl = _FontImpl::GetInstance(*const_cast < Font* >(pSimpleText->GetFont()));
+ SysTryReturn(NID_GRP, pFontImpl, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+
+ Collection::ArrayListT<_FloatPair> pCurrentElementGapListF;
- _Util::AccumList<_Util::Pair<int, int> > elemenGaptList;
const wchar_t* pText = pSimpleText->GetTextSource();
- pFont->GetTextExtentList(_Util::String(pText, wcslen(pText), textIndexFromElementOffset, currentLength), elemenGaptList);
+ pFontImpl->GetTextExtentList(pText, textIndexFromElementOffset, currentLength, pCurrentElementGapListF);
- for (_Util::AccumList<_Util::Pair<int, int> >::Iterator iterator = elemenGaptList.Begin(); iterator != elemenGaptList.End(); iterator++)
+ IEnumeratorT<_FloatPair >* pCurrentElementGapEnum = pCurrentElementGapListF.GetEnumeratorN();
+ while (pCurrentElementGapEnum->MoveNext() == E_SUCCESS)
{
- pGap = new (std::nothrow) _Util::Pair<int, int>;
- pGap->first = maxWidth + iterator->first;
- pGap->second = maxWidth + iterator->second;
+ pCurrentElementGapEnum->GetCurrent(currentGap);
+
+ currentGap.first = maxWidth + currentGap.first;
+ currentGap.second = maxWidth + currentGap.second;
- pGapList->Add(pGap);
- right = (right < pGap->second) ? pGap->second : right;
+ pGapListF->Add(currentGap);
+ right = (right < currentGap.second) ? currentGap.second : right;
}
+
+ Release(pCurrentElementGapEnum);
}
}
}
TextImage* pImageText = dynamic_cast < TextImage* >(pTextElement);
if (pImageText != null)
{
- Rectangle rect = pImageText->GetBounds();
+ FloatRectangle rect = pImageText->GetBoundsF();
- pGap = new (std::nothrow) _Util::Pair<int, int>;
- pGap->first = maxWidth;
- pGap->second = pGap->first + rect.width;
+ currentGap.first = maxWidth;
+ currentGap.second = currentGap.first + rect.width;
- pGapList->Add(pGap);
- right = (right < pGap->second) ? pGap->second : right;
+ pGapListF->Add(currentGap);
+ right = (right < currentGap.second) ? currentGap.second : right;
}
}
right = 0;
}
- pTextLine->SetTextExtentList(pGapList);
+ pTextLine->SetTextExtentList(pGapListF);
Release(pEnum);
}
int
-TextComposite::ComposeInWrap(Rectangle& rect)
+TextComposite::ComposeInWrap(FloatRectangle& rect)
{
SysTryReturn(NID_GRP, __pCurrentTextColumn, -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
int lineCount = 0;
int textIndex = 0;
int remainingLength = 0;
- int remainingWidth = 0;
- int remainingHeight = 0;
- int offsetY = 0;
+ float remainingWidth = 0;
+ float remainingHeight = 0;
+ float offsetY = 0;
bool hasPrevLine = false;
- Dimension textSize;
+ FloatDimension textSize;
TextLine* pTextLine = null;
int ret = 0;
int endType = TEXT_RETBY_NORMAL;
- Rectangle lineBounds;
- Dimension lineTextSize;
+ FloatRectangle lineBounds;
+ FloatDimension lineTextSize;
int lineOffset = 0;
int lineLength = 0;
int displayLineCount = 0;
- int displayHeight = 0;
- int baseline = 0;
- int lineBaseline = 0;
+ float displayHeight = 0;
+ float baseline = 0;
+ float lineBaseline = 0;
pTextLine = __pCurrentTextColumn->GetPrevLineChangedStartLine();
if (pTextLine != null)
endType = pTextLine->GetEndType();
lineOffset = pTextLine->GetTextOffset();
lineLength = pTextLine->GetTextLength();
- lineBounds = pTextLine->GetBounds();
- lineBaseline = pTextLine->GetBaseline();
+ lineBounds = pTextLine->GetBoundsF();
+ lineBaseline = pTextLine->GetBaselineF();
pTextLine->GetRegion(0, pTextLine->GetTextLength(), lineTextSize.width, lineTextSize.height);
if (endType != TEXT_RETBY_LINEFEED)
if (remainingLength == 0)
{
- int nextY = offsetY;
+ float nextY = offsetY;
lineTextSize.height = lineBounds.height;
pTextLine = new (std::nothrow)TextLine(this);
lineBounds.y = nextY;
pTextLine->SetBounds(lineBounds);
- pTextLine->SetRegion(0, lineTextSize.height);
+ pTextLine->SetRegion(0.0f, lineTextSize.height);
pTextLine->SetTextLength(0);
pTextLine->SetTextOffset(textIndex);
pTextLine->SetEndType(TEXT_RETBY_LINEFEED);
if (remainingLength == 0)
{
- lineTextSize.height = GetHeight(0);
+ lineTextSize.height = GetHeightF(0);
lineBounds.height = lineTextSize.height;
pTextLine->SetBounds(lineBounds);
- pTextLine->SetRegion(0, lineTextSize.height);
+ pTextLine->SetRegion(0.0f, lineTextSize.height);
pTextLine->SetTextLength(0);
pTextLine->SetTextOffset(textIndex);
pTextLine->SetEndType(TEXT_RETBY_NORMAL);
{
lineLength += textCount;
lineTextSize.width += textSize.width;
- lineBounds.height = Math::Max(lineBounds.height, textSize.height);
+ lineBounds.height = (lineBounds.height > textSize.height) ? lineBounds.height: textSize.height;
lineTextSize.height = lineBounds.height;
endType = ret;
- baseline = Math::Min(lineBaseline, baseline);
+ baseline = (lineBaseline > baseline) ? baseline : lineBaseline;
pTextLine->SetBounds(lineBounds);
pTextLine->SetRegion(lineTextSize.width, lineTextSize.height);
{
lineLength += textCount;
lineTextSize.width += textSize.width;
- lineBounds.height = Math::Max(lineBounds.height, textSize.height);
+ lineBounds.height = (lineBounds.height > textSize.height) ? lineBounds.height : textSize.height;
lineTextSize.height = lineBounds.height;
endType = ret;
- baseline = Math::Min(lineBaseline, baseline);
+ baseline = (lineBaseline > baseline) ? baseline : lineBaseline;
pTextLine->SetBounds(lineBounds);
pTextLine->SetRegion(lineTextSize.width, lineTextSize.height);
if (remainingLength > 0)
{
- int nextY = lineBounds.y + lineBounds.height;
+ float nextY = lineBounds.y + lineBounds.height;
pTextLine = new (std::nothrow)TextLine(this);
SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
{
if (endType == TEXT_RETBY_LINEFEED)
{
- int nextY = lineBounds.y + lineBounds.height;
+ float nextY = lineBounds.y + lineBounds.height;
lineTextSize.height = lineBounds.height;
pTextLine = new (std::nothrow)TextLine(this);
lineBounds.height = lineTextSize.height;
pTextLine->SetBounds(lineBounds);
- pTextLine->SetRegion(0, lineTextSize.height);
+ pTextLine->SetRegion(0.0f, lineTextSize.height);
pTextLine->SetTextLength(0);
pTextLine->SetTextOffset(textIndex);
pTextLine->SetEndType(TEXT_RETBY_LINEFEED);
}
}
- Dimension columnTextSize;
+ FloatDimension columnTextSize;
__pCurrentTextColumn->GetRegion(0, __length, columnTextSize.width, columnTextSize.height);
rect.height = columnTextSize.height;
}
int
-TextComposite::ComposeInWrap(FloatRectangle& rect)
-{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return ComposeInWrap(newRect);
-}
-
-int
-TextComposite::ComposeInPartialMode(Rectangle& rect)
+TextComposite::ComposeInPartialMode(FloatRectangle& rect)
{
- SysTryReturn(NID_GRP
- , __pCurrentTextColumn
- , -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
+ SysTryReturn(NID_GRP, __pCurrentTextColumn, -1, E_INVALID_STATE
+ , "[E_INVALID_STATE] This instance is not constructed yet.");
int textCount = 0;
int lineCount = 0;
int textIndex = 0;
int remainingLength = 0;
- int remainingWidth = 0;
- int remainingHeight = 0;
+ float remainingWidth = 0;
+ float remainingHeight = 0;
int lineOffset = 0;
int lineLength = 0;
- int offsetY = 0;
+ float offsetY = 0;
int ret = 0;
- Dimension textSize;
- Dimension lineTextSize;
- Rectangle lineBounds;
+ FloatDimension textSize;
+ FloatDimension lineTextSize;
+ FloatRectangle lineBounds;
bool hasPrevLine = false;
int displayLineCount = 0;
- int displayHeight = 0;
- int baseline = 0;
- int lineBaseline = 0;
+ float displayHeight = 0;
+ float baseline = 0;
+ float lineBaseline = 0;
TextLine* pTextLine = null;
int endType = TEXT_RETBY_NORMAL;
endType = pTextLine->GetEndType();
lineOffset = pTextLine->GetTextOffset();
lineLength = pTextLine->GetTextLength();
- lineBounds = pTextLine->GetBounds();
- lineBaseline = pTextLine->GetBaseline();
+ lineBounds = pTextLine->GetBoundsF();
+ lineBaseline = pTextLine->GetBaselineF();
pTextLine->GetRegion(0, pTextLine->GetTextLength(), lineTextSize.width, lineTextSize.height);
if (endType != TEXT_RETBY_LINEFEED)
if (remainingLength == 0)
{
- int nextY = offsetY;
+ float nextY = offsetY;
lineTextSize.height = lineBounds.height;
pTextLine = new (std::nothrow)TextLine(this);
lineBounds.y = nextY;
pTextLine->SetBounds(lineBounds);
- pTextLine->SetRegion(0, lineTextSize.height);
+ pTextLine->SetRegion(0.0f, lineTextSize.height);
pTextLine->SetTextLength(0);
pTextLine->SetTextOffset(textIndex);
pTextLine->SetEndType(TEXT_RETBY_LINEFEED);
if (remainingLength == 0)
{
- lineTextSize.height = GetHeight(0);
+ lineTextSize.height = GetHeightF(0);
lineBounds.height = lineTextSize.height;
pTextLine->SetBounds(lineBounds);
- pTextLine->SetRegion(0, lineTextSize.height);
+ pTextLine->SetRegion(0.0f, lineTextSize.height);
pTextLine->SetTextLength(0);
pTextLine->SetTextOffset(textIndex);
pTextLine->SetEndType(TEXT_RETBY_NORMAL);
}
}
- remainingHeight = GetComposePartialLimitHeight();
+ remainingHeight = GetComposePartialLimitHeightF();
if (remainingHeight == 0)
{
remainingHeight = rect.height;
{
lineLength += textCount;
lineTextSize.width += textSize.width;
- lineBounds.height = Math::Max(lineBounds.height, textSize.height);
+ lineBounds.height = (lineBounds.height > textSize.height) ? lineBounds.height: textSize.height;
lineTextSize.height = lineBounds.height;
endType = ret;
- baseline = Math::Min(lineBaseline, baseline);
+ baseline = (lineBaseline > baseline) ? baseline : lineBaseline;
pTextLine->SetBounds(lineBounds);
pTextLine->SetRegion(lineTextSize.width, lineTextSize.height);
{
lineLength += textCount;
lineTextSize.width += textSize.width;
- lineBounds.height = Math::Max(lineBounds.height, textSize.height);
+ lineBounds.height = (lineBounds.height > textSize.height) ? lineBounds.height : textSize.height;
lineTextSize.height = lineBounds.height;
endType = ret;
- baseline = Math::Min(lineBaseline, baseline);
+ baseline = (lineBaseline > baseline) ? baseline : lineBaseline;
pTextLine->SetBounds(lineBounds);
pTextLine->SetRegion(lineTextSize.width, lineTextSize.height);
if (remainingLength > 0)
{
- int nextY = lineBounds.y + lineBounds.height;
+ float nextY = lineBounds.y + lineBounds.height;
pTextLine = new (std::nothrow)TextLine(this);
SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
{
if (endType == TEXT_RETBY_LINEFEED)
{
- int nextY = lineBounds.y + lineBounds.height;
+ float nextY = lineBounds.y + lineBounds.height;
lineTextSize.height = lineBounds.height;
pTextLine = new (std::nothrow)TextLine(this);
lineBounds.height = lineTextSize.height;
pTextLine->SetBounds(lineBounds);
- pTextLine->SetRegion(0, lineTextSize.height);
+ pTextLine->SetRegion(0.0f, lineTextSize.height);
pTextLine->SetTextLength(0);
pTextLine->SetTextOffset(textIndex);
pTextLine->SetEndType(TEXT_RETBY_LINEFEED);
}
int
-TextComposite::ComposeInPartialMode(FloatRectangle& rect)
-{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return ComposeInPartialMode(newRect);
-}
-
-int
-TextComposite::ComposeInNormalWrap(Rectangle& rect)
-{
- return ComposeInWrap(rect);
-}
-
-int
TextComposite::ComposeInNormalWrap(FloatRectangle& rect)
{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return ComposeInNormalWrap(newRect);
+ return ComposeInWrap(rect);
}
int
-TextComposite::ComposeInWordWrap(Rectangle& rect)
+TextComposite::ComposeInWordWrap(FloatRectangle& rect)
{
if (IsWidthManagerEnabled())
{
}
int
-TextComposite::ComposeInWordWrap(FloatRectangle& rect)
-{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return ComposeInWordWrap(newRect);
-}
-
-int
-TextComposite::ComposeInNoneWrapMiddleEllipsis(Rectangle& rect)
+TextComposite::ComposeInNoneWrapMiddleEllipsis(FloatRectangle& rect)
{
int endType = TEXT_RETBY_NORMAL;
- Rectangle lineBounds;
- Dimension abbrevTextDim;
- Dimension textSize;
+ FloatRectangle lineBounds;
+ FloatDimension abbrevTextDim;
+ FloatDimension textSize;
int length = 0;
- int maxHeight = 0;
- int baseline = 0;
+ float maxHeight = 0;
+ float baseline = 0;
lineBounds.width = rect.width;
lineBounds.x = 0;
__pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
__middleEllipsisWidth = abbrevTextDim.width;
- ForwardAnalyze(0, __length, ((lineBounds.width - __middleEllipsisWidth + 10) >> 1), __wrap, length, textSize.width, textSize.height);
+ ForwardAnalyze(0, __length, ((lineBounds.width - __middleEllipsisWidth + 10.0f) / 2.0f), __wrap, length, textSize.width, textSize.height);
__middleEllipsisTextLengthInHead = length;
__middleEllipsisHeadWidth = textSize.width;
}
int
-TextComposite::ComposeInNoneWrapMiddleEllipsis(FloatRectangle& rect)
-{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return ComposeInNoneWrapMiddleEllipsis(newRect);
-}
-
-int
-TextComposite::ComposeInNoneWrapHeadEllipsis(Rectangle& rect)
+TextComposite::ComposeInNoneWrapHeadEllipsis(FloatRectangle& rect)
{
SysTryReturn(NID_GRP, __pCurrentTextColumn, -1, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
int endType = TEXT_RETBY_NORMAL;
- Rectangle lineBounds;
- Dimension abbrevTextDim;
- Dimension textSize;
+ FloatRectangle lineBounds;
+ FloatDimension abbrevTextDim;
+ FloatDimension textSize;
int length = 0;
- int maxHeight = 0;
- int baseline = 0;
+ float maxHeight = 0;
+ float baseline = 0;
lineBounds.width = rect.width;
lineBounds.x = 0;
return 1;
}
-int
-TextComposite::ComposeInNoneWrapHeadEllipsis(FloatRectangle& rect)
-{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return ComposeInNoneWrapHeadEllipsis(newRect);
-}
-
result
-TextComposite::DrawAbbrev(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment align)
+TextComposite::DrawAbbrev(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment align)
{
if (__TextObjectEllipsisType == TEXT_OBJECT_ELLIPSIS_TYPE_MIDDLE)
{
}
result
-TextComposite::DrawAbbrev(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment align)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return DrawAbbrev(canvasImpl, newDisplayRect, align);
-}
-
-result
TextComposite::GetValue(int textIndex, TextComponentInfoValueType type, unsigned int* value) const
{
IEnumerator* pEnum = null;
}
bool
-TextComposite::BackwardAnalyze(int startTextIndex, int maxWidth, int* actualLength, int* width, int* height)
+TextComposite::BackwardAnalyze(int startTextIndex, float maxWidth, int* actualLength, float* width, float* height)
{
- int remainingWidth = 0;
+ float remainingWidth = 0;
int length = 0;
- Dimension textSize;
+ FloatDimension textSize;
*actualLength = 0;
*width = 0;
return true;
}
-bool
-TextComposite::BackwardAnalyze(int startTextIndex, float maxWidth, int* actualLength, float* width, float* height)
-{
- int newMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth);
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(*width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(*height);
-
- return BackwardAnalyze(startTextIndex, newMaxWidth, actualLength, &newWidth, &newHeight);
-}
-
int
TextComposite::GetFirstTextIndexAt(int elementIndex) const
{
}
result
-TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment alignment)
+TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignment)
{
TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(0);
SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- Dimension textSize;
- Rectangle adjustedRect;
+ FloatDimension textSize;
+ FloatRectangle adjustedRect;
pTextLine->GetRegion(0, __length, textSize.width, textSize.height);
adjustedRect.x = displayRect.x;
}
result
-TextComposite::DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignment)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return DrawAbbrevInMiddleEllipsis(canvasImpl, newDisplayRect, alignment);
-}
-
-result
-TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment alignment)
+TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignment)
{
TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(0);
SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
result r = E_SUCCESS;
- Dimension textSize;
- Rectangle adjustedRect;
+ FloatDimension textSize;
+ FloatRectangle adjustedRect;
pTextLine->GetRegion(0, __length, textSize.width, textSize.height);
adjustedRect.x = displayRect.x;
}
result
-TextComposite::DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignment)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return DrawAbbrevInHeadEllipsis(canvasImpl, newDisplayRect, alignment);
-}
-
-result
-TextComposite::DrawPartial(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength)
+TextComposite::DrawPartial(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength)
{
SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
SysTryReturn(NID_GRP, textLength <= __length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
IEnumerator* pEnum = null;
TextElement* pTextElement = null;
- Dimension textSize;
+ FloatDimension textSize;
int currentLength = 0;
int textIndexFromElementOffset = 0;
int nodeIndex = 0;
int elementTextOffset = 0;
- Rectangle adjustedRect = displayRect;
+ FloatRectangle adjustedRect = displayRect;
int blockStartTextIndex = 0;
int blockEndTextIndex = 0;
bool isAlternateLookEnabled = false;
int textIndex = startTextIndex;
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance.");
-
pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, nodeIndex, currentLength,
textIndexFromElementOffset);
SysTryReturn(NID_GRP, pTextElement, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element.");
if (pTextElement->IsBackGroundDrawingModeEnable())
{
- r = pCanvas->FillRectangle(pTextElement->GetBackgroundColor(), Rectangle(adjustedRect.x, displayRect.y, textSize.width, displayRect.height));
+ r = canvasImpl.FillRectangle(pTextElement->GetBackgroundColor(), FloatRectangle(adjustedRect.x, displayRect.y, textSize.width, displayRect.height));
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
isAlternateLookEnabled = (pTextElement->GetValue(SET_ALTERNATE_LOOK) > 0) ? true : false;
if ((__displayBlock) && (isAlternateLookEnabled == false))
{
- Dimension tempTextSize;
- int adjustedX = 0;
+ FloatDimension tempTextSize;
+ float adjustedX = 0;
blockStartTextIndex = Math::Max(__workStart, textIndex);
blockEndTextIndex = Math::Min(__workStart + __workLength, textIndex + currentLength);
adjustedX += tempTextSize.width;
}
- Rectangle blockRect = adjustedRect;
+ FloatRectangle blockRect = adjustedRect;
blockRect.x = adjustedX;
}
}
return E_SUCCESS;
}
-result
-TextComposite::DrawPartial(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return DrawPartial(canvasImpl, newDisplayRect, startTextIndex, textLength);
-}
-
void
TextComposite::SetPartialComposingModeEnabled(bool enable)
{
}
int
-TextComposite::ComposeInWrapByTextWidth(Rectangle& rect)
+TextComposite::ComposeInWrapByTextWidth(FloatRectangle& rect)
{
SysTryReturn(NID_GRP, __pCurrentTextColumn, false, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
- Rectangle lineBounds;
+ FloatRectangle lineBounds;
int lineCount = 0;
int textIndex = 0;
int remainingLength = 0;
- int remainingWidth = 0;
- int remainingHeight = 0;
- int offsetY = 0;
+ float remainingWidth = 0;
+ float remainingHeight = 0;
+ float offsetY = 0;
bool hasPrevLine = false;
int endType = TEXT_RETBY_NORMAL;
- Dimension lineTextSize;
+ FloatDimension lineTextSize;
int lineOffset = 0;
int lineLength = 0;
TextLine* pTextLine = null;
endType = pTextLine->GetEndType();
lineOffset = pTextLine->GetTextOffset();
lineLength = pTextLine->GetTextLength();
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
pTextLine->GetRegion(0, pTextLine->GetTextLength(), lineTextSize.width, lineTextSize.height);
if (endType != TEXT_RETBY_LINEFEED)
SysTryReturn(NID_GRP, pTextLine, -1, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
pTextLine->SetBounds(lineBounds);
- pTextLine->SetRegion(0, lineTextSize.height);
+ pTextLine->SetRegion(0.0f, lineTextSize.height);
pTextLine->SetTextLength(0);
pTextLine->SetTextOffset(textIndex);
pTextLine->SetEndType(TEXT_RETBY_LINEFEED);
if (remainingLength > 0)
{
- int nextY = lineBounds.y + lineBounds.height;
+ float nextY = lineBounds.y + lineBounds.height;
lineBounds.x = rect.x;
lineBounds.y = nextY;
{
if (composeInfo.endType == TEXT_RETBY_LINEFEED)
{
- int nextY = lineBounds.y + lineBounds.height;
+ float nextY = lineBounds.y + lineBounds.height;
lineTextSize.height = lineBounds.height;
pTextLine = new (std::nothrow)TextLine(this);
lineBounds.height = lineTextSize.height;
pTextLine->SetBounds(lineBounds);
- pTextLine->SetRegion(0, lineTextSize.height);
+ pTextLine->SetRegion(0.0f, lineTextSize.height);
pTextLine->SetTextLength(0);
pTextLine->SetTextOffset(textIndex);
pTextLine->SetEndType(TEXT_RETBY_LINEFEED);
__pTextWidthManager->EndCompose();
- Dimension columnSize;
+ FloatDimension columnSize;
__pCurrentTextColumn->GetRegion(0, __length, columnSize.width, columnSize.height);
rect.height = columnSize.height;
return lineCount;
}
-int
-TextComposite::ComposeInWrapByTextWidth(FloatRectangle& rect)
-{
- Rectangle newRect = _CoordinateSystemUtils::ConvertToInteger(rect);
-
- return ComposeInWrapByTextWidth(newRect);
-}
-
result
TextComposite::GetCutLinkObjectInfo(int cutLinkIndex, int& textStartIndex, int& textLength) const
{
int
TextComposite::GetTotalComposedHeight(void) const
{
- return __totalComposedHeight;
+ return _CoordinateSystemUtils::ConvertToInteger(__totalComposedHeight);
}
float
TextComposite::GetTotalComposedHeightF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(__totalComposedHeight);
+ return __totalComposedHeight;
}
int
TextComposite::GetAnalysedTotalHeight(void) const
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetAnalysedTotalHeightF());
+}
+
+float
+TextComposite::GetAnalysedTotalHeightF(void) const
+{
TextLine* pTextLine = null;
pTextLine = __pCurrentTextColumn->GetTextLine(__lineIndexCompositeDone - 1);
return 0;
}
- return (int)(GetTotalComposedHeight() * __length / composedLength);
-}
-
-float
-TextComposite::GetAnalysedTotalHeightF(void) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetAnalysedTotalHeight());
+ return (float)(GetTotalComposedHeightF() * __length / composedLength);
}
void
TextComposite::SetComposePartialLimitHeight(int limitHeight)
{
- __composePartialLimitHeight = limitHeight;
+ __composePartialLimitHeight = _CoordinateSystemUtils::ConvertToFloat(limitHeight);
}
void
TextComposite::SetComposePartialLimitHeight(float limitHeight)
{
- __composePartialLimitHeight = _CoordinateSystemUtils::ConvertToInteger(limitHeight);
+ __composePartialLimitHeight = limitHeight;
}
int
TextComposite::GetComposePartialLimitHeight(void) const
{
- return __composePartialLimitHeight;
-
+ return _CoordinateSystemUtils::ConvertToInteger(__composePartialLimitHeight);
}
float
TextComposite::GetComposePartialLimitHeightF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(__composePartialLimitHeight);
+ return __composePartialLimitHeight;
}
TextElementType
int textIndexFromElementOffset = 0;
int elementTextOffset = 0;
- pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset
- , elementIndex, currentLength, textIndexFromElementOffset);
+ pTextElement = GetElementAtTextIndex(textIndex, elementTextOffset, elementIndex, currentLength, textIndexFromElementOffset);
if (pTextElement == null)
{
return TEXT_ELEMENT_TYPE_NONE;
void
TextComposite::SetLineSpace(int gap)
{
- __lineSpacing = gap;
+ SetLineSpace(_CoordinateSystemUtils::ConvertToFloat(gap));
}
void
TextComposite::SetLineSpace(float gap)
-{
- SetLineSpace(_CoordinateSystemUtils::ConvertToInteger(gap));
+{
+ __lineSpacing = gap;
}
int
TextComposite::GetLineSpace(void) const
{
- return __lineSpacing;
+ return _CoordinateSystemUtils::ConvertToInteger(__lineSpacing);
}
float
TextComposite::GetLineSpaceF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(__lineSpacing);
+ return __lineSpacing;
}
void
}
Tizen::Base::String
-TextComposite::GetDisplayableText(Rectangle displayRect, TextObjectActionType action)
+TextComposite::GetDisplayableText(FloatRectangle displayRect, TextObjectActionType action)
{
int firstDisplayLineIndex = __pCurrentTextColumn->GetFirstDisplayLineIndex();
TextLine* pTextLine = __pCurrentTextColumn->GetTextLine(firstDisplayLineIndex);
if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV)
{
- Dimension textSize;
- Dimension abbrevTextSize;
- Rectangle lineBounds = pTextLine->GetBounds();
+ FloatDimension textSize;
+ FloatDimension abbrevTextSize;
+ FloatRectangle lineBounds = pTextLine->GetBoundsF();
GetRegion(lineOffset, remainingLength, textSize.width, textSize.height);
return text;
}
-Tizen::Base::String
-TextComposite::GetDisplayableText(FloatRectangle displayRect, TextObjectActionType action)
-{
- Rectangle newDisplayRect = _CoordinateSystemUtils::ConvertToInteger(displayRect);
-
- return GetDisplayableText(newDisplayRect, action);
-}
-
void
TextComposite::SetTextWidthManager(TextWidthManager* pTextWidthManager)
{
TextComposite::SetWorkWidth(Font* pFont, wchar_t* pText, int workStart, int textLength)
{
result r = E_SUCCESS;
- int width = 0;
- int height = 0;
+ float width = 0;
+ float height = 0;
int workLength = 0;
const wchar_t* pSrc = &pText[workStart];
return E_SUCCESS;
}
-int
+float
TextComposite::GetWorkWidth(void)
{
return __workWidth;
int& actualLength, int& width, int& height, int& baseline);
virtual int ForwardAnalyzeWithBaseline(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
- int& actualLength, float& width, float& height, int& baseline);
+ int& actualLength, float& width, float& height, float& baseline);
virtual int ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength, int maxWidth,
int& cursorIndex, TextElementType& type);
virtual int ForwardAnalyzeWithFocusedObjectType(int textIndex, int textLength, float maxWidth,
int& cursorIndex, TextElementType& type);
- virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
- const TextObjectActionType action);
-
virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
const TextObjectActionType action);
- virtual result GetRegion(int textIndex, int textLength, int& width, int& height) const;
-
virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const;
- virtual int GetHeight(int textIndex) const;
-
virtual float GetHeightF(int textIndex) const;
virtual int GetTextLength(void) const;
- virtual int Compose(Rectangle& rect, TextColumn* pTextColumn);
-
virtual int Compose(FloatRectangle& rect, TextColumn* pTextColumn);
result DrawWithBaseline(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment alignment,
result RemoveAllElements(bool deallocate = true);
- result DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const Rectangle& displayRect, const TextObjectAlignment align, const TextObjectActionType action);
-
result DrawLine(_CanvasImpl& canvasImpl, TextLine* pTextLine, const FloatRectangle& displayRect, const TextObjectAlignment align, const TextObjectActionType action);
- result DrawPartial(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength);
-
result DrawPartial(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength);
- result DrawAbbrev(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment align);
-
result DrawAbbrev(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment align);
result GetText(TextComposite* pTargetCompsiteText, int textIndex, int textLength);
result SetWorkWidth(Font* pFont, wchar_t* pText, int workStart, int textLength);
- int GetWorkWidth(void);
+ float GetWorkWidth(void);
void SetTextSweepInfo(TextObjectSweepInfo* pTextSweepInfo);
result GetTextExtentList(TextLine* pTextLine) const;
- Tizen::Base::String GetDisplayableText(Rectangle displayRect, TextObjectActionType action);
-
Tizen::Base::String GetDisplayableText(FloatRectangle displayRect, TextObjectActionType action);
private:
- int ComposeInNoneWrap(Rectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo = null);
-
int ComposeInNoneWrap(FloatRectangle& rect, NoneWrapComposeInfo* pNoneWrapComposeInfo = null);
- int ComposeInNormalWrap(Rectangle& rect);
-
int ComposeInNormalWrap(FloatRectangle& rect);
- int ComposeInWordWrap(Rectangle& rect);
-
int ComposeInWordWrap(FloatRectangle& rect);
- int ComposeInWrap(Rectangle& rect);
-
int ComposeInWrap(FloatRectangle& rect);
- int ComposeInWrapByTextWidth(Rectangle& rect);
-
int ComposeInWrapByTextWidth(FloatRectangle& rect);
- int ComposeInNoneWrapMiddleEllipsis(Rectangle& rect);
-
int ComposeInNoneWrapMiddleEllipsis(FloatRectangle& rect);
- int ComposeInNoneWrapHeadEllipsis(Rectangle& rect);
-
int ComposeInNoneWrapHeadEllipsis(FloatRectangle& rect);
- int ComposeInPartialMode(Rectangle& rect);
-
int ComposeInPartialMode(FloatRectangle& rect);
- bool BackwardAnalyze(int startTextIndex, int maxWidth, int* actualLength, int* width, int* height);
-
bool BackwardAnalyze(int startTextIndex, float maxWidth, int* actualLength, float* width, float* height);
- result DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment alignment);
-
result DrawAbbrevInMiddleEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignment);
- result DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const Rectangle& displayRect, const TextObjectAlignment alignmen);
-
result DrawAbbrevInHeadEllipsis(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, const TextObjectAlignment alignmen);
result SetValueToAllTextElements(TextComponentInfoValueType type, unsigned int value);
int GetFirstTextIndexAt(int elementIndex) const;
- result DrawBlock(_CanvasImpl& canvasImpl, const Rectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment align, const TextObjectActionType action);
-
result DrawBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment align, const TextObjectActionType action);
- result DrawBackgroundBlock(_CanvasImpl& canvasImpl, const Rectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment align, const TextObjectActionType action);
-
result DrawBackgroundBlock(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment align, const TextObjectActionType action);
bool __displayBlock;
int __workStart;
int __workLength;
- int __workWidth;
+ float __workWidth;
int __cursorIndex;
bool __ignoreRearBlank;
bool __ignoreFrontBlank;
TextObjectSpaceHideType __rearSpaceHideMode;
TextObjectSpaceHideType __frontSpaceHideMode;
- int __lineSpacing;
+ float __lineSpacing;
TextObjectAlignment __elementVertialAlignment;
TextColumn* __pCurrentTextColumn;
TextSimple* __pAbbrevTextElement;
bool __partialComposingModeEnabled;
int __lineIndexCompositeDone;
- int __totalComposedHeight;
- int __composePartialLimitHeight;
+ float __totalComposedHeight;
+ float __composePartialLimitHeight;
TextCutLinkListInfo* __pCutLinkListInfo;
TextObjectEllipsisType __TextObjectEllipsisType;
bool __drawAbbrevText;
bool __drawTextEllipsis;
int __middleEllipsisTextLengthInHead;
- int __middleEllipsisHeadWidth;
- int __middleEllipsisWidth;
+ float __middleEllipsisHeadWidth;
+ float __middleEllipsisWidth;
int __middleEllipsisTextLengthInTail;
- int __headEllipsisWidth;
+ float __headEllipsisWidth;
int __headEllipsisTextLength;
TextWidthManager* __pTextWidthManager;
bool __widthManagerEnabled;
return E_SYSTEM;
}
-result
-TextElement::GetBlockRegion(int textIndex, int textLength, int& width, int& height) const
-{
- return E_SYSTEM;
-}
-
-result
-TextElement::GetBlockRegion(int textIndex, int textLength, float& width, float& height) const
-{
- return E_SYSTEM;
-}
-
int
TextElement::GetHeight(void) const
{
{
return -1;
}
+
+float
+TextElement::GetBaselineF(void) const
+{
+ return -1;
+}
+
void
TextElement::SetForegroundColor(const Color& color)
{
#include "FGrp_TextCommon.h"
#include "FGrp_TextTextElement.h"
#include "FGrp_TextTextImage.h"
-#include "../FGrp_BitmapUtil.h"
-#include "../FGrp_Canvas.h"
#include "FGrp_CoordinateSystemUtils.h"
namespace Tizen { namespace Graphics
namespace _Text
{
-TextImage::TextImage(Bitmap& bitmap, TextElementSourceType sourceType, Rectangle* pRect, TextObjectAlignment align)
+TextImage::TextImage(Bitmap& bitmap, TextElementSourceType sourceType, TextObjectAlignment align)
: TextElement()
{
result r = E_SUCCESS;
__pBitmap = &bitmap;
}
- if (pRect == null)
- {
- __rect.x = 0;
- __rect.y = 0;
- __rect.width = __pBitmap->GetWidth();
- __rect.height = __pBitmap->GetHeight();
- }
- else
- {
- __rect = *pRect;
- }
+ __rect.x = 0;
+ __rect.y = 0;
+ __rect.width = __pBitmap->GetWidthF();
+ __rect.height = __pBitmap->GetHeightF();
+
return;
CATCH:
}
int
-TextImage::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength,
- int& width, int& height)
+TextImage::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
+ int& actualLength, float& width, float& height)
{
- SysTryReturn(NID_GRP
- , 0 <= startTextIndex && startTextIndex < _length
+ SysTryReturn(NID_GRP, 0 <= startTextIndex && startTextIndex < _length
, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- SysTryReturn(NID_GRP
- , textLength <= _length
+ SysTryReturn(NID_GRP, textLength <= _length
, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
actualLength = 0;
return TEXT_RETBY_NORMAL;
}
-int
-TextImage::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
- int& actualLength, float& width, float& height)
-{
- int iMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth);
- int iWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int iHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- int r = ForwardAnalyze(startTextIndex, textLength, iMaxWidth, wrap, actualLength, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
- return r;
-}
-
result
-TextImage::GetRegion(int textIndex, int textLength, int& width, int& height) const
+TextImage::GetRegion(int textIndex, int textLength, float& width, float& height) const
{
- SysTryReturn(NID_GRP
- , 0 <= textIndex && textIndex < _length
+ SysTryReturn(NID_GRP, 0 <= textIndex && textIndex < _length
, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- SysTryReturn(NID_GRP
- , textLength <= _length
+ SysTryReturn(NID_GRP, textLength <= _length
, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
if (textLength == 0)
return E_SUCCESS;
}
-result
-TextImage::GetRegion(int textIndex, int textLength, float& width, float& height) const
-{
- int iWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int iHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- result r = GetRegion(textIndex, textLength, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
- return r;
-}
-
-result
-TextImage::GetBlockRegion(int textIndex, int textLength, int& width, int& height) const
-{
- return GetRegion(textIndex, textLength, width, height);
-}
-
-result
-TextImage::GetBlockRegion(int textIndex, int textLength, float& width, float& height) const
-{
- int iWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int iHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- result r = GetBlockRegion(textIndex, textLength, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
- return r;
-}
-
int
TextImage::GetHeight(void) const
{
- return __rect.height;
+ return _CoordinateSystemUtils::ConvertToInteger(GetHeightF());
}
float
TextImage::GetHeightF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetHeight());
+ return __rect.height;
}
result
-TextImage::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align, const TextObjectActionType action)
+TextImage::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
+ const TextObjectAlignment align, const TextObjectActionType action)
{
- SysTryReturn(NID_GRP
- , __pBitmap
- , E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
+ SysTryReturn(NID_GRP, __pBitmap, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
result r = E_SUCCESS;
if (textLength == 0)
return E_SUCCESS;
}
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP
- , pCanvas
- , E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance.");
-
-
- Rectangle bitmapRect = displayRect;
+ FloatRectangle bitmapRect = displayRect;
if (bitmapRect.width <= 0)
{
break;
}
- r = pCanvas->DrawBitmap(bitmapRect, *_GetBitmapEx(*_BitmapImpl::GetInstance(*__pBitmap)));
- SysTryReturn(NID_GRP
- , r == E_SUCCESS
- , r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = canvasImpl.DrawBitmap(bitmapRect, *_BitmapImpl::GetInstance(*__pBitmap));
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
if (_hasFocus)
{
- r = pCanvas->DrawRectangle(_Util::Convert<Rectangle, _Util::Rectangle<double> >(bitmapRect));
- SysTryReturn(NID_GRP
- , r == E_SUCCESS
- , r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = canvasImpl.DrawRectangle(bitmapRect);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
return E_SUCCESS;
}
-result
-TextImage::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment align, const TextObjectActionType action)
-{
- Rectangle iDisplayRect;
- iDisplayRect.x = _CoordinateSystemUtils::ConvertToInteger(displayRect.x);
- iDisplayRect.y = _CoordinateSystemUtils::ConvertToInteger(displayRect.y);
- iDisplayRect.width = _CoordinateSystemUtils::ConvertToInteger(displayRect.width);
- iDisplayRect.height = _CoordinateSystemUtils::ConvertToInteger(displayRect.height);
-
- return Draw(canvasImpl, iDisplayRect, startTextIndex, textLength, align, action);
-}
-
TextElement*
TextImage::CloneN(TextComponentInfoValueType type, unsigned int value)
{
TextImage* pImageText = null;
- pImageText = new (std::nothrow) TextImage(*__pBitmap, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, &__rect, __align);
+ pImageText = new (std::nothrow) TextImage(*__pBitmap, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, __align);
SysTryReturn(NID_GRP
, pImageText
, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
textLength = 1;
}
- TextImage* pImageText = null;
-
- pImageText = new (std::nothrow) TextImage(*__pBitmap, _sourceType, &__rect, __align);
- SysTryReturn(NID_GRP
- , pImageText
- , null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
+ TextImage* pImageText = new (std::nothrow) TextImage(*__pBitmap, _sourceType, __align);
+ SysTryReturn(NID_GRP, pImageText, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
return pImageText;
}
result
TextImage::SetBounds(const Rectangle& rect)
{
- __rect = rect;
- __rect.x = 0;
- __rect.y = 0;
-
- return E_SUCCESS;
+ return SetBounds(_CoordinateSystemUtils::ConvertToFloat(rect));
}
result
TextImage::SetBounds(const FloatRectangle& rect)
{
- const Rectangle iRect = _CoordinateSystemUtils::ConvertToInteger(rect);
- return SetBounds(iRect);
+ __rect = rect;
+ __rect.x = 0;
+ __rect.y = 0;
+
+ return E_SUCCESS;
}
result
Rectangle
TextImage::GetBounds(void) const
{
- return __rect;
+ return _CoordinateSystemUtils::ConvertToInteger(GetBoundsF());
}
FloatRectangle
TextImage::GetBoundsF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetBounds());
+ return __rect;
}
TextObjectAlignment
return 0;
}
+float
+TextImage::GetBaselineF(void) const
+{
+ return 0;
+}
+
}}} // Tizen::Graphics::_Text
result
TextLine::GetRegion(int textIndex, int textLength, int& width, int& height) const
{
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+
+ result r = GetRegion(textIndex, textLength, widthF, heightF);
+
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+
+ return r;
+}
+
+result
+TextLine::GetRegion(int textIndex, int textLength, float& width, float& height) const
+{
if (textIndex != 0 || textLength != __textLength)
{
return __pCompositeText->GetRegion(textIndex + __textOffset, textIndex + textLength + __textOffset, width, height);
-
}
width = __width;
return E_SUCCESS;
}
-result
-TextLine::GetRegion(int textIndex, int textLength, float& width, float& height) const
-{
- int iWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int iHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- result r = GetRegion(textIndex, textLength, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
- return r;
-}
-
-int
-TextLine::GetHeight(int textIndex) const
+float
+TextLine::GetHeightF(int textIndex) const
{
if (textIndex == -1)
{
}
else if (textIndex >= 0 && textIndex < __textLength)
{
- return __pCompositeText->GetHeight(textIndex + __textOffset);
+ return __pCompositeText->GetHeightF(textIndex + __textOffset);
}
else
{
}
}
-float
-TextLine::GetHeightF(int textIndex) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetHeight(textIndex));
-}
-
-result
-TextLine::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength, const TextObjectAlignment align,
- const TextObjectActionType action)
-{
- SysTryReturn(NID_GRP
- , startTextIndex == 0 && textLength == __textLength && __pCompositeText != null
- , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
-
- return __pCompositeText->DrawLine(canvasImpl, this, displayRect, align, action);
-}
-
result
TextLine::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment align, const TextObjectActionType action)
{
- SysTryReturn(NID_GRP
- , startTextIndex == 0 && textLength == __textLength && __pCompositeText != null
+ SysTryReturn(NID_GRP, startTextIndex == 0 && textLength == __textLength && __pCompositeText != null
, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- Rectangle iDisplayRect;
- iDisplayRect.x = _CoordinateSystemUtils::ConvertToInteger(displayRect.x);
- iDisplayRect.y = _CoordinateSystemUtils::ConvertToInteger(displayRect.y);
- iDisplayRect.width = _CoordinateSystemUtils::ConvertToInteger(displayRect.width);
- iDisplayRect.height = _CoordinateSystemUtils::ConvertToInteger(displayRect.height);
-
- return Draw(canvasImpl, iDisplayRect, startTextIndex, textLength, align, action);
+ return __pCompositeText->DrawLine(canvasImpl, this, displayRect, align, action);
}
result
-TextLine::DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, Rectangle& displayRect)
+TextLine::DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, FloatRectangle& displayRect)
{
- SysTryReturn(NID_GRP
- , __pCompositeText != null
- , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ SysTryReturn(NID_GRP, __pCompositeText != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
int textIndexAtLine = GetTextOffset() + startTextIndex;
return __pCompositeText->DrawPartial(canvasImpl, displayRect, textIndexAtLine, textLength);
}
-result
-TextLine::DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, FloatRectangle& displayRect)
-{
- SysTryReturn(NID_GRP
- , __pCompositeText != null
- , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
-
- Rectangle iDisplayRect;
- iDisplayRect.x = _CoordinateSystemUtils::ConvertToInteger(displayRect.x);
- iDisplayRect.y = _CoordinateSystemUtils::ConvertToInteger(displayRect.y);
- iDisplayRect.width = _CoordinateSystemUtils::ConvertToInteger(displayRect.width);
- iDisplayRect.height = _CoordinateSystemUtils::ConvertToInteger(displayRect.height);
-
- return DrawPartial(canvasImpl, startTextIndex, textLength, iDisplayRect);
-}
-
TextLine*
TextLine::CopyN(void)
{
void
TextLine::SetRegion(int width, int height)
{
- __width = width;
- __height = height;
+ SetRegion(_CoordinateSystemUtils::ConvertToFloat(width), _CoordinateSystemUtils::ConvertToFloat(height));
return;
}
void
TextLine::SetRegion(float width, float height)
{
- SetRegion(_CoordinateSystemUtils::ConvertToInteger(width), _CoordinateSystemUtils::ConvertToInteger(height));
+ __width = width;
+ __height = height;
return;
}
void
TextLine::SetBaseline(int baseline)
{
+ __baseline = _CoordinateSystemUtils::ConvertToFloat(baseline);
+}
+
+void
+TextLine::SetBaseline(float baseline)
+{
__baseline = baseline;
}
int
TextLine::GetBaseline(void) const
{
- return __baseline;
+ return _CoordinateSystemUtils::ConvertToInteger(__baseline);
}
-int
-TextLine::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
- int& actualLength, int& width, int& height)
+float
+TextLine::GetBaselineF(void) const
{
- return -1;
+ return __baseline;
}
int
}
void
-TextLine::SetSweepIn(int sweepIn)
+TextLine::SetSweepIn(float sweepIn)
{
__sweepIn = sweepIn;
}
-int
+float
TextLine::GetSweepIn(void) const
{
return __sweepIn;
}
void
-TextLine::SetSweepOut(int sweepOut)
+TextLine::SetSweepOut(float sweepOut)
{
__sweepOut = sweepOut;
}
-int
+float
TextLine::GetSweepOut(void) const
{
return __sweepOut;
}
result
-TextLine::SetTextExtentList(LinkedListT<_Util::Pair<int, int>* >* pList)
+TextLine::SetTextExtentList(Collection::ArrayListT<_FloatPair>* pList)
{
if (__pExtentList)
{
return E_SUCCESS;
}
-LinkedListT<_Util::Pair<int, int>* >*
+Tizen::Base::Collection::ArrayListT<_FloatPair>*
TextLine::GetTextExtentList(void) const
{
return __pExtentList;
int
TextLine::GetTextIndexFromPosition(int pcX, bool cursorMode)
{
- SysTryReturn(NID_GRP, pcX >= 0
- , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
-
- SysTryReturn(NID_GRP, __pExtentList
- , -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
-
- _Util::Pair<int, int>* pPair = null;
- IEnumeratorT<_Util::Pair<int, int>* >* pEnum = __pExtentList->GetEnumeratorN();
- pEnum->MoveNext();
+ SysTryReturn(NID_GRP, pcX >= 0, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ SysTryReturn(NID_GRP, __pExtentList, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ int index = 0;
int textIndex = -1;
+ _FloatPair currentGap;
+ IEnumeratorT<_FloatPair >* pEnum = __pExtentList->GetEnumeratorN();
- for (int i = 0; i < __textLength; i++, pEnum->MoveNext())
+ while (pEnum->MoveNext() == E_SUCCESS)
{
- pEnum->GetCurrent(pPair);
- if (pPair)
+ pEnum->GetCurrent(currentGap);
+
+ if (currentGap.first <= pcX && pcX < currentGap.second)
{
- if (pPair->first <= pcX && pcX < pPair->second)
+ textIndex = index + __textOffset;
+
+ FriBidiChar text[1] = { __pCompositeText->GetCharacter(textIndex) };
+ FriBidiCharType type[1] = { 0 };
+ fribidi_get_bidi_types(text, 1, type);
+ bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
+
+ if (isRtl == true)
+ {
+ textIndex = (pcX - currentGap.first < currentGap.second - pcX) ? index + __textOffset + 1 : index + __textOffset;
+ }
+ else
{
- textIndex = i + __textOffset;
-
- FriBidiChar text[1] = { __pCompositeText->GetCharacter(textIndex) };
- FriBidiCharType type[1] = { 0 };
- fribidi_get_bidi_types(text, 1, type);
- bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
-
- if (isRtl == true)
- {
- textIndex = (pcX - pPair->first < pPair->second - pcX) ? i + __textOffset + 1 : i + __textOffset;
- }
- else
- {
- textIndex = (pcX - pPair->first < pPair->second - pcX) ? i + __textOffset : i + __textOffset + 1;
- }
-
- break;
+ textIndex = (pcX - currentGap.first < currentGap.second - pcX) ? index + __textOffset : index + __textOffset + 1;
}
+
+ break;
}
+
+ index++;
}
if (textIndex < 0)
Rectangle
TextLine::GetTextExtent(int textIndexFromLineOffset, int textLength) const
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetTextExtentF(textIndexFromLineOffset, textLength));
+}
+
+FloatRectangle
+TextLine::GetTextExtentF(int textIndexFromLineOffset, int textLength) const
+{
SysTryReturn(NID_GRP, 0 <= textIndexFromLineOffset && textLength <= __textLength
- , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ , FloatRectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
SysTryReturn(NID_GRP, __pExtentList
- , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ , FloatRectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- _Util::Pair<int, int>* pPair = null;
- Rectangle extent;
- IEnumeratorT<_Util::Pair<int, int>* >* pEnum = __pExtentList->GetEnumeratorN();
+ FloatRectangle extent;
+ _FloatPair currentGap;
+ IEnumeratorT<_FloatPair >* pEnum = __pExtentList->GetEnumeratorN();
if (textIndexFromLineOffset == __textLength)
{
pEnum->MoveNext();
}
- pEnum->GetCurrent(pPair);
- if (pPair)
- {
- FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1) };
- FriBidiCharType type[1] = { 0 };
- fribidi_get_bidi_types(text, 1, type);
- bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
+ pEnum->GetCurrent(currentGap);
- extent.x = (isRtl == true) ? pPair->first : pPair->second;
- extent.width = 0;
- }
+ FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1) };
+ FriBidiCharType type[1] = { 0 };
+ fribidi_get_bidi_types(text, 1, type);
+ bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
+
+ extent.x = (isRtl == true) ? currentGap.first : currentGap.second;
+ extent.width = 0;
}
else if (textIndexFromLineOffset == 0)
{
pEnum->MoveNext();
- pEnum->GetCurrent(pPair);
- if (pPair)
- {
- FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset) };
- FriBidiCharType type[1] = { 0 };
- fribidi_get_bidi_types(text, 1, type);
- bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
+ pEnum->GetCurrent(currentGap);
- extent.x = (isRtl == true) ? pPair->second : pPair->first;
- extent.width = 0;
- }
+ FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset) };
+ FriBidiCharType type[1] = { 0 };
+ fribidi_get_bidi_types(text, 1, type);
+ bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
+
+ extent.x = (isRtl == true) ? currentGap.second : currentGap.first;
+ extent.width = 0;
for (int i = 0; i < textLength; i++)
{
- pEnum->GetCurrent(pPair);
- if (pPair)
- {
- extent.width += pPair->second - pPair->first;
- }
+ pEnum->GetCurrent(currentGap);
+ extent.width += currentGap.second - currentGap.first;
+
pEnum->MoveNext();
}
}
else
{
- int prevLeft = 0;
- int prevRight = 0;
+ float prevLeft = 0;
+ float prevRight = 0;
FriBidiChar text[2] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1), __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset)};
FriBidiCharType type[2] = { 0, 0 };
fribidi_get_bidi_types(text, 2, type);
pEnum->MoveNext();
}
- pEnum->GetCurrent(pPair);
- if (pPair)
- {
- prevLeft = pPair->first;
- prevRight = pPair->second;
- }
+ pEnum->GetCurrent(currentGap);
+ prevLeft = currentGap.first;
+ prevRight = currentGap.second;
pEnum->MoveNext();
- pEnum->GetCurrent(pPair);
+ pEnum->GetCurrent(currentGap);
- if (pPair)
+ if (isRtl[0] && isRtl[1]) // R + R
{
- if (isRtl[0] && isRtl[1]) // R + R
- {
- extent.x = prevLeft;
- }
- else if (isRtl[0] && !isRtl[1]) // R + L
- {
- extent.x = prevLeft;
- }
- else if (!isRtl[0] && !isRtl[1]) // L + L
- {
- extent.x = pPair->first;
- }
- else if (!isRtl[0] && isRtl[1]) // L + R
- {
- extent.x = prevRight;
- }
+ extent.x = prevLeft;
+ }
+ else if (isRtl[0] && !isRtl[1]) // R + L
+ {
+ extent.x = prevLeft;
+ }
+ else if (!isRtl[0] && !isRtl[1]) // L + L
+ {
+ extent.x = currentGap.first;
+ }
+ else if (!isRtl[0] && isRtl[1]) // L + R
+ {
+ extent.x = prevRight;
}
extent.width = 0;
for (int i = 0; i < textLength; i++)
{
- pEnum->GetCurrent(pPair);
- if (pPair)
- {
- extent.width += pPair->second - pPair->first;
- }
+ pEnum->GetCurrent(currentGap);
+ extent.width += currentGap.second - currentGap.first;
pEnum->MoveNext();
}
return extent;
}
-FloatRectangle
-TextLine::GetTextExtentF(int textIndexFromLineOffset, int textLength) const
+Rectangle
+TextLine::GetBlockTextExtent(int textIndexFromLineOffset, int textLength) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetTextExtent(textIndexFromLineOffset, textLength));
+ return _CoordinateSystemUtils::ConvertToInteger(GetBlockTextExtentF(textIndexFromLineOffset, textLength));
}
-Rectangle
-TextLine::GetBlockTextExtent(int textIndexFromLineOffset, int textLength) const
+FloatRectangle
+TextLine::GetBlockTextExtentF(int textIndexFromLineOffset, int textLength) const
{
SysTryReturn(NID_GRP, 0 <= textIndexFromLineOffset && textLength <= __textLength
- , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ , FloatRectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
SysTryReturn(NID_GRP, __pExtentList
- , Rectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ , FloatRectangle(-1, -1, -1, -1), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- _Util::Pair<int, int>* pPair = null;
- Rectangle extent;
- IEnumeratorT<_Util::Pair<int, int>* >* pEnum = __pExtentList->GetEnumeratorN();
+ FloatRectangle extent;
+ _FloatPair currentGap;
+ IEnumeratorT<_FloatPair >* pEnum = __pExtentList->GetEnumeratorN();
if (textIndexFromLineOffset == __textLength)
{
pEnum->MoveNext();
}
- pEnum->GetCurrent(pPair);
- if (pPair)
+ pEnum->GetCurrent(currentGap);
+ if (__endType == TEXT_RETBY_LINEFEED)
{
- if (__endType == TEXT_RETBY_LINEFEED)
- {
- extent.x = pPair->first + 10;
- extent.width = 0;
- }
- else
- {
- FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1) };
- FriBidiCharType type[1] = { 0 };
- fribidi_get_bidi_types(text, 1, type);
- bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
-
- extent.x = (isRtl == true) ? pPair->first : pPair->second;
- extent.width = 0;
- }
+ extent.x = currentGap.first + 10;
+ extent.width = 0;
}
- }
- else if (textIndexFromLineOffset == 0)
- {
- pEnum->MoveNext();
- pEnum->GetCurrent(pPair);
- if (pPair)
+ else
{
- FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset) };
+ FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1) };
FriBidiCharType type[1] = { 0 };
fribidi_get_bidi_types(text, 1, type);
bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
- extent.x = (isRtl == true) ? pPair->second : pPair->first;
+ extent.x = (isRtl == true) ? currentGap.first : currentGap.second;
extent.width = 0;
}
+ }
+ else if (textIndexFromLineOffset == 0)
+ {
+ pEnum->MoveNext();
+ pEnum->GetCurrent(currentGap);
+
+ FriBidiChar text[1] = { __pCompositeText->GetCharacter(__textOffset) };
+ FriBidiCharType type[1] = { 0 };
+ fribidi_get_bidi_types(text, 1, type);
+ bool isRtl = (type[0] & FRIBIDI_MASK_RTL) > 0;
+
+ extent.x = (isRtl == true) ? currentGap.second : currentGap.first;
+ extent.width = 0;
for (int i = 0; i < textLength; i++)
{
- pEnum->GetCurrent(pPair);
- if (pPair)
- {
- extent.width += pPair->second - pPair->first;
- }
+ pEnum->GetCurrent(currentGap);
+ extent.width += currentGap.second - currentGap.first;
+
pEnum->MoveNext();
}
}
else
{
+ float prevLeft = 0;
+ float prevRight = 0;
+ FriBidiChar text[2] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1), __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset)};
+ FriBidiCharType type[2] = { 0, 0 };
+ fribidi_get_bidi_types(text, 2, type);
+ bool isRtl[2] = {(type[0] & FRIBIDI_MASK_RTL) > 0, (type[1] & FRIBIDI_MASK_RTL) > 0};
+
+ for (int i = 0; i < textIndexFromLineOffset; i++)
{
- int prevLeft = 0;
- int prevRight = 0;
- FriBidiChar text[2] = { __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset - 1), __pCompositeText->GetCharacter(__textOffset + textIndexFromLineOffset)};
- FriBidiCharType type[2] = { 0, 0 };
- fribidi_get_bidi_types(text, 2, type);
- bool isRtl[2] = {(type[0] & FRIBIDI_MASK_RTL) > 0, (type[1] & FRIBIDI_MASK_RTL) > 0};
-
- for (int i = 0; i < textIndexFromLineOffset; i++)
- {
- pEnum->MoveNext();
- }
+ pEnum->MoveNext();
+ }
- pEnum->GetCurrent(pPair);
- if (pPair)
- {
- prevLeft = pPair->first;
- prevRight = pPair->second;
- }
+ pEnum->GetCurrent(currentGap);
- pEnum->MoveNext();
- pEnum->GetCurrent(pPair);
+ prevLeft = currentGap.first;
+ prevRight = currentGap.second;
- if (pPair)
- {
- if (isRtl[0] && isRtl[1]) // R + R
- {
- extent.x = prevLeft;
- }
- else if (isRtl[0] && !isRtl[1]) // R + L
- {
- extent.x = pPair->first;
- }
- else if (!isRtl[0] && !isRtl[1]) // L + L
- {
- extent.x = pPair->first;
- }
- else if (!isRtl[0] && isRtl[1]) // L + R
- {
- extent.x = prevRight;
- }
- }
+ pEnum->MoveNext();
+ pEnum->GetCurrent(currentGap);
- extent.width = 0;
+ if (isRtl[0] && isRtl[1]) // R + R
+ {
+ extent.x = prevLeft;
+ }
+ else if (isRtl[0] && !isRtl[1]) // R + L
+ {
+ extent.x = currentGap.first;
+ }
+ else if (!isRtl[0] && !isRtl[1]) // L + L
+ {
+ extent.x = currentGap.first;
+ }
+ else if (!isRtl[0] && isRtl[1]) // L + R
+ {
+ extent.x = prevRight;
+ }
- for (int i = 0; i < textLength; i++)
- {
- pEnum->GetCurrent(pPair);
- if (pPair)
- {
- extent.width += pPair->second - pPair->first;
- }
+ extent.width = 0;
- pEnum->MoveNext();
- }
+ for (int i = 0; i < textLength; i++)
+ {
+ pEnum->GetCurrent(currentGap);
+ extent.width += currentGap.second - currentGap.first;
+
+ pEnum->MoveNext();
}
}
return extent;
}
-FloatRectangle
-TextLine::GetBlockTextExtentF(int textIndexFromLineOffset, int textLength) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetBlockTextExtent(textIndexFromLineOffset, textLength));
-}
-
}}} // Tizen::Graphics::_Text
#include <FBaseColLinkedListT.h>
#include "FGrp_TextCommon.h"
-#include "../FGrp_Font.h"
+#include "FGrp_FontImpl.h"
namespace Tizen { namespace Graphics
{
virtual ~TextLine(void);
public:
- virtual result Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment align, const TextObjectActionType action);
-
virtual result Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment align, const TextObjectActionType action);
- virtual result DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, Rectangle& displayRect);
-
virtual result DrawPartial(_CanvasImpl& canvasImpl, int startTextIndex, int textLength, FloatRectangle& displayRect);
- virtual int ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap,
- int& actualLength, int& width, int& height);
-
virtual int ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
int& actualLength, float& width, float& height);
virtual result GetRegion(int textIndex, int textLength, float& width, float& height) const;
- virtual int GetHeight(int textIndex) const;
-
virtual float GetHeightF(int textIndex) const;
virtual int GetTextLength(void) const;
void SetBaseline(int baseline);
+ void SetBaseline(float baseline);
+
int GetBaseline(void) const;
+ float GetBaselineF(void) const;
+
result ResetSweepInfo(void);
void SetSweepComposeInfo(TextObjectSweepComposeLineInfo& textSweepComposeLineInfo);
TextObjectSweepComposeLineInfo GetSweepComposeInfo(void) const;
- void SetSweepIn(int sweepIn);
+ void SetSweepIn(float sweepIn);
- int GetSweepIn(void) const;
+ float GetSweepIn(void) const;
- void SetSweepOut(int sweepOut);
+ void SetSweepOut(float sweepOut);
- int GetSweepOut(void) const;
+ float GetSweepOut(void) const;
void SetKeyInputResult(int keyInputResult);
int GetKeyInputLength(void);
- result SetTextExtentList(Tizen::Base::Collection::LinkedListT<_Util::Pair<int, int>* >* pList);
+ result SetTextExtentList(Tizen::Base::Collection::ArrayListT<_FloatPair>* pList);
- Tizen::Base::Collection::LinkedListT<_Util::Pair<int, int>* >* GetTextExtentList(void) const;
+ Tizen::Base::Collection::ArrayListT<_FloatPair>* GetTextExtentList(void) const;
int GetTextIndexFromPosition(int pcX, bool cursorMode = true);
int __index;
int __textOffset;
int __textLength;
- int __width;
- int __height;
- int __baseline;
+ float __width;
+ float __height;
+ float __baseline;
TextObjectSweepComposeLineInfo __sweepComposeLineInfo;
- int __sweepIn;
- int __sweepOut;
+ float __sweepIn;
+ float __sweepOut;
int __sweepType;
bool __isKeyInputChanged;
int __keyInputTextIndex;
int __keyInputTextLength;
- Tizen::Base::Collection::LinkedListT<_Util::Pair<int, int>* >* __pExtentList;
+ Tizen::Base::Collection::ArrayListT<_FloatPair>* __pExtentList;
private:
TextLine(const TextLine& other); // NOT IMPLMENTED
*/
#include <new>
-#include <math.h>
#include <FGrpBitmap.h>
#include <FBaseSysLog.h>
#include "FGrp_FontImpl.h"
-#include "../FGrp_Font.h"
-#include "../FGrp_Canvas.h"
+#include "FGrp_CanvasImpl.h"
#include "../FGrp_ResUtil.h"
#include "FGrp_TextTextObject.h"
#include "FGrp_TextTextElement.h"
namespace _Text
{
-namespace // unnamed
-{
- const long long MAX_INT = 0x7FFFFFFF;
- const long long MIN_INT = -MAX_INT - 1;
-}
-
-inline int
-ToVirCoord(const int& sour)
-{
- int logicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetLogicalResolutionInt();
- Dimension physicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetPhysicalResolutionDim();
-
- long long tempSrc = sour;
-
- if (logicalResolution == 720 && physicalResolution.width == 480)
- {
- if (tempSrc >= 0)
- {
- tempSrc = tempSrc * 3 / 2;
-
- return (tempSrc > MAX_INT) ? MAX_INT : int(tempSrc);
- }
- else
- {
- tempSrc = (tempSrc * 3 - 1) / 2;
-
- return (tempSrc < MIN_INT) ? MIN_INT : int(tempSrc);
- }
- }
- else if (logicalResolution == 480 && physicalResolution.width == 720)
- {
-
- if (tempSrc > 0)
- {
- tempSrc = (tempSrc + 1) * 2 / 3;
-
- return (tempSrc > MAX_INT) ? MAX_INT : int(tempSrc);
- }
- else
- {
- tempSrc = tempSrc * 2 / 3;
-
- return (tempSrc < MIN_INT) ? MIN_INT : int(tempSrc);
- }
- }
- else
- {
- return _ResUtil::ConvertToVirCoord(sour);
- }
-}
-
-inline int
-ConvertToVirCoord(const int& sour)
-{
- return _ResUtil::NeedToConvertCoord() ? ToVirCoord(sour) : sour;
-}
-
-inline int
-ToPhyCoord(const int& sour)
-{
- int logicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetLogicalResolutionInt();
- Dimension physicalResolution = Tizen::Graphics::_CoordinateSystem::GetInstance()->GetPhysicalResolutionDim();
-
- long long tempSrc = sour;
-
- if (logicalResolution == 720 && physicalResolution.width == 480)
- {
- if (tempSrc > 0)
- {
- tempSrc = (tempSrc + 1) * 2 / 3;
-
- return (tempSrc > MAX_INT) ? MAX_INT : int(tempSrc);
- }
- else
- {
- tempSrc = tempSrc * 2 / 3;
-
- return (tempSrc < MIN_INT) ? MIN_INT : int(tempSrc);
- }
- }
- else if (logicalResolution == 480 && physicalResolution.width == 720)
- {
- if (tempSrc >= 0)
- {
- tempSrc = tempSrc * 3 / 2;
-
- return (tempSrc > MAX_INT) ? MAX_INT : int(tempSrc);
- }
- else
- {
- tempSrc = (tempSrc * 3 - 1) / 2;
-
- return (tempSrc < MIN_INT) ? MIN_INT : int(tempSrc);
- }
- }
- else
- {
- return _ResUtil::ConvertToPhyCoord(sour);
- }
-}
-
-inline int
-ConvertToPhyCoord(const int& sour)
-{
- return _ResUtil::NeedToConvertCoord() ? ToPhyCoord(sour) : sour;
-}
-
-inline int
-ConvertToPhyCoordWidth(const int& sour)
-{
- return _ResUtil::NeedToConvertCoord() ? ToPhyCoord(sour) : sour;
-}
-
-inline int
-ConvertToPhyCoordHeight(const int& sour)
-{
- return _ResUtil::NeedToConvertCoord() ? ToPhyCoord(sour) : sour;
-}
-
TextObject::TextObject(void)
{
__action = TEXT_OBJECT_ACTION_TYPE_NONE;
__rect.y = 0;
__rect.width = 0;
__rect.height = 0;
- __pcRect.x = 0;
- __pcRect.y = 0;
- __pcRect.width = 0;
- __pcRect.height = 0;
__slidingGap = 30;
__slidingStep = 2;
__pTextWidthManager = null;
__isAlternateLookEnabled = false;
__linkViewModeEnabled = false;
__pTextWidthManager = null;
- __rect = rect;
- __pcRect.x = _Text::ConvertToPhyCoord(rect.x);
- __pcRect.y = _Text::ConvertToPhyCoord(rect.y);
- __pcRect.width = _Text::ConvertToPhyCoordWidth(rect.width);
- __pcRect.height = _Text::ConvertToPhyCoordHeight(rect.height);
+ __rect = _CoordinateSystemUtils::ConvertToFloat(rect);
__pCompositeText = new (std::nothrow)TextComposite();
SysTryCatch(NID_GRP, __pCompositeText, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
__isAlternateLookEnabled = false;
__linkViewModeEnabled = false;
__pTextWidthManager = null;
- __rect = _CoordinateSystemUtils::ConvertToInteger(rect);
- __pcRect.x = _Text::ConvertToPhyCoord(rect.x);
- __pcRect.y = _Text::ConvertToPhyCoord(rect.y);
- __pcRect.width = _Text::ConvertToPhyCoordWidth(rect.width);
- __pcRect.height = _Text::ConvertToPhyCoordHeight(rect.height);
+ __rect = rect;
__pCompositeText = new (std::nothrow)TextComposite();
SysTryCatch(NID_GRP, __pCompositeText, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- if (__pcRect.width == 0 || __pcRect.height == 0)
+ if (__rect.width == 0 || __rect.height == 0)
{
return E_SUCCESS;
}
result r = E_SUCCESS;
TextLine* pTextLine = null;
- Rectangle clipRect;
- Rectangle lineBounds;
- Rectangle targetBounds;
- int totalHeight = 0;
- int slidingWidth = 0;
-
- SysTryReturn(NID_GRP, __pcRect.width > 0 && __pcRect.height > 0, E_INVALID_STATE, E_INVALID_STATE
- , "[E_INVALID_STATE] This instance is not constructed yet. (width = %d, height = %d)", __pcRect.width, __pcRect.height);
+ FloatRectangle clipRect;
+ FloatRectangle lineBounds;
+ FloatRectangle targetBounds;
+ float totalHeight = 0;
+ float slidingWidth = 0;
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP, pCanvas, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ SysTryReturn(NID_GRP, __rect.width > 0 && __rect.height > 0, E_INVALID_STATE, E_INVALID_STATE
+ , "[E_INVALID_STATE] This instance is not constructed yet. (width = %d, height = %d)", __rect.width, __rect.height);
r = Compose();
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pTextColumn->SetFirstDisplayPositionY(0);
}
- targetBounds = __pcRect;
+ targetBounds = __rect;
if (__action == TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT)
{
return E_SUCCESS;
}
- totalHeight = TextUtility::GetFontMaxHeight(__pDefaultFont);
+ totalHeight = TextUtility::GetFontMaxHeightF(__pDefaultFont);
}
else
{
- totalHeight = __pTextColumn->GetTotalHeight();
+ totalHeight = __pTextColumn->GetTotalHeightF();
}
if (totalHeight == 0)
}
else
{
- int lineHeight = __pTextColumn->GetLineHeightAt(0);
+ float lineHeight = __pTextColumn->GetLineHeightAtF(0);
if (targetBounds.height < lineHeight)
{
for (i = 0; i < lineCount; i++)
{
- lineHeight += __pTextColumn->GetLineHeightAt(i);
+ lineHeight += __pTextColumn->GetLineHeightAtF(i);
if (targetBounds.height < lineHeight)
{
- lineHeight -= __pTextColumn->GetLineHeightAt(i);
+ lineHeight -= __pTextColumn->GetLineHeightAtF(i);
break;
}
}
+
totalHeight = lineHeight;
}
}
}
CONTINUE_PROC:
- Rectangle finalClipRect;
- clipRect = pCanvas->GetClipBounds();
+ FloatRectangle finalClipRect;
+ clipRect = canvasImpl.GetClipBoundsF();
- finalClipRect.x = Math::Max(clipRect.x, targetBounds.x);
- finalClipRect.y = Math::Max(clipRect.y, targetBounds.y);
- finalClipRect.width = Math::Min(clipRect.x + clipRect.width, targetBounds.x + targetBounds.width) - finalClipRect.x;
- finalClipRect.height = Math::Min(clipRect.y + clipRect.height, targetBounds.y + targetBounds.height) - finalClipRect.y;
+ finalClipRect.x = (clipRect.x > targetBounds.x) ? clipRect.x : targetBounds.x; //Math::Max(clipRect.x, targetBounds.x);
+ finalClipRect.y = (clipRect.y > targetBounds.y) ? clipRect.y: targetBounds.y; //Math::Max(clipRect.y, targetBounds.y);
+ //finalClipRect.width = Math::Min(clipRect.x + clipRect.width, targetBounds.x + targetBounds.width) - finalClipRect.x;
+ finalClipRect.width = (clipRect.x + clipRect.width > targetBounds.x + targetBounds.width) ? clipRect.x + clipRect.width - finalClipRect.x : targetBounds.x + targetBounds.width - finalClipRect.x;
+ //finalClipRect.height = Math::Min(clipRect.y + clipRect.height, targetBounds.y + targetBounds.height) - finalClipRect.y;
+ finalClipRect.height = (clipRect.y + clipRect.height > targetBounds.y + targetBounds.height) ? clipRect.y + clipRect.height - finalClipRect.y : targetBounds.y + targetBounds.height - finalClipRect.y;
SysTryReturn(NID_GRP, 0 <= finalClipRect.width && 0 <= finalClipRect.height, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get clip rectangle.");
- pCanvas->SetClipBounds(finalClipRect);
+ canvasImpl.SetClipBounds(finalClipRect);
switch (__action)
{
pTextLine = __pTextColumn->GetTextLine(0);
SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
__pTextColumn->SetDisplayLineCount(1);
__pTextColumn->SetDisplayHeight(lineBounds.height);
- slidingWidth = Math::Max(__pTextColumn->GetSlidingDimension().width, __pcRect.width);
+ slidingWidth = (__pTextColumn->GetSlidingDimension().width > __rect.width) ? __pTextColumn->GetSlidingDimension().width : __rect.width;
if (__isActionOn)
{
- Rectangle slidingRect;
+ FloatRectangle slidingRect;
targetBounds.width = lineBounds.width;
targetBounds.height = lineBounds.height;
slidingRect = targetBounds;
- slidingRect.x += __pTextColumn->GetSlidingPosition();
- Dimension slidingDim = __pTextColumn->GetSlidingDimension();
+ slidingRect.x += __pTextColumn->GetSlidingPositionF();
+ FloatDimension slidingDim = __pTextColumn->GetSlidingDimensionF();
slidingRect.width = slidingDim.width;
slidingRect.height = slidingDim.height;
case TEXT_OBJECT_ACTION_TYPE_SLIDE_UP:
{
- Rectangle slidingRect = targetBounds;
+ FloatRectangle slidingRect = targetBounds;
slidingRect.y += __pTextColumn->GetSlidingPosition();
int lineCount = __pTextColumn->GetTotalLineCount();
pTextLine = __pTextColumn->GetTextLine(i);
if (pTextLine != null)
{
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
slidingRect.height = lineBounds.height;
if ((slidingRect.y + slidingRect.height >= targetBounds.y) && (slidingRect.y < targetBounds.y + targetBounds.height))
{
break;
}
- pCanvas->SetClipBounds(clipRect);
+ canvasImpl.SetClipBounds(clipRect);
return E_SUCCESS;
}
result r = E_SUCCESS;
TextLine* pTextLine = null;
- Rectangle lineBounds;
+ FloatRectangle lineBounds;
int firstDisplayY = __pTextColumn->GetFirstDisplayPositionY();
r = Compose();
return E_INVALID_ARG;
}
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
lineBounds.y = lineBounds.y - firstDisplayY + __rect.y;
int length = pTextLine->GetTextLength();
SysTryReturn(NID_GRP, __isActionOn, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] Action is off.");
- int slidingStartIndex = __pTextColumn->GetSlidingPosition();
- Dimension slidingDim = __pTextColumn->GetSlidingDimension();
+ float slidingStartIndex = __pTextColumn->GetSlidingPositionF();
+ FloatDimension slidingDim = __pTextColumn->GetSlidingDimensionF();
switch (__action)
{
case TEXT_OBJECT_ACTION_TYPE_SLIDE_LEFT:
- if (__pcRect.width < slidingDim.width)
+ if (__rect.width < slidingDim.width)
{
- slidingDim.width = Math::Max(slidingDim.width, __pcRect.width);
+ slidingDim.width = (slidingDim.width > __rect.width) ? slidingDim.width: __rect.width;//Math::Max(slidingDim.width, __rect.width);
if (__slidingStep < slidingStartIndex + slidingDim.width + __slidingGap)
{
}
else
{
- slidingStartIndex = __pcRect.width + __slidingGap + slidingStartIndex;
+ slidingStartIndex = __rect.width + __slidingGap + slidingStartIndex;
}
}
__pTextColumn->SetSlidingPosition(slidingStartIndex);
}
else
{
- slidingStartIndex = __pcRect.height;
+ slidingStartIndex = __rect.height;
}
__pTextColumn->SetSlidingPosition(slidingStartIndex);
break;
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- SysTryReturn(NID_GRP, __pcRect.width >= 0 && __pcRect.height >= 0, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
+ SysTryReturn(NID_GRP, __rect.width >= 0 && __rect.height >= 0, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
int lineCount = 0;
- Rectangle rect = __pcRect;
- Rectangle lineBounds;
+ FloatRectangle rect = __rect;
+ FloatRectangle lineBounds;
if (__pCompositeText->IsPartialComposingModeEnabled())
{
__isActionOn = true;
__pTextColumn->SetSlidingPosition(0);
- Dimension slidingDim;
- Dimension lineTextSize;
+ FloatDimension slidingDim;
+ FloatDimension lineTextSize;
__pCompositeText->GetRegion(0, totalLength, slidingDim.width, slidingDim.height);
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
__pTextColumn->SetSlidingDimension(slidingDim);
{
__pTextColumn->SetSlidingPosition(0);
- int totalHeight = __pTextColumn->GetTotalHeight();
- Dimension slidingDim;
- slidingDim.width = __pcRect.width;
+ float totalHeight = __pTextColumn->GetTotalHeightF();
+ FloatDimension slidingDim;
+ slidingDim.width = __rect.width;
slidingDim.height = totalHeight;
__pTextColumn->SetSlidingDimension(slidingDim);
- if (__pcRect.height < totalHeight)
+ if (__rect.height < totalHeight)
{
__isActionOn = true;
}
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
result r = E_SUCCESS;
- Rectangle lineBounds;
+ FloatRectangle lineBounds;
TextLine* pTextLine = null;
- int firstDisplayPositionY = 0;
- int rollbackFirstDisplayPositionY = 0;
+ float firstDisplayPositionY = 0;
+ float rollbackFirstDisplayPositionY = 0;
int rollbackFirstDisplayLineIndex = 0;
- rollbackFirstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY();
+ rollbackFirstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
rollbackFirstDisplayLineIndex = __pTextColumn->GetFirstDisplayLineIndex();
__pTextColumn->SetFirstDisplayLineIndex(lineIndex);
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryCatch(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text element.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
firstDisplayPositionY = lineBounds.y;
__pTextColumn->SetFirstDisplayPositionY(firstDisplayPositionY);
}
result
-TextObject::SetFirstDisplayPositionY(int lcY)
+TextObject::SetFirstDisplayPositionY(int y)
+{
+ return SetFirstDisplayPositionY(_CoordinateSystemUtils::ConvertToFloat(y));
+}
+
+result
+TextObject::SetFirstDisplayPositionY(float y)
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
result r = E_SUCCESS;
- int pcY = _Text::ConvertToPhyCoord(lcY);
if (IsPartialComposingModeEnabled())
{
__isFirstDisplayPositionYChanged = true;
- if (__pCompositeText->GetTotalComposedHeight() <= (pcY + __pcRect.height))
+ if (__pCompositeText->GetTotalComposedHeight() <= (y + __rect.height))
{
- __pCompositeText->SetComposePartialLimitHeight(pcY + __pcRect.height - GetTotalComposedHeight());
+ __pCompositeText->SetComposePartialLimitHeight(y + __rect.height - GetTotalComposedHeight());
r = Compose();
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
__isFirstDisplayPositionYChanged = false;
- __pTextColumn->SetFirstDisplayPositionY(pcY);
+ __pTextColumn->SetFirstDisplayPositionY(y);
return E_SUCCESS;
return r;
}
-result
-TextObject::SetFirstDisplayPositionY(float lcY)
-{
- return SetFirstDisplayPositionY(_CoordinateSystemUtils::ConvertToInteger(lcY));
-}
-
int
TextObject::GetMaxLineHeight(void) const
{
- IF_NOT_CONSTRUCTED(return -1);
-
- int pcMaxHeight = __pCompositeText->GetMaxLineHeight();
- pcMaxHeight = Math::Max(pcMaxHeight, TextUtility::GetFontMaxHeight(__pDefaultFont));
- int lcMaxHeight = _Text::ConvertToVirCoord(pcMaxHeight);
-
- return lcMaxHeight;
+ return _CoordinateSystemUtils::ConvertToInteger(GetMaxLineHeightF());
}
float
TextObject::GetMaxLineHeightF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetMaxLineHeight());
+ IF_NOT_CONSTRUCTED(return -1);
+
+ float lineMaxHeight = __pCompositeText->GetMaxLineHeightF();
+ float fontMaxHeight = TextUtility::GetFontMaxHeightF(__pDefaultFont);
+
+ return (lineMaxHeight > fontMaxHeight) ? lineMaxHeight: fontMaxHeight;
}
bool
{
IF_NOT_CONSTRUCTED(return false);
- int firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY();
+ float firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
bool isDisplayedAtStartPosition = (firstDisplayPositionY == 0) ? true : false;
{
IF_NOT_CONSTRUCTED(return false);
- int totalHeight = 0;
- int firstDisplayPositionY = 0;
+ float totalHeight = 0;
+ float firstDisplayPositionY = 0;
- firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY();
- totalHeight = __pTextColumn->GetTotalHeight();
+ firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
+ totalHeight = __pTextColumn->GetTotalHeightF();
- bool isDisplayedAtEndPosition = ((totalHeight - firstDisplayPositionY) <= __pcRect.height) ? true : false;
+ bool isDisplayedAtEndPosition = ((totalHeight - firstDisplayPositionY) <= __rect.height) ? true : false;
return isDisplayedAtEndPosition;
}
}
result
-TextObject::SetBounds(const Rectangle& lcRect)
+TextObject::SetBounds(const Rectangle& rect)
+{
+ return SetBounds(_CoordinateSystemUtils::ConvertToFloat(rect));
+}
+
+result
+TextObject::SetBounds(const FloatRectangle& rect)
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- SysTryReturn(NID_GRP, (lcRect.width >= 0) && (lcRect.height >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE
- , "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", lcRect.width, lcRect.height);
+ SysTryReturn(NID_GRP, (rect.width >= 0) && (rect.height >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE
+ , "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", rect.width, rect.height);
- if (__rect.width != lcRect.width)
+ if (__rect.width != rect.width)
{
UpdateChangedInfo(0, 0, false);
}
- __rect = lcRect;
-
- if (_ResUtil::NeedToConvertCoord())
- {
- __pcRect.x = _Text::ConvertToPhyCoord(__rect.x);
- __pcRect.y = _Text::ConvertToPhyCoord(__rect.y);
- __pcRect.width = _Text::ConvertToPhyCoordWidth(__rect.width);
-
- if (_Screen::GetWidth() == 600 || _Screen::GetWidth() == 1280 || _Screen::GetWidth() == 1920 || _Screen::GetWidth() == 2560)
- {
- __pcRect.width++;
- }
-
- __pcRect.height = _Text::ConvertToPhyCoordHeight(__rect.height);
- }
- else
- {
- __pcRect = __rect;
- }
+ __rect = rect;
return E_SUCCESS;
}
result
-TextObject::SetBounds(const FloatRectangle& lcRect)
+TextObject::SetLineSpace(int lineSpacing)
{
- return SetBounds(_CoordinateSystemUtils::ConvertToInteger(FloatRectangle(lcRect.x, lcRect.y, ceil(lcRect.width), ceil(lcRect.height))));
+ return SetLineSpace(_CoordinateSystemUtils::ConvertToFloat(lineSpacing));
}
result
-TextObject::SetLineSpace(int lcLineSpacing)
+TextObject::SetLineSpace(float lineSpacing)
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- SysTryReturn(NID_GRP, lcLineSpacing >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+ SysTryReturn(NID_GRP, lineSpacing >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. lineSpacing(%d)", lineSpacing);
- int pcLineSpacing = _Text::ConvertToPhyCoord(lcLineSpacing);
-
- if (__pCompositeText->GetLineSpace() != pcLineSpacing)
+ if (__pCompositeText->GetLineSpace() != lineSpacing)
{
- __pCompositeText->SetLineSpace(pcLineSpacing);
+ __pCompositeText->SetLineSpace(lineSpacing);
__isChanged = true;
}
- return E_SUCCESS;
+ return E_SUCCESS;
}
result
-TextObject::SetLineSpace(float lcLineSpacing)
-{
- return SetLineSpace(_CoordinateSystemUtils::ConvertToInteger(lcLineSpacing));
-}
-result
TextObject::SetElementVerticalAlignment(TextObjectAlignment alignment)
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
Dimension
TextObject::GetTextExtent(int startTextIndex, int textLength) const
{
- IF_NOT_CONSTRUCTED(return Dimension(-1, -1));
-
- Dimension pcTextSize;
- result r = __pCompositeText->GetRegion(startTextIndex, textLength, pcTextSize.width, pcTextSize.height);
- SysTryReturn(NID_GRP, r == E_SUCCESS, Dimension(-1, -1), r, "[%s] Propagating.", GetErrorMessage(r));
-
- Dimension lcTextSize;
- lcTextSize.width = _Text::ConvertToVirCoord(pcTextSize.width);
- lcTextSize.height = _Text::ConvertToVirCoord(pcTextSize.height);
- SetLastResult(E_SUCCESS);
-
- return lcTextSize;
+ return _CoordinateSystemUtils::ConvertToInteger(GetTextExtentF(startTextIndex,textLength));
}
FloatDimension
TextObject::GetTextExtentF(int startTextIndex, int textLength) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetTextExtent(startTextIndex,textLength));
+ IF_NOT_CONSTRUCTED(return FloatDimension(-1, -1));
+
+ FloatDimension textSize;
+ result r = __pCompositeText->GetRegion(startTextIndex, textLength, textSize.width, textSize.height);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, FloatDimension(-1, -1), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ SetLastResult(E_SUCCESS);
+
+ return textSize;
}
result
__pDefaultFont = pTmpFont;
__pCompositeText->SetRange(startTextIndex, textLength);
- r = __pCompositeText->SetFont(pFont);
+ r = __pCompositeText->SetFont(__pDefaultFont);
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
UpdateChangedInfo(__pCompositeText->GetWorkStart(), 0);
result
TextObject::SetDefaultFontSize(int size)
{
- IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
-
- _FontImpl::GetInstance(*__pDefaultFont)->SetSize(size);
-
- return E_SUCCESS;
+ return SetDefaultFontSize(_CoordinateSystemUtils::ConvertToFloat(size));
}
result
TextObject::SetDefaultFontSize(float size)
{
- return SetDefaultFontSize(_CoordinateSystemUtils::ConvertToInteger(size));
+ IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
+
+ _FontImpl::GetInstance(*__pDefaultFont)->SetSize(size);
+
+ return E_SUCCESS;
}
int
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- TextImage* pImageText = new (std::nothrow)TextImage(bitmap, sourceType, null, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP));
+ TextImage* pImageText = new (std::nothrow)TextImage(bitmap, sourceType, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP));
SysTryReturn(NID_GRP, pImageText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
int addedTextLength = pImageText->GetTextLength();
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
result r = E_SUCCESS;
- TextImage* pImageText = new (std::nothrow)TextImage(bitmap, sourceType, null, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP));
+ TextImage* pImageText = new (std::nothrow)TextImage(bitmap, sourceType, (TextObjectAlignment)(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_TOP));
SysTryReturn(NID_GRP, pImageText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
r = __pCompositeText->AppendElement(*pImageText);
}
int
-TextObject::GetTextIndexFromPosition(int lcX, int lcY, bool cursorMode) const
+TextObject::GetTextIndexFromPosition(int x, int y, bool cursorMode) const
+{
+ return GetTextIndexFromPosition(_CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y), cursorMode);
+}
+
+int
+TextObject::GetTextIndexFromPosition(float x, float y, bool cursorMode) const
{
IF_NOT_CONSTRUCTED(return -1);
return -1;
}
- int pcX = _Text::ConvertToPhyCoord(lcX);
- int pcY = _Text::ConvertToPhyCoord(lcY);
-
if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE)
{
- return GetTextIndexFromPositionInNoneWrap(pcX, pcY, !cursorMode);
+ return GetTextIndexFromPositionInNoneWrap(x, y, !cursorMode);
}
else
{
- return GetTextIndexFromPositionInWrap(pcX, pcY, !cursorMode);
- }
+ return GetTextIndexFromPositionInWrap(x, y, !cursorMode);
+ }
}
int
-TextObject::GetTextIndexFromPosition(float lcX, float lcY, bool cursorMode) const
+TextObject::GetTextIndexFromPositionAtLine(int lineIndex, int x, bool cursorMode) const
{
- return GetTextIndexFromPosition(_CoordinateSystemUtils::ConvertToInteger(lcX), _CoordinateSystemUtils::ConvertToInteger(lcY), cursorMode);
+ return GetTextIndexFromPositionAtLine(lineIndex, _CoordinateSystemUtils::ConvertToFloat(x), cursorMode);
}
int
-TextObject::GetTextIndexFromPositionAtLine(int lineIndex, int lcX, bool cursorMode) const
+TextObject::GetTextIndexFromPositionAtLine(int lineIndex, float x, bool cursorMode) const
{
IF_NOT_CONSTRUCTED(return -1);
TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- int pcX = _Text::ConvertToPhyCoord(lcX);
int lineOffset = pTextLine->GetTextOffset();
int lineLength = pTextLine->GetTextLength();
int length = 0;
TextElementType objectType;
- Rectangle lineBounds = pTextLine->GetBounds();
- Dimension lineTextSize;
+ FloatRectangle lineBounds = pTextLine->GetBoundsF();
+ FloatDimension lineTextSize;
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
switch (__align & TEXT_ALIGNMASK_HORIZ)
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- pcX -= (lineBounds.width - lineTextSize.width) / 2;
+ x -= (lineBounds.width - lineTextSize.width) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
- pcX -= (lineBounds.width - lineTextSize.width);
+ x -= (lineBounds.width - lineTextSize.width);
break;
}
- pcX = (pcX < 0) ? 0 : pcX;
+ x = (x < 0) ? 0 : x;
__pCompositeText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
int endType = 0;
if (cursorMode)
{
- __pCompositeText->ForwardAnalyzeWithFocusedObjectType(lineOffset, lineLength, pcX, length, objectType);
+ __pCompositeText->ForwardAnalyzeWithFocusedObjectType(lineOffset, lineLength, x, length, objectType);
}
else
{
- endType = __pCompositeText->ForwardAnalyzeInNoneCursorMode(lineOffset, lineLength, pcX, length);
- }
-
- __pCompositeText->SetWrap(__wrap);
-
- if (!cursorMode)
- {
- if (endType == -1)
- {
- return -1;
- }
- }
-
- int index = pTextLine->GetTextOffset() + length;
- if (pTextLine->GetEndType() == TEXT_RETBY_LINEFEED && lineLength == length && pTextLine->GetTextOffset() < index)
- {
- index--;
- }
-
- if (index != GetTextLength() && index == lineOffset + lineLength)
- {
- TextElement* pTextElement = GetElementAtTextIndex(index-1);
- if (pTextElement != null)
- {
- const TextSimple* pSimpleText = dynamic_cast <const TextSimple*>(pTextElement);
- if (pSimpleText != null)
- {
- const wchar_t* pText = pSimpleText->GetText();
- SysTryReturn(NID_GRP, pText, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text.");
-
- int i = index - 1 - pSimpleText->GetTextOffset();
- SysTryReturn(NID_GRP, i >= 0 && i < pSimpleText->GetTextLength(), -1, E_OUT_OF_RANGE
- , "[E_OUT_OF_RANGE] text index(%d) must greater than 0 and must be less than total string length(%d)",i, pSimpleText->GetTextLength());
-
- if (pText[i] == L' ')
- {
- index--;
- }
- }
- }
- }
-
- SetLastResult(E_SUCCESS);
-
- return index;
-}
-
-int
-TextObject::GetTextIndexFromPositionAtLine(int lineIndex, float lcX, bool cursorMode) const
-{
- IF_NOT_CONSTRUCTED(return -1);
-
- SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex);
-
- TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex);
- SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
-
- lcX = _CoordinateSystemUtils::ConvertToInteger(lcX);
- int pcX = _Text::ConvertToPhyCoord(lcX);
- int lineOffset = pTextLine->GetTextOffset();
- int lineLength = pTextLine->GetTextLength();
- int length = 0;
- TextElementType objectType;
- Rectangle lineBounds = pTextLine->GetBounds();
- Dimension lineTextSize;
- pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
-
- switch (__align & TEXT_ALIGNMASK_HORIZ)
- {
- case TEXT_OBJECT_ALIGNMENT_LEFT:
- break;
-
- case TEXT_OBJECT_ALIGNMENT_CENTER:
- pcX -= (lineBounds.width - lineTextSize.width) / 2;
- break;
-
- case TEXT_OBJECT_ALIGNMENT_RIGHT:
- pcX -= (lineBounds.width - lineTextSize.width);
- break;
- }
-
- pcX = (pcX < 0) ? 0 : pcX;
- __pCompositeText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
-
- int endType = 0;
-
- if (cursorMode)
- {
- __pCompositeText->ForwardAnalyzeWithFocusedObjectType(lineOffset, lineLength, pcX, length, objectType);
- }
- else
- {
- endType = __pCompositeText->ForwardAnalyzeInNoneCursorMode(lineOffset, lineLength, pcX, length);
+ endType = __pCompositeText->ForwardAnalyzeInNoneCursorMode(lineOffset, lineLength, x, length);
}
__pCompositeText->SetWrap(__wrap);
}
int
-TextObject::GetCutLinkIndexFromPositionData(int lcX, int lcY) const
+TextObject::GetCutLinkIndexFromPositionData(int x, int y) const
+{
+ return GetCutLinkIndexFromPositionData(_CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y));
+}
+
+int
+TextObject::GetCutLinkIndexFromPositionData(float x, float y) const
{
IF_NOT_CONSTRUCTED(return -1);
}
int textIndex = 0;
- int pcX = _Text::ConvertToPhyCoord(lcX);
- int pcY = _Text::ConvertToPhyCoord(lcY);
if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE)
{
- textIndex = GetTextIndexFromPositionInNoneWrap(pcX, pcY, false);
+ textIndex = GetTextIndexFromPositionInNoneWrap(x, y, false);
}
else
{
- textIndex = GetTextIndexFromPositionInWrap(pcX, pcY, false);
+ textIndex = GetTextIndexFromPositionInWrap(x, y, false);
}
if (textIndex < 0)
return -1;
}
- int width = 0;
- int height = 0;
- Point absPoint;
- Point relPoint;
+ float width = 0;
+ float height = 0;
+ FloatPoint absPoint;
+ FloatPoint relPoint;
+
if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE)
{
r = GetTextPositionInfoInNoneWrapAt(textIndex, width, height, absPoint.x, absPoint.y, relPoint.x, relPoint.y);
r = GetTextPositionInfoInWrapAt(textIndex, width, height, absPoint.x, absPoint.y, relPoint.x, relPoint.y);
}
SysTryReturn(NID_GRP, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
- SysTryReturn(NID_GRP, pcY + __pcRect.y >= relPoint.y, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text position information");
-
- return __pCompositeText->GetCutLinkElementIndexAt(textIndex);
-}
+ SysTryReturn(NID_GRP, y + __rect.y >= relPoint.y, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text position information");
-int
-TextObject::GetCutLinkIndexFromPositionData(float lcX, float lcY) const
-{
- return GetCutLinkIndexFromPositionData(_CoordinateSystemUtils::ConvertToInteger(lcX), _CoordinateSystemUtils::ConvertToInteger(lcY));
+ return __pCompositeText->GetCutLinkElementIndexAt(textIndex);
}
TextElement*
result
TextObject::GetCutLinkBounds(int cutLinkIndex, Point& startPoint, Point& endPoint) const
{
+ FloatPoint startPointF = _CoordinateSystemUtils::ConvertToFloat(startPoint);
+ FloatPoint endPointF = _CoordinateSystemUtils::ConvertToFloat(endPoint);
+
+ result r = GetCutLinkBounds(cutLinkIndex, startPointF, endPointF);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ startPoint = _CoordinateSystemUtils::ConvertToInteger(startPointF);
+ endPoint = _CoordinateSystemUtils::ConvertToInteger(endPointF);
+
+ return E_SUCCESS;
+}
+
+result
+TextObject::GetCutLinkBounds(int cutLinkIndex, FloatPoint& startPoint, FloatPoint& endPoint) const
+{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
result r = E_SUCCESS;
int textIndex = 0;
int textLength = 0;
- int width = 0;
- int heigth = 0;
- Point tempPoint;
+ float width = 0;
+ float heigth = 0;
+ FloatPoint tempPoint;
r = __pCompositeText->GetCutLinkObjectInfo(cutLinkIndex, textIndex, textLength);
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
endPoint.x = endPoint.x + width;
endPoint.y = endPoint.y + heigth;
- if (_ResUtil::NeedToConvertCoord())
- {
- startPoint.x = _Text::ConvertToVirCoord(startPoint.x);
- startPoint.y = _Text::ConvertToVirCoord(startPoint.y);
- endPoint.x = _Text::ConvertToVirCoord(endPoint.x);
- endPoint.y = _Text::ConvertToVirCoord(endPoint.y);
- }
-
return E_SUCCESS;
CATCH:
}
result
-TextObject::GetCutLinkBounds(int cutLinkIndex, FloatPoint& startPoint, FloatPoint& endPoint) const
+TextObject::GetTextPositionInfoAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const
{
- Point newStartPoint = _CoordinateSystemUtils::ConvertToInteger(startPoint);
- Point newEndPoint = _CoordinateSystemUtils::ConvertToInteger(endPoint);
- result r = GetCutLinkBounds(cutLinkIndex, newStartPoint, newEndPoint);
+ IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- startPoint = _CoordinateSystemUtils::ConvertToFloat(newStartPoint);
- endPoint = _CoordinateSystemUtils::ConvertToFloat(newEndPoint);
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+ float absXF = _CoordinateSystemUtils::ConvertToFloat(absX);
+ float absYF = _CoordinateSystemUtils::ConvertToFloat(absY);
+ float logicalXF = _CoordinateSystemUtils::ConvertToFloat(logicalX);
+ float logicalYF = _CoordinateSystemUtils::ConvertToFloat(logicalY);
- return r;
+ result r = GetTextPositionInfoAt(textIndex, widthF, heightF, absXF, absYF, logicalXF, logicalYF);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+ absX = _CoordinateSystemUtils::ConvertToInteger(absXF);
+ absY = _CoordinateSystemUtils::ConvertToInteger(absYF);
+ logicalX = _CoordinateSystemUtils::ConvertToInteger(logicalXF);
+ logicalY = _CoordinateSystemUtils::ConvertToInteger(logicalYF);
+
+ return E_SUCCESS;
}
result
-TextObject::GetTextPositionInfoAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const
+TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, float& absX, float& absY, float& logicalX, float& logicalY) const
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
if (lineCount < 1)
{
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont));
+ _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
- int maxHeight = TextUtility::GetFontMaxHeight(pFont);
- int posX = 0;
- int posY = 0;
+ float maxHeight = TextUtility::GetFontMaxHeightF(pFont);
+ float posX = 0;
+ float posY = 0;
absX = 0;
absY = 0;
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__pcRect.height - maxHeight) / 2;
+ posY += (__rect.height - maxHeight) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
- posY += (__pcRect.height - maxHeight);
+ posY += (__rect.height - maxHeight);
break;
}
- logicalY = __pcRect.y + posY;
+ logicalY = __rect.y + posY;
switch (__align & TEXT_ALIGNMASK_HORIZ)
{
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += __pcRect.width / 2;
+ posX += __rect.width / 2;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
- posX += __pcRect.width;
+ posX += __rect.width;
break;
}
- logicalX = __pcRect.x + posX;
+ logicalX = __rect.x + posX;
}
else
{
- int lineHeight = maxHeight + __pCompositeText->GetLineSpace();
+ float lineHeight = maxHeight + __pCompositeText->GetLineSpaceF();
TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment();
switch (alignment & TEXT_ALIGNMASK_VERT)
{
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += __pcRect.width / 2;
+ posX += __rect.width / 2;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
- posX += __pcRect.width;
+ posX += __rect.width;
break;
}
- logicalX = posX + __pcRect.x;
- logicalY = posY + __pcRect.y;
+ logicalX = posX + __rect.x;
+ logicalY = posY + __rect.y;
}
width = 0;
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
- if (_ResUtil::NeedToConvertCoord())
- {
- width = _Text::ConvertToVirCoord(width);
- height = _Text::ConvertToVirCoord(height);
- absX = _Text::ConvertToVirCoord(absX);
- absY = _Text::ConvertToVirCoord(absY);
- logicalX = _Text::ConvertToVirCoord(logicalX);
- logicalY = _Text::ConvertToVirCoord(logicalY);
- }
-
return E_SUCCESS;
}
result
-TextObject::GetTextPositionInfoAt(int textIndex, float& width, float& height, float& absX, float& absY, float& logicalX, float& logicalY) const
+TextObject::GetBlockTextPositionInfoAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const
{
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX);
- int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY);
- int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX);
- int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY);
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+ float absXF = _CoordinateSystemUtils::ConvertToFloat(absX);
+ float absYF = _CoordinateSystemUtils::ConvertToFloat(absY);
+ float logicalXF = _CoordinateSystemUtils::ConvertToFloat(logicalX);
+ float logicalYF = _CoordinateSystemUtils::ConvertToFloat(logicalY);
- result r = GetTextPositionInfoAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY);
+ result r = GetBlockTextPositionInfoAt(textIndex, widthF, heightF, absXF, absYF, logicalXF, logicalYF);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newHeight);
- absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX);
- absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY);
- logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX);
- logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY);
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+ absX = _CoordinateSystemUtils::ConvertToInteger(absXF);
+ absY = _CoordinateSystemUtils::ConvertToInteger(absYF);
+ logicalX = _CoordinateSystemUtils::ConvertToInteger(logicalXF);
+ logicalY = _CoordinateSystemUtils::ConvertToInteger(logicalYF);
- return r;
+ return E_SUCCESS;
}
result
-TextObject::GetBlockTextPositionInfoAt(int textIndex, int& width, int& height, int& absX, int& absY, int& logicalX, int& logicalY) const
+TextObject::GetBlockTextPositionInfoAt(int textIndex, float& width, float& height, float& absX, float& absY, float& logicalX, float& logicalY) const
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
if (lineCount < 1)
{
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont));
+ _FontImpl* pFont =_FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
- int maxHeight = TextUtility::GetFontMaxHeight(pFont);
- int posX = 0;
- int posY = 0;
+ float maxHeight = TextUtility::GetFontMaxHeightF(pFont);
+ float posX = 0;
+ float posY = 0;
absX = 0;
absY = 0;
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__pcRect.height - maxHeight) / 2;
+ posY += (__rect.height - maxHeight) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
- posY += (__pcRect.height - maxHeight);
+ posY += (__rect.height - maxHeight);
break;
}
- logicalY = __pcRect.y + posY;
+ logicalY = __rect.y + posY;
switch (__align & TEXT_ALIGNMASK_HORIZ)
{
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += __pcRect.width / 2;
+ posX += __rect.width / 2;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
- posX += __pcRect.width;
+ posX += __rect.width;
break;
}
- logicalX = __pcRect.x + posX;
+ logicalX = __rect.x + posX;
}
else
{
- int lineHeight = maxHeight + __pCompositeText->GetLineSpace();
+ float lineHeight = maxHeight + __pCompositeText->GetLineSpace();
TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment();
switch (alignment & TEXT_ALIGNMASK_VERT)
{
break;
}
- logicalX = __pcRect.x;
- logicalY = posY + __pcRect.y;
+ logicalX = __rect.x;
+ logicalY = posY + __rect.y;
}
width = 0;
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
- if (_ResUtil::NeedToConvertCoord())
- {
- width = _Text::ConvertToVirCoord(width);
- height = _Text::ConvertToVirCoord(height);
- absX = _Text::ConvertToVirCoord(absX);
- absY = _Text::ConvertToVirCoord(absY);
- logicalX = _Text::ConvertToVirCoord(logicalX);
- logicalY = _Text::ConvertToVirCoord(logicalY);
- }
-
return E_SUCCESS;
}
result
-TextObject::GetBlockTextPositionInfoAt(int textIndex, float& width, float& height, float& absX, float& absY, float& logicalX, float& logicalY) const
-{
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX);
- int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY);
- int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX);
- int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY);
-
- result r = GetBlockTextPositionInfoAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY);
-
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newHeight);
- absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX);
- absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY);
- logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX);
- logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY);
-
- return r;
-}
-
-result
TextObject::SetTextObjectEllipsisType(TextObjectEllipsisType type)
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
result
TextObject::DrawByLine(_CanvasImpl& canvasImpl, const Rectangle& displayRect)
{
- Rectangle targetBounds = displayRect;
-
- return __pTextColumn->Draw(canvasImpl, targetBounds, 0, __pTextColumn->GetTextLength(), __align, __action);
+ return DrawByLine(canvasImpl, _CoordinateSystemUtils::ConvertToFloat(displayRect));
}
result
TextObject::DrawByLine(_CanvasImpl& canvasImpl, const FloatRectangle& displayRect)
{
- return DrawByLine(canvasImpl, _CoordinateSystemUtils::ConvertToInteger(displayRect));
+ FloatRectangle targetBounds = displayRect;
+
+ return __pTextColumn->Draw(canvasImpl, targetBounds, 0, __pTextColumn->GetTextLength(), __align, __action);
}
int
-TextObject::GetTextIndexFromPositionInWrap(int pcX, int pcY, bool cursorMode) const
+TextObject::GetTextIndexFromPositionInWrap(int x, int y, bool cursorMode) const
+{
+ return GetTextIndexFromPositionInWrap(_CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y), cursorMode);
+}
+
+int
+TextObject::GetTextIndexFromPositionInWrap(float x, float y, bool cursorMode) const
{
TextLine* pTextLine = null;
- Rectangle lineBounds;
+ FloatRectangle lineBounds;
int firstDisplayLineIndex = __pTextColumn->GetFirstDisplayLineIndex();
- int firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY();
+ float firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
int lineCount = __pTextColumn->GetTotalLineCount();
int lineIndex = 0;
-
- int totalHeight = __pTextColumn->GetTotalHeight();
+ float totalHeight = __pTextColumn->GetTotalHeightF();
switch (__align & TEXT_ALIGNMASK_VERT)
{
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- pcY -= (__pcRect.height - totalHeight) / 2;
+ y -= (__rect.height - totalHeight) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
- pcY -= (__pcRect.height - totalHeight);
+ y -= (__rect.height - totalHeight);
break;
}
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryReturn(NID_GRP, pTextLine, -1, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
if (lineIndex == firstDisplayLineIndex)
{
- if (pcY < lineBounds.y - firstDisplayPositionY)
+ if (y < lineBounds.y - firstDisplayPositionY)
{
return -1;
}
}
- if ((lineBounds.y - firstDisplayPositionY <= pcY) && (pcY < lineBounds.y + lineBounds.height - firstDisplayPositionY))
+ if ((lineBounds.y - firstDisplayPositionY <= y) && (y < lineBounds.y + lineBounds.height - firstDisplayPositionY))
{
break;
}
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- pcX -= (lineBounds.width - lineTextSize.width) / 2;
+ x -= (lineBounds.width - lineTextSize.width) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
- pcX -= (lineBounds.width - lineTextSize.width);
+ x -= (lineBounds.width - lineTextSize.width);
break;
}
- if (pcX < 0)
+ if (x < 0)
{
- pcX = 0;
+ x = 0;
}
- int index = pTextLine->GetTextIndexFromPosition(pcX, cursorMode);
+ int index = pTextLine->GetTextIndexFromPosition(x, cursorMode);
SetLastResult(E_SUCCESS);
}
int
-TextObject::GetTextIndexFromPositionInWrap(float pcX, float pcY, bool cursorMode) const
+TextObject::GetTextIndexFromPositionInNoneWrap(int x, int y, bool cursorMode) const
{
- return GetTextIndexFromPositionInWrap(_CoordinateSystemUtils::ConvertToInteger(pcX), _CoordinateSystemUtils::ConvertToInteger(pcY), cursorMode);
+ return GetTextIndexFromPositionInNoneWrap(_CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y), cursorMode);
}
int
-TextObject::GetTextIndexFromPositionInNoneWrap(int pcX, int pcY, bool cursorMode) const
+TextObject::GetTextIndexFromPositionInNoneWrap(float x, float y, bool cursorMode) const
{
- Dimension lineTextSize;
- Rectangle lineBounds;
+ FloatDimension lineTextSize;
+ FloatRectangle lineBounds;
int lineOffset = 0;
int lineLength = 0;
TextLine* pTextLine = null;
lineOffset = pTextLine->GetTextOffset();
lineLength = pTextLine->GetTextLength();
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
switch (__align & TEXT_ALIGNMASK_HORIZ)
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- pcX -= (lineBounds.width - lineTextSize.width) / 2;
+ x -= (lineBounds.width - lineTextSize.width) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
- pcX -= (lineBounds.width - lineTextSize.width);
+ x -= (lineBounds.width - lineTextSize.width);
break;
}
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- pcY -= (__pcRect.height - lineTextSize.height) / 2;
+ y -= (__rect.height - lineTextSize.height) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
- pcY -= (__pcRect.height - lineTextSize.height);
+ y -= (__rect.height - lineTextSize.height);
break;
}
- if (pcX < 0)
+ if (x < 0)
{
- pcX = 0;
+ x = 0;
}
- int index = pTextLine->GetTextIndexFromPosition(pcX, cursorMode);
+ int index = pTextLine->GetTextIndexFromPosition(x, cursorMode);
SetLastResult(E_SUCCESS);
- return index;
-}
-
-int
-TextObject::GetTextIndexFromPositionInNoneWrap(float pcX, float pcY, bool cursorMode) const
-{
- return GetTextIndexFromPositionInNoneWrap(_CoordinateSystemUtils::ConvertToInteger(pcX), _CoordinateSystemUtils::ConvertToInteger(pcY), cursorMode);
+ return index;
}
result
TextObject::SetFirstDisplayLineIndexFromTextIndexInWrap(int textIndex)
{
result r = E_SUCCESS;
- Rectangle lineBounds;
- int firstDisplayPositionY = 0;
+ FloatRectangle lineBounds;
+ float firstDisplayPositionY = 0;
int currentTextIndex = textIndex;
int firstDisplayLineIndex = 0;
int lineIndex = 0;
int lineCount = 0;
- int remainingHeight = 0;
+ float remainingHeight = 0;
TextLine* pTextLine = null;
bool isChanged = false;
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
if (firstDisplayLineIndex < lineIndex)
{
pTextLine = __pTextColumn->GetTextLine(currentLineIndex);
SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- remainingHeight = __pcRect.height;
+ remainingHeight = __rect.height;
while ((remainingHeight != 0) && firstDisplayLineIndex < lineCount)
{
break;
}
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
remainingHeight -= lineBounds.height;
displayLineCount++;
while (remainingHeight && pTextLine)
{
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
remainingHeight -= lineBounds.height;
if (remainingHeight < 0)
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
- remainingHeight = __pcRect.height;
+ lineBounds = pTextLine->GetBoundsF();
+ remainingHeight = __rect.height;
firstDisplayLineIndex = lineIndex;
firstDisplayPositionY = lineBounds.y;
while ((pTextLine != null) && 0 < firstDisplayLineIndex && 0 < remainingHeight)
{
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
if (remainingHeight < lineBounds.height)
{
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
- remainingHeight = __pcRect.height;
+ remainingHeight = __rect.height;
firstDisplayLineIndex = lineIndex;
firstDisplayPositionY = lineBounds.y;
while (pTextLine && 0 < firstDisplayLineIndex && 0 < remainingHeight)
{
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
if (remainingHeight < lineBounds.height)
{
}
else
{
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
firstDisplayLineIndex = lineIndex;
firstDisplayPositionY = lineBounds.y;
isChanged = true;
int lineOffset = 0;
int lineEndIndex = 0;
int lineLength = 0;
- Rectangle lineBounds;
- Dimension lineTextSize;
+ FloatRectangle lineBounds;
+ FloatDimension lineTextSize;
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont));
+ _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
TextLine* pTextLine = __pTextColumn->GetTextLine(0);
lineLength = pTextLine->GetTextLength();
lineEndIndex = pTextLine->GetTextOffset() + pTextLine->GetTextLength();
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
if (currentTextIndex < pTextLine->GetTextOffset() + 1)
__pCompositeText->ForwardAnalyze(lineOffset, __pCompositeText->GetTextLength() - lineOffset, lineBounds.width,
__wrap, lineLength, lineTextSize.width, lineTextSize.height);
- lineBounds.height = Math::Max(lineBounds.height, lineTextSize.height);
+ lineBounds.height = (lineBounds.height > lineTextSize.height) ? lineBounds.height : lineTextSize.height;
if (lineBounds.height == 0)
{
- lineBounds.height = TextUtility::GetFontMaxHeight(pFont);
+ lineBounds.height = TextUtility::GetFontMaxHeightF(pFont);
}
pTextLine->SetBounds(lineBounds);
}
else if (lineEndIndex <= currentTextIndex)
{
- int gapWidth = 0;
- int gapHeight = 0;
+ float gapWidth = 0;
+ float gapHeight = 0;
+ float tempWidth = 0;
int textCount = 0;
- int tempWidth = 0;
r = __pCompositeText->GetRegion(lineEndIndex, currentTextIndex - lineEndIndex, gapWidth, gapHeight);
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pCompositeText->ForwardAnalyze(lineOffset, __pCompositeText->GetTextLength() - lineOffset, lineBounds.width,
__wrap, lineLength, lineTextSize.width, lineTextSize.height);
- lineBounds.height = Math::Max(lineBounds.height, lineTextSize.height);
+ lineBounds.height = (lineBounds.height > lineTextSize.height) ? lineBounds.height: lineTextSize.height;
if (lineBounds.height == 0)
{
- lineBounds.height = TextUtility::GetFontMaxHeight(pFont);
+ lineBounds.height = TextUtility::GetFontMaxHeightF(pFont);
}
pTextLine->SetBounds(lineBounds);
TextObject::GetTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int& absX, int& absY,
int& logicalX, int& logicalY) const
{
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+ float absXF = _CoordinateSystemUtils::ConvertToFloat(absX);
+ float absYF = _CoordinateSystemUtils::ConvertToFloat(absY);
+ float logicalXF = _CoordinateSystemUtils::ConvertToFloat(logicalX);
+ float logicalYF = _CoordinateSystemUtils::ConvertToFloat(logicalY);
+
+ result r = GetTextPositionInfoInWrapAt(textIndex, widthF, heightF, absXF, absYF, logicalXF, logicalYF);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+ absX = _CoordinateSystemUtils::ConvertToInteger(absXF);
+ absY = _CoordinateSystemUtils::ConvertToInteger(absYF);
+ logicalX = _CoordinateSystemUtils::ConvertToInteger(logicalXF);
+ logicalY = _CoordinateSystemUtils::ConvertToInteger(logicalYF);
+
+ return E_SUCCESS;
+}
+
+result
+TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& height, float& absX, float& absY,
+ float& logicalX, float& logicalY) const
+{
TextLine* pTextLine = null;
- Rectangle lineBounds;
- int firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY();
+ FloatRectangle lineBounds;
+ float firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
int lineCount = __pTextColumn->GetTotalLineCount();
int lineIndex = 0;
int lineOffset = 0;
int lineLength = 0;
int textIndexFromLineOffset = 0;
- int lineY = 0;
- int posX = 0;
- int posY = 0;
+ float lineY = 0;
+ float posX = 0;
+ float posY = 0;
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont));
+ _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
for (lineIndex = 0; lineIndex < lineCount; lineIndex++)
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
lineOffset = pTextLine->GetTextOffset();
lineLength = pTextLine->GetTextLength();
textIndexFromLineOffset = textIndex - lineOffset;
}
- Dimension lineTextSize;
+ FloatDimension lineTextSize;
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
if (lineTextSize.height == 0)
{
- lineTextSize.height = TextUtility::GetFontMaxHeight(pFont);
+ lineTextSize.height = TextUtility::GetFontMaxHeightF(pFont);
}
switch (__align & TEXT_ALIGNMASK_HORIZ)
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__pcRect.height - __pTextColumn->GetDisplayHeight()) / 2;
+ posY += (__rect.height - __pTextColumn->GetDisplayHeightF()) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
- posY += (__pcRect.height - __pTextColumn->GetDisplayHeight());
+ posY += (__rect.height - __pTextColumn->GetDisplayHeightF());
break;
}
posY = 0;
}
- Rectangle textExtent = pTextLine->GetTextExtent(textIndexFromLineOffset, 1);
+ FloatRectangle textExtent = pTextLine->GetTextExtentF(textIndexFromLineOffset, 1);
if (lineIndex == lineCount)
{
if (textIndex >= 1)
{
Font* pTextFont = __pCompositeText->GetFont(textIndex - 1);
- textExtent.height = TextUtility::GetFontMaxHeight(pTextFont);
+ textExtent.height = TextUtility::GetFontMaxHeightF(pTextFont);
}
if (textExtent.height < 0)
{
- textExtent.height = TextUtility::GetFontMaxHeight(pFont);
+ textExtent.height = TextUtility::GetFontMaxHeightF(pFont);
}
TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment();
width = textExtent.width;
height = textExtent.height;
absX = posX + textExtent.x;
- logicalX = absX + __pcRect.x;
+ logicalX = absX + __rect.x;
absY = lineY;
- logicalY = absY - firstDisplayPositionY + __pcRect.y + posY;
+ logicalY = absY - firstDisplayPositionY + __rect.y + posY;
return E_SUCCESS;
}
result
-TextObject::GetTextPositionInfoInWrapAt(int textIndex, float& width, float& height, float& absX, float& absY,
- float& logicalX, float& logicalY) const
+TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int& absX, int& absY,
+ int& logicalX, int& logicalY) const
{
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX);
- int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY);
- int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX);
- int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY);
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+ float absXF = _CoordinateSystemUtils::ConvertToFloat(absX);
+ float absYF = _CoordinateSystemUtils::ConvertToFloat(absY);
+ float logicalXF = _CoordinateSystemUtils::ConvertToFloat(logicalX);
+ float logicalYF = _CoordinateSystemUtils::ConvertToFloat(logicalY);
- result r = GetTextPositionInfoInWrapAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY);
+ result r = GetBlockTextPositionInfoInWrapAt(textIndex, widthF, heightF, absXF, absYF, logicalXF, logicalYF);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newHeight);
- absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX);
- absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY);
- logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX);
- logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY);
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+ absX = _CoordinateSystemUtils::ConvertToInteger(absXF);
+ absY = _CoordinateSystemUtils::ConvertToInteger(absYF);
+ logicalX = _CoordinateSystemUtils::ConvertToInteger(logicalXF);
+ logicalY = _CoordinateSystemUtils::ConvertToInteger(logicalYF);
- return r;
+ return E_SUCCESS;
}
result
-TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, int& width, int& height, int& absX, int& absY,
- int& logicalX, int& logicalY) const
+TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float& height, float& absX, float& absY,
+ float& logicalX, float& logicalY) const
{
TextLine* pTextLine = null;
- Rectangle lineBounds;
- int firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY();
+ FloatRectangle lineBounds;
+ float firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
int lineCount = __pTextColumn->GetTotalLineCount();
int lineIndex = 0;
int lineOffset = 0;
int lineLength = 0;
int textIndexFromLineOffset = 0;
- int lineY = 0;
- int posX = 0;
- int posY = 0;
+ float lineY = 0;
+ float posX = 0;
+ float posY = 0;
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont));
+ _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
for (lineIndex = 0; lineIndex < lineCount; lineIndex++)
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
lineOffset = pTextLine->GetTextOffset();
lineLength = pTextLine->GetTextLength();
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__pcRect.height - __pTextColumn->GetDisplayHeight()) / 2;
+ posY += (__rect.height - __pTextColumn->GetDisplayHeight()) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
- posY += (__pcRect.height - __pTextColumn->GetDisplayHeight());
+ posY += (__rect.height - __pTextColumn->GetDisplayHeight());
break;
}
posY = 0;
}
- Rectangle textExtent = pTextLine->GetBlockTextExtent(textIndexFromLineOffset, 1);
+ FloatRectangle textExtent = pTextLine->GetBlockTextExtentF(textIndexFromLineOffset, 1);
if (lineIndex == lineCount)
{
if (textIndex >= 1)
{
Font* pTextFont = __pCompositeText->GetFont(textIndex - 1);
- textExtent.height = TextUtility::GetFontMaxHeight(pTextFont);
+ textExtent.height = TextUtility::GetFontMaxHeightF(pTextFont);
}
if (textExtent.height < 0)
{
- textExtent.height = TextUtility::GetFontMaxHeight(pFont);
+ textExtent.height = TextUtility::GetFontMaxHeightF(pFont);
}
TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment();
width = textExtent.width;
height = textExtent.height;
absX = posX + textExtent.x;
- logicalX = absX + __pcRect.x;
+ logicalX = absX + __rect.x;
absY = lineY;
- logicalY = absY - firstDisplayPositionY + __pcRect.y + posY;
+ logicalY = absY - firstDisplayPositionY + __rect.y + posY;
return E_SUCCESS;
}
result
-TextObject::GetBlockTextPositionInfoInWrapAt(int textIndex, float& width, float& height, float& absX, float& absY,
- float& logicalX, float& logicalY) const
+TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, int& width, int& height, int& absX, int& absY,
+ int& logicalX, int& logicalY) const
{
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX);
- int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY);
- int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX);
- int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY);
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+ float absXF = _CoordinateSystemUtils::ConvertToFloat(absX);
+ float absYF = _CoordinateSystemUtils::ConvertToFloat(absY);
+ float logicalXF = _CoordinateSystemUtils::ConvertToFloat(logicalX);
+ float logicalYF = _CoordinateSystemUtils::ConvertToFloat(logicalY);
- result r = GetBlockTextPositionInfoInWrapAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY);
+ result r = GetTextPositionInfoInNoneWrapAt(textIndex, widthF, heightF, absXF, absYF, logicalXF, logicalYF);
+ SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newHeight);
- absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX);
- absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY);
- logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX);
- logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY);
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+ absX = _CoordinateSystemUtils::ConvertToInteger(absXF);
+ absY = _CoordinateSystemUtils::ConvertToInteger(absYF);
+ logicalX = _CoordinateSystemUtils::ConvertToInteger(logicalXF);
+ logicalY = _CoordinateSystemUtils::ConvertToInteger(logicalYF);
- return r;
+ return E_SUCCESS;
}
result
-TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, int& width, int& height, int& absX, int& absY,
- int& logicalX, int& logicalY) const
+TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float& height, float& absX, float& absY,
+ float& logicalX, float& logicalY) const
{
TextLine* pTextLine = null;
pTextLine = __pTextColumn->GetTextLine(0);
SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
int lineLength = pTextLine->GetTextLength();
- int posX = 0;
- int posY = 0;
+ float posX = 0;
+ float posY = 0;
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*__pDefaultFont));
+ _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
- Dimension lineTextSize;
- Rectangle lineBounds;
- lineBounds = pTextLine->GetBounds();
+ FloatDimension lineTextSize;
+ FloatRectangle lineBounds;
+ lineBounds = pTextLine->GetBoundsF();
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
if (lineTextSize.height == 0 || pTextLine->GetTextLength() == 0)
{
- lineTextSize.height = TextUtility::GetFontMaxHeight(pFont);
+ lineTextSize.height = TextUtility::GetFontMaxHeightF(pFont);
}
switch (__align & TEXT_ALIGNMASK_HORIZ)
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__pcRect.height - lineTextSize.height) / 2;
+ posY += (__rect.height - lineTextSize.height) / 2;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
- posY += (__pcRect.height - lineTextSize.height);
+ posY += (__rect.height - lineTextSize.height);
break;
}
posX = (posX < 0) ? 0 : posX;
posY = (posY < 0) ? 0 : posY;
- Rectangle textExtent = pTextLine->GetTextExtent(textIndex - pTextLine->GetTextOffset(), 1);
+ FloatRectangle textExtent = pTextLine->GetTextExtentF(textIndex - pTextLine->GetTextOffset(), 1);
if (textIndex >= 1)
{
Font* pTextFont = __pCompositeText->GetFont(textIndex - 1);
- textExtent.height = TextUtility::GetFontMaxHeight(pTextFont);
+ textExtent.height = TextUtility::GetFontMaxHeightF(pTextFont);
}
if (textExtent.height < 0)
{
- textExtent.height = TextUtility::GetFontMaxHeight(pFont);
+ textExtent.height = TextUtility::GetFontMaxHeightF(pFont);
}
TextObjectAlignment alignment = __pCompositeText->GetElementVerticalAlignment();
}
absX = posX + textExtent.x;
- logicalX = (absX >= 0) ? absX + __pcRect.x : absX;
+ logicalX = (absX >= 0) ? absX + __rect.x : absX;
absY = posY;
- logicalY = absY + __pcRect.y;
+ logicalY = absY + __rect.y;
width = textExtent.width;
height = textExtent.height;
return E_SUCCESS;
}
-result
-TextObject::GetTextPositionInfoInNoneWrapAt(int textIndex, float& width, float& height, float& absX, float& absY,
- float& logicalX, float& logicalY) const
-{
- int newWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int newHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- int newAbsX = _CoordinateSystemUtils::ConvertToInteger(absX);
- int newAbsY = _CoordinateSystemUtils::ConvertToInteger(absY);
- int newLogicalX = _CoordinateSystemUtils::ConvertToInteger(logicalX);
- int newLogicalY = _CoordinateSystemUtils::ConvertToInteger(logicalY);
-
- result r = GetTextPositionInfoInNoneWrapAt(textIndex, newWidth, newHeight, newAbsX, newAbsY, newLogicalX, newLogicalY);
-
- width = _CoordinateSystemUtils::ConvertToFloat(newWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(newHeight);
- absX = _CoordinateSystemUtils::ConvertToFloat(newAbsX);
- absY = _CoordinateSystemUtils::ConvertToFloat(newAbsY);
- logicalX = _CoordinateSystemUtils::ConvertToFloat(newLogicalX);
- logicalY = _CoordinateSystemUtils::ConvertToFloat(newLogicalY);
-
- return r;
-}
-
int
TextObject::GetTotalComposedHeight(void) const
{
int
TextObject::GetLineWidthAt(int lineIndex) const
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetLineWidthAtF(lineIndex));
+}
+
+float
+TextObject::GetLineWidthAtF(int lineIndex) const
+{
IF_NOT_CONSTRUCTED(return -1);
result r = E_SUCCESS;
TextLine* pTextLine = null;
- Dimension lineTextSize;
+ FloatDimension lineTextSize;
int lineLength = 0;
- int pcWidth = 0;
- int lcWidth = 0;
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryCatch(NID_GRP, pTextLine, , E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
lineLength = pTextLine->GetTextLength();
r = pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
- SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pcWidth = lineTextSize.width;
- lcWidth = _Text::ConvertToVirCoord(pcWidth);
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
SetLastResult(E_SUCCESS);
- return lcWidth;
+ return lineTextSize.width;
CATCH:
- return -1;
+ return -1;
}
-float
-TextObject::GetLineWidthAtF(int lineIndex) const
+int
+TextObject::GetTotalHeight(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetLineWidthAt(lineIndex));
+ return _CoordinateSystemUtils::ConvertToInteger(GetTotalHeightF());
}
-int
-TextObject::GetTotalHeight(void) const
+float
+TextObject::GetTotalHeightF(void) const
{
IF_NOT_CONSTRUCTED(return -1);
- int pcHeight = 0;
+ float height = 0;
if (IsPartialComposingModeEnabled())
{
- pcHeight = __pCompositeText->GetAnalysedTotalHeight();
+ height = __pCompositeText->GetAnalysedTotalHeightF();
}
else
{
- pcHeight = __pTextColumn->GetTotalHeight();
+ height = __pTextColumn->GetTotalHeightF();
}
- int lcHeight = _Text::ConvertToVirCoord(pcHeight);
-
- return lcHeight;
-}
-
-float
-TextObject::GetTotalHeightF(void) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetTotalHeight());
+ return height;
}
int
{
IF_NOT_CONSTRUCTED(return -1);
- int lcSlidingStep = _Text::ConvertToVirCoord(__slidingStep);
-
- return lcSlidingStep;
+ return __slidingStep;
}
result
-TextObject::SetSlidingStep(int lcSlidingStep)
+TextObject::SetSlidingStep(int slidingStep)
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- int pcSlidingStep = _Text::ConvertToPhyCoord(lcSlidingStep);
-
- __slidingStep = pcSlidingStep;
+ __slidingStep = slidingStep;
return E_SUCCESS;
}
int
TextObject::GetLineHeightAt(int lineIndex) const
+{
+ return _CoordinateSystemUtils::ConvertToInteger(GetLineHeightAtF(lineIndex));
+}
+
+float
+TextObject::GetLineHeightAtF(int lineIndex) const
{
IF_NOT_CONSTRUCTED(return -1);
SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex);
- int pcHeight = __pTextColumn->GetLineHeightAt(lineIndex);
- int lcHeight = _Text::ConvertToVirCoord(pcHeight);
-
- return lcHeight;
-}
-
-float
-TextObject::GetLineHeightAtF(int lineIndex) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetLineHeightAt(lineIndex));
+ return __pTextColumn->GetLineHeightAtF(lineIndex);
}
int
int
TextObject::GetFirstDisplayPositionY(void) const
{
- IF_NOT_CONSTRUCTED(return -1);
-
- int pcFirstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionY();
- int lcFirstDisplayPositionY = _Text::ConvertToVirCoord(pcFirstDisplayPositionY);
-
- return lcFirstDisplayPositionY;
+ return _CoordinateSystemUtils::ConvertToInteger(GetFirstDisplayPositionYF());
}
float
TextObject::GetFirstDisplayPositionYF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetFirstDisplayPositionY());
+ IF_NOT_CONSTRUCTED(return -1);
+
+ return __pTextColumn->GetFirstDisplayPositionYF();
}
int
-TextObject::GetLineIndexAtPositionY(int lcY) const
+TextObject::GetLineIndexAtPositionY(int y) const
{
- IF_NOT_CONSTRUCTED(return -1);
-
- int pcY = _Text::ConvertToPhyCoord(lcY);
-
- return __pTextColumn->GetLineIndexAtPositionY(pcY);
+ return GetLineIndexAtPositionY(_CoordinateSystemUtils::ConvertToFloat(y));
}
int
-TextObject::GetLineIndexAtPositionY(float lcY) const
+TextObject::GetLineIndexAtPositionY(float y) const
{
- return GetLineIndexAtPositionY(_CoordinateSystemUtils::ConvertToInteger(lcY));
+ IF_NOT_CONSTRUCTED(return -1);
+
+ return __pTextColumn->GetLineIndexAtPositionY(y);
}
int
{
IF_NOT_CONSTRUCTED(return Rectangle(0,0,0,0));
- return __rect;
+ return _CoordinateSystemUtils::ConvertToInteger(__rect);
}
FloatRectangle
{
IF_NOT_CONSTRUCTED(return -1);
- int pcLineSpacing = __pCompositeText->GetLineSpace();
- int lcLineSpacing = _Text::ConvertToVirCoord(pcLineSpacing);
-
- return lcLineSpacing;
+ return __pCompositeText->GetLineSpace();
}
float
Rectangle
TextObject::GetBoundsAtLine(int lineIndex) const
{
- IF_NOT_CONSTRUCTED(return Rectangle(-1, -1, -1, -1));
+ return _CoordinateSystemUtils::ConvertToInteger(GetBoundsAtLineF(lineIndex));
+}
+
+FloatRectangle
+TextObject::GetBoundsAtLineF(int lineIndex) const
+{
+ IF_NOT_CONSTRUCTED(return FloatRectangle(-1, -1, -1, -1));
- SysTryReturn(NID_GRP, lineIndex >= 0, Rectangle(-1, -1, -1, -1), E_INVALID_ARG
+ SysTryReturn(NID_GRP, lineIndex >= 0, FloatRectangle(-1, -1, -1, -1), E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex);
TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex);
- SysTryReturn(NID_GRP, pTextLine, Rectangle(-1, -1, -1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, FloatRectangle(-1, -1, -1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
- Rectangle lineBounds = pTextLine->GetBounds();
+ FloatRectangle lineBounds = pTextLine->GetBoundsF();
- return lineBounds;
+ return lineBounds;
}
-FloatRectangle
-TextObject::GetBoundsAtLineF(int lineIndex) const
+Point
+TextObject::GetDisplayPositionAtLine(int lineIndex, int textIndexFromLineOffset)
{
- return _CoordinateSystemUtils::ConvertToFloat(GetBoundsAtLine(lineIndex));
+ return _CoordinateSystemUtils::ConvertToInteger(GetDisplayPositionAtLineF(lineIndex, textIndexFromLineOffset));
}
-Point
-TextObject::GetDisplayPositionAtLine(int lineIndex, int textIndexFromLineOffset)
+FloatPoint
+TextObject::GetDisplayPositionAtLineF(int lineIndex, int textIndexFromLineOffset)
{
- IF_NOT_CONSTRUCTED(return Point(-1, -1));
+ IF_NOT_CONSTRUCTED(return FloatPoint(-1.0f, -1.0f));
- SysTryReturn(NID_GRP, lineIndex >= 0, Point(-1, -1), E_INVALID_ARG
+ SysTryReturn(NID_GRP, lineIndex >= 0, FloatPoint(-1.0f, -1.0f), E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid. (lineIndex = %d)", lineIndex);
TextLine* pTextLine = __pTextColumn->GetTextLine(lineIndex);
- SysTryReturn(NID_GRP, pTextLine, Point(-1, -1), E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
+ SysTryReturn(NID_GRP, pTextLine, FloatPoint(-1.0f, -1.0f), E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
int lineOffset = pTextLine->GetTextOffset();
int lineLength = pTextLine->GetTextLength();
- Dimension lineTextSize;
- Dimension extentDim;
+ FloatDimension lineTextSize;
+ FloatDimension extentDim;
+ FloatRectangle lineBounds;
int textCount = 0;
- Rectangle lineBounds;
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
- lineBounds = pTextLine->GetBounds();
+ lineBounds = pTextLine->GetBoundsF();
__pCompositeText->ForwardAnalyze(lineOffset, textIndexFromLineOffset, lineTextSize.width, __wrap, textCount, extentDim.width, extentDim.height);
break;
}
- if (extentDim.width < 0)
+ if (extentDim.width < 0.0f)
{
- extentDim.width = 0;
+ extentDim.width = 0.0f;
}
- return Point(extentDim.width + __rect.x, lineBounds.y - __pTextColumn->GetFirstDisplayPositionY() + __rect.y);
-}
-
-FloatPoint
-TextObject::GetDisplayPositionAtLineF(int lineIndex, int textIndexFromLineOffset)
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetDisplayPositionAtLine(lineIndex, textIndexFromLineOffset));
+ return FloatPoint(extentDim.width + __rect.x, lineBounds.y - __pTextColumn->GetFirstDisplayPositionYF() + __rect.y);
}
Tizen::Base::String
#include "FGrp_TextTextUtility.h"
#include "FGrp_FontImpl.h"
#include "../FGrp_BitmapUtil.h"
-#include "../FGrp_Font.h"
-#include "../FGrp_Canvas.h"
#include "FGrp_CoordinateSystemUtils.h"
#include <fribidi.h>
TextSimple::ForwardAnalyze(int startTextIndex, int textLength, int maxWidth, TextObjectWrapType wrap, int& actualLength,
int& width, int& height)
{
+ int maxWidthF = _CoordinateSystemUtils::ConvertToFloat(maxWidth);
+ int widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ int heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+
+ int r = ForwardAnalyze(startTextIndex, textLength, maxWidthF, wrap, actualLength, widthF, heightF);
+
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+
+ return r;
+}
+
+int
+TextSimple::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
+ int& actualLength, float& width, float& height)
+{
int charCount = 0;
int r = TEXT_RETBY_NORMAL;
}
Font* pCurrentFont = GetCurrentFont();
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont));
- SysTryReturn(NID_GRP, pFont, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+ _FontImpl* pFontImpl = _FontImpl::GetInstance(*pCurrentFont);
+ SysTryReturn(NID_GRP, pFontImpl, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
const wchar_t* pText = &_pText[startTextIndex];
int length = ConvertEnterToSpace(pModifiedText, pText, textLength);
pModifiedText[length] = 0;
- actualLength = TextUtility::GetCharCountInWidth(pFont, pModifiedText, length, maxWidth, _outline, width, height);
+ actualLength = TextUtility::GetCharCountInWidth(pFontImpl, pModifiedText, length, maxWidth, _outline, width, height);
charCount = textLength;
r = TEXT_RETBY_NORMAL;
}
else
{
- actualLength = TextUtility::GetCharCountInWidth(pFont, pText, textLength, maxWidth, _outline, width, height);
+ actualLength = TextUtility::GetCharCountInWidth(pFontImpl, pText, textLength, maxWidth, _outline, width, height);
charCount = textLength;
r = TEXT_RETBY_NORMAL;
}
case TEXT_OBJECT_WRAP_TYPE_CHARACTER:
r = GetSentenceLength(pText, textLength, charCount);
- actualLength = TextUtility::GetCharCountInWidth(pFont, pText, charCount, maxWidth, _outline, width, height);
+ actualLength = TextUtility::GetCharCountInWidth(pFontImpl, pText, charCount, maxWidth, _outline, width, height);
if (_pText[startTextIndex + actualLength] == TEXT_LINE_FEED || _pText[startTextIndex + actualLength] == TEXT_CARRIAGE_RETURN)
{
(actualLength)++;
if (charCount != 0)
{
- actualLength = TextUtility::GetCharCountInWidth(pFont, pText, charCount, maxWidth, _outline, width, height);
+ actualLength = TextUtility::GetCharCountInWidth(pFontImpl, pText, charCount, maxWidth, _outline, width, height);
actualLength = charCount;
}
}
break;
case TEXT_OBJECT_WRAP_TYPE_WORD:
- actualLength = TextUtility::GetCharCountInWidth(pFont, pText, textLength, maxWidth, _outline, width, height);
+ actualLength = TextUtility::GetCharCountInWidth(pFontImpl, pText, textLength, maxWidth, _outline, width, height);
int widthcheck = width;
if (_pText[startTextIndex + actualLength] == TEXT_LINE_FEED || _pText[startTextIndex + actualLength] == TEXT_CARRIAGE_RETURN)
if (charCount > (actualLength / 2))
{
const wchar_t* pExtraText = &_pText[startTextIndex + charCount];
- int overCharCount = TextUtility::GetCharCountInWidth(pFont, pExtraText, actualLength - charCount, maxWidth, _outline, width, height);
+ int overCharCount = TextUtility::GetCharCountInWidth(pFontImpl, pExtraText, actualLength - charCount, maxWidth, _outline, width, height);
actualLength = actualLength - overCharCount;
width = widthcheck - width;
}
else
{
- actualLength = TextUtility::GetCharCountInWidth(pFont, pText, charCount, maxWidth, _outline, width, height);
+ actualLength = TextUtility::GetCharCountInWidth(pFontImpl, pText, charCount, maxWidth, _outline, width, height);
}
actualLength = charCount;
if (height == 0 && (textLength > 0))
{
- height = pFont->GetLeading().ToInt();
+ height = pFontImpl->GetLeading();
}
if (actualLength < charCount)
return r;
}
-int
-TextSimple::ForwardAnalyze(int startTextIndex, int textLength, float maxWidth, TextObjectWrapType wrap,
- int& actualLength, float& width, float& height)
-{
- int iMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth);
- int iWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int iHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- int r = ForwardAnalyze(startTextIndex, textLength, iMaxWidth, wrap, actualLength, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
- return r;
-}
-
bool
TextSimple::IsKorean(const wchar_t* ch) const
{
result
TextSimple::GetRegion(int textIndex, int textLength, int& width, int& height) const
{
- const wchar_t* pText = null;
- Font* pCurrentFont = GetCurrentFont();
- SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet.");
+ float widthF = _CoordinateSystemUtils::ConvertToInteger(width);
+ float heightF = _CoordinateSystemUtils::ConvertToInteger(height);
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont));
- SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+ result r = GetRegion(textIndex, textLength, widthF, heightF);
- if (textLength > _length)
- {
- textLength = _length;
- }
+ width = _CoordinateSystemUtils::ConvertToFloat(widthF);
+ height = _CoordinateSystemUtils::ConvertToFloat(heightF);
- if (textLength == 0)
- {
- width = 0;
- height = 0;
-
- return E_SUCCESS;
- }
-
- if (__bitmapProperty.pBitmap)
- {
- if (__bitmapProperty.displayEnable)
- {
- width = __bitmapProperty.pBitmap->GetWidth();
- height = __bitmapProperty.pBitmap->GetHeight();
- }
- else
- {
- width = 0;
- height = 0;
- }
-
- return E_SUCCESS;
- }
-
- pText = &_pText[textIndex];
-
- switch (_userWrap)
- {
- case TEXT_OBJECT_WRAP_TYPE_NONE:
- {
- wchar_t* pModifiedText = new (std::nothrow) wchar_t[textLength + 1];
- SysTryReturn(NID_GRP, pModifiedText, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
-
- int length = ConvertEnterToSpace(pModifiedText, pText, textLength);
- pModifiedText[textLength] = 0;
-
- TextUtility::GetTextExtent(pFont, pModifiedText, length, _outline, width, height);
-
- delete[] pModifiedText;
- pModifiedText = null;
- }
- break;
-
- case TEXT_OBJECT_WRAP_TYPE_CHARACTER:
- // fall through
- case TEXT_OBJECT_WRAP_TYPE_WORD:
- TextUtility::GetTextExtent(pFont, pText, textLength, _outline, width, height);
- break;
- }
-
- if (height == 0 && (textLength > 0))
- {
- height = pFont->GetLeading().ToInt();
- }
-
- return E_SUCCESS;
-}
-
-result
-TextSimple::GetRegion(int textIndex, int textLength, float& width, float& height) const
-{
- int iWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int iHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- result r = GetRegion(textIndex, textLength, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
return r;
}
result
-TextSimple::GetBlockRegion(int textIndex, int textLength, int& width, int& height) const
+TextSimple::GetRegion(int textIndex, int textLength, float& width, float& height) const
{
const wchar_t* pText = null;
Font* pCurrentFont = GetCurrentFont();
SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet.");
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont));
- SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+ _FontImpl* pFontImpl = _FontImpl::GetInstance(*pCurrentFont);
+ SysTryReturn(NID_GRP, pFontImpl, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
if (textLength > _length)
{
int length = ConvertEnterToSpace(pModifiedText, pText, textLength);
pModifiedText[textLength] = 0;
- TextUtility::GetTextExtent(pFont, pModifiedText, length, _outline, width, height);
+ TextUtility::GetTextExtent(pFontImpl, pModifiedText, length, _outline, width, height);
delete[] pModifiedText;
pModifiedText = null;
case TEXT_OBJECT_WRAP_TYPE_CHARACTER:
// fall through
case TEXT_OBJECT_WRAP_TYPE_WORD:
- TextUtility::GetTextExtent(pFont, pText, textLength, _outline, width, height);
-
- if (pText[textLength-1] == TEXT_LINE_FEED || pText[textLength-1] == TEXT_CARRIAGE_RETURN)
- {
- width += LINE_FEED_WIDTH;
- }
+ TextUtility::GetTextExtent(pFontImpl, pText, textLength, _outline, width, height);
break;
}
if (height == 0 && (textLength > 0))
{
- pFont->GetLeading().ToInt();
+ height = pFontImpl->GetLeading();
}
return E_SUCCESS;
}
-result
-TextSimple::GetBlockRegion(int textIndex, int textLength, float& width, float& height) const
-{
- int iWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int iHeight = _CoordinateSystemUtils::ConvertToInteger(height);
- result r = GetBlockRegion(textIndex, textLength, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
- return r;
-}
-
int
TextSimple::GetHeight(void) const
{
TextSimple::Draw(_CanvasImpl& canvasImpl, Rectangle& displayRect, int startTextIndex, int textLength,
const TextObjectAlignment align, const TextObjectActionType action)
{
+ FloatRectangle displayRectF = _CoordinateSystemUtils::ConvertToFloat(displayRect);
+
+ return Draw(canvasImpl, displayRectF, startTextIndex, textLength, align, action);
+}
+
+result
+TextSimple::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
+ const TextObjectAlignment alignment, const TextObjectActionType action)
+{
SysTryReturn(NID_GRP, textLength <= _length, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
if (textLength == 0)
}
result r = E_SUCCESS;
- _Canvas* pCanvas = _Canvas::GetInstance(canvasImpl);
- SysTryReturn(NID_GRP, pCanvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native canvas instance.");
if (__bitmapProperty.pBitmap)
{
if (__bitmapProperty.displayEnable)
{
- r = pCanvas->DrawBitmap(Point(displayRect.x, displayRect.y), *_GetBitmapEx(*_BitmapImpl::GetInstance(*__bitmapProperty.pBitmap)));
+ r = canvasImpl.DrawBitmap(FloatPoint(displayRect.x, displayRect.y), *_BitmapImpl::GetInstance(*__bitmapProperty.pBitmap));
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
}
Color foregroundColor = GetCurrentForegroundColor();
- pCanvas->SetForegroundColor(foregroundColor);
+ canvasImpl.SetForegroundColor(foregroundColor);
Color backgroundColor = GetCurrentBackgroundColor();
- pCanvas->SetBackgroundColor(backgroundColor);
+ canvasImpl.SetBackgroundColor(backgroundColor);
Color outlineColor = GetCurrentOutlineColor();
Font* pCurrentFont = GetCurrentFont();
SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet.");
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont));
- SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+ _FontImpl* pFontImpl = _FontImpl::GetInstance(*pCurrentFont);
+ SysTryReturn(NID_GRP, pFontImpl, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
- r = pCanvas->SetPriorityFont(*pFont);
+ r = canvasImpl.SetPriorityFont(*pCurrentFont);
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
if (_userWrap != TEXT_OBJECT_WRAP_TYPE_NONE)
{
if (_outline)
{
- return TextUtility::DrawOutlineText(*pCanvas, displayRect.x, displayRect.y, &_pText[startTextIndex], textLength, outlineColor);
+ return TextUtility::DrawOutlineText(canvasImpl, displayRect.x, displayRect.y, &_pText[startTextIndex], textLength, outlineColor);
}
else
{
- return TextUtility::DrawText(*pCanvas, displayRect.x, displayRect.y, &_pText[startTextIndex], textLength);
+ return TextUtility::DrawText(canvasImpl, displayRect.x, displayRect.y, &_pText[startTextIndex], textLength);
}
}
else
if (_outline)
{
- TextUtility::DrawOutlineText(*pCanvas, displayRect.x, displayRect.y, pModifiedText, length, outlineColor);
+ TextUtility::DrawOutlineText(canvasImpl, displayRect.x, displayRect.y, pModifiedText, length, outlineColor);
}
else
{
- TextUtility::DrawText(*pCanvas, displayRect.x, displayRect.y, pModifiedText, length);
+ TextUtility::DrawText(canvasImpl, displayRect.x, displayRect.y, pModifiedText, length);
}
delete[] pModifiedText;
return E_SUCCESS;
}
-result
-TextSimple::Draw(_CanvasImpl& canvasImpl, FloatRectangle& displayRect, int startTextIndex, int textLength,
- const TextObjectAlignment alignment, const TextObjectActionType action)
-{
- Rectangle iDisplayRect;
- iDisplayRect.x = _CoordinateSystemUtils::ConvertToInteger(displayRect.x);
- iDisplayRect.y = _CoordinateSystemUtils::ConvertToInteger(displayRect.y);
- iDisplayRect.width = _CoordinateSystemUtils::ConvertToInteger(displayRect.width);
- iDisplayRect.height = _CoordinateSystemUtils::ConvertToInteger(displayRect.height);
-
- return Draw(canvasImpl, iDisplayRect, startTextIndex, textLength, alignment, action);
-}
-
TextElement*
TextSimple::CloneN(TextComponentInfoValueType type, unsigned int value)
{
int
TextSimple::GetBaseline(void) const
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetBaselineF());
+}
+
+float
+TextSimple::GetBaselineF(void) const
+{
Font* pCurrentFont = GetCurrentFont();
SysTryReturn(NID_GRP, pCurrentFont, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not line wrapped yet.");
- _Font* pFont = _Font::GetInstance(*_FontImpl::GetInstance(*pCurrentFont));
- SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+ _FontImpl* pFontImpl = _FontImpl::GetInstance(*pCurrentFont);
+ SysTryReturn(NID_GRP, pFontImpl, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
- return (-1) * pFont->GetDescender().ToInt();
+ return (-1) * pFontImpl->GetDescenderF();
}
}}} // Tizen::Graphics::_Text
#include <new>
#include <FBaseSysLog.h>
-#include "../FGrp_Canvas.h"
+#include <FBaseColLinkedList.h>
+#include "FGrp_CanvasImpl.h"
#include "FGrp_FontImpl.h"
#include "FGrp_TextCommon.h"
#include "FGrp_TextTextSimple.h"
using namespace Tizen::Base::Utility;
using namespace Tizen::Base;
-// [TODO] use before _Font::GetTextExtent is working properly.
-#define EXTENT_BIDI_LIST
+#define Release(x) \
+ if (x) \
+ { \
+ delete x; \
+ x = null; \
+ }
namespace Tizen { namespace Graphics
{
int
TextUtility::GetFontMaxHeight(Font* pFont)
{
- if (!pFont)
- {
- return 0;
- }
-
- _Font* pNativeFont = _Font::GetInstance(*_FontImpl::GetInstance(*pFont));
- SysTryReturn(NID_GRP, pNativeFont, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
-
- return pNativeFont->GetLeading().ToInt();
+ return _CoordinateSystemUtils::ConvertToInteger(GetFontMaxHeightF(pFont));
}
int
-TextUtility::GetFontMaxHeight(_Font* pFont)
+TextUtility::GetFontMaxHeight(_FontImpl* pFont)
+{
+ return _CoordinateSystemUtils::ConvertToInteger(GetFontMaxHeightF(pFont));
+}
+
+float
+TextUtility::GetFontMaxHeightF(Font* pFont)
{
if (!pFont)
{
return 0;
}
- return pFont->GetLeading().ToInt();
+ return pFont->GetMaxHeightF();
}
-
float
-TextUtility::GetFontMaxHeightF(Font* pFont)
+TextUtility::GetFontMaxHeightF(_FontImpl* pFont)
{
- return _CoordinateSystemUtils::ConvertToFloat(GetFontMaxHeight(pFont));
-}
+ if (!pFont)
+ {
+ return 0;
+ }
-float
-TextUtility::GetFontMaxHeightF(_Font* pFont)
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetFontMaxHeight(pFont));
+ return pFont->GetLeadingF();
}
int
}
int
-TextUtility::GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, int maxWidth, bool outline, int& width, int& height)
+TextUtility::GetCharCountInWidth(_FontImpl* pFont, const wchar_t* pText, int textLength, float maxWidth, bool outline, float& width, float& height)
{
if (!pFont)
{
result r = E_SUCCESS;
int count = 0;
- Dimension lineDimension;
+ FloatDimension lineDimension;
+
+ r = pFont->GetTextExtent(maxWidth, pText, 0, textLength, outline, L"", count, lineDimension);
- r = pFont->GetTextExtent(maxWidth, _Util::String(pText, textLength), outline, L"", count, lineDimension);
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
width = lineDimension.width;
- height = pFont->GetLeading().ToInt();
+ height = pFont->GetLeadingF();
SetLastResult(E_SUCCESS);
return 0;
}
-int
-TextUtility::GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, float maxWidth, bool outline, float& width, float& height)
-{
- int iMaxWidth = _CoordinateSystemUtils::ConvertToInteger(maxWidth);
- int iWidth = 0;
- int iHeight = 0;
- int charCount = GetCharCountInWidth(pFont, pText, textLength, iMaxWidth, outline, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
-
- return charCount;
-}
-
result
TextUtility::CopyText(wchar_t* pDstText, const wchar_t* pSrcText, int textLength)
{
}
result
-TextUtility::DrawText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength)
+TextUtility::DrawText(_CanvasImpl& canvasImpl, int x, int y, const wchar_t* pText, int textLength)
+{
+ return DrawText(canvasImpl, _CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y), pText, textLength);
+}
+
+result
+TextUtility::DrawText(_CanvasImpl& canvasImpl, float x, float y, const wchar_t* pText, int textLength)
{
result r = E_SUCCESS;
- Point point(x, y);
+ FloatPoint point(x, y);
Tizen::Base::String text(pText);
textLength--;
}
- r = canvas.DrawText(point, text, 0, textLength);
+ r = canvasImpl.DrawText(point, text, 0, textLength);
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- return E_SUCCESS;
+ return E_SUCCESS;
}
result
-TextUtility::DrawText(_Canvas& canvas, float x, float y, const wchar_t* pText, int textLength)
+TextUtility::DrawOutlineText(_CanvasImpl& canvasImpl, int x, int y, const wchar_t* pText, int textLength, Color outlineColor)
{
- return DrawText(canvas, _CoordinateSystemUtils::ConvertToInteger(x), _CoordinateSystemUtils::ConvertToInteger(y), pText, textLength);
+ return DrawOutlineText(canvasImpl, _CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y), pText, textLength, outlineColor);
}
result
-TextUtility::DrawOutlineText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength, Color outlineColor)
+TextUtility::DrawOutlineText(_CanvasImpl& canvasImpl, float x, float y, const wchar_t* pText, int textLength, Color outlineColor)
{
result r = E_SUCCESS;
- Point point(x, y);
+ FloatPoint point(x, y);
Tizen::Base::String text(pText);
textLength--;
}
- r = canvas.DrawText(point, text, 0, textLength, outlineColor);
+ r = canvasImpl.DrawText(point, text, 0, textLength, outlineColor);
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return E_SUCCESS;
}
result
-TextUtility::DrawOutlineText(_Canvas& canvas, float x, float y, const wchar_t* pText, int textLength, Color outlineColor)
-{
- return DrawOutlineText(canvas, _CoordinateSystemUtils::ConvertToInteger(x), _CoordinateSystemUtils::ConvertToInteger(y), pText, textLength, outlineColor);
-}
-
-result
-TextUtility::GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height)
+TextUtility::GetTextExtent(_FontImpl* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height)
{
SysTryReturn(NID_GRP, pFont && pText, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
result r = E_SUCCESS;
- Dimension lineDimension;
+ FloatDimension lineDimension;
+ _FloatPair currentGap;
+ Tizen::Base::Collection::ArrayListT<_FloatPair> gapList;
+ Tizen::Base::Collection::IEnumeratorT<_FloatPair >* pEnum = null;
- // [TODO] use before _Font::GetTextExtent is working properly.
-#if defined (EXTENT_BIDI_LIST)
- _Util::AccumList<_Util::Pair<int, int> > gaptList;
+ r = pFont->GetTextExtentList(pText, 0, textLength, gapList);
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- r = pFont->GetTextExtentList(_Util::String(pText, textLength), gaptList);
- for (_Util::AccumList<_Util::Pair<int, int> >::Iterator iterator = gaptList.Begin(); iterator != gaptList.End(); iterator++)
- {
- lineDimension.width = (lineDimension.width < iterator->second) ? iterator->second : lineDimension.width;
- }
+ pEnum = gapList.GetEnumeratorN();
-#else
- r = pFont->GetTextExtent(_Util::String(pText, textLength), lineDimension);
-#endif
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ pEnum->GetCurrent(currentGap);
- SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ lineDimension.width = (lineDimension.width < currentGap.second) ? currentGap.second : lineDimension.width;
+ }
width = lineDimension.width;
- height = pFont->GetLeading().ToInt();
+ height = pFont->GetLeadingF();
+ Release(pEnum);
return E_SUCCESS;
CATCH:
width = 0;
height = 0;
+
+ Release(pEnum);
return r;
}
result
-TextUtility::GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height)
+TextUtility::GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height)
{
SysTryReturn(NID_GRP, pFont && pText, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
result r = E_SUCCESS;
int count = 0;
- Dimension lineDimension;
+ FloatDimension lineDimension;
- _Font* pNativeFont = _Font::GetInstance(*_FontImpl::GetInstance(*pFont));
- SysTryReturn(NID_GRP, pNativeFont, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
+ _FontImpl* pFontImpl = _FontImpl::GetInstance(*pFont);
+ SysTryReturn(NID_GRP, pFontImpl, -1, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
- r = pNativeFont->GetTextExtent((Integer::VALUE_MAX >> 1) - 1, _Util::String(pText, textLength), outline, L"", count, lineDimension);
+ r = pFontImpl->GetTextExtent((Integer::VALUE_MAX / 2.0f) - 1, pText, textLength, outline, L"", count, lineDimension);
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
width = lineDimension.width;
- height = pNativeFont->GetLeading().ToInt();
+ height = pFontImpl->GetLeadingF();
return E_SUCCESS;
return r;
}
-result
-TextUtility::GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height)
-{
- result r = E_SUCCESS;
- int iWidth = 0;
- int iHeight = 0;
- r = GetTextExtent(pFont, pText, textLength, outline, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
-
- return r;
-}
-
-result
-TextUtility::GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height)
-{
- result r = E_SUCCESS;
- int iWidth = 0;
- int iHeight = 0;
- r = GetTextExtent(pFont, pText, textLength, outline, iWidth, iHeight);
- width = _CoordinateSystemUtils::ConvertToFloat(iWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(iHeight);
-
- return r;
-}
-
-}}} // Tizen::Graphics::_Text
+}}} // Tizen::Graphics::_Texts
#ifndef _FGRP_INTERNAL_TEXT_UTILITY_H_
#define _FGRP_INTERNAL_TEXT_UTILITY_H_
-#include "../FGrp_Font.h"
+#include "FGrp_CanvasImpl.h"
+#include "FGrp_FontImpl.h"
#include "FGrp_TextCommon.h"
namespace Tizen { namespace Graphics
static int GetFontMaxHeight(Font* pFont);
- static int GetFontMaxHeight(_Font* pFont);
+ static int GetFontMaxHeight(_FontImpl* pFont);
static float GetFontMaxHeightF(Font* pFont);
- static float GetFontMaxHeightF(_Font* pFont);
+ static float GetFontMaxHeightF(_FontImpl* pFont);
static int GetTextLength(const wchar_t* pText);
- static int GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, int maxWidth, bool outline, int& width, int& height);
+ static int GetCharCountInWidth(_FontImpl* pFont, const wchar_t* pText, int textLength, float maxWidth, bool outline, float& width, float& height);
- static int GetCharCountInWidth(_Font* pFont, const wchar_t* pText, int textLength, float maxWidth, bool outline, float& width, float& height);
-
- static result GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height);
-
- static result GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, int& width, int& height);
-
- static result GetTextExtent(_Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height);
+ static result GetTextExtent(_FontImpl* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height);
static result GetTextExtent(Font* pFont, const wchar_t* pText, int textLength, bool outline, float& width, float& height);
static result CopyText(wchar_t* pDstText, const wchar_t* pSrcText);
- static result DrawText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength);
+ static result DrawText(_CanvasImpl& canvasImpl, int x, int y, const wchar_t* pText, int textLength);
- static result DrawText(_Canvas& canvas, float x, float y, const wchar_t* pText, int textLength);
+ static result DrawText(_CanvasImpl& canvasImpl, float x, float y, const wchar_t* pText, int textLength);
- static result DrawOutlineText(_Canvas& canvas, int x, int y, const wchar_t* pText, int textLength, Color outlineColor);
+ static result DrawOutlineText(_CanvasImpl& canvasImpl, int x, int y, const wchar_t* pText, int textLength, Color outlineColor);
- static result DrawOutlineText(_Canvas& canvas, float x, float y, const wchar_t* pText, int textLength, Color outlineColor);
+ static result DrawOutlineText(_CanvasImpl& canvasImpl, float x, float y, const wchar_t* pText, int textLength, Color outlineColor);
}; // TextUtility
struct TextLineComposeInfo
{
int length;
- int width;
- int height;
+ float width;
+ float height;
int endType;
};
result
Container::AddControl(Control* pControl)
{
+ SysTryReturnResult(NID_UI, pControl != null, E_INVALID_ARG, "pControl is null.");
_ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
result
Container::RemoveControl(Control* pControl)
{
+ SysTryReturnResult(NID_UI, pControl != null, E_INVALID_ARG, "pControl is null.");
_ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
result
Container::SetControlAt(Control* pControl, int index)
{
+ SysTryReturnResult(NID_UI, pControl != null, E_INVALID_ARG, "pControl is null.");
_ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
result
Container::GetControlAt(const Control* pControl, int& index) const
{
+ SysTryReturnResult(NID_UI, pControl != null, E_INVALID_ARG, "pControl is null.");
const _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
bool
Container::IsAncestorOf(const Control* pControl) const
{
+ SysTryReturnResult(NID_UI, pControl != null, E_INVALID_ARG, "pControl is null.");
const _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
bool
Container::OnEvaluateSize(FloatDimension& evaluatedSize)
{
-
+ return false;
}
void
bool
Container::IsControlAlwaysAtBottom(const Control* pControl) const
{
+ SysTryReturnResult(NID_UI, pControl != null, E_INVALID_ARG, "pControl is null.");
const _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
bool
Container::IsControlAlwaysOnTop(const Control* pControl) const
{
+ SysTryReturnResult(NID_UI, pControl != null, E_INVALID_ARG, "pControl is null.");
const _ContainerImpl* pImpl = _ContainerImpl::GetInstance(*this);
SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
result
Control::AddGestureDetector(TouchGestureDetector* pGestureDetector)
{
+ SysTryReturnResult(NID_UI, pGestureDetector != null, E_INVALID_ARG, "pGestureDetector is null.");
_ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this);
SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use.");
result
Control::RemoveGestureDetector(TouchGestureDetector* pGestureDetector)
{
+ SysTryReturnResult(NID_UI, pGestureDetector != null, E_INVALID_ARG, "pGestureDetector is null.");
_ControlImpl* pControlImpl = _ControlImpl::GetInstance(*this);
SysAssertf(pControlImpl != null, "Not yet constructed. Construct() should be called before use.");
result
TouchGestureDetector::StartOnFailureOf(TouchGestureDetector* pGestureDetector)
{
+ SysTryReturnResult(NID_UI, pGestureDetector != null, E_INVALID_ARG, "pGestureDetector is null.");
SysAssertf(__pTouchGestureDetectorImpl != null, "Not yet constructed. Construct() should be called before used.");
result r = __pTouchGestureDetectorImpl->StartOnFailureOf(*pGestureDetector);
if (pChildContainer)
{
_ContainerImpl* pParent = pChildContainer->GetParent();
- if (pParent)
- {
- r = pParent->RemoveChild(pChildContainer, false);
- SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- }
+ SysTryReturn(NID_UI, pParent, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The control is not a child of this container.");
+
+ r = pParent->RemoveChild(pChildContainer, false);
+ SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
pChildContainer->RemoveAllChildren(true);
r = GetLastResult();
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- Container* pContainer = &pChildContainer->GetPublic();
- delete pContainer;
- pContainer = null;
+ if (deallocate)
+ {
+ Container* pContainer = &pChildContainer->GetPublic();
+ delete pContainer;
+ pContainer = null;
+ }
}
else
{
+ SysTryReturn(NID_UI, pChild, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The control is not a child of this container.");
r = RemoveChild(pChild, deallocate);
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
delete pContainer;
pContainer = null;
}
- r = RemoveChild(index);
- SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ else
+ {
+ r = RemoveChild(index);
+ SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
return r;
}
}
void
-_ContainerImpl::RemoveAllChildren(bool detachSystemChild)
+_ContainerImpl::RemoveAllChildren(bool detachSystemChild, bool callOnDetachingFromMaintree)
{
+ if (callOnDetachingFromMaintree && !GetCore().IsPostOrderTraversal())
+ {
+ GetCore().GetControlDelegate().OnDetachingFromMainTree();
+ }
GetCore().DetachAllChildren(detachSystemChild, true);
SysAssert(GetLastResult() == E_SUCCESS);
+ if (callOnDetachingFromMaintree && GetCore().IsPostOrderTraversal())
+ {
+ GetCore().GetControlDelegate().OnDetachingFromMainTree();
+ }
ArrayList* pChildrenList = static_cast <ArrayList*>(GetChildrenPublic());
DeleteAllChildren(this, detachSystemChild, pChildrenList);
}
E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range.");\r
}\r
r = CallOnDetachingFromMainTree(*pChild);\r
+ pChild->SetCalledCallAttachingToMainTree(false);\r
pChild->SetCalledCallAttachedToMainTree(false);\r
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
}\r
if (__isPostOrderTraversal)\r
{\r
r = control.GetControlDelegate().OnDetachingFromMainTree();\r
- pChild->SetCalledCallAttachedToMainTree(false);\r
+ control.SetCalledCallAttachingToMainTree(false);\r
+ control.SetCalledCallAttachedToMainTree(false);\r
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
}\r
\r
if (!(__isControlFontChanged || pControlManager->IsDefaultFontChanged())\r
&& __pFont != null\r
&& ((__pFont->GetSize() == textSize || __pFont->GetSizeF() == floatTextSize))\r
- && (pFontImpl->GetStyle() == style))\r
+ && (pFontImpl->GetStyle() == static_cast<int>(style)))\r
{\r
return __pFont;\r
}\r
{\r
SetClientBounds(FloatRectangle(0.0f, 0.0f, GetSizeF().width, GetSizeF().height));\r
}\r
+ if (__pFocusVisualElement)\r
+ {\r
+ __pFocusVisualElement->SetBounds(FloatRectangle(0, 0, __bounds.width, __bounds.height));\r
+ }\r
delegate.OnBoundsChanged();\r
\r
_Control* pParent = GetParent();\r
, __pDetectStartedGestureMap(null)\r
, __pDelayedTouchInfoList(null)\r
, __touchMoveAllowance(3)\r
+ , __inputLockRefCount(0)\r
+ , __screenDpi(0)\r
, __isSentDelayedEvent(false)\r
, __isSendingDelayedEvent(false)\r
, __isChangingEventTarget(false)\r
, __fontFileName(L"")\r
, __pPreviousFocus(null)\r
, __pNextFocus(null)\r
- , __pFocusVisualElement(null)\r
- , __inputLockRefCount(0)\r
- , __screenDpi(0)\r
{\r
ClearLastResult();\r
\r
__isPostOrderTraversal = postOrderTraversal;\r
}\r
\r
+bool\r
+_Control::IsPostOrderTraversal(void)\r
+{\r
+ return __isPostOrderTraversal;\r
+}\r
+\r
void\r
_Control::SetParent(_Control* pParent)\r
{\r
\r
if (__pFocusVisualElement)\r
{\r
- Rectangle rectangle = this->GetBounds();\r
+ Rectangle rectangle = GetBounds();\r
__pFocusVisualElement->SetBounds(FloatRectangle(0, 0, rectangle.width, rectangle.height));\r
unique_ptr<Canvas>pCanvas(__pFocusVisualElement->GetCanvasN());\r
pCanvas->SetBackgroundColor(0x55555555);\r
_ControlImplManager::GetFormOrientationStatus(_ControlImpl* pControlImpl)
{
_FormImpl* pParentImpl = null;
- _ControlImpl* pTempControlImpl = pControlImpl;
OrientationStatus orientation = ORIENTATION_STATUS_NONE;
while(pControlImpl)
{
_ControlImpl* pImpl = _ControlImpl::GetInstance(*pOwner);
pImpl->GetCore().DetachOwnee(GetCore());
}
- GetCore().GetControlDelegate().OnDetachingFromMainTree();
- RemoveAllChildren(true);
+ RemoveAllChildren(true, true);
Window* pWindow = &GetPublic();
delete pWindow;
pWindow = null;
}
void
-_AnimationManager::RemoveAnimationForProperty(VisualElement& target, const Tizen::Base::String& property)
+_AnimationManager::RemoveAnimationByProperty(VisualElement& target, const Tizen::Base::String& property)
{
if (__pCurrentTransaction)
{
__pCurrentTransactionExceptGroup = pParentTransaction;
}
}
-
- __pCurrentTransaction->RemoveChild(transactionId);
+ else
+ {
+ __pCurrentTransaction->RemoveChild(transactionId);
+ }
return E_SUCCESS;
}
//for animation
result AddAnimation(VisualElement& target, const Tizen::Base::String* pKeyName, VisualElementAnimation& animation);
result RemoveAnimation(VisualElement& target, const Tizen::Base::String& keyName);
- void RemoveAnimationForProperty(VisualElement& target, const Tizen::Base::String& property);
+ void RemoveAnimationByProperty(VisualElement& target, const Tizen::Base::String& property);
void RemoveAllAnimations(VisualElement& target);
bool DoesAnimationExist(VisualElement& target, const Tizen::Base::String& keyName) const;
- bool DoesAnimationExistForProperty(VisualElement& target, const Tizen::Base::String& keyName) const;
VisualElementAnimation* GetAnimationN(VisualElement& target, const Tizen::Base::String& keyName) const;
//for transaction
return __animations.GetCount();
}
-_AnimationData*
-_TransactionNode::GetAnimationDataInPending(VisualElement& target, const String& keyName) const
-{
- int pendingCount = __pendingAnimations.GetCount();
-
- _AnimationData* pAnimationData = null;
-
- for (int index = 0; index < pendingCount; index++)
- {
- pAnimationData = AD_CONST_CAST(__pendingAnimations.GetAt(index));
-
- if (&(pAnimationData->GetTarget()) == &target && pAnimationData->IsRemoved() == false)
- {
- if (pAnimationData->GetName() == keyName)
- {
- return pAnimationData;
- }
- }
- }
-
- return null;
-}
-
-_AnimationData*
-_TransactionNode::GetAnimationDataInPendingByProperty(VisualElement& target, const String& property) const
-{
- int pendingCount = __pendingAnimations.GetCount();
-
- _AnimationData* pAnimationData = null;
- VisualElementPropertyAnimation* pPropertyAnimation = null;
-
- for (int index = 0; index < pendingCount; index++)
- {
- pAnimationData = AD_CONST_CAST(__pendingAnimations.GetAt(index));
-
- if (&(pAnimationData->GetTarget()) == &target && pAnimationData->IsRemoved() == false)
- {
- pPropertyAnimation = dynamic_cast< VisualElementPropertyAnimation* >(&(pAnimationData->GetAnimation()));
-
- if(pPropertyAnimation != null && pPropertyAnimation->GetPropertyName() == property)
- {
- return pAnimationData;
- }
- }
- }
-
- return null;
-}
-
result
-_TransactionNode::AddAnimationData(_AnimationData& animationData)
+_TransactionNode::AddAnimation(VisualElement& target, const String* pKeyName, VisualElementAnimation& animation)
{
result r = E_SUCCESS;
- ArrayList* pAnimationList = null;
- VisualElement* pTarget = &(animationData.GetTarget());
-
- __animations.GetValue(pTarget, pAnimationList);
+ ArrayList* pAnimationList = __animations.GetList(&target);
if (pAnimationList == null)
{
r = pAnimationList->Construct();
SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Failed to construct animation list.");
- __animations.Add(pTarget, pAnimationList);
- }
-
- animationData.SetBaseTime(_AnimationTime::GetTime());
- animationData.SetPendingMode(_AnimationData::_PENDING_MODE_NONE);
-
- return pAnimationList->Add(animationData);
-}
-
-void
-_TransactionNode::RemoveAnimationData(_AnimationData& animationData)
-{
- ArrayList* pAnimationList = null;
- VisualElement* pTarget = &(animationData.GetTarget());
-
- __animations.GetValue(pTarget, pAnimationList);
-
- if (pAnimationList == null)
- {
- return;
- }
-
- pAnimationList->Remove(animationData, true);
-
- if (pAnimationList->GetCount() <= 0)
- {
- __animations.Remove(pTarget);
-
- delete pAnimationList;
+ __animations.Add(&target, pAnimationList);
}
-}
-
-result
-_TransactionNode::SetAnimationDataAsPending(_AnimationData& animationData, bool remove, bool completed)
-{
- result r = E_SUCCESS;
-
- if (remove == true)
- {
- if (animationData.IsRemoved())
- {
- return E_SUCCESS;
- }
-
- if (animationData.GetPendingMode() == _AnimationData::_PENDING_MODE_NONE)
- {
- r = __pendingAnimations.Add(animationData);
- }
-
- animationData.SetPendingMode(_AnimationData::_PENDING_MODE_REMOVING);
-
- animationData.NotifyAnimationFinished(completed);
-
- animationData.SetPendingMode(_AnimationData::_PENDING_MODE_REMOVE);
- }
- else
- {
- animationData.SetPendingMode(_AnimationData::_PENDING_MODE_ADD);
-
- r = __pendingAnimations.Add(animationData);
- }
-
- return r;
-}
-
-result
-_TransactionNode::AddAnimation(VisualElement& target, const String* pKeyName, VisualElementAnimation& animation)
-{
- result r = E_SUCCESS;
_AnimationData* pAnimationData = new (std::nothrow) _AnimationData(target, pKeyName, animation);
SysTryReturnResult(NID_UI_ANIM, pAnimationData != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- if (__isInAnimationTick == true)
- {
- r = SetAnimationDataAsPending(*pAnimationData, false);
- }
- else
- {
- r = AddAnimationData(*pAnimationData);
- }
+ r = pAnimationList->Add(*pAnimationData);
if (r != E_SUCCESS)
{
result r = E_OBJ_NOT_FOUND;
- _AnimationData* pAnimationData = GetAnimationDataInPending(target, keyName);
-
- if (pAnimationData != null)
- {
- r = SetAnimationDataAsPending(*pAnimationData, true, false);
- SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Failed to add to pending list.");
-
- return E_SUCCESS;
- }
-
- ArrayList* pAnimationList = null;
-
- __animations.GetValue(&target, pAnimationList);
+ ArrayList* pAnimationList = __animations.GetList(&target);
if (pAnimationList == null)
{
return E_OBJ_NOT_FOUND;
}
+ _AnimationData* pAnimationData = null;
+
int animationCount = pAnimationList->GetCount();
for (int index = 0; index < animationCount; index++)
{
pAnimationData = AD_CAST(pAnimationList->GetAt(index));
- if (pAnimationData->IsRemoved() == false)
+ if (pAnimationData->GetName() == keyName)
{
- if (pAnimationData->GetName() == keyName)
+ if (pAnimationData->IsRemoved() == false)
{
- r = SetAnimationDataAsPending(*pAnimationData, true, false);
+ r = SetAnimationDataAsPending(*pAnimationData, false);
SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Failed to add to pending list.");
-
- break;
}
+
+ break;
}
}
return;
}
- result r = E_OBJ_NOT_FOUND;
-
- _AnimationData* pAnimationData = GetAnimationDataInPendingByProperty(target, property);
-
- if (pAnimationData != null)
- {
- r = SetAnimationDataAsPending(*pAnimationData, true, false);
- SysTryReturnVoidResult(NID_UI_ANIM, r == E_SUCCESS, r, "[%s] Failed to add to pending list.", GetErrorMessage(r));
-
- return;
- }
-
- ArrayList* pAnimationList = null;
-
- __animations.GetValue(&target, pAnimationList);
+ ArrayList* pAnimationList = __animations.GetList(&target);
if (pAnimationList == null)
{
return;
}
+ result r = E_SUCCESS;
+
VisualElementPropertyAnimation* pPropertyAnimation = null;
+ _AnimationData* pAnimationData = null;
int animationCount = pAnimationList->GetCount();
for (int index = 0; index < animationCount; index++)
{
pAnimationData = AD_CAST(pAnimationList->GetAt(index));
+ pPropertyAnimation = dynamic_cast< VisualElementPropertyAnimation* >(&(pAnimationData->GetAnimation()));
- if (pAnimationData->IsRemoved() == false)
+ if (pPropertyAnimation != null && pPropertyAnimation->GetPropertyName() == property)
{
- pPropertyAnimation = dynamic_cast< VisualElementPropertyAnimation* >(&(pAnimationData->GetAnimation()));
-
- if (pPropertyAnimation != null && pPropertyAnimation->GetPropertyName() == property)
+ if (pAnimationData->IsRemoved() == false)
{
- r = SetAnimationDataAsPending(*pAnimationData, true, false);
+ r = SetAnimationDataAsPending(*pAnimationData, false);
SysTryReturnVoidResult(NID_UI_ANIM, r == E_SUCCESS, r, "[%s] Failed to add to pending list.", GetErrorMessage(r));
-
- break;
}
}
}
return;
}
- ArrayList* pAnimationList = null;
-
- __animations.GetValue(&target, pAnimationList);
+ ArrayList* pAnimationList = __animations.GetList(&target);
if (pAnimationList == null)
{
{
pAnimationData = AD_CAST(pAnimationList->GetAt(index));
- r = SetAnimationDataAsPending(*pAnimationData, true, false);
+ r = SetAnimationDataAsPending(*pAnimationData, false);
SysTryReturnVoidResult(NID_UI_ANIM, r == E_SUCCESS, r, "[%s] Failed to add to pending list.", GetErrorMessage(r));
}
return null;
}
- _AnimationData* pAnimationData = GetAnimationDataInPending(target, keyName);
-
- if (pAnimationData != null)
- {
- return &(pAnimationData->GetAnimation());
- }
-
- ArrayList* pAnimationList = null;
-
- __animations.GetValue(&target, pAnimationList);
+ ArrayList* pAnimationList = __animations.GetList(&target);
if (pAnimationList == null)
{
return null;
}
+ _AnimationData* pAnimationData = null;
+
int animationCount = pAnimationList->GetCount();
for (int index = 0; index < animationCount; index++)
{
pAnimationData = AD_CAST(pAnimationList->GetAt(index));
- if (pAnimationData->IsRemoved() == false)
+ if (pAnimationData->GetName() == keyName)
{
- if (pAnimationData->GetName() == keyName)
+ if (pAnimationData->IsRemoved() == false)
{
return &(pAnimationData->GetAnimation());
}
+
+ return null;
}
}
return null;
}
-const VisualElementAnimation*
-_TransactionNode::GetAnimationByProperty(VisualElement& target, const String& property) const
-{
- if (GetAnimationCount() <= 0)
- {
- return null;
- }
-
- _AnimationData* pAnimationData = GetAnimationDataInPendingByProperty(target, property);
-
- if (pAnimationData != null)
- {
- return &(pAnimationData->GetAnimation());
- }
-
- ArrayList* pAnimationList = null;
-
- __animations.GetValue(&target, pAnimationList);
-
- if (pAnimationList == null)
- {
- return null;
- }
-
- const VisualElementPropertyAnimation* pPropertyAnimation = null;
-
- int animationCount = pAnimationList->GetCount();
-
- for (int index = 0; index < animationCount; index++)
- {
- pAnimationData = AD_CAST(pAnimationList->GetAt(index));
-
- if (pAnimationData->IsRemoved() == false)
- {
- pPropertyAnimation = dynamic_cast< VisualElementPropertyAnimation* >(&(pAnimationData->GetAnimation()));
-
- if (pPropertyAnimation != null && pPropertyAnimation->GetPropertyName() == property)
- {
- break;
- }
- }
- }
-
- return pPropertyAnimation;
-}
-
-const VisualElementAnimation*
-_TransactionNode::GetChildrenAnimationByProperty(VisualElement& target, const String& property) const
+result
+_TransactionNode::SetAnimationDataAsPending(_AnimationData& animationData, bool completed)
{
- const VisualElementAnimation* pAnimation = GetAnimationByProperty(target, property);
-
- if (pAnimation != null)
- {
- return pAnimation;
- }
-
- int childrenCount = GetChildrenCount();
+ result r = E_SUCCESS;
- if (childrenCount <= 0)
+ if (animationData.IsRemoved())
{
- return null;
+ return E_SUCCESS;
}
- _TransactionNode* pChild = null;
+ r = __pendingAnimations.Add(animationData);
- for (int index = 0; index < childrenCount; index++)
- {
- pChild = __children.GetChildAt(index);
+ animationData.SetPendingMode(_AnimationData::_PENDING_MODE_REMOVING);
- pAnimation = pChild->GetChildrenAnimationByProperty(target, property);
+ animationData.NotifyAnimationFinished(completed);
- if (pAnimation != null)
- {
- break;
- }
- }
+ animationData.SetPendingMode(_AnimationData::_PENDING_MODE_REMOVE);
- return pAnimation;
+ return r;
}
void
VisualElement* pTarget = null;
ArrayList* pAnimationList = null;
- //TODO: Check dep.
while (pMapEnum->MoveNext() == E_SUCCESS)
{
pMapEnum->GetKey(pTarget);
{
__status = _STATUS_RUNNING;
}
+
+ if (IsEmpty() == true)
+ {
+ __status = _STATUS_FINISH;
+ }
}
void
VisualElement* pTarget = &(animationData.GetTarget());
- ArrayList* pAnimationList = null;
-
- __animations.GetValue(pTarget, pAnimationList);
+ ArrayList* pAnimationList = __animations.GetList(pTarget);
if (pAnimationList != null)
{
if (pRemovePropertyAnimation && pRemovePropertyAnimation->GetPropertyName() == pPropertyAnimation->GetPropertyName())
{
- result r = SetAnimationDataAsPending(*pRemoveAnimationData, true, false);
+ result r = SetAnimationDataAsPending(*pRemoveAnimationData, false);
SysTryReturn(NID_UI_ANIM, r == E_SUCCESS, r, false, "[%s] Failed to add to pending list.", GetErrorMessage(r));
//TODO: refactoring for group
void
_TransactionNode::ProcessPendingAnimations(void)
{
- if (__isInAnimationTick == true)
- {
- return;
- }
-
- if (__pendingAnimations.GetCount() <= 0)
+ if (__isInAnimationTick == true || __pendingAnimations.GetCount() <= 0)
{
return;
}
{
pAnimationData = AD_CAST(__pendingAnimations.GetAt(index));
- switch(pAnimationData->GetPendingMode())
+ if (pAnimationData->GetPendingMode() == _AnimationData::_PENDING_MODE_REMOVE)
{
- case _AnimationData::_PENDING_MODE_ADD:
+ VisualElement* pTarget = &(pAnimationData->GetTarget());
- if (AddAnimationData(*pAnimationData) != E_SUCCESS)
- {
- delete pAnimationData;
- }
+ ArrayList* pAnimationList = __animations.GetList(pTarget);
+ SysAssertf(pAnimationList, "AnimationList is null!");
- __pendingAnimations.RemoveAt(index, false);
- break;
+ pAnimationList->Remove(*pAnimationData, true);
- case _AnimationData::_PENDING_MODE_REMOVE:
+ if (pAnimationList->GetCount() <= 0)
+ {
+ __animations.Remove(pTarget);
- RemoveAnimationData(*pAnimationData);
+ delete pAnimationList;
+ }
__pendingAnimations.RemoveAt(index, false);
- break;
-
- default:
- break;
}
}
}
return;
}
- //TODO: Remove because set base time when starts
-#if 0
- if (__baseTime > tick) // this node is added in animation tick
- {
- return;
- }
-#endif
-
CalculateProgress(tick);
if (__status == _STATUS_READY)
}
}
}
-
- if (IsEmpty() == true)
- {
- __status = _STATUS_FINISH;
- }
}
void
if (__status == _STATUS_FINISH || pAnimationData->GetStatus() == _AnimationData::_STATUS_FINISH)
{
- SetAnimationDataAsPending(*pAnimationData, true, true);
+ SetAnimationDataAsPending(*pAnimationData, true);
//TODO: refactoring for group
if (IsRemovable() == false)
enum _PendingMode
{
_PENDING_MODE_NONE,
- _PENDING_MODE_ADD,
_PENDING_MODE_REMOVING,
_PENDING_MODE_REMOVE
};
void RemoveChildrenAllAnimations(VisualElement& target);
const VisualElementAnimation* GetChildrenAnimation(VisualElement& target, const Tizen::Base::String& keyName) const;
- const VisualElementAnimation* GetChildrenAnimationByProperty(VisualElement& target, const Tizen::Base::String& property) const;
void DrawTargets(void);
private:
_TransactionNode& operator =(const _TransactionNode& rhs);
- result AddAnimationData(_AnimationData& animationData);
- void RemoveAnimationData(_AnimationData& animationData);
- result SetAnimationDataAsPending(_AnimationData& animationData, bool remove, bool completed = false);
-
- _AnimationData* GetAnimationDataInPending(VisualElement& target, const Tizen::Base::String& keyName) const;
- _AnimationData* GetAnimationDataInPendingByProperty(VisualElement& target, const Tizen::Base::String& property) const;
-
result RemoveAnimation(VisualElement& target, const Tizen::Base::String& keyName);
void RemoveAnimationByProperty(VisualElement& target, const Tizen::Base::String& property);
void RemoveAllAnimations(void);
void RemoveAllAnimations(VisualElement& target);
const VisualElementAnimation* GetAnimation(VisualElement& target, const Tizen::Base::String& property) const;
- const VisualElementAnimation* GetAnimationByProperty(VisualElement& target, const Tizen::Base::String& property) const;
+
+ result SetAnimationDataAsPending(_AnimationData& animationData, bool completed);
void ReservedRemove(bool remove = true);
bool IsReservedRemove(void) const;
ChildrenListT __children;
Tizen::Base::Collection::ArrayList __pendingAnimations;
- Tizen::Base::Collection::HashMapT<VisualElement*, Tizen::Base::Collection::ArrayList*> __animations;
+
+ class AnimationHashMapT : public Tizen::Base::Collection::HashMapT<VisualElement*, Tizen::Base::Collection::ArrayList*>
+ {
+ public:
+ Tizen::Base::Collection::ArrayList* GetList(VisualElement* pTarget) const
+ {
+ Tizen::Base::Collection::ArrayList* pAnimationList = null;
+
+ GetValue(pTarget, pAnimationList);
+
+ return pAnimationList;
+ }
+ };
+
+ AnimationHashMapT __animations;
}; // _TransactionNode
}}} // Tizen::Ui::Animations
{ // remove sub property
for(int i = 0 ; pSubProperties[i] != NULL ; i++)
{
- pAnimationManager->RemoveAnimationForProperty(*__pPublicInstance, *pSubProperties[i]);
+ pAnimationManager->RemoveAnimationByProperty(*__pPublicInstance, *pSubProperties[i]);
}
}
if (unlikely(pAnimation))
// Adding property animation causes previous animation for same property to be removed in Animation Manager.
if (unlikely(IsFailed(AddAnimation(null, *pAnimation))))
{
- pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, property);
+ pAnimationManager->RemoveAnimationByProperty(*__pPresentation->__pPublicInstance, property);
r = false;
}
{
// WARNING:
// Remove previous animation even when trying to change the property without animation.
- pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, property);
+ pAnimationManager->RemoveAnimationByProperty(*__pPresentation->__pPublicInstance, property);
r = false;
}
}
else
{
- pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, property);
+ pAnimationManager->RemoveAnimationByProperty(*__pPresentation->__pPublicInstance, property);
r = false;
}
return r;
if (unlikely(IsFailed(AddAnimation(null, *pPropertyAnimation))))
{
needPresentationUpdate = true;
- //pAnimationManager->RemoveAnimationForProperty(*presentation.GetPublic(), property);
+ //pAnimationManager->RemoveAnimationByProperty(*presentation.GetPublic(), property);
}
delete pPropertyAnimation;
{
// WARNING:
// Remove previous animation even when trying to change the property without animation.
- pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, property);
- pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, *pVePrivPropShowOpacity);
+ pAnimationManager->RemoveAnimationByProperty(*__pPresentation->__pPublicInstance, property);
+ pAnimationManager->RemoveAnimationByProperty(*__pPresentation->__pPublicInstance, *pVePrivPropShowOpacity);
needPresentationUpdate = true;
}
}
else
{
- pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, property);
- pAnimationManager->RemoveAnimationForProperty(*__pPresentation->__pPublicInstance, *pVePrivPropShowOpacity);
+ pAnimationManager->RemoveAnimationByProperty(*__pPresentation->__pPublicInstance, property);
+ pAnimationManager->RemoveAnimationByProperty(*__pPresentation->__pPublicInstance, *pVePrivPropShowOpacity);
needPresentationUpdate = true;
}
Color color;
float size = 0;
int opacity = 0;
- Rectangle buttonRect(0, 0, 0, 0);
+ FloatRectangle buttonRect(0.0f, 0.0f, 0.0f, 0.0f);
Tizen::Base::String elementString;
GetProperty(pControl, &pControlProperty);
return null;
}
- buttonRect = pControlProperty->GetRect();
+ buttonRect = pControlProperty->GetRectF();
if (pControl->GetElement(L"text", elementString))
{
__pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
__pTextObject->Compose();
}
- else
- {
- fontSize = __pButton->GetTextSizeF();
- SetTextSize(fontSize);
+ //else
+ //{
+ // fontSize = __pButton->GetTextSizeF();
+ // SetTextSize(fontSize);
- __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
- __pTextObject->Compose();
- }
+ // __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
+ // __pTextObject->Compose();
+ //}
__pTextObject->SetForegroundColor(__pButton->GetTextColor(__pButton->GetButtonStatus()), 0, __pTextObject->GetTextLength());
__pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));
_UiBuilderControlLayout* pControlProperty = null;
CheckButton* pCheck = null;
BackgroundStyle backgroundStyle = BACKGROUND_STYLE_DEFAULT;
- Rectangle rect;
+ FloatRectangle rect;
Tizen::Base::String elementString;
String checkText;
}
pCheck = new (std::nothrow) CheckButton();
- rect = pControlProperty->GetRect();
+ rect = pControlProperty->GetRectF();
Tizen::Base::String styleString;
styleString = pControlProperty->GetStyle();
}
#if 0
//-------safety for Minimum size-------------------
- tempRect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->GetRect();
+ tempRect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->GetRectF();
if ((pStyleString != null) &&
((strcmp((const char*)pStyleString,"CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER") == 0)
|| (strcmp((const char*)pStyleString,"CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER") == 0)
(pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->SetRect(tempRect.x,tempRect.y,tempRect.w,tempRect.h);
- tempRect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->GetRect();
+ tempRect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->GetRectF();
if ((pStyleString != null) &&
((strcmp((const char*)pStyleString,"CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER") == 0)
|| (strcmp((const char*)pStyleString,"CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER") == 0)
_DateTimePicker::_DateTimePicker(_DateTimePresenter* pPresenter, const String& title)
: __pPresenter(pPresenter)
- , __pHeader(null)
, __pFooter(null)
, __title(title)
, __pDateTimeChangeEvent(null)
__pDateTimeChangeEvent = null;
}
- if (__pHeader != null)
- {
- DetachSystemChild(*__pHeader);
- delete __pHeader;
- __pHeader = null;
- }
-
if (__pFooter != null)
{
DetachSystemChild(*__pFooter);
result r = E_SUCCESS;
FloatDimension pickerSize(0.0f, 0.0f);
FloatDimension screenSize(0.0f, 0.0f);
+ FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f);
_ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
+ _DateTimePresenter* pPresenter = null;
+ _DateTimePicker* pView = null;
SysTryReturn(NID_UI_CTRL, ((style & DATETIME_OUTPUT_STYLE_DATETIME) != DATETIME_OUTPUT_STYLE_INVALID), null, E_INVALID_ARG,
"[E_INVALID_ARG] Invalid argument(s) is used. The style provided is not present in the _DateTimeOutputStyle list.");
- _DateTimePresenter* pPresenter = new (std::nothrow) _DateTimePresenter(style, title);
+ pPresenter = new (std::nothrow) _DateTimePresenter(style, title);
SysTryReturn(NID_UI_CTRL, (pPresenter != null), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- _DateTimePicker* pView = new (std::nothrow) _DateTimePicker(pPresenter, title);
+ pView = new (std::nothrow) _DateTimePicker(pPresenter, title);
SysTryCatch(NID_UI_CTRL, (pView != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pView->InitializeFont();
pickerSize.width = screenSize.height;
pickerSize.height = screenSize.width;
}
+
+ indicatorBounds = pView->GetIndicatorBoundsF();
+ pickerSize.height -= indicatorBounds.height;
+
+ r = pView->SetPosition(FloatPoint(0.0f, indicatorBounds.height));
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM,
+ "[E_SYSTEM] A system error has occurred. Failed to set the position for this control");
+
r = pView->SetSize(pickerSize);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM,
"[E_SYSTEM] A system error has occurred. Failed to set the size for this control");
- if (title.IsEmpty() == false && orientation == _CONTROL_ORIENTATION_PORTRAIT)
- {
- r = pView->CreateHeader();
- SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. Failed to create the header for this control");
- }
-
r = pView->CreateFooter();
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , E_SYSTEM,
"[E_SYSTEM] A system error has occurred. Failed to create the footer for this control");
}
result
-_DateTimePicker::CreateHeader(void)
-{
- FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f);
- FloatRectangle headerBounds(0.0f, 0.0f, 0.0f, 0.0f);
- _Frame* pFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturnResult(NID_UI_CTRL, (pFrame != null), E_SYSTEM,
- "A system error has occurred. Failed to get the instance of frame.");
-
- _Form* pForm = pFrame->GetCurrentForm();
- SysTryReturnResult(NID_UI_CTRL, (pForm != null), E_SYSTEM,
- "A system error has occurred. Failed to get the instance of form.");
-
- indicatorBounds = pForm->GetIndicatorBoundsF();
-
- _Toolbar* pHeader = _Toolbar::CreateToolbarN(true);
- result r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, (pHeader != null), r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = AttachSystemChild(*pHeader);
- if (r != E_SUCCESS)
- {
- delete pHeader;
- return r;
- }
-
- pHeader->SetStyle(TOOLBAR_TITLE);
- pHeader->SetTitleText(__title);
- pHeader->SetMovable(true);
- pHeader->SetResizable(true);
- headerBounds = pHeader->GetBoundsF();
- headerBounds.y = indicatorBounds.height;
- pHeader->SetBounds(headerBounds);
- pHeader->SetMovable(false);
- pHeader->SetResizable(false);
-
- if (__pHeader != null)
- {
- DetachSystemChild(*__pHeader);
- delete __pHeader;
- __pHeader = null;
- }
-
- __pHeader = pHeader;
-
- return E_SUCCESS;
-}
-
-result
-_DateTimePicker::DestroyHeader(void)
-{
- if (__pHeader != null)
- {
- DetachSystemChild(*__pHeader);
- delete __pHeader;
- __pHeader = null;
- }
-
- return E_SUCCESS;
-}
-
-result
_DateTimePicker::CreateFooter(void)
{
result r = E_SUCCESS;
return E_SUCCESS;
}
-FloatRectangle
-_DateTimePicker::GetHeaderBounds(void)
-{
- FloatRectangle headerBounds(0.0f, 0.0f, 0.0f, 0.0f);
- float headerHeight = 0.0f;
-
- GET_SHAPE_CONFIG(HEADER::HEIGHT, GetOrientation(), headerHeight);
-
- _Frame* pFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturn(NID_UI_CTRL, (pFrame != null), FloatRectangle(), E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. Failed to get the instance of frame.");
-
- _Form* pForm = pFrame->GetCurrentForm();
- SysTryReturn(NID_UI_CTRL, (pForm != null), FloatRectangle(), E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. Failed to get the instance of form.");
-
- headerBounds = pForm->GetIndicatorBoundsF();
- headerBounds.height += headerHeight;
-
- return headerBounds;
-}
-
result
_DateTimePicker::CreateDisplayVisualElement(void)
{
result r = E_SUCCESS;
FloatDimension pickerSize(0.0f, 0.0f);
FloatDimension screenSize(0.0f, 0.0f);
+ FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f);
screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
pickerSize = screenSize;
pickerSize.height = screenSize.width;
}
+ indicatorBounds = GetIndicatorBoundsF();
+ pickerSize.height -= indicatorBounds.height;
+
+ SetMovable(true);
SetResizable(true);
- SetSize(pickerSize);
- SetResizable(false);
- if (__pHeader != null)
- {
- r = DestroyHeader();
- SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. Failed to destroy the header for this control.");
- }
+ SetSize(pickerSize);
+ SetPosition(FloatPoint(0.0f, indicatorBounds.height));
- if (orientation == _CONTROL_ORIENTATION_PORTRAIT && __title.IsEmpty() == false)
- {
- r = CreateHeader();
- SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. Failed to create the header for this control.");
- }
+ SetMovable(false);
+ SetResizable(false);
r = DestroyFooter();
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), E_SYSTEM,
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.");
}
- if (__pHeader != null)
- {
- r = __pHeader->SetFont(pFont->GetFaceName());
- SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.");
- }
-
if (__pFooter != null)
{
for (int i=0; i < __pFooter->GetItemCount(); i++)
return r;
}
+FloatRectangle
+_DateTimePicker::GetIndicatorBoundsF(void)
+{
+ FloatRectangle indicatorBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ _Frame* pFrame = null;
+ _Form* pForm = null;
+
+ pFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+ SysTryReturn(NID_UI_CTRL, (pFrame != null), FloatRectangle(), E_SYSTEM,
+ "[E_SYSTEM] A system error has occurred. Failed to get the instance of frame.");
+
+ pForm = pFrame->GetCurrentForm();
+ SysTryReturn(NID_UI_CTRL, (pForm != null), FloatRectangle(), E_SYSTEM,
+ "[E_SYSTEM] A system error has occurred. Failed to get the instance of form.");
+
+ if (pForm->HasIndicator())
+ {
+ indicatorBounds = pForm->GetIndicatorBoundsF();
+ }
+
+ return indicatorBounds;
+}
+
}}} // Tizen::Ui::Controls
, __isFocusBoxChanged(false)
, __inputComposing(DATETIME_INPUT_END)
, __changeFocusCounter(DATE_TIME_CHANGE_FOCUS_COUNTER_MIN)
+ , __title(title)
, __pPmBoxNormalBitmap(null)
, __pPmBoxEffectBitmap(null)
, __pPmBoxPressedEffectBitmap(null)
// Draw DisplayBox Background
DrawBackground(*pCanvas);
+ if (!__title.IsEmpty())
+ {
+ DrawTitle(*pCanvas);
+ }
+
DrawDividers(*pCanvas);
for (int i = 0; i < __outputBoxMaxCount; i++)
GET_SHAPE_CONFIG(DATETIMEPICKER::AMPM_WIDTH, orientation, amPmWidth);
GET_SHAPE_CONFIG(DATETIMEPICKER::TIME_AMPM_MARGIN, orientation, amPmMargin);
- dateTimeElementY = (outputAreaBounds.height - dateTimeDisplayBoxHeight) / 2.0f;
- amPmElementY = (outputAreaBounds.height - amPmDisplayBoxHeight) / 2.0f;
-
if (__pickerStyle == DATETIME_OUTPUT_STYLE_DATE)
{
dateBounds.width = monthBounds.width = yearBounds.width = dpDateElementWidth;
dateBounds.height = monthBounds.height = yearBounds.height = hourBounds.height = minuteBounds.height = dateTimeDisplayBoxHeight;
amPmBounds.height = amPmDisplayBoxHeight;
+ if (__title.IsEmpty())
+ {
+ dateTimeElementY = (outputAreaBounds.height - dateTimeDisplayBoxHeight) / 2.0f;
+ amPmElementY = (outputAreaBounds.height - amPmDisplayBoxHeight) / 2.0f;
+ }
+ else
+ {
+ float topMargin = 0.0f;
+ float bottomMargin = 0.0f;
+ float titleHeight = 0.0f;
+
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_TOP_MARGIN, orientation, topMargin);
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_BOTTOM_MARGIN, orientation, bottomMargin);
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_HEIGHT, orientation, titleHeight);
+
+ dateTimeElementY = topMargin + titleHeight + bottomMargin;
+ amPmElementY = topMargin + titleHeight;
+ }
+
dateBounds.y = monthBounds.y = yearBounds.y = hourBounds.y = minuteBounds.y = dateTimeElementY;
amPmBounds.y = amPmElementY;
}
else
{
- hourBounds.x = dateTimeMargin + timeOutputMargin;
+ hourBounds.x = timeOutputMargin;
minuteBounds.x = hourBounds.x + hourBounds.width + colonWidth + 2 * colonMargin;
amPmBounds.x = minuteBounds.x + minuteBounds.width + amPmMargin;
}
r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pPmBoxNormalBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
- r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pPmBoxEffectBitmap);
+ r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_NORMAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pPmBoxEffectBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
r = GET_BITMAP_CONFIG_N(DATETIMEPICKER::AMPM_BG_PRESSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pPmBoxPressedEffectBitmap);
{
result r = E_SUCCESS;
String text;
+ int fontSize = 0;
int number = 0;
int boxId = __pDisplayBox[index]->GetDisplayBoxId();
number = GetNumberInBox(boxId);
DateTimePickerStatus status = DATETIME_STATUS_NORMAL;
+ GET_SHAPE_CONFIG(DATETIMEPICKER::FONT_SIZE, __pView->GetOrientation(), fontSize);
+
+ r = _FontImpl::GetInstance(*__pFont)->SetSize(fontSize);
+ SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
+
if (__pView->IsEnabled() == false)
{
status = DATETIME_STATUS_DISABLED;
}
void
+_DateTimePresenter::DrawTitle(Canvas& canvas)
+{
+ result r = E_SUCCESS;
+ float marginX = 0.0f;
+ float marginY = 0.0f;
+ int fontSize = 0;
+ Color color(0, 0, 0, 0);
+ _ControlOrientation orientation = __pView->GetOrientation();
+
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_LEFT_MARGIN, orientation, marginX);
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_TOP_MARGIN, orientation, marginY);
+
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_FONT_SIZE, orientation, fontSize);
+
+ r = _FontImpl::GetInstance(*__pFont)->SetSize(fontSize);
+ SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (__pView->IsEnabled())
+ {
+ GET_COLOR_CONFIG(DATETIMEPICKER::TITLE_NORMAL, color);
+ }
+ else
+ {
+ GET_COLOR_CONFIG(DATETIMEPICKER::TITLE_DISABLED, color);
+ }
+
+ canvas.SetForegroundColor(color);
+ canvas.SetFont(*__pFont);
+ canvas.DrawText(FloatPoint(marginX, marginY), __title);
+
+ return;
+}
+
+void
_DateTimePresenter::DrawDividers(Canvas& canvas)
{
result r = E_SUCCESS;
GET_COLOR_CONFIG(DATETIMEPICKER::DIVIDER_LEFT_HALF, colorHalfLeft);
GET_COLOR_CONFIG(DATETIMEPICKER::DIVIDER_RIGHT_HALF, colorHalfRight);
- lineStart.y = (GetOutputArea().height - dividerHeight) / 2.0f;
- lineEnd.y = lineStart.y + dividerHeight;
+ if (__title.IsEmpty())
+ {
+ lineStart.y = (GetOutputArea().height - dividerHeight) / 2.0f;
+ lineEnd.y = lineStart.y + dividerHeight;
+ }
+ else
+ {
+ float topMargin = 0.0f;
+ float bottomMargin = 0.0f;
+ float titleHeight = 0.0f;
+
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_TOP_MARGIN, orientation, topMargin);
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_BOTTOM_MARGIN, orientation, bottomMargin);
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_HEIGHT, orientation, titleHeight);
+
+ lineStart.y = topMargin + titleHeight + bottomMargin;
+ lineEnd.y = lineStart.y + dividerHeight;
+ }
canvas.SetLineWidth(dividerWidth/2.0f);
_ControlOrientation orientation = __pView->GetOrientation();
FloatRectangle outputArea(0.0f, 0.0f, 0.0f, 0.0f);
- FloatRectangle headerBounds = __pView->GetHeaderBounds();
GET_SHAPE_CONFIG(DATETIMEPICKER::LEFT_MARGIN, orientation, outputArea.x);
GET_SHAPE_CONFIG(DATETIMEPICKER::TOP_MARGIN, orientation, outputArea.y);
- outputArea.y += headerBounds.y + headerBounds.height;
+ if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ float headerHeight = 0.0f;
+
+ GET_SHAPE_CONFIG(HEADER::HEIGHT, orientation, headerHeight);
+ outputArea.y += headerHeight;
+ }
+
outputArea.width = __pView->GetBounds().width - 2 * outputArea.x;
GET_SHAPE_CONFIG(DATETIMEPICKER::OUTPUT_AREA_HEIGHT, orientation, outputArea.height);
_DateTimePresenter::CalculateTouchOutputArea(float posX, float posY)
{
FloatRectangle outputArea = GetOutputArea();
+ _ControlOrientation orientation = __pView->GetOrientation();
for (int i = 0; i < __outputBoxMaxCount; i++)
{
FloatRectangle boxBounds = __pDisplayBox[i]->GetDisplayBoxBounds();
- boxBounds.y = outputArea.y + ((outputArea.height - boxBounds.height) / 2);
+ if (__title.IsEmpty())
+ {
+ boxBounds.y = outputArea.y + ((outputArea.height - boxBounds.height) / 2);
+ }
+ else
+ {
+ float topMargin = 0.0f;
+ float bottomMargin = 0.0f;
+ float titleHeight = 0.0f;
+
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_TOP_MARGIN, orientation, topMargin);
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_BOTTOM_MARGIN, orientation, bottomMargin);
+ GET_SHAPE_CONFIG(DATETIMEPICKER::TITLE_HEIGHT, orientation, titleHeight);
+
+ boxBounds.y = outputArea.y + topMargin + titleHeight + bottomMargin;
+ }
if ((posX >= boxBounds.x) && (posX < boxBounds.x + boxBounds.width)
&& (posY >= boxBounds.y) && (posY < boxBounds.y + boxBounds.height))
result r = E_SYSTEM;
_UiBuilderControlLayout* pControlProperty = null;
EditArea* pEditArea = null;
- Rectangle rect;
+ FloatRectangle rect;
String elementString;
InputStyle inputStyle = INPUT_STYLE_FULLSCREEN;
int limitLength = EDIT_AREA_DEFAULT_LIMIT_LENGTH;
HorizontalAlignment horizontalAlignment = ALIGNMENT_LEFT;
bool viewModeEnable = false;
bool commandButtonVisible = false;
- int fontSize = 0;
+ float fontSize = 0.0f;
Color color;
int opacity = EDIT_COLOR_OPACITY;
- int horizontalMargin = 0;
- int verticalMargin = 0;
+ float horizontalMargin = 0.0f;
+ float verticalMargin = 0.0f;
GetProperty(pControl, &pControlProperty);
if (pControlProperty == null)
return null;
}
- rect = pControlProperty->GetRect();
+ rect = pControlProperty->GetRectF();
if (pControl->GetElement(L"inputStyle", elementString) || pControl->GetElement(L"InputStyle", elementString))
{
if (pControl->GetElement(L"textSize", elementString))
{
- Base::Integer::Parse(elementString, fontSize);
+ Base::Float::Parse(elementString, fontSize);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement(L"horizontalMargin", elementString))
{
- Base::Integer::Parse(elementString, horizontalMargin);
+ Base::Float::Parse(elementString, horizontalMargin);
r = pEditArea->SetMargin(EDIT_MARGIN_TYPE_HORIZONTAL, horizontalMargin);
}
if (pControl->GetElement(L"verticalMargin", elementString))
{
- Base::Integer::Parse(elementString, verticalMargin);
+ Base::Float::Parse(elementString, verticalMargin);
r = pEditArea->SetMargin(EDIT_MARGIN_TYPE_VERTICAL, verticalMargin);
}
void
_EditDate::OnDraw(void)
{
- if (GetDateTimeBar() != null)
+ if (GetDateTimeBar() != null && GetDateTimeBar()->IsActivated())
{
CalculateDateTimeBarPosition();
}
result r = E_SYSTEM;
_UiBuilderControlLayout* pControlProperty = null;
EditField* pEditField = null;
- Rectangle rect;
+ FloatRectangle rect;
String elementString;
bool showTitle = false;
HorizontalAlignment horizontalAlignment = ALIGNMENT_LEFT;
bool viewModeEnable = false;
bool commandButtonVisible = false;
- int fontSize = 0;
+ float fontSize = 0.0f;
Color color;
int opacity = EDIT_COLOR_OPACITY;
EditFieldStyle editFieldStyle = EDIT_FIELD_STYLE_NORMAL;
EditFieldTitleStyle editFieldTitleStyle = EDIT_FIELD_TITLE_STYLE_NONE;
bool clearButtonEnable = false;
bool newConstructEnable = false;
- int horizontalMargin = 0;
- int verticalMargin = 0;
+ float horizontalMargin = 0.0f;
+ float verticalMargin = 0.0f;
EllipsisPosition ellipsisPosition = ELLIPSIS_POSITION_END;
GetProperty(pControl, &pControlProperty);
return null;
}
- rect = pControlProperty->GetRect();
+ rect = pControlProperty->GetRectF();
String styleString;
styleString = pControlProperty->GetStyle();
if (pControl->GetElement(L"textSize", elementString))
{
- Base::Integer::Parse(elementString, fontSize);
+ Base::Float::Parse(elementString, fontSize);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement(L"horizontalMargin", elementString))
{
- Base::Integer::Parse(elementString, horizontalMargin);
+ Base::Float::Parse(elementString, horizontalMargin);
r = pEditField->SetMargin(EDIT_MARGIN_TYPE_HORIZONTAL, horizontalMargin);
}
if (pControl->GetElement(L"verticalMargin", elementString))
{
- Base::Integer::Parse(elementString, verticalMargin);
+ Base::Float::Parse(elementString, verticalMargin);
r = pEditField->SetMargin(EDIT_MARGIN_TYPE_VERTICAL, verticalMargin);
}
__isTextBlocked = false;
+ InitializeCopyPasteManager();
+
return r;
}
bool
_EditPresenter::OnFocusLost(void)
{
- InitializeCopyPasteManager();
+ if (!__pEdit->IsDestroyed())
+ {
+ InitializeCopyPasteManager();
+ }
if (__isAutoShrinkEnabled)
{
void
_EditTime::OnDraw(void)
{
- if (GetDateTimeBar() != null)
+ if (GetDateTimeBar() != null && GetDateTimeBar()->IsActivated())
{
CalculateDateTimeBarPosition();
}
KeypadStyle keypadStyle = KEYPAD_STYLE_NORMAL;
int maxLines = 10;
String guideText;
- int verticalMarin = 0;
- int horizontalMargin = 0;
+ float verticalMarin = 0.0f;
+ float horizontalMargin = 0.0f;
String text;
- int textSize = 6;
+ float textSize = 6.0f;
String titleText;
int limitLength = 0;
int opacity = 100;
if (pControl->GetElement(L"textSize", elementString))
{
- Base::Integer::Parse(elementString, textSize);
+ Base::Float::Parse(elementString, textSize);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement(L"verticalMargin", elementString))
{
- Base::Integer::Parse(elementString, verticalMarin);
+ Base::Float::Parse(elementString, verticalMarin);
r = pExpandableEditArea->SetMargin(EDIT_MARGIN_TYPE_VERTICAL, verticalMarin);
}
if (pControl->GetElement(L"horizontalMargin", elementString))
{
- Base::Integer::Parse(elementString, horizontalMargin);
+ Base::Float::Parse(elementString, horizontalMargin);
r = pExpandableEditArea->SetMargin(EDIT_MARGIN_TYPE_HORIZONTAL, horizontalMargin);
}
Color selectedBitmapColor;
GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap);
- GET_COLOR_CONFIG(HEADER::SEGMENTED_ITEM_TEXT_PRESSED, selectedBitmapColor);
+ GET_COLOR_CONFIG(HEADER::SEGMENTED_ITEM_TEXT_SELECTED, selectedBitmapColor);
pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), selectedBitmapColor);
namespace Tizen { namespace Ui { namespace Controls {
+const String _ACTIVATE_FRAME = L"ActivateFrame";
+
_Frame::_Frame(void)
: __pFramePresenter(null)
, __pFrameEvent(null)
return true;
}
+ else if (*pType == _ACTIVATE_FRAME)
+ {
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+ if (pEcoreEvas)
+ {
+ pEcoreEvas->ActivateWindow(*this);
+ }
+
+ pArgs->RemoveAll(true);
+ delete pArgs;
+
+ return true;
+ }
return false;
}
if (needFlush)
{
- pListViewItem->Draw();
- pListViewItem->Show();
+ Draw();
+ Show();
}
SetLastResultReturn(r);
Color selectedBitmapColor;
GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedBitmap);
- GET_COLOR_CONFIG(HEADER::SEGMENTED_ITEM_TEXT_PRESSED, selectedBitmapColor);
+ GET_COLOR_CONFIG(HEADER::SEGMENTED_ITEM_TEXT_SELECTED, selectedBitmapColor);
pColorReplacedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), selectedBitmapColor);
virtual Control* Make(_UiBuilderControl* pControl)
{
Header* pHeader = null;
- Rectangle rect(0, 0, 0, 0);
String elementString;
int opacity = 0;
Color color;
result r = E_SYSTEM;
_UiBuilderControlLayout* pControlProperty = null;
Label* pLabel = null;
- Rectangle rect;
+ FloatRectangle rect;
HorizontalAlignment horizontalAlignment;
VerticalAlignment verticalAlignment;
Tizen::Base::String elementString;
int opacity = 0;
- int size = 0;
+ float size = 0.0f;
LabelTextStyle style = LABEL_TEXT_STYLE_NORMAL;
Color color;
}
pLabel = new (std::nothrow) Label();
- rect = pControlProperty->GetRect();
+ rect = pControlProperty->GetRectF();
//Construct
if (pControl->GetElement(L"text", elementString))
if (pControl->GetElement(L"textSize", elementString))
{
- Base::Integer::Parse(elementString, size);
+ Base::Float::Parse(elementString, size);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
}
}
- if (size != 0)
+ if (size > 0.0f)
{
pLabel->SetTextConfig(size, style);
}
}
//-------safety for Minimum size-------------------
- rect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->GetRect();
- if (rect.width < 0) // LABEL_MIN_WIDTH = 0
+ rect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->GetRectF();
+ if (rect.width < 0.0f) // LABEL_MIN_WIDTH = 0
{
- rect.width = 0;
+ rect.width = 0.0f;
}
- if (rect.height < 0)
+ if (rect.height < 0.0f)
{
- rect.height = 0;
+ rect.height = 0.0f;
}
(pControl->GetAttribute(UIBUILDER_ATTRIBUTE_PORTRAIT))->SetRect(rect.x, rect.y, rect.width, rect.height);
- rect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->GetRect();
- if (rect.width < 0)
+ rect = (pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->GetRectF();
+ if (rect.width < 0.0f)
{
- rect.width = 0;
+ rect.width = 0.0f;
}
- if (rect.height < 0) // LABEL_MIN_HEIGHT = 0
+ if (rect.height < 0.0f) // LABEL_MIN_HEIGHT = 0
{
- rect.height = 0;
+ rect.height = 0.0f;
}
(pControl->GetAttribute(UIBUILDER_ATTRIBUTE_LANDSCAPE))->SetRect(rect.x, rect.y, rect.width, rect.height);
//---------end safety code------------------------
if (needFlush)
{
- pListViewItem->Draw();
- pListViewItem->Show();
+ Draw();
+ Show();
}
SetLastResultReturn(r);
if (pScrollVe == null)
{
pScrollVe = new (std::nothrow) _VisualElement();
- SysTryReturnResult(NID_UI_CTRL, pScrollVe, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ SysTryCatch(NID_UI_CTRL, pScrollVe, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pScrollVe->Construct();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct pScrollVe.", GetErrorMessage(r));
}
Canvas* pCanvas = null;
- Bitmap* pHandlerBgBitmap = null;
result r = E_SUCCESS;
if (__enableHandler)
//fall through
CATCH:
delete pCanvas;
- delete pHandlerBgBitmap;
return;
}
break;
case TABLE_VIEW_ANNEX_STYLE_DETAILED:
- GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
+ GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
break;
case TABLE_VIEW_ANNEX_STYLE_RADIO:
{
result r = E_SUCCESS;
- Rectangle rect;
+ FloatRectangle rect;
TextBox* pTextBox = null;
_UiBuilderControlLayout* pControlProperty = null;
String text;
Color color;
int opacity = 100;
- int textSize = 0;
- int lineSpacingExtra = 0;
+ float textSize = 0.0f;
+ float lineSpacingExtra = 0.0f;
int lineSpacingMultiplier = 1;
String elementString;
return null;
}
- rect = pControlProperty->GetRect();
+ rect = pControlProperty->GetRectF();
if (pControl->GetElement("textboxBorder", elementString))
{
if (elementString.Equals(L"TEXT_BOX_BORDER_NONE", false))
if (pControl->GetElement("textSize", elementString))
{
- Base::Integer::Parse(elementString, textSize);
+ Base::Float::Parse(elementString, textSize);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement("lineSpacingExtra", elementString))
{
- Base::Integer::Parse(elementString, lineSpacingExtra);
+ Base::Float::Parse(elementString, lineSpacingExtra);
if (pControl->GetElement("lineSpacingMultiplier", elementString))
{
Tizen::Graphics::Font* GetDateTimeFont(void);
result InitializeFont(void);
- result CreateHeader(void);
- result DestroyHeader(void);
result CreateFooter(void);
result DestroyFooter(void);
- Tizen::Graphics::FloatRectangle GetHeaderBounds(void);
-
result CreateDisplayVisualElement(void);
void SetDisplayVisualElementBounds(Tizen::Graphics::FloatRectangle bounds);
Tizen::Ui::Animations::_VisualElement* GetDisplayVisualElement(void);
+ Tizen::Graphics::FloatRectangle GetIndicatorBoundsF(void);
private:
_DateTimePicker(_DateTimePresenter* pPresenter, const Tizen::Base::String& title = L"");
private:
_DateTimePresenter* __pPresenter;
- _Toolbar* __pHeader;
_Toolbar* __pFooter;
Tizen::Base::String __title;
void DrawBackground(Tizen::Graphics::Canvas& canvas);
+ void DrawTitle(Tizen::Graphics::Canvas& canvas);
+
void DrawDividers(Tizen::Graphics::Canvas& canvas);
void ChangeInputPadStyle(int boxId);
int __changeFocusCounter;
+ Tizen::Base::String __title;
+
Tizen::Graphics::Bitmap* __pPmBoxNormalBitmap;
Tizen::Graphics::Bitmap* __pPmBoxEffectBitmap;
Tizen::Graphics::Bitmap* __pPmBoxPressedEffectBitmap;
result RemoveControl(int index);
result RemoveChild(int index);
void DeleteAllChildren(_ContainerImpl* pChild, bool detachSystemChild = true, Tizen::Base::Collection::ArrayList* pChildrenList = null);
- void RemoveAllChildren(bool detachSystemChild = true);
+ void RemoveAllChildren(bool detachSystemChild = true, bool callOnDetachingFromMainTree = false);
result MoveChildToTop(const _ControlImpl& child);
result MoveChildBefore(const _ControlImpl& targetChild, const _ControlImpl& child);
void SetDrawWhenVisible(bool draw);
bool IsDrawWhenVisible(void);
void SetTerminatingOrder(bool postOrderTraversal);
+ bool IsPostOrderTraversal(void);
// Font
result SetFont(const Tizen::Base::String& fontName);
DECLARE_COLOR_CONFIG(AMPM_TEXT_DISABLED, 14)
DECLARE_COLOR_CONFIG(DIVIDER_LEFT_HALF, 15)
DECLARE_COLOR_CONFIG(DIVIDER_RIGHT_HALF, 16)
+ DECLARE_COLOR_CONFIG(TITLE_NORMAL, 17)
+ DECLARE_COLOR_CONFIG(TITLE_DISABLED, 18)
DECLARE_IMAGE_CONFIG(AMPM_BG_NORMAL, 1)
DECLARE_IMAGE_CONFIG(AMPM_BG_PRESSED, 2)
DECLARE_IMAGE_CONFIG(AMPM_BG_HIGHLIGHTED, 3)
- DECLARE_IMAGE_CONFIG(AMPM_BG_EFFECT, 4)
- DECLARE_IMAGE_CONFIG(AMPM_BG_PRESSED_EFFECT, 5)
- DECLARE_IMAGE_CONFIG(AMPM_BG_DISABLED_EFFECT, 6)
- DECLARE_IMAGE_CONFIG(COLON_BG_NORMAL, 7)
- DECLARE_IMAGE_CONFIG(BG_NORMAL, 8);
- DECLARE_IMAGE_CONFIG(BG_EFFECT, 9);
+ DECLARE_IMAGE_CONFIG(AMPM_BG_DISABLED, 4)
+ DECLARE_IMAGE_CONFIG(AMPM_BG_NORMAL_EFFECT, 5)
+ DECLARE_IMAGE_CONFIG(AMPM_BG_PRESSED_EFFECT, 6)
+ DECLARE_IMAGE_CONFIG(AMPM_BG_DISABLED_EFFECT, 7)
+ DECLARE_IMAGE_CONFIG(AMPM_BG_HIGHLIGHTED_EFFECT, 8)
+ DECLARE_IMAGE_CONFIG(COLON_BG_NORMAL, 9)
+ DECLARE_IMAGE_CONFIG(BG_NORMAL, 10);
+ DECLARE_IMAGE_CONFIG(BG_EFFECT, 11);
DECLARE_SHAPE_CONFIG(FOOTER_HEIGHT, 1)
DECLARE_SHAPE_CONFIG(INPUTPAD_HEIGHT, 2)
DECLARE_SHAPE_CONFIG(AMPM_DISPLAY_BOX_HEIGHT, 5)
DECLARE_SHAPE_CONFIG(TOP_MARGIN, 6)
DECLARE_SHAPE_CONFIG(LEFT_MARGIN, 7)
- DECLARE_SHAPE_CONFIG(DATE_ELEMENT_WIDTH, 8)
- DECLARE_SHAPE_CONFIG(TIME_ELEMENT_WIDTH, 9)
- DECLARE_SHAPE_CONFIG(AMPM_WIDTH, 10)
- DECLARE_SHAPE_CONFIG(COLON_WIDTH, 11)
- DECLARE_SHAPE_CONFIG(DATE_TIME_MARGIN, 12)
- DECLARE_SHAPE_CONFIG(TIME_AMPM_MARGIN, 13)
- DECLARE_SHAPE_CONFIG(COLON_MARGIN, 14)
- DECLARE_SHAPE_CONFIG(DIVIDER_HEIGHT, 15)
- DECLARE_SHAPE_CONFIG(TIME_OUTPUT_MARGIN, 16)
- DECLARE_SHAPE_CONFIG(FONT_SIZE, 17)
- DECLARE_SHAPE_CONFIG(DTP_DATE_ELEMENT_WIDTH, 18)
- DECLARE_SHAPE_CONFIG(DP_DATE_ELEMENT_WIDTH, 19)
-
- DECLARE_FIXED_VALUE_CONFIG(DIVIDER_WIDTH, 1)
+ DECLARE_SHAPE_CONFIG(TITLE_TOP_MARGIN, 8)
+ DECLARE_SHAPE_CONFIG(TITLE_LEFT_MARGIN, 9)
+ DECLARE_SHAPE_CONFIG(TITLE_BOTTOM_MARGIN, 10)
+ DECLARE_SHAPE_CONFIG(TITLE_HEIGHT, 11)
+ DECLARE_SHAPE_CONFIG(DTP_DATE_ELEMENT_WIDTH, 12)
+ DECLARE_SHAPE_CONFIG(DP_DATE_ELEMENT_WIDTH, 13)
+ DECLARE_SHAPE_CONFIG(TIME_ELEMENT_WIDTH, 14)
+ DECLARE_SHAPE_CONFIG(AMPM_WIDTH, 15)
+ DECLARE_SHAPE_CONFIG(COLON_WIDTH, 16)
+ DECLARE_SHAPE_CONFIG(DATE_TIME_MARGIN, 17)
+ DECLARE_SHAPE_CONFIG(TIME_AMPM_MARGIN, 18)
+ DECLARE_SHAPE_CONFIG(COLON_MARGIN, 19)
+ DECLARE_FIXED_VALUE_CONFIG(DIVIDER_WIDTH, 20)
+ DECLARE_SHAPE_CONFIG(DIVIDER_HEIGHT, 21)
+ DECLARE_SHAPE_CONFIG(TIME_OUTPUT_MARGIN, 22)
+ DECLARE_SHAPE_CONFIG(FONT_SIZE, 23)
+ DECLARE_SHAPE_CONFIG(TITLE_FONT_SIZE, 24)
DECLARE_END_UI_CONFIG(DATETIMEPICKER);
-#endif //_FUI_RESOURCE_DATETIMEPICKER_CONFIG_H_
\ No newline at end of file
+#endif //_FUI_RESOURCE_DATETIMEPICKER_CONFIG_H_
pLayoutNode = __pLayoutList->GetNextNode(*pLayoutNode);
}
delete __pLayoutList;
+ __pLayoutList = null;
}
result
void
LayoutContainer::OnDestroyContainerProxy()
{
- LayoutListNode* pCurNode = __pLayoutList->GetFirstNode();
- Layout* pLayout = null;
-
- while (pCurNode)
+ if (__pLayoutList != null)
{
- pLayout = pCurNode->GetLayout();
- if (pLayout)
+ LayoutListNode* pCurNode = __pLayoutList->GetFirstNode();
+ Layout* pLayout = null;
+
+ while (pCurNode)
{
- pLayout->SetContainer(this);
+ pLayout = pCurNode->GetLayout();
+ if (pLayout)
+ {
+ pLayout->SetContainer(this);
+ }
+ pCurNode = __pLayoutList->GetNextNode(*pCurNode);
}
- pCurNode = __pLayoutList->GetNextNode(*pCurNode);
}
}
return __pLayoutList;
}
-
}}} // Tizen::Ui::_Layout
ADD_COLOR_CONFIG(DIVIDER_LEFT_HALF, $B0224);
ADD_COLOR_CONFIG(DIVIDER_RIGHT_HALF, $B0222);
+ ADD_COLOR_CONFIG(TITLE_NORMAL, $B052L5);
+ ADD_COLOR_CONFIG(TITLE_DISABLED, $B052L5);
+
ADD_IMAGE_CONFIG(AMPM_BG_NORMAL, #00_button_01.#.png);
ADD_IMAGE_CONFIG(AMPM_BG_PRESSED, #00_button_01.#.png);
ADD_IMAGE_CONFIG(AMPM_BG_HIGHLIGHTED, #00_button_01_focus.#.png);
- ADD_IMAGE_CONFIG(AMPM_BG_EFFECT, #00_button_01_ef.#.png);
+ ADD_IMAGE_CONFIG(AMPM_BG_DISABLED, #00_button_01.#.png);
+
+ ADD_IMAGE_CONFIG(AMPM_BG_NORMAL_EFFECT, #00_button_01_ef.#.png);
ADD_IMAGE_CONFIG(AMPM_BG_PRESSED_EFFECT, #00_button_01_ef_press.#.png);
ADD_IMAGE_CONFIG(AMPM_BG_DISABLED_EFFECT, #00_button_01_ef_dim.#.png);
+ ADD_IMAGE_CONFIG(AMPM_BG_HIGHLIGHTED_EFFECT, #00_button_01_ef.#.png);
+
ADD_IMAGE_CONFIG(COLON_BG_NORMAL, #00_date_picker_dot.png);
ADD_IMAGE_CONFIG(BG_NORMAL, #00_list_group_bg.#.png);
ADD_IMAGE_CONFIG(BG_EFFECT, #00_list_group_bg_ef.#.png);
ADD_SHAPE_CONFIG(TOP_MARGIN, 32);
ADD_SHAPE_CONFIG(LEFT_MARGIN, 16);
+ ADD_SHAPE_CONFIG(TITLE_TOP_MARGIN, 12);
+ ADD_SHAPE_CONFIG(TITLE_LEFT_MARGIN, 20);
+ ADD_SHAPE_CONFIG(TITLE_BOTTOM_MARGIN, 5);
+ ADD_SHAPE_CONFIG(TITLE_HEIGHT, 36);
+
ADD_SHAPE_CONFIG(DTP_DATE_ELEMENT_WIDTH, 130);
ADD_SHAPE_CONFIG(DP_DATE_ELEMENT_WIDTH, 228);
ADD_SHAPE_CONFIG(TIME_ELEMENT_WIDTH, 48);
ADD_SHAPE_CONFIG(TIME_OUTPUT_MARGIN, 20);
ADD_SHAPE_CONFIG(FONT_SIZE, 36);
+ ADD_SHAPE_CONFIG(TITLE_FONT_SIZE, 32);
}
END_UI_CONFIG_MODE(720x1280);
START_UI_CONFIG_MODE(1280x720);
{
+ ADD_SHAPE_CONFIG(TOP_MARGIN, 52);
+
ADD_SHAPE_CONFIG(FOOTER_HEIGHT, 84);
ADD_SHAPE_CONFIG(INPUTPAD_HEIGHT, 316);
- ADD_SHAPE_CONFIG(DATE_ELEMENT_WIDTH, 242);
+ ADD_SHAPE_CONFIG(DTP_DATE_ELEMENT_WIDTH, 242);
+ ADD_SHAPE_CONFIG(DP_DATE_ELEMENT_WIDTH, 242);
ADD_SHAPE_CONFIG(DATE_TIME_MARGIN, 66);
ADD_SHAPE_CONFIG(TIME_AMPM_MARGIN, 84);
ADD_COLOR_CONFIG(BUTTON_TRANSLUCENT_BG_HIGHLIGHTED, $B013);
ADD_COLOR_CONFIG(BUTTON_TEXT_NORMAL, $B052L4);
- ADD_COLOR_CONFIG(BUTTON_TEXT_DISABLED, $B052L4D);
- ADD_COLOR_CONFIG(BUTTON_TEXT_PRESSED, $B052L6P);
+ ADD_COLOR_CONFIG(BUTTON_TEXT_DISABLED, $B052L4);
+ ADD_COLOR_CONFIG(BUTTON_TEXT_PRESSED, $B052L4P);
ADD_COLOR_CONFIG(BUTTON_TEXT_HIGHLIGHTED, $B052L4P);
ADD_COLOR_CONFIG(BUTTON_TRANSLUCENT_TEXT_NORMAL, $B052L8);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_SELECTED, $B013);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_NORMAL, $B052L6);
- ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_DISABLED, $B052L4D);
- ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_PRESSED, $B052L6P);
+ ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_DISABLED, $B052L6);
+ ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_PRESSED, $B052L6);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_HIGHLIGHTED, $B052L6P);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_SELECTED, $B052L6P);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_SELECTED, $B013);
ADD_COLOR_CONFIG(TAB_ITEM_TEXT_NORMAL, $B052L6);
- ADD_COLOR_CONFIG(TAB_ITEM_TEXT_DISABLED, $B052L4D);
- ADD_COLOR_CONFIG(TAB_ITEM_TEXT_PRESSED, $B052L6P);
+ ADD_COLOR_CONFIG(TAB_ITEM_TEXT_DISABLED, $B052L6);
+ ADD_COLOR_CONFIG(TAB_ITEM_TEXT_PRESSED, $B052L6);
ADD_COLOR_CONFIG(TAB_ITEM_TEXT_HIGHLIGHTED, $B052L6P);
ADD_COLOR_CONFIG(TAB_ITEM_TEXT_SELECTED, $B052L6P);
ADD_COLOR_CONFIG(BUTTON_TRANSLUCENT_BG_HIGHLIGHTED, $B013);
ADD_COLOR_CONFIG(BUTTON_TEXT_NORMAL, $B052L4);
- ADD_COLOR_CONFIG(BUTTON_TEXT_DISABLED, $B052L4D);
- ADD_COLOR_CONFIG(BUTTON_TEXT_PRESSED, $B052L6P);
+ ADD_COLOR_CONFIG(BUTTON_TEXT_DISABLED, $B052L4);
+ ADD_COLOR_CONFIG(BUTTON_TEXT_PRESSED, $B052L4P);
ADD_COLOR_CONFIG(BUTTON_TEXT_HIGHLIGHTED, $B052L4P);
ADD_COLOR_CONFIG(BUTTON_TRANSLUCENT_TEXT_NORMAL, $B052L8);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_SELECTED, $B013);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_NORMAL, $B052L6);
- ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_DISABLED, $B052L4D);
- ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_PRESSED, $B052L6P);
+ ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_DISABLED, $B052L6);
+ ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_PRESSED, $B052L6);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_HIGHLIGHTED, $B052L6P);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TEXT_SELECTED, $B052L6P);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_SELECTED, $B013);
ADD_COLOR_CONFIG(TAB_ITEM_TEXT_NORMAL, $B052L6);
- ADD_COLOR_CONFIG(TAB_ITEM_TEXT_DISABLED, $B052L4D);
- ADD_COLOR_CONFIG(TAB_ITEM_TEXT_PRESSED, $B052L6P);
+ ADD_COLOR_CONFIG(TAB_ITEM_TEXT_DISABLED, $B052L6);
+ ADD_COLOR_CONFIG(TAB_ITEM_TEXT_PRESSED, $B052L6);
ADD_COLOR_CONFIG(TAB_ITEM_TEXT_HIGHLIGHTED, $B052L6P);
ADD_COLOR_CONFIG(TAB_ITEM_TEXT_SELECTED, $B052L6P);