OLD | NEW |
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 "xfa/fxfa/include/xfa_ffdocview.h" | 7 #include "xfa/fxfa/include/xfa_ffdocview.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 10 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 if (!pFormRoot) { | 322 if (!pFormRoot) { |
323 return NULL; | 323 return NULL; |
324 } | 324 } |
325 return new CXFA_WidgetAccIterator(this, pFormRoot); | 325 return new CXFA_WidgetAccIterator(this, pFormRoot); |
326 } | 326 } |
327 CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() { | 327 CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() { |
328 return m_pFocusWidget; | 328 return m_pFocusWidget; |
329 } | 329 } |
330 void CXFA_FFDocView::KillFocus() { | 330 void CXFA_FFDocView::KillFocus() { |
331 if (m_pFocusWidget && | 331 if (m_pFocusWidget && |
332 (m_pFocusWidget->GetStatus() & XFA_WIDGETSTATUS_Focused)) { | 332 (m_pFocusWidget->GetStatus() & XFA_WidgetStatus_Focused)) { |
333 (m_pFocusWidget)->OnKillFocus(NULL); | 333 (m_pFocusWidget)->OnKillFocus(NULL); |
334 } | 334 } |
335 m_pFocusAcc = NULL; | 335 m_pFocusAcc = NULL; |
336 m_pFocusWidget = NULL; | 336 m_pFocusWidget = NULL; |
337 m_pOldFocusWidget = NULL; | 337 m_pOldFocusWidget = NULL; |
338 } | 338 } |
339 FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { | 339 FX_BOOL CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) { |
340 CXFA_FFWidget* pNewFocus = hWidget; | 340 CXFA_FFWidget* pNewFocus = hWidget; |
341 if (m_pOldFocusWidget == pNewFocus) { | 341 if (m_pOldFocusWidget == pNewFocus) { |
342 return FALSE; | 342 return FALSE; |
343 } | 343 } |
344 CXFA_FFWidget* pOldFocus = m_pOldFocusWidget; | 344 CXFA_FFWidget* pOldFocus = m_pOldFocusWidget; |
345 m_pOldFocusWidget = pNewFocus; | 345 m_pOldFocusWidget = pNewFocus; |
346 if (pOldFocus) { | 346 if (pOldFocus) { |
347 if (m_pFocusWidget != m_pOldFocusWidget && | 347 if (m_pFocusWidget != m_pOldFocusWidget && |
348 (pOldFocus->GetStatus() & XFA_WIDGETSTATUS_Focused)) { | 348 (pOldFocus->GetStatus() & XFA_WidgetStatus_Focused)) { |
349 m_pFocusWidget = pOldFocus; | 349 m_pFocusWidget = pOldFocus; |
350 pOldFocus->OnKillFocus(pNewFocus); | 350 pOldFocus->OnKillFocus(pNewFocus); |
351 } else if ((pOldFocus->GetStatus() & XFA_WIDGETSTATUS_Visible)) { | 351 } else if ((pOldFocus->GetStatus() & XFA_WidgetStatus_Visible)) { |
352 if (!pOldFocus->IsLoaded()) { | 352 if (!pOldFocus->IsLoaded()) { |
353 pOldFocus->LoadWidget(); | 353 pOldFocus->LoadWidget(); |
354 } | 354 } |
355 pOldFocus->OnSetFocus(m_pFocusWidget); | 355 pOldFocus->OnSetFocus(m_pFocusWidget); |
356 m_pFocusWidget = pOldFocus; | 356 m_pFocusWidget = pOldFocus; |
357 pOldFocus->OnKillFocus(pNewFocus); | 357 pOldFocus->OnKillFocus(pNewFocus); |
358 } | 358 } |
359 } | 359 } |
360 if (m_pFocusWidget == m_pOldFocusWidget) { | 360 if (m_pFocusWidget == m_pOldFocusWidget) { |
361 return FALSE; | 361 return FALSE; |
362 } | 362 } |
363 pNewFocus = m_pOldFocusWidget; | 363 pNewFocus = m_pOldFocusWidget; |
364 if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) { | 364 if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) { |
365 m_pFocusAcc = NULL; | 365 m_pFocusAcc = NULL; |
366 m_pFocusWidget = NULL; | 366 m_pFocusWidget = NULL; |
367 m_pListFocusWidget = NULL; | 367 m_pListFocusWidget = NULL; |
368 m_pOldFocusWidget = NULL; | 368 m_pOldFocusWidget = NULL; |
369 return FALSE; | 369 return FALSE; |
370 } | 370 } |
371 if (pNewFocus && (pNewFocus->GetStatus() & XFA_WIDGETSTATUS_Visible)) { | 371 if (pNewFocus && (pNewFocus->GetStatus() & XFA_WidgetStatus_Visible)) { |
372 if (!pNewFocus->IsLoaded()) { | 372 if (!pNewFocus->IsLoaded()) { |
373 pNewFocus->LoadWidget(); | 373 pNewFocus->LoadWidget(); |
374 } | 374 } |
375 pNewFocus->OnSetFocus(m_pFocusWidget); | 375 pNewFocus->OnSetFocus(m_pFocusWidget); |
376 } | 376 } |
377 m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : NULL; | 377 m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : NULL; |
378 m_pFocusWidget = pNewFocus; | 378 m_pFocusWidget = pNewFocus; |
379 m_pOldFocusWidget = m_pFocusWidget; | 379 m_pOldFocusWidget = m_pFocusWidget; |
380 return TRUE; | 380 return TRUE; |
381 } | 381 } |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToLast() { | 837 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToLast() { |
838 return NULL; | 838 return NULL; |
839 } | 839 } |
840 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToNext() { | 840 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToNext() { |
841 CXFA_Node* pItem = m_pCurWidget ? m_ContentIterator.MoveToNext() | 841 CXFA_Node* pItem = m_pCurWidget ? m_ContentIterator.MoveToNext() |
842 : m_ContentIterator.GetCurrent(); | 842 : m_ContentIterator.GetCurrent(); |
843 while (pItem) { | 843 while (pItem) { |
844 if (CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)pItem->GetWidgetData()) { | 844 if (CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)pItem->GetWidgetData()) { |
845 while ((m_pCurWidget = pAcc->GetNextWidget(NULL))) { | 845 while ((m_pCurWidget = pAcc->GetNextWidget(NULL))) { |
846 if (!m_pCurWidget->IsLoaded() && | 846 if (!m_pCurWidget->IsLoaded() && |
847 (m_pCurWidget->GetStatus() & XFA_WIDGETSTATUS_Visible)) { | 847 (m_pCurWidget->GetStatus() & XFA_WidgetStatus_Visible)) { |
848 m_pCurWidget->LoadWidget(); | 848 m_pCurWidget->LoadWidget(); |
849 } | 849 } |
850 return m_pCurWidget; | 850 return m_pCurWidget; |
851 } | 851 } |
852 } | 852 } |
853 pItem = m_ContentIterator.MoveToNext(); | 853 pItem = m_ContentIterator.MoveToNext(); |
854 } | 854 } |
855 return NULL; | 855 return NULL; |
856 } | 856 } |
857 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToPrevious() { | 857 CXFA_FFWidget* CXFA_FFDocWidgetIterator::MoveToPrevious() { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { | 898 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { |
899 return NULL; | 899 return NULL; |
900 } | 900 } |
901 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { | 901 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { |
902 return FALSE; | 902 return FALSE; |
903 } | 903 } |
904 void CXFA_WidgetAccIterator::SkipTree() { | 904 void CXFA_WidgetAccIterator::SkipTree() { |
905 m_ContentIterator.SkipChildrenAndMoveToNext(); | 905 m_ContentIterator.SkipChildrenAndMoveToNext(); |
906 m_pCurWidgetAcc = NULL; | 906 m_pCurWidgetAcc = NULL; |
907 } | 907 } |
OLD | NEW |