01d0019c85
Added tooling replaceStart/EndColor to allow simple transition for code that does not immediately adapt to multi color gradients. Also added createColorStepsFromStartEndColor for the same purpose. Adapted XGradient to no longer have Start/EndColor at all, but only use ColorSteps. Adapted all usages of XGradient to no longer use Get/Set/Start/EndColor, but access the ColorSteps instead. Replaced quite some XGradient constructors that used XGradient() as Start/EndColor since this is already the default. Adapted ColorBlending to black AKA Start/EndIntens in XGradient to work now on all ColorSteps in the required linearly-scaled manner. UNO API changes: Added com::sun:⭐:awt::ColorStep as basic data element that holds a pair of Offset and Color. Added com::sun:⭐:awt::ColorStepSequence to handle an array of sorted entries. Added com::sun:⭐:awt::Gradient2 derived from com::sun:⭐:awt::Gradient, extended by the needed com::sun:⭐:awt::ColorStepSequence. Added MID_GRADIENT_COLORSTEPSEQUENCE to UNO API to provide access to ColorSteps directly. Adapted XFillGradientItem::QueryValue/PutValue to make use of new UNO API data structures. To do so, added tooling methods for data transition: - fillColorStepSequenceFromColorSteps - fillGradient2FromXGradient - fillColorStepsFromAny - fillXGradientFromAny and adapted - case '0' (all data) - MID_FILLGRADIENT - MID_GRADIENT_COLORSTEPSEQUENCE - MID_GRADIENT_START/ENDCOLOR to make use of these. Tested usage of these in the office. Renamed from GradientStep to GradientStop after discussions with members on the list to make this closer related to other norms/definitions. Also renamed classes and class members to better reflect to GradientStop, so grepping/finding will be easier (e.g. 'Color' just exists pretty often, but 'StopColor' is more precise). Changed the used UNO API class for reprsenting the Color to better reflect to ranges [0.0 .. 1.0] and usage of RGB. Change-Id: I1eeb3e97e81d6785967615d1ff256551fc3b882d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148849 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
98 lines
3.2 KiB
C++
98 lines
3.2 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/*
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
* This file incorporates work covered by the following license notice:
|
|
*
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
* with this work for additional information regarding copyright
|
|
* ownership. The ASF licenses this file to you 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 .
|
|
*/
|
|
#ifndef INCLUDED_SVX_UNOMID_HXX
|
|
#define INCLUDED_SVX_UNOMID_HXX
|
|
|
|
//SvxPageItem
|
|
#define MID_PAGE_NUMTYPE 0
|
|
#define MID_PAGE_ORIENTATION 1
|
|
#define MID_PAGE_LAYOUT 2
|
|
|
|
//SvxMarginItem
|
|
#define MID_MARGIN_L_MARGIN 2
|
|
#define MID_MARGIN_R_MARGIN 3
|
|
#define MID_MARGIN_UP_MARGIN 4
|
|
#define MID_MARGIN_LO_MARGIN 5
|
|
|
|
#define ALL_BORDER 10
|
|
#define ALL_BORDER_PADDING 11
|
|
#define LEFT_BORDER_PADDING 12
|
|
#define RIGHT_BORDER_PADDING 13
|
|
#define TOP_BORDER_PADDING 14
|
|
#define BOTTOM_BORDER_PADDING 15
|
|
#define ALL_BORDER_LINE_WIDTH 16
|
|
#define LEFT_BORDER_LINE_WIDTH 17
|
|
#define RIGHT_BORDER_LINE_WIDTH 18
|
|
#define TOP_BORDER_LINE_WIDTH 19
|
|
#define BOTTOM_BORDER_LINE_WIDTH 20
|
|
|
|
// XFillBitmapItem (is also a NameOrIndex)
|
|
#define MID_BITMAP 8
|
|
|
|
// SvxObjectItem
|
|
#define MID_START_X 1
|
|
#define MID_START_Y 2
|
|
#define MID_END_X 3
|
|
#define MID_END_Y 4
|
|
#define MID_LIMIT 5
|
|
|
|
// SvxColumnItem
|
|
#define MID_COLUMNARRAY 7
|
|
#define MID_ACTUAL 4
|
|
#define MID_TABLE 5
|
|
#define MID_ORTHO 6
|
|
|
|
// XFillGradientItem
|
|
// Don't use 0 as it used for the whole struct
|
|
#define MID_FILLGRADIENT 1
|
|
#define MID_GRADIENT_STYLE 2
|
|
#define MID_GRADIENT_STARTCOLOR 3
|
|
#define MID_GRADIENT_ENDCOLOR 4
|
|
#define MID_GRADIENT_ANGLE 5
|
|
#define MID_GRADIENT_BORDER 6
|
|
#define MID_GRADIENT_XOFFSET 7
|
|
#define MID_GRADIENT_YOFFSET 8
|
|
#define MID_GRADIENT_STARTINTENSITY 9
|
|
#define MID_GRADIENT_ENDINTENSITY 10
|
|
#define MID_GRADIENT_STEPCOUNT 11
|
|
#define MID_GRADIENT_COLORSTOPSEQUENCE 12
|
|
|
|
// XFillHatchItem
|
|
// Don't use 0 as it used for the whole struct
|
|
#define MID_FILLHATCH 1
|
|
#define MID_HATCH_STYLE 2
|
|
#define MID_HATCH_COLOR 3
|
|
#define MID_HATCH_DISTANCE 4
|
|
#define MID_HATCH_ANGLE 5
|
|
|
|
// XLineDashItem
|
|
// Don't use 0 as it used for the whole struct
|
|
#define MID_LINEDASH 1
|
|
#define MID_LINEDASH_STYLE 2
|
|
#define MID_LINEDASH_DOTS 3
|
|
#define MID_LINEDASH_DOTLEN 4
|
|
#define MID_LINEDASH_DASHES 5
|
|
#define MID_LINEDASH_DASHLEN 6
|
|
#define MID_LINEDASH_DISTANCE 7
|
|
|
|
#define MID_LEFT 3
|
|
|
|
#endif
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|