applied magnifier mask bitmap for black theme.
authorChulheon <ch.jeong47@samsung.com>
Mon, 8 Jul 2013 13:01:27 +0000 (22:01 +0900)
committerChulheon <ch.jeong47@samsung.com>
Mon, 8 Jul 2013 13:08:08 +0000 (22:08 +0900)
Change-Id: I8446334145d4701b05134fab3e31c6e3476efb62

res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier.#.png
res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier_mask.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier.#.png
res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier_mask.#.png [new file with mode: 0644]
src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/inc/FUi_ResourceEditConfig.h
src/ui/resource/FUi_ResourceEditConfig.cpp

index c5a289d..ce56b66 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier.#.png and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier_mask.#.png b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier_mask.#.png
new file mode 100644 (file)
index 0000000..68127e7
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/copy&paste_Magnifier_mask.#.png differ
index c85ea30..92158c6 100644 (file)
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier.#.png and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier_mask.#.png b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier_mask.#.png
new file mode 100644 (file)
index 0000000..419ae1f
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/copy&paste_Magnifier_mask.#.png differ
index 9e387b4..12d1379 100644 (file)
@@ -83,6 +83,7 @@ private:
 private:
        _EditCopyPasteManager* __pCopyPasteManager;
        Bitmap* __pMagnifierBitmap;
+       Bitmap* __pMagnifierMaskBitmap;
        _VisualElement* __pRoot;
        int __handlerCursorPos;
        FloatRectangle __windowBounds;
@@ -93,6 +94,7 @@ private:
 _EditCopyPasteMagnifier::_EditCopyPasteMagnifier(_EditCopyPasteManager* pCopyPasteManager, int handlerCursorPos)
        : __pCopyPasteManager(pCopyPasteManager)
        , __pMagnifierBitmap(null)
+       , __pMagnifierMaskBitmap(null)
        , __pRoot(null)
        , __handlerCursorPos(handlerCursorPos)
        , __windowBounds(0.0f, 0.0f, 0.0f, 0.0f)
@@ -104,6 +106,7 @@ _EditCopyPasteMagnifier::_EditCopyPasteMagnifier(_EditCopyPasteManager* pCopyPas
        __pRoot->SetSurfaceOpaque(false);
 
        GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_MAGNIFIER, BITMAP_PIXEL_FORMAT_ARGB8888, __pMagnifierBitmap);
+       GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_MAGNIFIER_MASK, BITMAP_PIXEL_FORMAT_ARGB8888, __pMagnifierMaskBitmap);
 }
 
 _EditCopyPasteMagnifier::~_EditCopyPasteMagnifier(void)
@@ -113,6 +116,11 @@ _EditCopyPasteMagnifier::~_EditCopyPasteMagnifier(void)
                delete __pMagnifierBitmap;
                __pMagnifierBitmap = null;
        }
+       if (__pMagnifierMaskBitmap)
+       {
+               delete __pMagnifierMaskBitmap;
+               __pMagnifierMaskBitmap = null;
+       }
 }
 
 Bitmap*
@@ -145,7 +153,7 @@ _EditCopyPasteMagnifier::CreateInstanceN(const FloatPoint& point, int handlerCur
        GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_WIDTH, orientation, width);
        GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_HEIGHT, orientation, height);
 
-       bounds = FloatRectangle(cursorPoint.x - width/2, cursorPoint.y - height, width, height);
+       bounds = FloatRectangle(cursorPoint.x - width/2.0f, cursorPoint.y - height, width, height);
        if (bounds.y < 0.0f)
        {
                bounds.y = 0.0f;
@@ -226,6 +234,24 @@ _EditCopyPasteMagnifier::OnDraw(void)
                pCanvas->DrawBitmap(pCanvas->GetBoundsF(), *__pMagnifierBitmap);
        }
 
+       if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pMagnifierMaskBitmap))
+       {
+               Color editColor = __pCopyPasteManager->GetEdit()->GetColor(EDIT_STATUS_HIGHLIGHTED);
+               if (editColor.GetAlpha() == 0x00)
+               {
+                       editColor.SetAlpha(0xFF);
+               }
+
+               Bitmap* pReplacedMaskBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pMagnifierMaskBitmap, Color::GetColor(COLOR_ID_MAGENTA), editColor);
+               SysTryReturnVoidResult(NID_UI_CTRL, pReplacedMaskBitmap, GetLastResult(), "pReplacedMaskBitmap is null.");
+
+               pCanvas->DrawNinePatchedBitmap(pCanvas->GetBoundsF(), *pReplacedMaskBitmap);
+       }
+       else
+       {
+               pCanvas->DrawBitmap(pCanvas->GetBoundsF(), *__pMagnifierMaskBitmap);
+       }
+
        CaptureTextArea(*pCanvas);
 
        delete pCanvas;
@@ -260,7 +286,7 @@ _EditCopyPasteMagnifier::CaptureTextArea(Canvas& canvas)
 
        FloatRectangle textObjectBounds = pEditPresenter->GetTextBoundsF();
        captureBounds.x = cursorBounds.x - captureWidth/2.0f;
