Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / src / fwl / src / core / fwl_widgetmgrimp.cpp
index b5e2547..a1e1d45 100644 (file)
@@ -59,12 +59,12 @@ CFWL_WidgetMgr::~CFWL_WidgetMgr()
         m_pDelegate = NULL;\r
     }\r
 }\r
-FX_INT32 CFWL_WidgetMgr::CountWidgets(IFWL_Widget *pParent )\r
+int32_t CFWL_WidgetMgr::CountWidgets(IFWL_Widget *pParent )\r
 {\r
     CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent);\r
     return TravelWidgetMgr(pParentItem, NULL, NULL);\r
 }\r
-IFWL_Widget* CFWL_WidgetMgr::GetWidget(FX_INT32 nIndex, IFWL_Widget *pParent )\r
+IFWL_Widget* CFWL_WidgetMgr::GetWidget(int32_t nIndex, IFWL_Widget *pParent )\r
 {\r
     CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent);\r
     IFWL_Widget *pWidget = NULL;\r
@@ -138,19 +138,19 @@ IFWL_Widget* CFWL_WidgetMgr::GetWidget(IFWL_Widget *pWidget, FWL_WGTRELATION eRe
     }\r
     return pRet;\r
 }\r
-FX_INT32 CFWL_WidgetMgr::GetWidgetIndex(IFWL_Widget *pWidget)\r
+int32_t CFWL_WidgetMgr::GetWidgetIndex(IFWL_Widget *pWidget)\r
 {\r
     CFWL_WidgetMgrItem *pItem = GetWidgetMgrItem(pWidget);\r
     _FWL_RETURN_VALUE_IF_FAIL(pItem, -1);\r
     return TravelWidgetMgr(pItem->pParent, NULL, pItem);\r
 }\r
-FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget *pWidget, FX_INT32 nIndex)\r
+FX_BOOL CFWL_WidgetMgr::SetWidgetIndex(IFWL_Widget *pWidget, int32_t nIndex)\r
 {\r
     CFWL_WidgetMgrItem *pItem = GetWidgetMgrItem(pWidget);\r
     _FWL_RETURN_VALUE_IF_FAIL(pItem, FALSE);\r
     _FWL_RETURN_VALUE_IF_FAIL(pItem->pParent, FALSE);\r
     CFWL_WidgetMgrItem *pChild = pItem->pParent->pChild;\r
-    FX_INT32 i = 0;\r
+    int32_t i = 0;\r
     while (pChild) {\r
         if (pChild == pItem) {\r
             if (i == nIndex) {\r
@@ -264,7 +264,7 @@ void CFWL_WidgetMgr::AddWidget(IFWL_Widget *pWidget)
     pItem->pParent = pParentItem;\r
     SetWidgetIndex(pWidget, -1);\r
 }\r
-void CFWL_WidgetMgr::InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, FX_INT32 nIndex )\r
+void CFWL_WidgetMgr::InsertWidget(IFWL_Widget *pParent, IFWL_Widget *pChild, int32_t nIndex )\r
 {\r
     CFWL_WidgetMgrItem *pParentItem = GetWidgetMgrItem(pParent);\r
     if (!pParentItem) {\r
@@ -462,7 +462,7 @@ FX_BOOL     CFWL_WidgetMgr::IsIdleMessage_Native()
 {\r
     return m_pAdapter->IsIdleMessage();\r
 }\r
-FWL_ERR CFWL_WidgetMgr::Exit_Native(FX_INT32 iExitCode)\r
+FWL_ERR CFWL_WidgetMgr::Exit_Native(int32_t iExitCode)\r
 {\r
     return m_pAdapter->Exit(iExitCode);\r
 }\r
@@ -527,9 +527,9 @@ IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget *parent, IFWL_Widget *focus, FX
     }\r
     return NULL;\r
 }\r
-FX_INT32 CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget *pFirst)\r
+int32_t CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget *pFirst)\r
 {\r
-    FX_INT32 iRet = 0;\r
+    int32_t iRet = 0;\r
     IFWL_Widget *pChild = pFirst;\r
     while (pChild) {\r
         if ((pChild->GetStyles() & FWL_WGTSTYLE_Group) && pChild->GetClassID() == 3811304691) {\r
@@ -580,7 +580,7 @@ void CFWL_WidgetMgr::GetSameGroupRadioButton(IFWL_Widget *pRadioButton, CFX_PtrA
     if (!pFirst) {\r
         pFirst = pRadioButton;\r
     }\r
-    FX_INT32 iGroup = CountRadioButtonGroup(pFirst);\r
+    int32_t iGroup = CountRadioButtonGroup(pFirst);\r
     if (iGroup < 2) {\r
         if (pFirst->GetClassID() == 3811304691) {\r
             group.Add(pFirst);\r
@@ -636,12 +636,12 @@ CFWL_WidgetMgrItem* CFWL_WidgetMgr::GetWidgetMgrItem(IFWL_Widget *pWidget)
 {\r
     return (CFWL_WidgetMgrItem*)m_mapWidgetItem.GetValueAt(pWidget);\r
 }\r
-FX_INT32 CFWL_WidgetMgr::TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, FX_INT32 *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget )\r
+int32_t CFWL_WidgetMgr::TravelWidgetMgr(CFWL_WidgetMgrItem *pParent, int32_t *pIndex, CFWL_WidgetMgrItem *pItem, IFWL_Widget **pWidget )\r
 {\r
     if (!pParent) {\r
         return 0;\r
     }\r
-    FX_INT32 iCount = 0;\r
+    int32_t iCount = 0;\r
     CFWL_WidgetMgrItem *pChild = pParent->pChild;\r
     while (pChild) {\r
         iCount ++;\r
@@ -695,7 +695,7 @@ FWL_ERR     CFWL_WidgetMgrDelegate::OnSetCapability(FX_DWORD dwCapability )
     m_pWidgetMgr->m_dwCapability = dwCapability;\r
     return FWL_ERR_Succeeded;\r
 }\r
-FX_INT32 CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message *pMessage)\r
+int32_t CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message *pMessage)\r
 {\r
     _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0);\r
     _FWL_RETURN_VALUE_IF_FAIL(pMessage->m_pDstTarget, 0);\r
@@ -738,7 +738,7 @@ FWL_ERR     CFWL_WidgetMgrDelegate::OnDrawWidget(IFWL_Widget *        pWidget,
         return FWL_ERR_Succeeded;\r
     }\r
     CFX_RectF clipBounds;\r
-#if (_FX_OS_==_FX_WIN32_DESKTOP_) || (_FX_OS_==_FX_WIN64_) || (_FX_OS_ == _FX_LINUX_DESKTOP_) || (_FX_OS_ == _FX_LINUX_EMBEDDED_) || (_FX_OS_ == _FX_ANDROID_)\r
+#if (_FX_OS_==_FX_WIN32_DESKTOP_) || (_FX_OS_==_FX_WIN64_) || (_FX_OS_ == _FX_LINUX_DESKTOP_) || (_FX_OS_ == _FX_ANDROID_)\r
     IFWL_WidgetDelegate *pDelegate = pWidget->SetDelegate(NULL);\r
     pDelegate->OnDrawWidget(pTemp, pMatrix);\r
     pGraphics->GetClipRect(clipBounds);\r
@@ -833,7 +833,7 @@ CFX_Graphics* CFWL_WidgetMgrDelegate::DrawWidgetBefore(IFWL_Widget *pWidget, CFX
         pItem->pOffscreen = FX_NEW CFX_Graphics;\r
         CFX_RectF rect;\r
         pWidget->GetWidgetRect(rect);\r
-        pItem->pOffscreen->Create((FX_INT32)rect.width, (FX_INT32)rect.height, FXDIB_Argb);\r
+        pItem->pOffscreen->Create((int32_t)rect.width, (int32_t)rect.height, FXDIB_Argb);\r
     }\r
     CFX_RectF rect;\r
     pGraphics->GetClipRect(rect);\r
@@ -893,7 +893,7 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix *
     FX_BOOL bOrginPtIntersectWidthChild = FALSE;\r
     FX_BOOL bOrginPtIntersectWidthDirty = rtDirty.Contains(rtWidget.left, rtWidget.top);\r
     static FWL_NeedRepaintHitData hitPoint[FWL_NEEDREPAINTHIT_Point];\r
-    static FX_INT32 iSize = sizeof(FWL_NeedRepaintHitData);\r
+    static int32_t iSize = sizeof(FWL_NeedRepaintHitData);\r
     FXSYS_memset(hitPoint, 0, iSize);\r
     FX_FLOAT fxPiece = rtWidget.width / FWL_NEEDREPAINTHIT_Piece;\r
     FX_FLOAT fyPiece = rtWidget.height / FWL_NEEDREPAINTHIT_Piece;\r
@@ -928,7 +928,7 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix *
         } else if (!(pChild->GetStates() & FWL_WGTSTATE_Invisible)) {\r
             rtChilds.Union(rect);\r
         }\r
-        for (FX_INT32 i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) {\r
+        for (int32_t i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) {\r
             if (hitPoint[i].bNotContainByDirty || hitPoint[i].bNotNeedRepaint) {\r
                 continue;\r
             }\r
@@ -950,8 +950,8 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget *pWidget, CFX_Matrix *
     if (rtChilds.IsEmpty()) {\r
         return TRUE;\r
     }\r
-    FX_INT32 repaintPoint = FWL_NEEDREPAINTHIT_Point;\r
-    for (FX_INT32 i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) {\r
+    int32_t repaintPoint = FWL_NEEDREPAINTHIT_Point;\r
+    for (int32_t i = 0; i < FWL_NEEDREPAINTHIT_Point; i ++) {\r
         if (hitPoint[i].bNotNeedRepaint) {\r
             repaintPoint --;\r
         }\r
@@ -1027,7 +1027,7 @@ FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget *pWidget, const CFX_WideString *saveFi
     CFX_RectF r;\r
     pWidget->GetWidgetRect(r);\r
     CFX_Graphics gs;\r
-    gs.Create((FX_INT32)r.width, (FX_INT32)r.height, FXDIB_Argb);\r
+    gs.Create((int32_t)r.width, (int32_t)r.height, FXDIB_Argb);\r
     CFWL_WidgetMgr *widgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr();\r
     CFWL_WidgetMgrDelegate *delegate = widgetMgr->GetDelegate();\r
     delegate->OnDrawWidget(pWidget, &gs, pMatrix);\r