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

Side by Side Diff: xfa/include/fwl/core/fwl_note.h

Issue 1508883003: Replace more static casts in FWL (part 3) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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
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 #ifndef _FWL_NOTE_H 7 #ifndef _FWL_NOTE_H
8 #define _FWL_NOTE_H 8 #define _FWL_NOTE_H
9 class IFWL_Target; 9 class IFWL_Target;
10 class IFWL_Widget; 10 class IFWL_Widget;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 public: 163 public:
164 FX_DWORD m_dwExtend; 164 FX_DWORD m_dwExtend;
165 }; 165 };
166 class CFWL_Message : public CFWL_Note { 166 class CFWL_Message : public CFWL_Note {
167 public: 167 public:
168 CFWL_Message() : CFWL_Note(FALSE) {} 168 CFWL_Message() : CFWL_Note(FALSE) {}
169 virtual ~CFWL_Message() {} 169 virtual ~CFWL_Message() {}
170 virtual CFWL_Event* CloneToEvent() { return NULL; } 170 virtual CFWL_Event* CloneToEvent() { return NULL; }
171 }; 171 };
172
173 // FIXME: CloneToEvent() relies on events having the same layout as
174 // messages, and the hash in the "event" will be wrong, too.
172 #define BEGIN_FWL_MESSAGE_DEF(classname, msghashcode) \ 175 #define BEGIN_FWL_MESSAGE_DEF(classname, msghashcode) \
173 class classname : public CFWL_Message { \ 176 class classname : public CFWL_Message { \
174 public: \ 177 public: \
175 classname() : CFWL_Message() {} \ 178 classname() : CFWL_Message() {} \
176 virtual CFWL_Note* Clone() { return new classname(*this); } \ 179 virtual CFWL_Note* Clone() { return new classname(*this); } \
177 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \ 180 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \
178 wsClass = L" ## classname ## "; \ 181 wsClass = L" ## classname ## "; \
Tom Sepez 2015/12/08 00:47:06 Note: This probably doesn't do what they think it
Lei Zhang 2015/12/09 04:22:11 Don't you have another CL to fix this? Or is that
179 return FWL_ERR_Succeeded; \ 182 return FWL_ERR_Succeeded; \
180 } \ 183 } \
181 virtual FX_DWORD GetClassID() const { return msghashcode; } \ 184 virtual FX_DWORD GetClassID() const { return msghashcode; } \
182 virtual CFWL_Event* CloneToEvent() { \ 185 virtual CFWL_Event* CloneToEvent() { \
183 classname* pEvent = new classname; \ 186 classname* pEvent = new classname; \
184 pEvent->m_bIsEvent = TRUE; \ 187 pEvent->m_bIsEvent = TRUE; \
185 return (CFWL_Event*)pEvent; \ 188 return reinterpret_cast<CFWL_Event*>(pEvent); \
186 } 189 }
187 #define END_FWL_MESSAGE_DEF \ 190 #define END_FWL_MESSAGE_DEF \
188 } \ 191 } \
189 ; 192 ;
190 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, FWL_MSGHASH_Activate) 193 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, FWL_MSGHASH_Activate)
191 END_FWL_MESSAGE_DEF 194 END_FWL_MESSAGE_DEF
192 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, FWL_MSGHASH_Deactivate) 195 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, FWL_MSGHASH_Deactivate)
193 END_FWL_MESSAGE_DEF 196 END_FWL_MESSAGE_DEF
194 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouse, FWL_MSGHASH_Mouse) 197 BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouse, FWL_MSGHASH_Mouse)
195 FX_FLOAT m_fx; 198 FX_FLOAT m_fx;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 }; 371 };
369 FWL_ERR FWL_AddToolTipTarget(IFWL_ToolTipTarget* pTarget); 372 FWL_ERR FWL_AddToolTipTarget(IFWL_ToolTipTarget* pTarget);
370 FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget* pTarget); 373 FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget* pTarget);
371 FWL_ERR FWL_SetToolTipInitialDelay(int32_t iDelayTime); 374 FWL_ERR FWL_SetToolTipInitialDelay(int32_t iDelayTime);
372 FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t iDelayTime); 375 FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t iDelayTime);
373 typedef FX_BOOL (*FWLMessageHookCallback)(CFWL_Message* msg, void* info); 376 typedef FX_BOOL (*FWLMessageHookCallback)(CFWL_Message* msg, void* info);
374 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, 377 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver,
375 FWLMessageHookCallback callback, 378 FWLMessageHookCallback callback,
376 void* info); 379 void* info);
377 #endif 380 #endif
OLDNEW
« no previous file with comments | « no previous file | xfa/include/fwl/core/fwl_widgetmgr.h » ('j') | xfa/src/fwl/src/core/fwl_gridimp.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698