-       captureBounds.y = cursorBounds.y + cursorBounds.height/2 - captureHeight/2;
+       captureBounds.y = cursorBounds.y + cursorBounds.height/2.0f - captureHeight/2.0f;
        captureBounds.width = captureWidth;
        captureBounds.height = captureHeight;
        captureBounds = textObjectBounds.GetIntersection(captureBounds);
@@ -278,7 +304,7 @@ _EditCopyPasteMagnifier::CaptureTextArea(Canvas& canvas)
        SysTryReturnVoidResult(NID_UI_CTRL, pOriginalBitmp, E_INVALID_STATE, "pOriginalBitmp is null.");
 
        Bitmap bitmap;
-       r = bitmap.Construct(captureBounds);
+       r = bitmap.Construct(FloatRectangle(0, 0, captureBounds.width, captureBounds.height));
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = bitmap.Merge(FloatPoint(0.0f, 0.0f), *pOriginalBitmp, captureBounds);
@@ -305,7 +331,7 @@ CATCH:
 void
 _EditCopyPasteMagnifier::MoveMagnifier(const FloatPoint& point, int handlerCursorPos)
 {
-       FloatRectangle bounds = FloatRectangle(point.x - GetBoundsF().width/2, point.y - GetBoundsF().height, GetBoundsF().width, GetBoundsF().height);
+       FloatRectangle bounds = FloatRectangle(point.x - GetBoundsF().width/2.0f, point.y - GetBoundsF().height, GetBoundsF().width, GetBoundsF().height);
        __handlerCursorPos = handlerCursorPos;
        if (bounds.y < 0.0f)
        {
index f83ec1e..426240b 100644 (file)
@@ -57,20 +57,21 @@ DECLARE_UI_CONFIG(EDIT);
        DECLARE_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_RIGHT_NORMAL, 11)
        DECLARE_IMAGE_CONFIG(COPY_PASTE_SEARCH_ICON, 12)
        DECLARE_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER, 13)
-       DECLARE_IMAGE_CONFIG(BG_ROUND_NORMAL, 14)
-       DECLARE_IMAGE_CONFIG(BG_ROUND_EFFECT, 15)
-       DECLARE_IMAGE_CONFIG(CLEAR_ICON_NORMAL, 16)
-       DECLARE_IMAGE_CONFIG(CLEAR_ICON_PRESSED, 17)
-       DECLARE_IMAGE_CONFIG(CLEAR_ICON_DISABLED, 18)
-       DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, 19)
-       DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 20)
-       DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, 21)
-       DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, 22)
-       DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, 23)
-       DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, 24)
-       DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, 25)
-       DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, 26)
-       DECLARE_IMAGE_CONFIG(BG_RING_FOCUSED, 27)
+       DECLARE_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER_MASK, 14)
+       DECLARE_IMAGE_CONFIG(BG_ROUND_NORMAL, 15)
+       DECLARE_IMAGE_CONFIG(BG_ROUND_EFFECT, 16)
+       DECLARE_IMAGE_CONFIG(CLEAR_ICON_NORMAL, 17)
+       DECLARE_IMAGE_CONFIG(CLEAR_ICON_PRESSED, 18)
+       DECLARE_IMAGE_CONFIG(CLEAR_ICON_DISABLED, 19)
+       DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, 20)
+       DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 21)
+       DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, 22)
+       DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, 23)
+       DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, 24)
+       DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, 25)
+       DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, 26)
+       DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, 27)
+       DECLARE_IMAGE_CONFIG(BG_RING_FOCUSED, 28)
 
        DECLARE_DIMENSION_CONFIG(MIN_SIZE, 1)
        DECLARE_DIMENSION_CONFIG(TITLE_STYLE_MIN_SIZE, 2)
index cac6cff..e7ada32 100644 (file)
@@ -56,6 +56,7 @@ START_UI_CONFIG(EDIT);
        ADD_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_RIGHT_NORMAL, #copy&paste_Handler_left_reverse.png);
        ADD_IMAGE_CONFIG(COPY_PASTE_SEARCH_ICON, #copy&paste_icon_search.png);
        ADD_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER, #copy&paste_Magnifier.#.png);
+       ADD_IMAGE_CONFIG(COPY_PASTE_MAGNIFIER_MASK, #copy&paste_Magnifier_mask.#.png);
        ADD_IMAGE_CONFIG(BG_ROUND_NORMAL, #00_edit_field_round_bg.#.png);
        ADD_IMAGE_CONFIG(BG_ROUND_EFFECT, #00_edit_field_line_round_bg_01.#.png);
        ADD_IMAGE_CONFIG(CLEAR_ICON_NORMAL, #00_edit_field_clear.png);
@@ -131,7 +132,7 @@ START_UI_CONFIG(EDIT);
        ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_WIDTH, 324);
        ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_HEIGHT, 164);
        ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_WIDTH, 192);
-       ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_HEIGHT, 69);
+       ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_HEIGHT, 70);
        ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_POSITION_X, 18);
        ADD_SHAPE_CONFIG(COPYPASTE_MAGNIFIER_CAPTURE_POSITION_Y, 18);