| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../../foxitlib.h" | 7 #include "../../../foxitlib.h" |
| 8 #include "include/fwl_targetimp.h" | 8 #include "include/fwl_targetimp.h" |
| 9 #include "include/fwl_threadimp.h" | 9 #include "include/fwl_threadimp.h" |
| 10 #include "include/fwl_noteimp.h" | 10 #include "include/fwl_noteimp.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 return FWL_WGTHITTEST_Client; | 321 return FWL_WGTHITTEST_Client; |
| 322 } | 322 } |
| 323 FWL_ERR CFWL_FormImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat
rix ) | 323 FWL_ERR CFWL_FormImp::DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMat
rix ) |
| 324 { | 324 { |
| 325 _FWL_RETURN_VALUE_IF_FAIL(pGraphics, FWL_ERR_Indefinite); | 325 _FWL_RETURN_VALUE_IF_FAIL(pGraphics, FWL_ERR_Indefinite); |
| 326 _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pThemeProvider, FWL_ERR_Indefinit
e); | 326 _FWL_RETURN_VALUE_IF_FAIL(m_pProperties->m_pThemeProvider, FWL_ERR_Indefinit
e); |
| 327 IFWL_ThemeProvider *pTheme = m_pProperties->m_pThemeProvider; | 327 IFWL_ThemeProvider *pTheme = m_pProperties->m_pThemeProvider; |
| 328 FX_BOOL bInactive = !IsActive(); | 328 FX_BOOL bInactive = !IsActive(); |
| 329 FX_INT32 iState = bInactive ? FWL_PARTSTATE_FRM_Inactive : FWL_PARTSTATE_FRM
_Normal; | 329 int32_t iState = bInactive ? FWL_PARTSTATE_FRM_Inactive : FWL_PARTSTATE_FRM_
Normal; |
| 330 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_NoDrawClient) == 0) { | 330 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_NoDrawClient) == 0) { |
| 331 DrawBackground(pGraphics, pTheme); | 331 DrawBackground(pGraphics, pTheme); |
| 332 } | 332 } |
| 333 #ifdef FWL_UseMacSystemBorder | 333 #ifdef FWL_UseMacSystemBorder |
| 334 return FWL_ERR_Succeeded; | 334 return FWL_ERR_Succeeded; |
| 335 #endif | 335 #endif |
| 336 CFWL_ThemeBackground param; | 336 CFWL_ThemeBackground param; |
| 337 param.m_pWidget = m_pInterface; | 337 param.m_pWidget = m_pInterface; |
| 338 param.m_dwStates = iState; | 338 param.m_dwStates = iState; |
| 339 param.m_pGraphics = pGraphics; | 339 param.m_pGraphics = pGraphics; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 return m_pMaxBox; | 592 return m_pMaxBox; |
| 593 } | 593 } |
| 594 if (m_pMinBox && (m_pMinBox->m_dwState & dwState)) { | 594 if (m_pMinBox && (m_pMinBox->m_dwState & dwState)) { |
| 595 return m_pMinBox; | 595 return m_pMinBox; |
| 596 } | 596 } |
| 597 if (m_pCaptionBox && (m_pCaptionBox->m_dwState & dwState)) { | 597 if (m_pCaptionBox && (m_pCaptionBox->m_dwState & dwState)) { |
| 598 return m_pCaptionBox; | 598 return m_pCaptionBox; |
| 599 } | 599 } |
| 600 return NULL; | 600 return NULL; |
| 601 } | 601 } |
| 602 CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(FX_INT32 nIndex) | 602 CFWL_SysBtn* CFWL_FormImp::GetSysBtnByIndex(int32_t nIndex) |
| 603 { | 603 { |
| 604 if (nIndex < 0) { | 604 if (nIndex < 0) { |
| 605 return NULL; | 605 return NULL; |
| 606 } | 606 } |
| 607 CFX_PtrArray arrBtn; | 607 CFX_PtrArray arrBtn; |
| 608 if (m_pMinBox) { | 608 if (m_pMinBox) { |
| 609 arrBtn.Add(m_pMinBox); | 609 arrBtn.Add(m_pMinBox); |
| 610 } | 610 } |
| 611 if (m_pMaxBox) { | 611 if (m_pMaxBox) { |
| 612 arrBtn.Add(m_pMaxBox); | 612 arrBtn.Add(m_pMaxBox); |
| 613 } | 613 } |
| 614 if (m_pCloseBox) { | 614 if (m_pCloseBox) { |
| 615 arrBtn.Add(m_pCloseBox); | 615 arrBtn.Add(m_pCloseBox); |
| 616 } | 616 } |
| 617 return (CFWL_SysBtn*) arrBtn[nIndex]; | 617 return (CFWL_SysBtn*) arrBtn[nIndex]; |
| 618 } | 618 } |
| 619 FX_INT32 CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn *pBtn) | 619 int32_t CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn *pBtn) |
| 620 { | 620 { |
| 621 CFX_PtrArray arrBtn; | 621 CFX_PtrArray arrBtn; |
| 622 if (m_pMinBox) { | 622 if (m_pMinBox) { |
| 623 arrBtn.Add(m_pMinBox); | 623 arrBtn.Add(m_pMinBox); |
| 624 } | 624 } |
| 625 if (m_pMaxBox) { | 625 if (m_pMaxBox) { |
| 626 arrBtn.Add(m_pMaxBox); | 626 arrBtn.Add(m_pMaxBox); |
| 627 } | 627 } |
| 628 if (m_pCloseBox) { | 628 if (m_pCloseBox) { |
| 629 arrBtn.Add(m_pCloseBox); | 629 arrBtn.Add(m_pCloseBox); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 } else if (fTemp > fLimitMax && fHeight < fLimitMax) { | 982 } else if (fTemp > fLimitMax && fHeight < fLimitMax) { |
| 983 fTop -= bTop ? (fLimitMax - fHeight) : 0; | 983 fTop -= bTop ? (fLimitMax - fHeight) : 0; |
| 984 fHeight = fLimitMax; | 984 fHeight = fLimitMax; |
| 985 } | 985 } |
| 986 } | 986 } |
| 987 } | 987 } |
| 988 CFWL_FormDelegate::CFWL_FormDelegate(CFWL_FormImp *pOwner) | 988 CFWL_FormDelegate::CFWL_FormDelegate(CFWL_FormImp *pOwner) |
| 989 : m_pOwner(pOwner) | 989 : m_pOwner(pOwner) |
| 990 { | 990 { |
| 991 } | 991 } |
| 992 FX_INT32 CFWL_FormDelegate::OnProcessMessage(CFWL_Message *pMessage) | 992 int32_t CFWL_FormDelegate::OnProcessMessage(CFWL_Message *pMessage) |
| 993 { | 993 { |
| 994 #ifdef FWL_UseMacSystemBorder | 994 #ifdef FWL_UseMacSystemBorder |
| 995 _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); | 995 _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); |
| 996 FX_DWORD dwMsgCode = pMessage->GetClassID(); | 996 FX_DWORD dwMsgCode = pMessage->GetClassID(); |
| 997 FX_INT32 iRet = 1; | 997 int32_t iRet = 1; |
| 998 switch (dwMsgCode) { | 998 switch (dwMsgCode) { |
| 999 case FWL_MSGHASH_Activate: { | 999 case FWL_MSGHASH_Activate: { |
| 1000 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated
; | 1000 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated
; |
| 1001 m_pOwner->Repaint(&m_pOwner->m_rtRelative); | 1001 m_pOwner->Repaint(&m_pOwner->m_rtRelative); |
| 1002 break; | 1002 break; |
| 1003 } | 1003 } |
| 1004 case FWL_MSGHASH_Deactivate: { | 1004 case FWL_MSGHASH_Deactivate: { |
| 1005 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Deactivated; | 1005 m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Deactivated; |
| 1006 m_pOwner->Repaint(&m_pOwner->m_rtRelative); | 1006 m_pOwner->Repaint(&m_pOwner->m_rtRelative); |
| 1007 break; | 1007 break; |
| 1008 } | 1008 } |
| 1009 } | 1009 } |
| 1010 return FWL_ERR_Succeeded; | 1010 return FWL_ERR_Succeeded; |
| 1011 #else | 1011 #else |
| 1012 _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); | 1012 _FWL_RETURN_VALUE_IF_FAIL(pMessage, 0); |
| 1013 FX_DWORD dwMsgCode = pMessage->GetClassID(); | 1013 FX_DWORD dwMsgCode = pMessage->GetClassID(); |
| 1014 FX_INT32 iRet = 1; | 1014 int32_t iRet = 1; |
| 1015 switch (dwMsgCode) { | 1015 switch (dwMsgCode) { |
| 1016 case FWL_MSGHASH_Activate: { | 1016 case FWL_MSGHASH_Activate: { |
| 1017 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated
; | 1017 m_pOwner->m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Deactivated
; |
| 1018 IFWL_NoteThread *pThread = m_pOwner->GetOwnerThread(); | 1018 IFWL_NoteThread *pThread = m_pOwner->GetOwnerThread(); |
| 1019 CFWL_NoteDriver *pDriver = (CFWL_NoteDriver*)pThread->GetNoteDri
ver(); | 1019 CFWL_NoteDriver *pDriver = (CFWL_NoteDriver*)pThread->GetNoteDri
ver(); |
| 1020 CFWL_WidgetImp *pSubFocusImp = m_pOwner->GetSubFocus(); | 1020 CFWL_WidgetImp *pSubFocusImp = m_pOwner->GetSubFocus(); |
| 1021 IFWL_Widget *pSubFocus = pSubFocusImp ? pSubFocusImp->GetInterfa
ce() : NULL; | 1021 IFWL_Widget *pSubFocus = pSubFocusImp ? pSubFocusImp->GetInterfa
ce() : NULL; |
| 1022 if (pSubFocus && pSubFocus != pDriver->GetFocus()) { | 1022 if (pSubFocus && pSubFocus != pDriver->GetFocus()) { |
| 1023 pDriver->SetFocus(pSubFocus); | 1023 pDriver->SetFocus(pSubFocus); |
| 1024 } | 1024 } |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 CFWL_EvtClose eClose; | 1425 CFWL_EvtClose eClose; |
| 1426 eClose.m_pSrcTarget = m_pOwner->m_pInterface; | 1426 eClose.m_pSrcTarget = m_pOwner->m_pInterface; |
| 1427 m_pOwner->DispatchEvent(&eClose); | 1427 m_pOwner->DispatchEvent(&eClose); |
| 1428 } | 1428 } |
| 1429 FWL_ERR FWL_Accelerator_SetForm(IFWL_Form *pFrom, CFX_MapAccelerators *pMapAccel
) | 1429 FWL_ERR FWL_Accelerator_SetForm(IFWL_Form *pFrom, CFX_MapAccelerators *pMapAccel
) |
| 1430 { | 1430 { |
| 1431 CFWL_FormImp *pImp = (CFWL_FormImp*)((IFWL_TargetData*)pFrom)->GetData(); | 1431 CFWL_FormImp *pImp = (CFWL_FormImp*)((IFWL_TargetData*)pFrom)->GetData(); |
| 1432 _FWL_RETURN_VALUE_IF_FAIL(pImp, FWL_ERR_Indefinite); | 1432 _FWL_RETURN_VALUE_IF_FAIL(pImp, FWL_ERR_Indefinite); |
| 1433 return FWL_ERR_Succeeded; | 1433 return FWL_ERR_Succeeded; |
| 1434 } | 1434 } |
| OLD | NEW |