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

Side by Side Diff: xfa/fwl/core/cfwl_message.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/core/cfwl_event.h ('k') | xfa/fwl/core/fwl_appimp.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_MESSAGE_H_ 7 #ifndef XFA_FWL_CORE_CFWL_MESSAGE_H_
8 #define XFA_FWL_CORE_CFWL_MESSAGE_H_ 8 #define XFA_FWL_CORE_CFWL_MESSAGE_H_
9 9
10 #include "core/fxcrt/include/fx_string.h" 10 #include "core/fxcrt/include/fx_string.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 class CFWL_Message { 54 class CFWL_Message {
55 public: 55 public:
56 CFWL_Message() 56 CFWL_Message()
57 : m_pSrcTarget(nullptr), 57 : m_pSrcTarget(nullptr),
58 m_pDstTarget(nullptr), 58 m_pDstTarget(nullptr),
59 m_dwExtend(0), 59 m_dwExtend(0),
60 m_dwRefCount(1) {} 60 m_dwRefCount(1) {}
61 virtual ~CFWL_Message() {} 61 virtual ~CFWL_Message() {}
62 62
63 virtual CFWL_Message* Clone() { return nullptr; } 63 virtual CFWL_Message* Clone() { return nullptr; }
64 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { 64 virtual FWL_Error GetClassName(CFX_WideString& wsClass) const {
65 return FWL_ERR_Succeeded; 65 return FWL_Error::Succeeded;
66 } 66 }
67 virtual CFWL_MessageType GetClassID() const { return CFWL_MessageType::None; } 67 virtual CFWL_MessageType GetClassID() const { return CFWL_MessageType::None; }
68 68
69 uint32_t Release() { 69 uint32_t Release() {
70 m_dwRefCount--; 70 m_dwRefCount--;
71 uint32_t dwRefCount = m_dwRefCount; 71 uint32_t dwRefCount = m_dwRefCount;
72 if (!m_dwRefCount) 72 if (!m_dwRefCount)
73 delete this; 73 delete this;
74 return dwRefCount; 74 return dwRefCount;
75 } 75 }
76 76
77 CFWL_Message* Retain() { 77 CFWL_Message* Retain() {
78 m_dwRefCount++; 78 m_dwRefCount++;
79 return this; 79 return this;
80 } 80 }
81 81
82 IFWL_Widget* m_pSrcTarget; 82 IFWL_Widget* m_pSrcTarget;
83 IFWL_Widget* m_pDstTarget; 83 IFWL_Widget* m_pDstTarget;
84 uint32_t m_dwExtend; 84 uint32_t m_dwExtend;
85 85
86 private: 86 private:
87 uint32_t m_dwRefCount; 87 uint32_t m_dwRefCount;
88 }; 88 };
89 89
90 #define BEGIN_FWL_MESSAGE_DEF(classname, msgType) \ 90 #define BEGIN_FWL_MESSAGE_DEF(classname, msgType) \
91 class classname : public CFWL_Message { \ 91 class classname : public CFWL_Message { \
92 public: \ 92 public: \
93 classname() : CFWL_Message() {} \ 93 classname() : CFWL_Message() {} \
94 CFWL_Message* Clone() override { return new classname(*this); } \ 94 CFWL_Message* Clone() override { return new classname(*this); } \
95 FWL_ERR GetClassName(CFX_WideString& wsClass) const override { \ 95 FWL_Error GetClassName(CFX_WideString& wsClass) const override { \
96 wsClass = L## #classname; \ 96 wsClass = L## #classname; \
97 return FWL_ERR_Succeeded; \ 97 return FWL_Error::Succeeded; \
98 } \ 98 } \
99 CFWL_MessageType GetClassID() const override { return msgType; } 99 CFWL_MessageType GetClassID() const override { return msgType; }
100 100
101 #define END_FWL_MESSAGE_DEF \ 101 #define END_FWL_MESSAGE_DEF \
102 } \ 102 } \
103 ; // NOLINT 103 ; // NOLINT
104 104
105 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, CFWL_MessageType::Activate) 105 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, CFWL_MessageType::Activate)
106 END_FWL_MESSAGE_DEF 106 END_FWL_MESSAGE_DEF
107 107
108 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, CFWL_MessageType::Deactivate) 108 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, CFWL_MessageType::Deactivate)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 FX_FLOAT m_fy; 168 FX_FLOAT m_fy;
169 END_FWL_MESSAGE_DEF 169 END_FWL_MESSAGE_DEF
170 170
171 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgClose, CFWL_MessageType::Close) 171 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgClose, CFWL_MessageType::Close)
172 END_FWL_MESSAGE_DEF 172 END_FWL_MESSAGE_DEF
173 173
174 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, CFWL_MessageType::WindowWillMove) 174 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, CFWL_MessageType::WindowWillMove)
175 END_FWL_MESSAGE_DEF 175 END_FWL_MESSAGE_DEF
176 176
177 #endif // XFA_FWL_CORE_CFWL_MESSAGE_H_ 177 #endif // XFA_FWL_CORE_CFWL_MESSAGE_H_
OLDNEW
« no previous file with comments | « xfa/fwl/core/cfwl_event.h ('k') | xfa/fwl/core/fwl_appimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698