| 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/cfwl_widget.h" | 7 #include "xfa/fwl/cfwl_widget.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 272 |
| 273 bool CFWL_Widget::IsEnabled() const { | 273 bool CFWL_Widget::IsEnabled() const { |
| 274 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; | 274 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; |
| 275 } | 275 } |
| 276 | 276 |
| 277 bool CFWL_Widget::HasBorder() const { | 277 bool CFWL_Widget::HasBorder() const { |
| 278 return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border); | 278 return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border); |
| 279 } | 279 } |
| 280 | 280 |
| 281 bool CFWL_Widget::HasEdge() const { | 281 bool CFWL_Widget::HasEdge() const { |
| 282 return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_EdgeMask); | 282 return false; |
| 283 } | 283 } |
| 284 | 284 |
| 285 bool CFWL_Widget::IsVisible() const { | 285 bool CFWL_Widget::IsVisible() const { |
| 286 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0; | 286 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0; |
| 287 } | 287 } |
| 288 | 288 |
| 289 bool CFWL_Widget::IsOverLapper() const { | 289 bool CFWL_Widget::IsOverLapper() const { |
| 290 return (m_pProperties->m_dwStyles & FWL_WGTSTYLE_WindowTypeMask) == | 290 return (m_pProperties->m_dwStyles & FWL_WGTSTYLE_WindowTypeMask) == |
| 291 FWL_WGTSTYLE_OverLapper; | 291 FWL_WGTSTYLE_OverLapper; |
| 292 } | 292 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 316 | 316 |
| 317 FX_FLOAT CFWL_Widget::GetBorderSize(bool bCX) { | 317 FX_FLOAT CFWL_Widget::GetBorderSize(bool bCX) { |
| 318 FX_FLOAT* pfBorder = static_cast<FX_FLOAT*>(GetThemeCapacity( | 318 FX_FLOAT* pfBorder = static_cast<FX_FLOAT*>(GetThemeCapacity( |
| 319 bCX ? CFWL_WidgetCapacity::CXBorder : CFWL_WidgetCapacity::CYBorder)); | 319 bCX ? CFWL_WidgetCapacity::CXBorder : CFWL_WidgetCapacity::CYBorder)); |
| 320 if (!pfBorder) | 320 if (!pfBorder) |
| 321 return 0; | 321 return 0; |
| 322 return *pfBorder; | 322 return *pfBorder; |
| 323 } | 323 } |
| 324 | 324 |
| 325 FX_FLOAT CFWL_Widget::GetEdgeWidth() { | 325 FX_FLOAT CFWL_Widget::GetEdgeWidth() { |
| 326 CFWL_WidgetCapacity dwCapacity = CFWL_WidgetCapacity::None; | |
| 327 switch (m_pProperties->m_dwStyles & FWL_WGTSTYLE_EdgeMask) { | |
| 328 case FWL_WGTSTYLE_EdgeFlat: { | |
| 329 dwCapacity = CFWL_WidgetCapacity::EdgeFlat; | |
| 330 break; | |
| 331 } | |
| 332 case FWL_WGTSTYLE_EdgeRaised: { | |
| 333 dwCapacity = CFWL_WidgetCapacity::EdgeRaised; | |
| 334 break; | |
| 335 } | |
| 336 case FWL_WGTSTYLE_EdgeSunken: { | |
| 337 dwCapacity = CFWL_WidgetCapacity::EdgeSunken; | |
| 338 break; | |
| 339 } | |
| 340 } | |
| 341 if (dwCapacity != CFWL_WidgetCapacity::None) { | |
| 342 FX_FLOAT* fRet = static_cast<FX_FLOAT*>(GetThemeCapacity(dwCapacity)); | |
| 343 return fRet ? *fRet : 0; | |
| 344 } | |
| 345 return 0; | 326 return 0; |
| 346 } | 327 } |
| 347 | 328 |
| 348 CFX_RectF CFWL_Widget::GetRelativeRect() { | 329 CFX_RectF CFWL_Widget::GetRelativeRect() { |
| 349 CFX_RectF rect = m_pProperties->m_rtWidget; | 330 CFX_RectF rect = m_pProperties->m_rtWidget; |
| 350 rect.left = 0; | 331 rect.left = 0; |
| 351 rect.top = 0; | 332 rect.top = 0; |
| 352 return rect; | 333 return rect; |
| 353 } | 334 } |
| 354 | 335 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 } | 685 } |
| 705 default: | 686 default: |
| 706 break; | 687 break; |
| 707 } | 688 } |
| 708 } | 689 } |
| 709 | 690 |
| 710 void CFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {} | 691 void CFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {} |
| 711 | 692 |
| 712 void CFWL_Widget::OnDrawWidget(CFX_Graphics* pGraphics, | 693 void CFWL_Widget::OnDrawWidget(CFX_Graphics* pGraphics, |
| 713 const CFX_Matrix* pMatrix) {} | 694 const CFX_Matrix* pMatrix) {} |
| OLD | NEW |