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(OString const& rValue, bool bDefault)
99 {
100  if (rValue.isEmpty())
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 
120  {
121  auto& pSettings = m_pWidgetDefinition->mpSettings;
122 
123  ImplSVData* pSVData = ImplGetSVData();
124  pSVData->maNWFData.mbNoFocusRects = true;
125  pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
127  = getSettingValueBool(pSettings->msNoActiveTabTextRaise, true);
128  pSVData->maNWFData.mbCenteredTabs = getSettingValueBool(pSettings->msCenteredTabs, true);
129  pSVData->maNWFData.mbProgressNeedsErase = true;
131  pSVData->maNWFData.mbCanDrawWidgetAnySize = true;
132 
133  int nDefaultListboxEntryMargin = pSVData->maNWFData.mnListBoxEntryMargin;
135  = getSettingValueInteger(pSettings->msListBoxEntryMargin, nDefaultListboxEntryMargin);
136 
137  m_bIsActive = true;
138  }
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 
209 namespace
210 {
211 void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics, long nX, long nY,
212  long nWidth, long nHeight)
213 {
214  basegfx::B2DRectangle aSVGRect = rDrawRoot.maRectangle;
215 
216  basegfx::B2DRange aTargetSurface(nX, nY, nX + nWidth + 1, nY + nHeight + 1);
217 
218  for (std::shared_ptr<gfx::DrawBase> const& pDrawBase : rDrawRoot.maChildren)
219  {
220  switch (pDrawBase->getType())
221  {
223  {
224  auto const& rRectangle = static_cast<gfx::DrawRectangle const&>(*pDrawBase);
225 
226  basegfx::B2DRange aInputRectangle(rRectangle.maRectangle);
227 
228  double fDeltaX = aTargetSurface.getWidth() - aSVGRect.getWidth();
229  double fDeltaY = aTargetSurface.getHeight() - aSVGRect.getHeight();
230 
231  basegfx::B2DRange aFinalRectangle(
232  aInputRectangle.getMinX(), aInputRectangle.getMinY(),
233  aInputRectangle.getMaxX() + fDeltaX, aInputRectangle.getMaxY() + fDeltaY);
234 
236  aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5));
237 
239  aFinalRectangle, rRectangle.mnRx / aFinalRectangle.getWidth() * 2.0,
240  rRectangle.mnRy / aFinalRectangle.getHeight() * 2.0);
241 
242  if (rRectangle.mpFillColor)
243  {
244  rGraphics.SetLineColor();
245  rGraphics.SetFillColor(Color(*rRectangle.mpFillColor));
247  basegfx::B2DPolyPolygon(aB2DPolygon),
248  1.0 - rRectangle.mnOpacity, nullptr);
249  }
250  else if (rRectangle.mpFillGradient)
251  {
252  rGraphics.SetLineColor();
253  rGraphics.SetFillColor();
254  if (rRectangle.mpFillGradient->meType == gfx::GradientType::Linear)
255  {
256  auto* pLinearGradient = static_cast<gfx::LinearGradientInfo*>(
257  rRectangle.mpFillGradient.get());
258  SalGradient aGradient;
259  double x, y;
260 
261  x = pLinearGradient->x1;
262  y = pLinearGradient->y1;
263 
264  if (x > aSVGRect.getCenterX())
265  x = x + fDeltaX;
266  if (y > aSVGRect.getCenterY())
267  y = y + fDeltaY;
268 
269  aGradient.maPoint1 = basegfx::B2DPoint(x, y);
271  aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5);
272 
273  x = pLinearGradient->x2;
274  y = pLinearGradient->y2;
275 
276  if (x > aSVGRect.getCenterX())
277  x = x + fDeltaX;
278  if (y > aSVGRect.getCenterY())
279  y = y + fDeltaY;
280 
281  aGradient.maPoint2 = basegfx::B2DPoint(x, y);
283  aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5);
284 
285  for (gfx::GradientStop const& rStop : pLinearGradient->maGradientStops)
286  {
287  Color aColor(rStop.maColor);
288  aColor.SetTransparency(rStop.mfOpacity * (1.0f - rRectangle.mnOpacity));
289  aGradient.maStops.emplace_back(aColor, rStop.mfOffset);
290  }
291  rGraphics.DrawGradient(basegfx::B2DPolyPolygon(aB2DPolygon), aGradient);
292  }
293  }
294  if (rRectangle.mpStrokeColor)
295  {
296  rGraphics.SetLineColor(Color(*rRectangle.mpStrokeColor));
297  rGraphics.SetFillColor();
298  rGraphics.DrawPolyLine(
299  basegfx::B2DHomMatrix(), aB2DPolygon, 1.0 - rRectangle.mnOpacity,
300  basegfx::B2DVector(rRectangle.mnStrokeWidth, rRectangle.mnStrokeWidth),
301  nullptr, // MM01
302  basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false,
303  nullptr);
304  }
305  }
306  break;
308  {
309  auto const& rPath = static_cast<gfx::DrawPath const&>(*pDrawBase);
310 
311  double fDeltaX = aTargetSurface.getWidth() - aSVGRect.getWidth();
312  double fDeltaY = aTargetSurface.getHeight() - aSVGRect.getHeight();
313 
314  basegfx::B2DPolyPolygon aPolyPolygon(rPath.maPolyPolygon);
315  for (auto& rPolygon : aPolyPolygon)
316  {
317  for (size_t i = 0; i < rPolygon.count(); ++i)
318  {
319  auto& rPoint = rPolygon.getB2DPoint(i);
320  double x = rPoint.getX();
321  double y = rPoint.getY();
322 
323  if (x > aSVGRect.getCenterX())
324  x = x + fDeltaX;
325  if (y > aSVGRect.getCenterY())
326  y = y + fDeltaY;
327  rPolygon.setB2DPoint(i, basegfx::B2DPoint(x, y));
328  }
329  }
330  aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(
331  aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5));
332 
333  if (rPath.mpFillColor)
334  {
335  rGraphics.SetLineColor();
336  rGraphics.SetFillColor(Color(*rPath.mpFillColor));
337  rGraphics.DrawPolyPolygon(basegfx::B2DHomMatrix(), aPolyPolygon,
338  1.0 - rPath.mnOpacity, nullptr);
339  }
340  if (rPath.mpStrokeColor)
341  {
342  rGraphics.SetLineColor(Color(*rPath.mpStrokeColor));
343  rGraphics.SetFillColor();
344  for (auto const& rPolygon : aPolyPolygon)
345  {
346  rGraphics.DrawPolyLine(
347  basegfx::B2DHomMatrix(), rPolygon, 1.0 - rPath.mnOpacity,
348  basegfx::B2DVector(rPath.mnStrokeWidth, rPath.mnStrokeWidth),
349  nullptr, // MM01
350  basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false,
351  nullptr);
352  }
353  }
354  }
355  break;
356 
357  default:
358  break;
359  }
360  }
361 }
362 
363 void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDrawActions,
364  SalGraphics& rGraphics, long nX, long nY, long nWidth, long nHeight)
365 {
366  for (std::shared_ptr<WidgetDrawAction> const& pDrawAction : rDrawActions)
367  {
368  switch (pDrawAction->maType)
369  {
371  {
372  auto const& rWidgetDraw
373  = static_cast<WidgetDrawActionRectangle const&>(*pDrawAction);
374 
375  basegfx::B2DRectangle rRect(
376  nX + (nWidth * rWidgetDraw.mfX1), nY + (nHeight * rWidgetDraw.mfY1),
377  nX + (nWidth * rWidgetDraw.mfX2), nY + (nHeight * rWidgetDraw.mfY2));
378 
380  rRect, rWidgetDraw.mnRx / rRect.getWidth() * 2.0,
381  rWidgetDraw.mnRy / rRect.getHeight() * 2.0);
382 
383  rGraphics.SetLineColor();
384  rGraphics.SetFillColor(rWidgetDraw.maFillColor);
386  basegfx::B2DPolyPolygon(aB2DPolygon), 0.0f, nullptr);
387  rGraphics.SetLineColor(rWidgetDraw.maStrokeColor);
388  rGraphics.SetFillColor();
389  rGraphics.DrawPolyLine(
390  basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f,
391  basegfx::B2DVector(rWidgetDraw.mnStrokeWidth, rWidgetDraw.mnStrokeWidth),
392  nullptr, // MM01
393  basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false, nullptr);
394  }
395  break;
397  {
398  auto const& rWidgetDraw = static_cast<WidgetDrawActionLine const&>(*pDrawAction);
399  Point aRectPoint(nX + 1, nY + 1);
400 
401  Size aRectSize(nWidth - 1, nHeight - 1);
402 
403  rGraphics.SetFillColor();
404  rGraphics.SetLineColor(rWidgetDraw.maStrokeColor);
405 
406  basegfx::B2DPolygon aB2DPolygon{
407  { aRectPoint.X() + (aRectSize.Width() * rWidgetDraw.mfX1),
408  aRectPoint.Y() + (aRectSize.Height() * rWidgetDraw.mfY1) },
409  { aRectPoint.X() + (aRectSize.Width() * rWidgetDraw.mfX2),
410  aRectPoint.Y() + (aRectSize.Height() * rWidgetDraw.mfY2) },
411  };
412 
413  rGraphics.DrawPolyLine(
414  basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f,
415  basegfx::B2DVector(rWidgetDraw.mnStrokeWidth, rWidgetDraw.mnStrokeWidth),
416  nullptr, // MM01
417  basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false, nullptr);
418  }
419  break;
421  {
422  double nScaleFactor = 1.0;
425 
426  auto const& rWidgetDraw = static_cast<WidgetDrawActionImage const&>(*pDrawAction);
427  auto& rCacheImages = ImplGetSVData()->maGDIData.maThemeImageCache;
428  OUString rCacheKey = rWidgetDraw.msSource + "@" + OUString::number(nScaleFactor);
429  auto aIterator = rCacheImages.find(rCacheKey);
430 
431  BitmapEx aBitmap;
432  if (aIterator == rCacheImages.end())
433  {
434  SvFileStream aFileStream(rWidgetDraw.msSource, StreamMode::READ);
435 
436  vcl::bitmap::loadFromSvg(aFileStream, "", aBitmap, nScaleFactor);
437  if (!!aBitmap)
438  {
439  rCacheImages.insert(std::make_pair(rCacheKey, aBitmap));
440  }
441  }
442  else
443  {
444  aBitmap = aIterator->second;
445  }
446 
447  long nImageWidth = aBitmap.GetSizePixel().Width();
448  long nImageHeight = aBitmap.GetSizePixel().Height();
449  SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, nImageWidth / nScaleFactor,
450  nImageHeight / nScaleFactor);
451  if (!!aBitmap)
452  {
453  const std::shared_ptr<SalBitmap> pSalBitmap
454  = aBitmap.GetBitmap().ImplGetSalBitmap();
455  if (aBitmap.IsAlpha())
456  {
457  const std::shared_ptr<SalBitmap> pSalBitmapAlpha
458  = aBitmap.GetAlpha().ImplGetSalBitmap();
459  rGraphics.DrawBitmap(aTR, *pSalBitmap, *pSalBitmapAlpha, nullptr);
460  }
461  else
462  {
463  rGraphics.DrawBitmap(aTR, *pSalBitmap, nullptr);
464  }
465  }
466  }
467  break;
469  {
470  auto const& rWidgetDraw
471  = static_cast<WidgetDrawActionExternal const&>(*pDrawAction);
472 
473  auto& rCacheDrawCommands = ImplGetSVData()->maGDIData.maThemeDrawCommandsCache;
474 
475  auto aIterator = rCacheDrawCommands.find(rWidgetDraw.msSource);
476 
477  if (aIterator == rCacheDrawCommands.end())
478  {
479  SvFileStream aFileStream(rWidgetDraw.msSource, StreamMode::READ);
480 
481  uno::Reference<uno::XComponentContext> xContext(
483  const uno::Reference<graphic::XSvgParser> xSvgParser
484  = graphic::SvgTools::create(xContext);
485 
486  std::size_t nSize = aFileStream.remainingSize();
487  std::vector<sal_Int8> aBuffer(nSize + 1);
488  aFileStream.ReadBytes(aBuffer.data(), nSize);
489  aBuffer[nSize] = 0;
490 
491  uno::Sequence<sal_Int8> aData(aBuffer.data(), nSize + 1);
492  uno::Reference<io::XInputStream> aInputStream(
494 
495  uno::Any aAny = xSvgParser->getDrawCommands(aInputStream, "");
496  if (aAny.has<sal_uInt64>())
497  {
498  auto* pDrawRoot = reinterpret_cast<gfx::DrawRoot*>(aAny.get<sal_uInt64>());
499  if (pDrawRoot)
500  {
501  rCacheDrawCommands.insert(
502  std::make_pair(rWidgetDraw.msSource, *pDrawRoot));
503  drawFromDrawCommands(*pDrawRoot, rGraphics, nX, nY, nWidth, nHeight);
504  }
505  }
506  }
507  else
508  {
509  drawFromDrawCommands(aIterator->second, rGraphics, nX, nY, nWidth, nHeight);
510  }
511  }
512  break;
513  }
514  }
515 }
516 
517 } // end anonymous namespace
518 
520  ControlState eState,
521  const ImplControlValue& rValue, long nX, long nY,
522  long nWidth, long nHeight)
523 {
524  bool bOK = false;
525  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ePart);
526  if (pPart)
527  {
528  auto const& aStates = pPart->getStates(eType, ePart, eState, rValue);
529  if (!aStates.empty())
530  {
531  // use last defined state
532  auto const& pState = aStates.back();
533  {
534  munchDrawCommands(pState->mpWidgetDrawActions, m_rGraphics, nX, nY, nWidth,
535  nHeight);
536  bOK = true;
537  }
538  }
539  }
540  return bOK;
541 }
542 
544  const tools::Rectangle& rControlRegion,
545  ControlState eState,
546  const ImplControlValue& rValue,
547  const OUString& /*aCaptions*/)
548 {
549  bool bOldAA = m_rGraphics.getAntiAliasB2DDraw();
551 
552  long nWidth = rControlRegion.GetWidth() - 1;
553  long nHeight = rControlRegion.GetHeight() - 1;
554  long nX = rControlRegion.Left();
555  long nY = rControlRegion.Top();
556 
557  bool bOK = false;
558 
559  switch (eType)
560  {
562  {
563  /*bool bIsAction = false;
564  const PushButtonValue* pPushButtonValue = static_cast<const PushButtonValue*>(&rValue);
565  if (pPushButtonValue)
566  bIsAction = pPushButtonValue->mbIsAction;*/
567 
568  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
569  }
570  break;
572  {
573  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
574  }
575  break;
577  {
578  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
579  }
580  break;
582  {
583  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
584  }
585  break;
589  {
590  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
591  }
592  break;
594  {
595  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
596  }
597  break;
599  {
600  if (rValue.getType() == ControlType::SpinButtons)
601  {
602  const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue*>(&rValue);
603 
604  {
605  ControlPart eUpButtonPart = pSpinVal->mnUpperPart;
606  ControlState eUpButtonState = pSpinVal->mnUpperState;
607 
608  long nUpperX = pSpinVal->maUpperRect.Left();
609  long nUpperY = pSpinVal->maUpperRect.Top();
610  long nUpperWidth = pSpinVal->maUpperRect.GetWidth() - 1;
611  long nUpperHeight = pSpinVal->maUpperRect.GetHeight() - 1;
612 
613  bOK = resolveDefinition(eType, eUpButtonPart, eUpButtonState,
614  ImplControlValue(), nUpperX, nUpperY, nUpperWidth,
615  nUpperHeight);
616  }
617 
618  if (bOK)
619  {
620  ControlPart eDownButtonPart = pSpinVal->mnLowerPart;
621  ControlState eDownButtonState = pSpinVal->mnLowerState;
622 
623  long nLowerX = pSpinVal->maLowerRect.Left();
624  long nLowerY = pSpinVal->maLowerRect.Top();
625  long nLowerWidth = pSpinVal->maLowerRect.GetWidth() - 1;
626  long nLowerHeight = pSpinVal->maLowerRect.GetHeight() - 1;
627 
628  bOK = resolveDefinition(eType, eDownButtonPart, eDownButtonState,
629  ImplControlValue(), nLowerX, nLowerY, nLowerWidth,
630  nLowerHeight);
631  }
632  }
633  else
634  {
635  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
636  }
637  }
638  break;
640  break;
645  {
646  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
647  }
648  break;
650  {
651  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
652  }
653  break;
654  case ControlType::Slider:
655  {
656  const SliderValue* pSliderValue = static_cast<const SliderValue*>(&rValue);
657  long nThumbX = pSliderValue->maThumbRect.Left();
658  long nThumbY = pSliderValue->maThumbRect.Top();
659  long nThumbWidth = pSliderValue->maThumbRect.GetWidth() - 1;
660  long nThumbHeight = pSliderValue->maThumbRect.GetHeight() - 1;
661 
662  if (ePart == ControlPart::TrackHorzArea)
663  {
664  long nCenterX = nThumbX + nThumbWidth / 2;
665 
666  bOK = resolveDefinition(eType, ControlPart::TrackHorzLeft, eState, rValue, nX, nY,
667  nCenterX - nX, nHeight);
668  if (bOK)
669  bOK = resolveDefinition(eType, ControlPart::TrackHorzRight, eState, rValue,
670  nCenterX, nY, nX + nWidth - nCenterX, nHeight);
671  }
672  else if (ePart == ControlPart::TrackVertArea)
673  {
674  long nCenterY = nThumbY + nThumbHeight / 2;
675 
676  bOK = resolveDefinition(eType, ControlPart::TrackVertUpper, eState, rValue, nX, nY,
677  nWidth, nCenterY - nY);
678  if (bOK)
679  bOK = resolveDefinition(eType, ControlPart::TrackVertLower, eState, rValue, nY,
680  nCenterY, nWidth, nY + nHeight - nCenterY);
681  }
682 
683  if (bOK)
684  {
686  eState | pSliderValue->mnThumbState, rValue, nThumbX,
687  nThumbY, nThumbWidth, nThumbHeight);
688  }
689  }
690  break;
692  {
693  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
694  }
695  break;
697  {
698  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
699  }
700  break;
703  {
704  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
705  }
706  break;
708  {
709  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
710  }
711  break;
713  break;
715  {
716  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
717  }
718  break;
720  case ControlType::Frame:
721  {
722  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
723  }
724  break;
728  {
729  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
730  }
731  break;
732  default:
733  break;
734  }
735 
737 
738  return bOK;
739 }
740 
742  ControlType eType, ControlPart ePart, const tools::Rectangle& rBoundingControlRegion,
743  ControlState /*eState*/, const ImplControlValue& /*aValue*/, const OUString& /*aCaption*/,
744  tools::Rectangle& rNativeBoundingRegion, tools::Rectangle& rNativeContentRegion)
745 {
746  Point aLocation(rBoundingControlRegion.TopLeft());
747 
748  switch (eType)
749  {
751  {
752  auto const& pButtonUpPart
753  = m_pWidgetDefinition->getDefinition(eType, ControlPart::ButtonUp);
754  if (!pButtonUpPart)
755  return false;
756  Size aButtonSizeUp(pButtonUpPart->mnWidth, pButtonUpPart->mnHeight);
757 
758  auto const& pButtonDownPart
759  = m_pWidgetDefinition->getDefinition(eType, ControlPart::ButtonDown);
760  if (!pButtonDownPart)
761  return false;
762  Size aButtonSizeDown(pButtonDownPart->mnWidth, pButtonDownPart->mnHeight);
763 
764  auto const& pEntirePart
765  = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
766 
767  OString sOrientation = pEntirePart->msOrientation;
768 
769  if (sOrientation.isEmpty() || sOrientation == "stacked")
770  {
771  return false;
772  }
773  else if (sOrientation == "decrease-edit-increase")
774  {
775  if (ePart == ControlPart::ButtonUp)
776  {
777  Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
778  - aButtonSizeUp.Width(),
779  aLocation.Y());
780  rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeUp);
781  rNativeBoundingRegion = rNativeContentRegion;
782  return true;
783  }
784  else if (ePart == ControlPart::ButtonDown)
785  {
786  rNativeContentRegion = tools::Rectangle(aLocation, aButtonSizeDown);
787  rNativeBoundingRegion = rNativeContentRegion;
788  return true;
789  }
790  else if (ePart == ControlPart::SubEdit)
791  {
792  Point aPoint(aLocation.X() + aButtonSizeDown.Width(), aLocation.Y());
793  Size aSize(rBoundingControlRegion.GetWidth()
794  - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
795  std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
796  rNativeContentRegion = tools::Rectangle(aPoint, aSize);
797  rNativeBoundingRegion = rNativeContentRegion;
798  return true;
799  }
800  else if (ePart == ControlPart::Entire)
801  {
802  Size aSize(rBoundingControlRegion.GetWidth(),
803  std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
804  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
805  rNativeBoundingRegion = rNativeContentRegion;
806  return true;
807  }
808  }
809  else if (sOrientation == "edit-decrease-increase")
810  {
811  if (ePart == ControlPart::ButtonUp)
812  {
813  Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
814  - aButtonSizeUp.Width(),
815  aLocation.Y());
816  rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeUp);
817  rNativeBoundingRegion = rNativeContentRegion;
818  return true;
819  }
820  else if (ePart == ControlPart::ButtonDown)
821  {
822  Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
823  - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
824  aLocation.Y());
825  rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeDown);
826  rNativeBoundingRegion = rNativeContentRegion;
827  return true;
828  }
829  else if (ePart == ControlPart::SubEdit)
830  {
831  Size aSize(rBoundingControlRegion.GetWidth()
832  - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
833  std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
834  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
835  rNativeBoundingRegion = rNativeContentRegion;
836  return true;
837  }
838  else if (ePart == ControlPart::Entire)
839  {
840  Size aSize(rBoundingControlRegion.GetWidth(),
841  std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
842  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
843  rNativeBoundingRegion = rNativeContentRegion;
844  return true;
845  }
846  }
847  }
848  break;
850  {
851  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
852  if (!pPart)
853  return false;
854 
855  Size aSize(pPart->mnWidth, pPart->mnHeight);
856  rNativeContentRegion = tools::Rectangle(Point(), aSize);
857  return true;
858  }
860  {
861  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
862  if (!pPart)
863  return false;
864 
865  Size aSize(pPart->mnWidth, pPart->mnHeight);
866  rNativeContentRegion = tools::Rectangle(Point(), aSize);
867  return true;
868  }
870  {
871  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
872  if (!pPart)
873  return false;
874 
875  long nWidth = std::max(rBoundingControlRegion.GetWidth() + pPart->mnMarginWidth,
876  long(pPart->mnWidth));
877  long nHeight = std::max(rBoundingControlRegion.GetHeight() + pPart->mnMarginHeight,
878  long(pPart->mnHeight));
879 
880  rNativeBoundingRegion = tools::Rectangle(aLocation, Size(nWidth, nHeight));
881  rNativeContentRegion = rNativeBoundingRegion;
882  return true;
883  }
887  {
888  sal_Int32 nHeight = rBoundingControlRegion.GetHeight();
889 
890  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
891  if (pPart)
892  nHeight = std::max(nHeight, pPart->mnHeight);
893 
894  Size aSize(rBoundingControlRegion.GetWidth(), nHeight);
895  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
896  rNativeBoundingRegion = rNativeContentRegion;
897  rNativeBoundingRegion.expand(2);
898  return true;
899  }
900  break;
902  {
903  if (ePart == ControlPart::ButtonUp || ePart == ControlPart::ButtonDown
904  || ePart == ControlPart::ButtonLeft || ePart == ControlPart::ButtonRight)
905  {
906  rNativeContentRegion = tools::Rectangle(aLocation, Size(0, 0));
907  rNativeBoundingRegion = rNativeContentRegion;
908  return true;
909  }
910  else
911  {
912  rNativeBoundingRegion = rBoundingControlRegion;
913  rNativeContentRegion = rNativeBoundingRegion;
914  return true;
915  }
916  }
917  break;
920  {
921  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::ButtonDown);
922  Size aComboButtonSize(pPart->mnWidth, pPart->mnHeight);
923 
924  if (ePart == ControlPart::ButtonDown)
925  {
926  Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
927  - aComboButtonSize.Width() - 1,
928  aLocation.Y());
929  rNativeContentRegion = tools::Rectangle(aPoint, aComboButtonSize);
930  rNativeBoundingRegion = rNativeContentRegion;
931  return true;
932  }
933  else if (ePart == ControlPart::SubEdit)
934  {
935  Size aSize(rBoundingControlRegion.GetWidth() - aComboButtonSize.Width(),
936  aComboButtonSize.Height());
937  rNativeContentRegion = tools::Rectangle(aLocation + Point(1, 1), aSize);
938  rNativeBoundingRegion = rNativeContentRegion;
939  return true;
940  }
941  else if (ePart == ControlPart::Entire)
942  {
943  Size aSize(rBoundingControlRegion.GetWidth(), aComboButtonSize.Height());
944  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
945  rNativeBoundingRegion = rNativeContentRegion;
946  rNativeBoundingRegion.expand(2);
947  return true;
948  }
949  }
950  break;
951  case ControlType::Slider:
952  if (ePart == ControlPart::ThumbHorz || ePart == ControlPart::ThumbVert)
953  {
954  rNativeContentRegion = tools::Rectangle(aLocation, Size(28, 28));
955  rNativeBoundingRegion = rNativeContentRegion;
956  return true;
957  }
958  break;
959  default:
960  break;
961  }
962 
963  return false;
964 }
965 
967 {
968  StyleSettings aStyleSet = rSettings.GetStyleSettings();
969 
970  auto& pDefinitionStyle = m_pWidgetDefinition->mpStyle;
971 
972  aStyleSet.SetFaceColor(pDefinitionStyle->maFaceColor);
973  aStyleSet.SetCheckedColor(pDefinitionStyle->maCheckedColor);
974  aStyleSet.SetLightColor(pDefinitionStyle->maLightColor);
975  aStyleSet.SetLightBorderColor(pDefinitionStyle->maLightBorderColor);
976  aStyleSet.SetShadowColor(pDefinitionStyle->maShadowColor);
977  aStyleSet.SetDarkShadowColor(pDefinitionStyle->maDarkShadowColor);
978  aStyleSet.SetDefaultButtonTextColor(pDefinitionStyle->maDefaultButtonTextColor);
979  aStyleSet.SetButtonTextColor(pDefinitionStyle->maButtonTextColor);
980  aStyleSet.SetDefaultActionButtonTextColor(pDefinitionStyle->maDefaultActionButtonTextColor);
981  aStyleSet.SetActionButtonTextColor(pDefinitionStyle->maActionButtonTextColor);
982  aStyleSet.SetFlatButtonTextColor(pDefinitionStyle->maFlatButtonTextColor);
983  aStyleSet.SetDefaultButtonRolloverTextColor(pDefinitionStyle->maDefaultButtonRolloverTextColor);
984  aStyleSet.SetButtonRolloverTextColor(pDefinitionStyle->maButtonRolloverTextColor);
986  pDefinitionStyle->maDefaultActionButtonRolloverTextColor);
987  aStyleSet.SetActionButtonRolloverTextColor(pDefinitionStyle->maActionButtonRolloverTextColor);
988  aStyleSet.SetFlatButtonRolloverTextColor(pDefinitionStyle->maFlatButtonRolloverTextColor);
990  pDefinitionStyle->maDefaultButtonPressedRolloverTextColor);
991  aStyleSet.SetButtonPressedRolloverTextColor(pDefinitionStyle->maButtonPressedRolloverTextColor);
993  pDefinitionStyle->maDefaultActionButtonPressedRolloverTextColor);
995  pDefinitionStyle->maActionButtonPressedRolloverTextColor);
997  pDefinitionStyle->maFlatButtonPressedRolloverTextColor);
998  aStyleSet.SetRadioCheckTextColor(pDefinitionStyle->maRadioCheckTextColor);
999  aStyleSet.SetGroupTextColor(pDefinitionStyle->maGroupTextColor);
1000  aStyleSet.SetLabelTextColor(pDefinitionStyle->maLabelTextColor);
1001  aStyleSet.SetWindowColor(pDefinitionStyle->maWindowColor);
1002  aStyleSet.SetWindowTextColor(pDefinitionStyle->maWindowTextColor);
1003  aStyleSet.SetDialogColor(pDefinitionStyle->maDialogColor);
1004  aStyleSet.SetDialogTextColor(pDefinitionStyle->maDialogTextColor);
1005  aStyleSet.SetWorkspaceColor(pDefinitionStyle->maWorkspaceColor);
1006  aStyleSet.SetMonoColor(pDefinitionStyle->maMonoColor);
1007  aStyleSet.SetFieldColor(pDefinitionStyle->maFieldColor);
1008  aStyleSet.SetFieldTextColor(pDefinitionStyle->maFieldTextColor);
1009  aStyleSet.SetFieldRolloverTextColor(pDefinitionStyle->maFieldRolloverTextColor);
1010  aStyleSet.SetActiveColor(pDefinitionStyle->maActiveColor);
1011  aStyleSet.SetActiveTextColor(pDefinitionStyle->maActiveTextColor);
1012  aStyleSet.SetActiveBorderColor(pDefinitionStyle->maActiveBorderColor);
1013  aStyleSet.SetDeactiveColor(pDefinitionStyle->maDeactiveColor);
1014  aStyleSet.SetDeactiveTextColor(pDefinitionStyle->maDeactiveTextColor);
1015  aStyleSet.SetDeactiveBorderColor(pDefinitionStyle->maDeactiveBorderColor);
1016  aStyleSet.SetMenuColor(pDefinitionStyle->maMenuColor);
1017  aStyleSet.SetMenuBarColor(pDefinitionStyle->maMenuBarColor);
1018  aStyleSet.SetMenuBarRolloverColor(pDefinitionStyle->maMenuBarRolloverColor);
1019  aStyleSet.SetMenuBorderColor(pDefinitionStyle->maMenuBorderColor);
1020  aStyleSet.SetMenuTextColor(pDefinitionStyle->maMenuTextColor);
1021  aStyleSet.SetMenuBarTextColor(pDefinitionStyle->maMenuBarTextColor);
1022  aStyleSet.SetMenuBarRolloverTextColor(pDefinitionStyle->maMenuBarRolloverTextColor);
1023  aStyleSet.SetMenuBarHighlightTextColor(pDefinitionStyle->maMenuBarHighlightTextColor);
1024  aStyleSet.SetMenuHighlightColor(pDefinitionStyle->maMenuHighlightColor);
1025  aStyleSet.SetMenuHighlightTextColor(pDefinitionStyle->maMenuHighlightTextColor);
1026  aStyleSet.SetHighlightColor(pDefinitionStyle->maHighlightColor);
1027  aStyleSet.SetHighlightTextColor(pDefinitionStyle->maHighlightTextColor);
1028  aStyleSet.SetActiveTabColor(pDefinitionStyle->maActiveTabColor);
1029  aStyleSet.SetInactiveTabColor(pDefinitionStyle->maInactiveTabColor);
1030  aStyleSet.SetTabTextColor(pDefinitionStyle->maTabTextColor);
1031  aStyleSet.SetTabRolloverTextColor(pDefinitionStyle->maTabRolloverTextColor);
1032  aStyleSet.SetTabHighlightTextColor(pDefinitionStyle->maTabHighlightTextColor);
1033  aStyleSet.SetDisableColor(pDefinitionStyle->maDisableColor);
1034  aStyleSet.SetHelpColor(pDefinitionStyle->maHelpColor);
1035  aStyleSet.SetHelpTextColor(pDefinitionStyle->maHelpTextColor);
1036  aStyleSet.SetLinkColor(pDefinitionStyle->maLinkColor);
1037  aStyleSet.SetVisitedLinkColor(pDefinitionStyle->maVisitedLinkColor);
1038  aStyleSet.SetToolTextColor(pDefinitionStyle->maToolTextColor);
1039  aStyleSet.SetFontColor(pDefinitionStyle->maFontColor);
1040 
1041  auto& pSettings = m_pWidgetDefinition->mpSettings;
1042 
1043  int nFontSize = getSettingValueInteger(pSettings->msDefaultFontSize, 10);
1044  vcl::Font aFont(FAMILY_SWISS, Size(0, nFontSize));
1045  aFont.SetCharSet(osl_getThreadTextEncoding());
1046  aFont.SetWeight(WEIGHT_NORMAL);
1047  aFont.SetFamilyName("Liberation Sans");
1048  aStyleSet.SetAppFont(aFont);
1049  aStyleSet.SetHelpFont(aFont);
1050  aStyleSet.SetMenuFont(aFont);
1051  aStyleSet.SetToolFont(aFont);
1052  aStyleSet.SetGroupFont(aFont);
1053  aStyleSet.SetLabelFont(aFont);
1054  aStyleSet.SetRadioCheckFont(aFont);
1055  aStyleSet.SetPushButtonFont(aFont);
1056  aStyleSet.SetFieldFont(aFont);
1057  aStyleSet.SetIconFont(aFont);
1058  aStyleSet.SetTabFont(aFont);
1059 
1060  aFont.SetWeight(WEIGHT_BOLD);
1061  aStyleSet.SetFloatTitleFont(aFont);
1062  aStyleSet.SetTitleFont(aFont);
1063 
1064  int nTitleHeight = getSettingValueInteger(pSettings->msTitleHeight, aStyleSet.GetTitleHeight());
1065  aStyleSet.SetTitleHeight(nTitleHeight);
1066 
1067  int nFloatTitleHeight
1068  = getSettingValueInteger(pSettings->msFloatTitleHeight, aStyleSet.GetFloatTitleHeight());
1069  aStyleSet.SetFloatTitleHeight(nFloatTitleHeight);
1070 
1071  int nLogicWidth = getSettingValueInteger(pSettings->msListBoxPreviewDefaultLogicWidth,
1072  15); // See vcl/source/app/settings.cxx
1073  int nLogicHeight = getSettingValueInteger(pSettings->msListBoxPreviewDefaultLogicHeight, 7);
1074  aStyleSet.SetListBoxPreviewDefaultLogicSize(Size(nLogicWidth, nLogicHeight));
1075 
1076  rSettings.SetStyleSettings(aStyleSet);
1077 
1078  return true;
1079 }
1080 
1081 } // end vcl namespace
1082 
1083 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetCheckedColor(const Color &rColor)
void SetMenuFont(const vcl::Font &rFont)
Point TopLeft() const
long Width() const
double getCenterY() const
void SetTabRolloverTextColor(const Color &rColor)
void loadFromSvg(SvStream &rStream, const OUString &sPath, BitmapEx &rBitmapEx, double fScalingFactor)
Definition: BitmapTools.cxx:58
void SetHighlightColor(const Color &rColor)
long GetWidth() const
void SetHelpFont(const vcl::Font &rFont)
basegfx::B2DRange maRectangle
bool mbCanDrawWidgetAnySize
Definition: svdata.hxx:329
long GetHeight() const
double getHeight() const
void SetFontColor(const Color &rColor)
const char aData[]
long GetTitleHeight() const
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)
long Height() const
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:520
void SetIconFont(const vcl::Font &rFont)
void SetRadioCheckFont(const vcl::Font &rFont)
void SetFieldRolloverTextColor(const Color &rColor)
const StyleSettings & GetStyleSettings() const
ImplSVNWFData maNWFData
Definition: svdata.hxx:399
void SetWindowColor(const Color &rColor)
void SetWeight(FontWeight)
Definition: font/font.cxx:215
bool mbNoFocusRectsForFlatButtons
Definition: svdata.hxx:322
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:394
int mnListBoxEntryMargin
Definition: svdata.hxx:340
void SetLinkColor(const Color &rColor)
void SetDeactiveBorderColor(const Color &rColor)
void SetDeactiveColor(const Color &rColor)
WEIGHT_BOLD
bool resolveDefinition(ControlType eType, ControlPart ePart, ControlState eState, const ImplControlValue &rValue, long nX, long nY, long nWidth, long nHeight)
tools::Rectangle maUpperRect
bool IsAlpha() const
Definition: bitmapex.cxx:226
double getWidth() const
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)
void SetMenuBarTextColor(const Color &rColor)
bool updateSettings(AllSettings &rSettings) override
long GetFloatTitleHeight() const
long Top() const
bool isdigitAsciiString(const OString &rString)
void SetTitleHeight(long nSize)
void DrawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice *pOutDev)
bool DrawGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient)
void DrawPolyLine(sal_uInt32 nPoints, SalPoint const *pPtAry, const OutputDevice *pOutDev)
void DrawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, PCONSTSALPOINT *pPtAry, const OutputDevice *pOutDev)
float y
std::vector< std::shared_ptr< DrawBase > > maChildren
o3tl::lru_map< OUString, BitmapEx > maThemeImageCache
Definition: svdata.hxx:231
void SetFlatButtonPressedRolloverTextColor(const Color &rColor)
ControlPart mnUpperPart
std::vector< SalGradientStop > maStops
Definition: SalGradient.hxx:31
ControlState mnUpperState
virtual void SetFillColor()=0
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
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
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)
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:232
bool getAntiAliasB2DDraw() const
Definition: salgdi.hxx:85
void SetVisitedLinkColor(const Color &rColor)
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:236
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 SetTabTextColor(const Color &rColor)
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:268
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)
void setAntiAliasB2DDraw(bool bNew)
Definition: salgdi.hxx:84
Reference< XComponentContext > getProcessComponentContext()
void expand(long nExpandBy)
long Left() const
void SetHelpColor(const Color &rColor)
void SetActiveBorderColor(const Color &rColor)
basegfx::BColor maColor
void SetListBoxPreviewDefaultLogicSize(Size const &rSize)
void SetTabFont(const vcl::Font &rFont)
bool drawNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaptions) override
Draw the requested control.
void SetDeactiveTextColor(const Color &rColor)
void(* f)(TrueTypeTable *)
Definition: ttcr.cxx:474
void SetFieldTextColor(const Color &rColor)
void SetShadowColor(const Color &rColor)
void SetActiveTextColor(const Color &rColor)
void SetTabHighlightTextColor(const Color &rColor)
std::shared_ptr< WidgetDefinition > m_pWidgetDefinition
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
void SetDefaultButtonRolloverTextColor(const Color &rColor)
void SetHelpTextColor(const Color &rColor)
const Size & GetSizePixel() const
Definition: bitmapex.hxx:83
void SetWindowTextColor(const Color &rColor)
void SetHighlightTextColor(const Color &rColor)
void SetDefaultActionButtonRolloverTextColor(const Color &rColor)
void SetDarkShadowColor(const Color &rColor)
void SetFloatTitleHeight(long nSize)
void SetActiveColor(const Color &rColor)
bool mbCenteredTabs
Definition: svdata.hxx:323