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