Skip to content

Commit 0901297

Browse files
chrissherlockquikee
authored andcommitted
vcl: create drawmode functions
Change-Id: I3cb0325dc16db84ad58de28aa9110e9c7a0b9697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115372 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]>
1 parent 7f90260 commit 0901297

File tree

14 files changed

+802
-308
lines changed

14 files changed

+802
-308
lines changed

include/vcl/outdev.hxx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public:
478478
AntialiasingFlags GetAntialiasing() const { return mnAntialiasing; }
479479

480480
void SetDrawMode( DrawModeFlags nDrawMode );
481-
DrawModeFlags GetDrawMode() const { return mnDrawMode; }
481+
DrawModeFlags GetDrawMode() const;
482482

483483
void SetLayoutMode( ComplexTextLayoutFlags nTextLayoutMode );
484484
ComplexTextLayoutFlags GetLayoutMode() const { return mnTextLayoutMode; }
@@ -1493,9 +1493,6 @@ public:
14931493
bool bDownsampleBitmaps,
14941494
const Color& rBackground = COL_TRANSPARENT );
14951495

1496-
SAL_DLLPRIVATE Color ImplDrawModeToColor ( const Color& rColor ) const;
1497-
1498-
14991496
void DrawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
15001497

15011498
void DrawTransparent(

vcl/CppunitTest_vcl_drawmode.mk

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2+
#
3+
# This file is part of the LibreOffice project.
4+
#
5+
# This Source Code Form is subject to the terms of the Mozilla Public
6+
# License, v. 2.0. If a copy of the MPL was not distributed with this
7+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8+
#
9+
10+
$(eval $(call gb_CppunitTest_CppunitTest,vcl_drawmode))
11+
12+
$(eval $(call gb_CppunitTest_set_include,vcl_drawmode,\
13+
$$(INCLUDE) \
14+
-I$(SRCDIR)/vcl/inc \
15+
))
16+
17+
$(eval $(call gb_CppunitTest_add_exception_objects,vcl_drawmode, \
18+
vcl/qa/cppunit/drawmode \
19+
))
20+
21+
$(eval $(call gb_CppunitTest_use_libraries,vcl_drawmode, \
22+
comphelper \
23+
cppu \
24+
cppuhelper \
25+
sal \
26+
svt \
27+
test \
28+
tl \
29+
tk \
30+
unotest \
31+
vcl \
32+
))
33+
34+
$(eval $(call gb_CppunitTest_use_sdk_api,vcl_drawmode))
35+
36+
$(eval $(call gb_CppunitTest_use_ure,vcl_drawmode))
37+
$(eval $(call gb_CppunitTest_use_vcl,vcl_drawmode))
38+
39+
$(eval $(call gb_CppunitTest_use_configuration,vcl_drawmode))
40+
41+
$(eval $(call gb_CppunitTest_use_components,vcl_drawmode,\
42+
configmgr/source/configmgr \
43+
i18npool/util/i18npool \
44+
ucb/source/core/ucb1 \
45+
))
46+
47+
# vim: set noet sw=4 ts=4:

vcl/Library_vcl.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
9494
))
9595

9696
$(eval $(call gb_Library_add_exception_objects,vcl,\
97+
vcl/source/rendercontext/drawmode \
9798
vcl/skia/SkiaHelper \
9899
vcl/source/rendercontext/ImplMapRes \
99100
vcl/source/animate/Animation \

vcl/Module_vcl.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ $(eval $(call gb_Module_add_targets,vcl,\
189189
endif
190190

191191
$(eval $(call gb_Module_add_check_targets,vcl,\
192+
CppunitTest_vcl_drawmode \
192193
CppunitTest_vcl_lifecycle \
193194
CppunitTest_vcl_bitmap_test \
194195
CppunitTest_vcl_bitmapprocessor_test \

vcl/inc/drawmode.hxx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2+
/*
3+
* This file is part of the LibreOffice project.
4+
*
5+
* This Source Code Form is subject to the terms of the Mozilla Public
6+
* License, v. 2.0. If a copy of the MPL was not distributed with this
7+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8+
*
9+
* This file incorporates work covered by the following license notice:
10+
*
11+
* Licensed to the Apache Software Foundation (ASF) under one or more
12+
* contributor license agreements. See the NOTICE file distributed
13+
* with this work for additional information regarding copyright
14+
* ownership. The ASF licenses this file to you under the Apache
15+
* License, Version 2.0 (the "License"); you may not use this file
16+
* except in compliance with the License. You may obtain a copy of
17+
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
18+
*/
19+
20+
#pragma once
21+
22+
#include <tools/color.hxx>
23+
24+
#include <vcl/bitmapex.hxx>
25+
#include <vcl/font.hxx>
26+
#include <vcl/rendercontext/DrawModeFlags.hxx>
27+
28+
class StyleSettings;
29+
30+
namespace vcl::drawmode
31+
{
32+
VCL_DLLPUBLIC Color GetLineColor(Color const& rColor, DrawModeFlags nDrawMode,
33+
StyleSettings const& rStyleSettings);
34+
35+
VCL_DLLPUBLIC Color GetFillColor(Color const& rColor, DrawModeFlags nDrawMode,
36+
StyleSettings const& rStyleSettings);
37+
38+
VCL_DLLPUBLIC Color GetHatchColor(Color const& rColor, DrawModeFlags nDrawMode,
39+
StyleSettings const& rStyleSettings);
40+
41+
VCL_DLLPUBLIC Color GetTextColor(Color const& rColor, DrawModeFlags nDrawMode,
42+
StyleSettings const& rStyleSettings);
43+
44+
VCL_DLLPUBLIC vcl::Font GetFont(vcl::Font const& rFont, DrawModeFlags nDrawMode,
45+
StyleSettings const& rStyleSettings);
46+
47+
VCL_DLLPUBLIC Bitmap GetBitmap(Bitmap const& rBitmap, DrawModeFlags nDrawMode);
48+
49+
VCL_DLLPUBLIC BitmapEx GetBitmapEx(BitmapEx const& rBitmapEx, DrawModeFlags nDrawMode);
50+
};
51+
52+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

0 commit comments

Comments
 (0)