Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: xfa/fwl/core/fwl_noteimp.cpp

Issue 1951653002: Return bool rather than bitwise-and for FX_BOOL (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: More bool, fix nits. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/core/fwl_formimp.h ('k') | xfa/fwl/core/fwl_widgetmgrimp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "xfa/fwl/core/fwl_noteimp.h" 7 #include "xfa/fwl/core/fwl_noteimp.h"
8 8
9 #include "core/fxcrt/include/fx_ext.h" 9 #include "core/fxcrt/include/fx_ext.h"
10 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" 10 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h"
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 } 803 }
804 } 804 }
805 } 805 }
806 return FALSE; 806 return FALSE;
807 } 807 }
808 808
809 FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) { 809 FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) {
810 if (dwFilter == FWL_EVENT_ALL_MASK) 810 if (dwFilter == FWL_EVENT_ALL_MASK)
811 return TRUE; 811 return TRUE;
812 812
813 FX_BOOL bRet = FALSE;
814 switch (pEvent->GetClassID()) { 813 switch (pEvent->GetClassID()) {
815 case CFWL_EventType::Mouse: { 814 case CFWL_EventType::Mouse:
816 bRet = dwFilter & FWL_EVENT_MOUSE_MASK; 815 return !!(dwFilter & FWL_EVENT_MOUSE_MASK);
817 break; 816 case CFWL_EventType::MouseWheel:
818 } 817 return !!(dwFilter & FWL_EVENT_MOUSEWHEEL_MASK);
819 case CFWL_EventType::MouseWheel: { 818 case CFWL_EventType::Key:
820 bRet = dwFilter & FWL_EVENT_MOUSEWHEEL_MASK; 819 return !!(dwFilter & FWL_EVENT_KEY_MASK);
821 break;
822 }
823 case CFWL_EventType::Key: {
824 bRet = dwFilter & FWL_EVENT_KEY_MASK;
825 break;
826 }
827 case CFWL_EventType::SetFocus: 820 case CFWL_EventType::SetFocus:
828 case CFWL_EventType::KillFocus: { 821 case CFWL_EventType::KillFocus:
829 bRet = dwFilter & FWL_EVENT_FOCUSCHANGED_MASK; 822 return !!(dwFilter & FWL_EVENT_FOCUSCHANGED_MASK);
830 break; 823 case CFWL_EventType::Draw:
831 } 824 return !!(dwFilter & FWL_EVENT_DRAW_MASK);
832 case CFWL_EventType::Draw: { 825 case CFWL_EventType::Close:
833 bRet = dwFilter & FWL_EVENT_DRAW_MASK; 826 return !!(dwFilter & FWL_EVENT_CLOSE_MASK);
834 break; 827 case CFWL_EventType::SizeChanged:
835 } 828 return !!(dwFilter & FWL_EVENT_SIZECHANGED_MASK);
836 case CFWL_EventType::Close: { 829 case CFWL_EventType::Idle:
837 bRet = dwFilter & FWL_EVENT_CLOSE_MASK; 830 return !!(dwFilter & FWL_EVENT_IDLE_MASK);
838 break; 831 default:
839 } 832 return !!(dwFilter & FWL_EVENT_CONTROL_MASK);
840 case CFWL_EventType::SizeChanged: {
841 bRet = dwFilter & FWL_EVENT_SIZECHANGED_MASK;
842 break;
843 }
844 case CFWL_EventType::Idle: {
845 bRet = dwFilter & FWL_EVENT_IDLE_MASK;
846 break;
847 }
848 default: {
849 bRet = dwFilter & FWL_EVENT_CONTROL_MASK;
850 break;
851 }
852 } 833 }
853 return bRet;
854 } 834 }
855 835
856 CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL; 836 CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL;
857 837
858 CFWL_ToolTipContainer::CFWL_ToolTipContainer() 838 CFWL_ToolTipContainer::CFWL_ToolTipContainer()
859 : pCurTarget(NULL), m_pToolTipImp(NULL) { 839 : pCurTarget(NULL), m_pToolTipImp(NULL) {
860 m_ToolTipDp = new CFWL_CoreToolTipDP; 840 m_ToolTipDp = new CFWL_CoreToolTipDP;
861 m_ToolTipDp->m_nInitDelayTime = 0; 841 m_ToolTipDp->m_nInitDelayTime = 0;
862 m_ToolTipDp->m_nAutoPopDelayTime = 2000; 842 m_ToolTipDp->m_nAutoPopDelayTime = 2000;
863 } 843 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) { 948 if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) {
969 m_pToolTipImp->Hide(); 949 m_pToolTipImp->Hide();
970 pCurTarget = NULL; 950 pCurTarget = NULL;
971 return TRUE; 951 return TRUE;
972 } 952 }
973 return FALSE; 953 return FALSE;
974 } 954 }
975 IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() { 955 IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() {
976 return pCurTarget; 956 return pCurTarget;
977 } 957 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/fwl_formimp.h ('k') | xfa/fwl/core/fwl_widgetmgrimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698