Chromium Code Reviews| 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/fwl/core/fwl_widgetimp.h" | 7 #include "xfa/fwl/core/fwl_widgetimp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "xfa/fde/tto/fde_textout.h" | 11 #include "xfa/fde/tto/fde_textout.h" |
| 12 #include "xfa/fwl/basewidget/ifwl_combobox.h" | 12 #include "xfa/fwl/basewidget/ifwl_combobox.h" |
| 13 #include "xfa/fwl/basewidget/ifwl_datetimepicker.h" | 13 #include "xfa/fwl/basewidget/ifwl_datetimepicker.h" |
| 14 #include "xfa/fwl/core/cfwl_message.h" | 14 #include "xfa/fwl/core/cfwl_message.h" |
| 15 #include "xfa/fwl/core/cfwl_themebackground.h" | 15 #include "xfa/fwl/core/cfwl_themebackground.h" |
| 16 #include "xfa/fwl/core/cfwl_themepart.h" | 16 #include "xfa/fwl/core/cfwl_themepart.h" |
| 17 #include "xfa/fwl/core/cfwl_themetext.h" | 17 #include "xfa/fwl/core/cfwl_themetext.h" |
| 18 #include "xfa/fwl/core/fwl_appimp.h" | 18 #include "xfa/fwl/core/fwl_appimp.h" |
| 19 #include "xfa/fwl/core/fwl_noteimp.h" | 19 #include "xfa/fwl/core/fwl_noteimp.h" |
| 20 #include "xfa/fwl/core/fwl_targetimp.h" | |
| 21 #include "xfa/fwl/core/fwl_threadimp.h" | |
| 22 #include "xfa/fwl/core/fwl_widgetmgrimp.h" | 20 #include "xfa/fwl/core/fwl_widgetmgrimp.h" |
| 23 #include "xfa/fwl/core/ifwl_adapternative.h" | 21 #include "xfa/fwl/core/ifwl_adapternative.h" |
| 24 #include "xfa/fwl/core/ifwl_adapterthreadmgr.h" | 22 #include "xfa/fwl/core/ifwl_adapterthreadmgr.h" |
| 25 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" | 23 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" |
| 26 #include "xfa/fwl/core/ifwl_app.h" | 24 #include "xfa/fwl/core/ifwl_app.h" |
| 27 #include "xfa/fwl/core/ifwl_form.h" | 25 #include "xfa/fwl/core/ifwl_form.h" |
| 28 #include "xfa/fwl/core/ifwl_themeprovider.h" | 26 #include "xfa/fwl/core/ifwl_themeprovider.h" |
| 29 | 27 |
| 30 #define FWL_CLASSHASH_Menu 3957949655 | 28 #define FWL_CLASSHASH_Menu 3957949655 |
| 31 #define FWL_STYLEEXT_MNU_Vert (1L << 0) | 29 #define FWL_STYLEEXT_MNU_Vert (1L << 0) |
| 32 | 30 |
| 31 IFWL_Widget::~IFWL_Widget() { | |
| 32 delete m_pImpl; | |
|
Tom Sepez
2016/04/27 20:23:34
nit: unique_ptr
dsinclair
2016/04/27 20:58:55
Done.
| |
| 33 } | |
| 34 | |
| 35 FWL_ERR IFWL_Widget::GetClassName(CFX_WideString& wsClass) const { | |
| 36 return m_pImpl->GetClassName(wsClass); | |
| 37 } | |
| 38 | |
| 39 uint32_t IFWL_Widget::GetClassID() const { | |
| 40 return m_pImpl->GetClassID(); | |
| 41 } | |
| 42 | |
| 43 FX_BOOL IFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const { | |
| 44 return m_pImpl->IsInstance(wsClass); | |
| 45 } | |
| 46 | |
| 47 FWL_ERR IFWL_Widget::Initialize() { | |
| 48 return m_pImpl->Initialize(); | |
| 49 } | |
| 50 | |
| 51 FWL_ERR IFWL_Widget::Finalize() { | |
| 52 return m_pImpl->Finalize(); | |
| 53 } | |
| 54 | |
| 33 FWL_ERR IFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { | 55 FWL_ERR IFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
| 34 return static_cast<CFWL_WidgetImp*>(GetImpl()) | 56 return static_cast<CFWL_WidgetImp*>(GetImpl()) |
| 35 ->GetWidgetRect(rect, bAutoSize); | 57 ->GetWidgetRect(rect, bAutoSize); |
| 36 } | 58 } |
| 37 FWL_ERR IFWL_Widget::GetGlobalRect(CFX_RectF& rect) { | 59 FWL_ERR IFWL_Widget::GetGlobalRect(CFX_RectF& rect) { |
| 38 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetGlobalRect(rect); | 60 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetGlobalRect(rect); |
| 39 } | 61 } |
| 40 FWL_ERR IFWL_Widget::SetWidgetRect(const CFX_RectF& rect) { | 62 FWL_ERR IFWL_Widget::SetWidgetRect(const CFX_RectF& rect) { |
| 41 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetWidgetRect(rect); | 63 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetWidgetRect(rect); |
| 42 } | 64 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 return static_cast<CFWL_WidgetImp*>(GetImpl()) | 149 return static_cast<CFWL_WidgetImp*>(GetImpl()) |
| 128 ->SetThemeProvider(pThemeProvider); | 150 ->SetThemeProvider(pThemeProvider); |
| 129 } | 151 } |
| 130 FWL_ERR IFWL_Widget::SetDataProvider(IFWL_DataProvider* pDataProvider) { | 152 FWL_ERR IFWL_Widget::SetDataProvider(IFWL_DataProvider* pDataProvider) { |
| 131 return static_cast<CFWL_WidgetImp*>(GetImpl()) | 153 return static_cast<CFWL_WidgetImp*>(GetImpl()) |
| 132 ->SetDataProvider(pDataProvider); | 154 ->SetDataProvider(pDataProvider); |
| 133 } | 155 } |
| 134 IFWL_WidgetDelegate* IFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) { | 156 IFWL_WidgetDelegate* IFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) { |
| 135 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetDelegate(pDelegate); | 157 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetDelegate(pDelegate); |
| 136 } | 158 } |
| 137 IFWL_Thread* IFWL_Widget::GetOwnerThread() const { | 159 IFWL_App* IFWL_Widget::GetOwnerThread() const { |
| 138 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwnerThread(); | 160 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwnerThread(); |
| 139 } | 161 } |
| 140 CFX_SizeF IFWL_Widget::GetOffsetFromParent(IFWL_Widget* pParent) { | 162 CFX_SizeF IFWL_Widget::GetOffsetFromParent(IFWL_Widget* pParent) { |
| 141 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOffsetFromParent(pParent); | 163 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOffsetFromParent(pParent); |
| 142 } | 164 } |
| 165 | |
| 143 FWL_ERR CFWL_WidgetImp::Initialize() { | 166 FWL_ERR CFWL_WidgetImp::Initialize() { |
| 144 IFWL_App* pApp = FWL_GetApp(); | 167 IFWL_App* pApp = FWL_GetApp(); |
| 145 if (!pApp) | 168 if (!pApp) |
| 146 return FWL_ERR_Indefinite; | 169 return FWL_ERR_Indefinite; |
| 147 IFWL_AdapterNative* pAdapter = pApp->GetAdapterNative(); | 170 IFWL_AdapterNative* pAdapter = pApp->GetAdapterNative(); |
| 148 if (!pAdapter) | 171 if (!pAdapter) |
| 149 return FWL_ERR_Indefinite; | 172 return FWL_ERR_Indefinite; |
| 150 IFWL_AdapterThreadMgr* pAdapterThread = pAdapter->GetThreadMgr(); | 173 IFWL_AdapterThreadMgr* pAdapterThread = pAdapter->GetThreadMgr(); |
| 151 if (!pAdapterThread) | 174 if (!pAdapterThread) |
| 152 return FWL_ERR_Indefinite; | 175 return FWL_ERR_Indefinite; |
| 153 SetOwnerThread(static_cast<CFWL_ThreadImp*>( | 176 SetOwnerThread( |
| 154 pAdapterThread->GetCurrentThread()->GetImpl())); | 177 static_cast<CFWL_AppImp*>(pAdapterThread->GetCurrentThread()->GetImpl())); |
| 155 IFWL_Widget* pParent = m_pProperties->m_pParent; | 178 IFWL_Widget* pParent = m_pProperties->m_pParent; |
| 156 m_pWidgetMgr->InsertWidget(pParent, m_pInterface); | 179 m_pWidgetMgr->InsertWidget(pParent, m_pInterface); |
| 157 if (!IsChild()) { | 180 if (!IsChild()) { |
| 158 { | 181 { |
| 159 IFWL_Widget* pOwner = m_pProperties->m_pOwner; | 182 IFWL_Widget* pOwner = m_pProperties->m_pOwner; |
| 160 if (pOwner) { | 183 if (pOwner) { |
| 161 m_pWidgetMgr->SetOwner(pOwner, m_pInterface); | 184 m_pWidgetMgr->SetOwner(pOwner, m_pInterface); |
| 162 } | 185 } |
| 163 } | 186 } |
| 164 m_pWidgetMgr->CreateWidget_Native(m_pInterface); | 187 m_pWidgetMgr->CreateWidget_Native(m_pInterface); |
| 165 } | 188 } |
| 166 return FWL_ERR_Succeeded; | 189 return FWL_ERR_Succeeded; |
| 167 } | 190 } |
| 191 | |
| 168 FWL_ERR CFWL_WidgetImp::Finalize() { | 192 FWL_ERR CFWL_WidgetImp::Finalize() { |
| 169 NotifyDriver(); | 193 NotifyDriver(); |
| 170 if (!IsChild()) | 194 if (!IsChild()) |
| 171 m_pWidgetMgr->DestroyWidget_Native(m_pInterface); | 195 m_pWidgetMgr->DestroyWidget_Native(m_pInterface); |
| 172 | 196 |
| 173 m_pWidgetMgr->RemoveWidget(m_pInterface); | 197 m_pWidgetMgr->RemoveWidget(m_pInterface); |
| 174 return FWL_ERR_Succeeded; | 198 return FWL_ERR_Succeeded; |
| 175 } | 199 } |
| 200 | |
| 201 FWL_ERR CFWL_WidgetImp::GetClassName(CFX_WideString& wsClass) const { | |
| 202 wsClass.clear(); | |
| 203 return FWL_ERR_Succeeded; | |
| 204 } | |
| 205 | |
| 206 uint32_t CFWL_WidgetImp::GetClassID() const { | |
| 207 return 0; | |
| 208 } | |
| 209 | |
| 210 FX_BOOL CFWL_WidgetImp::IsInstance(const CFX_WideStringC& wsClass) const { | |
| 211 return FALSE; | |
| 212 } | |
| 213 | |
| 176 FWL_ERR CFWL_WidgetImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { | 214 FWL_ERR CFWL_WidgetImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
| 177 if (bAutoSize) { | 215 if (bAutoSize) { |
| 178 if (HasEdge()) { | 216 if (HasEdge()) { |
| 179 FX_FLOAT fEdge = GetEdgeWidth(); | 217 FX_FLOAT fEdge = GetEdgeWidth(); |
| 180 rect.Inflate(fEdge, fEdge); | 218 rect.Inflate(fEdge, fEdge); |
| 181 } | 219 } |
| 182 if (HasBorder()) { | 220 if (HasBorder()) { |
| 183 FX_FLOAT fBorder = GetBorderSize(); | 221 FX_FLOAT fBorder = GetBorderSize(); |
| 184 rect.Inflate(fBorder, fBorder); | 222 rect.Inflate(fBorder, fBorder); |
| 185 } | 223 } |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 490 if (!m_pCurDelegate) { | 528 if (!m_pCurDelegate) { |
| 491 m_pCurDelegate = m_pDelegate; | 529 m_pCurDelegate = m_pDelegate; |
| 492 } | 530 } |
| 493 if (!pDelegate) { | 531 if (!pDelegate) { |
| 494 return m_pCurDelegate; | 532 return m_pCurDelegate; |
| 495 } | 533 } |
| 496 IFWL_WidgetDelegate* pOldDelegate = m_pCurDelegate; | 534 IFWL_WidgetDelegate* pOldDelegate = m_pCurDelegate; |
| 497 m_pCurDelegate = pDelegate; | 535 m_pCurDelegate = pDelegate; |
| 498 return pOldDelegate; | 536 return pOldDelegate; |
| 499 } | 537 } |
| 500 IFWL_Thread* CFWL_WidgetImp::GetOwnerThread() const { | 538 IFWL_App* CFWL_WidgetImp::GetOwnerThread() const { |
| 501 return static_cast<IFWL_Thread*>(m_pOwnerThread->GetInterface()); | 539 return static_cast<IFWL_App*>(m_pOwnerThread->GetInterface()); |
| 502 } | 540 } |
| 503 FWL_ERR CFWL_WidgetImp::SetOwnerThread(CFWL_ThreadImp* pOwnerThread) { | 541 FWL_ERR CFWL_WidgetImp::SetOwnerThread(CFWL_AppImp* pOwnerThread) { |
| 504 m_pOwnerThread = pOwnerThread; | 542 m_pOwnerThread = pOwnerThread; |
| 505 return FWL_ERR_Succeeded; | 543 return FWL_ERR_Succeeded; |
| 506 } | 544 } |
| 507 IFWL_Widget* CFWL_WidgetImp::GetInterface() const { | 545 IFWL_Widget* CFWL_WidgetImp::GetInterface() const { |
| 508 return m_pInterface; | 546 return m_pInterface; |
| 509 } | 547 } |
| 510 void CFWL_WidgetImp::SetInterface(IFWL_Widget* pInterface) { | 548 void CFWL_WidgetImp::SetInterface(IFWL_Widget* pInterface) { |
| 511 m_pInterface = pInterface; | 549 m_pInterface = pInterface; |
| 512 } | 550 } |
| 513 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, | 551 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 675 CFWL_ThemeText calPart; | 713 CFWL_ThemeText calPart; |
| 676 calPart.m_pWidget = m_pInterface; | 714 calPart.m_pWidget = m_pInterface; |
| 677 calPart.m_wsText = wsText; | 715 calPart.m_wsText = wsText; |
| 678 calPart.m_dwTTOStyles = dwTTOStyles; | 716 calPart.m_dwTTOStyles = dwTTOStyles; |
| 679 calPart.m_iTTOAlign = iTTOAlign; | 717 calPart.m_iTTOAlign = iTTOAlign; |
| 680 pTheme->CalcTextRect(&calPart, rect); | 718 pTheme->CalcTextRect(&calPart, rect); |
| 681 } | 719 } |
| 682 void CFWL_WidgetImp::SetFocus(FX_BOOL bFocus) { | 720 void CFWL_WidgetImp::SetFocus(FX_BOOL bFocus) { |
| 683 if (m_pWidgetMgr->IsFormDisabled()) | 721 if (m_pWidgetMgr->IsFormDisabled()) |
| 684 return; | 722 return; |
| 685 IFWL_Thread* pThread = GetOwnerThread(); | 723 IFWL_App* pThread = GetOwnerThread(); |
| 686 if (!pThread) | 724 if (!pThread) |
| 687 return; | 725 return; |
| 688 CFWL_NoteDriver* pDriver = | 726 CFWL_NoteDriver* pDriver = |
| 689 static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); | 727 static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); |
| 690 if (!pDriver) | 728 if (!pDriver) |
| 691 return; | 729 return; |
| 692 IFWL_Widget* curFocus = pDriver->GetFocus(); | 730 IFWL_Widget* curFocus = pDriver->GetFocus(); |
| 693 if (bFocus && curFocus != m_pInterface) { | 731 if (bFocus && curFocus != m_pInterface) { |
| 694 pDriver->SetFocus(m_pInterface); | 732 pDriver->SetFocus(m_pInterface); |
| 695 } else if (!bFocus && curFocus == m_pInterface) { | 733 } else if (!bFocus && curFocus == m_pInterface) { |
| 696 pDriver->SetFocus(NULL); | 734 pDriver->SetFocus(NULL); |
| 697 } | 735 } |
| 698 } | 736 } |
| 699 void CFWL_WidgetImp::SetGrab(FX_BOOL bSet) { | 737 void CFWL_WidgetImp::SetGrab(FX_BOOL bSet) { |
| 700 IFWL_Thread* pThread = GetOwnerThread(); | 738 IFWL_App* pThread = GetOwnerThread(); |
| 701 if (!pThread) | 739 if (!pThread) |
| 702 return; | 740 return; |
| 703 CFWL_NoteDriver* pDriver = | 741 CFWL_NoteDriver* pDriver = |
| 704 static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); | 742 static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); |
| 705 pDriver->SetGrab(m_pInterface, bSet); | 743 pDriver->SetGrab(m_pInterface, bSet); |
| 706 } | 744 } |
| 707 FX_BOOL CFWL_WidgetImp::GetPopupPos(FX_FLOAT fMinHeight, | 745 FX_BOOL CFWL_WidgetImp::GetPopupPos(FX_FLOAT fMinHeight, |
| 708 FX_FLOAT fMaxHeight, | 746 FX_FLOAT fMaxHeight, |
| 709 const CFX_RectF& rtAnchor, | 747 const CFX_RectF& rtAnchor, |
| 710 CFX_RectF& rtPopup) { | 748 CFX_RectF& rtPopup) { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 806 rtPopup.height); | 844 rtPopup.height); |
| 807 } | 845 } |
| 808 rtPopup.Offset(fx, fy); | 846 rtPopup.Offset(fx, fy); |
| 809 return TRUE; | 847 return TRUE; |
| 810 } | 848 } |
| 811 FX_BOOL CFWL_WidgetImp::GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy) { | 849 FX_BOOL CFWL_WidgetImp::GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy) { |
| 812 return FALSE; | 850 return FALSE; |
| 813 } | 851 } |
| 814 void CFWL_WidgetImp::RegisterEventTarget(IFWL_Widget* pEventSource, | 852 void CFWL_WidgetImp::RegisterEventTarget(IFWL_Widget* pEventSource, |
| 815 uint32_t dwFilter) { | 853 uint32_t dwFilter) { |
| 816 IFWL_Thread* pThread = GetOwnerThread(); | 854 IFWL_App* pThread = GetOwnerThread(); |
| 817 if (!pThread) | 855 if (!pThread) |
| 818 return; | 856 return; |
| 819 IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); | 857 CFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); |
| 820 if (!pNoteDriver) | 858 if (!pNoteDriver) |
| 821 return; | 859 return; |
| 822 pNoteDriver->RegisterEventTarget(m_pInterface, pEventSource, dwFilter); | 860 pNoteDriver->RegisterEventTarget(m_pInterface, pEventSource, dwFilter); |
| 823 } | 861 } |
| 824 void CFWL_WidgetImp::UnregisterEventTarget() { | 862 void CFWL_WidgetImp::UnregisterEventTarget() { |
| 825 IFWL_Thread* pThread = GetOwnerThread(); | 863 IFWL_App* pThread = GetOwnerThread(); |
| 826 if (!pThread) | 864 if (!pThread) |
| 827 return; | 865 return; |
| 828 IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); | 866 CFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); |
| 829 if (!pNoteDriver) | 867 if (!pNoteDriver) |
| 830 return; | 868 return; |
| 831 pNoteDriver->UnregisterEventTarget(m_pInterface); | 869 pNoteDriver->UnregisterEventTarget(m_pInterface); |
| 832 } | 870 } |
| 833 void CFWL_WidgetImp::DispatchKeyEvent(CFWL_MsgKey* pNote) { | 871 void CFWL_WidgetImp::DispatchKeyEvent(CFWL_MsgKey* pNote) { |
| 834 if (!pNote) | 872 if (!pNote) |
| 835 return; | 873 return; |
| 836 CFWL_EvtKey* pEvent = new CFWL_EvtKey; | 874 CFWL_EvtKey* pEvent = new CFWL_EvtKey; |
| 837 pEvent->m_pSrcTarget = m_pInterface; | 875 pEvent->m_pSrcTarget = m_pInterface; |
| 838 pEvent->m_dwCmd = pNote->m_dwCmd; | 876 pEvent->m_dwCmd = pNote->m_dwCmd; |
| 839 pEvent->m_dwKeyCode = pNote->m_dwKeyCode; | 877 pEvent->m_dwKeyCode = pNote->m_dwKeyCode; |
| 840 pEvent->m_dwFlags = pNote->m_dwFlags; | 878 pEvent->m_dwFlags = pNote->m_dwFlags; |
| 841 DispatchEvent(pEvent); | 879 DispatchEvent(pEvent); |
| 842 pEvent->Release(); | 880 pEvent->Release(); |
| 843 } | 881 } |
| 844 void CFWL_WidgetImp::DispatchEvent(CFWL_Event* pEvent) { | 882 void CFWL_WidgetImp::DispatchEvent(CFWL_Event* pEvent) { |
| 845 if (m_pOuter) { | 883 if (m_pOuter) { |
| 846 IFWL_WidgetDelegate* pDelegate = m_pOuter->SetDelegate(NULL); | 884 IFWL_WidgetDelegate* pDelegate = m_pOuter->SetDelegate(NULL); |
| 847 pDelegate->OnProcessEvent(pEvent); | 885 pDelegate->OnProcessEvent(pEvent); |
| 848 return; | 886 return; |
| 849 } | 887 } |
| 850 IFWL_Thread* pThread = GetOwnerThread(); | 888 IFWL_App* pThread = GetOwnerThread(); |
| 851 if (!pThread) | 889 if (!pThread) |
| 852 return; | 890 return; |
| 853 IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); | 891 CFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); |
| 854 if (!pNoteDriver) | 892 if (!pNoteDriver) |
| 855 return; | 893 return; |
| 856 pNoteDriver->SendEvent(pEvent); | 894 pNoteDriver->SendEvent(pEvent); |
| 857 } | 895 } |
| 858 void CFWL_WidgetImp::Repaint(const CFX_RectF* pRect) { | 896 void CFWL_WidgetImp::Repaint(const CFX_RectF* pRect) { |
| 859 if (pRect) { | 897 if (pRect) { |
| 860 m_pWidgetMgr->RepaintWidget(m_pInterface, pRect); | 898 m_pWidgetMgr->RepaintWidget(m_pInterface, pRect); |
| 861 return; | 899 return; |
| 862 } | 900 } |
| 863 CFX_RectF rect; | 901 CFX_RectF rect; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 907 param.m_pWidget = m_pInterface; | 945 param.m_pWidget = m_pInterface; |
| 908 param.m_iPart = iPartEdge; | 946 param.m_iPart = iPartEdge; |
| 909 param.m_pGraphics = pGraphics; | 947 param.m_pGraphics = pGraphics; |
| 910 if (pMatrix) { | 948 if (pMatrix) { |
| 911 param.m_matrix.Concat(*pMatrix, TRUE); | 949 param.m_matrix.Concat(*pMatrix, TRUE); |
| 912 } | 950 } |
| 913 param.m_rtPart = rtEdge; | 951 param.m_rtPart = rtEdge; |
| 914 pTheme->DrawBackground(¶m); | 952 pTheme->DrawBackground(¶m); |
| 915 } | 953 } |
| 916 void CFWL_WidgetImp::NotifyDriver() { | 954 void CFWL_WidgetImp::NotifyDriver() { |
| 917 IFWL_Thread* pThread = GetOwnerThread(); | 955 IFWL_App* pThread = GetOwnerThread(); |
| 918 if (!pThread) | 956 if (!pThread) |
| 919 return; | 957 return; |
| 920 CFWL_NoteDriver* pDriver = | 958 CFWL_NoteDriver* pDriver = |
| 921 static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); | 959 static_cast<CFWL_NoteDriver*>(pThread->GetNoteDriver()); |
| 922 if (!pDriver) | 960 if (!pDriver) |
| 923 return; | 961 return; |
| 924 pDriver->NotifyTargetDestroy(m_pInterface); | 962 pDriver->NotifyTargetDestroy(m_pInterface); |
| 925 } | 963 } |
| 926 CFX_SizeF CFWL_WidgetImp::GetOffsetFromParent(IFWL_Widget* pParent) { | 964 CFX_SizeF CFWL_WidgetImp::GetOffsetFromParent(IFWL_Widget* pParent) { |
| 927 if (pParent == GetInterface()) | 965 if (pParent == GetInterface()) |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1028 FWL_ERR CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { | 1066 FWL_ERR CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
| 1029 return FWL_ERR_Succeeded; | 1067 return FWL_ERR_Succeeded; |
| 1030 } | 1068 } |
| 1031 | 1069 |
| 1032 FWL_ERR CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 1070 FWL_ERR CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 1033 const CFX_Matrix* pMatrix) { | 1071 const CFX_Matrix* pMatrix) { |
| 1034 CFWL_EvtDraw evt; | 1072 CFWL_EvtDraw evt; |
| 1035 evt.m_pGraphics = pGraphics; | 1073 evt.m_pGraphics = pGraphics; |
| 1036 return FWL_ERR_Succeeded; | 1074 return FWL_ERR_Succeeded; |
| 1037 } | 1075 } |
| OLD | NEW |