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

Unified Diff: xfa/fwl/core/cfwl_message.h

Issue 2505703003: Cleaning up nits in fwl/core files. (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: xfa/fwl/core/cfwl_message.h
diff --git a/xfa/fwl/core/cfwl_message.h b/xfa/fwl/core/cfwl_message.h
index 0bfafb5a893dee0e49d0551989b1f2f11cb60ca3..56e8185c2958adcc5ed7a70dd05fc3b4cb108d68 100644
--- a/xfa/fwl/core/cfwl_message.h
+++ b/xfa/fwl/core/cfwl_message.h
@@ -14,22 +14,11 @@
enum class CFWL_MessageType {
None = 0,
-
- Activate,
- Close,
- Cursor,
- Deactivate,
- DropFiles,
Key,
KillFocus,
Mouse,
MouseWheel,
- Post,
- SetFocus,
- Size,
- TaskClicked,
- WindowMove,
- WindowWillMove
+ SetFocus
};
enum class FWL_MouseCommand {
@@ -39,9 +28,6 @@ enum class FWL_MouseCommand {
RightButtonDown,
RightButtonUp,
RightButtonDblClk,
- MiddleButtonDown,
- MiddleButtonUp,
- MiddleButtonDblClk,
Move,
Enter,
Leave,
@@ -100,30 +86,19 @@ inline CFWL_Message* CFWL_Message::Retain() {
return this;
}
-#define FWL_MESSAGE_CLASS_DEF(classname, msgType, ...) \
- class classname : public CFWL_Message { \
- public: \
- classname(); \
- ~classname() override; \
- CFWL_Message* Clone() override; \
- CFWL_MessageType GetClassID() const override; \
- __VA_ARGS__ \
- };
-
-#define FWL_MESSAGE_FUNCTION_DEF(classname, msgType, ...) \
- inline classname::classname() {} \
- inline classname::~classname() {} \
- inline CFWL_Message* classname::Clone() { return new classname(*this); } \
- inline CFWL_MessageType classname::GetClassID() const { return msgType; } \
- __VA_ARGS__
-
-#define FWL_MESSAGE_DEF(classname, msgType, ...) \
- FWL_MESSAGE_CLASS_DEF(classname, msgType, __VA_ARGS__) \
- FWL_MESSAGE_FUNCTION_DEF(classname, msgType)
-
-FWL_MESSAGE_DEF(CFWL_MsgActivate, CFWL_MessageType::Activate)
-
-FWL_MESSAGE_DEF(CFWL_MsgDeactivate, CFWL_MessageType::Deactivate)
+#define FWL_MESSAGE_DEF(classname, msgType, ...) \
npm 2016/11/15 21:38:30 Is this really the best way to do this?
dsinclair 2016/11/15 21:44:06 Probably not, but it's the way it's currently done
Tom Sepez 2016/11/15 22:41:47 I'd suggest just writing it out "longhand" in the
+ class classname : public CFWL_Message { \
+ public: \
+ classname(); \
+ ~classname() override; \
+ CFWL_Message* Clone() override; \
+ CFWL_MessageType GetClassID() const override; \
+ __VA_ARGS__ \
+ }; \
+ inline classname::classname() {} \
+ inline classname::~classname() {} \
+ inline CFWL_Message* classname::Clone() { return new classname(*this); } \
+ inline CFWL_MessageType classname::GetClassID() const { return msgType; }
FWL_MESSAGE_DEF(CFWL_MsgMouse, CFWL_MessageType::Mouse, FX_FLOAT m_fx;
FX_FLOAT m_fy;
@@ -148,38 +123,4 @@ FWL_MESSAGE_DEF(CFWL_MsgKey, CFWL_MessageType::Key, uint32_t m_dwKeyCode;
uint32_t m_dwFlags;
FWL_KeyCommand m_dwCmd;)
-FWL_MESSAGE_DEF(CFWL_MsgCursor, CFWL_MessageType::Cursor)
-
-FWL_MESSAGE_DEF(CFWL_MsgSize, CFWL_MessageType::Size, int32_t m_iWidth;
- int32_t m_iHeight;)
-
-FWL_MESSAGE_DEF(CFWL_MsgWindowMove, CFWL_MessageType::WindowMove, FX_FLOAT m_fx;
- FX_FLOAT m_fy;)
-
-FWL_MESSAGE_CLASS_DEF(CFWL_MsgDropFiles,
- CFWL_MessageType::DropFiles,
- CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy);
- FX_FLOAT m_fx;
- FX_FLOAT m_fy;
- CFX_WideStringArray m_files;)
-FWL_MESSAGE_FUNCTION_DEF(
- CFWL_MsgDropFiles,
- CFWL_MessageType::DropFiles,
- inline CFWL_MsgDropFiles::CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy) {
- m_pDstTarget = copy.m_pDstTarget;
- m_pSrcTarget = copy.m_pSrcTarget;
- m_fx = copy.m_fx;
- m_fy = copy.m_fy;
- m_files.Append(copy.m_files);
- })
-
-FWL_MESSAGE_DEF(CFWL_MsgTaskClicked,
- CFWL_MessageType::TaskClicked,
- FX_FLOAT m_fx;
- FX_FLOAT m_fy;)
-
-FWL_MESSAGE_DEF(CFWL_MsgClose, CFWL_MessageType::Close)
-
-FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, CFWL_MessageType::WindowWillMove)
-
#endif // XFA_FWL_CORE_CFWL_MESSAGE_H_

Powered by Google App Engine
This is Rietveld 408576698