Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cfwl_edittp.cpp
Go to the documentation of this file.
1
// Copyright 2014 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
include
"xfa/fwl/theme/cfwl_edittp.h"
8
9
#
include
"xfa/fgas/graphics/cfgas_gecolor.h"
10
#
include
"xfa/fgas/graphics/cfgas_gegraphics.h"
11
#
include
"xfa/fgas/graphics/cfgas_gepath.h"
12
#
include
"xfa/fwl/cfwl_edit.h"
13
#
include
"xfa/fwl/cfwl_themebackground.h"
14
#
include
"xfa/fwl/cfwl_widget.h"
15
16
namespace
pdfium
{
17
18
CFWL_EditTP::CFWL_EditTP() =
default
;
19
20
CFWL_EditTP::~
CFWL_EditTP
() =
default
;
21
22
void
CFWL_EditTP::
DrawBackground
(
const
CFWL_ThemeBackground& pParams) {
23
switch
(pParams
.
GetPart
()) {
24
case
CFWL_ThemePart
::
Part
::
kBorder
: {
25
DrawBorder
(
pParams
.
GetGraphics
(
)
,
pParams.m_PartRect
,
pParams.m_matrix
)
;
26
break
;
27
}
28
case
CFWL_ThemePart
::
Part
::
kBackground
: {
29
CFGAS_GEGraphics
* pGraphics = pParams
.
GetGraphics
(
)
;
30
CFGAS_GEGraphics
::
StateRestorer
restorer
(
pGraphics
)
;
31
const
CFGAS_GEPath* pParamsPath = pParams
.
GetPath
(
)
;
32
if
(pParamsPath) {
33
pGraphics
->
SetFillColor
(
CFGAS_GEColor
(
FWLTHEME_COLOR_BKSelected
)
)
;
34
pGraphics
->
FillPath
(
*pParamsPath
,
35
CFX_FillRenderOptions
::
FillType
::
kWinding
,
36
pParams.m_matrix
)
;
37
}
else
{
38
CFGAS_GEPath path;
39
path
.
AddRectangle
(
pParams.m_PartRect.left
,
pParams.m_PartRect.top
,
40
pParams.m_PartRect.width
,
pParams.m_PartRect.height
)
;
41
CFGAS_GEColor
cr
(
FWLTHEME_COLOR_Background
)
;
42
if
(!pParams.m_bStaticBackground) {
43
if
(pParams.m_dwStates &
CFWL_PartState
::
kDisabled
)
44
cr
=
CFGAS_GEColor
(
FWLTHEME_COLOR_EDGERB1
)
;
45
else
if
(pParams.m_dwStates &
CFWL_PartState
::
kReadOnly
)
46
cr
=
CFGAS_GEColor
(
ArgbEncode
(
255
,
236
,
233
,
216
)
)
;
47
else
48
cr
=
CFGAS_GEColor
(
0xFFFFFFFF
)
;
49
}
50
pGraphics
->
SetFillColor
(
cr
)
;
51
pGraphics
->
FillPath
(
path
,
CFX_FillRenderOptions
::
FillType
::
kWinding
,
52
pParams.m_matrix
)
;
53
}
54
break
;
55
}
56
case
CFWL_ThemePart
::
Part
::
kCombTextLine
: {
57
CFWL_Widget
::
AdapterIface
* pWidget =
58
pParams
.
GetWidget
()->GetOutmost()->GetAdapterIface();
59
FX_ARGB
cr = 0xFF000000;
60
float
fWidth = 1.0f;
61
pWidget
->
GetBorderColorAndThickness
(
&cr
,
&fWidth
)
;
62
pParams
.
GetGraphics
(
)
->
SetStrokeColor
(
CFGAS_GEColor
(
cr
)
)
;
63
pParams
.
GetGraphics
(
)
->
SetLineWidth
(
fWidth
)
;
64
const
CFGAS_GEPath* pParamsPath = pParams
.
GetPath
(
)
;
65
if
(pParamsPath)
66
pParams
.
GetGraphics
(
)
->
StrokePath
(
*pParamsPath
,
pParams.m_matrix
)
;
67
break
;
68
}
69
default
:
70
break
;
71
}
72
}
73
74
}
// namespace pdfium
FWLTHEME_COLOR_BKSelected
#define FWLTHEME_COLOR_BKSelected
Definition
cfwl_utils.h:23
FWLTHEME_COLOR_EDGERB1
#define FWLTHEME_COLOR_EDGERB1
Definition
cfwl_utils.h:21
FWLTHEME_COLOR_Background
#define FWLTHEME_COLOR_Background
Definition
cfwl_utils.h:22
CFGAS_GEColor
Definition
cfgas_gecolor.h:19
CFGAS_GEColor::operator=
CFGAS_GEColor & operator=(const CFGAS_GEColor &that)
CFGAS_GEColor::CFGAS_GEColor
CFGAS_GEColor(FX_ARGB argb)
Definition
cfgas_gecolor.cpp:9
CFGAS_GEGraphics::StateRestorer
Definition
cfgas_gegraphics.h:28
CFGAS_GEGraphics::StateRestorer::StateRestorer
StateRestorer(CFGAS_GEGraphics *graphics)
Definition
cfgas_gegraphics.cpp:421
CFGAS_GEGraphics
Definition
cfgas_gegraphics.h:26
CFGAS_GEGraphics::FillPath
void FillPath(const CFGAS_GEPath &path, CFX_FillRenderOptions::FillType fill_type, const CFX_Matrix &matrix)
Definition
cfgas_gegraphics.cpp:178
CFGAS_GEGraphics::SetLineWidth
void SetLineWidth(float lineWidth)
Definition
cfgas_gegraphics.cpp:157
CFGAS_GEGraphics::SetStrokeColor
void SetStrokeColor(const CFGAS_GEColor &color)
Definition
cfgas_gegraphics.cpp:165
CFGAS_GEGraphics::SetFillColor
void SetFillColor(const CFGAS_GEColor &color)
Definition
cfgas_gegraphics.cpp:169
CFGAS_GEGraphics::StrokePath
void StrokePath(const CFGAS_GEPath &path, const CFX_Matrix &matrix)
Definition
cfgas_gegraphics.cpp:173
CFGAS_GEPath::AddRectangle
void AddRectangle(float left, float top, float width, float height)
Definition
cfgas_gepath.cpp:83
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
pdfium::CFWL_EditTP::DrawBackground
void DrawBackground(const CFWL_ThemeBackground &pParams) override
Definition
cfwl_edittp.cpp:22
pdfium::CFWL_EditTP::~CFWL_EditTP
~CFWL_EditTP() override
pdfium::CFWL_ThemeBackground::GetGraphics
CFGAS_GEGraphics * GetGraphics() const
Definition
cfwl_themebackground.h:28
pdfium::CFWL_ThemeBackground::GetPath
const CFGAS_GEPath * GetPath() const
Definition
cfwl_themebackground.h:29
pdfium::CFWL_ThemePart
Definition
cfwl_themepart.h:39
pdfium::CFWL_ThemePart::GetWidget
CFWL_Widget * GetWidget() const
Definition
cfwl_themepart.h:93
pdfium::CFWL_ThemePart::GetPart
Part GetPart() const
Definition
cfwl_themepart.h:92
pdfium::CFWL_ThemePart::Part
Part
Definition
cfwl_themepart.h:41
pdfium::CFWL_ThemePart::Part::kBackground
@ kBackground
Definition
cfwl_themepart.h:45
pdfium::CFWL_ThemePart::Part::kCombTextLine
@ kCombTextLine
Definition
cfwl_themepart.h:51
pdfium::CFWL_ThemePart::Part::kBorder
@ kBorder
Definition
cfwl_themepart.h:46
pdfium::CFWL_WidgetTP::DrawBorder
void DrawBorder(CFGAS_GEGraphics *pGraphics, const CFX_RectF &rect, const CFX_Matrix &matrix)
Definition
cfwl_widgettp.cpp:83
pdfium::CFWL_Widget::AdapterIface
Definition
cfwl_widget.h:74
pdfium::CFWL_Widget::AdapterIface::GetBorderColorAndThickness
virtual void GetBorderColorAndThickness(FX_ARGB *cr, float *fWidth)=0
pdfium::CFWL_Widget
Definition
cfwl_widget.h:70
FX_ARGB
uint32_t FX_ARGB
Definition
fx_dib.h:36
ArgbEncode
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
Definition
fx_dib.h:188
pdfium::CFWL_PartState
CFWL_PartState
Definition
cfwl_themepart.h:22
pdfium::CFWL_PartState::kDisabled
@ kDisabled
Definition
cfwl_themepart.h:26
pdfium::CFWL_PartState::kReadOnly
@ kReadOnly
Definition
cfwl_themepart.h:33
CFX_FillRenderOptions
Definition
cfx_fillrenderoptions.h:11
CFX_FillRenderOptions::FillType
FillType
Definition
cfx_fillrenderoptions.h:13
CFX_FillRenderOptions::FillType::kWinding
@ kWinding
Definition
cfx_fillrenderoptions.h:23
qtwebengine
src
3rdparty
chromium
third_party
pdfium
xfa
fwl
theme
cfwl_edittp.cpp
Generated on
for Qt by
1.18.0