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