https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f3ae595df9739cd95d220bd28c3a778fc27bdf8f

commit f3ae595df9739cd95d220bd28c3a778fc27bdf8f
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Wed Jan 24 14:40:31 2024 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Wed Jan 24 14:40:31 2024 +0900

    [SDK] cicuif.h: Fix CUIFBalloonWindow::CreateRegion (#6401)
    
    Implementing Language Bar...
    JIRA issue: CORE-19363
    - Implement CUIFBalloonWindow::CreateRegion
      method.
---
 sdk/include/reactos/cicero/cicuif.h | 54 ++++++++++++++++++++++++++++++++++---
 1 file changed, 51 insertions(+), 3 deletions(-)

diff --git a/sdk/include/reactos/cicero/cicuif.h 
b/sdk/include/reactos/cicero/cicuif.h
index 52305dcef14..257df7162d8 100644
--- a/sdk/include/reactos/cicero/cicuif.h
+++ b/sdk/include/reactos/cicero/cicuif.h
@@ -5204,12 +5204,60 @@ CUIFBalloonWindow::AdjustPos()
     //FIXME
 }
 
-/// @unimplemented
 inline HRGN
 CUIFBalloonWindow::CreateRegion(LPCRECT prc)
 {
-    //FIXME
-    return NULL;
+    POINT Points[4];
+    HRGN hRgn;
+    BOOL bFlag = FALSE;
+    LONG x, y;
+
+    switch (m_nBalloonType)
+    {
+        case 1:
+            hRgn = ::CreateRoundRectRgn(prc->left, prc->top + 16, prc->right, 
prc->bottom, 16, 16);
+            y = prc->top + 16;
+            bFlag = TRUE;
+            break;
+
+        case 2:
+            hRgn = ::CreateRoundRectRgn(prc->left, prc->top, prc->right - 16, 
prc->bottom, 16, 16);
+            x = prc->right - 17;
+            break;
+
+        case 3:
+            hRgn = ::CreateRoundRectRgn(prc->left + 16, prc->top, prc->right, 
prc->bottom, 16, 16);
+            x = prc->left + 16;
+            break;
+
+        default:
+            hRgn = ::CreateRoundRectRgn(prc->left, prc->top, prc->right, 
prc->bottom - 16, 16, 16);
+            y = prc->bottom - 17;
+            bFlag = TRUE;
+            break;
+    }
+
+    if (bFlag)
+    {
+        x = Points[1].x = m_ptBalloon.x;
+        Points[1].y = m_ptBalloon.y;
+        Points[0].y = Points[2].y = Points[3].y = y;
+        Points[2].x = x + 10 * (2 * (m_dwUnknown8[0] == 0) - 1);
+    }
+    else
+    {
+        Points[2].x = x;
+        y = Points[0].y = Points[1].y = Points[3].y = m_ptBalloon.y;
+        Points[1].x = m_ptBalloon.x;
+        Points[2].y = y + 10 * (2 * (m_dwUnknown8[0] == 2) - 1);
+    }
+
+    Points[0].x = Points[3].x = x;
+
+    HRGN hPolygonRgn = ::CreatePolygonRgn(Points, _countof(Points), WINDING);
+    ::CombineRgn(hRgn, hRgn, hPolygonRgn, RGN_OR);
+    ::DeleteObject(hPolygonRgn);
+    return hRgn;
 }
 
 inline void

Reply via email to