summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-04 17:57:03 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-04 17:57:03 -0700
commitc777f486f84611d2fdd2d03af661b14955f9efb6 (patch)
tree679012454d82e885f749d17f75fd12735efec29a /xfa/fxgraphics
parent41aad19ba366540bd4efa20a9009ac1c70a81403 (diff)
downloadpdfium-c777f486f84611d2fdd2d03af661b14955f9efb6.tar.xz
Convert FWL_ERR into an enum class.
This Cl updates FWL_ERR to be an FWL_Error enum class. It removes FX_ERR and replaces it with FWL_Error as well as the values were the same. There were many places where we either returned other values for FWL_ERR results. This Cl is the same as: https://codereview.chromium.org/1943413002/ but I seem to have messed up the base URL in that one. TBR=tsepez@chromium.org Review-Url: https://codereview.chromium.org/1952693003
Diffstat (limited to 'xfa/fxgraphics')
-rw-r--r--xfa/fxgraphics/cagg_graphics.cpp14
-rw-r--r--xfa/fxgraphics/cagg_graphics.h8
-rw-r--r--xfa/fxgraphics/cfx_color.cpp16
-rw-r--r--xfa/fxgraphics/cfx_color.h6
-rw-r--r--xfa/fxgraphics/cfx_graphics.cpp491
-rw-r--r--xfa/fxgraphics/cfx_path.cpp164
-rw-r--r--xfa/fxgraphics/cfx_path.h96
-rw-r--r--xfa/fxgraphics/include/cfx_graphics.h211
8 files changed, 504 insertions, 502 deletions
diff --git a/xfa/fxgraphics/cagg_graphics.cpp b/xfa/fxgraphics/cagg_graphics.cpp
index a4211810c4..564a2b14cc 100644
--- a/xfa/fxgraphics/cagg_graphics.cpp
+++ b/xfa/fxgraphics/cagg_graphics.cpp
@@ -8,21 +8,21 @@
CAGG_Graphics::CAGG_Graphics() : m_owner(nullptr) {}
-FX_ERR CAGG_Graphics::Create(CFX_Graphics* owner,
- int32_t width,
- int32_t height,
- FXDIB_Format format) {
+FWL_Error CAGG_Graphics::Create(CFX_Graphics* owner,
+ int32_t width,
+ int32_t height,
+ FXDIB_Format format) {
if (owner->m_renderDevice)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_owner)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_FxgeDevice* device = new CFX_FxgeDevice;
device->Create(width, height, format);
m_owner = owner;
m_owner->m_renderDevice = device;
m_owner->m_renderDevice->GetBitmap()->Clear(0xFFFFFFFF);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CAGG_Graphics::~CAGG_Graphics() {
diff --git a/xfa/fxgraphics/cagg_graphics.h b/xfa/fxgraphics/cagg_graphics.h
index bac9c19167..5f53c73695 100644
--- a/xfa/fxgraphics/cagg_graphics.h
+++ b/xfa/fxgraphics/cagg_graphics.h
@@ -17,10 +17,10 @@ class CAGG_Graphics {
CAGG_Graphics();
virtual ~CAGG_Graphics();
- FX_ERR Create(CFX_Graphics* owner,
- int32_t width,
- int32_t height,
- FXDIB_Format format);
+ FWL_Error Create(CFX_Graphics* owner,
+ int32_t width,
+ int32_t height,
+ FXDIB_Format format);
private:
CFX_Graphics* m_owner;
diff --git a/xfa/fxgraphics/cfx_color.cpp b/xfa/fxgraphics/cfx_color.cpp
index 9cc9c14bbd..2044b76054 100644
--- a/xfa/fxgraphics/cfx_color.cpp
+++ b/xfa/fxgraphics/cfx_color.cpp
@@ -24,26 +24,26 @@ CFX_Color::~CFX_Color() {
m_type = FX_COLOR_None;
}
-FX_ERR CFX_Color::Set(const FX_ARGB argb) {
+FWL_Error CFX_Color::Set(const FX_ARGB argb) {
m_type = FX_COLOR_Solid;
m_info.argb = argb;
m_info.pattern = nullptr;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) {
+FWL_Error CFX_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) {
if (!pattern)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
m_type = FX_COLOR_Pattern;
m_info.argb = argb;
m_info.pattern = pattern;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Color::Set(CFX_Shading* shading) {
+FWL_Error CFX_Color::Set(CFX_Shading* shading) {
if (!shading)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
m_type = FX_COLOR_Shading;
m_shading = shading;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
diff --git a/xfa/fxgraphics/cfx_color.h b/xfa/fxgraphics/cfx_color.h
index 3f6684dc63..bf61c6859a 100644
--- a/xfa/fxgraphics/cfx_color.h
+++ b/xfa/fxgraphics/cfx_color.h
@@ -25,9 +25,9 @@ class CFX_Color {
explicit CFX_Color(CFX_Shading* shading);
virtual ~CFX_Color();
- FX_ERR Set(const FX_ARGB argb);
- FX_ERR Set(CFX_Pattern* pattern, const FX_ARGB argb = 0x0);
- FX_ERR Set(CFX_Shading* shading);
+ FWL_Error Set(const FX_ARGB argb);
+ FWL_Error Set(CFX_Pattern* pattern, const FX_ARGB argb = 0x0);
+ FWL_Error Set(CFX_Shading* shading);
private:
friend class CFX_Graphics;
diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp
index fd85714254..179e470e90 100644
--- a/xfa/fxgraphics/cfx_graphics.cpp
+++ b/xfa/fxgraphics/cfx_graphics.cpp
@@ -570,28 +570,28 @@ CFX_Graphics::CFX_Graphics()
m_renderDevice(nullptr),
m_aggGraphics(nullptr) {}
-FX_ERR CFX_Graphics::Create(CFX_RenderDevice* renderDevice,
- FX_BOOL isAntialiasing) {
+FWL_Error CFX_Graphics::Create(CFX_RenderDevice* renderDevice,
+ FX_BOOL isAntialiasing) {
if (!renderDevice)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type != FX_CONTEXT_None)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_type = FX_CONTEXT_Device;
m_info.isAntialiasing = isAntialiasing;
m_renderDevice = renderDevice;
if (m_renderDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)
- return FX_ERR_Succeeded;
- return FX_ERR_Indefinite;
+ return FWL_Error::Succeeded;
+ return FWL_Error::Indefinite;
}
-FX_ERR CFX_Graphics::Create(int32_t width,
- int32_t height,
- FXDIB_Format format,
- FX_BOOL isNative,
- FX_BOOL isAntialiasing) {
+FWL_Error CFX_Graphics::Create(int32_t width,
+ int32_t height,
+ FXDIB_Format format,
+ FX_BOOL isNative,
+ FX_BOOL isAntialiasing) {
if (m_type != FX_CONTEXT_None)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_type = FX_CONTEXT_Device;
m_info.isAntialiasing = isAntialiasing;
@@ -603,99 +603,100 @@ CFX_Graphics::~CFX_Graphics() {
delete m_aggGraphics;
}
-FX_ERR CFX_Graphics::GetDeviceCap(const int32_t capID, FX_DeviceCap& capVal) {
+FWL_Error CFX_Graphics::GetDeviceCap(const int32_t capID,
+ FX_DeviceCap& capVal) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
capVal = m_renderDevice->GetDeviceCaps(capID);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::IsPrinterDevice(FX_BOOL& isPrinter) {
+FWL_Error CFX_Graphics::IsPrinterDevice(FX_BOOL& isPrinter) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
isPrinter = m_renderDevice->GetDeviceClass() == FXDC_PRINTER;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::EnableAntialiasing(FX_BOOL isAntialiasing) {
+FWL_Error CFX_Graphics::EnableAntialiasing(FX_BOOL isAntialiasing) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.isAntialiasing = isAntialiasing;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SaveGraphState() {
+FWL_Error CFX_Graphics::SaveGraphState() {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_renderDevice->SaveState();
m_infoStack.Add(new TInfo(m_info));
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::RestoreGraphState() {
+FWL_Error CFX_Graphics::RestoreGraphState() {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_renderDevice->RestoreState();
int32_t size = m_infoStack.GetSize();
if (size <= 0) {
- return FX_ERR_Intermediate_Value_Invalid;
+ return FWL_Error::IntermediateValueInvalid;
}
int32_t topIndex = size - 1;
std::unique_ptr<TInfo> info(m_infoStack.GetAt(topIndex));
if (!info)
- return FX_ERR_Intermediate_Value_Invalid;
+ return FWL_Error::IntermediateValueInvalid;
m_info = *info;
m_infoStack.RemoveAt(topIndex);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::GetLineCap(CFX_GraphStateData::LineCap& lineCap) const {
+FWL_Error CFX_Graphics::GetLineCap(CFX_GraphStateData::LineCap& lineCap) const {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
lineCap = m_info.graphState.m_LineCap;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) {
+FWL_Error CFX_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.graphState.m_LineCap = lineCap;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::GetDashCount(int32_t& dashCount) const {
+FWL_Error CFX_Graphics::GetDashCount(int32_t& dashCount) const {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
dashCount = m_info.graphState.m_DashCount;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::GetLineDash(FX_FLOAT& dashPhase,
- FX_FLOAT* dashArray) const {
+FWL_Error CFX_Graphics::GetLineDash(FX_FLOAT& dashPhase,
+ FX_FLOAT* dashArray) const {
if (!dashArray)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
dashPhase = m_info.graphState.m_DashPhase;
FXSYS_memcpy(dashArray, m_info.graphState.m_DashArray,
m_info.graphState.m_DashCount * sizeof(FX_FLOAT));
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetLineDash(FX_FLOAT dashPhase,
- FX_FLOAT* dashArray,
- int32_t dashCount) {
+FWL_Error CFX_Graphics::SetLineDash(FX_FLOAT dashPhase,
+ FX_FLOAT* dashArray,
+ int32_t dashCount) {
if (dashCount > 0 && !dashArray)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
dashCount = dashCount < 0 ? 0 : dashCount;
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
@@ -708,164 +709,165 @@ FX_ERR CFX_Graphics::SetLineDash(FX_FLOAT dashPhase,
for (int32_t i = 0; i < dashCount; i++) {
m_info.graphState.m_DashArray[i] = dashArray[i] * scale;
}
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetLineDash(FX_DashStyle dashStyle) {
+FWL_Error CFX_Graphics::SetLineDash(FX_DashStyle dashStyle) {
if (m_type == FX_CONTEXT_Device && m_renderDevice)
return RenderDeviceSetLineDash(dashStyle);
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::GetLineJoin(CFX_GraphStateData::LineJoin& lineJoin) const {
+FWL_Error CFX_Graphics::GetLineJoin(
+ CFX_GraphStateData::LineJoin& lineJoin) const {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
lineJoin = m_info.graphState.m_LineJoin;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetLineJoin(CFX_GraphStateData::LineJoin lineJoin) {
+FWL_Error CFX_Graphics::SetLineJoin(CFX_GraphStateData::LineJoin lineJoin) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.graphState.m_LineJoin = lineJoin;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::GetMiterLimit(FX_FLOAT& miterLimit) const {
+FWL_Error CFX_Graphics::GetMiterLimit(FX_FLOAT& miterLimit) const {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
miterLimit = m_info.graphState.m_MiterLimit;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetMiterLimit(FX_FLOAT miterLimit) {
+FWL_Error CFX_Graphics::SetMiterLimit(FX_FLOAT miterLimit) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.graphState.m_MiterLimit = miterLimit;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::GetLineWidth(FX_FLOAT& lineWidth) const {
+FWL_Error CFX_Graphics::GetLineWidth(FX_FLOAT& lineWidth) const {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
lineWidth = m_info.graphState.m_LineWidth;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetLineWidth(FX_FLOAT lineWidth, FX_BOOL isActOnDash) {
+FWL_Error CFX_Graphics::SetLineWidth(FX_FLOAT lineWidth, FX_BOOL isActOnDash) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.graphState.m_LineWidth = lineWidth;
m_info.isActOnDash = isActOnDash;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::GetStrokeAlignment(
+FWL_Error CFX_Graphics::GetStrokeAlignment(
FX_StrokeAlignment& strokeAlignment) const {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
strokeAlignment = m_info.strokeAlignment;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetStrokeAlignment(FX_StrokeAlignment strokeAlignment) {
+FWL_Error CFX_Graphics::SetStrokeAlignment(FX_StrokeAlignment strokeAlignment) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.strokeAlignment = strokeAlignment;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetStrokeColor(CFX_Color* color) {
+FWL_Error CFX_Graphics::SetStrokeColor(CFX_Color* color) {
if (!color)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.strokeColor = color;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetFillColor(CFX_Color* color) {
+FWL_Error CFX_Graphics::SetFillColor(CFX_Color* color) {
if (!color)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.fillColor = color;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::StrokePath(CFX_Path* path, CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::StrokePath(CFX_Path* path, CFX_Matrix* matrix) {
if (!path)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice)
return RenderDeviceStrokePath(path, matrix);
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::FillPath(CFX_Path* path,
- FX_FillMode fillMode,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::FillPath(CFX_Path* path,
+ FX_FillMode fillMode,
+ CFX_Matrix* matrix) {
if (!path)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice)
return RenderDeviceFillPath(path, fillMode, matrix);
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::ClipPath(CFX_Path* path,
- FX_FillMode fillMode,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::ClipPath(CFX_Path* path,
+ FX_FillMode fillMode,
+ CFX_Matrix* matrix) {
if (!path)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
FX_BOOL result = m_renderDevice->SetClip_PathFill(
path->GetPathData(), (CFX_Matrix*)matrix, fillMode);
if (!result)
- return FX_ERR_Indefinite;
- return FX_ERR_Succeeded;
+ return FWL_Error::Indefinite;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::DrawImage(CFX_DIBSource* source,
- const CFX_PointF& point,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::DrawImage(CFX_DIBSource* source,
+ const CFX_PointF& point,
+ CFX_Matrix* matrix) {
if (!source)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice)
return RenderDeviceDrawImage(source, point, matrix);
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::StretchImage(CFX_DIBSource* source,
- const CFX_RectF& rect,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::StretchImage(CFX_DIBSource* source,
+ const CFX_RectF& rect,
+ CFX_Matrix* matrix) {
if (!source)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice)
return RenderDeviceStretchImage(source, rect, matrix);
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::ConcatMatrix(const CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::ConcatMatrix(const CFX_Matrix* matrix) {
if (!matrix)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.CTM.Concat(*matrix);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
CFX_Matrix* CFX_Graphics::GetMatrix() {
@@ -874,88 +876,88 @@ CFX_Matrix* CFX_Graphics::GetMatrix() {
return nullptr;
}
-FX_ERR CFX_Graphics::GetClipRect(CFX_RectF& rect) const {
+FWL_Error CFX_Graphics::GetClipRect(CFX_RectF& rect) const {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
FX_RECT r = m_renderDevice->GetClipBox();
rect.left = (FX_FLOAT)r.left;
rect.top = (FX_FLOAT)r.top;
rect.width = (FX_FLOAT)r.Width();
rect.height = (FX_FLOAT)r.Height();
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetClipRect(const CFX_RectF& rect) {
+FWL_Error CFX_Graphics::SetClipRect(const CFX_RectF& rect) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
if (!m_renderDevice->SetClip_Rect(
FX_RECT(FXSYS_round(rect.left), FXSYS_round(rect.top),
FXSYS_round(rect.right()), FXSYS_round(rect.bottom())))) {
- return FX_ERR_Method_Not_Supported;
+ return FWL_Error::MethodNotSupported;
}
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::ClearClip() {
+FWL_Error CFX_Graphics::ClearClip() {
if (m_type == FX_CONTEXT_Device && m_renderDevice)
- return FX_ERR_Succeeded;
- return FX_ERR_Property_Invalid;
+ return FWL_Error::Succeeded;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetFont(CFX_Font* font) {
+FWL_Error CFX_Graphics::SetFont(CFX_Font* font) {
if (!font)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.font = font;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetFontSize(const FX_FLOAT size) {
+FWL_Error CFX_Graphics::SetFontSize(const FX_FLOAT size) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.fontSize = size <= 0 ? 1.0f : size;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetFontHScale(const FX_FLOAT scale) {
+FWL_Error CFX_Graphics::SetFontHScale(const FX_FLOAT scale) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.fontHScale = scale <= 0 ? 1.0f : scale;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetCharSpacing(const FX_FLOAT spacing) {
+FWL_Error CFX_Graphics::SetCharSpacing(const FX_FLOAT spacing) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
m_info.fontSpacing = spacing < 0 ? 0 : spacing;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetTextDrawingMode(const int32_t mode) {
+FWL_Error CFX_Graphics::SetTextDrawingMode(const int32_t mode) {
if (m_type == FX_CONTEXT_Device && m_renderDevice)
- return FX_ERR_Succeeded;
- return FX_ERR_Property_Invalid;
+ return FWL_Error::Succeeded;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::ShowText(const CFX_PointF& point,
- const CFX_WideString& text,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::ShowText(const CFX_PointF& point,
+ const CFX_WideString& text,
+ CFX_Matrix* matrix) {
if (m_type == FX_CONTEXT_Device && m_renderDevice)
return RenderDeviceShowText(point, text, matrix);
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::CalcTextRect(CFX_RectF& rect,
- const CFX_WideString& text,
- FX_BOOL isMultiline,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::CalcTextRect(CFX_RectF& rect,
+ const CFX_WideString& text,
+ FX_BOOL isMultiline,
+ CFX_Matrix* matrix) {
if (m_type == FX_CONTEXT_Device && m_renderDevice) {
int32_t length = text.GetLength();
uint32_t* charCodes = FX_Alloc(uint32_t, length);
@@ -963,15 +965,15 @@ FX_ERR CFX_Graphics::CalcTextRect(CFX_RectF& rect,
CalcTextInfo(text, charCodes, charPos, rect);
FX_Free(charPos);
FX_Free(charCodes);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::Transfer(CFX_Graphics* graphics,
- const CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::Transfer(CFX_Graphics* graphics,
+ const CFX_Matrix* matrix) {
if (!graphics || !graphics->m_renderDevice)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
CFX_Matrix m;
m.Set(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e,
m_info.CTM.f);
@@ -982,19 +984,19 @@ FX_ERR CFX_Graphics::Transfer(CFX_Graphics* graphics,
CFX_DIBitmap* bitmap = graphics->m_renderDevice->GetBitmap();
FX_BOOL result = m_renderDevice->SetDIBits(bitmap, 0, 0);
if (!result)
- return FX_ERR_Method_Not_Supported;
- return FX_ERR_Succeeded;
+ return FWL_Error::MethodNotSupported;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::Transfer(CFX_Graphics* graphics,
- FX_FLOAT srcLeft,
- FX_FLOAT srcTop,
- const CFX_RectF& dstRect,
- const CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::Transfer(CFX_Graphics* graphics,
+ FX_FLOAT srcLeft,
+ FX_FLOAT srcTop,
+ const CFX_RectF& dstRect,
+ const CFX_Matrix* matrix) {
if (!graphics || !graphics->m_renderDevice)
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
CFX_Matrix m;
m.Set(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e,
m_info.CTM.f);
@@ -1007,37 +1009,37 @@ FX_ERR CFX_Graphics::Transfer(CFX_Graphics* graphics,
bmp.Create((int32_t)dstRect.width, (int32_t)dstRect.height,
graphics->m_renderDevice->GetBitmap()->GetFormat());
if (!result)
- return FX_ERR_Intermediate_Value_Invalid;
+ return FWL_Error::IntermediateValueInvalid;
result = graphics->m_renderDevice->GetDIBits(&bmp, (int32_t)srcLeft,
(int32_t)srcTop);
if (!result)
- return FX_ERR_Method_Not_Supported;
+ return FWL_Error::MethodNotSupported;
result = m_renderDevice->SetDIBits(&bmp, (int32_t)dstRect.left,
(int32_t)dstRect.top);
if (!result)
- return FX_ERR_Method_Not_Supported;
- return FX_ERR_Succeeded;
+ return FWL_Error::MethodNotSupported;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
CFX_RenderDevice* CFX_Graphics::GetRenderDevice() {
return m_renderDevice;
}
-FX_ERR CFX_Graphics::InverseRect(const CFX_RectF& rect) {
+FWL_Error CFX_Graphics::InverseRect(const CFX_RectF& rect) {
if (!m_renderDevice)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap();
if (!bitmap)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_RectF temp(rect);
m_info.CTM.TransformRect(temp);
CFX_RectF r;
r.Set(0, 0, (FX_FLOAT)bitmap->GetWidth(), (FX_FLOAT)bitmap->GetWidth());
r.Intersect(temp);
if (r.IsEmpty()) {
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
}
FX_ARGB* pBuf =
(FX_ARGB*)(bitmap->GetBuffer() + int32_t(r.top) * bitmap->GetPitch());
@@ -1051,23 +1053,23 @@ FX_ERR CFX_Graphics::InverseRect(const CFX_RectF& rect) {
}
pBuf = (FX_ARGB*)((uint8_t*)pBuf + bitmap->GetPitch());
}
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Graphics::XorDIBitmap(const CFX_DIBitmap* srcBitmap,
- const CFX_RectF& rect) {
+FWL_Error CFX_Graphics::XorDIBitmap(const CFX_DIBitmap* srcBitmap,
+ const CFX_RectF& rect) {
if (!m_renderDevice)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_DIBitmap* dst = m_renderDevice->GetBitmap();
if (!dst)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_RectF temp(rect);
m_info.CTM.TransformRect(temp);
CFX_RectF r;
r.Set(0, 0, (FX_FLOAT)dst->GetWidth(), (FX_FLOAT)dst->GetWidth());
r.Intersect(temp);
if (r.IsEmpty()) {
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
}
FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() +
int32_t(r.top) * srcBitmap->GetPitch());
@@ -1087,23 +1089,23 @@ FX_ERR CFX_Graphics::XorDIBitmap(const CFX_DIBitmap* srcBitmap,
pSrcBuf = (FX_ARGB*)((uint8_t*)pSrcBuf + srcBitmap->GetPitch());
pDstBuf = (FX_ARGB*)((uint8_t*)pDstBuf + dst->GetPitch());
}
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Graphics::EqvDIBitmap(const CFX_DIBitmap* srcBitmap,
- const CFX_RectF& rect) {
+FWL_Error CFX_Graphics::EqvDIBitmap(const CFX_DIBitmap* srcBitmap,
+ const CFX_RectF& rect) {
if (!m_renderDevice)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_DIBitmap* dst = m_renderDevice->GetBitmap();
if (!dst)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_RectF temp(rect);
m_info.CTM.TransformRect(temp);
CFX_RectF r;
r.Set(0, 0, (FX_FLOAT)dst->GetWidth(), (FX_FLOAT)dst->GetWidth());
r.Intersect(temp);
if (r.IsEmpty()) {
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
}
FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() +
int32_t(r.top) * srcBitmap->GetPitch());
@@ -1123,44 +1125,44 @@ FX_ERR CFX_Graphics::EqvDIBitmap(const CFX_DIBitmap* srcBitmap,
pSrcBuf = (FX_ARGB*)((uint8_t*)pSrcBuf + srcBitmap->GetPitch());
pDstBuf = (FX_ARGB*)((uint8_t*)pDstBuf + dst->GetPitch());
}
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Graphics::RenderDeviceSetLineDash(FX_DashStyle dashStyle) {
+FWL_Error CFX_Graphics::RenderDeviceSetLineDash(FX_DashStyle dashStyle) {
switch (dashStyle) {
case FX_DASHSTYLE_Solid: {
m_info.graphState.SetDashCount(0);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
case FX_DASHSTYLE_Dash: {
FX_FLOAT dashArray[] = {3, 1};
SetLineDash(0, dashArray, 2);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
case FX_DASHSTYLE_Dot: {
FX_FLOAT dashArray[] = {1, 1};
SetLineDash(0, dashArray, 2);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
case FX_DASHSTYLE_DashDot: {
FX_FLOAT dashArray[] = {3, 1, 1, 1};
SetLineDash(0, dashArray, 4);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
case FX_DASHSTYLE_DashDotDot: {
FX_FLOAT dashArray[] = {4, 1, 2, 1, 2, 1};
SetLineDash(0, dashArray, 6);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
default:
- return FX_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
}
}
-FX_ERR CFX_Graphics::RenderDeviceStrokePath(CFX_Path* path,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::RenderDeviceStrokePath(CFX_Path* path,
+ CFX_Matrix* matrix) {
if (!m_info.strokeColor)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_Matrix m;
m.Set(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e,
m_info.CTM.f);
@@ -1173,23 +1175,23 @@ FX_ERR CFX_Graphics::RenderDeviceStrokePath(CFX_Path* path,
path->GetPathData(), (CFX_Matrix*)&m, &m_info.graphState, 0x0,
m_info.strokeColor->m_info.argb, 0);
if (!result)
- return FX_ERR_Indefinite;
- return FX_ERR_Succeeded;
+ return FWL_Error::Indefinite;
+ return FWL_Error::Succeeded;
}
case FX_COLOR_Pattern:
return StrokePathWithPattern(path, &m);
case FX_COLOR_Shading:
return StrokePathWithShading(path, &m);
default:
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
}
-FX_ERR CFX_Graphics::RenderDeviceFillPath(CFX_Path* path,
- FX_FillMode fillMode,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::RenderDeviceFillPath(CFX_Path* path,
+ FX_FillMode fillMode,
+ CFX_Matrix* matrix) {
if (!m_info.fillColor)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
CFX_Matrix m;
m.Set(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e,
m_info.CTM.f);
@@ -1202,21 +1204,21 @@ FX_ERR CFX_Graphics::RenderDeviceFillPath(CFX_Path* path,
path->GetPathData(), (CFX_Matrix*)&m, &m_info.graphState,
m_info.fillColor->m_info.argb, 0x0, fillMode);
if (!result)
- return FX_ERR_Indefinite;
- return FX_ERR_Succeeded;
+ return FWL_Error::Indefinite;
+ return FWL_Error::Succeeded;
}
case FX_COLOR_Pattern:
return FillPathWithPattern(path, fillMode, &m);
case FX_COLOR_Shading:
return FillPathWithShading(path, fillMode, &m);
default:
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
}
}
-FX_ERR CFX_Graphics::RenderDeviceDrawImage(CFX_DIBSource* source,
- const CFX_PointF& point,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::RenderDeviceDrawImage(CFX_DIBSource* source,
+ const CFX_PointF& point,
+ CFX_Matrix* matrix) {
CFX_Matrix m1;
m1.Set(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e,
m_info.CTM.f);
@@ -1242,14 +1244,14 @@ FX_ERR CFX_Graphics::RenderDeviceDrawImage(CFX_DIBSource* source,
bmp2.get(), FXSYS_round(r.left - left),
FXSYS_round(r.top - top)) &&
m_renderDevice->SetDIBits(&bmp, 0, 0)) {
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Indefinite;
+ return FWL_Error::Indefinite;
}
-FX_ERR CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource* source,
- const CFX_RectF& rect,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource* source,
+ const CFX_RectF& rect,
+ CFX_Matrix* matrix) {
CFX_Matrix m1;
m1.Set(m_info.CTM.a, m_info.CTM.b, m_info.CTM.c, m_info.CTM.d, m_info.CTM.e,
m_info.CTM.f);
@@ -1272,14 +1274,14 @@ FX_ERR CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource* source,
FXSYS_round(r.Width()), FXSYS_round(r.Height()),
bmp3.get(), FXSYS_round(r.left - left),
FXSYS_round(r.top - top))) {
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
- return FX_ERR_Indefinite;
+ return FWL_Error::Indefinite;
}
-FX_ERR CFX_Graphics::RenderDeviceShowText(const CFX_PointF& point,
- const CFX_WideString& text,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::RenderDeviceShowText(const CFX_PointF& point,
+ const CFX_WideString& text,
+ CFX_Matrix* matrix) {
int32_t length = text.GetLength();
uint32_t* charCodes = FX_Alloc(uint32_t, length);
FXTEXT_CHARPOS* charPos = FX_Alloc(FXTEXT_CHARPOS, length);
@@ -1298,23 +1300,25 @@ FX_ERR CFX_Graphics::RenderDeviceShowText(const CFX_PointF& point,
-m_info.fontSize * m_info.fontHScale, (CFX_Matrix*)&m,
m_info.fillColor->m_info.argb, FXTEXT_CLEARTYPE);
if (!result)
- return FX_ERR_Indefinite;
+ return FWL_Error::Indefinite;
FX_Free(charPos);
FX_Free(charCodes);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Graphics::StrokePathWithPattern(CFX_Path* path, CFX_Matrix* matrix) {
- return FX_ERR_Method_Not_Supported;
+FWL_Error CFX_Graphics::StrokePathWithPattern(CFX_Path* path,
+ CFX_Matrix* matrix) {
+ return FWL_Error::MethodNotSupported;
}
-FX_ERR CFX_Graphics::StrokePathWithShading(CFX_Path* path, CFX_Matrix* matrix) {
- return FX_ERR_Method_Not_Supported;
+FWL_Error CFX_Graphics::StrokePathWithShading(CFX_Path* path,
+ CFX_Matrix* matrix) {
+ return FWL_Error::MethodNotSupported;
}
-FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path* path,
- FX_FillMode fillMode,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::FillPathWithPattern(CFX_Path* path,
+ FX_FillMode fillMode,
+ CFX_Matrix* matrix) {
CFX_Pattern* pattern = m_info.fillColor->m_info.pattern;
CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap();
int32_t width = bitmap->GetWidth();
@@ -1326,7 +1330,7 @@ FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path* path,
FX_HatchStyle hatchStyle = m_info.fillColor->m_info.pattern->m_hatchStyle;
if (hatchStyle < FX_HATCHSTYLE_Horizontal ||
hatchStyle > FX_HATCHSTYLE_SolidDiamond) {
- return FX_ERR_Intermediate_Value_Invalid;
+ return FWL_Error::IntermediateValueInvalid;
}
const FX_HATCHDATA& data = hatchBitmapData[hatchStyle];
CFX_DIBitmap mask;
@@ -1353,12 +1357,12 @@ FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path* path,
fillMode);
SetDIBitsWithMatrix(&bmp, &pattern->m_matrix);
m_renderDevice->RestoreState();
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
- FX_FillMode fillMode,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::FillPathWithShading(CFX_Path* path,
+ FX_FillMode fillMode,
+ CFX_Matrix* matrix) {
CFX_DIBitmap* bitmap = m_renderDevice->GetBitmap();
int32_t width = bitmap->GetWidth();
int32_t height = bitmap->GetHeight();
@@ -1370,7 +1374,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
bmp.Create(width, height, FXDIB_Argb);
m_renderDevice->GetDIBits(&bmp, 0, 0);
int32_t pitch = bmp.GetPitch();
- FX_BOOL result = FALSE;
+ bool result = false;
switch (m_info.fillColor->m_shading->m_type) {
case FX_SHADING_Axial: {
FX_FLOAT x_span = end_x - start_x;
@@ -1399,7 +1403,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
dib_buf[column] = m_info.fillColor->m_shading->m_argbArray[index];
}
}
- result = TRUE;
+ result = true;
break;
}
case FX_SHADING_Radial: {
@@ -1460,10 +1464,13 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
dib_buf[column] = m_info.fillColor->m_shading->m_argbArray[index];
}
}
- result = TRUE;
+ result = true;
+ break;
+ }
+ default: {
+ result = false;
break;
}
- default: { result = FALSE; }
}
if (result) {
m_renderDevice->SaveState();
@@ -1472,11 +1479,11 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
SetDIBitsWithMatrix(&bmp, matrix);
m_renderDevice->RestoreState();
}
- return result;
+ return result ? FWL_Error::Succeeded : FWL_Error::PropertyInvalid;
}
-FX_ERR CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource* source,
- CFX_Matrix* matrix) {
+FWL_Error CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource* source,
+ CFX_Matrix* matrix) {
if (matrix->IsIdentity()) {
m_renderDevice->SetDIBits(source, 0, 0);
} else {
@@ -1490,13 +1497,13 @@ FX_ERR CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource* source,
bmp1->TransformTo((CFX_Matrix*)&m, left, top));
m_renderDevice->SetDIBits(bmp2.get(), left, top);
}
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString& text,
- uint32_t* charCodes,
- FXTEXT_CHARPOS* charPos,
- CFX_RectF& rect) {
+FWL_Error CFX_Graphics::CalcTextInfo(const CFX_WideString& text,
+ uint32_t* charCodes,
+ FXTEXT_CHARPOS* charPos,
+ CFX_RectF& rect) {
std::unique_ptr<CFX_UnicodeEncoding> encoding(
new CFX_UnicodeEncoding(m_info.font));
int32_t length = text.GetLength();
@@ -1535,7 +1542,7 @@ FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString& text,
}
rect.width = (FX_FLOAT)penX - rect.left;
rect.height = rect.top + m_info.fontSize * m_info.fontHScale - rect.top;
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_Graphics::TInfo::TInfo(const TInfo& info)
diff --git a/xfa/fxgraphics/cfx_path.cpp b/xfa/fxgraphics/cfx_path.cpp
index 2acdc3eac2..fe956d3fcc 100644
--- a/xfa/fxgraphics/cfx_path.cpp
+++ b/xfa/fxgraphics/cfx_path.cpp
@@ -12,163 +12,165 @@ CFX_Path::CFX_Path() {
m_generator = nullptr;
}
-FX_ERR CFX_Path::Create() {
+FWL_Error CFX_Path::Create() {
if (m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator = new CFX_PathGenerator;
m_generator->Create();
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_Path::~CFX_Path() {
delete m_generator;
}
-FX_ERR CFX_Path::MoveTo(FX_FLOAT x, FX_FLOAT y) {
+FWL_Error CFX_Path::MoveTo(FX_FLOAT x, FX_FLOAT y) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->MoveTo(x, y);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::LineTo(FX_FLOAT x, FX_FLOAT y) {
+FWL_Error CFX_Path::LineTo(FX_FLOAT x, FX_FLOAT y) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->LineTo(x, y);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::BezierTo(FX_FLOAT ctrlX1,
- FX_FLOAT ctrlY1,
- FX_FLOAT ctrlX2,
- FX_FLOAT ctrlY2,
- FX_FLOAT toX,
- FX_FLOAT toY) {
+FWL_Error CFX_Path::BezierTo(FX_FLOAT ctrlX1,
+ FX_FLOAT ctrlY1,
+ FX_FLOAT ctrlX2,
+ FX_FLOAT ctrlY2,
+ FX_FLOAT toX,
+ FX_FLOAT toY) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->BezierTo(ctrlX1, ctrlY1, ctrlX2, ctrlY2, toX, toY);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::ArcTo(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle) {
+FWL_Error CFX_Path::ArcTo(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->ArcTo(left + width / 2, top + height / 2, width / 2, height / 2,
startAngle, sweepAngle);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::Close() {
+FWL_Error CFX_Path::Close() {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->Close();
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2) {
+FWL_Error CFX_Path::AddLine(FX_FLOAT x1,
+ FX_FLOAT y1,
+ FX_FLOAT x2,
+ FX_FLOAT y2) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddLine(x1, y1, x2, y2);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddBezier(FX_FLOAT startX,
- FX_FLOAT startY,
- FX_FLOAT ctrlX1,
- FX_FLOAT ctrlY1,
- FX_FLOAT ctrlX2,
- FX_FLOAT ctrlY2,
- FX_FLOAT endX,
- FX_FLOAT endY) {
+FWL_Error CFX_Path::AddBezier(FX_FLOAT startX,
+ FX_FLOAT startY,
+ FX_FLOAT ctrlX1,
+ FX_FLOAT ctrlY1,
+ FX_FLOAT ctrlX2,
+ FX_FLOAT ctrlY2,
+ FX_FLOAT endX,
+ FX_FLOAT endY) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddBezier(startX, startY, ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX,
endY);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddRectangle(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height) {
+FWL_Error CFX_Path::AddRectangle(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddRectangle(left, top, left + width, top + height);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddEllipse(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height) {
+FWL_Error CFX_Path::AddEllipse(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddEllipse(left + width / 2, top + height / 2, width / 2,
height / 2);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddEllipse(const CFX_RectF& rect) {
+FWL_Error CFX_Path::AddEllipse(const CFX_RectF& rect) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddEllipse(rect.left + rect.Width() / 2,
rect.top + rect.Height() / 2, rect.Width() / 2,
rect.Height() / 2);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddArc(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle) {
+FWL_Error CFX_Path::AddArc(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddArc(left + width / 2, top + height / 2, width / 2, height / 2,
startAngle, sweepAngle);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddPie(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle) {
+FWL_Error CFX_Path::AddPie(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddPie(left + width / 2, top + height / 2, width / 2, height / 2,
startAngle, sweepAngle);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddSubpath(CFX_Path* path) {
+FWL_Error CFX_Path::AddSubpath(CFX_Path* path) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddPathData(path->GetPathData());
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::Clear() {
+FWL_Error CFX_Path::Clear() {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->GetPathData()->SetPointCount(0);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_BOOL CFX_Path::IsEmpty() {
if (!m_generator)
- return FX_ERR_Property_Invalid;
- if (m_generator->GetPathData()->GetPointCount() == 0) {
+ return FALSE;
+ if (m_generator->GetPathData()->GetPointCount() == 0)
return TRUE;
- }
return FALSE;
}
diff --git a/xfa/fxgraphics/cfx_path.h b/xfa/fxgraphics/cfx_path.h
index 5b5840fa0b..f42586f0de 100644
--- a/xfa/fxgraphics/cfx_path.h
+++ b/xfa/fxgraphics/cfx_path.h
@@ -18,55 +18,55 @@ class CFX_Path {
CFX_Path();
virtual ~CFX_Path();
- FX_ERR Create();
- FX_ERR MoveTo(FX_FLOAT x, FX_FLOAT y);
- FX_ERR LineTo(FX_FLOAT x, FX_FLOAT y);
- FX_ERR BezierTo(FX_FLOAT ctrlX1,
- FX_FLOAT ctrlY1,
- FX_FLOAT ctrlX2,
- FX_FLOAT ctrlY2,
- FX_FLOAT toX,
- FX_FLOAT toY);
- FX_ERR ArcTo(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle);
- FX_ERR Close();
+ FWL_Error Create();
+ FWL_Error MoveTo(FX_FLOAT x, FX_FLOAT y);
+ FWL_Error LineTo(FX_FLOAT x, FX_FLOAT y);
+ FWL_Error BezierTo(FX_FLOAT ctrlX1,
+ FX_FLOAT ctrlY1,
+ FX_FLOAT ctrlX2,
+ FX_FLOAT ctrlY2,
+ FX_FLOAT toX,
+ FX_FLOAT toY);
+ FWL_Error ArcTo(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle);
+ FWL_Error Close();
- FX_ERR AddLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2);
- FX_ERR AddBezier(FX_FLOAT startX,
- FX_FLOAT startY,
- FX_FLOAT ctrlX1,
- FX_FLOAT ctrlY1,
- FX_FLOAT ctrlX2,
- FX_FLOAT ctrlY2,
- FX_FLOAT endX,
- FX_FLOAT endY);
- FX_ERR AddRectangle(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height);
- FX_ERR AddEllipse(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height);
- FX_ERR AddEllipse(const CFX_RectF& rect);
- FX_ERR AddArc(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle);
- FX_ERR AddPie(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle);
- FX_ERR AddSubpath(CFX_Path* path);
- FX_ERR Clear();
+ FWL_Error AddLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2);
+ FWL_Error AddBezier(FX_FLOAT startX,
+ FX_FLOAT startY,
+ FX_FLOAT ctrlX1,
+ FX_FLOAT ctrlY1,
+ FX_FLOAT ctrlX2,
+ FX_FLOAT ctrlY2,
+ FX_FLOAT endX,
+ FX_FLOAT endY);
+ FWL_Error AddRectangle(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height);
+ FWL_Error AddEllipse(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height);
+ FWL_Error AddEllipse(const CFX_RectF& rect);
+ FWL_Error AddArc(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle);
+ FWL_Error AddPie(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle);
+ FWL_Error AddSubpath(CFX_Path* path);
+ FWL_Error Clear();
FX_BOOL IsEmpty();
CFX_PathData* GetPathData();
diff --git a/xfa/fxgraphics/include/cfx_graphics.h b/xfa/fxgraphics/include/cfx_graphics.h
index 7f456270a5..3f969432ea 100644
--- a/xfa/fxgraphics/include/cfx_graphics.h
+++ b/xfa/fxgraphics/include/cfx_graphics.h
@@ -10,20 +10,12 @@
#include "core/fxcrt/include/fx_system.h"
#include "core/fxge/include/fx_dib.h"
#include "core/fxge/include/fx_ge.h"
+#include "xfa/fwl/core/fwl_error.h"
class CFX_Color;
class CFX_Path;
class CAGG_Graphics;
-#define FX_ERR_Succeeded 0
-#define FX_ERR_Indefinite -1
-#define FX_ERR_Parameter_Invalid -100
-#define FX_ERR_Property_Invalid -200
-#define FX_ERR_Intermediate_Value_Invalid -300
-#define FX_ERR_Method_Not_Supported -400
-#define FX_ERR_Out_Of_Memory -500
-
-using FX_ERR = int;
using FX_DeviceCap = int32_t;
using FX_FillMode = int32_t;
@@ -106,81 +98,82 @@ class CFX_Graphics {
CFX_Graphics();
virtual ~CFX_Graphics();
- FX_ERR Create(CFX_RenderDevice* renderDevice, FX_BOOL isAntialiasing = TRUE);
- FX_ERR Create(int32_t width,
- int32_t height,
- FXDIB_Format format,
- FX_BOOL isNative = TRUE,
- FX_BOOL isAntialiasing = TRUE);
-
- FX_ERR GetDeviceCap(const int32_t capID, FX_DeviceCap& capVal);
- FX_ERR IsPrinterDevice(FX_BOOL& isPrinter);
- FX_ERR EnableAntialiasing(FX_BOOL isAntialiasing);
-
- FX_ERR SaveGraphState();
- FX_ERR RestoreGraphState();
-
- FX_ERR GetLineCap(CFX_GraphStateData::LineCap& lineCap) const;
- FX_ERR GetDashCount(int32_t& dashCount) const;
- FX_ERR GetLineDash(FX_FLOAT& dashPhase, FX_FLOAT* dashArray) const;
- FX_ERR GetLineJoin(CFX_GraphStateData::LineJoin& lineJoin) const;
- FX_ERR GetMiterLimit(FX_FLOAT& miterLimit) const;
- FX_ERR GetLineWidth(FX_FLOAT& lineWidth) const;
- FX_ERR GetStrokeAlignment(FX_StrokeAlignment& strokeAlignment) const;
- FX_ERR GetClipRect(CFX_RectF& rect) const;
+ FWL_Error Create(CFX_RenderDevice* renderDevice,
+ FX_BOOL isAntialiasing = TRUE);
+ FWL_Error Create(int32_t width,
+ int32_t height,
+ FXDIB_Format format,
+ FX_BOOL isNative = TRUE,
+ FX_BOOL isAntialiasing = TRUE);
+
+ FWL_Error GetDeviceCap(const int32_t capID, FX_DeviceCap& capVal);
+ FWL_Error IsPrinterDevice(FX_BOOL& isPrinter);
+ FWL_Error EnableAntialiasing(FX_BOOL isAntialiasing);
+
+ FWL_Error SaveGraphState();
+ FWL_Error RestoreGraphState();
+
+ FWL_Error GetLineCap(CFX_GraphStateData::LineCap& lineCap) const;
+ FWL_Error GetDashCount(int32_t& dashCount) const;
+ FWL_Error GetLineDash(FX_FLOAT& dashPhase, FX_FLOAT* dashArray) const;
+ FWL_Error GetLineJoin(CFX_GraphStateData::LineJoin& lineJoin) const;
+ FWL_Error GetMiterLimit(FX_FLOAT& miterLimit) const;
+ FWL_Error GetLineWidth(FX_FLOAT& lineWidth) const;
+ FWL_Error GetStrokeAlignment(FX_StrokeAlignment& strokeAlignment) const;
+ FWL_Error GetClipRect(CFX_RectF& rect) const;
CFX_Matrix* GetMatrix();
CFX_RenderDevice* GetRenderDevice();
- FX_ERR SetLineCap(CFX_GraphStateData::LineCap lineCap);
- FX_ERR SetLineDash(FX_FLOAT dashPhase,
- FX_FLOAT* dashArray,
- int32_t dashCount);
- FX_ERR SetLineDash(FX_DashStyle dashStyle);
- FX_ERR SetLineJoin(CFX_GraphStateData::LineJoin lineJoin);
- FX_ERR SetMiterLimit(FX_FLOAT miterLimit);
- FX_ERR SetLineWidth(FX_FLOAT lineWidth, FX_BOOL isActOnDash = FALSE);
- FX_ERR SetStrokeAlignment(FX_StrokeAlignment strokeAlignment);
- FX_ERR SetStrokeColor(CFX_Color* color);
- FX_ERR SetFillColor(CFX_Color* color);
- FX_ERR SetClipRect(const CFX_RectF& rect);
- FX_ERR SetFont(CFX_Font* font);
- FX_ERR SetFontSize(const FX_FLOAT size);
- FX_ERR SetFontHScale(const FX_FLOAT scale);
- FX_ERR SetCharSpacing(const FX_FLOAT spacing);
- FX_ERR SetTextDrawingMode(const int32_t mode);
-
- FX_ERR StrokePath(CFX_Path* path, CFX_Matrix* matrix = NULL);
- FX_ERR FillPath(CFX_Path* path,
- FX_FillMode fillMode = FXFILL_WINDING,
- CFX_Matrix* matrix = NULL);
- FX_ERR ClipPath(CFX_Path* path,
- FX_FillMode fillMode = FXFILL_WINDING,
- CFX_Matrix* matrix = NULL);
- FX_ERR DrawImage(CFX_DIBSource* source,
- const CFX_PointF& point,
- CFX_Matrix* matrix = NULL);
- FX_ERR StretchImage(CFX_DIBSource* source,
- const CFX_RectF& rect,
- CFX_Matrix* matrix = NULL);
- FX_ERR ConcatMatrix(const CFX_Matrix* matrix);
- FX_ERR ClearClip();
- FX_ERR ShowText(const CFX_PointF& point,
- const CFX_WideString& text,
- CFX_Matrix* matrix = NULL);
- FX_ERR CalcTextRect(CFX_RectF& rect,
- const CFX_WideString& text,
- FX_BOOL isMultiline = FALSE,
+ FWL_Error SetLineCap(CFX_GraphStateData::LineCap lineCap);
+ FWL_Error SetLineDash(FX_FLOAT dashPhase,
+ FX_FLOAT* dashArray,
+ int32_t dashCount);
+ FWL_Error SetLineDash(FX_DashStyle dashStyle);
+ FWL_Error SetLineJoin(CFX_GraphStateData::LineJoin lineJoin);
+ FWL_Error SetMiterLimit(FX_FLOAT miterLimit);
+ FWL_Error SetLineWidth(FX_FLOAT lineWidth, FX_BOOL isActOnDash = FALSE);
+ FWL_Error SetStrokeAlignment(FX_StrokeAlignment strokeAlignment);
+ FWL_Error SetStrokeColor(CFX_Color* color);
+ FWL_Error SetFillColor(CFX_Color* color);
+ FWL_Error SetClipRect(const CFX_RectF& rect);
+ FWL_Error SetFont(CFX_Font* font);
+ FWL_Error SetFontSize(const FX_FLOAT size);
+ FWL_Error SetFontHScale(const FX_FLOAT scale);
+ FWL_Error SetCharSpacing(const FX_FLOAT spacing);
+ FWL_Error SetTextDrawingMode(const int32_t mode);
+
+ FWL_Error StrokePath(CFX_Path* path, CFX_Matrix* matrix = NULL);
+ FWL_Error FillPath(CFX_Path* path,
+ FX_FillMode fillMode = FXFILL_WINDING,
+ CFX_Matrix* matrix = NULL);
+ FWL_Error ClipPath(CFX_Path* path,
+ FX_FillMode fillMode = FXFILL_WINDING,
+ CFX_Matrix* matrix = NULL);
+ FWL_Error DrawImage(CFX_DIBSource* source,
+ const CFX_PointF& point,
CFX_Matrix* matrix = NULL);
- FX_ERR Transfer(CFX_Graphics* graphics, const CFX_Matrix* matrix);
- FX_ERR Transfer(CFX_Graphics* graphics,
- FX_FLOAT srcLeft,
- FX_FLOAT srcTop,
- const CFX_RectF& dstRect,
- const CFX_Matrix* matrix);
-
- FX_ERR InverseRect(const CFX_RectF& rect);
- FX_ERR XorDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect);
- FX_ERR EqvDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect);
+ FWL_Error StretchImage(CFX_DIBSource* source,
+ const CFX_RectF& rect,
+ CFX_Matrix* matrix = NULL);
+ FWL_Error ConcatMatrix(const CFX_Matrix* matrix);
+ FWL_Error ClearClip();
+ FWL_Error ShowText(const CFX_PointF& point,
+ const CFX_WideString& text,
+ CFX_Matrix* matrix = NULL);
+ FWL_Error CalcTextRect(CFX_RectF& rect,
+ const CFX_WideString& text,
+ FX_BOOL isMultiline = FALSE,
+ CFX_Matrix* matrix = NULL);
+ FWL_Error Transfer(CFX_Graphics* graphics, const CFX_Matrix* matrix);
+ FWL_Error Transfer(CFX_Graphics* graphics,
+ FX_FLOAT srcLeft,
+ FX_FLOAT srcTop,
+ const CFX_RectF& dstRect,
+ const CFX_Matrix* matrix);
+
+ FWL_Error InverseRect(const CFX_RectF& rect);
+ FWL_Error XorDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect);
+ FWL_Error EqvDIBitmap(const CFX_DIBitmap* srcBitmap, const CFX_RectF& rect);
protected:
int32_t m_type;
@@ -213,36 +206,36 @@ class CFX_Graphics {
FX_FLOAT fontSpacing;
} m_info;
- FX_ERR RenderDeviceSetLineDash(FX_DashStyle dashStyle);
- FX_ERR RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix);
- FX_ERR RenderDeviceFillPath(CFX_Path* path,
- FX_FillMode fillMode,
- CFX_Matrix* matrix);
- FX_ERR RenderDeviceDrawImage(CFX_DIBSource* source,
- const CFX_PointF& point,
- CFX_Matrix* matrix);
- FX_ERR RenderDeviceStretchImage(CFX_DIBSource* source,
- const CFX_RectF& rect,
+ FWL_Error RenderDeviceSetLineDash(FX_DashStyle dashStyle);
+ FWL_Error RenderDeviceStrokePath(CFX_Path* path, CFX_Matrix* matrix);
+ FWL_Error RenderDeviceFillPath(CFX_Path* path,
+ FX_FillMode fillMode,
+ CFX_Matrix* matrix);
+ FWL_Error RenderDeviceDrawImage(CFX_DIBSource* source,
+ const CFX_PointF& point,
CFX_Matrix* matrix);
- FX_ERR RenderDeviceShowText(const CFX_PointF& point,
- const CFX_WideString& text,
- CFX_Matrix* matrix);
-
- FX_ERR StrokePathWithPattern(CFX_Path* path, CFX_Matrix* matrix);
- FX_ERR StrokePathWithShading(CFX_Path* path, CFX_Matrix* matrix);
-
- FX_ERR FillPathWithPattern(CFX_Path* path,
- FX_FillMode fillMode,
- CFX_Matrix* matrix);
- FX_ERR FillPathWithShading(CFX_Path* path,
- FX_FillMode fillMode,
- CFX_Matrix* matrix);
-
- FX_ERR SetDIBitsWithMatrix(CFX_DIBSource* source, CFX_Matrix* matrix);
- FX_ERR CalcTextInfo(const CFX_WideString& text,
- uint32_t* charCodes,
- FXTEXT_CHARPOS* charPos,
- CFX_RectF& rect);
+ FWL_Error RenderDeviceStretchImage(CFX_DIBSource* source,
+ const CFX_RectF& rect,
+ CFX_Matrix* matrix);
+ FWL_Error RenderDeviceShowText(const CFX_PointF& point,
+ const CFX_WideString& text,
+ CFX_Matrix* matrix);
+
+ FWL_Error StrokePathWithPattern(CFX_Path* path, CFX_Matrix* matrix);
+ FWL_Error StrokePathWithShading(CFX_Path* path, CFX_Matrix* matrix);
+
+ FWL_Error FillPathWithPattern(CFX_Path* path,
+ FX_FillMode fillMode,
+ CFX_Matrix* matrix);
+ FWL_Error FillPathWithShading(CFX_Path* path,
+ FX_FillMode fillMode,
+ CFX_Matrix* matrix);
+
+ FWL_Error SetDIBitsWithMatrix(CFX_DIBSource* source, CFX_Matrix* matrix);
+ FWL_Error CalcTextInfo(const CFX_WideString& text,
+ uint32_t* charCodes,
+ FXTEXT_CHARPOS* charPos,
+ CFX_RectF& rect);
CFX_RenderDevice* m_renderDevice;
CFX_ArrayTemplate<TInfo*> m_infoStack;