LibreOffice Module vcl (master) 1
FileDefinitionWidgetDraw.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
11#include <sal/config.h>
12
13#include <string_view>
14
17
18#include <svdata.hxx>
19#include <rtl/bootstrap.hxx>
20#include <config_folders.h>
21#include <osl/file.hxx>
22
27
28#include <tools/stream.hxx>
29#include <vcl/bitmapex.hxx>
30#include <vcl/BitmapTools.hxx>
31#include <vcl/gradient.hxx>
32
35#include <comphelper/lok.hxx>
36#include <comphelper/string.hxx>
37
38#include <com/sun/star/graphic/SvgTools.hpp>
40#include <o3tl/string_view.hxx>
41
42using namespace css;
43
44namespace vcl
45{
46namespace
47{
48OUString lcl_getThemeDefinitionPath()
49{
50 OUString sPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/theme_definitions/");
51 rtl::Bootstrap::expandMacros(sPath);
52 return sPath;
53}
54
55bool lcl_directoryExists(OUString const& sDirectory)
56{
57 osl::DirectoryItem aDirectoryItem;
58 osl::FileBase::RC eRes = osl::DirectoryItem::get(sDirectory, aDirectoryItem);
59 return eRes == osl::FileBase::E_None;
60}
61
62bool lcl_fileExists(OUString const& sFilename)
63{
64 osl::File aFile(sFilename);
65 osl::FileBase::RC eRC = aFile.open(osl_File_OpenFlag_Read);
66 return osl::FileBase::E_None == eRC;
67}
68
69std::shared_ptr<WidgetDefinition> getWidgetDefinition(OUString const& rDefinitionFile,
70 OUString const& rDefinitionResourcesPath)
71{
72 auto pWidgetDefinition = std::make_shared<WidgetDefinition>();
73 WidgetDefinitionReader aReader(rDefinitionFile, rDefinitionResourcesPath);
74 if (aReader.read(*pWidgetDefinition))
75 return pWidgetDefinition;
76 return std::shared_ptr<WidgetDefinition>();
77}
78
79std::shared_ptr<WidgetDefinition> const&
80getWidgetDefinitionForTheme(std::u16string_view rThemenName)
81{
82 static std::shared_ptr<WidgetDefinition> spDefinition;
83 if (!spDefinition)
84 {
85 OUString sSharedDefinitionBasePath = lcl_getThemeDefinitionPath();
86 OUString sThemeFolder = sSharedDefinitionBasePath + rThemenName + "/";
87 OUString sThemeDefinitionFile = sThemeFolder + "definition.xml";
88 if (lcl_directoryExists(sThemeFolder) && lcl_fileExists(sThemeDefinitionFile))
89 spDefinition = getWidgetDefinition(sThemeDefinitionFile, sThemeFolder);
90 }
91 return spDefinition;
92}
93
94int getSettingValueInteger(std::string_view rValue, int nDefault)
95{
96 if (rValue.empty())
97 return nDefault;
99 return nDefault;
100 return o3tl::toInt32(rValue);
101}
102
103bool getSettingValueBool(std::string_view rValue, bool bDefault)
104{
105 if (rValue.empty())
106 return bDefault;
107 if (rValue == "true" || rValue == "false")
108 return rValue == "true";
109 return bDefault;
110}
111
112} // end anonymous namespace
113
115 : m_rGraphics(rGraphics)
116 , m_bIsActive(false)
117{
118 m_pWidgetDefinition = getWidgetDefinitionForTheme(u"online");
119#ifdef IOS
121 m_pWidgetDefinition = getWidgetDefinitionForTheme(u"ios");
122#endif
123
125 return;
126
127 auto& pSettings = m_pWidgetDefinition->mpSettings;
128
129 ImplSVData* pSVData = ImplGetSVData();
130 pSVData->maNWFData.mbNoFocusRects = true;
133 = getSettingValueBool(pSettings->msNoActiveTabTextRaise, true);
134 pSVData->maNWFData.mbCenteredTabs = getSettingValueBool(pSettings->msCenteredTabs, true);
135 pSVData->maNWFData.mbProgressNeedsErase = true;
137 pSVData->maNWFData.mbCanDrawWidgetAnySize = true;
138
139 int nDefaultListboxEntryMargin = pSVData->maNWFData.mnListBoxEntryMargin;
141 = getSettingValueInteger(pSettings->msListBoxEntryMargin, nDefaultListboxEntryMargin);
142
143 m_bIsActive = true;
144}
145
147{
148 switch (eType)
149 {
154 return true;
157 return false;
158 return true;
162 return true;
165 return false;
166 return true;
168 if (ePart == ControlPart::AllButtons)
169 return false;
170 return true;
172 return false;
177 return true;
181 return false;
182 return true;
186 return true;
189 return true;
191 return true;
193 return false;
195 return true;
201 return true;
202 }
203
204 return false;
205}
206
208 ControlType /*eType*/, ControlPart /*ePart*/,
209 const tools::Rectangle& /*rBoundingControlRegion*/, const Point& /*aPos*/, bool& /*rIsInside*/)
210{
211 return false;
212}
213
215 const basegfx::B2DHomMatrix& rObjectToDevice,
216 const basegfx::B2DPolyPolygon& i_rPolyPolygon,
217 double i_fTransparency)
218{
219 rGraphics.drawPolyPolygon(rObjectToDevice, i_rPolyPolygon, i_fTransparency);
220}
221
223 SalGraphics& rGraphics, const basegfx::B2DHomMatrix& rObjectToDevice,
224 const basegfx::B2DPolygon& i_rPolygon, double i_fTransparency, double i_fLineWidth,
225 const std::vector<double>* i_pStroke, basegfx::B2DLineJoin i_eLineJoin,
226 css::drawing::LineCap i_eLineCap, double i_fMiterMinimumAngle, bool bPixelSnapHairline)
227{
228 rGraphics.drawPolyLine(rObjectToDevice, i_rPolygon, i_fTransparency, i_fLineWidth, i_pStroke,
229 i_eLineJoin, i_eLineCap, i_fMiterMinimumAngle, bPixelSnapHairline);
230}
231
233 const SalBitmap& rSalBitmap)
234{
235 rGraphics.drawBitmap(rPosAry, rSalBitmap);
236}
237
239 const SalBitmap& rSalBitmap,
240 const SalBitmap& rTransparentBitmap)
241{
242 rGraphics.drawBitmap(rPosAry, rSalBitmap, rTransparentBitmap);
243}
244
246 const basegfx::B2DPolyPolygon& rPolyPolygon,
247 const SalGradient& rGradient)
248{
249 rGraphics.implDrawGradient(rPolyPolygon, rGradient);
250}
251
252namespace
253{
254void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics, tools::Long nX,
255 tools::Long nY, tools::Long nWidth, tools::Long nHeight)
256{
257 basegfx::B2DRectangle aSVGRect = rDrawRoot.maRectangle;
258
259 basegfx::B2DRange aTargetSurface(nX, nY, nX + nWidth + 1, nY + nHeight + 1);
260
261 for (std::shared_ptr<gfx::DrawBase> const& pDrawBase : rDrawRoot.maChildren)
262 {
263 switch (pDrawBase->getType())
264 {
266 {
267 auto const& rRectangle = static_cast<gfx::DrawRectangle const&>(*pDrawBase);
268
269 basegfx::B2DRange aInputRectangle(rRectangle.maRectangle);
270
271 double fDeltaX = aTargetSurface.getWidth() - aSVGRect.getWidth();
272 double fDeltaY = aTargetSurface.getHeight() - aSVGRect.getHeight();
273
274 basegfx::B2DRange aFinalRectangle(
275 aInputRectangle.getMinX(), aInputRectangle.getMinY(),
276 aInputRectangle.getMaxX() + fDeltaX, aInputRectangle.getMaxY() + fDeltaY);
277
278 aFinalRectangle.transform(basegfx::utils::createTranslateB2DHomMatrix(
279 aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5));
280
282 aFinalRectangle, rRectangle.mnRx / aFinalRectangle.getWidth() * 2.0,
283 rRectangle.mnRy / aFinalRectangle.getHeight() * 2.0);
284
285 if (rRectangle.mpFillColor)
286 {
287 rGraphics.SetLineColor();
288 rGraphics.SetFillColor(Color(*rRectangle.mpFillColor));
290 basegfx::B2DPolyPolygon(aB2DPolygon),
291 1.0 - rRectangle.mnOpacity);
292 }
293 else if (rRectangle.mpFillGradient)
294 {
295 rGraphics.SetLineColor();
296 rGraphics.SetFillColor();
297 if (rRectangle.mpFillGradient->meType == gfx::GradientType::Linear)
298 {
299 auto* pLinearGradient = static_cast<gfx::LinearGradientInfo*>(
300 rRectangle.mpFillGradient.get());
301 SalGradient aGradient;
302 double x, y;
303
304 x = pLinearGradient->x1;
305 y = pLinearGradient->y1;
306
307 if (x > aSVGRect.getCenterX())
308 x = x + fDeltaX;
309 if (y > aSVGRect.getCenterY())
310 y = y + fDeltaY;
311
312 aGradient.maPoint1 = basegfx::B2DPoint(x, y);
314 aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5);
315
316 x = pLinearGradient->x2;
317 y = pLinearGradient->y2;
318
319 if (x > aSVGRect.getCenterX())
320 x = x + fDeltaX;
321 if (y > aSVGRect.getCenterY())
322 y = y + fDeltaY;
323
324 aGradient.maPoint2 = basegfx::B2DPoint(x, y);
326 aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5);
327
328 for (gfx::GradientStop const& rStop : pLinearGradient->maGradientStops)
329 {
330 Color aColor(rStop.maColor);
331 aColor.SetAlpha(255
332 - (rStop.mfOpacity * (1.0f - rRectangle.mnOpacity)));
333 aGradient.maStops.emplace_back(aColor, rStop.mfOffset);
334 }
336 rGraphics, basegfx::B2DPolyPolygon(aB2DPolygon), aGradient);
337 }
338 }
339 if (rRectangle.mpStrokeColor)
340 {
341 rGraphics.SetLineColor(Color(*rRectangle.mpStrokeColor));
342 rGraphics.SetFillColor();
344 rGraphics, basegfx::B2DHomMatrix(), aB2DPolygon, 1.0 - rRectangle.mnOpacity,
345 rRectangle.mnStrokeWidth,
346 nullptr, // MM01
347 basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false);
348 }
349 }
350 break;
352 {
353 auto const& rPath = static_cast<gfx::DrawPath const&>(*pDrawBase);
354
355 double fDeltaX = aTargetSurface.getWidth() - aSVGRect.getWidth();
356 double fDeltaY = aTargetSurface.getHeight() - aSVGRect.getHeight();
357
358 basegfx::B2DPolyPolygon aPolyPolygon(rPath.maPolyPolygon);
359 for (auto& rPolygon : aPolyPolygon)
360 {
361 for (size_t i = 0; i < rPolygon.count(); ++i)
362 {
363 auto& rPoint = rPolygon.getB2DPoint(i);
364 double x = rPoint.getX();
365 double y = rPoint.getY();
366
367 if (x > aSVGRect.getCenterX())
368 x = x + fDeltaX;
369 if (y > aSVGRect.getCenterY())
370 y = y + fDeltaY;
371 rPolygon.setB2DPoint(i, basegfx::B2DPoint(x, y));
372 }
373 }
374 aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(
375 aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5));
376
377 if (rPath.mpFillColor)
378 {
379 rGraphics.SetLineColor();
380 rGraphics.SetFillColor(Color(*rPath.mpFillColor));
382 aPolyPolygon, 1.0 - rPath.mnOpacity);
383 }
384 if (rPath.mpStrokeColor)
385 {
386 rGraphics.SetLineColor(Color(*rPath.mpStrokeColor));
387 rGraphics.SetFillColor();
388 for (auto const& rPolygon : std::as_const(aPolyPolygon))
389 {
391 rGraphics, basegfx::B2DHomMatrix(), rPolygon, 1.0 - rPath.mnOpacity,
392 rPath.mnStrokeWidth,
393 nullptr, // MM01
394 basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false);
395 }
396 }
397 }
398 break;
399
400 default:
401 break;
402 }
403 }
404}
405
406void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDrawActions,
407 SalGraphics& rGraphics, tools::Long nX, tools::Long nY, tools::Long nWidth,
408 tools::Long nHeight)
409{
410 for (std::shared_ptr<WidgetDrawAction> const& pDrawAction : rDrawActions)
411 {
412 switch (pDrawAction->maType)
413 {
415 {
416 auto const& rWidgetDraw
417 = static_cast<WidgetDrawActionRectangle const&>(*pDrawAction);
418
420 nX + (nWidth * rWidgetDraw.mfX1), nY + (nHeight * rWidgetDraw.mfY1),
421 nX + (nWidth * rWidgetDraw.mfX2), nY + (nHeight * rWidgetDraw.mfY2));
422
424 rRect, rWidgetDraw.mnRx / rRect.getWidth() * 2.0,
425 rWidgetDraw.mnRy / rRect.getHeight() * 2.0);
426
427 rGraphics.SetLineColor();
428 rGraphics.SetFillColor(rWidgetDraw.maFillColor);
430 rGraphics, basegfx::B2DHomMatrix(), basegfx::B2DPolyPolygon(aB2DPolygon), 0.0f);
431 rGraphics.SetLineColor(rWidgetDraw.maStrokeColor);
432 rGraphics.SetFillColor();
434 rGraphics, basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f,
435 rWidgetDraw.mnStrokeWidth, nullptr, // MM01
436 basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false);
437 }
438 break;
440 {
441 auto const& rWidgetDraw = static_cast<WidgetDrawActionLine const&>(*pDrawAction);
442 Point aRectPoint(nX + 1, nY + 1);
443
444 Size aRectSize(nWidth - 1, nHeight - 1);
445
446 rGraphics.SetFillColor();
447 rGraphics.SetLineColor(rWidgetDraw.maStrokeColor);
448
449 basegfx::B2DPolygon aB2DPolygon{
450 { aRectPoint.X() + (aRectSize.Width() * rWidgetDraw.mfX1),
451 aRectPoint.Y() + (aRectSize.Height() * rWidgetDraw.mfY1) },
452 { aRectPoint.X() + (aRectSize.Width() * rWidgetDraw.mfX2),
453 aRectPoint.Y() + (aRectSize.Height() * rWidgetDraw.mfY2) },
454 };
455
457 rGraphics, basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f,
458 rWidgetDraw.mnStrokeWidth, nullptr, // MM01
459 basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false);
460 }
461 break;
463 {
464 double nScaleFactor = 1.0;
467
468 auto const& rWidgetDraw = static_cast<WidgetDrawActionImage const&>(*pDrawAction);
469 auto& rCacheImages = ImplGetSVData()->maGDIData.maThemeImageCache;
470 OUString rCacheKey = rWidgetDraw.msSource + "@" + OUString::number(nScaleFactor);
471 auto aIterator = rCacheImages.find(rCacheKey);
472
473 BitmapEx aBitmap;
474 if (aIterator == rCacheImages.end())
475 {
476 SvFileStream aFileStream(rWidgetDraw.msSource, StreamMode::READ);
477
478 vcl::bitmap::loadFromSvg(aFileStream, "", aBitmap, nScaleFactor);
479 if (!aBitmap.IsEmpty())
480 {
481 rCacheImages.insert(std::make_pair(rCacheKey, aBitmap));
482 }
483 }
484 else
485 {
486 aBitmap = aIterator->second;
487 }
488
489 tools::Long nImageWidth = aBitmap.GetSizePixel().Width();
490 tools::Long nImageHeight = aBitmap.GetSizePixel().Height();
491 SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, nImageWidth / nScaleFactor,
492 nImageHeight / nScaleFactor);
493 if (!aBitmap.IsEmpty())
494 {
495 const std::shared_ptr<SalBitmap> pSalBitmap
496 = aBitmap.GetBitmap().ImplGetSalBitmap();
497 if (aBitmap.IsAlpha())
498 {
499 const std::shared_ptr<SalBitmap> pSalBitmapAlpha
500 = aBitmap.GetAlphaMask().ImplGetSalBitmap();
501 FileDefinitionWidgetDraw::drawBitmap(rGraphics, aTR, *pSalBitmap,
502 *pSalBitmapAlpha);
503 }
504 else
505 {
506 FileDefinitionWidgetDraw::drawBitmap(rGraphics, aTR, *pSalBitmap);
507 }
508 }
509 }
510 break;
512 {
513 auto const& rWidgetDraw
514 = static_cast<WidgetDrawActionExternal const&>(*pDrawAction);
515
516 auto& rCacheDrawCommands = ImplGetSVData()->maGDIData.maThemeDrawCommandsCache;
517
518 auto aIterator = rCacheDrawCommands.find(rWidgetDraw.msSource);
519
520 if (aIterator == rCacheDrawCommands.end())
521 {
522 SvFileStream aFileStream(rWidgetDraw.msSource, StreamMode::READ);
523
524 uno::Reference<uno::XComponentContext> xContext(
526 const uno::Reference<graphic::XSvgParser> xSvgParser
527 = graphic::SvgTools::create(xContext);
528
529 std::size_t nSize = aFileStream.remainingSize();
530 std::vector<sal_Int8> aBuffer(nSize + 1);
531 aFileStream.ReadBytes(aBuffer.data(), nSize);
532 aBuffer[nSize] = 0;
533
534 uno::Sequence<sal_Int8> aData(aBuffer.data(), nSize + 1);
535 uno::Reference<io::XInputStream> aInputStream(
537
538 uno::Any aAny = xSvgParser->getDrawCommands(aInputStream, "");
539 if (aAny.has<sal_uInt64>())
540 {
541 auto* pDrawRoot = reinterpret_cast<gfx::DrawRoot*>(aAny.get<sal_uInt64>());
542 if (pDrawRoot)
543 {
544 rCacheDrawCommands.insert(
545 std::make_pair(rWidgetDraw.msSource, *pDrawRoot));
546 drawFromDrawCommands(*pDrawRoot, rGraphics, nX, nY, nWidth, nHeight);
547 }
548 }
549 }
550 else
551 {
552 drawFromDrawCommands(aIterator->second, rGraphics, nX, nY, nWidth, nHeight);
553 }
554 }
555 break;
556 }
557 }
558}
559
560} // end anonymous namespace
561
563 ControlState eState,
564 const ImplControlValue& rValue, tools::Long nX,
565 tools::Long nY, tools::Long nWidth,
566 tools::Long nHeight)
567{
568 bool bOK = false;
569 auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ePart);
570 if (pPart)
571 {
572 auto const& aStates = pPart->getStates(eType, ePart, eState, rValue);
573 if (!aStates.empty())
574 {
575 // use last defined state
576 auto const& pState = aStates.back();
577 {
578 munchDrawCommands(pState->mpWidgetDrawActions, m_rGraphics, nX, nY, nWidth,
579 nHeight);
580 bOK = true;
581 }
582 }
583 }
584 return bOK;
585}
586
588 const tools::Rectangle& rControlRegion,
589 ControlState eState,
590 const ImplControlValue& rValue,
591 const OUString& /*aCaptions*/,
592 const Color& /*rBackgroundColor*/)
593{
594 bool bOldAA = m_rGraphics.getAntiAlias();
596
597 tools::Long nWidth = rControlRegion.GetWidth() - 1;
598 tools::Long nHeight = rControlRegion.GetHeight() - 1;
599 tools::Long nX = rControlRegion.Left();
600 tools::Long nY = rControlRegion.Top();
601
602 bool bOK = false;
603
604 switch (eType)
605 {
607 {
608 /*bool bIsAction = false;
609 const PushButtonValue* pPushButtonValue = static_cast<const PushButtonValue*>(&rValue);
610 if (pPushButtonValue)
611 bIsAction = pPushButtonValue->mbIsAction;*/
612
613 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
614 }
615 break;
617 {
618 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
619 }
620 break;
622 {
623 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
624 }
625 break;
627 {
628 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
629 }
630 break;
634 {
635 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
636 }
637 break;
639 {
640 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
641 }
642 break;
644 {
645 if (rValue.getType() == ControlType::SpinButtons)
646 {
647 const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue*>(&rValue);
648
649 {
650 ControlPart eUpButtonPart = pSpinVal->mnUpperPart;
651 ControlState eUpButtonState = pSpinVal->mnUpperState;
652
653 tools::Long nUpperX = pSpinVal->maUpperRect.Left();
654 tools::Long nUpperY = pSpinVal->maUpperRect.Top();
655 tools::Long nUpperWidth = pSpinVal->maUpperRect.GetWidth() - 1;
656 tools::Long nUpperHeight = pSpinVal->maUpperRect.GetHeight() - 1;
657
658 bOK = resolveDefinition(eType, eUpButtonPart, eUpButtonState,
659 ImplControlValue(), nUpperX, nUpperY, nUpperWidth,
660 nUpperHeight);
661 }
662
663 if (bOK)
664 {
665 ControlPart eDownButtonPart = pSpinVal->mnLowerPart;
666 ControlState eDownButtonState = pSpinVal->mnLowerState;
667
668 tools::Long nLowerX = pSpinVal->maLowerRect.Left();
669 tools::Long nLowerY = pSpinVal->maLowerRect.Top();
670 tools::Long nLowerWidth = pSpinVal->maLowerRect.GetWidth() - 1;
671 tools::Long nLowerHeight = pSpinVal->maLowerRect.GetHeight() - 1;
672
673 bOK = resolveDefinition(eType, eDownButtonPart, eDownButtonState,
674 ImplControlValue(), nLowerX, nLowerY, nLowerWidth,
675 nLowerHeight);
676 }
677 }
678 else
679 {
680 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
681 }
682 }
683 break;
685 break;
690 {
691 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
692 }
693 break;
695 {
696 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
697 }
698 break;
700 {
701 const SliderValue* pSliderValue = static_cast<const SliderValue*>(&rValue);
702 tools::Long nThumbX = pSliderValue->maThumbRect.Left();
703 tools::Long nThumbY = pSliderValue->maThumbRect.Top();
704 tools::Long nThumbWidth = pSliderValue->maThumbRect.GetWidth() - 1;
705 tools::Long nThumbHeight = pSliderValue->maThumbRect.GetHeight() - 1;
706
707 if (ePart == ControlPart::TrackHorzArea)
708 {
709 tools::Long nCenterX = nThumbX + nThumbWidth / 2;
710
711 bOK = resolveDefinition(eType, ControlPart::TrackHorzLeft, eState, rValue, nX, nY,
712 nCenterX - nX, nHeight);
713 if (bOK)
715 nCenterX, nY, nX + nWidth - nCenterX, nHeight);
716 }
717 else if (ePart == ControlPart::TrackVertArea)
718 {
719 tools::Long nCenterY = nThumbY + nThumbHeight / 2;
720
721 bOK = resolveDefinition(eType, ControlPart::TrackVertUpper, eState, rValue, nX, nY,
722 nWidth, nCenterY - nY);
723 if (bOK)
724 bOK = resolveDefinition(eType, ControlPart::TrackVertLower, eState, rValue, nY,
725 nCenterY, nWidth, nY + nHeight - nCenterY);
726 }
727
728 if (bOK)
729 {
731 eState | pSliderValue->mnThumbState, rValue, nThumbX,
732 nThumbY, nThumbWidth, nThumbHeight);
733 }
734 }
735 break;
737 {
738 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
739 }
740 break;
742 {
743 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
744 }
745 break;
748 {
749 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
750 }
751 break;
753 {
754 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
755 }
756 break;
758 break;
760 {
761 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
762 }
763 break;
766 {
767 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
768 }
769 break;
773 {
774 bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
775 }
776 break;
777 default:
778 break;
779 }
780
782
783 return bOK;
784}
785
787 ControlType eType, ControlPart ePart, const tools::Rectangle& rBoundingControlRegion,
788 ControlState /*eState*/, const ImplControlValue& /*aValue*/, const OUString& /*aCaption*/,
789 tools::Rectangle& rNativeBoundingRegion, tools::Rectangle& rNativeContentRegion)
790{
791 Point aLocation(rBoundingControlRegion.TopLeft());
792
793 switch (eType)
794 {
796 {
797 auto const& pButtonUpPart
799 if (!pButtonUpPart)
800 return false;
801 Size aButtonSizeUp(pButtonUpPart->mnWidth, pButtonUpPart->mnHeight);
802
803 auto const& pButtonDownPart
805 if (!pButtonDownPart)
806 return false;
807 Size aButtonSizeDown(pButtonDownPart->mnWidth, pButtonDownPart->mnHeight);
808
809 auto const& pEntirePart
811
812 OString sOrientation = pEntirePart->msOrientation;
813
814 if (sOrientation.isEmpty() || sOrientation == "stacked")
815 {
816 return false;
817 }
818 else if (sOrientation == "decrease-edit-increase")
819 {
820 if (ePart == ControlPart::ButtonUp)
821 {
822 Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
823 - aButtonSizeUp.Width(),
824 aLocation.Y());
825 rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeUp);
826 rNativeBoundingRegion = rNativeContentRegion;
827 return true;
828 }
829 else if (ePart == ControlPart::ButtonDown)
830 {
831 rNativeContentRegion = tools::Rectangle(aLocation, aButtonSizeDown);
832 rNativeBoundingRegion = rNativeContentRegion;
833 return true;
834 }
835 else if (ePart == ControlPart::SubEdit)
836 {
837 Point aPoint(aLocation.X() + aButtonSizeDown.Width(), aLocation.Y());
838 Size aSize(rBoundingControlRegion.GetWidth()
839 - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
840 std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
841 rNativeContentRegion = tools::Rectangle(aPoint, aSize);
842 rNativeBoundingRegion = rNativeContentRegion;
843 return true;
844 }
845 else if (ePart == ControlPart::Entire)
846 {
847 Size aSize(rBoundingControlRegion.GetWidth(),
848 std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
849 rNativeContentRegion = tools::Rectangle(aLocation, aSize);
850 rNativeBoundingRegion = rNativeContentRegion;
851 return true;
852 }
853 }
854 else if (sOrientation == "edit-decrease-increase")
855 {
856 if (ePart == ControlPart::ButtonUp)
857 {
858 Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
859 - aButtonSizeUp.Width(),
860 aLocation.Y());
861 rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeUp);
862 rNativeBoundingRegion = rNativeContentRegion;
863 return true;
864 }
865 else if (ePart == ControlPart::ButtonDown)
866 {
867 Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
868 - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
869 aLocation.Y());
870 rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeDown);
871 rNativeBoundingRegion = rNativeContentRegion;
872 return true;
873 }
874 else if (ePart == ControlPart::SubEdit)
875 {
876 Size aSize(rBoundingControlRegion.GetWidth()
877 - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
878 std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
879 rNativeContentRegion = tools::Rectangle(aLocation, aSize);
880 rNativeBoundingRegion = rNativeContentRegion;
881 return true;
882 }
883 else if (ePart == ControlPart::Entire)
884 {
885 Size aSize(rBoundingControlRegion.GetWidth(),
886 std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
887 rNativeContentRegion = tools::Rectangle(aLocation, aSize);
888 rNativeBoundingRegion = rNativeContentRegion;
889 return true;
890 }
891 }
892 }
893 break;
895 {
896 auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
897 if (!pPart)
898 return false;
899
900 Size aSize(pPart->mnWidth, pPart->mnHeight);
901 rNativeContentRegion = tools::Rectangle(Point(), aSize);
902 return true;
903 }
905 {
906 auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
907 if (!pPart)
908 return false;
909
910 Size aSize(pPart->mnWidth, pPart->mnHeight);
911 rNativeContentRegion = tools::Rectangle(Point(), aSize);
912 return true;
913 }
915 {
916 auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
917 if (!pPart)
918 return false;
919
920 tools::Long nWidth = std::max(rBoundingControlRegion.GetWidth() + pPart->mnMarginWidth,
921 tools::Long(pPart->mnWidth));
922 tools::Long nHeight
923 = std::max(rBoundingControlRegion.GetHeight() + pPart->mnMarginHeight,
924 tools::Long(pPart->mnHeight));
925
926 rNativeBoundingRegion = tools::Rectangle(aLocation, Size(nWidth, nHeight));
927 rNativeContentRegion = rNativeBoundingRegion;
928 return true;
929 }
933 {
934 sal_Int32 nHeight = rBoundingControlRegion.GetHeight();
935
936 auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
937 if (pPart)
938 nHeight = std::max(nHeight, pPart->mnHeight);
939
940 Size aSize(rBoundingControlRegion.GetWidth(), nHeight);
941 rNativeContentRegion = tools::Rectangle(aLocation, aSize);
942 rNativeBoundingRegion = rNativeContentRegion;
943 rNativeBoundingRegion.expand(2);
944 return true;
945 }
946 break;
948 {
949 if (ePart == ControlPart::ButtonUp || ePart == ControlPart::ButtonDown
951 {
952 rNativeContentRegion = tools::Rectangle(aLocation, Size(0, 0));
953 rNativeBoundingRegion = rNativeContentRegion;
954 return true;
955 }
956 else
957 {
958 rNativeBoundingRegion = rBoundingControlRegion;
959 rNativeContentRegion = rNativeBoundingRegion;
960 return true;
961 }
962 }
963 break;
966 {
967 auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::ButtonDown);
968 Size aComboButtonSize(pPart->mnWidth, pPart->mnHeight);
969
970 if (ePart == ControlPart::ButtonDown)
971 {
972 Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
973 - aComboButtonSize.Width() - 1,
974 aLocation.Y());
975 rNativeContentRegion = tools::Rectangle(aPoint, aComboButtonSize);
976 rNativeBoundingRegion = rNativeContentRegion;
977 return true;
978 }
979 else if (ePart == ControlPart::SubEdit)
980 {
981 Size aSize(rBoundingControlRegion.GetWidth() - aComboButtonSize.Width(),
982 aComboButtonSize.Height());
983 rNativeContentRegion = tools::Rectangle(aLocation + Point(1, 1), aSize);
984 rNativeBoundingRegion = rNativeContentRegion;
985 return true;
986 }
987 else if (ePart == ControlPart::Entire)
988 {
989 Size aSize(rBoundingControlRegion.GetWidth(), aComboButtonSize.Height());
990 rNativeContentRegion = tools::Rectangle(aLocation, aSize);
991 rNativeBoundingRegion = rNativeContentRegion;
992 rNativeBoundingRegion.expand(2);
993 return true;
994 }
995 }
996 break;
998 if (ePart == ControlPart::ThumbHorz || ePart == ControlPart::ThumbVert)
999 {
1000 rNativeContentRegion = tools::Rectangle(aLocation, Size(28, 28));
1001 rNativeBoundingRegion = rNativeContentRegion;
1002 return true;
1003 }
1004 break;
1005 default:
1006 break;
1007 }
1008
1009 return false;
1010}
1011
1013{
1014 StyleSettings aStyleSet = rSettings.GetStyleSettings();
1015
1016 auto& pDefinitionStyle = m_pWidgetDefinition->mpStyle;
1017
1018 aStyleSet.SetFaceColor(pDefinitionStyle->maFaceColor);
1019 aStyleSet.SetCheckedColor(pDefinitionStyle->maCheckedColor);
1020 aStyleSet.SetLightColor(pDefinitionStyle->maLightColor);
1021 aStyleSet.SetLightBorderColor(pDefinitionStyle->maLightBorderColor);
1022 aStyleSet.SetShadowColor(pDefinitionStyle->maShadowColor);
1023 aStyleSet.SetDarkShadowColor(pDefinitionStyle->maDarkShadowColor);
1024 aStyleSet.SetDefaultButtonTextColor(pDefinitionStyle->maDefaultButtonTextColor);
1025 aStyleSet.SetButtonTextColor(pDefinitionStyle->maButtonTextColor);
1026 aStyleSet.SetDefaultActionButtonTextColor(pDefinitionStyle->maDefaultActionButtonTextColor);
1027 aStyleSet.SetActionButtonTextColor(pDefinitionStyle->maActionButtonTextColor);
1028 aStyleSet.SetFlatButtonTextColor(pDefinitionStyle->maFlatButtonTextColor);
1029 aStyleSet.SetDefaultButtonRolloverTextColor(pDefinitionStyle->maDefaultButtonRolloverTextColor);
1030 aStyleSet.SetButtonRolloverTextColor(pDefinitionStyle->maButtonRolloverTextColor);
1032 pDefinitionStyle->maDefaultActionButtonRolloverTextColor);
1033 aStyleSet.SetActionButtonRolloverTextColor(pDefinitionStyle->maActionButtonRolloverTextColor);
1034 aStyleSet.SetFlatButtonRolloverTextColor(pDefinitionStyle->maFlatButtonRolloverTextColor);
1036 pDefinitionStyle->maDefaultButtonPressedRolloverTextColor);
1037 aStyleSet.SetButtonPressedRolloverTextColor(pDefinitionStyle->maButtonPressedRolloverTextColor);
1039 pDefinitionStyle->maDefaultActionButtonPressedRolloverTextColor);
1041 pDefinitionStyle->maActionButtonPressedRolloverTextColor);
1043 pDefinitionStyle->maFlatButtonPressedRolloverTextColor);
1044 aStyleSet.SetRadioCheckTextColor(pDefinitionStyle->maRadioCheckTextColor);
1045 aStyleSet.SetGroupTextColor(pDefinitionStyle->maGroupTextColor);
1046 aStyleSet.SetLabelTextColor(pDefinitionStyle->maLabelTextColor);
1047 aStyleSet.SetWindowColor(pDefinitionStyle->maWindowColor);
1048 aStyleSet.SetWindowTextColor(pDefinitionStyle->maWindowTextColor);
1049 aStyleSet.SetDialogColor(pDefinitionStyle->maDialogColor);
1050 aStyleSet.SetDialogTextColor(pDefinitionStyle->maDialogTextColor);
1051 aStyleSet.SetWorkspaceColor(pDefinitionStyle->maWorkspaceColor);
1052 aStyleSet.SetMonoColor(pDefinitionStyle->maMonoColor);
1053 aStyleSet.SetFieldColor(pDefinitionStyle->maFieldColor);
1054 aStyleSet.SetFieldTextColor(pDefinitionStyle->maFieldTextColor);
1055 aStyleSet.SetFieldRolloverTextColor(pDefinitionStyle->maFieldRolloverTextColor);
1056 aStyleSet.SetActiveColor(pDefinitionStyle->maActiveColor);
1057 aStyleSet.SetActiveTextColor(pDefinitionStyle->maActiveTextColor);
1058 aStyleSet.SetActiveBorderColor(pDefinitionStyle->maActiveBorderColor);
1059 aStyleSet.SetDeactiveColor(pDefinitionStyle->maDeactiveColor);
1060 aStyleSet.SetDeactiveTextColor(pDefinitionStyle->maDeactiveTextColor);
1061 aStyleSet.SetDeactiveBorderColor(pDefinitionStyle->maDeactiveBorderColor);
1062 aStyleSet.SetMenuColor(pDefinitionStyle->maMenuColor);
1063 aStyleSet.SetMenuBarColor(pDefinitionStyle->maMenuBarColor);
1064 aStyleSet.SetMenuBarRolloverColor(pDefinitionStyle->maMenuBarRolloverColor);
1065 aStyleSet.SetMenuBorderColor(pDefinitionStyle->maMenuBorderColor);
1066 aStyleSet.SetMenuTextColor(pDefinitionStyle->maMenuTextColor);
1067 aStyleSet.SetMenuBarTextColor(pDefinitionStyle->maMenuBarTextColor);
1068 aStyleSet.SetMenuBarRolloverTextColor(pDefinitionStyle->maMenuBarRolloverTextColor);
1069 aStyleSet.SetMenuBarHighlightTextColor(pDefinitionStyle->maMenuBarHighlightTextColor);
1070 aStyleSet.SetMenuHighlightColor(pDefinitionStyle->maMenuHighlightColor);
1071 aStyleSet.SetMenuHighlightTextColor(pDefinitionStyle->maMenuHighlightTextColor);
1072 aStyleSet.SetHighlightColor(pDefinitionStyle->maHighlightColor);
1073 aStyleSet.SetHighlightTextColor(pDefinitionStyle->maHighlightTextColor);
1074 aStyleSet.SetActiveTabColor(pDefinitionStyle->maActiveTabColor);
1075 aStyleSet.SetInactiveTabColor(pDefinitionStyle->maInactiveTabColor);
1076 aStyleSet.SetTabTextColor(pDefinitionStyle->maTabTextColor);
1077 aStyleSet.SetTabRolloverTextColor(pDefinitionStyle->maTabRolloverTextColor);
1078 aStyleSet.SetTabHighlightTextColor(pDefinitionStyle->maTabHighlightTextColor);
1079 aStyleSet.SetDisableColor(pDefinitionStyle->maDisableColor);
1080 aStyleSet.SetHelpColor(pDefinitionStyle->maHelpColor);
1081 aStyleSet.SetHelpTextColor(pDefinitionStyle->maHelpTextColor);
1082 aStyleSet.SetLinkColor(pDefinitionStyle->maLinkColor);
1083 aStyleSet.SetVisitedLinkColor(pDefinitionStyle->maVisitedLinkColor);
1084 aStyleSet.SetToolTextColor(pDefinitionStyle->maToolTextColor);
1085
1086 auto& pSettings = m_pWidgetDefinition->mpSettings;
1087
1088 int nFontSize = getSettingValueInteger(pSettings->msDefaultFontSize, 10);
1089 vcl::Font aFont(FAMILY_SWISS, Size(0, nFontSize));
1090 aFont.SetCharSet(osl_getThreadTextEncoding());
1091 aFont.SetWeight(WEIGHT_NORMAL);
1092 aFont.SetFamilyName("Liberation Sans");
1093 aStyleSet.SetAppFont(aFont);
1094 aStyleSet.SetHelpFont(aFont);
1095 aStyleSet.SetMenuFont(aFont);
1096 aStyleSet.SetToolFont(aFont);
1097 aStyleSet.SetGroupFont(aFont);
1098 aStyleSet.SetLabelFont(aFont);
1099 aStyleSet.SetRadioCheckFont(aFont);
1100 aStyleSet.SetPushButtonFont(aFont);
1101 aStyleSet.SetFieldFont(aFont);
1102 aStyleSet.SetIconFont(aFont);
1103 aStyleSet.SetTabFont(aFont);
1104
1105 aFont.SetWeight(WEIGHT_BOLD);
1106 aStyleSet.SetFloatTitleFont(aFont);
1107 aStyleSet.SetTitleFont(aFont);
1108
1109 int nTitleHeight = getSettingValueInteger(pSettings->msTitleHeight, aStyleSet.GetTitleHeight());
1110 aStyleSet.SetTitleHeight(nTitleHeight);
1111
1112 int nFloatTitleHeight
1113 = getSettingValueInteger(pSettings->msFloatTitleHeight, aStyleSet.GetFloatTitleHeight());
1114 aStyleSet.SetFloatTitleHeight(nFloatTitleHeight);
1115
1116 int nLogicWidth = getSettingValueInteger(pSettings->msListBoxPreviewDefaultLogicWidth,
1117 15); // See vcl/source/app/settings.cxx
1118 int nLogicHeight = getSettingValueInteger(pSettings->msListBoxPreviewDefaultLogicHeight, 7);
1119 aStyleSet.SetListBoxPreviewDefaultLogicSize(Size(nLogicWidth, nLogicHeight));
1120
1121 rSettings.SetStyleSettings(aStyleSet);
1122
1123 return true;
1124}
1125
1126} // end vcl namespace
1127
1128/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ SubEdit
The edit field part of a control, e.g.
@ HasBackgroundTexture
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
const AlphaMask & GetAlphaMask() const
Definition: bitmapex.hxx:71
bool IsAlpha() const
Definition: BitmapEx.cxx:207
bool IsEmpty() const
Definition: BitmapEx.cxx:186
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Definition: BitmapEx.cxx:217
const Size & GetSizePixel() const
Definition: bitmapex.hxx:73
const std::shared_ptr< SalBitmap > & ImplGetSalBitmap() const
ControlType getType() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry)=0
bool getAntiAlias() const
Definition: salgdi.hxx:92
void setAntiAlias(bool bNew)
Definition: salgdi.hxx:83
virtual void SetLineColor()=0
virtual void SetFillColor()=0
virtual void drawPolyLine(sal_uInt32 nPoints, const Point *pPtAry)=0
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)=0
virtual bool implDrawGradient(basegfx::B2DPolyPolygon const &, SalGradient const &)
Definition: salgdi.hxx:481
constexpr tools::Long Height() const
constexpr tools::Long Width() const
tools::Rectangle maThumbRect
ControlState mnThumbState
tools::Rectangle maLowerRect
ControlPart mnLowerPart
tools::Rectangle maUpperRect
ControlState mnUpperState
ControlState mnLowerState
ControlPart mnUpperPart
void SetFieldTextColor(const Color &rColor)
void SetLabelFont(const vcl::Font &rFont)
void SetLightBorderColor(const Color &rColor)
void SetRadioCheckFont(const vcl::Font &rFont)
void SetLinkColor(const Color &rColor)
void SetFieldRolloverTextColor(const Color &rColor)
void SetActionButtonTextColor(const Color &rColor)
void SetGroupTextColor(const Color &rColor)
void SetFloatTitleFont(const vcl::Font &rFont)
void SetFlatButtonPressedRolloverTextColor(const Color &rColor)
void SetActiveTextColor(const Color &rColor)
sal_Int32 GetTitleHeight() const
void SetFaceColor(const Color &rColor)
void SetHelpFont(const vcl::Font &rFont)
void SetHelpTextColor(const Color &rColor)
void SetToolFont(const vcl::Font &rFont)
void SetShadowColor(const Color &rColor)
void SetListBoxPreviewDefaultLogicSize(Size const &rSize)
void SetActiveBorderColor(const Color &rColor)
void SetPushButtonFont(const vcl::Font &rFont)
void SetTabTextColor(const Color &rColor)
void SetTitleHeight(sal_Int32 nSize)
void SetDisableColor(const Color &rColor)
void SetActiveTabColor(const Color &rColor)
void SetHighlightTextColor(const Color &rColor)
void SetFloatTitleHeight(sal_Int32 nSize)
void SetActionButtonRolloverTextColor(const Color &rColor)
void SetTabRolloverTextColor(const Color &rColor)
void SetDefaultButtonPressedRolloverTextColor(const Color &rColor)
void SetMenuBarHighlightTextColor(const Color &rColor)
void SetDefaultActionButtonTextColor(const Color &rColor)
void SetActiveColor(const Color &rColor)
void SetHelpColor(const Color &rColor)
void SetInactiveTabColor(const Color &rColor)
void SetDialogColor(const Color &rColor)
void SetMenuTextColor(const Color &rColor)
void SetDefaultButtonRolloverTextColor(const Color &rColor)
void SetTabFont(const vcl::Font &rFont)
void SetFlatButtonRolloverTextColor(const Color &rColor)
void SetDefaultActionButtonRolloverTextColor(const Color &rColor)
void SetGroupFont(const vcl::Font &rFont)
void SetCheckedColor(const Color &rColor)
void SetMenuColor(const Color &rColor)
void SetHighlightColor(const Color &rColor)
void SetMonoColor(const Color &rColor)
void SetButtonPressedRolloverTextColor(const Color &rColor)
void SetAppFont(const vcl::Font &rFont)
void SetMenuBarColor(const Color &rColor)
void SetMenuBarRolloverTextColor(const Color &rColor)
void SetMenuHighlightTextColor(const Color &rColor)
void SetTitleFont(const vcl::Font &rFont)
sal_Int32 GetFloatTitleHeight() const
void SetRadioCheckTextColor(const Color &rColor)
void SetLabelTextColor(const Color &rColor)
void SetFieldFont(const vcl::Font &rFont)
void SetDefaultButtonTextColor(const Color &rColor)
void SetIconFont(const vcl::Font &rFont)
void SetButtonRolloverTextColor(const Color &rColor)
void SetButtonTextColor(const Color &rColor)
void SetWindowColor(const Color &rColor)
void SetWindowTextColor(const Color &rColor)
void SetTabHighlightTextColor(const Color &rColor)
void SetVisitedLinkColor(const Color &rColor)
void SetMenuBarTextColor(const Color &rColor)
void SetMenuBarRolloverColor(const Color &rColor)
void SetDeactiveTextColor(const Color &rColor)
void SetDarkShadowColor(const Color &rColor)
void SetFieldColor(const Color &rColor)
void SetMenuFont(const vcl::Font &rFont)
void SetDefaultActionButtonPressedRolloverTextColor(const Color &rColor)
void SetMenuBorderColor(const Color &rColor)
void SetToolTextColor(const Color &rColor)
void SetMenuHighlightColor(const Color &rColor)
void SetLightColor(const Color &rColor)
void SetWorkspaceColor(const Color &rColor)
void SetDeactiveBorderColor(const Color &rColor)
void SetDeactiveColor(const Color &rColor)
void SetActionButtonPressedRolloverTextColor(const Color &rColor)
void SetDialogTextColor(const Color &rColor)
void SetFlatButtonTextColor(const Color &rColor)
TYPE getWidth() const
double getCenterX() const
double getCenterY() const
TYPE getHeight() const
std::vector< std::shared_ptr< DrawBase > > maChildren
basegfx::B2DRange maRectangle
basegfx::BColor maColor
list_const_iterator_t find(const Key &key)
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
void expand(tools::Long nExpandBy)
std::shared_ptr< WidgetDefinition > m_pWidgetDefinition
static void drawBitmap(SalGraphics &rGraphics, const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)
bool updateSettings(AllSettings &rSettings) override
static void drawPolyPolygon(SalGraphics &rGraphics, const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &i_rPolyPolygon, double i_fTransparency)
bool isNativeControlSupported(ControlType eType, ControlPart ePart) override
Query the platform layer for native control support.
bool hitTestNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, const Point &aPos, bool &rIsInside) override
Query if a position is inside the native widget part.
bool resolveDefinition(ControlType eType, ControlPart ePart, ControlState eState, const ImplControlValue &rValue, tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)
FileDefinitionWidgetDraw(SalGraphics &rGraphics)
static void drawPolyLine(SalGraphics &rGraphics, const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolygon &i_rPolygon, double i_fTransparency, double i_fLineWidth, const std::vector< double > *i_pStroke, basegfx::B2DLineJoin i_eLineJoin, css::drawing::LineCap i_eLineCap, double i_fMiterMinimumAngle, bool bPixelSnapHairline)
static void implDrawGradient(SalGraphics &rGraphics, const basegfx::B2DPolyPolygon &rPolyPolygon, const SalGradient &rGradient)
bool getNativeControlRegion(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaption, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) override
Get the native control regions for the control part.
bool drawNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaptions, const Color &rBackgroundColor) override
Draw the requested control.
void SetWeight(FontWeight)
Definition: font/font.cxx:236
void SetCharSet(rtl_TextEncoding)
Definition: font/font.cxx:161
void SetFamilyName(const OUString &rFamilyName)
Definition: font/font.cxx:137
float u
float y
float x
DocumentType eType
FAMILY_SWISS
WEIGHT_BOLD
WEIGHT_NORMAL
constexpr OUStringLiteral aData
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
bool isdigitAsciiString(std::string_view rString)
Reference< XComponentContext > getProcessComponentContext()
int i
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
long Long
void loadFromSvg(SvStream &rStream, const OUString &sPath, BitmapEx &rBitmapEx, double fScalingFactor)
Definition: BitmapTools.cxx:72
ImplSVNWFData maNWFData
Definition: svdata.hxx:403
ImplSVGDIData maGDIData
Definition: svdata.hxx:398
o3tl::lru_map< OUString, BitmapEx > maThemeImageCache
Definition: svdata.hxx:234
o3tl::lru_map< OUString, gfx::DrawRoot > maThemeDrawCommandsCache
Definition: svdata.hxx:235
bool mbNoFocusRects
Definition: svdata.hxx:325
int mnListBoxEntryMargin
Definition: svdata.hxx:346
bool mbCanDrawWidgetAnySize
Definition: svdata.hxx:335
bool mbCenteredTabs
Definition: svdata.hxx:329
bool mbNoFocusRectsForFlatButtons
Definition: svdata.hxx:326
int mnStatusBarLowerRightOffset
Definition: svdata.hxx:315
bool mbProgressNeedsErase
Definition: svdata.hxx:332
bool mbNoActiveTabTextRaise
Definition: svdata.hxx:330
basegfx::B2DPoint maPoint1
Definition: SalGradient.hxx:29
basegfx::B2DPoint maPoint2
Definition: SalGradient.hxx:30
std::vector< SalGradientStop > maStops
Definition: SalGradient.hxx:31
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:77
std::unique_ptr< char[]> aBuffer