summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fwl/lightwidget/cfwl_scrollbar.cpp108
-rw-r--r--xfa/fwl/lightwidget/cfwl_scrollbar.h32
-rw-r--r--xfa/fwl/lightwidget/cfwl_theme.cpp140
-rw-r--r--xfa/fwl/lightwidget/cfwl_theme.h60
-rw-r--r--xfa/fwl/lightwidget/cfwl_tooltip.cpp125
-rw-r--r--xfa/fwl/lightwidget/cfwl_tooltip.h60
-rw-r--r--xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp21
-rw-r--r--xfa/fwl/lightwidget/cfwl_widgetdelegate.h31
-rw-r--r--xfa/fwl/theme/cfwl_formtp.cpp874
-rw-r--r--xfa/fwl/theme/cfwl_formtp.h113
-rw-r--r--xfa/fxbarcode/BC_ResultPoint.cpp31
-rw-r--r--xfa/fxbarcode/BC_ResultPoint.h25
-rw-r--r--xfa/fxbarcode/common/BC_CommonBitSource.cpp71
-rw-r--r--xfa/fxbarcode/common/BC_CommonBitSource.h28
-rw-r--r--xfa/fxbarcode/common/BC_CommonPerspectiveTransform.cpp152
-rw-r--r--xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h66
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417Codeword.cpp70
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417Codeword.h38
18 files changed, 0 insertions, 2045 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_scrollbar.cpp b/xfa/fwl/lightwidget/cfwl_scrollbar.cpp
deleted file mode 100644
index eb4276c2d1..0000000000
--- a/xfa/fwl/lightwidget/cfwl_scrollbar.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/lightwidget/cfwl_scrollbar.h"
-
-#include <memory>
-
-#include "xfa/fwl/basewidget/ifwl_scrollbar.h"
-
-CFWL_ScrollBar* CFWL_ScrollBar::Create() {
- return new CFWL_ScrollBar;
-}
-
-CFWL_ScrollBar::CFWL_ScrollBar() {}
-
-CFWL_ScrollBar::~CFWL_ScrollBar() {}
-
-FWL_Error CFWL_ScrollBar::Initialize(const CFWL_WidgetProperties* pProperties) {
- if (m_pIface)
- return FWL_Error::Indefinite;
- if (pProperties) {
- *m_pProperties = *pProperties;
- }
- std::unique_ptr<IFWL_ScrollBar> pScrollBar(IFWL_ScrollBar::Create(
- m_pProperties->MakeWidgetImpProperties(nullptr), nullptr));
- FWL_Error ret = pScrollBar->Initialize();
- if (ret != FWL_Error::Succeeded) {
- return ret;
- }
- m_pIface = pScrollBar.release();
- CFWL_Widget::Initialize();
- return FWL_Error::Succeeded;
-}
-
-FX_BOOL CFWL_ScrollBar::IsVertical() {
- if (!m_pIface)
- return FALSE;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->IsVertical();
-}
-
-FWL_Error CFWL_ScrollBar::GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax) {
- if (!m_pIface)
- return FWL_Error::Indefinite;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->GetRange(fMin, fMax);
-}
-
-FWL_Error CFWL_ScrollBar::SetRange(FX_FLOAT fMin, FX_FLOAT fMax) {
- if (!m_pIface)
- return FWL_Error::Indefinite;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->SetRange(fMin, fMax);
-}
-
-FX_FLOAT CFWL_ScrollBar::GetPageSize() {
- if (!m_pIface)
- return 0;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->GetPageSize();
-}
-
-FWL_Error CFWL_ScrollBar::SetPageSize(FX_FLOAT fPageSize) {
- if (!m_pIface)
- return FWL_Error::Indefinite;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->SetPageSize(fPageSize);
-}
-
-FX_FLOAT CFWL_ScrollBar::GetStepSize() {
- if (!m_pIface)
- return 0;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->GetStepSize();
-}
-
-FWL_Error CFWL_ScrollBar::SetStepSize(FX_FLOAT fStepSize) {
- if (!m_pIface)
- return FWL_Error::Indefinite;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->SetStepSize(fStepSize);
-}
-
-FX_FLOAT CFWL_ScrollBar::GetPos() {
- if (!m_pIface)
- return -1;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->GetPos();
-}
-
-FWL_Error CFWL_ScrollBar::SetPos(FX_FLOAT fPos) {
- if (!m_pIface)
- return FWL_Error::Indefinite;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->SetPos(fPos);
-}
-
-FX_FLOAT CFWL_ScrollBar::GetTrackPos() {
- if (!m_pIface)
- return -1;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->GetTrackPos();
-}
-
-FWL_Error CFWL_ScrollBar::SetTrackPos(FX_FLOAT fTrackPos) {
- if (!m_pIface)
- return FWL_Error::Indefinite;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->SetTrackPos(fTrackPos);
-}
-
-FX_BOOL CFWL_ScrollBar::DoScroll(uint32_t dwCode, FX_FLOAT fPos) {
- if (!m_pIface)
- return FALSE;
- return static_cast<IFWL_ScrollBar*>(m_pIface)->DoScroll(dwCode, fPos);
-}
diff --git a/xfa/fwl/lightwidget/cfwl_scrollbar.h b/xfa/fwl/lightwidget/cfwl_scrollbar.h
deleted file mode 100644
index fd80e8b8ab..0000000000
--- a/xfa/fwl/lightwidget/cfwl_scrollbar.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_LIGHTWIDGET_CFWL_SCROLLBAR_H_
-#define XFA_FWL_LIGHTWIDGET_CFWL_SCROLLBAR_H_
-
-#include "xfa/fwl/lightwidget/cfwl_widget.h"
-
-class CFWL_ScrollBar : public CFWL_Widget {
- public:
- static CFWL_ScrollBar* Create();
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
- FX_BOOL IsVertical();
- FWL_Error GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax);
- FWL_Error SetRange(FX_FLOAT fMin, FX_FLOAT fMax);
- FX_FLOAT GetPageSize();
- FWL_Error SetPageSize(FX_FLOAT fPageSize);
- FX_FLOAT GetStepSize();
- FWL_Error SetStepSize(FX_FLOAT fStepSize);
- FX_FLOAT GetPos();
- FWL_Error SetPos(FX_FLOAT fPos);
- FX_FLOAT GetTrackPos();
- FWL_Error SetTrackPos(FX_FLOAT fTrackPos);
- FX_BOOL DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f);
- CFWL_ScrollBar();
- virtual ~CFWL_ScrollBar();
-};
-
-#endif // XFA_FWL_LIGHTWIDGET_CFWL_SCROLLBAR_H_
diff --git a/xfa/fwl/lightwidget/cfwl_theme.cpp b/xfa/fwl/lightwidget/cfwl_theme.cpp
deleted file mode 100644
index 4824667080..0000000000
--- a/xfa/fwl/lightwidget/cfwl_theme.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/lightwidget/cfwl_theme.h"
-
-#include <algorithm>
-
-#include "xfa/fwl/core/cfwl_themebackground.h"
-#include "xfa/fwl/core/cfwl_themepart.h"
-#include "xfa/fwl/core/cfwl_themetext.h"
-#include "xfa/fwl/theme/cfwl_barcodetp.h"
-#include "xfa/fwl/theme/cfwl_carettp.h"
-#include "xfa/fwl/theme/cfwl_checkboxtp.h"
-#include "xfa/fwl/theme/cfwl_comboboxtp.h"
-#include "xfa/fwl/theme/cfwl_datetimepickertp.h"
-#include "xfa/fwl/theme/cfwl_edittp.h"
-#include "xfa/fwl/theme/cfwl_formtp.h"
-#include "xfa/fwl/theme/cfwl_listboxtp.h"
-#include "xfa/fwl/theme/cfwl_monthcalendartp.h"
-#include "xfa/fwl/theme/cfwl_pictureboxtp.h"
-#include "xfa/fwl/theme/cfwl_pushbuttontp.h"
-#include "xfa/fwl/theme/cfwl_scrollbartp.h"
-
-CFWL_Theme::CFWL_Theme() {
- m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_FormTP));
- m_ThemesArray.push_back(
- std::unique_ptr<CFWL_WidgetTP>(new CFWL_PushButtonTP));
- m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_CheckBoxTP));
- m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ListBoxTP));
- m_ThemesArray.push_back(
- std::unique_ptr<CFWL_WidgetTP>(new CFWL_PictureBoxTP));
- m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ScrollBarTP));
- m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_EditTP));
- m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ComboBoxTP));
- m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_BarcodeTP));
- m_ThemesArray.push_back(
- std::unique_ptr<CFWL_WidgetTP>(new CFWL_DateTimePickerTP));
- m_ThemesArray.push_back(
- std::unique_ptr<CFWL_WidgetTP>(new CFWL_MonthCalendarTP));
- m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_CaretTP));
-}
-
-CFWL_Theme::~CFWL_Theme() {}
-
-bool CFWL_Theme::IsValidWidget(IFWL_Widget* pWidget) {
- return !!GetTheme(pWidget);
-}
-
-uint32_t CFWL_Theme::GetThemeID(IFWL_Widget* pWidget) {
- return GetTheme(pWidget)->GetThemeID(pWidget);
-}
-
-uint32_t CFWL_Theme::SetThemeID(IFWL_Widget* pWidget,
- uint32_t dwThemeID,
- FX_BOOL bChildren) {
- uint32_t dwID = 0;
- for (const auto& pTheme : m_ThemesArray) {
- dwID = pTheme->GetThemeID(pWidget);
- pTheme->SetThemeID(pWidget, dwThemeID, FALSE);
- }
- return dwID;
-}
-
-FWL_Error CFWL_Theme::GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) {
- return FWL_Error::Succeeded;
-}
-
-FWL_Error CFWL_Theme::SetThemeMatrix(IFWL_Widget* pWidget,
- const CFX_Matrix& matrix) {
- return FWL_Error::Succeeded;
-}
-
-FX_BOOL CFWL_Theme::DrawBackground(CFWL_ThemeBackground* pParams) {
- return GetTheme(pParams->m_pWidget)->DrawBackground(pParams);
-}
-
-FX_BOOL CFWL_Theme::DrawText(CFWL_ThemeText* pParams) {
- return GetTheme(pParams->m_pWidget)->DrawText(pParams);
-}
-
-void* CFWL_Theme::GetCapacity(CFWL_ThemePart* pThemePart,
- CFWL_WidgetCapacity dwCapacity) {
- return GetTheme(pThemePart->m_pWidget)->GetCapacity(pThemePart, dwCapacity);
-}
-
-FX_BOOL CFWL_Theme::IsCustomizedLayout(IFWL_Widget* pWidget) {
- return GetTheme(pWidget)->IsCustomizedLayout(pWidget);
-}
-
-FWL_Error CFWL_Theme::GetPartRect(CFWL_ThemePart* pThemePart,
- CFX_RectF& rtPart) {
- return GetTheme(pThemePart->m_pWidget)->GetPartRect(pThemePart, rtPart);
-}
-
-FX_BOOL CFWL_Theme::IsInPart(CFWL_ThemePart* pThemePart,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- return GetTheme(pThemePart->m_pWidget)->IsInPart(pThemePart, fx, fy);
-}
-
-FX_BOOL CFWL_Theme::CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) {
- return GetTheme(pParams->m_pWidget)->CalcTextRect(pParams, rect);
-}
-
-FWL_Error CFWL_Theme::Initialize() {
- for (const auto& pTheme : m_ThemesArray)
- pTheme->Initialize();
-
- FWLTHEME_Init();
- return FWL_Error::Succeeded;
-}
-
-FWL_Error CFWL_Theme::Finalize() {
- for (const auto& pTheme : m_ThemesArray)
- pTheme->Finalize();
-
- FWLTHEME_Release();
- return FWL_Error::Succeeded;
-}
-
-FWL_Error CFWL_Theme::SetFont(IFWL_Widget* pWidget,
- const FX_WCHAR* strFont,
- FX_FLOAT fFontSize,
- FX_ARGB rgbFont) {
- for (const auto& pTheme : m_ThemesArray)
- pTheme->SetFont(pWidget, strFont, fFontSize, rgbFont);
-
- return FWL_Error::Succeeded;
-}
-
-CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) {
- for (const auto& pTheme : m_ThemesArray) {
- if (pTheme->IsValidWidget(pWidget))
- return pTheme.get();
- }
- return nullptr;
-}
diff --git a/xfa/fwl/lightwidget/cfwl_theme.h b/xfa/fwl/lightwidget/cfwl_theme.h
deleted file mode 100644
index effb31b04e..0000000000
--- a/xfa/fwl/lightwidget/cfwl_theme.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_LIGHTWIDGET_CFWL_THEME_H_
-#define XFA_FWL_LIGHTWIDGET_CFWL_THEME_H_
-
-#include <memory>
-#include <vector>
-
-#include "core/fxcrt/include/fx_coordinates.h"
-#include "core/fxcrt/include/fx_system.h"
-#include "core/fxge/include/fx_dib.h"
-#include "xfa/fwl/core/ifwl_themeprovider.h"
-
-class CFWL_WidgetTP;
-class IFWL_Widget;
-class CFWL_ThemePart;
-class CFWL_ThemeText;
-
-class CFWL_Theme final : public IFWL_ThemeProvider {
- public:
- CFWL_Theme();
- ~CFWL_Theme() override;
-
- // IFWL_ThemeProvider:
- bool IsValidWidget(IFWL_Widget* pWidget) override;
- uint32_t GetThemeID(IFWL_Widget* pWidget) override;
- uint32_t SetThemeID(IFWL_Widget* pWidget,
- uint32_t dwThemeID,
- FX_BOOL bChildren = TRUE) override;
- FWL_Error GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override;
- FWL_Error SetThemeMatrix(IFWL_Widget* pWidget,
- const CFX_Matrix& matrix) override;
- FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override;
- FX_BOOL DrawText(CFWL_ThemeText* pParams) override;
- void* GetCapacity(CFWL_ThemePart* pThemePart,
- CFWL_WidgetCapacity dwCapacity) override;
- FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) override;
- FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override;
- FX_BOOL IsInPart(CFWL_ThemePart* pThemePart,
- FX_FLOAT fx,
- FX_FLOAT fy) override;
- FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) override;
-
- FWL_Error Initialize();
- FWL_Error Finalize();
- FWL_Error SetFont(IFWL_Widget* pWidget,
- const FX_WCHAR* strFont,
- FX_FLOAT fFontSize,
- FX_ARGB rgbFont);
- CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget);
-
- protected:
- std::vector<std::unique_ptr<CFWL_WidgetTP>> m_ThemesArray;
-};
-
-#endif // XFA_FWL_LIGHTWIDGET_CFWL_THEME_H_
diff --git a/xfa/fwl/lightwidget/cfwl_tooltip.cpp b/xfa/fwl/lightwidget/cfwl_tooltip.cpp
deleted file mode 100644
index 7a9a26cf9e..0000000000
--- a/xfa/fwl/lightwidget/cfwl_tooltip.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/lightwidget/cfwl_tooltip.h"
-
-#include <memory>
-
-#include "xfa/fwl/core/fwl_formimp.h"
-#include "xfa/fwl/core/fwl_noteimp.h"
-#include "xfa/fwl/core/fwl_widgetimp.h"
-
-CFWL_ToolTip* CFWL_ToolTip::Create() {
- return new CFWL_ToolTip;
-}
-
-FWL_Error CFWL_ToolTip::Initialize(const CFWL_WidgetProperties* pProperties) {
- if (m_pIface)
- return FWL_Error::Indefinite;
- if (pProperties) {
- *m_pProperties = *pProperties;
- }
- std::unique_ptr<IFWL_ToolTip> pToolTip(IFWL_ToolTip::Create(
- m_pProperties->MakeWidgetImpProperties(&m_tooltipData), nullptr));
- FWL_Error ret = pToolTip->Initialize();
- if (ret != FWL_Error::Succeeded) {
- return ret;
- }
- m_pIface = pToolTip.release();
- CFWL_Widget::Initialize();
- return FWL_Error::Succeeded;
-}
-
-void CFWL_ToolTip::GetCaption(CFX_WideString& wsCaption) {
- wsCaption = m_tooltipData.m_wsCaption;
-}
-
-void CFWL_ToolTip::SetCaption(const CFX_WideStringC& wsCaption) {
- m_tooltipData.m_wsCaption = wsCaption;
-}
-
-int32_t CFWL_ToolTip::GetInitialDelay() {
- return m_tooltipData.m_nInitDelayTime;
-}
-
-void CFWL_ToolTip::SetInitialDelay(int32_t nDelayTime) {
- m_tooltipData.m_nInitDelayTime = nDelayTime;
-}
-
-int32_t CFWL_ToolTip::GetAutoPopDelay() {
- return m_tooltipData.m_nAutoPopDelayTime;
-}
-
-void CFWL_ToolTip::SetAutoPopDelay(int32_t nDelayTime) {
- m_tooltipData.m_nAutoPopDelayTime = nDelayTime;
-}
-
-CFX_DIBitmap* CFWL_ToolTip::GetToolTipIcon() {
- return m_tooltipData.m_pBitmap;
-}
-
-void CFWL_ToolTip::SetToolTipIcon(CFX_DIBitmap* pBitmap) {
- m_tooltipData.m_pBitmap = pBitmap;
-}
-
-CFX_SizeF CFWL_ToolTip::GetToolTipIconSize() {
- return m_tooltipData.m_fIconSize;
-}
-
-void CFWL_ToolTip::SetToolTipIconSize(CFX_SizeF fSize) {
- m_tooltipData.m_fIconSize = fSize;
-}
-
-void CFWL_ToolTip::SetAnchor(const CFX_RectF& rtAnchor) {
- static_cast<IFWL_ToolTip*>(m_pIface)->SetAnchor(rtAnchor);
-}
-
-void CFWL_ToolTip::Show() {
- static_cast<IFWL_ToolTip*>(m_pIface)->Show();
-}
-
-void CFWL_ToolTip::Hide() {
- static_cast<IFWL_ToolTip*>(m_pIface)->Hide();
-}
-
-CFWL_ToolTip::CFWL_ToolTip() {}
-
-CFWL_ToolTip::~CFWL_ToolTip() {}
-
-CFWL_ToolTip::CFWL_ToolTipDP::CFWL_ToolTipDP() : m_pBitmap(NULL) {
- m_wsCaption = L"";
- m_nInitDelayTime = 500;
- m_nAutoPopDelayTime = 50000;
- m_fAnchor.Set(0.0, 0.0, 0.0, 0.0);
-}
-
-FWL_Error CFWL_ToolTip::CFWL_ToolTipDP::GetCaption(IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) {
- wsCaption = m_wsCaption;
- return FWL_Error::Succeeded;
-}
-
-int32_t CFWL_ToolTip::CFWL_ToolTipDP::GetInitialDelay(IFWL_Widget* pWidget) {
- return m_nInitDelayTime;
-}
-
-int32_t CFWL_ToolTip::CFWL_ToolTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) {
- return m_nAutoPopDelayTime;
-}
-
-CFX_DIBitmap* CFWL_ToolTip::CFWL_ToolTipDP::GetToolTipIcon(
- IFWL_Widget* pWidget) {
- return m_pBitmap;
-}
-
-CFX_SizeF CFWL_ToolTip::CFWL_ToolTipDP::GetToolTipIconSize(
- IFWL_Widget* pWidget) {
- return m_fIconSize;
-}
-
-CFX_RectF CFWL_ToolTip::CFWL_ToolTipDP::GetAnchor() {
- return m_fAnchor;
-}
diff --git a/xfa/fwl/lightwidget/cfwl_tooltip.h b/xfa/fwl/lightwidget/cfwl_tooltip.h
deleted file mode 100644
index 74f702849c..0000000000
--- a/xfa/fwl/lightwidget/cfwl_tooltip.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_LIGHTWIDGET_CFWL_TOOLTIP_H_
-#define XFA_FWL_LIGHTWIDGET_CFWL_TOOLTIP_H_
-
-#include "xfa/fwl/basewidget/ifwl_tooltip.h"
-#include "xfa/fwl/lightwidget/cfwl_widget.h"
-
-class CFWL_ToolTip : public CFWL_Widget {
- public:
- static CFWL_ToolTip* Create();
-
- CFWL_ToolTip();
- virtual ~CFWL_ToolTip();
-
- FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
-
- void GetCaption(CFX_WideString& wsCaption);
- void SetCaption(const CFX_WideStringC& wsCaption);
-
- int32_t GetInitialDelay();
- void SetInitialDelay(int32_t nDelayTime);
-
- int32_t GetAutoPopDelay();
- void SetAutoPopDelay(int32_t nDelayTime);
-
- CFX_DIBitmap* GetToolTipIcon();
- void SetToolTipIcon(CFX_DIBitmap* pBitmap);
- CFX_SizeF GetToolTipIconSize();
- void SetToolTipIconSize(CFX_SizeF fSize);
-
- void SetAnchor(const CFX_RectF& rtAnchor);
- void Show();
- void Hide();
-
- protected:
- class CFWL_ToolTipDP : public IFWL_ToolTipDP {
- public:
- CFWL_ToolTipDP();
- FWL_Error GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
- int32_t GetInitialDelay(IFWL_Widget* pWidget);
- int32_t GetAutoPopDelay(IFWL_Widget* pWidget);
- CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget);
- CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget);
- CFX_RectF GetAnchor();
- CFX_WideString m_wsCaption;
- int32_t m_nInitDelayTime;
- int32_t m_nAutoPopDelayTime;
- CFX_DIBitmap* m_pBitmap;
- CFX_SizeF m_fIconSize;
- CFX_RectF m_fAnchor;
- };
- CFWL_ToolTipDP m_tooltipData;
-};
-
-#endif // XFA_FWL_LIGHTWIDGET_CFWL_TOOLTIP_H_
diff --git a/xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp b/xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp
deleted file mode 100644
index fcb7232622..0000000000
--- a/xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/lightwidget/cfwl_widgetdelegate.h"
-
-#include "xfa/fwl/core/cfwl_event.h"
-#include "xfa/fwl/core/cfwl_message.h"
-
-CFWL_WidgetDelegate::CFWL_WidgetDelegate() {}
-
-CFWL_WidgetDelegate::~CFWL_WidgetDelegate() {}
-
-void CFWL_WidgetDelegate::OnProcessMessage(CFWL_Message* pMessage) {}
-
-void CFWL_WidgetDelegate::OnProcessEvent(CFWL_Event* pEvent) {}
-
-void CFWL_WidgetDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {}
diff --git a/xfa/fwl/lightwidget/cfwl_widgetdelegate.h b/xfa/fwl/lightwidget/cfwl_widgetdelegate.h
deleted file mode 100644
index 1f5cdab8f4..0000000000
--- a/xfa/fwl/lightwidget/cfwl_widgetdelegate.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_LIGHTWIDGET_CFWL_WIDGETDELEGATE_H_
-#define XFA_FWL_LIGHTWIDGET_CFWL_WIDGETDELEGATE_H_
-
-#include <stdint.h>
-
-#include "xfa/fwl/core/fwl_error.h"
-#include "xfa/fwl/core/ifwl_widgetdelegate.h"
-
-class CFWL_Event;
-class CFWL_Message;
-class CFX_Graphics;
-class CFX_Matrix;
-
-class CFWL_WidgetDelegate : public IFWL_WidgetDelegate {
- public:
- CFWL_WidgetDelegate();
- virtual ~CFWL_WidgetDelegate();
-
- void OnProcessMessage(CFWL_Message* pMessage) override;
- void OnProcessEvent(CFWL_Event* pEvent) override;
- void OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = nullptr) override;
-};
-
-#endif // XFA_FWL_LIGHTWIDGET_CFWL_WIDGETDELEGATE_H_
diff --git a/xfa/fwl/theme/cfwl_formtp.cpp b/xfa/fwl/theme/cfwl_formtp.cpp
deleted file mode 100644
index 033375911b..0000000000
--- a/xfa/fwl/theme/cfwl_formtp.cpp
+++ /dev/null
@@ -1,874 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/theme/cfwl_formtp.h"
-
-#include "xfa/fde/tto/fde_textout.h"
-#include "xfa/fwl/core/cfwl_themebackground.h"
-#include "xfa/fwl/core/cfwl_themepart.h"
-#include "xfa/fwl/core/cfwl_themetext.h"
-#include "xfa/fwl/core/ifwl_form.h"
-#include "xfa/fwl/core/ifwl_themeprovider.h"
-#include "xfa/fwl/core/ifwl_widget.h"
-#include "xfa/fxgraphics/cfx_color.h"
-#include "xfa/fxgraphics/cfx_path.h"
-
-namespace {
-
-const int kCXFormBorder = 3;
-const int kCYFormBorder = 3;
-const int kCYCaption = 29;
-const int kFormBigIconSize = 32;
-const int kFormSmallIconSize = 16;
-const uint32_t kFormTextColor = 0xFFFFFFFF;
-
-const int kButtonSize = 21;
-const int kButtonMargin = 5;
-const int kButtonSpan = 2;
-
-} // namespace
-
-CFWL_FormTP::CFWL_FormTP() : m_pActiveBitmap(NULL), m_pDeactivebitmap(NULL) {
- m_pThemeData = new SBThemeData;
- SetThemeData(0);
- m_rtDisLBorder.Reset();
- m_rtDisRBorder.Reset();
- m_rtDisBBorder.Reset();
- m_rtDisCaption.Reset();
-}
-
-CFWL_FormTP::~CFWL_FormTP() {
- delete m_pThemeData;
-}
-
-FWL_Error CFWL_FormTP::Initialize() {
- InitTTO();
- InitCaption(TRUE);
- InitCaption(FALSE);
- return CFWL_WidgetTP::Initialize();
-}
-
-FWL_Error CFWL_FormTP::Finalize() {
- FinalizeTTO();
- delete m_pActiveBitmap;
- m_pActiveBitmap = nullptr;
- delete m_pDeactivebitmap;
- m_pDeactivebitmap = nullptr;
- return CFWL_WidgetTP::Finalize();
-}
-
-bool CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) {
- return pWidget && pWidget->GetClassID() == FWL_Type::Form;
-}
-
-uint32_t CFWL_FormTP::SetThemeID(IFWL_Widget* pWidget,
- uint32_t dwThemeID,
- FX_BOOL bChildren) {
- if (m_pThemeData) {
- SetThemeData(FWL_GetThemeColor(dwThemeID));
- }
- InitCaption(TRUE);
- InitCaption(FALSE);
- return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren);
-}
-FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground* pParams) {
- if (!pParams)
- return FALSE;
- int32_t iActive = 0;
- if (pParams->m_dwStates & CFWL_PartState_Inactive)
- iActive = 1;
-
- FWLTHEME_STATE eState = FWLTHEME_STATE_Normal;
- if (pParams->m_dwStates & CFWL_PartState_Hovered)
- eState = FWLTHEME_STATE_Hover;
- else if (pParams->m_dwStates & CFWL_PartState_Pressed)
- eState = FWLTHEME_STATE_Pressed;
- else if (pParams->m_dwStates & CFWL_PartState_Disabled)
- eState = FWLTHEME_STATE_Disabale;
-
- switch (pParams->m_iPart) {
- case CFWL_Part::Border: {
- DrawFormBorder(pParams->m_pGraphics, &pParams->m_rtPart, eState,
- &pParams->m_matrix, iActive);
- break;
- }
- case CFWL_Part::Edge: {
- DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(),
- &pParams->m_rtPart, &pParams->m_matrix);
- break;
- }
- case CFWL_Part::Background: {
- FillBackground(pParams->m_pGraphics, &pParams->m_rtPart,
- &pParams->m_matrix);
- break;
- }
- case CFWL_Part::Caption: {
- DrawCaption(pParams->m_pGraphics, &pParams->m_rtPart, eState,
- &pParams->m_matrix, iActive);
- break;
- }
- case CFWL_Part::NarrowCaption: {
- DrawNarrowCaption(pParams->m_pGraphics, &pParams->m_rtPart, eState,
- &pParams->m_matrix, iActive);
- break;
- }
- case CFWL_Part::CloseBox: {
- DrawCloseBox(pParams->m_pGraphics, &pParams->m_rtPart, eState,
- &pParams->m_matrix, iActive);
- break;
- }
- case CFWL_Part::MinimizeBox: {
- DrawMinimizeBox(pParams->m_pGraphics, &pParams->m_rtPart, eState,
- &pParams->m_matrix, iActive);
- break;
- }
- case CFWL_Part::MaximizeBox: {
- DrawMaximizeBox(pParams->m_pGraphics, &pParams->m_rtPart, eState,
- pParams->m_bMaximize, &pParams->m_matrix, iActive);
- break;
- }
- case CFWL_Part::Icon: {
- DrawIconImage(pParams->m_pGraphics, pParams->m_pImage, &pParams->m_rtPart,
- eState, &pParams->m_matrix, iActive);
- break;
- }
- default: {}
- }
- return TRUE;
-}
-FX_BOOL CFWL_FormTP::DrawText(CFWL_ThemeText* pParams) {
- if (!m_pTextOut)
- return FALSE;
- if (pParams->m_iPart == CFWL_Part::Caption) {
- m_pTextOut->SetTextColor(0xFFFFFFFF);
- } else {
- m_pTextOut->SetTextColor(0xFF000000);
- }
- return CFWL_WidgetTP::DrawText(pParams);
-}
-void* CFWL_FormTP::GetCapacity(CFWL_ThemePart* pThemePart,
- CFWL_WidgetCapacity dwCapacity) {
- FX_BOOL bDefPro = FALSE;
- FX_BOOL bDwordVal = FALSE;
- switch (dwCapacity) {
- case CFWL_WidgetCapacity::CXBorder: {
- m_fValue = kCXFormBorder;
- break;
- }
- case CFWL_WidgetCapacity::CYBorder: {
- m_fValue = kCYFormBorder;
- break;
- }
- case CFWL_WidgetCapacity::CYCaption: {
- m_fValue = kCYCaption;
- break;
- }
- case CFWL_WidgetCapacity::CYNarrowCaption: {
- m_fValue = kCYCaption;
- break;
- }
- case CFWL_WidgetCapacity::TextColor: {
- bDwordVal = TRUE;
- m_dwValue = kFormTextColor;
- break;
- }
- case CFWL_WidgetCapacity::BigIcon: {
- m_fValue = kFormBigIconSize;
- break;
- }
- case CFWL_WidgetCapacity::SmallIcon: {
- m_fValue = kFormSmallIconSize;
- break;
- }
- default: { bDefPro = TRUE; }
- }
- if (!bDefPro) {
- if (bDwordVal) {
- return &m_dwValue;
- }
- return &m_fValue;
- }
- return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity);
-}
-FWL_Error CFWL_FormTP::GetPartRect(CFWL_ThemePart* pThemePart,
- CFX_RectF& rtPart) {
- switch (pThemePart->m_iPart) {
- case CFWL_Part::CloseBox: {
- CalCloseBox(pThemePart->m_pWidget, rtPart);
- break;
- }
- case CFWL_Part::MaximizeBox: {
- CalMaxBox(pThemePart->m_pWidget, rtPart);
- break;
- }
- case CFWL_Part::MinimizeBox: {
- CalMinBox(pThemePart->m_pWidget, rtPart);
- break;
- }
- case CFWL_Part::HeadText: {
- CalCaption(pThemePart->m_pWidget, rtPart);
- break;
- }
- case CFWL_Part::Icon: {
- CalIcon(pThemePart->m_pWidget, rtPart);
- break;
- }
- default: {}
- }
- return FWL_Error::Succeeded;
-}
-void CFWL_FormTP::CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect) {
- uint32_t dwStyles = pWidget->GetStyles();
- CFX_RectF rtWidget;
- pWidget->GetWidgetRect(rtWidget);
- rtWidget.Offset(-rtWidget.left, -rtWidget.top);
- if (dwStyles & FWL_WGTSTYLE_CloseBox) {
- rect.Set(rtWidget.left + kButtonMargin + kButtonSpan,
- rtWidget.top + kButtonMargin, kButtonSize, kButtonSize);
- } else {
- rect.Set(rtWidget.left + kButtonMargin + kButtonSpan,
- rtWidget.top + kButtonMargin, 0, 0);
- }
-}
-void CFWL_FormTP::CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect) {
- uint32_t dwStyles = pWidget->GetStyles();
- CFX_RectF rtWidget;
- pWidget->GetWidgetRect(rtWidget);
- rtWidget.Offset(-rtWidget.left, -rtWidget.top);
- if (dwStyles & FWL_WGTSTYLE_MaximizeBox) {
- rect.Set(rtWidget.left + kButtonMargin + kButtonSize + kButtonSpan * 2,
- rtWidget.top + kButtonMargin, kButtonSize, kButtonSize);
- } else {
- rect.Set(rtWidget.left + kButtonMargin + kButtonSize + kButtonSpan * 2,
- rtWidget.top + kButtonMargin, 0, 0);
- }
-}
-void CFWL_FormTP::CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect) {
- uint32_t dwStyles = pWidget->GetStyles();
- CFX_RectF rtWidget;
- pWidget->GetWidgetRect(rtWidget);
- rtWidget.Offset(-rtWidget.left, -rtWidget.top);
- if (dwStyles & FWL_WGTSTYLE_MinimizeBox) {
- rect.Set(rtWidget.left + kButtonMargin + kButtonSize * 2 + kButtonSpan * 3,
- rtWidget.top + kButtonMargin, kButtonSize, kButtonSize);
- } else {
- rect.Set(rtWidget.left + kButtonMargin + kButtonSize * 2 + kButtonSpan * 3,
- rtWidget.top + kButtonMargin, 0, 0);
- }
-}
-void CFWL_FormTP::CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect) {
- CFX_RectF rtWidget;
- pWidget->GetWidgetRect(rtWidget);
- rtWidget.Offset(-rtWidget.left, -rtWidget.top);
- rect.Set(rtWidget.left + kButtonMargin, rtWidget.top + kButtonMargin - 2,
- rtWidget.width - kButtonMargin * 2,
- kButtonSize + 2 * kButtonMargin + 4);
-}
-void CFWL_FormTP::CalIcon(IFWL_Widget* pWidget, CFX_RectF& rect) {}
-void CFWL_FormTP::DrawFormBorder(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive) {
- CFX_RectF rt;
- rt.Set(pRect->left, pRect->top, 1, pRect->height);
- FX_FLOAT fBottom, fRight;
- fBottom = pRect->bottom();
- fRight = pRect->right();
- CFX_Path path;
- path.Create();
- CFX_Color clrLine;
- path.Clear();
- path.MoveTo(pRect->left, pRect->top);
- path.LineTo(pRect->left, fBottom - 1);
- path.LineTo(fRight - 1, fBottom - 1);
- path.LineTo(fRight - 1, pRect->top);
- clrLine = m_pThemeData->clrFormBorder[iActive][2];
- pGraphics->SetStrokeColor(&clrLine);
- pGraphics->StrokePath(&path, pMatrix);
- path.Clear();
- path.MoveTo(pRect->left + 1, pRect->top);
- path.LineTo(pRect->left + 1, fBottom - 2);
- path.LineTo(fRight - 2, fBottom - 2);
- path.LineTo(fRight - 2, pRect->top);
- clrLine = m_pThemeData->clrFormBorder[iActive][1];
- pGraphics->SetStrokeColor(&clrLine);
- pGraphics->StrokePath(&path, pMatrix);
- path.Clear();
- path.MoveTo(pRect->left + 2, pRect->top);
- path.LineTo(pRect->left + 2, fBottom - 3);
- path.LineTo(fRight - 3, fBottom - 3);
- path.LineTo(fRight - 3, pRect->top);
- clrLine = m_pThemeData->clrFormBorder[iActive][0];
- pGraphics->SetStrokeColor(&clrLine);
- pGraphics->StrokePath(&path, pMatrix);
- path.Clear();
- path.MoveTo(pRect->left + 3, pRect->top);
- path.LineTo(pRect->left + 3, fBottom - 4);
- path.LineTo(fRight - 4, fBottom - 4);
- path.LineTo(fRight - 4, pRect->top);
- clrLine = m_pThemeData->clrFormBorder[iActive][4];
- pGraphics->SetStrokeColor(&clrLine);
- pGraphics->StrokePath(&path, pMatrix);
- m_rtDisLBorder.Set(pRect->left, pRect->top + 29, 4, pRect->height - 29);
- m_rtDisRBorder.Set(pRect->right() - 4, pRect->top + 29, 4,
- pRect->height - 29);
- m_rtDisBBorder.Set(pRect->left, pRect->bottom() - 4, pRect->width, 4);
- m_rtDisCaption.Set(pRect->left, pRect->top, pRect->width, 29);
-}
-void CFWL_FormTP::DrawCaption(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive) {
- CFX_RectF rt;
- FX_FLOAT fBottom, fRight;
- fBottom = pRect->bottom();
- fRight = pRect->right();
- rt.Set(pRect->left, pRect->top, pRect->width, 1);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][0], &rt,
- pMatrix);
- rt.Offset(0, 1);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][1], &rt,
- pMatrix);
- rt.Offset(0, 1);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][2], &rt,
- pMatrix);
- rt.Set(pRect->left, pRect->bottom() - 1, pRect->width, 1);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeBottom[iActive][2], &rt,
- pMatrix);
- rt.Offset(0, -1);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeBottom[iActive][1], &rt,
- pMatrix);
- rt.Set(pRect->left, pRect->top, 1, pRect->height);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][2], &rt,
- pMatrix);
- rt.Set(pRect->left + 1, pRect->top + 1, 1, fBottom - 1);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][1], &rt,
- pMatrix);
- rt.Set(pRect->left + 2, pRect->top + 2, 1, fBottom - 2);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][0], &rt,
- pMatrix);
- rt.Set(fRight - 1, pRect->top, pRect->width, pRect->height);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][2], &rt,
- pMatrix);
- rt.Set(fRight - 2, pRect->top + 1, 1, fBottom - 1);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][1], &rt,
- pMatrix);
- rt.Set(fRight - 3, pRect->top + 2, 1, fBottom - 2);
- FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][0], &rt,
- pMatrix);
- CFX_RectF rect(*pRect);
- rect.Set(rect.left + 3, rect.top + 3, rect.width - 6, rect.height - 5);
- if (iActive == 0) {
- pGraphics->StretchImage(m_pActiveBitmap, rect, pMatrix);
- } else {
- pGraphics->StretchImage(m_pDeactivebitmap, rect, pMatrix);
- }
-}
-void CFWL_FormTP::DrawNarrowCaption(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive) {}
-void CFWL_FormTP::DrawCloseBox(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive) {
- FX_FLOAT fRight = pRect->right();
- FX_FLOAT fBottom = pRect->bottom();
- FX_FLOAT fWidth = pRect->width;
- FX_FLOAT fHeight = pRect->height;
- pGraphics->SaveGraphState();
- CFX_RectF rt(*pRect);
- pGraphics->SetLineWidth(1.0f);
- CFX_Path path;
- path.Create();
- path.AddRectangle(rt.left + 1, rt.top, fWidth - 2, 1);
- path.AddRectangle(rt.left, rt.top + 1, 1, fHeight - 2);
- path.AddRectangle(fRight - 1, rt.top + 1, 1, fHeight - 2);
- path.AddRectangle(rt.left + 1, fBottom - 1, fWidth - 2, 1);
- CFX_Color crFill;
- crFill = m_pThemeData->clrBtnEdgeOut[iActive];
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- path.Clear();
- path.AddRectangle(rt.left + 1, rt.top + 1, 1, 1);
- path.AddRectangle(fRight - 2, rt.top + 1, 1, 1);
- path.AddRectangle(rt.left + 1, fBottom - 2, 1, 1);
- path.AddRectangle(fRight - 2, fBottom - 2, 1, 1);
- crFill = m_pThemeData->clrBtnCornerLight[iActive][eState - 1];
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- path.Clear();
- path.AddRectangle(rt.left + 2, rt.top + 1, fWidth - 4, 1);
- path.AddRectangle(rt.left + 1, rt.top + 2, 1, fHeight - 4);
- crFill = m_pThemeData->clrCloseBtEdgeLight[iActive][eState - 1];
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- path.Clear();
- path.AddRectangle(fRight - 2, rt.top + 2, 1, fHeight - 4);
- path.AddRectangle(rt.left + 2, fBottom - 2, fWidth - 4, 1);
- crFill = m_pThemeData->clrCloseBtEdgeDark[iActive][eState - 1];
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- path.Clear();
- path.AddRectangle(pRect->left + 2, pRect->top + 2, fWidth - 4, fHeight - 4);
- DrawAxialShading(pGraphics, pRect->left + 2, pRect->top + 2, fRight - 2,
- fBottom - 2,
- m_pThemeData->clrCloseBtBKStart[iActive][eState - 1],
- m_pThemeData->clrCloseBtBKEnd[iActive][eState - 1], &path,
- FXFILL_WINDING, pMatrix);
- CFX_RectF rtX(*pRect);
- rtX.Inflate(-5, -5);
- path.Clear();
- FX_FLOAT frtXRight = rtX.right();
- FX_FLOAT frtXBottom = rtX.bottom();
- path.AddLine(rtX.left, rtX.top + 1, frtXRight - 1, frtXBottom);
- path.AddLine(rtX.left, rtX.top, frtXRight, frtXBottom);
- path.AddLine(rtX.left + 1, rtX.top, frtXRight, frtXBottom - 1);
- path.AddLine(rtX.left, frtXBottom - 1, frtXRight - 1, rtX.top);
- path.AddLine(rtX.left, frtXBottom, frtXRight, rtX.top);
- path.AddLine(rtX.left + 1, frtXBottom, frtXRight, rtX.top + 1);
- CFX_Color clrLine(0xffffffff);
- pGraphics->SetLineWidth(1.0f);
- pGraphics->SetStrokeColor(&clrLine);
- pGraphics->StrokePath(&path, pMatrix);
- pGraphics->RestoreGraphState();
-}
-void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive) {
- pGraphics->SaveGraphState();
- FX_FLOAT fRight = pRect->right();
- FX_FLOAT fBottom = pRect->bottom();
- FX_FLOAT fWidth = pRect->width;
- FX_FLOAT fHeight = pRect->height;
- CFX_RectF rt(*pRect);
- pGraphics->SetLineWidth(1.0f);
- CFX_Path path;
- path.Create();
- path.AddRectangle(rt.left + 1, rt.top, fWidth - 2, 1);
- path.AddRectangle(rt.left, rt.top + 1, 1, fHeight - 2);
- path.AddRectangle(fRight - 1, rt.top + 1, 1, fHeight - 2);
- path.AddRectangle(rt.left + 1, fBottom - 1, fWidth - 2, 1);
- CFX_Color crFill;
- crFill = m_pThemeData->clrBtnEdgeOut[iActive];
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- path.Clear();
- path.AddRectangle(rt.left + 1, rt.top + 1, 1, 1);
- path.AddRectangle(fRight - 2, rt.top + 1, 1, 1);
- path.AddRectangle(rt.left + 1, fBottom - 2, 1, 1);
- path.AddRectangle(fRight - 2, fBottom - 2, 1, 1);
- crFill = m_pThemeData->clrBtnCornerLight[iActive][eState - 1];
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- path.Clear();
- path.AddRectangle(rt.left + 2, rt.top + 1, fWidth - 4, 1);
- path.AddRectangle(rt.left + 1, rt.top + 2, 1, fHeight - 4);
- crFill = m_pThemeData->clrNormalBtEdgeLight[iActive][eState - 1];
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- path.Clear();
- path.AddRectangle(fRight - 2, rt.top + 2, 1, fHeight - 4);
- path.AddRectangle(rt.left + 2, fBottom - 2, fWidth - 4, 1);
- crFill = m_pThemeData->clrNormalBtEdgeDark[iActive][eState - 1];
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- pGraphics->RestoreGraphState();
- path.Clear();
- path.AddRectangle(pRect->left + 2, pRect->top + 2, fWidth - 4, fHeight - 4);
- DrawAxialShading(pGraphics, pRect->left + 2, pRect->top + 2, fRight - 2,
- fBottom - 2,
- m_pThemeData->clrNormalBtBKStart[iActive][eState - 1],
- m_pThemeData->clrNormalBtBKEnd[iActive][eState - 1], &path,
- FXFILL_WINDING, pMatrix);
-}
-void CFWL_FormTP::DrawMinimizeBox(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive) {
- DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix);
- CFX_RectF rtMin;
- rtMin.Set(pRect->left + 5, pRect->top + 13, pRect->width - 14,
- pRect->height - 18);
- FillSoildRect(pGraphics, 0xFFFFFFFF, &rtMin, pMatrix);
-}
-void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- bool bMax,
- CFX_Matrix* pMatrix,
- int32_t iActive) {
- DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix);
- FX_FLOAT fWidth = pRect->width;
- FX_FLOAT fHeight = pRect->height;
- if (bMax) {
- CFX_Path path;
- path.Create();
- path.AddLine(pRect->left + 7, pRect->top + 6, pRect->left + 14,
- pRect->top + 6);
- path.AddLine(pRect->left + 4, pRect->top + 9, pRect->left + 11,
- pRect->top + 9);
- pGraphics->SaveGraphState();
- pGraphics->SetLineWidth(2);
- CFX_Color crStroke(0xFFFFFFFF);
- pGraphics->SetStrokeColor(&crStroke);
- pGraphics->StrokePath(&path, pMatrix);
- pGraphics->SetLineWidth(1);
- path.Clear();
- path.AddLine(pRect->left + 4, pRect->top + 10, pRect->left + 4,
- pRect->top + 14);
- path.AddLine(pRect->left + 10, pRect->top + 10, pRect->left + 10,
- pRect->top + 14);
- path.AddLine(pRect->left + 13, pRect->top + 7, pRect->left + 13,
- pRect->top + 11);
- path.AddLine(pRect->left + 4, pRect->top + 14, pRect->left + 10,
- pRect->top + 14);
- path.AddLine(pRect->left + 12, pRect->top + 11, pRect->left + 12,
- pRect->top + 11);
- pGraphics->StrokePath(&path, pMatrix);
- pGraphics->RestoreGraphState();
- } else {
- CFX_RectF rtMax(*pRect);
- rtMax.Inflate(-5, -5);
- CFX_Path path;
- path.Create();
- path.AddRectangle(pRect->left + 5, pRect->top + 5, fWidth - 10,
- fHeight - 10);
- path.AddRectangle(pRect->left + 6, pRect->top + 8, fWidth - 12,
- fHeight - 14);
- pGraphics->SaveGraphState();
- CFX_Color crFill(0xFFFFFFFF);
- pGraphics->SetFillColor(&crFill);
- pGraphics->FillPath(&path, FXFILL_ALTERNATE, pMatrix);
- pGraphics->RestoreGraphState();
- }
-}
-void CFWL_FormTP::DrawIconImage(CFX_Graphics* pGraphics,
- CFX_DIBitmap* pDIBitmap,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive) {
- pGraphics->StretchImage(pDIBitmap, *pRect, pMatrix);
-}
-void CFWL_FormTP::SetThemeData(uint32_t dwID) {
- m_pThemeData->clrTransWhite = ArgbEncode(0x65, 255, 255, 255);
- m_pThemeData->clrCloseBtBKStart[0][0] = ArgbEncode(0xff, 240, 166, 148);
- m_pThemeData->clrCloseBtBKEnd[0][0] = ArgbEncode(0xff, 228, 61, 5);
- m_pThemeData->clrCloseBtBKStart[0][1] = ArgbEncode(0xff, 255, 184, 176);
- m_pThemeData->clrCloseBtBKEnd[0][1] = ArgbEncode(0xff, 252, 107, 71);
- m_pThemeData->clrCloseBtBKStart[0][2] = ArgbEncode(0xff, 141, 44, 20);
- m_pThemeData->clrCloseBtBKEnd[0][2] = ArgbEncode(0xff, 202, 72, 33);
- m_pThemeData->clrCloseBtEdgeLight[0][0] = ArgbEncode(0xff, 255, 122, 107);
- m_pThemeData->clrCloseBtEdgeDark[0][0] = ArgbEncode(0xff, 218, 77, 54);
- m_pThemeData->clrCloseBtEdgeLight[0][1] = ArgbEncode(0xff, 255, 93, 74);
- m_pThemeData->clrCloseBtEdgeDark[0][1] = ArgbEncode(0xff, 218, 74, 51);
- m_pThemeData->clrCloseBtEdgeLight[0][2] = ArgbEncode(0xff, 191, 61, 28);
- m_pThemeData->clrCloseBtEdgeDark[0][2] = ArgbEncode(0xff, 93, 30, 13);
- if (dwID) {
- m_pThemeData->clrHeadBK[0][0] = ArgbEncode(0xff, 194, 205, 149);
- m_pThemeData->clrHeadBK[0][1] = ArgbEncode(0xff, 170, 184, 131);
- m_pThemeData->clrHeadBK[0][2] = ArgbEncode(0xff, 168, 182, 128);
- m_pThemeData->clrHeadBK[0][3] = ArgbEncode(0xff, 194, 205, 149);
- m_pThemeData->clrHeadEdgeLeft[0][0] = ArgbEncode(0xff, 117, 141, 94);
- m_pThemeData->clrHeadEdgeLeft[0][1] = ArgbEncode(0xff, 139, 161, 105);
- m_pThemeData->clrHeadEdgeLeft[0][2] = ArgbEncode(0xff, 171, 189, 133);
- m_pThemeData->clrHeadEdgeRight[0][0] = ArgbEncode(0xff, 155, 175, 125);
- m_pThemeData->clrHeadEdgeRight[0][1] = ArgbEncode(0xff, 128, 146, 103);
- m_pThemeData->clrHeadEdgeRight[0][2] = ArgbEncode(0xff, 94, 118, 79);
- m_pThemeData->clrHeadEdgeTop[0][0] = ArgbEncode(0xff, 139, 161, 105);
- m_pThemeData->clrHeadEdgeTop[0][1] = ArgbEncode(0xff, 234, 245, 201);
- m_pThemeData->clrHeadEdgeTop[0][2] = ArgbEncode(0xff, 194, 205, 149);
- m_pThemeData->clrHeadEdgeBottom[0][0] = ArgbEncode(0xff, 175, 189, 133);
- m_pThemeData->clrHeadEdgeBottom[0][1] = ArgbEncode(0xff, 153, 168, 121);
- m_pThemeData->clrHeadEdgeBottom[0][2] = ArgbEncode(0xff, 150, 168, 103);
- m_pThemeData->clrNormalBtBKStart[0][0] = ArgbEncode(0xff, 182, 195, 162);
- m_pThemeData->clrNormalBtBKEnd[0][0] = ArgbEncode(0xff, 128, 144, 84);
- m_pThemeData->clrNormalBtBKStart[0][1] = ArgbEncode(0xff, 234, 241, 208);
- m_pThemeData->clrNormalBtBKEnd[0][1] = ArgbEncode(0xff, 169, 186, 112);
- m_pThemeData->clrNormalBtBKStart[0][2] = ArgbEncode(0xff, 199, 199, 190);
- m_pThemeData->clrNormalBtBKEnd[0][2] = ArgbEncode(0xff, 133, 148, 88);
- m_pThemeData->clrNormalBtEdgeLight[0][0] = ArgbEncode(0xff, 163, 176, 137);
- m_pThemeData->clrNormalBtEdgeDark[0][0] = ArgbEncode(0xff, 118, 135, 83);
- m_pThemeData->clrNormalBtEdgeLight[0][1] = ArgbEncode(0xff, 154, 174, 105);
- m_pThemeData->clrNormalBtEdgeDark[0][1] = ArgbEncode(0xff, 154, 174, 105);
- m_pThemeData->clrNormalBtEdgeLight[0][2] = ArgbEncode(0xff, 172, 193, 123);
- m_pThemeData->clrNormalBtEdgeDark[0][2] = ArgbEncode(0xff, 154, 174, 105);
- m_pThemeData->clrBtnCornerLight[0][0] = ArgbEncode(0xff, 220, 220, 220);
- m_pThemeData->clrBtnCornerLight[0][1] = ArgbEncode(0xff, 255, 255, 255);
- m_pThemeData->clrBtnCornerLight[0][2] = ArgbEncode(0xff, 225, 225, 225);
- m_pThemeData->clrBtnEdgeOut[0] = ArgbEncode(0xff, 255, 255, 255);
- m_pThemeData->clrFormBorder[0][0] = ArgbEncode(0xff, 117, 141, 94);
- m_pThemeData->clrFormBorder[0][1] = ArgbEncode(0xff, 139, 161, 105);
- m_pThemeData->clrFormBorder[0][2] = ArgbEncode(0xff, 171, 189, 133);
- m_pThemeData->clrFormBorder[0][3] = ArgbEncode(0xff, 164, 178, 127);
- m_pThemeData->clrFormBorder[0][4] = ArgbEncode(0xff, 255, 255, 255);
- m_pThemeData->clrFormBorderLight[0] = ArgbEncode(0xff, 171, 189, 133);
- } else {
- m_pThemeData->clrHeadBK[0][0] = ArgbEncode(0xff, 3, 114, 255);
- m_pThemeData->clrHeadBK[0][1] = ArgbEncode(0xff, 0, 85, 226);
- m_pThemeData->clrHeadBK[0][2] = ArgbEncode(0xff, 0, 85, 226);
- m_pThemeData->clrHeadBK[0][3] = ArgbEncode(0xff, 3, 114, 255);
- m_pThemeData->clrHeadEdgeLeft[0][2] = ArgbEncode(0xff, 0, 32, 200);
- m_pThemeData->clrHeadEdgeLeft[0][1] = ArgbEncode(0xff, 0, 61, 220);
- m_pThemeData->clrHeadEdgeLeft[0][0] = ArgbEncode(0xff, 0, 54, 210);
- m_pThemeData->clrHeadEdgeRight[0][0] = ArgbEncode(0xff, 0, 56, 234);
- m_pThemeData->clrHeadEdgeRight[0][1] = ArgbEncode(0xff, 0, 50, 193);
- m_pThemeData->clrHeadEdgeRight[0][2] = ArgbEncode(0xff, 0, 19, 139);
- m_pThemeData->clrHeadEdgeTop[0][0] = ArgbEncode(0xff, 0, 88, 238);
- m_pThemeData->clrHeadEdgeTop[0][1] = ArgbEncode(0xff, 63, 151, 255);
- m_pThemeData->clrHeadEdgeTop[0][2] = ArgbEncode(0xff, 3, 114, 255);
- m_pThemeData->clrHeadEdgeBottom[0][0] = ArgbEncode(0xff, 0, 96, 252);
- m_pThemeData->clrHeadEdgeBottom[0][1] = ArgbEncode(0xff, 63, 151, 255);
- m_pThemeData->clrHeadEdgeBottom[0][2] = ArgbEncode(0xff, 0, 67, 207);
- m_pThemeData->clrNormalBtBKStart[0][2] = ArgbEncode(0xff, 0, 49, 112);
- m_pThemeData->clrNormalBtBKEnd[0][2] = ArgbEncode(0xff, 0, 87, 188);
- m_pThemeData->clrNormalBtBKStart[0][0] = ArgbEncode(0xff, 154, 183, 250);
- m_pThemeData->clrNormalBtBKEnd[0][0] = ArgbEncode(0xff, 17, 110, 248);
- m_pThemeData->clrNormalBtBKStart[0][1] = ArgbEncode(0xff, 164, 194, 255);
- m_pThemeData->clrNormalBtBKEnd[0][1] = ArgbEncode(0xff, 29, 158, 255);
- m_pThemeData->clrNormalBtEdgeLight[0][0] = ArgbEncode(0xff, 68, 120, 245);
- m_pThemeData->clrNormalBtEdgeDark[0][0] = ArgbEncode(0xff, 24, 72, 187);
- m_pThemeData->clrNormalBtEdgeLight[0][1] = ArgbEncode(0xff, 72, 122, 245);
- m_pThemeData->clrNormalBtEdgeDark[0][1] = ArgbEncode(0xff, 35, 87, 195);
- m_pThemeData->clrNormalBtEdgeLight[0][2] = ArgbEncode(0xff, 60, 114, 244);
- m_pThemeData->clrNormalBtEdgeDark[0][2] = ArgbEncode(0xff, 21, 70, 185);
- m_pThemeData->clrBtnCornerLight[0][0] = ArgbEncode(0xff, 220, 220, 220);
- m_pThemeData->clrBtnCornerLight[0][1] = ArgbEncode(0xff, 255, 255, 255);
- m_pThemeData->clrBtnCornerLight[0][2] = ArgbEncode(0xff, 225, 225, 225);
- m_pThemeData->clrBtnEdgeOut[0] = ArgbEncode(0xff, 255, 255, 255);
- m_pThemeData->clrFormBorder[0][0] = ArgbEncode(0xff, 0, 72, 241);
- m_pThemeData->clrFormBorder[0][1] = ArgbEncode(0xff, 0, 61, 220);
- m_pThemeData->clrFormBorder[0][2] = ArgbEncode(0xff, 0, 30, 160);
- m_pThemeData->clrFormBorder[0][3] = ArgbEncode(0xff, 0, 19, 140);
- m_pThemeData->clrFormBorder[0][4] = ArgbEncode(0xff, 255, 255, 255);
- m_pThemeData->clrFormBorderLight[0] = ArgbEncode(0xff, 22, 106, 239);
- }
- m_pThemeData->clrCloseBtBKStart[1][0] = m_pThemeData->clrCloseBtBKStart[0][0];
- m_pThemeData->clrCloseBtBKEnd[1][0] = m_pThemeData->clrCloseBtBKEnd[0][0];
- m_pThemeData->clrCloseBtBKStart[1][1] = m_pThemeData->clrCloseBtBKStart[0][1];
- m_pThemeData->clrCloseBtBKEnd[1][1] = m_pThemeData->clrCloseBtBKEnd[0][1];
- m_pThemeData->clrCloseBtBKStart[1][2] = m_pThemeData->clrCloseBtBKStart[0][2];
- m_pThemeData->clrCloseBtBKEnd[1][2] = m_pThemeData->clrCloseBtBKEnd[0][2];
- m_pThemeData->clrCloseBtEdgeLight[1][0] =
- m_pThemeData->clrCloseBtEdgeLight[0][0];
- m_pThemeData->clrCloseBtEdgeDark[1][0] =
- m_pThemeData->clrCloseBtEdgeDark[0][0];
- m_pThemeData->clrCloseBtEdgeLight[1][1] =
- m_pThemeData->clrCloseBtEdgeLight[0][1];
- m_pThemeData->clrCloseBtEdgeDark[1][1] =
- m_pThemeData->clrCloseBtEdgeDark[0][1];
- m_pThemeData->clrCloseBtEdgeLight[1][2] =
- m_pThemeData->clrCloseBtEdgeLight[0][2];
- m_pThemeData->clrCloseBtEdgeDark[1][2] =
- m_pThemeData->clrCloseBtEdgeDark[0][2];
- m_pThemeData->clrHeadBK[1][0] = m_pThemeData->clrHeadBK[0][0];
- m_pThemeData->clrHeadBK[1][1] = m_pThemeData->clrHeadBK[0][1];
- m_pThemeData->clrHeadBK[1][2] = m_pThemeData->clrHeadBK[0][2];
- m_pThemeData->clrHeadBK[1][3] = m_pThemeData->clrHeadBK[0][3];
- m_pThemeData->clrHeadEdgeLeft[1][2] = m_pThemeData->clrHeadEdgeLeft[0][2];
- m_pThemeData->clrHeadEdgeLeft[1][1] = m_pThemeData->clrHeadEdgeLeft[0][1];
- m_pThemeData->clrHeadEdgeLeft[1][0] = m_pThemeData->clrHeadEdgeLeft[0][0];
- m_pThemeData->clrHeadEdgeRight[1][0] = m_pThemeData->clrHeadEdgeRight[0][0];
- m_pThemeData->clrHeadEdgeRight[1][1] = m_pThemeData->clrHeadEdgeRight[0][1];
- m_pThemeData->clrHeadEdgeRight[1][2] = m_pThemeData->clrHeadEdgeRight[0][2];
- m_pThemeData->clrHeadEdgeTop[1][0] = m_pThemeData->clrHeadEdgeTop[0][0];
- m_pThemeData->clrHeadEdgeTop[1][1] = m_pThemeData->clrHeadEdgeTop[0][1];
- m_pThemeData->clrHeadEdgeTop[1][2] = m_pThemeData->clrHeadEdgeTop[0][2];
- m_pThemeData->clrHeadEdgeBottom[1][0] = m_pThemeData->clrHeadEdgeBottom[0][0];
- m_pThemeData->clrHeadEdgeBottom[1][1] = m_pThemeData->clrHeadEdgeBottom[0][1];
- m_pThemeData->clrHeadEdgeBottom[1][2] = m_pThemeData->clrHeadEdgeBottom[0][2];
- m_pThemeData->clrNormalBtBKStart[1][2] =
- m_pThemeData->clrNormalBtBKStart[0][2];
- m_pThemeData->clrNormalBtBKEnd[1][2] = m_pThemeData->clrNormalBtBKEnd[0][2];
- m_pThemeData->clrNormalBtBKStart[1][0] =
- m_pThemeData->clrNormalBtBKStart[0][0];
- m_pThemeData->clrNormalBtBKEnd[1][0] = m_pThemeData->clrNormalBtBKEnd[1][0];
- m_pThemeData->clrNormalBtBKStart[1][1] =
- m_pThemeData->clrNormalBtBKStart[0][1];
- m_pThemeData->clrNormalBtBKEnd[1][1] = m_pThemeData->clrNormalBtBKEnd[0][1];
- m_pThemeData->clrNormalBtEdgeLight[1][0] =
- m_pThemeData->clrNormalBtEdgeLight[0][0];
- m_pThemeData->clrNormalBtEdgeDark[1][0] =
- m_pThemeData->clrNormalBtEdgeDark[0][0];
- m_pThemeData->clrNormalBtEdgeLight[1][1] =
- m_pThemeData->clrNormalBtEdgeLight[0][1];
- m_pThemeData->clrNormalBtEdgeDark[1][1] =
- m_pThemeData->clrNormalBtEdgeDark[0][1];
- m_pThemeData->clrNormalBtEdgeLight[1][2] =
- m_pThemeData->clrNormalBtEdgeLight[0][2];
- m_pThemeData->clrNormalBtEdgeDark[1][2] =
- m_pThemeData->clrNormalBtEdgeDark[0][2];
- m_pThemeData->clrBtnCornerLight[1][0] = m_pThemeData->clrBtnCornerLight[0][0];
- m_pThemeData->clrBtnCornerLight[1][1] = m_pThemeData->clrBtnCornerLight[0][1];
- m_pThemeData->clrBtnCornerLight[1][2] = m_pThemeData->clrBtnCornerLight[0][2];
- m_pThemeData->clrBtnEdgeOut[1] = m_pThemeData->clrBtnEdgeOut[0];
- m_pThemeData->clrFormBorder[1][0] = m_pThemeData->clrFormBorder[0][0];
- m_pThemeData->clrFormBorder[1][1] = m_pThemeData->clrFormBorder[0][1];
- m_pThemeData->clrFormBorder[1][2] = m_pThemeData->clrFormBorder[0][2];
- m_pThemeData->clrFormBorder[1][3] = m_pThemeData->clrFormBorder[0][3];
- m_pThemeData->clrFormBorder[1][4] = m_pThemeData->clrFormBorder[0][4];
- m_pThemeData->clrFormBorderLight[1] = m_pThemeData->clrFormBorderLight[0];
- DeactiveForm();
-}
-void CFWL_FormTP::DeactiveForm() {
- TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrHeadBK[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrHeadBK[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrHeadBK[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrHeadBK[1][3]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeLeft[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeLeft[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeLeft[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeRight[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeRight[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeRight[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeTop[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeTop[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeTop[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeBottom[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeBottom[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrHeadEdgeBottom[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtBKStart[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtBKStart[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtBKStart[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtBKEnd[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtBKEnd[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtBKEnd[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtEdgeLight[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtEdgeLight[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtEdgeLight[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtEdgeDark[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtEdgeDark[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrNormalBtEdgeDark[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrBtnCornerLight[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrBtnCornerLight[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrBtnCornerLight[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrBtnEdgeOut[1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrFormBorder[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrFormBorder[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrFormBorder[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrFormBorder[1][3]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrFormBorder[1][4]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrFormBorderLight[1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtBKStart[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtBKStart[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtBKStart[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtBKEnd[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtBKEnd[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtBKEnd[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtEdgeLight[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtEdgeLight[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtEdgeLight[1][2]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtEdgeDark[1][0]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtEdgeDark[1][1]);
- TransModeColor(m_pThemeData->clrTransWhite,
- m_pThemeData->clrCloseBtEdgeDark[1][2]);
-}
-void CFWL_FormTP::TransModeColor(FX_ARGB clrFore, FX_ARGB& clrBack) {
- int32_t iAlfaF, iRF, iGF, iBF;
- int32_t iAlfaB, iRB, iGB, iBB;
- ArgbDecode(clrFore, iAlfaF, iRF, iGF, iBF);
- ArgbDecode(clrBack, iAlfaB, iRB, iGB, iBB);
- clrBack = ArgbEncode(0xff, iRB + (iRF - iRB) * iAlfaF / 255,
- iGB + (iGF - iGB) * iAlfaF / 255,
- iBB + (iBF - iBB) * iAlfaF / 255);
-}
-void CFWL_FormTP::InitCaption(FX_BOOL bActive) {
- if (bActive) {
- CFX_FxgeDevice dev;
- CFX_Graphics gs;
- CFX_Path path;
- path.Create();
- delete m_pActiveBitmap;
- m_pActiveBitmap = new CFX_DIBitmap;
- m_pActiveBitmap->Create(1, kCYCaption, FXDIB_Argb);
- dev.Attach(m_pActiveBitmap, false, nullptr, false);
- gs.Create(&dev);
- path.AddRectangle(0, 0, 1, 5);
- DrawAxialShading(&gs, 0, 0, 0, 5, m_pThemeData->clrHeadBK[0][0],
- m_pThemeData->clrHeadBK[0][1], &path);
- path.Clear();
- path.AddRectangle(0, 5, 1, 15);
- DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[0][1],
- m_pThemeData->clrHeadBK[0][2], &path);
- path.Clear();
- path.AddRectangle(0, 20, 1, kCYCaption - 19);
- DrawAxialShading(&gs, 0, 20, 0, kCYCaption, m_pThemeData->clrHeadBK[0][2],
- m_pThemeData->clrHeadBK[0][3], &path);
- } else {
- CFX_FxgeDevice dev;
- CFX_Graphics gs;
- CFX_Path path;
- path.Create();
- delete m_pDeactivebitmap;
- m_pDeactivebitmap = new CFX_DIBitmap;
- m_pDeactivebitmap->Create(1, kCYCaption, FXDIB_Argb);
- dev.Attach(m_pDeactivebitmap, false, nullptr, false);
- gs.Create(&dev);
- path.AddRectangle(0, 0, 1, 5);
- DrawAxialShading(&gs, 0, 0, 0, 5, m_pThemeData->clrHeadBK[1][0],
- m_pThemeData->clrHeadBK[1][1], &path);
- path.Clear();
- path.AddRectangle(0, 5, 1, 15);
- DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1],
- m_pThemeData->clrHeadBK[1][2], &path);
- path.Clear();
- path.AddRectangle(0, 20, 1, kCYCaption - 19);
- DrawAxialShading(&gs, 0, 20, 0, kCYCaption, m_pThemeData->clrHeadBK[1][2],
- m_pThemeData->clrHeadBK[1][3], &path);
- }
-}
diff --git a/xfa/fwl/theme/cfwl_formtp.h b/xfa/fwl/theme/cfwl_formtp.h
deleted file mode 100644
index ccbc71b2c2..0000000000
--- a/xfa/fwl/theme/cfwl_formtp.h
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_THEME_CFWL_FORMTP_H_
-#define XFA_FWL_THEME_CFWL_FORMTP_H_
-
-#include "xfa/fwl/theme/cfwl_utils.h"
-#include "xfa/fwl/theme/cfwl_widgettp.h"
-
-class CFWL_FormTP : public CFWL_WidgetTP {
- public:
- CFWL_FormTP();
- ~CFWL_FormTP() override;
-
- // CFWL_WidgetTP
- FWL_Error Initialize() override;
- FWL_Error Finalize() override;
- bool IsValidWidget(IFWL_Widget* pWidget) override;
- uint32_t SetThemeID(IFWL_Widget* pWidget,
- uint32_t dwThemeID,
- FX_BOOL bChildren = TRUE) override;
- FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override;
- FX_BOOL DrawText(CFWL_ThemeText* pParams) override;
- void* GetCapacity(CFWL_ThemePart* pThemePart,
- CFWL_WidgetCapacity dwCapacity) override;
- FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override;
-
- protected:
- void CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect);
- void CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect);
- void CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect);
- void CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect);
- void CalIcon(IFWL_Widget* pWidget, CFX_RectF& rect);
-
- void DrawFormBorder(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive = 0);
- void DrawCaption(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive = 0);
- void DrawNarrowCaption(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive = 0);
- void DrawCloseBox(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive = 0);
- void DrawMinMaxBoxCommon(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive = 0);
- void DrawMinimizeBox(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive = 0);
- void DrawMaximizeBox(CFX_Graphics* pGraphics,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- bool bMax,
- CFX_Matrix* pMatrix,
- int32_t iActive = 0);
- void DrawIconImage(CFX_Graphics* pGraphics,
- CFX_DIBitmap* pDIBitmap,
- const CFX_RectF* pRect,
- FWLTHEME_STATE eState,
- CFX_Matrix* pMatrix,
- int32_t iActive = 0);
- void SetThemeData(uint32_t dwID);
- void TransModeColor(FX_ARGB clrFore, FX_ARGB& clrBack);
- void DeactiveForm();
- void InitCaption(FX_BOOL bActive);
- CFX_DIBitmap* m_pActiveBitmap;
- CFX_DIBitmap* m_pDeactivebitmap;
- CFX_RectF m_rtDisCaption;
- CFX_RectF m_rtDisLBorder;
- CFX_RectF m_rtDisRBorder;
- CFX_RectF m_rtDisBBorder;
- struct SBThemeData {
- FX_ARGB clrHeadBK[2][4];
- FX_ARGB clrHeadEdgeLeft[2][3];
- FX_ARGB clrHeadEdgeRight[2][3];
- FX_ARGB clrHeadEdgeTop[2][3];
- FX_ARGB clrHeadEdgeBottom[2][3];
- FX_ARGB clrCloseBtBKStart[2][3];
- FX_ARGB clrCloseBtBKEnd[2][3];
- FX_ARGB clrCloseBtEdgeLight[2][3];
- FX_ARGB clrCloseBtEdgeDark[2][3];
- FX_ARGB clrNormalBtBKStart[2][3];
- FX_ARGB clrNormalBtBKEnd[2][3];
- FX_ARGB clrNormalBtEdgeLight[2][3];
- FX_ARGB clrNormalBtEdgeDark[2][3];
- FX_ARGB clrBtnEdgeOut[2];
- FX_ARGB clrBtnCornerLight[2][3];
- FX_ARGB clrHeadText[2];
- FX_ARGB clrFormBorder[2][5];
- FX_ARGB clrFormBorderLight[2];
- FX_ARGB clrTransWhite;
- } * m_pThemeData;
-};
-
-#endif // XFA_FWL_THEME_CFWL_FORMTP_H_
diff --git a/xfa/fxbarcode/BC_ResultPoint.cpp b/xfa/fxbarcode/BC_ResultPoint.cpp
deleted file mode 100644
index 9726ea4240..0000000000
--- a/xfa/fxbarcode/BC_ResultPoint.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-// Original code is licensed as follows:
-/*
- * Copyright 2007 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "xfa/fxbarcode/BC_ResultPoint.h"
-
-CBC_ResultPoint::CBC_ResultPoint(FX_FLOAT x, FX_FLOAT y) : m_x(x), m_y(y) {}
-FX_FLOAT CBC_ResultPoint::GetX() {
- return m_x;
-}
-FX_FLOAT CBC_ResultPoint::GetY() {
- return m_y;
-}
diff --git a/xfa/fxbarcode/BC_ResultPoint.h b/xfa/fxbarcode/BC_ResultPoint.h
deleted file mode 100644
index 81e27848ca..0000000000
--- a/xfa/fxbarcode/BC_ResultPoint.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXBARCODE_BC_RESULTPOINT_H_
-#define XFA_FXBARCODE_BC_RESULTPOINT_H_
-
-#include "core/fxcrt/include/fx_basic.h"
-
-class CBC_ResultPoint {
- public:
- CBC_ResultPoint();
- CBC_ResultPoint(FX_FLOAT x, FX_FLOAT y);
- virtual ~CBC_ResultPoint() {}
- virtual FX_FLOAT GetX();
- virtual FX_FLOAT GetY();
-
- protected:
- FX_FLOAT m_x;
- FX_FLOAT m_y;
-};
-
-#endif // XFA_FXBARCODE_BC_RESULTPOINT_H_
diff --git a/xfa/fxbarcode/common/BC_CommonBitSource.cpp b/xfa/fxbarcode/common/BC_CommonBitSource.cpp
deleted file mode 100644
index af91d5e0bd..0000000000
--- a/xfa/fxbarcode/common/BC_CommonBitSource.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-// Original code is licensed as follows:
-/*
- * Copyright 2007 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "xfa/fxbarcode/common/BC_CommonBitSource.h"
-
-CBC_CommonBitSource::CBC_CommonBitSource(CFX_ByteArray* bytes) {
- m_bytes.Copy((*bytes));
- m_bitOffset = 0;
- m_byteOffset = 0;
-}
-CBC_CommonBitSource::~CBC_CommonBitSource() {}
-int32_t CBC_CommonBitSource::ReadBits(int32_t numBits, int32_t& e) {
- if (numBits < 1 || numBits > 32) {
- e = BCExceptionIllegalArgument;
- return 0;
- }
- int32_t result = 0;
- if (m_bitOffset > 0) {
- int32_t bitsLeft = 8 - m_bitOffset;
- int32_t toRead = numBits < bitsLeft ? numBits : bitsLeft;
- int32_t bitsToNotRead = bitsLeft - toRead;
- int32_t mask = (0xff >> (8 - toRead)) << bitsToNotRead;
- result = (m_bytes[m_byteOffset] & mask) >> bitsToNotRead;
- numBits -= toRead;
- m_bitOffset += toRead;
- if (m_bitOffset == 8) {
- m_bitOffset = 0;
- m_byteOffset++;
- }
- }
- if (numBits > 0) {
- while (numBits >= 8) {
- result = (result << 8) | (m_bytes[m_byteOffset] & 0xff);
- m_byteOffset++;
- numBits -= 8;
- }
- if (numBits > 0) {
- int32_t bitsToNotRead = 8 - numBits;
- int32_t mask = (0xff >> bitsToNotRead) << bitsToNotRead;
- result = (result << numBits) |
- ((m_bytes[m_byteOffset] & mask) >> bitsToNotRead);
- m_bitOffset += numBits;
- }
- }
- return result;
-}
-int32_t CBC_CommonBitSource::Available() {
- return 8 * (m_bytes.GetSize() - m_byteOffset) - m_bitOffset;
-}
-int32_t CBC_CommonBitSource::getByteOffset() {
- return m_byteOffset;
-}
diff --git a/xfa/fxbarcode/common/BC_CommonBitSource.h b/xfa/fxbarcode/common/BC_CommonBitSource.h
deleted file mode 100644
index 7c6736cba3..0000000000
--- a/xfa/fxbarcode/common/BC_CommonBitSource.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXBARCODE_COMMON_BC_COMMONBITSOURCE_H_
-#define XFA_FXBARCODE_COMMON_BC_COMMONBITSOURCE_H_
-
-#include "core/fxcrt/include/fx_basic.h"
-#include "xfa/fxbarcode/utils.h"
-
-class CBC_CommonBitSource {
- public:
- CBC_CommonBitSource(CFX_ByteArray* bytes);
- ~CBC_CommonBitSource();
-
- int32_t ReadBits(int32_t numBits, int32_t& e);
- int32_t Available();
- int32_t getByteOffset();
-
- private:
- CFX_ByteArray m_bytes;
- int32_t m_byteOffset;
- int32_t m_bitOffset;
-};
-
-#endif // XFA_FXBARCODE_COMMON_BC_COMMONBITSOURCE_H_
diff --git a/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.cpp b/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.cpp
deleted file mode 100644
index d84ed6163d..0000000000
--- a/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-// Original code is licensed as follows:
-/*
- * Copyright 2007 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h"
-
-#include <memory>
-
-#include "core/fxcrt/include/fx_basic.h"
-#include "xfa/fxbarcode/utils.h"
-
-CBC_CommonPerspectiveTransform::CBC_CommonPerspectiveTransform(FX_FLOAT a11,
- FX_FLOAT a21,
- FX_FLOAT a31,
- FX_FLOAT a12,
- FX_FLOAT a22,
- FX_FLOAT a32,
- FX_FLOAT a13,
- FX_FLOAT a23,
- FX_FLOAT a33)
- : m_a11(a11),
- m_a12(a12),
- m_a13(a13),
- m_a21(a21),
- m_a22(a22),
- m_a23(a23),
- m_a31(a31),
- m_a32(a32),
- m_a33(a33) {}
-CBC_CommonPerspectiveTransform::~CBC_CommonPerspectiveTransform() {}
-CBC_CommonPerspectiveTransform*
-CBC_CommonPerspectiveTransform::QuadrilateralToQuadrilateral(FX_FLOAT x0,
- FX_FLOAT y0,
- FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- FX_FLOAT x3,
- FX_FLOAT y3,
- FX_FLOAT x0p,
- FX_FLOAT y0p,
- FX_FLOAT x1p,
- FX_FLOAT y1p,
- FX_FLOAT x2p,
- FX_FLOAT y2p,
- FX_FLOAT x3p,
- FX_FLOAT y3p) {
- std::unique_ptr<CBC_CommonPerspectiveTransform> qToS(
- QuadrilateralToSquare(x0, y0, x1, y1, x2, y2, x3, y3));
- std::unique_ptr<CBC_CommonPerspectiveTransform> sToQ(
- SquareToQuadrilateral(x0p, y0p, x1p, y1p, x2p, y2p, x3p, y3p));
- return sToQ->Times(*(qToS.get()));
-}
-void CBC_CommonPerspectiveTransform::TransformPoints(CFX_FloatArray* points) {
- int32_t max = points->GetSize();
- FX_FLOAT a11 = m_a11;
- FX_FLOAT a12 = m_a12;
- FX_FLOAT a13 = m_a13;
- FX_FLOAT a21 = m_a21;
- FX_FLOAT a22 = m_a22;
- FX_FLOAT a23 = m_a23;
- FX_FLOAT a31 = m_a31;
- FX_FLOAT a32 = m_a32;
- FX_FLOAT a33 = m_a33;
- int32_t i;
- for (i = 0; i < max; i += 2) {
- FX_FLOAT x = (*points)[i];
- FX_FLOAT y = (*points)[i + 1];
- FX_FLOAT denominator = a13 * x + a23 * y + a33;
- (*points)[i] = (a11 * x + a21 * y + a31) / denominator;
- (*points)[i + 1] = (a12 * x + a22 * y + a32) / denominator;
- }
-}
-CBC_CommonPerspectiveTransform*
-CBC_CommonPerspectiveTransform::SquareToQuadrilateral(FX_FLOAT x0,
- FX_FLOAT y0,
- FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- FX_FLOAT x3,
- FX_FLOAT y3) {
- FX_FLOAT dy2 = y3 - y2;
- FX_FLOAT dy3 = y0 - y1 + y2 - y3;
- if ((dy2 == 0.0f) && (dy3 == 0.0f)) {
- return new CBC_CommonPerspectiveTransform(x1 - x0, x2 - x1, x0, y1 - y0,
- y2 - y1, y0, 0.0f, 0.0f, 1.0f);
- } else {
- FX_FLOAT dx1 = x1 - x2;
- FX_FLOAT dx2 = x3 - x2;
- FX_FLOAT dx3 = x0 - x1 + x2 - x3;
- FX_FLOAT dy1 = y1 - y2;
- FX_FLOAT denominator = dx1 * dy2 - dx2 * dy1;
- FX_FLOAT a13 = (dx3 * dy2 - dx2 * dy3) / denominator;
- FX_FLOAT a23 = (dx1 * dy3 - dx3 * dy1) / denominator;
- return new CBC_CommonPerspectiveTransform(
- x1 - x0 + a13 * x1, x3 - x0 + a23 * x3, x0, y1 - y0 + a13 * y1,
- y3 - y0 + a23 * y3, y0, a13, a23, 1.0f);
- }
-}
-CBC_CommonPerspectiveTransform*
-CBC_CommonPerspectiveTransform::QuadrilateralToSquare(FX_FLOAT x0,
- FX_FLOAT y0,
- FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- FX_FLOAT x3,
- FX_FLOAT y3) {
- std::unique_ptr<CBC_CommonPerspectiveTransform> temp1(
- SquareToQuadrilateral(x0, y0, x1, y1, x2, y2, x3, y3));
- return temp1->BuildAdjoint();
-}
-CBC_CommonPerspectiveTransform* CBC_CommonPerspectiveTransform::BuildAdjoint() {
- return new CBC_CommonPerspectiveTransform(
- m_a22 * m_a33 - m_a23 * m_a32, m_a23 * m_a31 - m_a21 * m_a33,
- m_a21 * m_a32 - m_a22 * m_a31, m_a13 * m_a32 - m_a12 * m_a33,
- m_a11 * m_a33 - m_a13 * m_a31, m_a12 * m_a31 - m_a11 * m_a32,
- m_a12 * m_a23 - m_a13 * m_a22, m_a13 * m_a21 - m_a11 * m_a23,
- m_a11 * m_a22 - m_a12 * m_a21);
-}
-CBC_CommonPerspectiveTransform* CBC_CommonPerspectiveTransform::Times(
- CBC_CommonPerspectiveTransform& other) {
- return new CBC_CommonPerspectiveTransform(
- m_a11 * other.m_a11 + m_a21 * other.m_a12 + m_a31 * other.m_a13,
- m_a11 * other.m_a21 + m_a21 * other.m_a22 + m_a31 * other.m_a23,
- m_a11 * other.m_a31 + m_a21 * other.m_a32 + m_a31 * other.m_a33,
- m_a12 * other.m_a11 + m_a22 * other.m_a12 + m_a32 * other.m_a13,
- m_a12 * other.m_a21 + m_a22 * other.m_a22 + m_a32 * other.m_a23,
- m_a12 * other.m_a31 + m_a22 * other.m_a32 + m_a32 * other.m_a33,
- m_a13 * other.m_a11 + m_a23 * other.m_a12 + m_a33 * other.m_a13,
- m_a13 * other.m_a21 + m_a23 * other.m_a22 + m_a33 * other.m_a23,
- m_a13 * other.m_a31 + m_a23 * other.m_a32 + m_a33 * other.m_a33);
-}
diff --git a/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h b/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h
deleted file mode 100644
index 8a5fd26f22..0000000000
--- a/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXBARCODE_COMMON_BC_COMMONPERSPECTIVETRANSFORM_H_
-#define XFA_FXBARCODE_COMMON_BC_COMMONPERSPECTIVETRANSFORM_H_
-
-#include "core/fxcrt/include/fx_basic.h"
-
-class CBC_CommonPerspectiveTransform {
- public:
- CBC_CommonPerspectiveTransform(FX_FLOAT a11,
- FX_FLOAT a21,
- FX_FLOAT a31,
- FX_FLOAT a12,
- FX_FLOAT a22,
- FX_FLOAT a32,
- FX_FLOAT a13,
- FX_FLOAT a23,
- FX_FLOAT a33);
- virtual ~CBC_CommonPerspectiveTransform();
-
- static CBC_CommonPerspectiveTransform* QuadrilateralToQuadrilateral(
- FX_FLOAT x0,
- FX_FLOAT y0,
- FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- FX_FLOAT x3,
- FX_FLOAT y3,
- FX_FLOAT x0p,
- FX_FLOAT y0p,
- FX_FLOAT x1p,
- FX_FLOAT y1p,
- FX_FLOAT x2p,
- FX_FLOAT y2p,
- FX_FLOAT x3p,
- FX_FLOAT y3p);
- static CBC_CommonPerspectiveTransform* SquareToQuadrilateral(FX_FLOAT x0,
- FX_FLOAT y0,
- FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- FX_FLOAT x3,
- FX_FLOAT y3);
- static CBC_CommonPerspectiveTransform* QuadrilateralToSquare(FX_FLOAT x0,
- FX_FLOAT y0,
- FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- FX_FLOAT x3,
- FX_FLOAT y3);
- CBC_CommonPerspectiveTransform* BuildAdjoint();
- CBC_CommonPerspectiveTransform* Times(CBC_CommonPerspectiveTransform& other);
- void TransformPoints(CFX_FloatArray* points);
-
- private:
- FX_FLOAT m_a11, m_a12, m_a13, m_a21, m_a22, m_a23, m_a31, m_a32, m_a33;
-};
-
-#endif // XFA_FXBARCODE_COMMON_BC_COMMONPERSPECTIVETRANSFORM_H_
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Codeword.cpp b/xfa/fxbarcode/pdf417/BC_PDF417Codeword.cpp
deleted file mode 100644
index 0280ea0953..0000000000
--- a/xfa/fxbarcode/pdf417/BC_PDF417Codeword.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-// Original code is licensed as follows:
-/*
- * Copyright 2013 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "xfa/fxbarcode/pdf417/BC_PDF417Codeword.h"
-
-int32_t CBC_Codeword::BARCODE_ROW_UNKNOWN = -1;
-CBC_Codeword::CBC_Codeword(int32_t startX,
- int32_t endX,
- int32_t bucket,
- int32_t cvalue) {
- m_startX = startX;
- m_endX = endX;
- m_bucket = bucket;
- m_value = cvalue;
- m_rowNumber = BARCODE_ROW_UNKNOWN;
-}
-CBC_Codeword::~CBC_Codeword() {}
-FX_BOOL CBC_Codeword::hasValidRowNumber() {
- return isValidRowNumber(m_rowNumber);
-}
-FX_BOOL CBC_Codeword::isValidRowNumber(int32_t rowNumber) {
- return m_rowNumber != BARCODE_ROW_UNKNOWN &&
- m_bucket == (m_rowNumber % 3) * 3;
-}
-void CBC_Codeword::setRowNumberAsRowIndicatorColumn() {
- m_rowNumber = (m_value / 30) * 3 + m_bucket / 3;
-}
-int32_t CBC_Codeword::getWidth() {
- return m_endX - m_startX;
-}
-int32_t CBC_Codeword::getStartX() {
- return m_startX;
-}
-int32_t CBC_Codeword::getEndX() {
- return m_endX;
-}
-int32_t CBC_Codeword::getBucket() {
- return m_bucket;
-}
-int32_t CBC_Codeword::getValue() {
- return m_value;
-}
-int32_t CBC_Codeword::getRowNumber() {
- return m_rowNumber;
-}
-void CBC_Codeword::setRowNumber(int32_t rowNumber) {
- m_rowNumber = rowNumber;
-}
-CFX_ByteString CBC_Codeword::toString() {
- return m_rowNumber + (FX_CHAR)'|' + m_value;
-}
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Codeword.h b/xfa/fxbarcode/pdf417/BC_PDF417Codeword.h
deleted file mode 100644
index 2423cab757..0000000000
--- a/xfa/fxbarcode/pdf417/BC_PDF417Codeword.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXBARCODE_PDF417_BC_PDF417CODEWORD_H_
-#define XFA_FXBARCODE_PDF417_BC_PDF417CODEWORD_H_
-
-#include "core/fxcrt/include/fx_basic.h"
-
-class CBC_Codeword {
- public:
- CBC_Codeword(int32_t startX, int32_t endX, int32_t bucket, int32_t value);
- virtual ~CBC_Codeword();
-
- FX_BOOL hasValidRowNumber();
- FX_BOOL isValidRowNumber(int32_t rowNumber);
- void setRowNumberAsRowIndicatorColumn();
- int32_t getWidth();
- int32_t getStartX();
- int32_t getEndX();
- int32_t getBucket();
- int32_t getValue();
- int32_t getRowNumber();
- void setRowNumber(int32_t rowNumber);
- CFX_ByteString toString();
-
- private:
- static int32_t BARCODE_ROW_UNKNOWN;
- int32_t m_startX;
- int32_t m_endX;
- int32_t m_bucket;
- int32_t m_value;
- int32_t m_rowNumber;
-};
-
-#endif // XFA_FXBARCODE_PDF417_BC_PDF417CODEWORD_H_