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

Side by Side Diff: xfa/fwl/core/cfwl_event.h

Issue 1943413002: Convert FWL_ERR into an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@bcdattribute
Patch Set: 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/basewidget/ifwl_tooltip.h ('k') | xfa/fwl/core/cfwl_message.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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef XFA_FWL_CORE_CFWL_EVENT_H_ 7 #ifndef XFA_FWL_CORE_CFWL_EVENT_H_
8 #define XFA_FWL_CORE_CFWL_EVENT_H_ 8 #define XFA_FWL_CORE_CFWL_EVENT_H_
9 9
10 #include "core/fxcrt/include/fx_coordinates.h" 10 #include "core/fxcrt/include/fx_coordinates.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 class CFX_Graphics; 64 class CFX_Graphics;
65 class IFWL_Widget; 65 class IFWL_Widget;
66 66
67 class CFWL_Event { 67 class CFWL_Event {
68 public: 68 public:
69 CFWL_Event() 69 CFWL_Event()
70 : m_pSrcTarget(nullptr), m_pDstTarget(nullptr), m_dwRefCount(1) {} 70 : m_pSrcTarget(nullptr), m_pDstTarget(nullptr), m_dwRefCount(1) {}
71 virtual ~CFWL_Event() {} 71 virtual ~CFWL_Event() {}
72 72
73 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { 73 virtual FWL_Error GetClassName(CFX_WideString& wsClass) const {
74 return FWL_ERR_Succeeded; 74 return FWL_Error::Succeeded;
75 } 75 }
76 virtual CFWL_EventType GetClassID() const { return CFWL_EventType::None; } 76 virtual CFWL_EventType GetClassID() const { return CFWL_EventType::None; }
77 77
78 uint32_t Release() { 78 uint32_t Release() {
79 m_dwRefCount--; 79 m_dwRefCount--;
80 uint32_t dwRefCount = m_dwRefCount; 80 uint32_t dwRefCount = m_dwRefCount;
81 if (!m_dwRefCount) 81 if (!m_dwRefCount)
82 delete this; 82 delete this;
83 return dwRefCount; 83 return dwRefCount;
84 } 84 }
85 85
86 IFWL_Widget* m_pSrcTarget; 86 IFWL_Widget* m_pSrcTarget;
87 IFWL_Widget* m_pDstTarget; 87 IFWL_Widget* m_pDstTarget;
88 88
89 private: 89 private:
90 uint32_t m_dwRefCount; 90 uint32_t m_dwRefCount;
91 }; 91 };
92 92
93 #define BEGIN_FWL_EVENT_DEF(classname, eventType) \ 93 #define BEGIN_FWL_EVENT_DEF(classname, eventType) \
94 class classname : public CFWL_Event { \ 94 class classname : public CFWL_Event { \
95 public: \ 95 public: \
96 classname() : CFWL_Event() {} \ 96 classname() : CFWL_Event() {} \
97 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \ 97 virtual FWL_Error GetClassName(CFX_WideString& wsClass) const { \
98 wsClass = L## #classname; \ 98 wsClass = L## #classname; \
99 return FWL_ERR_Succeeded; \ 99 return FWL_Error::Succeeded; \
100 } \ 100 } \
101 virtual CFWL_EventType GetClassID() const { return eventType; } 101 virtual CFWL_EventType GetClassID() const { return eventType; }
102 102
103 #define END_FWL_EVENT_DEF \ 103 #define END_FWL_EVENT_DEF \
104 } \ 104 } \
105 ; // NOLINT 105 ; // NOLINT
106 106
107 BEGIN_FWL_EVENT_DEF(CFWL_EvtMouse, CFWL_EventType::Mouse) 107 BEGIN_FWL_EVENT_DEF(CFWL_EvtMouse, CFWL_EventType::Mouse)
108 FX_FLOAT m_fx; 108 FX_FLOAT m_fx;
109 FX_FLOAT m_fy; 109 FX_FLOAT m_fy;
110 uint32_t m_dwFlags; 110 uint32_t m_dwFlags;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 BEGIN_FWL_EVENT_DEF(CFWL_EvtSizeChanged, CFWL_EventType::SizeChanged) 164 BEGIN_FWL_EVENT_DEF(CFWL_EvtSizeChanged, CFWL_EventType::SizeChanged)
165 IFWL_Widget* m_pWidget; 165 IFWL_Widget* m_pWidget;
166 CFX_RectF m_rtOld; 166 CFX_RectF m_rtOld;
167 CFX_RectF m_rtNew; 167 CFX_RectF m_rtNew;
168 END_FWL_EVENT_DEF 168 END_FWL_EVENT_DEF
169 169
170 BEGIN_FWL_EVENT_DEF(CFWL_EvtIdle, CFWL_EventType::Idle) 170 BEGIN_FWL_EVENT_DEF(CFWL_EvtIdle, CFWL_EventType::Idle)
171 END_FWL_EVENT_DEF 171 END_FWL_EVENT_DEF
172 172
173 #endif // XFA_FWL_CORE_CFWL_EVENT_H_ 173 #endif // XFA_FWL_CORE_CFWL_EVENT_H_
OLDNEW
« no previous file with comments | « xfa/fwl/basewidget/ifwl_tooltip.h ('k') | xfa/fwl/core/cfwl_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698