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

Side by Side Diff: fpdfsdk/fsdk_annothandler.cpp

Issue 1835693002: Remove FX_DWORD from fpdfsdk/ and testing/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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 | « fpdfsdk/fpdfxfa/fpdfxfa_util.cpp ('k') | fpdfsdk/fsdk_baseannot.cpp » ('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 "fpdfsdk/include/fsdk_annothandler.h" 7 #include "fpdfsdk/include/fsdk_annothandler.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler( 134 IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(
135 const CFX_ByteString& sType) const { 135 const CFX_ByteString& sType) const {
136 auto it = m_mapType2Handler.find(sType); 136 auto it = m_mapType2Handler.find(sType);
137 return it != m_mapType2Handler.end() ? it->second : nullptr; 137 return it != m_mapType2Handler.end() ? it->second : nullptr;
138 } 138 }
139 139
140 void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, 140 void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView,
141 CPDFSDK_Annot* pAnnot, 141 CPDFSDK_Annot* pAnnot,
142 CFX_RenderDevice* pDevice, 142 CFX_RenderDevice* pDevice,
143 CFX_Matrix* pUser2Device, 143 CFX_Matrix* pUser2Device,
144 FX_DWORD dwFlags) { 144 uint32_t dwFlags) {
145 ASSERT(pAnnot); 145 ASSERT(pAnnot);
146 146
147 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 147 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
148 pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); 148 pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
149 } else { 149 } else {
150 #ifdef PDF_ENABLE_XFA 150 #ifdef PDF_ENABLE_XFA
151 if (pAnnot->IsXFAField()) 151 if (pAnnot->IsXFAField())
152 return; 152 return;
153 #endif // PDF_ENABLE_XFA 153 #endif // PDF_ENABLE_XFA
154 static_cast<CPDFSDK_BAAnnot*>(pAnnot) 154 static_cast<CPDFSDK_BAAnnot*>(pAnnot)
155 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); 155 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
156 } 156 }
157 } 157 }
158 158
159 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( 159 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(
160 CPDFSDK_PageView* pPageView, 160 CPDFSDK_PageView* pPageView,
161 CPDFSDK_Annot* pAnnot, 161 CPDFSDK_Annot* pAnnot,
162 FX_DWORD nFlags, 162 uint32_t nFlags,
163 const CFX_FloatPoint& point) { 163 const CFX_FloatPoint& point) {
164 ASSERT(pAnnot); 164 ASSERT(pAnnot);
165 165
166 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 166 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
167 return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point); 167 return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point);
168 } 168 }
169 return FALSE; 169 return FALSE;
170 } 170 }
171 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp( 171 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(
172 CPDFSDK_PageView* pPageView, 172 CPDFSDK_PageView* pPageView,
173 CPDFSDK_Annot* pAnnot, 173 CPDFSDK_Annot* pAnnot,
174 FX_DWORD nFlags, 174 uint32_t nFlags,
175 const CFX_FloatPoint& point) { 175 const CFX_FloatPoint& point) {
176 ASSERT(pAnnot); 176 ASSERT(pAnnot);
177 177
178 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 178 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
179 return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point); 179 return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point);
180 } 180 }
181 return FALSE; 181 return FALSE;
182 } 182 }
183 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk( 183 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(
184 CPDFSDK_PageView* pPageView, 184 CPDFSDK_PageView* pPageView,
185 CPDFSDK_Annot* pAnnot, 185 CPDFSDK_Annot* pAnnot,
186 FX_DWORD nFlags, 186 uint32_t nFlags,
187 const CFX_FloatPoint& point) { 187 const CFX_FloatPoint& point) {
188 ASSERT(pAnnot); 188 ASSERT(pAnnot);
189 189
190 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 190 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
191 return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); 191 return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
192 } 192 }
193 return FALSE; 193 return FALSE;
194 } 194 }
195 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove( 195 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(
196 CPDFSDK_PageView* pPageView, 196 CPDFSDK_PageView* pPageView,
197 CPDFSDK_Annot* pAnnot, 197 CPDFSDK_Annot* pAnnot,
198 FX_DWORD nFlags, 198 uint32_t nFlags,
199 const CFX_FloatPoint& point) { 199 const CFX_FloatPoint& point) {
200 ASSERT(pAnnot); 200 ASSERT(pAnnot);
201 201
202 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 202 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
203 return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point); 203 return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point);
204 } 204 }
205 return FALSE; 205 return FALSE;
206 } 206 }
207 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel( 207 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(
208 CPDFSDK_PageView* pPageView, 208 CPDFSDK_PageView* pPageView,
209 CPDFSDK_Annot* pAnnot, 209 CPDFSDK_Annot* pAnnot,
210 FX_DWORD nFlags, 210 uint32_t nFlags,
211 short zDelta, 211 short zDelta,
212 const CFX_FloatPoint& point) { 212 const CFX_FloatPoint& point) {
213 ASSERT(pAnnot); 213 ASSERT(pAnnot);
214 214
215 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 215 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
216 return pAnnotHandler->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, 216 return pAnnotHandler->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta,
217 point); 217 point);
218 } 218 }
219 return FALSE; 219 return FALSE;
220 } 220 }
221 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown( 221 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(
222 CPDFSDK_PageView* pPageView, 222 CPDFSDK_PageView* pPageView,
223 CPDFSDK_Annot* pAnnot, 223 CPDFSDK_Annot* pAnnot,
224 FX_DWORD nFlags, 224 uint32_t nFlags,
225 const CFX_FloatPoint& point) { 225 const CFX_FloatPoint& point) {
226 ASSERT(pAnnot); 226 ASSERT(pAnnot);
227 227
228 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 228 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
229 return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point); 229 return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point);
230 } 230 }
231 return FALSE; 231 return FALSE;
232 } 232 }
233 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp( 233 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(
234 CPDFSDK_PageView* pPageView, 234 CPDFSDK_PageView* pPageView,
235 CPDFSDK_Annot* pAnnot, 235 CPDFSDK_Annot* pAnnot,
236 FX_DWORD nFlags, 236 uint32_t nFlags,
237 const CFX_FloatPoint& point) { 237 const CFX_FloatPoint& point) {
238 ASSERT(pAnnot); 238 ASSERT(pAnnot);
239 239
240 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 240 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
241 return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point); 241 return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point);
242 } 242 }
243 return FALSE; 243 return FALSE;
244 } 244 }
245 245
246 void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, 246 void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView* pPageView,
247 CPDFSDK_Annot* pAnnot, 247 CPDFSDK_Annot* pAnnot,
248 FX_DWORD nFlag) { 248 uint32_t nFlag) {
249 ASSERT(pAnnot); 249 ASSERT(pAnnot);
250 250
251 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) 251 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
252 pAnnotHandler->OnMouseEnter(pPageView, pAnnot, nFlag); 252 pAnnotHandler->OnMouseEnter(pPageView, pAnnot, nFlag);
253 } 253 }
254 254
255 void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView* pPageView, 255 void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView* pPageView,
256 CPDFSDK_Annot* pAnnot, 256 CPDFSDK_Annot* pAnnot,
257 FX_DWORD nFlag) { 257 uint32_t nFlag) {
258 ASSERT(pAnnot); 258 ASSERT(pAnnot);
259 259
260 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) 260 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
261 pAnnotHandler->OnMouseExit(pPageView, pAnnot, nFlag); 261 pAnnotHandler->OnMouseExit(pPageView, pAnnot, nFlag);
262 } 262 }
263 263
264 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, 264 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot,
265 FX_DWORD nChar, 265 uint32_t nChar,
266 FX_DWORD nFlags) { 266 uint32_t nFlags) {
267 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 267 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
268 return pAnnotHandler->OnChar(pAnnot, nChar, nFlags); 268 return pAnnotHandler->OnChar(pAnnot, nChar, nFlags);
269 } 269 }
270 return FALSE; 270 return FALSE;
271 } 271 }
272 272
273 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, 273 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot,
274 int nKeyCode, 274 int nKeyCode,
275 int nFlag) { 275 int nFlag) {
276 if (!m_pApp->FFI_IsCTRLKeyDown(nFlag) && !m_pApp->FFI_IsALTKeyDown(nFlag)) { 276 if (!m_pApp->FFI_IsCTRLKeyDown(nFlag) && !m_pApp->FFI_IsALTKeyDown(nFlag)) {
(...skipping 16 matching lines...) Expand all
293 } 293 }
294 return FALSE; 294 return FALSE;
295 } 295 }
296 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, 296 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot,
297 int nKeyCode, 297 int nKeyCode,
298 int nFlag) { 298 int nFlag) {
299 return FALSE; 299 return FALSE;
300 } 300 }
301 301
302 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, 302 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot,
303 FX_DWORD nFlag) { 303 uint32_t nFlag) {
304 ASSERT(pAnnot); 304 ASSERT(pAnnot);
305 305
306 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 306 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
307 if (pAnnotHandler->OnSetFocus(pAnnot, nFlag)) { 307 if (pAnnotHandler->OnSetFocus(pAnnot, nFlag)) {
308 CPDFSDK_PageView* pPage = pAnnot->GetPageView(); 308 CPDFSDK_PageView* pPage = pAnnot->GetPageView();
309 pPage->GetSDKDocument(); 309 pPage->GetSDKDocument();
310 return TRUE; 310 return TRUE;
311 } 311 }
312 } 312 }
313 return FALSE; 313 return FALSE;
314 } 314 }
315 315
316 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, 316 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot,
317 FX_DWORD nFlag) { 317 uint32_t nFlag) {
318 ASSERT(pAnnot); 318 ASSERT(pAnnot);
319 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) 319 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
320 return pAnnotHandler->OnKillFocus(pAnnot, nFlag); 320 return pAnnotHandler->OnKillFocus(pAnnot, nFlag);
321 321
322 return FALSE; 322 return FALSE;
323 } 323 }
324 324
325 #ifdef PDF_ENABLE_XFA 325 #ifdef PDF_ENABLE_XFA
326 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChangeFocus( 326 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChangeFocus(
327 CPDFSDK_Annot* pSetAnnot, 327 CPDFSDK_Annot* pSetAnnot,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 int nFieldFlags = pWidget->GetFieldFlags(); 409 int nFieldFlags = pWidget->GetFieldFlags();
410 if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) 410 if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
411 return FALSE; 411 return FALSE;
412 412
413 if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON) 413 if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
414 return TRUE; 414 return TRUE;
415 415
416 CPDF_Page* pPage = pWidget->GetPDFPage(); 416 CPDF_Page* pPage = pWidget->GetPDFPage();
417 CPDF_Document* pDocument = pPage->m_pDocument; 417 CPDF_Document* pDocument = pPage->m_pDocument;
418 FX_DWORD dwPermissions = pDocument->GetUserPermissions(); 418 uint32_t dwPermissions = pDocument->GetUserPermissions();
419 return (dwPermissions & FPDFPERM_FILL_FORM) || 419 return (dwPermissions & FPDFPERM_FILL_FORM) ||
420 (dwPermissions & FPDFPERM_ANNOT_FORM); 420 (dwPermissions & FPDFPERM_ANNOT_FORM);
421 } 421 }
422 422
423 CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, 423 CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot,
424 CPDFSDK_PageView* pPage) { 424 CPDFSDK_PageView* pPage) {
425 CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument(); 425 CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
426 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm(); 426 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm();
427 CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl( 427 CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(
428 pInterForm->GetInterForm(), pAnnot->GetAnnotDict()); 428 pInterForm->GetInterForm(), pAnnot->GetAnnotDict());
(...skipping 27 matching lines...) Expand all
456 CPDF_FormControl* pCtrol = pWidget->GetFormControl(); 456 CPDF_FormControl* pCtrol = pWidget->GetFormControl();
457 pInterForm->RemoveMap(pCtrol); 457 pInterForm->RemoveMap(pCtrol);
458 458
459 delete pWidget; 459 delete pWidget;
460 } 460 }
461 461
462 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, 462 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
463 CPDFSDK_Annot* pAnnot, 463 CPDFSDK_Annot* pAnnot,
464 CFX_RenderDevice* pDevice, 464 CFX_RenderDevice* pDevice,
465 CFX_Matrix* pUser2Device, 465 CFX_Matrix* pUser2Device,
466 FX_DWORD dwFlags) { 466 uint32_t dwFlags) {
467 CFX_ByteString sSubType = pAnnot->GetSubType(); 467 CFX_ByteString sSubType = pAnnot->GetSubType();
468 468
469 if (sSubType == BFFT_SIGNATURE) { 469 if (sSubType == BFFT_SIGNATURE) {
470 static_cast<CPDFSDK_BAAnnot*>(pAnnot) 470 static_cast<CPDFSDK_BAAnnot*>(pAnnot)
471 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); 471 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
472 } else { 472 } else {
473 if (m_pFormFiller) { 473 if (m_pFormFiller) {
474 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); 474 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
475 } 475 }
476 } 476 }
477 } 477 }
478 478
479 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, 479 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
480 CPDFSDK_Annot* pAnnot, 480 CPDFSDK_Annot* pAnnot,
481 FX_DWORD nFlag) { 481 uint32_t nFlag) {
482 CFX_ByteString sSubType = pAnnot->GetSubType(); 482 CFX_ByteString sSubType = pAnnot->GetSubType();
483 483
484 if (sSubType == BFFT_SIGNATURE) { 484 if (sSubType == BFFT_SIGNATURE) {
485 } else { 485 } else {
486 if (m_pFormFiller) 486 if (m_pFormFiller)
487 m_pFormFiller->OnMouseEnter(pPageView, pAnnot, nFlag); 487 m_pFormFiller->OnMouseEnter(pPageView, pAnnot, nFlag);
488 } 488 }
489 } 489 }
490 void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, 490 void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView,
491 CPDFSDK_Annot* pAnnot, 491 CPDFSDK_Annot* pAnnot,
492 FX_DWORD nFlag) { 492 uint32_t nFlag) {
493 CFX_ByteString sSubType = pAnnot->GetSubType(); 493 CFX_ByteString sSubType = pAnnot->GetSubType();
494 494
495 if (sSubType == BFFT_SIGNATURE) { 495 if (sSubType == BFFT_SIGNATURE) {
496 } else { 496 } else {
497 if (m_pFormFiller) 497 if (m_pFormFiller)
498 m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag); 498 m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag);
499 } 499 }
500 } 500 }
501 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, 501 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
502 CPDFSDK_Annot* pAnnot, 502 CPDFSDK_Annot* pAnnot,
503 FX_DWORD nFlags, 503 uint32_t nFlags,
504 const CFX_FloatPoint& point) { 504 const CFX_FloatPoint& point) {
505 CFX_ByteString sSubType = pAnnot->GetSubType(); 505 CFX_ByteString sSubType = pAnnot->GetSubType();
506 506
507 if (sSubType == BFFT_SIGNATURE) { 507 if (sSubType == BFFT_SIGNATURE) {
508 } else { 508 } else {
509 if (m_pFormFiller) 509 if (m_pFormFiller)
510 return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point); 510 return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
511 } 511 }
512 512
513 return FALSE; 513 return FALSE;
514 } 514 }
515 515
516 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, 516 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
517 CPDFSDK_Annot* pAnnot, 517 CPDFSDK_Annot* pAnnot,
518 FX_DWORD nFlags, 518 uint32_t nFlags,
519 const CFX_FloatPoint& point) { 519 const CFX_FloatPoint& point) {
520 CFX_ByteString sSubType = pAnnot->GetSubType(); 520 CFX_ByteString sSubType = pAnnot->GetSubType();
521 521
522 if (sSubType == BFFT_SIGNATURE) { 522 if (sSubType == BFFT_SIGNATURE) {
523 } else { 523 } else {
524 if (m_pFormFiller) 524 if (m_pFormFiller)
525 return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); 525 return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
526 } 526 }
527 527
528 return FALSE; 528 return FALSE;
529 } 529 }
530 530
531 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, 531 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
532 CPDFSDK_Annot* pAnnot, 532 CPDFSDK_Annot* pAnnot,
533 FX_DWORD nFlags, 533 uint32_t nFlags,
534 const CFX_FloatPoint& point) { 534 const CFX_FloatPoint& point) {
535 CFX_ByteString sSubType = pAnnot->GetSubType(); 535 CFX_ByteString sSubType = pAnnot->GetSubType();
536 536
537 if (sSubType == BFFT_SIGNATURE) { 537 if (sSubType == BFFT_SIGNATURE) {
538 } else { 538 } else {
539 if (m_pFormFiller) 539 if (m_pFormFiller)
540 return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); 540 return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
541 } 541 }
542 542
543 return FALSE; 543 return FALSE;
544 } 544 }
545 545
546 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, 546 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
547 CPDFSDK_Annot* pAnnot, 547 CPDFSDK_Annot* pAnnot,
548 FX_DWORD nFlags, 548 uint32_t nFlags,
549 const CFX_FloatPoint& point) { 549 const CFX_FloatPoint& point) {
550 CFX_ByteString sSubType = pAnnot->GetSubType(); 550 CFX_ByteString sSubType = pAnnot->GetSubType();
551 551
552 if (sSubType == BFFT_SIGNATURE) { 552 if (sSubType == BFFT_SIGNATURE) {
553 } else { 553 } else {
554 if (m_pFormFiller) 554 if (m_pFormFiller)
555 return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point); 555 return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
556 } 556 }
557 557
558 return FALSE; 558 return FALSE;
559 } 559 }
560 560
561 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, 561 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
562 CPDFSDK_Annot* pAnnot, 562 CPDFSDK_Annot* pAnnot,
563 FX_DWORD nFlags, 563 uint32_t nFlags,
564 short zDelta, 564 short zDelta,
565 const CFX_FloatPoint& point) { 565 const CFX_FloatPoint& point) {
566 CFX_ByteString sSubType = pAnnot->GetSubType(); 566 CFX_ByteString sSubType = pAnnot->GetSubType();
567 567
568 if (sSubType == BFFT_SIGNATURE) { 568 if (sSubType == BFFT_SIGNATURE) {
569 } else { 569 } else {
570 if (m_pFormFiller) 570 if (m_pFormFiller)
571 return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, 571 return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta,
572 point); 572 point);
573 } 573 }
574 574
575 return FALSE; 575 return FALSE;
576 } 576 }
577 577
578 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, 578 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
579 CPDFSDK_Annot* pAnnot, 579 CPDFSDK_Annot* pAnnot,
580 FX_DWORD nFlags, 580 uint32_t nFlags,
581 const CFX_FloatPoint& point) { 581 const CFX_FloatPoint& point) {
582 CFX_ByteString sSubType = pAnnot->GetSubType(); 582 CFX_ByteString sSubType = pAnnot->GetSubType();
583 583
584 if (sSubType == BFFT_SIGNATURE) { 584 if (sSubType == BFFT_SIGNATURE) {
585 } else { 585 } else {
586 if (m_pFormFiller) 586 if (m_pFormFiller)
587 return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point); 587 return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
588 } 588 }
589 589
590 return FALSE; 590 return FALSE;
591 } 591 }
592 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, 592 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
593 CPDFSDK_Annot* pAnnot, 593 CPDFSDK_Annot* pAnnot,
594 FX_DWORD nFlags, 594 uint32_t nFlags,
595 const CFX_FloatPoint& point) { 595 const CFX_FloatPoint& point) {
596 CFX_ByteString sSubType = pAnnot->GetSubType(); 596 CFX_ByteString sSubType = pAnnot->GetSubType();
597 597
598 if (sSubType == BFFT_SIGNATURE) { 598 if (sSubType == BFFT_SIGNATURE) {
599 } else { 599 } else {
600 if (m_pFormFiller) 600 if (m_pFormFiller)
601 return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point); 601 return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
602 } 602 }
603 603
604 return FALSE; 604 return FALSE;
605 } 605 }
606 606
607 FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, 607 FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot,
608 FX_DWORD nChar, 608 uint32_t nChar,
609 FX_DWORD nFlags) { 609 uint32_t nFlags) {
610 CFX_ByteString sSubType = pAnnot->GetSubType(); 610 CFX_ByteString sSubType = pAnnot->GetSubType();
611 611
612 if (sSubType == BFFT_SIGNATURE) { 612 if (sSubType == BFFT_SIGNATURE) {
613 } else { 613 } else {
614 if (m_pFormFiller) 614 if (m_pFormFiller)
615 return m_pFormFiller->OnChar(pAnnot, nChar, nFlags); 615 return m_pFormFiller->OnChar(pAnnot, nChar, nFlags);
616 } 616 }
617 617
618 return FALSE; 618 return FALSE;
619 } 619 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { 671 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
672 if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty()) 672 if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty())
673 pWidget->ResetAppearance(FALSE); 673 pWidget->ResetAppearance(FALSE);
674 } 674 }
675 #endif // PDF_ENABLE_XFA 675 #endif // PDF_ENABLE_XFA
676 if (m_pFormFiller) 676 if (m_pFormFiller)
677 m_pFormFiller->OnLoad(pAnnot); 677 m_pFormFiller->OnLoad(pAnnot);
678 } 678 }
679 679
680 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, 680 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot,
681 FX_DWORD nFlag) { 681 uint32_t nFlag) {
682 CFX_ByteString sSubType = pAnnot->GetSubType(); 682 CFX_ByteString sSubType = pAnnot->GetSubType();
683 683
684 if (sSubType == BFFT_SIGNATURE) { 684 if (sSubType == BFFT_SIGNATURE) {
685 } else { 685 } else {
686 if (m_pFormFiller) 686 if (m_pFormFiller)
687 return m_pFormFiller->OnSetFocus(pAnnot, nFlag); 687 return m_pFormFiller->OnSetFocus(pAnnot, nFlag);
688 } 688 }
689 689
690 return TRUE; 690 return TRUE;
691 } 691 }
692 FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, 692 FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
693 FX_DWORD nFlag) { 693 uint32_t nFlag) {
694 CFX_ByteString sSubType = pAnnot->GetSubType(); 694 CFX_ByteString sSubType = pAnnot->GetSubType();
695 695
696 if (sSubType == BFFT_SIGNATURE) { 696 if (sSubType == BFFT_SIGNATURE) {
697 } else { 697 } else {
698 if (m_pFormFiller) 698 if (m_pFormFiller)
699 return m_pFormFiller->OnKillFocus(pAnnot, nFlag); 699 return m_pFormFiller->OnKillFocus(pAnnot, nFlag);
700 } 700 }
701 701
702 return TRUE; 702 return TRUE;
703 } 703 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 744 }
745 745
746 FX_BOOL CPDFSDK_XFAAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { 746 FX_BOOL CPDFSDK_XFAAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
747 return pAnnot->GetXFAWidget() != NULL; 747 return pAnnot->GetXFAWidget() != NULL;
748 } 748 }
749 749
750 void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, 750 void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
751 CPDFSDK_Annot* pAnnot, 751 CPDFSDK_Annot* pAnnot,
752 CFX_RenderDevice* pDevice, 752 CFX_RenderDevice* pDevice,
753 CFX_Matrix* pUser2Device, 753 CFX_Matrix* pUser2Device,
754 FX_DWORD dwFlags) { 754 uint32_t dwFlags) {
755 ASSERT(pPageView != NULL); 755 ASSERT(pPageView != NULL);
756 ASSERT(pAnnot != NULL); 756 ASSERT(pAnnot != NULL);
757 757
758 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); 758 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
759 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 759 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
760 760
761 CFX_Graphics gs; 761 CFX_Graphics gs;
762 gs.Create(pDevice); 762 gs.Create(pDevice);
763 763
764 CFX_Matrix mt; 764 CFX_Matrix mt;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 return FALSE; 820 return FALSE;
821 821
822 IXFA_DocView* pDocView = pDoc->GetXFADocView(); 822 IXFA_DocView* pDocView = pDoc->GetXFADocView();
823 if (!pDocView) 823 if (!pDocView)
824 return FALSE; 824 return FALSE;
825 825
826 IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler(); 826 IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
827 if (!pWidgetHandler) 827 if (!pWidgetHandler)
828 return FALSE; 828 return FALSE;
829 829
830 FX_DWORD dwHitTest = 830 uint32_t dwHitTest =
831 pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y); 831 pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y);
832 return (dwHitTest != FWL_WGTHITTEST_Unknown); 832 return (dwHitTest != FWL_WGTHITTEST_Unknown);
833 } 833 }
834 834
835 void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, 835 void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
836 CPDFSDK_Annot* pAnnot, 836 CPDFSDK_Annot* pAnnot,
837 FX_DWORD nFlag) { 837 uint32_t nFlag) {
838 if (!pPageView || !pAnnot) 838 if (!pPageView || !pAnnot)
839 return; 839 return;
840 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 840 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
841 pWidgetHandler->OnMouseEnter(pAnnot->GetXFAWidget()); 841 pWidgetHandler->OnMouseEnter(pAnnot->GetXFAWidget());
842 } 842 }
843 843
844 void CPDFSDK_XFAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, 844 void CPDFSDK_XFAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView,
845 CPDFSDK_Annot* pAnnot, 845 CPDFSDK_Annot* pAnnot,
846 FX_DWORD nFlag) { 846 uint32_t nFlag) {
847 if (!pPageView || !pAnnot) 847 if (!pPageView || !pAnnot)
848 return; 848 return;
849 849
850 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 850 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
851 pWidgetHandler->OnMouseExit(pAnnot->GetXFAWidget()); 851 pWidgetHandler->OnMouseExit(pAnnot->GetXFAWidget());
852 } 852 }
853 853
854 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, 854 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
855 CPDFSDK_Annot* pAnnot, 855 CPDFSDK_Annot* pAnnot,
856 FX_DWORD nFlags, 856 uint32_t nFlags,
857 const CFX_FloatPoint& point) { 857 const CFX_FloatPoint& point) {
858 if (!pPageView || !pAnnot) 858 if (!pPageView || !pAnnot)
859 return FALSE; 859 return FALSE;
860 860
861 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 861 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
862 return pWidgetHandler->OnLButtonDown(pAnnot->GetXFAWidget(), 862 return pWidgetHandler->OnLButtonDown(pAnnot->GetXFAWidget(),
863 GetFWLFlags(nFlags), point.x, point.y); 863 GetFWLFlags(nFlags), point.x, point.y);
864 } 864 }
865 865
866 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, 866 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
867 CPDFSDK_Annot* pAnnot, 867 CPDFSDK_Annot* pAnnot,
868 FX_DWORD nFlags, 868 uint32_t nFlags,
869 const CFX_FloatPoint& point) { 869 const CFX_FloatPoint& point) {
870 if (!pPageView || !pAnnot) 870 if (!pPageView || !pAnnot)
871 return FALSE; 871 return FALSE;
872 872
873 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 873 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
874 return pWidgetHandler->OnLButtonUp(pAnnot->GetXFAWidget(), 874 return pWidgetHandler->OnLButtonUp(pAnnot->GetXFAWidget(),
875 GetFWLFlags(nFlags), point.x, point.y); 875 GetFWLFlags(nFlags), point.x, point.y);
876 } 876 }
877 877
878 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, 878 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
879 CPDFSDK_Annot* pAnnot, 879 CPDFSDK_Annot* pAnnot,
880 FX_DWORD nFlags, 880 uint32_t nFlags,
881 const CFX_FloatPoint& point) { 881 const CFX_FloatPoint& point) {
882 if (!pPageView || !pAnnot) 882 if (!pPageView || !pAnnot)
883 return FALSE; 883 return FALSE;
884 884
885 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 885 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
886 return pWidgetHandler->OnLButtonDblClk(pAnnot->GetXFAWidget(), 886 return pWidgetHandler->OnLButtonDblClk(pAnnot->GetXFAWidget(),
887 GetFWLFlags(nFlags), point.x, point.y); 887 GetFWLFlags(nFlags), point.x, point.y);
888 } 888 }
889 889
890 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, 890 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
891 CPDFSDK_Annot* pAnnot, 891 CPDFSDK_Annot* pAnnot,
892 FX_DWORD nFlags, 892 uint32_t nFlags,
893 const CFX_FloatPoint& point) { 893 const CFX_FloatPoint& point) {
894 if (!pPageView || !pAnnot) 894 if (!pPageView || !pAnnot)
895 return FALSE; 895 return FALSE;
896 896
897 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 897 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
898 return pWidgetHandler->OnMouseMove(pAnnot->GetXFAWidget(), 898 return pWidgetHandler->OnMouseMove(pAnnot->GetXFAWidget(),
899 GetFWLFlags(nFlags), point.x, point.y); 899 GetFWLFlags(nFlags), point.x, point.y);
900 } 900 }
901 901
902 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, 902 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
903 CPDFSDK_Annot* pAnnot, 903 CPDFSDK_Annot* pAnnot,
904 FX_DWORD nFlags, 904 uint32_t nFlags,
905 short zDelta, 905 short zDelta,
906 const CFX_FloatPoint& point) { 906 const CFX_FloatPoint& point) {
907 if (!pPageView || !pAnnot) 907 if (!pPageView || !pAnnot)
908 return FALSE; 908 return FALSE;
909 909
910 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 910 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
911 return pWidgetHandler->OnMouseWheel( 911 return pWidgetHandler->OnMouseWheel(
912 pAnnot->GetXFAWidget(), GetFWLFlags(nFlags), zDelta, point.x, point.y); 912 pAnnot->GetXFAWidget(), GetFWLFlags(nFlags), zDelta, point.x, point.y);
913 } 913 }
914 914
915 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, 915 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
916 CPDFSDK_Annot* pAnnot, 916 CPDFSDK_Annot* pAnnot,
917 FX_DWORD nFlags, 917 uint32_t nFlags,
918 const CFX_FloatPoint& point) { 918 const CFX_FloatPoint& point) {
919 if (!pPageView || !pAnnot) 919 if (!pPageView || !pAnnot)
920 return FALSE; 920 return FALSE;
921 921
922 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 922 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
923 return pWidgetHandler->OnRButtonDown(pAnnot->GetXFAWidget(), 923 return pWidgetHandler->OnRButtonDown(pAnnot->GetXFAWidget(),
924 GetFWLFlags(nFlags), point.x, point.y); 924 GetFWLFlags(nFlags), point.x, point.y);
925 } 925 }
926 926
927 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, 927 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
928 CPDFSDK_Annot* pAnnot, 928 CPDFSDK_Annot* pAnnot,
929 FX_DWORD nFlags, 929 uint32_t nFlags,
930 const CFX_FloatPoint& point) { 930 const CFX_FloatPoint& point) {
931 if (!pPageView || !pAnnot) 931 if (!pPageView || !pAnnot)
932 return FALSE; 932 return FALSE;
933 933
934 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 934 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
935 return pWidgetHandler->OnRButtonUp(pAnnot->GetXFAWidget(), 935 return pWidgetHandler->OnRButtonUp(pAnnot->GetXFAWidget(),
936 GetFWLFlags(nFlags), point.x, point.y); 936 GetFWLFlags(nFlags), point.x, point.y);
937 } 937 }
938 938
939 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView, 939 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView,
940 CPDFSDK_Annot* pAnnot, 940 CPDFSDK_Annot* pAnnot,
941 FX_DWORD nFlags, 941 uint32_t nFlags,
942 const CFX_FloatPoint& point) { 942 const CFX_FloatPoint& point) {
943 if (!pPageView || !pAnnot) 943 if (!pPageView || !pAnnot)
944 return FALSE; 944 return FALSE;
945 945
946 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 946 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
947 return pWidgetHandler->OnRButtonDblClk(pAnnot->GetXFAWidget(), 947 return pWidgetHandler->OnRButtonDblClk(pAnnot->GetXFAWidget(),
948 GetFWLFlags(nFlags), point.x, point.y); 948 GetFWLFlags(nFlags), point.x, point.y);
949 } 949 }
950 950
951 FX_BOOL CPDFSDK_XFAAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, 951 FX_BOOL CPDFSDK_XFAAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot,
952 FX_DWORD nChar, 952 uint32_t nChar,
953 FX_DWORD nFlags) { 953 uint32_t nFlags) {
954 if (!pAnnot) 954 if (!pAnnot)
955 return FALSE; 955 return FALSE;
956 956
957 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 957 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
958 return pWidgetHandler->OnChar(pAnnot->GetXFAWidget(), nChar, 958 return pWidgetHandler->OnChar(pAnnot->GetXFAWidget(), nChar,
959 GetFWLFlags(nFlags)); 959 GetFWLFlags(nFlags));
960 } 960 }
961 961
962 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, 962 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot,
963 int nKeyCode, 963 int nKeyCode,
(...skipping 11 matching lines...) Expand all
975 int nFlag) { 975 int nFlag) {
976 if (!pAnnot) 976 if (!pAnnot)
977 return FALSE; 977 return FALSE;
978 978
979 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 979 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
980 return pWidgetHandler->OnKeyUp(pAnnot->GetXFAWidget(), nKeyCode, 980 return pWidgetHandler->OnKeyUp(pAnnot->GetXFAWidget(), nKeyCode,
981 GetFWLFlags(nFlag)); 981 GetFWLFlags(nFlag));
982 } 982 }
983 983
984 FX_BOOL CPDFSDK_XFAAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, 984 FX_BOOL CPDFSDK_XFAAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot,
985 FX_DWORD nFlag) { 985 uint32_t nFlag) {
986 return TRUE; 986 return TRUE;
987 } 987 }
988 988
989 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, 989 FX_BOOL CPDFSDK_XFAAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
990 FX_DWORD nFlag) { 990 uint32_t nFlag) {
991 return TRUE; 991 return TRUE;
992 } 992 }
993 993
994 FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, 994 FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
995 CPDFSDK_Annot* pNewAnnot) { 995 CPDFSDK_Annot* pNewAnnot) {
996 IXFA_WidgetHandler* pWidgetHandler = NULL; 996 IXFA_WidgetHandler* pWidgetHandler = NULL;
997 997
998 if (pOldAnnot) 998 if (pOldAnnot)
999 pWidgetHandler = GetXFAWidgetHandler(pOldAnnot); 999 pWidgetHandler = GetXFAWidgetHandler(pOldAnnot);
1000 else if (pNewAnnot) 1000 else if (pNewAnnot)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 return pDocView->GetWidgetHandler(); 1041 return pDocView->GetWidgetHandler();
1042 } 1042 }
1043 1043
1044 #define FWL_KEYFLAG_Ctrl (1 << 0) 1044 #define FWL_KEYFLAG_Ctrl (1 << 0)
1045 #define FWL_KEYFLAG_Alt (1 << 1) 1045 #define FWL_KEYFLAG_Alt (1 << 1)
1046 #define FWL_KEYFLAG_Shift (1 << 2) 1046 #define FWL_KEYFLAG_Shift (1 << 2)
1047 #define FWL_KEYFLAG_LButton (1 << 3) 1047 #define FWL_KEYFLAG_LButton (1 << 3)
1048 #define FWL_KEYFLAG_RButton (1 << 4) 1048 #define FWL_KEYFLAG_RButton (1 << 4)
1049 #define FWL_KEYFLAG_MButton (1 << 5) 1049 #define FWL_KEYFLAG_MButton (1 << 5)
1050 1050
1051 FX_DWORD CPDFSDK_XFAAnnotHandler::GetFWLFlags(FX_DWORD dwFlag) { 1051 uint32_t CPDFSDK_XFAAnnotHandler::GetFWLFlags(uint32_t dwFlag) {
1052 FX_DWORD dwFWLFlag = 0; 1052 uint32_t dwFWLFlag = 0;
1053 1053
1054 if (dwFlag & FWL_EVENTFLAG_ControlKey) 1054 if (dwFlag & FWL_EVENTFLAG_ControlKey)
1055 dwFWLFlag |= FWL_KEYFLAG_Ctrl; 1055 dwFWLFlag |= FWL_KEYFLAG_Ctrl;
1056 if (dwFlag & FWL_EVENTFLAG_LeftButtonDown) 1056 if (dwFlag & FWL_EVENTFLAG_LeftButtonDown)
1057 dwFWLFlag |= FWL_KEYFLAG_LButton; 1057 dwFWLFlag |= FWL_KEYFLAG_LButton;
1058 if (dwFlag & FWL_EVENTFLAG_MiddleButtonDown) 1058 if (dwFlag & FWL_EVENTFLAG_MiddleButtonDown)
1059 dwFWLFlag |= FWL_KEYFLAG_MButton; 1059 dwFWLFlag |= FWL_KEYFLAG_MButton;
1060 if (dwFlag & FWL_EVENTFLAG_RightButtonDown) 1060 if (dwFlag & FWL_EVENTFLAG_RightButtonDown)
1061 dwFWLFlag |= FWL_KEYFLAG_RButton; 1061 dwFWLFlag |= FWL_KEYFLAG_RButton;
1062 if (dwFlag & FWL_EVENTFLAG_ShiftKey) 1062 if (dwFlag & FWL_EVENTFLAG_ShiftKey)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 1102
1103 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { 1103 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() {
1104 if (m_pos < m_iteratorAnnotList.size()) 1104 if (m_pos < m_iteratorAnnotList.size())
1105 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; 1105 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos];
1106 return nullptr; 1106 return nullptr;
1107 } 1107 }
1108 1108
1109 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { 1109 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() {
1110 return m_bReverse ? PrevAnnot() : NextAnnot(); 1110 return m_bReverse ? PrevAnnot() : NextAnnot();
1111 } 1111 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfxfa/fpdfxfa_util.cpp ('k') | fpdfsdk/fsdk_baseannot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698