| 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 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 IFWL_Widget* IFWL_Widget::GetOwner() { | 55 IFWL_Widget* IFWL_Widget::GetOwner() { |
| 56 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwner(); | 56 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOwner(); |
| 57 } | 57 } |
| 58 FWL_ERR IFWL_Widget::SetOwner(IFWL_Widget* pOwner) { | 58 FWL_ERR IFWL_Widget::SetOwner(IFWL_Widget* pOwner) { |
| 59 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetOwner(pOwner); | 59 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetOwner(pOwner); |
| 60 } | 60 } |
| 61 IFWL_Widget* IFWL_Widget::GetOuter() { | 61 IFWL_Widget* IFWL_Widget::GetOuter() { |
| 62 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOuter(); | 62 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetOuter(); |
| 63 } | 63 } |
| 64 FX_DWORD IFWL_Widget::GetStyles() { | 64 uint32_t IFWL_Widget::GetStyles() { |
| 65 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStyles(); | 65 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStyles(); |
| 66 } | 66 } |
| 67 FWL_ERR IFWL_Widget::ModifyStyles(FX_DWORD dwStylesAdded, | 67 FWL_ERR IFWL_Widget::ModifyStyles(uint32_t dwStylesAdded, |
| 68 FX_DWORD dwStylesRemoved) { | 68 uint32_t dwStylesRemoved) { |
| 69 return static_cast<CFWL_WidgetImp*>(GetImpl()) | 69 return static_cast<CFWL_WidgetImp*>(GetImpl()) |
| 70 ->ModifyStyles(dwStylesAdded, dwStylesRemoved); | 70 ->ModifyStyles(dwStylesAdded, dwStylesRemoved); |
| 71 } | 71 } |
| 72 FX_DWORD IFWL_Widget::GetStylesEx() { | 72 uint32_t IFWL_Widget::GetStylesEx() { |
| 73 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStylesEx(); | 73 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStylesEx(); |
| 74 } | 74 } |
| 75 FWL_ERR IFWL_Widget::ModifyStylesEx(FX_DWORD dwStylesExAdded, | 75 FWL_ERR IFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded, |
| 76 FX_DWORD dwStylesExRemoved) { | 76 uint32_t dwStylesExRemoved) { |
| 77 return static_cast<CFWL_WidgetImp*>(GetImpl()) | 77 return static_cast<CFWL_WidgetImp*>(GetImpl()) |
| 78 ->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); | 78 ->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); |
| 79 } | 79 } |
| 80 FX_DWORD IFWL_Widget::GetStates() { | 80 uint32_t IFWL_Widget::GetStates() { |
| 81 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStates(); | 81 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStates(); |
| 82 } | 82 } |
| 83 FWL_ERR IFWL_Widget::SetStates(FX_DWORD dwStates, FX_BOOL bSet) { | 83 FWL_ERR IFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) { |
| 84 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet); | 84 return static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet); |
| 85 } | 85 } |
| 86 FWL_ERR IFWL_Widget::SetPrivateData(void* module_id, | 86 FWL_ERR IFWL_Widget::SetPrivateData(void* module_id, |
| 87 void* pData, | 87 void* pData, |
| 88 PD_CALLBACK_FREEDATA callback) { | 88 PD_CALLBACK_FREEDATA callback) { |
| 89 return static_cast<CFWL_WidgetImp*>(GetImpl()) | 89 return static_cast<CFWL_WidgetImp*>(GetImpl()) |
| 90 ->SetPrivateData(module_id, pData, callback); | 90 ->SetPrivateData(module_id, pData, callback); |
| 91 } | 91 } |
| 92 void* IFWL_Widget::GetPrivateData(void* module_id) { | 92 void* IFWL_Widget::GetPrivateData(void* module_id) { |
| 93 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetPrivateData(module_id); | 93 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetPrivateData(module_id); |
| 94 } | 94 } |
| 95 FWL_ERR IFWL_Widget::Update() { | 95 FWL_ERR IFWL_Widget::Update() { |
| 96 return static_cast<CFWL_WidgetImp*>(GetImpl())->Update(); | 96 return static_cast<CFWL_WidgetImp*>(GetImpl())->Update(); |
| 97 } | 97 } |
| 98 FWL_ERR IFWL_Widget::LockUpdate() { | 98 FWL_ERR IFWL_Widget::LockUpdate() { |
| 99 return static_cast<CFWL_WidgetImp*>(GetImpl())->LockUpdate(); | 99 return static_cast<CFWL_WidgetImp*>(GetImpl())->LockUpdate(); |
| 100 } | 100 } |
| 101 FWL_ERR IFWL_Widget::UnlockUpdate() { | 101 FWL_ERR IFWL_Widget::UnlockUpdate() { |
| 102 return static_cast<CFWL_WidgetImp*>(GetImpl())->UnlockUpdate(); | 102 return static_cast<CFWL_WidgetImp*>(GetImpl())->UnlockUpdate(); |
| 103 } | 103 } |
| 104 FX_DWORD IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 104 uint32_t IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 105 return static_cast<CFWL_WidgetImp*>(GetImpl())->HitTest(fx, fy); | 105 return static_cast<CFWL_WidgetImp*>(GetImpl())->HitTest(fx, fy); |
| 106 } | 106 } |
| 107 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, | 107 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, |
| 108 FX_FLOAT& fx, | 108 FX_FLOAT& fx, |
| 109 FX_FLOAT& fy) { | 109 FX_FLOAT& fy) { |
| 110 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, fx, fy); | 110 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, fx, fy); |
| 111 } | 111 } |
| 112 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) { | 112 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) { |
| 113 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, rt); | 113 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, rt); |
| 114 } | 114 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 return m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_Owner); | 251 return m_pWidgetMgr->GetWidget(m_pInterface, FWL_WGTRELATION_Owner); |
| 252 } | 252 } |
| 253 FWL_ERR CFWL_WidgetImp::SetOwner(IFWL_Widget* pOwner) { | 253 FWL_ERR CFWL_WidgetImp::SetOwner(IFWL_Widget* pOwner) { |
| 254 m_pProperties->m_pOwner = pOwner; | 254 m_pProperties->m_pOwner = pOwner; |
| 255 m_pWidgetMgr->SetOwner(pOwner, m_pInterface); | 255 m_pWidgetMgr->SetOwner(pOwner, m_pInterface); |
| 256 return FWL_ERR_Succeeded; | 256 return FWL_ERR_Succeeded; |
| 257 } | 257 } |
| 258 IFWL_Widget* CFWL_WidgetImp::GetOuter() { | 258 IFWL_Widget* CFWL_WidgetImp::GetOuter() { |
| 259 return m_pOuter; | 259 return m_pOuter; |
| 260 } | 260 } |
| 261 FX_DWORD CFWL_WidgetImp::GetStyles() { | 261 uint32_t CFWL_WidgetImp::GetStyles() { |
| 262 return m_pProperties->m_dwStyles; | 262 return m_pProperties->m_dwStyles; |
| 263 } | 263 } |
| 264 FWL_ERR CFWL_WidgetImp::ModifyStyles(FX_DWORD dwStylesAdded, | 264 FWL_ERR CFWL_WidgetImp::ModifyStyles(uint32_t dwStylesAdded, |
| 265 FX_DWORD dwStylesRemoved) { | 265 uint32_t dwStylesRemoved) { |
| 266 m_pProperties->m_dwStyles = | 266 m_pProperties->m_dwStyles = |
| 267 (m_pProperties->m_dwStyles & ~dwStylesRemoved) | dwStylesAdded; | 267 (m_pProperties->m_dwStyles & ~dwStylesRemoved) | dwStylesAdded; |
| 268 return FWL_ERR_Succeeded; | 268 return FWL_ERR_Succeeded; |
| 269 } | 269 } |
| 270 FX_DWORD CFWL_WidgetImp::GetStylesEx() { | 270 uint32_t CFWL_WidgetImp::GetStylesEx() { |
| 271 return m_pProperties->m_dwStyleExes; | 271 return m_pProperties->m_dwStyleExes; |
| 272 } | 272 } |
| 273 FWL_ERR CFWL_WidgetImp::ModifyStylesEx(FX_DWORD dwStylesExAdded, | 273 FWL_ERR CFWL_WidgetImp::ModifyStylesEx(uint32_t dwStylesExAdded, |
| 274 FX_DWORD dwStylesExRemoved) { | 274 uint32_t dwStylesExRemoved) { |
| 275 m_pProperties->m_dwStyleExes = | 275 m_pProperties->m_dwStyleExes = |
| 276 (m_pProperties->m_dwStyleExes & ~dwStylesExRemoved) | dwStylesExAdded; | 276 (m_pProperties->m_dwStyleExes & ~dwStylesExRemoved) | dwStylesExAdded; |
| 277 return FWL_ERR_Succeeded; | 277 return FWL_ERR_Succeeded; |
| 278 } | 278 } |
| 279 FX_DWORD CFWL_WidgetImp::GetStates() { | 279 uint32_t CFWL_WidgetImp::GetStates() { |
| 280 return m_pProperties->m_dwStates; | 280 return m_pProperties->m_dwStates; |
| 281 } | 281 } |
| 282 static void NotifyHideChildWidget(IFWL_WidgetMgr* widgetMgr, | 282 static void NotifyHideChildWidget(IFWL_WidgetMgr* widgetMgr, |
| 283 IFWL_Widget* widget, | 283 IFWL_Widget* widget, |
| 284 CFWL_NoteDriver* noteDriver) { | 284 CFWL_NoteDriver* noteDriver) { |
| 285 IFWL_Widget* child = widgetMgr->GetWidget(widget, FWL_WGTRELATION_FirstChild); | 285 IFWL_Widget* child = widgetMgr->GetWidget(widget, FWL_WGTRELATION_FirstChild); |
| 286 while (child) { | 286 while (child) { |
| 287 noteDriver->NotifyTargetHide(child); | 287 noteDriver->NotifyTargetHide(child); |
| 288 NotifyHideChildWidget(widgetMgr, child, noteDriver); | 288 NotifyHideChildWidget(widgetMgr, child, noteDriver); |
| 289 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); | 289 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 FWL_ERR CFWL_WidgetImp::SetStates(FX_DWORD dwStates, FX_BOOL bSet) { | 292 FWL_ERR CFWL_WidgetImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { |
| 293 bSet ? (m_pProperties->m_dwStates |= dwStates) | 293 bSet ? (m_pProperties->m_dwStates |= dwStates) |
| 294 : (m_pProperties->m_dwStates &= ~dwStates); | 294 : (m_pProperties->m_dwStates &= ~dwStates); |
| 295 FWL_ERR ret = FWL_ERR_Succeeded; | 295 FWL_ERR ret = FWL_ERR_Succeeded; |
| 296 if (dwStates & FWL_WGTSTATE_Invisible) { | 296 if (dwStates & FWL_WGTSTATE_Invisible) { |
| 297 if (bSet) { | 297 if (bSet) { |
| 298 ret = m_pWidgetMgr->HideWidget_Native(m_pInterface); | 298 ret = m_pWidgetMgr->HideWidget_Native(m_pInterface); |
| 299 CFWL_NoteDriver* noteDriver = | 299 CFWL_NoteDriver* noteDriver = |
| 300 static_cast<CFWL_NoteDriver*>(GetOwnerThread()->GetNoteDriver()); | 300 static_cast<CFWL_NoteDriver*>(GetOwnerThread()->GetNoteDriver()); |
| 301 IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr(); | 301 IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr(); |
| 302 noteDriver->NotifyTargetHide(m_pInterface); | 302 noteDriver->NotifyTargetHide(m_pInterface); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 333 FWL_ERR CFWL_WidgetImp::LockUpdate() { | 333 FWL_ERR CFWL_WidgetImp::LockUpdate() { |
| 334 m_iLock++; | 334 m_iLock++; |
| 335 return FWL_ERR_Succeeded; | 335 return FWL_ERR_Succeeded; |
| 336 } | 336 } |
| 337 FWL_ERR CFWL_WidgetImp::UnlockUpdate() { | 337 FWL_ERR CFWL_WidgetImp::UnlockUpdate() { |
| 338 if (IsLocked()) { | 338 if (IsLocked()) { |
| 339 m_iLock--; | 339 m_iLock--; |
| 340 } | 340 } |
| 341 return FWL_ERR_Succeeded; | 341 return FWL_ERR_Succeeded; |
| 342 } | 342 } |
| 343 FX_DWORD CFWL_WidgetImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 343 uint32_t CFWL_WidgetImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 344 CFX_RectF rtClient; | 344 CFX_RectF rtClient; |
| 345 GetClientRect(rtClient); | 345 GetClientRect(rtClient); |
| 346 if (rtClient.Contains(fx, fy)) { | 346 if (rtClient.Contains(fx, fy)) { |
| 347 return FWL_WGTHITTEST_Client; | 347 return FWL_WGTHITTEST_Client; |
| 348 } | 348 } |
| 349 if (HasEdge()) { | 349 if (HasEdge()) { |
| 350 CFX_RectF rtEdge; | 350 CFX_RectF rtEdge; |
| 351 GetEdgeRect(rtEdge); | 351 GetEdgeRect(rtEdge); |
| 352 if (rtEdge.Contains(fx, fy)) { | 352 if (rtEdge.Contains(fx, fy)) { |
| 353 return FWL_WGTHITTEST_Edge; | 353 return FWL_WGTHITTEST_Edge; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 } | 585 } |
| 586 } | 586 } |
| 587 FX_FLOAT CFWL_WidgetImp::GetBorderSize(FX_BOOL bCX) { | 587 FX_FLOAT CFWL_WidgetImp::GetBorderSize(FX_BOOL bCX) { |
| 588 FX_FLOAT* pfBorder = static_cast<FX_FLOAT*>(GetThemeCapacity( | 588 FX_FLOAT* pfBorder = static_cast<FX_FLOAT*>(GetThemeCapacity( |
| 589 bCX ? FWL_WGTCAPACITY_CXBorder : FWL_WGTCAPACITY_CYBorder)); | 589 bCX ? FWL_WGTCAPACITY_CXBorder : FWL_WGTCAPACITY_CYBorder)); |
| 590 if (!pfBorder) | 590 if (!pfBorder) |
| 591 return 0; | 591 return 0; |
| 592 return *pfBorder; | 592 return *pfBorder; |
| 593 } | 593 } |
| 594 FX_FLOAT CFWL_WidgetImp::GetEdgeWidth() { | 594 FX_FLOAT CFWL_WidgetImp::GetEdgeWidth() { |
| 595 FX_DWORD dwCapacity = 0; | 595 uint32_t dwCapacity = 0; |
| 596 switch (m_pProperties->m_dwStyles & FWL_WGTSTYLE_EdgeMask) { | 596 switch (m_pProperties->m_dwStyles & FWL_WGTSTYLE_EdgeMask) { |
| 597 case FWL_WGTSTYLE_EdgeFlat: { | 597 case FWL_WGTSTYLE_EdgeFlat: { |
| 598 dwCapacity = FWL_WGTCAPACITY_EdgeFlat; | 598 dwCapacity = FWL_WGTCAPACITY_EdgeFlat; |
| 599 break; | 599 break; |
| 600 } | 600 } |
| 601 case FWL_WGTSTYLE_EdgeRaised: { | 601 case FWL_WGTSTYLE_EdgeRaised: { |
| 602 dwCapacity = FWL_WGTCAPACITY_EdgeRaised; | 602 dwCapacity = FWL_WGTCAPACITY_EdgeRaised; |
| 603 break; | 603 break; |
| 604 } | 604 } |
| 605 case FWL_WGTSTYLE_EdgeSunken: { | 605 case FWL_WGTSTYLE_EdgeSunken: { |
| 606 dwCapacity = FWL_WGTCAPACITY_EdgeSunken; | 606 dwCapacity = FWL_WGTCAPACITY_EdgeSunken; |
| 607 break; | 607 break; |
| 608 } | 608 } |
| 609 } | 609 } |
| 610 if (dwCapacity > 0) { | 610 if (dwCapacity > 0) { |
| 611 FX_FLOAT* fRet = static_cast<FX_FLOAT*>(GetThemeCapacity(dwCapacity)); | 611 FX_FLOAT* fRet = static_cast<FX_FLOAT*>(GetThemeCapacity(dwCapacity)); |
| 612 return fRet ? *fRet : 0; | 612 return fRet ? *fRet : 0; |
| 613 } | 613 } |
| 614 return 0; | 614 return 0; |
| 615 } | 615 } |
| 616 void CFWL_WidgetImp::GetRelativeRect(CFX_RectF& rect) { | 616 void CFWL_WidgetImp::GetRelativeRect(CFX_RectF& rect) { |
| 617 rect = m_pProperties->m_rtWidget; | 617 rect = m_pProperties->m_rtWidget; |
| 618 rect.left = rect.top = 0; | 618 rect.left = rect.top = 0; |
| 619 } | 619 } |
| 620 void* CFWL_WidgetImp::GetThemeCapacity(FX_DWORD dwCapacity) { | 620 void* CFWL_WidgetImp::GetThemeCapacity(uint32_t dwCapacity) { |
| 621 IFWL_ThemeProvider* pTheme = GetAvailableTheme(); | 621 IFWL_ThemeProvider* pTheme = GetAvailableTheme(); |
| 622 if (!pTheme) | 622 if (!pTheme) |
| 623 return NULL; | 623 return NULL; |
| 624 CFWL_ThemePart part; | 624 CFWL_ThemePart part; |
| 625 part.m_pWidget = m_pInterface; | 625 part.m_pWidget = m_pInterface; |
| 626 return pTheme->GetCapacity(&part, dwCapacity); | 626 return pTheme->GetCapacity(&part, dwCapacity); |
| 627 } | 627 } |
| 628 IFWL_ThemeProvider* CFWL_WidgetImp::GetAvailableTheme() { | 628 IFWL_ThemeProvider* CFWL_WidgetImp::GetAvailableTheme() { |
| 629 if (m_pProperties->m_pThemeProvider) { | 629 if (m_pProperties->m_pThemeProvider) { |
| 630 return m_pProperties->m_pThemeProvider; | 630 return m_pProperties->m_pThemeProvider; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 FX_FLOAT fWidth = bMultiLine | 673 FX_FLOAT fWidth = bMultiLine |
| 674 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth | 674 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth |
| 675 : FWL_WGT_CalcMultiLineDefWidth) | 675 : FWL_WGT_CalcMultiLineDefWidth) |
| 676 : FWL_WGT_CalcWidth; | 676 : FWL_WGT_CalcWidth; |
| 677 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight); | 677 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight); |
| 678 pTheme->CalcTextRect(&calPart, rect); | 678 pTheme->CalcTextRect(&calPart, rect); |
| 679 return CFX_SizeF(rect.width, rect.height); | 679 return CFX_SizeF(rect.width, rect.height); |
| 680 } | 680 } |
| 681 void CFWL_WidgetImp::CalcTextRect(const CFX_WideString& wsText, | 681 void CFWL_WidgetImp::CalcTextRect(const CFX_WideString& wsText, |
| 682 IFWL_ThemeProvider* pTheme, | 682 IFWL_ThemeProvider* pTheme, |
| 683 FX_DWORD dwTTOStyles, | 683 uint32_t dwTTOStyles, |
| 684 int32_t iTTOAlign, | 684 int32_t iTTOAlign, |
| 685 CFX_RectF& rect) { | 685 CFX_RectF& rect) { |
| 686 CFWL_ThemeText calPart; | 686 CFWL_ThemeText calPart; |
| 687 calPart.m_pWidget = m_pInterface; | 687 calPart.m_pWidget = m_pInterface; |
| 688 calPart.m_wsText = wsText; | 688 calPart.m_wsText = wsText; |
| 689 calPart.m_dwTTOStyles = dwTTOStyles; | 689 calPart.m_dwTTOStyles = dwTTOStyles; |
| 690 calPart.m_iTTOAlign = iTTOAlign; | 690 calPart.m_iTTOAlign = iTTOAlign; |
| 691 pTheme->CalcTextRect(&calPart, rect); | 691 pTheme->CalcTextRect(&calPart, rect); |
| 692 } | 692 } |
| 693 void CFWL_WidgetImp::SetFocus(FX_BOOL bFocus) { | 693 void CFWL_WidgetImp::SetFocus(FX_BOOL bFocus) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 rtPopup.Set(rtAnchor.left, rtAnchor.bottom(), rtPopup.width, | 816 rtPopup.Set(rtAnchor.left, rtAnchor.bottom(), rtPopup.width, |
| 817 rtPopup.height); | 817 rtPopup.height); |
| 818 } | 818 } |
| 819 rtPopup.Offset(fx, fy); | 819 rtPopup.Offset(fx, fy); |
| 820 return TRUE; | 820 return TRUE; |
| 821 } | 821 } |
| 822 FX_BOOL CFWL_WidgetImp::GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy) { | 822 FX_BOOL CFWL_WidgetImp::GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy) { |
| 823 return FALSE; | 823 return FALSE; |
| 824 } | 824 } |
| 825 void CFWL_WidgetImp::RegisterEventTarget(IFWL_Widget* pEventSource, | 825 void CFWL_WidgetImp::RegisterEventTarget(IFWL_Widget* pEventSource, |
| 826 FX_DWORD dwFilter) { | 826 uint32_t dwFilter) { |
| 827 IFWL_NoteThread* pThread = GetOwnerThread(); | 827 IFWL_NoteThread* pThread = GetOwnerThread(); |
| 828 if (!pThread) | 828 if (!pThread) |
| 829 return; | 829 return; |
| 830 IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); | 830 IFWL_NoteDriver* pNoteDriver = pThread->GetNoteDriver(); |
| 831 if (!pNoteDriver) | 831 if (!pNoteDriver) |
| 832 return; | 832 return; |
| 833 pNoteDriver->RegisterEventTarget(m_pInterface, pEventSource, dwFilter); | 833 pNoteDriver->RegisterEventTarget(m_pInterface, pEventSource, dwFilter); |
| 834 } | 834 } |
| 835 void CFWL_WidgetImp::UnregisterEventTarget() { | 835 void CFWL_WidgetImp::UnregisterEventTarget() { |
| 836 IFWL_NoteThread* pThread = GetOwnerThread(); | 836 IFWL_NoteThread* pThread = GetOwnerThread(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 pUpWidget = pUpWidget->GetParent(); | 962 pUpWidget = pUpWidget->GetParent(); |
| 963 } | 963 } |
| 964 return FALSE; | 964 return FALSE; |
| 965 } | 965 } |
| 966 CFWL_WidgetImpDelegate::CFWL_WidgetImpDelegate() {} | 966 CFWL_WidgetImpDelegate::CFWL_WidgetImpDelegate() {} |
| 967 int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 967 int32_t CFWL_WidgetImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
| 968 if (!pMessage->m_pDstTarget) | 968 if (!pMessage->m_pDstTarget) |
| 969 return 0; | 969 return 0; |
| 970 CFWL_WidgetImp* pWidget = | 970 CFWL_WidgetImp* pWidget = |
| 971 static_cast<CFWL_WidgetImp*>(pMessage->m_pDstTarget->GetImpl()); | 971 static_cast<CFWL_WidgetImp*>(pMessage->m_pDstTarget->GetImpl()); |
| 972 FX_DWORD dwMsgCode = pMessage->GetClassID(); | 972 uint32_t dwMsgCode = pMessage->GetClassID(); |
| 973 switch (dwMsgCode) { | 973 switch (dwMsgCode) { |
| 974 case FWL_MSGHASH_Mouse: { | 974 case FWL_MSGHASH_Mouse: { |
| 975 CFWL_MsgMouse* pMsgMouse = static_cast<CFWL_MsgMouse*>(pMessage); | 975 CFWL_MsgMouse* pMsgMouse = static_cast<CFWL_MsgMouse*>(pMessage); |
| 976 CFWL_EvtMouse evt; | 976 CFWL_EvtMouse evt; |
| 977 evt.m_pSrcTarget = pWidget->m_pInterface; | 977 evt.m_pSrcTarget = pWidget->m_pInterface; |
| 978 evt.m_pDstTarget = pWidget->m_pInterface; | 978 evt.m_pDstTarget = pWidget->m_pInterface; |
| 979 evt.m_dwCmd = pMsgMouse->m_dwCmd; | 979 evt.m_dwCmd = pMsgMouse->m_dwCmd; |
| 980 evt.m_dwFlags = pMsgMouse->m_dwFlags; | 980 evt.m_dwFlags = pMsgMouse->m_dwFlags; |
| 981 evt.m_fx = pMsgMouse->m_fx; | 981 evt.m_fx = pMsgMouse->m_fx; |
| 982 evt.m_fy = pMsgMouse->m_fy; | 982 evt.m_fy = pMsgMouse->m_fy; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 return pCustom; | 1082 return pCustom; |
| 1083 } | 1083 } |
| 1084 IFWL_Custom::IFWL_Custom() {} | 1084 IFWL_Custom::IFWL_Custom() {} |
| 1085 FWL_ERR IFWL_Custom::SetProxy(IFWL_Proxy* pProxy) { | 1085 FWL_ERR IFWL_Custom::SetProxy(IFWL_Proxy* pProxy) { |
| 1086 return static_cast<CFWL_CustomImp*>(GetImpl())->SetProxy(pProxy); | 1086 return static_cast<CFWL_CustomImp*>(GetImpl())->SetProxy(pProxy); |
| 1087 } | 1087 } |
| 1088 void FWL_SetWidgetRect(IFWL_Widget* widget, const CFX_RectF& rect) { | 1088 void FWL_SetWidgetRect(IFWL_Widget* widget, const CFX_RectF& rect) { |
| 1089 static_cast<CFWL_WidgetImp*>(widget->GetImpl())->m_pProperties->m_rtWidget = | 1089 static_cast<CFWL_WidgetImp*>(widget->GetImpl())->m_pProperties->m_rtWidget = |
| 1090 rect; | 1090 rect; |
| 1091 } | 1091 } |
| 1092 void FWL_SetWidgetStates(IFWL_Widget* widget, FX_DWORD dwStates) { | 1092 void FWL_SetWidgetStates(IFWL_Widget* widget, uint32_t dwStates) { |
| 1093 static_cast<CFWL_WidgetImp*>(widget->GetImpl())->m_pProperties->m_dwStates = | 1093 static_cast<CFWL_WidgetImp*>(widget->GetImpl())->m_pProperties->m_dwStates = |
| 1094 dwStates; | 1094 dwStates; |
| 1095 } | 1095 } |
| 1096 void FWL_SetWidgetStyles(IFWL_Widget* widget, FX_DWORD dwStyles) { | 1096 void FWL_SetWidgetStyles(IFWL_Widget* widget, uint32_t dwStyles) { |
| 1097 static_cast<CFWL_WidgetImp*>(widget->GetImpl())->m_pProperties->m_dwStyles = | 1097 static_cast<CFWL_WidgetImp*>(widget->GetImpl())->m_pProperties->m_dwStyles = |
| 1098 dwStyles; | 1098 dwStyles; |
| 1099 } | 1099 } |
| 1100 FWL_ERR FWL_EnabelWidget(IFWL_Widget* widget, FX_BOOL bEnable) { | 1100 FWL_ERR FWL_EnabelWidget(IFWL_Widget* widget, FX_BOOL bEnable) { |
| 1101 widget->SetStates(FWL_WGTSTATE_Disabled, !bEnable); | 1101 widget->SetStates(FWL_WGTSTATE_Disabled, !bEnable); |
| 1102 IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr(); | 1102 IFWL_WidgetMgr* widgetMgr = FWL_GetWidgetMgr(); |
| 1103 IFWL_Widget* child = widgetMgr->GetWidget(widget, FWL_WGTRELATION_FirstChild); | 1103 IFWL_Widget* child = widgetMgr->GetWidget(widget, FWL_WGTRELATION_FirstChild); |
| 1104 while (child) { | 1104 while (child) { |
| 1105 FWL_EnabelWidget(child, bEnable); | 1105 FWL_EnabelWidget(child, bEnable); |
| 1106 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); | 1106 child = widgetMgr->GetWidget(child, FWL_WGTRELATION_NextSibling); |
| 1107 } | 1107 } |
| 1108 return FWL_ERR_Succeeded; | 1108 return FWL_ERR_Succeeded; |
| 1109 } | 1109 } |
| OLD | NEW |