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(basegfx::B2DHomMatrix(), aB2DPolygon,
299  1.0 - rRectangle.mnOpacity, rRectangle.mnStrokeWidth,
300  nullptr, // MM01
301  basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND,
302  0.0f, false, nullptr);
303  }
304  }
305  break;
307  {
308  auto const& rPath = static_cast<gfx::DrawPath const&>(*pDrawBase);
309 
310  double fDeltaX = aTargetSurface.getWidth() - aSVGRect.getWidth();
311  double fDeltaY = aTargetSurface.getHeight() - aSVGRect.getHeight();
312 
313  basegfx::B2DPolyPolygon aPolyPolygon(rPath.maPolyPolygon);
314  for (auto& rPolygon : aPolyPolygon)
315  {
316  for (size_t i = 0; i < rPolygon.count(); ++i)
317  {
318  auto& rPoint = rPolygon.getB2DPoint(i);
319  double x = rPoint.getX();
320  double y = rPoint.getY();
321 
322  if (x > aSVGRect.getCenterX())
323  x = x + fDeltaX;
324  if (y > aSVGRect.getCenterY())
325  y = y + fDeltaY;
326  rPolygon.setB2DPoint(i, basegfx::B2DPoint(x, y));
327  }
328  }
329  aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(
330  aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 0.5));
331 
332  if (rPath.mpFillColor)
333  {
334  rGraphics.SetLineColor();
335  rGraphics.SetFillColor(Color(*rPath.mpFillColor));
336  rGraphics.DrawPolyPolygon(basegfx::B2DHomMatrix(), aPolyPolygon,
337  1.0 - rPath.mnOpacity, nullptr);
338  }
339  if (rPath.mpStrokeColor)
340  {
341  rGraphics.SetLineColor(Color(*rPath.mpStrokeColor));
342  rGraphics.SetFillColor();
343  for (auto const& rPolygon : aPolyPolygon)
344  {
345  rGraphics.DrawPolyLine(basegfx::B2DHomMatrix(), rPolygon,
346  1.0 - rPath.mnOpacity, rPath.mnStrokeWidth,
347  nullptr, // MM01
349  css::drawing::LineCap_ROUND, 0.0f, false, nullptr);
350  }
351  }
352  }
353  break;
354 
355  default:
356  break;
357  }
358  }
359 }
360 
361 void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDrawActions,
362  SalGraphics& rGraphics, long nX, long nY, long nWidth, long nHeight)
363 {
364  for (std::shared_ptr<WidgetDrawAction> const& pDrawAction : rDrawActions)
365  {
366  switch (pDrawAction->maType)
367  {
369  {
370  auto const& rWidgetDraw
371  = static_cast<WidgetDrawActionRectangle const&>(*pDrawAction);
372 
373  basegfx::B2DRectangle rRect(
374  nX + (nWidth * rWidgetDraw.mfX1), nY + (nHeight * rWidgetDraw.mfY1),
375  nX + (nWidth * rWidgetDraw.mfX2), nY + (nHeight * rWidgetDraw.mfY2));
376 
378  rRect, rWidgetDraw.mnRx / rRect.getWidth() * 2.0,
379  rWidgetDraw.mnRy / rRect.getHeight() * 2.0);
380 
381  rGraphics.SetLineColor();
382  rGraphics.SetFillColor(rWidgetDraw.maFillColor);
384  basegfx::B2DPolyPolygon(aB2DPolygon), 0.0f, nullptr);
385  rGraphics.SetLineColor(rWidgetDraw.maStrokeColor);
386  rGraphics.SetFillColor();
387  rGraphics.DrawPolyLine(
388  basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f, rWidgetDraw.mnStrokeWidth,
389  nullptr, // MM01
390  basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false, nullptr);
391  }
392  break;
394  {
395  auto const& rWidgetDraw = static_cast<WidgetDrawActionLine const&>(*pDrawAction);
396  Point aRectPoint(nX + 1, nY + 1);
397 
398  Size aRectSize(nWidth - 1, nHeight - 1);
399 
400  rGraphics.SetFillColor();
401  rGraphics.SetLineColor(rWidgetDraw.maStrokeColor);
402 
403  basegfx::B2DPolygon aB2DPolygon{
404  { aRectPoint.X() + (aRectSize.Width() * rWidgetDraw.mfX1),
405  aRectPoint.Y() + (aRectSize.Height() * rWidgetDraw.mfY1) },
406  { aRectPoint.X() + (aRectSize.Width() * rWidgetDraw.mfX2),
407  aRectPoint.Y() + (aRectSize.Height() * rWidgetDraw.mfY2) },
408  };
409 
410  rGraphics.DrawPolyLine(
411  basegfx::B2DHomMatrix(), aB2DPolygon, 0.0f, rWidgetDraw.mnStrokeWidth,
412  nullptr, // MM01
413  basegfx::B2DLineJoin::Round, css::drawing::LineCap_ROUND, 0.0f, false, nullptr);
414  }
415  break;
417  {
418  double nScaleFactor = 1.0;
421 
422  auto const& rWidgetDraw = static_cast<WidgetDrawActionImage const&>(*pDrawAction);
423  auto& rCacheImages = ImplGetSVData()->maGDIData.maThemeImageCache;
424  OUString rCacheKey = rWidgetDraw.msSource + "@" + OUString::number(nScaleFactor);
425  auto aIterator = rCacheImages.find(rCacheKey);
426 
427  BitmapEx aBitmap;
428  if (aIterator == rCacheImages.end())
429  {
430  SvFileStream aFileStream(rWidgetDraw.msSource, StreamMode::READ);
431 
432  vcl::bitmap::loadFromSvg(aFileStream, "", aBitmap, nScaleFactor);
433  if (!!aBitmap)
434  {
435  rCacheImages.insert(std::make_pair(rCacheKey, aBitmap));
436  }
437  }
438  else
439  {
440  aBitmap = aIterator->second;
441  }
442 
443  long nImageWidth = aBitmap.GetSizePixel().Width();
444  long nImageHeight = aBitmap.GetSizePixel().Height();
445  SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, nImageWidth / nScaleFactor,
446  nImageHeight / nScaleFactor);
447  if (!!aBitmap)
448  {
449  const std::shared_ptr<SalBitmap> pSalBitmap
450  = aBitmap.GetBitmap().ImplGetSalBitmap();
451  if (aBitmap.IsAlpha())
452  {
453  const std::shared_ptr<SalBitmap> pSalBitmapAlpha
454  = aBitmap.GetAlpha().ImplGetSalBitmap();
455  rGraphics.DrawBitmap(aTR, *pSalBitmap, *pSalBitmapAlpha, nullptr);
456  }
457  else
458  {
459  rGraphics.DrawBitmap(aTR, *pSalBitmap, nullptr);
460  }
461  }
462  }
463  break;
465  {
466  auto const& rWidgetDraw
467  = static_cast<WidgetDrawActionExternal const&>(*pDrawAction);
468 
469  auto& rCacheDrawCommands = ImplGetSVData()->maGDIData.maThemeDrawCommandsCache;
470 
471  auto aIterator = rCacheDrawCommands.find(rWidgetDraw.msSource);
472 
473  if (aIterator == rCacheDrawCommands.end())
474  {
475  SvFileStream aFileStream(rWidgetDraw.msSource, StreamMode::READ);
476 
477  uno::Reference<uno::XComponentContext> xContext(
479  const uno::Reference<graphic::XSvgParser> xSvgParser
480  = graphic::SvgTools::create(xContext);
481 
482  std::size_t nSize = aFileStream.remainingSize();
483  std::vector<sal_Int8> aBuffer(nSize + 1);
484  aFileStream.ReadBytes(aBuffer.data(), nSize);
485  aBuffer[nSize] = 0;
486 
487  uno::Sequence<sal_Int8> aData(aBuffer.data(), nSize + 1);
488  uno::Reference<io::XInputStream> aInputStream(
490 
491  uno::Any aAny = xSvgParser->getDrawCommands(aInputStream, "");
492  if (aAny.has<sal_uInt64>())
493  {
494  auto* pDrawRoot = reinterpret_cast<gfx::DrawRoot*>(aAny.get<sal_uInt64>());
495  if (pDrawRoot)
496  {
497  rCacheDrawCommands.insert(
498  std::make_pair(rWidgetDraw.msSource, *pDrawRoot));
499  drawFromDrawCommands(*pDrawRoot, rGraphics, nX, nY, nWidth, nHeight);
500  }
501  }
502  }
503  else
504  {
505  drawFromDrawCommands(aIterator->second, rGraphics, nX, nY, nWidth, nHeight);
506  }
507  }
508  break;
509  }
510  }
511 }
512 
513 } // end anonymous namespace
514 
516  ControlState eState,
517  const ImplControlValue& rValue, long nX, long nY,
518  long nWidth, long nHeight)
519 {
520  bool bOK = false;
521  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ePart);
522  if (pPart)
523  {
524  auto const& aStates = pPart->getStates(eType, ePart, eState, rValue);
525  if (!aStates.empty())
526  {
527  // use last defined state
528  auto const& pState = aStates.back();
529  {
530  munchDrawCommands(pState->mpWidgetDrawActions, m_rGraphics, nX, nY, nWidth,
531  nHeight);
532  bOK = true;
533  }
534  }
535  }
536  return bOK;
537 }
538 
540  const tools::Rectangle& rControlRegion,
541  ControlState eState,
542  const ImplControlValue& rValue,
543  const OUString& /*aCaptions*/)
544 {
545  bool bOldAA = m_rGraphics.getAntiAliasB2DDraw();
547 
548  long nWidth = rControlRegion.GetWidth() - 1;
549  long nHeight = rControlRegion.GetHeight() - 1;
550  long nX = rControlRegion.Left();
551  long nY = rControlRegion.Top();
552 
553  bool bOK = false;
554 
555  switch (eType)
556  {
558  {
559  /*bool bIsAction = false;
560  const PushButtonValue* pPushButtonValue = static_cast<const PushButtonValue*>(&rValue);
561  if (pPushButtonValue)
562  bIsAction = pPushButtonValue->mbIsAction;*/
563 
564  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
565  }
566  break;
568  {
569  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
570  }
571  break;
573  {
574  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
575  }
576  break;
578  {
579  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
580  }
581  break;
585  {
586  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
587  }
588  break;
590  {
591  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
592  }
593  break;
595  {
596  if (rValue.getType() == ControlType::SpinButtons)
597  {
598  const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue*>(&rValue);
599 
600  {
601  ControlPart eUpButtonPart = pSpinVal->mnUpperPart;
602  ControlState eUpButtonState = pSpinVal->mnUpperState;
603 
604  long nUpperX = pSpinVal->maUpperRect.Left();
605  long nUpperY = pSpinVal->maUpperRect.Top();
606  long nUpperWidth = pSpinVal->maUpperRect.GetWidth() - 1;
607  long nUpperHeight = pSpinVal->maUpperRect.GetHeight() - 1;
608 
609  bOK = resolveDefinition(eType, eUpButtonPart, eUpButtonState,
610  ImplControlValue(), nUpperX, nUpperY, nUpperWidth,
611  nUpperHeight);
612  }
613 
614  if (bOK)
615  {
616  ControlPart eDownButtonPart = pSpinVal->mnLowerPart;
617  ControlState eDownButtonState = pSpinVal->mnLowerState;
618 
619  long nLowerX = pSpinVal->maLowerRect.Left();
620  long nLowerY = pSpinVal->maLowerRect.Top();
621  long nLowerWidth = pSpinVal->maLowerRect.GetWidth() - 1;
622  long nLowerHeight = pSpinVal->maLowerRect.GetHeight() - 1;
623 
624  bOK = resolveDefinition(eType, eDownButtonPart, eDownButtonState,
625  ImplControlValue(), nLowerX, nLowerY, nLowerWidth,
626  nLowerHeight);
627  }
628  }
629  else
630  {
631  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
632  }
633  }
634  break;
636  break;
641  {
642  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
643  }
644  break;
646  {
647  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
648  }
649  break;
650  case ControlType::Slider:
651  {
652  const SliderValue* pSliderValue = static_cast<const SliderValue*>(&rValue);
653  long nThumbX = pSliderValue->maThumbRect.Left();
654  long nThumbY = pSliderValue->maThumbRect.Top();
655  long nThumbWidth = pSliderValue->maThumbRect.GetWidth() - 1;
656  long nThumbHeight = pSliderValue->maThumbRect.GetHeight() - 1;
657 
658  if (ePart == ControlPart::TrackHorzArea)
659  {
660  long nCenterX = nThumbX + nThumbWidth / 2;
661 
662  bOK = resolveDefinition(eType, ControlPart::TrackHorzLeft, eState, rValue, nX, nY,
663  nCenterX - nX, nHeight);
664  if (bOK)
665  bOK = resolveDefinition(eType, ControlPart::TrackHorzRight, eState, rValue,
666  nCenterX, nY, nX + nWidth - nCenterX, nHeight);
667  }
668  else if (ePart == ControlPart::TrackVertArea)
669  {
670  long nCenterY = nThumbY + nThumbHeight / 2;
671 
672  bOK = resolveDefinition(eType, ControlPart::TrackVertUpper, eState, rValue, nX, nY,
673  nWidth, nCenterY - nY);
674  if (bOK)
675  bOK = resolveDefinition(eType, ControlPart::TrackVertLower, eState, rValue, nY,
676  nCenterY, nWidth, nY + nHeight - nCenterY);
677  }
678 
679  if (bOK)
680  {
682  eState | pSliderValue->mnThumbState, rValue, nThumbX,
683  nThumbY, nThumbWidth, nThumbHeight);
684  }
685  }
686  break;
688  {
689  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
690  }
691  break;
693  {
694  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
695  }
696  break;
699  {
700  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
701  }
702  break;
704  {
705  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
706  }
707  break;
709  break;
711  {
712  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
713  }
714  break;
716  case ControlType::Frame:
717  {
718  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
719  }
720  break;
724  {
725  bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
726  }
727  break;
728  default:
729  break;
730  }
731 
733 
734  return bOK;
735 }
736 
738  ControlType eType, ControlPart ePart, const tools::Rectangle& rBoundingControlRegion,
739  ControlState /*eState*/, const ImplControlValue& /*aValue*/, const OUString& /*aCaption*/,
740  tools::Rectangle& rNativeBoundingRegion, tools::Rectangle& rNativeContentRegion)
741 {
742  Point aLocation(rBoundingControlRegion.TopLeft());
743 
744  switch (eType)
745  {
747  {
748  auto const& pButtonUpPart
749  = m_pWidgetDefinition->getDefinition(eType, ControlPart::ButtonUp);
750  if (!pButtonUpPart)
751  return false;
752  Size aButtonSizeUp(pButtonUpPart->mnWidth, pButtonUpPart->mnHeight);
753 
754  auto const& pButtonDownPart
755  = m_pWidgetDefinition->getDefinition(eType, ControlPart::ButtonDown);
756  if (!pButtonDownPart)
757  return false;
758  Size aButtonSizeDown(pButtonDownPart->mnWidth, pButtonDownPart->mnHeight);
759 
760  auto const& pEntirePart
761  = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
762 
763  OString sOrientation = pEntirePart->msOrientation;
764 
765  if (sOrientation.isEmpty() || sOrientation == "stacked")
766  {
767  return false;
768  }
769  else if (sOrientation == "decrease-edit-increase")
770  {
771  if (ePart == ControlPart::ButtonUp)
772  {
773  Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
774  - aButtonSizeUp.Width(),
775  aLocation.Y());
776  rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeUp);
777  rNativeBoundingRegion = rNativeContentRegion;
778  return true;
779  }
780  else if (ePart == ControlPart::ButtonDown)
781  {
782  rNativeContentRegion = tools::Rectangle(aLocation, aButtonSizeDown);
783  rNativeBoundingRegion = rNativeContentRegion;
784  return true;
785  }
786  else if (ePart == ControlPart::SubEdit)
787  {
788  Point aPoint(aLocation.X() + aButtonSizeDown.Width(), aLocation.Y());
789  Size aSize(rBoundingControlRegion.GetWidth()
790  - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
791  std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
792  rNativeContentRegion = tools::Rectangle(aPoint, aSize);
793  rNativeBoundingRegion = rNativeContentRegion;
794  return true;
795  }
796  else if (ePart == ControlPart::Entire)
797  {
798  Size aSize(rBoundingControlRegion.GetWidth(),
799  std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
800  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
801  rNativeBoundingRegion = rNativeContentRegion;
802  return true;
803  }
804  }
805  else if (sOrientation == "edit-decrease-increase")
806  {
807  if (ePart == ControlPart::ButtonUp)
808  {
809  Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
810  - aButtonSizeUp.Width(),
811  aLocation.Y());
812  rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeUp);
813  rNativeBoundingRegion = rNativeContentRegion;
814  return true;
815  }
816  else if (ePart == ControlPart::ButtonDown)
817  {
818  Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
819  - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
820  aLocation.Y());
821  rNativeContentRegion = tools::Rectangle(aPoint, aButtonSizeDown);
822  rNativeBoundingRegion = rNativeContentRegion;
823  return true;
824  }
825  else if (ePart == ControlPart::SubEdit)
826  {
827  Size aSize(rBoundingControlRegion.GetWidth()
828  - (aButtonSizeDown.Width() + aButtonSizeUp.Width()),
829  std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
830  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
831  rNativeBoundingRegion = rNativeContentRegion;
832  return true;
833  }
834  else if (ePart == ControlPart::Entire)
835  {
836  Size aSize(rBoundingControlRegion.GetWidth(),
837  std::max(aButtonSizeUp.Height(), aButtonSizeDown.Height()));
838  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
839  rNativeBoundingRegion = rNativeContentRegion;
840  return true;
841  }
842  }
843  }
844  break;
846  {
847  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
848  if (!pPart)
849  return false;
850 
851  Size aSize(pPart->mnWidth, pPart->mnHeight);
852  rNativeContentRegion = tools::Rectangle(Point(), aSize);
853  return true;
854  }
856  {
857  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
858  if (!pPart)
859  return false;
860 
861  Size aSize(pPart->mnWidth, pPart->mnHeight);
862  rNativeContentRegion = tools::Rectangle(Point(), aSize);
863  return true;
864  }
866  {
867  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
868  if (!pPart)
869  return false;
870 
871  long nWidth = std::max(rBoundingControlRegion.GetWidth() + pPart->mnMarginWidth,
872  long(pPart->mnWidth));
873  long nHeight = std::max(rBoundingControlRegion.GetHeight() + pPart->mnMarginHeight,
874  long(pPart->mnHeight));
875 
876  rNativeBoundingRegion = tools::Rectangle(aLocation, Size(nWidth, nHeight));
877  rNativeContentRegion = rNativeBoundingRegion;
878  return true;
879  }
883  {
884  sal_Int32 nHeight = rBoundingControlRegion.GetHeight();
885 
886  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
887  if (pPart)
888  nHeight = std::max(nHeight, pPart->mnHeight);
889 
890  Size aSize(rBoundingControlRegion.GetWidth(), nHeight);
891  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
892  rNativeBoundingRegion = rNativeContentRegion;
893  rNativeBoundingRegion.expand(2);
894  return true;
895  }
896  break;
898  {
899  if (ePart == ControlPart::ButtonUp || ePart == ControlPart::ButtonDown
900  || ePart == ControlPart::ButtonLeft || ePart == ControlPart::ButtonRight)
901  {
902  rNativeContentRegion = tools::Rectangle(aLocation, Size(0, 0));
903  rNativeBoundingRegion = rNativeContentRegion;
904  return true;
905  }
906  else
907  {
908  rNativeBoundingRegion = rBoundingControlRegion;
909  rNativeContentRegion = rNativeBoundingRegion;
910  return true;
911  }
912  }
913  break;
916  {
917  auto const& pPart = m_pWidgetDefinition->getDefinition(eType, ControlPart::ButtonDown);
918  Size aComboButtonSize(pPart->mnWidth, pPart->mnHeight);
919 
920  if (ePart == ControlPart::ButtonDown)
921  {
922  Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
923  - aComboButtonSize.Width() - 1,
924  aLocation.Y());
925  rNativeContentRegion = tools::Rectangle(aPoint, aComboButtonSize);
926  rNativeBoundingRegion = rNativeContentRegion;
927  return true;
928  }
929  else if (ePart == ControlPart::SubEdit)
930  {
931  Size aSize(rBoundingControlRegion.GetWidth() - aComboButtonSize.Width(),
932  aComboButtonSize.Height());
933  rNativeContentRegion = tools::Rectangle(aLocation + Point(1, 1), aSize);
934  rNativeBoundingRegion = rNativeContentRegion;
935  return true;
936  }
937  else if (ePart == ControlPart::Entire)
938  {
939  Size aSize(rBoundingControlRegion.GetWidth(), aComboButtonSize.Height());
940  rNativeContentRegion = tools::Rectangle(aLocation, aSize);
941  rNativeBoundingRegion = rNativeContentRegion;
942  rNativeBoundingRegion.expand(2);
943  return true;
944  }
945  }
946  break;
947  case ControlType::Slider:
948  if (ePart == ControlPart::ThumbHorz || ePart == ControlPart::ThumbVert)
949  {
950  rNativeContentRegion = tools::Rectangle(aLocation, Size(28, 28));
951  rNativeBoundingRegion = rNativeContentRegion;
952  return true;
953  }
954  break;
955  default:
956  break;
957  }
958 
959  return false;
960 }
961 
963 {
964  StyleSettings aStyleSet = rSettings.GetStyleSettings();
965 
966  auto& pDefinitionStyle = m_pWidgetDefinition->mpStyle;
967 
968  aStyleSet.SetFaceColor(pDefinitionStyle->maFaceColor);
969  aStyleSet.SetCheckedColor(pDefinitionStyle->maCheckedColor);
970  aStyleSet.SetLightColor(pDefinitionStyle->maLightColor);
971  aStyleSet.SetLightBorderColor(pDefinitionStyle->maLightBorderColor);
972  aStyleSet.SetShadowColor(pDefinitionStyle->maShadowColor);
973  aStyleSet.SetDarkShadowColor(pDefinitionStyle->maDarkShadowColor);
974  aStyleSet.SetDefaultButtonTextColor(pDefinitionStyle->maDefaultButtonTextColor);
975  aStyleSet.SetButtonTextColor(pDefinitionStyle->maButtonTextColor);
976  aStyleSet.SetDefaultActionButtonTextColor(pDefinitionStyle->maDefaultActionButtonTextColor);
977  aStyleSet.SetActionButtonTextColor(pDefinitionStyle->maActionButtonTextColor);
978  aStyleSet.SetFlatButtonTextColor(pDefinitionStyle->maFlatButtonTextColor);
979  aStyleSet.SetDefaultButtonRolloverTextColor(pDefinitionStyle->maDefaultButtonRolloverTextColor);
980  aStyleSet.SetButtonRolloverTextColor(pDefinitionStyle->maButtonRolloverTextColor);
982  pDefinitionStyle->maDefaultActionButtonRolloverTextColor);
983  aStyleSet.SetActionButtonRolloverTextColor(pDefinitionStyle->maActionButtonRolloverTextColor);
984  aStyleSet.SetFlatButtonRolloverTextColor(pDefinitionStyle->maFlatButtonRolloverTextColor);
986  pDefinitionStyle->maDefaultButtonPressedRolloverTextColor);
987  aStyleSet.SetButtonPressedRolloverTextColor(pDefinitionStyle->maButtonPressedRolloverTextColor);
989  pDefinitionStyle->maDefaultActionButtonPressedRolloverTextColor);
991  pDefinitionStyle->maActionButtonPressedRolloverTextColor);
993  pDefinitionStyle->maFlatButtonPressedRolloverTextColor);
994  aStyleSet.SetRadioCheckTextColor(pDefinitionStyle->maRadioCheckTextColor);
995  aStyleSet.SetGroupTextColor(pDefinitionStyle->maGroupTextColor);
996  aStyleSet.SetLabelTextColor(pDefinitionStyle->maLabelTextColor);
997  aStyleSet.SetWindowColor(pDefinitionStyle->maWindowColor);
998  aStyleSet.SetWindowTextColor(pDefinitionStyle->maWindowTextColor);
999  aStyleSet.SetDialogColor(pDefinitionStyle->maDialogColor);
1000  aStyleSet.SetDialogTextColor(pDefinitionStyle->maDialogTextColor);
1001  aStyleSet.SetWorkspaceColor(pDefinitionStyle->maWorkspaceColor);
1002  aStyleSet.SetMonoColor(pDefinitionStyle->maMonoColor);
1003  aStyleSet.SetFieldColor(pDefinitionStyle->maFieldColor);
1004  aStyleSet.SetFieldTextColor(pDefinitionStyle->maFieldTextColor);
1005  aStyleSet.SetFieldRolloverTextColor(pDefinitionStyle->maFieldRolloverTextColor);
1006  aStyleSet.SetActiveColor(pDefinitionStyle->maActiveColor);
1007  aStyleSet.SetActiveTextColor(pDefinitionStyle->maActiveTextColor);
1008  aStyleSet.SetActiveBorderColor(pDefinitionStyle->maActiveBorderColor);
1009  aStyleSet.SetDeactiveColor(pDefinitionStyle->maDeactiveColor);
1010  aStyleSet.SetDeactiveTextColor(pDefinitionStyle->maDeactiveTextColor);
1011  aStyleSet.SetDeactiveBorderColor(pDefinitionStyle->maDeactiveBorderColor);
1012  aStyleSet.SetMenuColor(pDefinitionStyle->maMenuColor);
1013  aStyleSet.SetMenuBarColor(pDefinitionStyle->maMenuBarColor);
1014  aStyleSet.SetMenuBarRolloverColor(pDefinitionStyle->maMenuBarRolloverColor);
1015  aStyleSet.SetMenuBorderColor(pDefinitionStyle->maMenuBorderColor);
1016  aStyleSet.SetMenuTextColor(pDefinitionStyle->maMenuTextColor);
1017  aStyleSet.SetMenuBarTextColor(pDefinitionStyle->maMenuBarTextColor);
1018  aStyleSet.SetMenuBarRolloverTextColor(pDefinitionStyle->maMenuBarRolloverTextColor);
1019  aStyleSet.SetMenuBarHighlightTextColor(pDefinitionStyle->maMenuBarHighlightTextColor);
1020  aStyleSet.SetMenuHighlightColor(pDefinitionStyle->maMenuHighlightColor);
1021  aStyleSet.SetMenuHighlightTextColor(pDefinitionStyle->maMenuHighlightTextColor);
1022  aStyleSet.SetHighlightColor(pDefinitionStyle->maHighlightColor);
1023  aStyleSet.SetHighlightTextColor(pDefinitionStyle->maHighlightTextColor);
1024  aStyleSet.SetActiveTabColor(pDefinitionStyle->maActiveTabColor);
1025  aStyleSet.SetInactiveTabColor(pDefinitionStyle->maInactiveTabColor);
1026  aStyleSet.SetTabTextColor(pDefinitionStyle->maTabTextColor);
1027  aStyleSet.SetTabRolloverTextColor(pDefinitionStyle->maTabRolloverTextColor);
1028  aStyleSet.SetTabHighlightTextColor(pDefinitionStyle->maTabHighlightTextColor);
1029  aStyleSet.SetDisableColor(pDefinitionStyle->maDisableColor);
1030  aStyleSet.SetHelpColor(pDefinitionStyle->maHelpColor);
1031  aStyleSet.SetHelpTextColor(pDefinitionStyle->maHelpTextColor);
1032  aStyleSet.SetLinkColor(pDefinitionStyle->maLinkColor);
1033  aStyleSet.SetVisitedLinkColor(pDefinitionStyle->maVisitedLinkColor);
1034  aStyleSet.SetToolTextColor(pDefinitionStyle->maToolTextColor);
1035  aStyleSet.SetFontColor(pDefinitionStyle->maFontColor);
1036 
1037  auto& pSettings = m_pWidgetDefinition->mpSettings;
1038 
1039  int nFontSize = getSettingValueInteger(pSettings->msDefaultFontSize, 10);
1040  vcl::Font aFont(FAMILY_SWISS, Size(0, nFontSize));
1041  aFont.SetCharSet(osl_getThreadTextEncoding());
1042  aFont.SetWeight(WEIGHT_NORMAL);
1043  aFont.SetFamilyName("Liberation Sans");
1044  aStyleSet.SetAppFont(aFont);
1045  aStyleSet.SetHelpFont(aFont);
1046  aStyleSet.SetMenuFont(aFont);
1047  aStyleSet.SetToolFont(aFont);
1048  aStyleSet.SetGroupFont(aFont);
1049  aStyleSet.SetLabelFont(aFont);
1050  aStyleSet.SetRadioCheckFont(aFont);
1051  aStyleSet.SetPushButtonFont(aFont);
1052  aStyleSet.SetFieldFont(aFont);
1053  aStyleSet.SetIconFont(aFont);
1054  aStyleSet.SetTabFont(aFont);
1055 
1056  aFont.SetWeight(WEIGHT_BOLD);
1057  aStyleSet.SetFloatTitleFont(aFont);
1058  aStyleSet.SetTitleFont(aFont);
1059 
1060  int nTitleHeight = getSettingValueInteger(pSettings->msTitleHeight, aStyleSet.GetTitleHeight());
1061  aStyleSet.SetTitleHeight(nTitleHeight);
1062 
1063  int nFloatTitleHeight
1064  = getSettingValueInteger(pSettings->msFloatTitleHeight, aStyleSet.GetFloatTitleHeight());
1065  aStyleSet.SetFloatTitleHeight(nFloatTitleHeight);
1066 
1067  int nLogicWidth = getSettingValueInteger(pSettings->msListBoxPreviewDefaultLogicWidth,
1068  15); // See vcl/source/app/settings.cxx
1069  int nLogicHeight = getSettingValueInteger(pSettings->msListBoxPreviewDefaultLogicHeight, 7);
1070  aStyleSet.SetListBoxPreviewDefaultLogicSize(Size(nLogicWidth, nLogicHeight));
1071 
1072  rSettings.SetStyleSettings(aStyleSet);
1073 
1074  return true;
1075 }
1076 
1077 } // end vcl namespace
1078 
1079 /* 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:67
void SetHighlightColor(const Color &rColor)
long GetWidth() const
void SetHelpFont(const vcl::Font &rFont)
basegfx::B2DRange maRectangle
bool mbCanDrawWidgetAnySize
Definition: svdata.hxx:328
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:323
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:310
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:398
void SetWindowColor(const Color &rColor)
void SetWeight(FontWeight)
Definition: font/font.cxx:215
bool mbNoFocusRectsForFlatButtons
Definition: svdata.hxx:321
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:393
int mnListBoxEntryMargin
Definition: svdata.hxx:339
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:222
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:230
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: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
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:231
bool getAntiAliasB2DDraw() const
Definition: salgdi.hxx:81
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:232
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: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)
void setAntiAliasB2DDraw(bool bNew)
Definition: salgdi.hxx:80
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:483
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:322