LibreOffice Module vcl (master)  1
decoview.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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <vcl/settings.hxx>
21 #include <vcl/outdev.hxx>
22 #include <vcl/decoview.hxx>
23 #include <vcl/window.hxx>
24 #include <vcl/ctrl.hxx>
25 
30 
31 using namespace std;
32 
33 namespace {
34 
35 long AdjustRectToSquare( tools::Rectangle &rRect )
36 {
37  const long nWidth = rRect.GetWidth();
38  const long nHeight = rRect.GetHeight();
39  long nSide = std::min( nWidth, nHeight );
40 
41  if ( nSide && !(nSide & 1) )
42  {
43  // we prefer an odd size
44  --nSide;
45  }
46 
47  // Make the rectangle a square
48  rRect.SetSize( Size( nSide, nSide ) );
49 
50  // and place it at the center of the original rectangle
51  rRect.Move( (nWidth-nSide)/2, (nHeight-nSide)/2 );
52 
53  return nSide;
54 }
55 
56 void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolType eType )
57 {
58  const long nSide = AdjustRectToSquare( nRect );
59 
60  if ( !nSide ) return;
61  if ( nSide==1 )
62  {
63  pDev->DrawPixel( Point( nRect.Left(), nRect.Top() ) );
64  return;
65  }
66 
67  // Precalculate some values
68  const long n2 = nSide/2;
69  const long n4 = (n2+1)/2;
70  const long n8 = (n4+1)/2;
71  const long n16 = (n8+1)/2;
72  const Point aCenter = nRect.Center();
73 
74  switch ( eType )
75  {
77  pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) );
78  for ( long i=1; i <= n2; ++i )
79  {
80  nRect.AdjustTop( 1 );
81  pDev->DrawLine( Point( aCenter.X()-i, nRect.Top() ),
82  Point( aCenter.X()+i, nRect.Top() ) );
83  pDev->DrawPixel( Point( aCenter.X()-i, nRect.Top() ) );
84  pDev->DrawPixel( Point( aCenter.X()+i, nRect.Top() ) );
85  }
86  pDev->DrawRect( tools::Rectangle( aCenter.X()-n8, nRect.Top()+1,
87  aCenter.X()+n8, nRect.Bottom() ) );
88  break;
89 
91  pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) );
92  for ( long i=1; i <= n2; ++i )
93  {
94  nRect.AdjustBottom( -1 );
95  pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom() ),
96  Point( aCenter.X()+i, nRect.Bottom() ) );
97  pDev->DrawPixel( Point( aCenter.X()-i, nRect.Bottom() ) );
98  pDev->DrawPixel( Point( aCenter.X()+i, nRect.Bottom() ) );
99  }
100  pDev->DrawRect( tools::Rectangle( aCenter.X()-n8, nRect.Top(),
101  aCenter.X()+n8, nRect.Bottom()-1 ) );
102  break;
103 
105  pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) );
106  for ( long i=1; i <= n2; ++i )
107  {
108  nRect.AdjustLeft( 1 );
109  pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-i ),
110  Point( nRect.Left(), aCenter.Y()+i ) );
111  pDev->DrawPixel( Point( nRect.Left(), aCenter.Y()-i ) );
112  pDev->DrawPixel( Point( nRect.Left(), aCenter.Y()+i ) );
113  }
114  pDev->DrawRect( tools::Rectangle( nRect.Left()+1, aCenter.Y()-n8,
115  nRect.Right(), aCenter.Y()+n8 ) );
116  break;
117 
119  pDev->DrawPixel( Point( nRect.Right(), aCenter.Y() ) );
120  for ( long i=1; i <= n2; ++i )
121  {
122  nRect.AdjustRight( -1 );
123  pDev->DrawLine( Point( nRect.Right(), aCenter.Y()-i ),
124  Point( nRect.Right(), aCenter.Y()+i ) );
125  pDev->DrawPixel( Point( nRect.Right(), aCenter.Y()-i ) );
126  pDev->DrawPixel( Point( nRect.Right(), aCenter.Y()+i ) );
127  }
128  pDev->DrawRect( tools::Rectangle( nRect.Left(), aCenter.Y()-n8,
129  nRect.Right()-1, aCenter.Y()+n8 ) );
130  break;
131 
132  case SymbolType::SPIN_UP:
133  nRect.AdjustTop(n4 );
134  pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) );
135  for ( long i=1; i <= n2; ++i )
136  {
137  nRect.AdjustTop( 1 );
138  pDev->DrawLine( Point( aCenter.X()-i, nRect.Top() ),
139  Point( aCenter.X()+i, nRect.Top() ) );
140  pDev->DrawPixel( Point( aCenter.X()-i, nRect.Top() ) );
141  pDev->DrawPixel( Point( aCenter.X()+i, nRect.Top() ) );
142  }
143  break;
144 
146  nRect.AdjustBottom( -n4 );
147  pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) );
148  for ( long i=1; i <= n2; ++i )
149  {
150  nRect.AdjustBottom( -1 );
151  pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom() ),
152  Point( aCenter.X()+i, nRect.Bottom() ) );
153  pDev->DrawPixel( Point( aCenter.X()-i, nRect.Bottom() ) );
154  pDev->DrawPixel( Point( aCenter.X()+i, nRect.Bottom() ) );
155  }
156  break;
157 
159  case SymbolType::FIRST:
160  case SymbolType::PREV:
161  {
162  nRect.AdjustLeft(n4 );
163  if ( eType==SymbolType::FIRST )
164  {
165  pDev->DrawLine( Point( nRect.Left(), nRect.Top() ),
166  Point( nRect.Left(), nRect.Bottom() ) );
167  nRect.AdjustLeft( 1 );
168  }
169 
170  tools::Polygon aTriangle(3);
171  aTriangle.SetPoint(Point(nRect.Left() + n2, aCenter.Y() - n2), 0);
172  aTriangle.SetPoint(Point(nRect.Left(), aCenter.Y()), 1);
173  aTriangle.SetPoint(Point(nRect.Left() + n2, aCenter.Y() + n2), 2);
174 
175  pDev->Push(PushFlags::LINECOLOR);
176  pDev->SetLineColor();
177  pDev->DrawPolygon(aTriangle);
178  pDev->Pop();
179 
180  break;
181  }
182 
184  case SymbolType::LAST:
185  case SymbolType::NEXT:
186  case SymbolType::PLAY:
187  {
188  nRect.AdjustRight( -n4 );
189  if ( eType==SymbolType::LAST )
190  {
191  pDev->DrawLine( Point( nRect.Right(), nRect.Top() ),
192  Point( nRect.Right(), nRect.Bottom() ) );
193  nRect.AdjustRight( -1 );
194  }
195 
196  tools::Polygon aTriangle(3);
197  aTriangle.SetPoint(Point(nRect.Right() - n2, aCenter.Y() - n2), 0);
198  aTriangle.SetPoint(Point(nRect.Right(), aCenter.Y()), 1);
199  aTriangle.SetPoint(Point(nRect.Right() - n2, aCenter.Y() + n2), 2);
200 
201  pDev->Push(PushFlags::LINECOLOR);
202  pDev->SetLineColor();
203  pDev->DrawPolygon(aTriangle);
204  pDev->Pop();
205  break;
206  }
207 
208  case SymbolType::PAGEUP:
209  pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) );
210  pDev->DrawPixel( Point( aCenter.X(), nRect.Top()+n2 ) );
211  for ( long i=1; i < n2; ++i )
212  {
213  nRect.AdjustTop( 1 );
214  pDev->DrawLine( Point( aCenter.X()-i, nRect.Top() ),
215  Point( aCenter.X()+i, nRect.Top() ) );
216  pDev->DrawPixel( Point( aCenter.X()-i, nRect.Top() ) );
217  pDev->DrawPixel( Point( aCenter.X()+i, nRect.Top() ) );
218  pDev->DrawLine( Point( aCenter.X()-i, nRect.Top()+n2 ),
219  Point( aCenter.X()+i, nRect.Top()+n2 ) );
220  pDev->DrawPixel( Point( aCenter.X()-i, nRect.Top()+n2 ) );
221  pDev->DrawPixel( Point( aCenter.X()+i, nRect.Top()+n2 ) );
222  }
223  break;
224 
226  pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) );
227  pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom()-n2 ) );
228  for ( long i=1; i < n2; ++i )
229  {
230  nRect.AdjustBottom( -1 );
231  pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom() ),
232  Point( aCenter.X()+i, nRect.Bottom() ) );
233  pDev->DrawPixel( Point( aCenter.X()-i, nRect.Bottom() ) );
234  pDev->DrawPixel( Point( aCenter.X()+i, nRect.Bottom() ) );
235  pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom()-n2 ),
236  Point( aCenter.X()+i, nRect.Bottom()-n2 ) );
237  pDev->DrawPixel( Point( aCenter.X()-i, nRect.Bottom()-n2 ) );
238  pDev->DrawPixel( Point( aCenter.X()+i, nRect.Bottom()-n2 ) );
239  }
240  break;
241 
243  {
244  // Midpoint circle algorithm
245  long x = 0;
246  long y = n2;
247  long p = 1 - n2;
248  // Draw central line
249  pDev->DrawLine( Point( aCenter.X(), aCenter.Y()-y ),
250  Point( aCenter.X(), aCenter.Y()+y ) );
251  while ( x<y )
252  {
253  if ( p>=0 )
254  {
255  // Draw vertical lines close to sides
256  pDev->DrawLine( Point( aCenter.X()+y, aCenter.Y()-x ),
257  Point( aCenter.X()+y, aCenter.Y()+x ) );
258  pDev->DrawLine( Point( aCenter.X()-y, aCenter.Y()-x ),
259  Point( aCenter.X()-y, aCenter.Y()+x ) );
260  --y;
261  p -= 2*y;
262  }
263  ++x;
264  p += 2*x+1;
265  // Draw vertical lines close to center
266  pDev->DrawLine( Point( aCenter.X()-x, aCenter.Y()-y ),
267  Point( aCenter.X()-x, aCenter.Y()+y ) );
268  pDev->DrawLine( Point( aCenter.X()+x, aCenter.Y()-y ),
269  Point( aCenter.X()+x, aCenter.Y()+y ) );
270  }
271  }
272  break;
273 
274  case SymbolType::STOP:
275  pDev->DrawRect( nRect );
276  break;
277 
278  case SymbolType::CLOSE:
279  pDev->DrawLine( Point( nRect.Left(), nRect.Top() ),
280  Point( nRect.Right(), nRect.Bottom() ) );
281  pDev->DrawLine( Point( nRect.Left(), nRect.Bottom() ),
282  Point( nRect.Right(), nRect.Top() ) );
283  for ( long i=1; i<n8; ++i )
284  {
285  pDev->DrawLine( Point( nRect.Left()+i, nRect.Top() ),
286  Point( nRect.Right(), nRect.Bottom()-i ) );
287  pDev->DrawLine( Point( nRect.Left(), nRect.Top()+i ),
288  Point( nRect.Right()-i, nRect.Bottom() ) );
289  pDev->DrawLine( Point( nRect.Left()+i, nRect.Bottom() ),
290  Point( nRect.Right(), nRect.Top()+i ) );
291  pDev->DrawLine( Point( nRect.Left(), nRect.Bottom()-i ),
292  Point( nRect.Right()-i, nRect.Top() ) );
293  }
294  break;
295 
297  pDev->DrawLine( Point( nRect.Left(), nRect.Top() ),
298  Point( nRect.Left(), nRect.Bottom() ) );
299  pDev->DrawLine( Point( nRect.Right(), nRect.Top() ),
300  Point( nRect.Right(), nRect.Bottom() ) );
301  pDev->DrawLine( Point( nRect.Left(), nRect.Bottom() ),
302  Point( nRect.Right(), nRect.Bottom() ) );
303  [[fallthrough]];
304  case SymbolType::ROLLUP:
305  pDev->DrawRect( tools::Rectangle( nRect.Left(), nRect.Top(),
306  nRect.Right(), nRect.Top()+n8 ) );
307  break;
308 
310  {
311  long n3 = nSide/3;
312  nRect.AdjustTop( -(n3/2) );
313  nRect.AdjustBottom( -(n3/2) );
314  // #106953# never mirror checkmarks
315  if ( pDev->HasMirroredGraphics() && pDev->IsRTLEnabled() )
316  {
317  // Draw a mirrored checkmark so that it looks "normal" in a
318  // mirrored graphics device (double mirroring!)
319  pDev->DrawLine( Point( nRect.Right(), nRect.Bottom()-n3 ),
320  Point( nRect.Right()-n3, nRect.Bottom() ) );
321  pDev->DrawLine( Point( nRect.Right()-n3, nRect.Bottom() ),
322  Point( nRect.Left(), nRect.Top()+n3 ) );
323  nRect.AdjustTop( 1 );
324  nRect.AdjustBottom( 1 );
325  pDev->DrawLine( Point( nRect.Right(), nRect.Bottom()-n3 ),
326  Point( nRect.Right()-n3, nRect.Bottom() ) );
327  pDev->DrawLine( Point( nRect.Right()-n3, nRect.Bottom() ),
328  Point( nRect.Left(), nRect.Top()+n3 ) );
329  }
330  else
331  {
332  pDev->DrawLine( Point( nRect.Left(), nRect.Bottom()-n3 ),
333  Point( nRect.Left()+n3, nRect.Bottom() ) );
334  pDev->DrawLine( Point( nRect.Left()+n3, nRect.Bottom() ),
335  Point( nRect.Right(), nRect.Top()+n3 ) );
336  nRect.AdjustTop( 1 );
337  nRect.AdjustBottom( 1 );
338  pDev->DrawLine( Point( nRect.Left(), nRect.Bottom()-n3 ),
339  Point( nRect.Left()+n3, nRect.Bottom() ) );
340  pDev->DrawLine( Point( nRect.Left()+n3, nRect.Bottom() ),
341  Point( nRect.Right(), nRect.Top()+n3 ) );
342  }
343  }
344  break;
345 
346  case SymbolType::FLOAT:
347  nRect.AdjustRight( -n4 );
348  nRect.AdjustTop(n4+1 );
349  pDev->DrawRect( tools::Rectangle( nRect.Left(), nRect.Top(),
350  nRect.Right(), nRect.Top()+n8 ) );
351  pDev->DrawLine( Point( nRect.Left(), nRect.Top()+n8 ),
352  Point( nRect.Left(), nRect.Bottom() ) );
353  pDev->DrawLine( Point( nRect.Left(), nRect.Bottom() ),
354  Point( nRect.Right(), nRect.Bottom() ) );
355  pDev->DrawLine( Point( nRect.Right(), nRect.Top()+n8 ),
356  Point( nRect.Right(), nRect.Bottom() ) );
357  nRect.AdjustRight(n4 );
358  nRect.AdjustTop( -(n4+1) );
359  nRect.AdjustLeft(n4 );
360  nRect.AdjustBottom( -(n4+1) );
361  pDev->DrawRect( tools::Rectangle( nRect.Left(), nRect.Top(),
362  nRect.Right(), nRect.Top()+n8 ) );
363  pDev->DrawLine( Point( nRect.Left(), nRect.Top()+n8 ),
364  Point( nRect.Left(), nRect.Bottom() ) );
365  pDev->DrawLine( Point( nRect.Left(), nRect.Bottom() ),
366  Point( nRect.Right(), nRect.Bottom() ) );
367  pDev->DrawLine( Point( nRect.Right(), nRect.Top()+n8 ),
368  Point( nRect.Right(), nRect.Bottom() ) );
369  break;
370 
371  case SymbolType::DOCK:
372  pDev->DrawLine( Point( nRect.Left(), nRect.Top() ),
373  Point( nRect.Right(), nRect.Top() ) );
374  pDev->DrawLine( Point( nRect.Left(), nRect.Top() ),
375  Point( nRect.Left(), nRect.Bottom() ) );
376  pDev->DrawLine( Point( nRect.Left(), nRect.Bottom() ),
377  Point( nRect.Right(), nRect.Bottom() ) );
378  pDev->DrawLine( Point( nRect.Right(), nRect.Top() ),
379  Point( nRect.Right(), nRect.Bottom() ) );
380  break;
381 
382  case SymbolType::HIDE:
383  pDev->DrawRect( tools::Rectangle( nRect.Left()+n8, nRect.Bottom()-n8,
384  nRect.Right()-n8, nRect.Bottom() ) );
385  break;
386 
387  case SymbolType::PLUS:
388  pDev->DrawRect( tools::Rectangle( nRect.Left(), aCenter.Y()-n16,
389  nRect.Right(), aCenter.Y()+n16 ) );
390  pDev->DrawRect( tools::Rectangle( aCenter.X()-n16, nRect.Top(),
391  aCenter.X()+n16, nRect.Bottom() ) );
392  break;
394  case SymbolType::IMAGE:
395  case SymbolType::HELP: break;
396  }
397 }
398 
399 void ImplDrawDPILineRect( OutputDevice *const pDev, tools::Rectangle& rRect,
400  const Color *const pColor, const bool bRound = false )
401 {
402  long nLineWidth = pDev->GetDPIX()/300;
403  long nLineHeight = pDev->GetDPIY()/300;
404  if ( !nLineWidth )
405  nLineWidth = 1;
406  if ( !nLineHeight )
407  nLineHeight = 1;
408 
409  if ( pColor )
410  {
411  if ( (nLineWidth == 1) && (nLineHeight == 1) )
412  {
413  pDev->SetLineColor( *pColor );
414  if( bRound )
415  {
416  pDev->DrawLine( Point( rRect.Left()+1, rRect.Top()), Point( rRect.Right()-1, rRect.Top()) );
417  pDev->DrawLine( Point( rRect.Left()+1, rRect.Bottom()), Point( rRect.Right()-1, rRect.Bottom()) );
418  pDev->DrawLine( Point( rRect.Left(), rRect.Top()+1), Point( rRect.Left(), rRect.Bottom()-1) );
419  pDev->DrawLine( Point( rRect.Right(), rRect.Top()+1), Point( rRect.Right(), rRect.Bottom()-1) );
420  }
421  else
422  {
423  pDev->SetFillColor();
424  pDev->DrawRect( rRect );
425  }
426  }
427  else
428  {
429  const long nWidth = rRect.GetWidth();
430  const long nHeight = rRect.GetHeight();
431  pDev->SetLineColor();
432  pDev->SetFillColor( *pColor );
433  pDev->DrawRect( tools::Rectangle( rRect.TopLeft(), Size( nWidth, nLineHeight ) ) );
434  pDev->DrawRect( tools::Rectangle( rRect.TopLeft(), Size( nLineWidth, nHeight ) ) );
435  pDev->DrawRect( tools::Rectangle( Point( rRect.Left(), rRect.Bottom()-nLineHeight ),
436  Size( nWidth, nLineHeight ) ) );
437  pDev->DrawRect( tools::Rectangle( Point( rRect.Right()-nLineWidth, rRect.Top() ),
438  Size( nLineWidth, nHeight ) ) );
439  }
440  }
441 
442  rRect.AdjustLeft(nLineWidth );
443  rRect.AdjustTop(nLineHeight );
444  rRect.AdjustRight( -nLineWidth );
445  rRect.AdjustBottom( -nLineHeight );
446 }
447 
448 void ImplDraw2ColorFrame( OutputDevice *const pDev, tools::Rectangle& rRect,
449  const Color& rLeftTopColor, const Color& rRightBottomColor )
450 {
451  pDev->SetLineColor( rLeftTopColor );
452  pDev->DrawLine( rRect.TopLeft(), rRect.BottomLeft() );
453  pDev->DrawLine( rRect.TopLeft(), rRect.TopRight() );
454  pDev->SetLineColor( rRightBottomColor );
455  pDev->DrawLine( rRect.BottomLeft(), rRect.BottomRight() );
456  pDev->DrawLine( rRect.TopRight(), rRect.BottomRight() );
457 
458  // reduce drawing area
459  rRect.AdjustLeft( 1 );
460  rRect.AdjustTop( 1 );
461  rRect.AdjustRight( -1 );
462  rRect.AdjustBottom( -1 );
463 }
464 
465 void ImplDrawButton( OutputDevice *const pDev, tools::Rectangle aFillRect,
466  const DrawButtonFlags nStyle )
467 {
468  const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
469 
470  if ( (nStyle & DrawButtonFlags::Mono) ||
471  (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) )
472  {
473  const Color aBlackColor(COL_BLACK);
474 
475  if ( nStyle & DrawButtonFlags::Default )
476  {
477  // default selection shows a wider border
478  ImplDrawDPILineRect( pDev, aFillRect, &aBlackColor );
479  }
480 
481  ImplDrawDPILineRect( pDev, aFillRect, &aBlackColor );
482 
483  Size aBrdSize( 1, 1 );
484  if ( pDev->GetOutDevType() == OUTDEV_PRINTER )
485  {
486  aBrdSize = pDev->LogicToPixel( Size( 20, 20 ), MapMode(MapUnit::Map100thMM) );
487  if ( !aBrdSize.Width() )
488  aBrdSize.setWidth( 1 );
489  if ( !aBrdSize.Height() )
490  aBrdSize.setHeight( 1 );
491  }
492 
493  pDev->SetLineColor();
494  pDev->SetFillColor( aBlackColor );
495  const tools::Rectangle aOrigFillRect(aFillRect);
497  {
498  // shrink fill rect
499  aFillRect.AdjustLeft(aBrdSize.Width() );
500  aFillRect.AdjustTop(aBrdSize.Height() );
501  // draw top and left borders (aOrigFillRect-aFillRect)
502  pDev->DrawRect( tools::Rectangle( aOrigFillRect.Left(), aOrigFillRect.Top(),
503  aOrigFillRect.Right(), aFillRect.Top()-1 ) );
504  pDev->DrawRect( tools::Rectangle( aOrigFillRect.Left(), aOrigFillRect.Top(),
505  aFillRect.Left()-1, aOrigFillRect.Bottom() ) );
506  }
507  else
508  {
509  // shrink fill rect
510  aFillRect.AdjustRight( -(aBrdSize.Width()) );
511  aFillRect.AdjustBottom( -(aBrdSize.Height()) );
512  // draw bottom and right borders (aOrigFillRect-aFillRect)
513  pDev->DrawRect( tools::Rectangle( aOrigFillRect.Left(), aFillRect.Bottom()+1,
514  aOrigFillRect.Right(), aOrigFillRect.Bottom() ) );
515  pDev->DrawRect( tools::Rectangle( aFillRect.Right()+1, aOrigFillRect.Top(),
516  aOrigFillRect.Right(), aOrigFillRect.Bottom() ) );
517  }
518 
519  // Hack: in monochrome mode on printers we like to have grey buttons
520  if ( pDev->GetOutDevType() == OUTDEV_PRINTER )
521  pDev->SetFillColor( COL_LIGHTGRAY );
522  else
523  pDev->SetFillColor( COL_WHITE );
524  pDev->DrawRect( aFillRect );
525  }
526  else
527  {
528  if ( nStyle & DrawButtonFlags::Default )
529  {
530  const Color aDefBtnColor = rStyleSettings.GetDarkShadowColor();
531  ImplDrawDPILineRect( pDev, aFillRect, &aDefBtnColor );
532  }
533 
534  if ( nStyle & DrawButtonFlags::NoLeftLightBorder )
535  {
536  pDev->SetLineColor( rStyleSettings.GetLightBorderColor() );
537  pDev->DrawLine( Point( aFillRect.Left(), aFillRect.Top() ),
538  Point( aFillRect.Left(), aFillRect.Bottom() ) );
539  aFillRect.AdjustLeft( 1 );
540  }
541 
542  Color aColor1;
543  Color aColor2;
545  {
546  aColor1 = rStyleSettings.GetDarkShadowColor();
547  aColor2 = rStyleSettings.GetLightColor();
548  }
549  else
550  {
551  if ( nStyle & DrawButtonFlags::NoLightBorder )
552  aColor1 = rStyleSettings.GetLightBorderColor();
553  else
554  aColor1 = rStyleSettings.GetLightColor();
555  if ( (nStyle & BUTTON_DRAW_FLATTEST) == DrawButtonFlags::Flat )
556  aColor2 = rStyleSettings.GetShadowColor();
557  else
558  aColor2 = rStyleSettings.GetDarkShadowColor();
559  }
560 
561  ImplDraw2ColorFrame( pDev, aFillRect, aColor1, aColor2 );
562 
563  if ( (nStyle & BUTTON_DRAW_FLATTEST) != DrawButtonFlags::Flat )
564  {
566  {
567  aColor1 = rStyleSettings.GetShadowColor();
568  aColor2 = rStyleSettings.GetLightBorderColor();
569  }
570  else
571  {
572  if ( nStyle & DrawButtonFlags::NoLightBorder )
573  aColor1 = rStyleSettings.GetLightColor();
574  else
575  aColor1 = rStyleSettings.GetLightBorderColor();
576  aColor2 = rStyleSettings.GetShadowColor();
577  }
578  ImplDraw2ColorFrame( pDev, aFillRect, aColor1, aColor2 );
579  }
580 
581  pDev->SetLineColor();
583  pDev->SetFillColor( rStyleSettings.GetCheckedColor() );
584  else
585  pDev->SetFillColor( rStyleSettings.GetFaceColor() );
586  pDev->DrawRect( aFillRect );
587  }
588 }
589 
590 void ImplDrawFrame( OutputDevice *const pDev, tools::Rectangle& rRect,
591  const StyleSettings& rStyleSettings, DrawFrameStyle nStyle, DrawFrameFlags nFlags )
592 {
593  vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(pDev) : nullptr;
594 
595  const bool bMenuStyle(nFlags & DrawFrameFlags::Menu);
596 
597  // UseFlatBorders disables 3D style for all frames except menus
598  // menus may use different border colors (eg on XP)
599  // normal frames will be drawn using the shadow color
600  // whereas window frame borders will use black
601  bool bFlatBorders = !bMenuStyle && rStyleSettings.GetUseFlatBorders();
602 
603  // no flat borders for standard VCL controls (ie formcontrols that keep their classic look)
604  // will not affect frame windows (like dropdowns)
605  if( bFlatBorders && pWin && pWin->GetType() == WindowType::BORDERWINDOW && (pWin != pWin->ImplGetFrameWindow()) )
606  {
607  // check for formcontrol, i.e., a control without NWF enabled
608  Control *const pControl = dynamic_cast< Control* >( pWin->GetWindow( GetWindowType::Client ) );
609  if( !pControl || !pControl->IsNativeWidgetEnabled() )
610  bFlatBorders = false;
611  }
612 
613  const bool bNoDraw(nFlags & DrawFrameFlags::NoDraw);
614 
615  if ( (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) ||
616  (pDev->GetOutDevType() == OUTDEV_PRINTER) ||
617  bFlatBorders )
618  nFlags |= DrawFrameFlags::Mono;
619 
620  if( nStyle != DrawFrameStyle::NWF &&
622  {
623  long nControlFlags = static_cast<long>(nStyle);
624  nControlFlags |= static_cast<long>(nFlags);
625  nControlFlags |= static_cast<long>(pWin->GetType() == WindowType::BORDERWINDOW ?
627  ImplControlValue aControlValue( nControlFlags );
628 
629  tools::Rectangle aBound, aContent;
630  tools::Rectangle aNatRgn( rRect );
632  aNatRgn, ControlState::NONE, aControlValue, aBound, aContent) )
633  {
634  // if bNoDraw is true then don't call the drawing routine
635  // but just update the target rectangle
636  if( bNoDraw ||
638  aControlValue, OUString()) )
639  {
640  rRect = aContent;
641  return;
642  }
643  }
644  }
645 
646  if ( nFlags & DrawFrameFlags::Mono )
647  {
648  // no round corners for window frame borders
649  const bool bRound = bFlatBorders && !(nFlags & DrawFrameFlags::WindowBorder);
650 
651  if ( bNoDraw )
652  {
653  ImplDrawDPILineRect( pDev, rRect, nullptr, bRound );
654  }
655  else
656  {
657  Color aColor = bRound ? rStyleSettings.GetShadowColor()
659  // when the MonoColor wasn't set, check face color
660  if (
661  (bRound && aColor.IsDark()) ||
662  (
663  (aColor == COL_BLACK) &&
665  )
666  )
667  {
668  aColor = COL_WHITE;
669  }
670  ImplDrawDPILineRect( pDev, rRect, &aColor, bRound );
671  }
672  }
673  else
674  {
675  if ( bNoDraw )
676  {
677  switch ( nStyle )
678  {
679  case DrawFrameStyle::In:
680  case DrawFrameStyle::Out:
681  rRect.AdjustLeft( 1 );
682  rRect.AdjustTop( 1 );
683  rRect.AdjustRight( -1 );
684  rRect.AdjustBottom( -1 );
685  break;
686 
690  rRect.AdjustLeft(2 );
691  rRect.AdjustTop(2 );
692  rRect.AdjustRight( -2 );
693  rRect.AdjustBottom( -2 );
694  break;
695 
696  case DrawFrameStyle::NWF:
697  // enough space for the native rendering
698  rRect.AdjustLeft(4 );
699  rRect.AdjustTop(4 );
700  rRect.AdjustRight( -4 );
701  rRect.AdjustBottom( -4 );
702  break;
703  default: break;
704  }
705  }
706  else
707  {
708  switch ( nStyle )
709  {
711  pDev->SetFillColor();
712  pDev->SetLineColor( rStyleSettings.GetLightColor() );
713  pDev->DrawRect( tools::Rectangle( rRect.Left()+1, rRect.Top()+1,
714  rRect.Right(), rRect.Bottom() ) );
715  pDev->SetLineColor( rStyleSettings.GetShadowColor() );
716  pDev->DrawRect( tools::Rectangle( rRect.Left(), rRect.Top(),
717  rRect.Right()-1, rRect.Bottom()-1 ) );
718 
719  // adjust target rectangle
720  rRect.AdjustLeft(2 );
721  rRect.AdjustTop(2 );
722  rRect.AdjustRight( -2 );
723  rRect.AdjustBottom( -2 );
724  break;
725 
726  case DrawFrameStyle::In:
727  ImplDraw2ColorFrame( pDev, rRect,
728  rStyleSettings.GetShadowColor(),
729  rStyleSettings.GetLightColor() );
730  break;
731 
732  case DrawFrameStyle::Out:
733  ImplDraw2ColorFrame( pDev, rRect,
734  rStyleSettings.GetLightColor(),
735  rStyleSettings.GetShadowColor() );
736  break;
737 
739  if( bFlatBorders )
740  {
741  // no 3d effect
742  ImplDraw2ColorFrame( pDev, rRect,
743  rStyleSettings.GetShadowColor(),
744  rStyleSettings.GetShadowColor() );
745  ImplDraw2ColorFrame( pDev, rRect,
746  rStyleSettings.GetFaceColor(),
747  rStyleSettings.GetFaceColor() );
748  }
749  else
750  {
751  ImplDraw2ColorFrame( pDev, rRect,
752  rStyleSettings.GetShadowColor(),
753  rStyleSettings.GetLightColor() );
754  ImplDraw2ColorFrame( pDev, rRect,
755  rStyleSettings.GetDarkShadowColor(),
756  rStyleSettings.GetLightBorderColor() );
757  }
758  break;
759 
761  if( bMenuStyle )
762  {
763  ImplDraw2ColorFrame( pDev, rRect,
764  rStyleSettings.GetMenuBorderColor(),
765  rStyleSettings.GetDarkShadowColor() );
766  if ( !rStyleSettings.GetUseFlatMenus() )
767  {
768  ImplDraw2ColorFrame( pDev, rRect,
769  rStyleSettings.GetLightColor(),
770  rStyleSettings.GetShadowColor() );
771  }
772  }
773  else
774  {
775  ImplDraw2ColorFrame( pDev, rRect,
776  bFlatBorders ? // no 3d effect
777  rStyleSettings.GetDarkShadowColor() :
778  rStyleSettings.GetLightBorderColor(),
779  rStyleSettings.GetDarkShadowColor() );
780  ImplDraw2ColorFrame( pDev, rRect,
781  rStyleSettings.GetLightColor(),
782  rStyleSettings.GetShadowColor() );
783  }
784  break;
785 
786  case DrawFrameStyle::NWF:
787  // no rendering, just enough space for the native rendering
788  rRect.AdjustLeft(4 );
789  rRect.AdjustTop(4 );
790  rRect.AdjustRight( -4 );
791  rRect.AdjustBottom( -4 );
792  break;
793  default: break;
794  }
795  }
796  }
797 }
798 
799 } // end anonymous namespace
800 
802  mpOutDev(pOutDev)
803 {}
804 
806  const Color& rColor, DrawSymbolFlags nStyle )
807 {
808  const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
809  const tools::Rectangle aRect = mpOutDev->LogicToPixel( rRect );
810  const Color aOldLineColor = mpOutDev->GetLineColor();
811  const Color aOldFillColor = mpOutDev->GetFillColor();
812  const bool bOldMapMode = mpOutDev->IsMapModeEnabled();
813  Color nColor(rColor);
814  mpOutDev->EnableMapMode( false );
815 
816  if ( (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) ||
818  nStyle |= DrawSymbolFlags::Mono;
819 
820  if ( nStyle & DrawSymbolFlags::Mono )
821  {
822  // Monochrome: set color to black if enabled, to gray if disabled
823  nColor = ( nStyle & DrawSymbolFlags::Disable ) ? COL_GRAY : COL_BLACK;
824  }
825  else
826  {
827  if ( nStyle & DrawSymbolFlags::Disable )
828  {
829  // Draw shifted and brighter symbol for embossed look
830  mpOutDev->SetLineColor( rStyleSettings.GetLightColor() );
831  mpOutDev->SetFillColor( rStyleSettings.GetLightColor() );
832  ImplDrawSymbol( mpOutDev, aRect + Point(1, 1) , eType );
833  nColor = rStyleSettings.GetShadowColor();
834  }
835  }
836 
837  // Set selected color and draw the symbol
838  mpOutDev->SetLineColor( nColor );
839  mpOutDev->SetFillColor( nColor );
840  ImplDrawSymbol( mpOutDev, aRect, eType );
841 
842  // Restore previous settings
843  mpOutDev->SetLineColor( aOldLineColor );
844  mpOutDev->SetFillColor( aOldFillColor );
845  mpOutDev->EnableMapMode( bOldMapMode );
846 }
847 
849  const Color& rLeftTopColor,
850  const Color& rRightBottomColor )
851 {
852  tools::Rectangle aRect = mpOutDev->LogicToPixel( rRect );
853  const Color aOldLineColor = mpOutDev->GetLineColor();
854  const bool bOldMapMode = mpOutDev->IsMapModeEnabled();
855  mpOutDev->EnableMapMode( false );
856  ImplDraw2ColorFrame( mpOutDev, aRect, rLeftTopColor, rRightBottomColor );
857  mpOutDev->SetLineColor( aOldLineColor );
858  mpOutDev->EnableMapMode( bOldMapMode );
859 }
860 
862  DrawHighlightFrameStyle nStyle )
863 {
864  const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
865  Color aLightColor = rStyleSettings.GetLightColor();
866  Color aShadowColor = rStyleSettings.GetShadowColor();
867 
868  if ( (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) ||
870  {
871  aLightColor = COL_BLACK;
872  aShadowColor = COL_BLACK;
873  }
874  else
875  {
876  Wallpaper aBackground = mpOutDev->GetBackground();
877  if ( aBackground.IsBitmap() || aBackground.IsGradient() )
878  {
879  aLightColor = rStyleSettings.GetFaceColor();
880  aShadowColor = COL_BLACK;
881  }
882  else
883  {
884  Color aBackColor = aBackground.GetColor();
885  if ( (aLightColor.GetColorError( aBackColor ) < 96) ||
886  (aShadowColor.GetColorError( aBackColor ) < 96) )
887  {
888  aLightColor = COL_WHITE;
889  aShadowColor = COL_BLACK;
890 
891  if ( aLightColor.GetColorError( aBackColor ) < 96 )
892  aLightColor.DecreaseLuminance( 64 );
893  if ( aShadowColor.GetColorError( aBackColor ) < 96 )
894  aShadowColor.IncreaseLuminance( 64 );
895  }
896  }
897  }
898 
899  if ( nStyle == DrawHighlightFrameStyle::In )
900  {
901  Color aTempColor = aLightColor;
902  aLightColor = aShadowColor;
903  aShadowColor = aTempColor;
904  }
905 
906  DrawFrame( rRect, aLightColor, aShadowColor );
907 }
908 
910 {
911  tools::Rectangle aRect = rRect;
912  bool bOldMap = mpOutDev->IsMapModeEnabled();
913  if ( bOldMap )
914  {
915  aRect = mpOutDev->LogicToPixel( aRect );
916  mpOutDev->EnableMapMode( false );
917  }
918 
919  if ( !rRect.IsEmpty() )
920  {
921  if ( nFlags & DrawFrameFlags::NoDraw )
922  ImplDrawFrame( mpOutDev, aRect, mpOutDev->GetSettings().GetStyleSettings(), nStyle, nFlags );
923  else
924  {
925  Color aOldLineColor = mpOutDev->GetLineColor();
926  Color aOldFillColor = mpOutDev->GetFillColor();
927  ImplDrawFrame( mpOutDev, aRect, mpOutDev->GetSettings().GetStyleSettings(), nStyle, nFlags );
928  mpOutDev->SetLineColor( aOldLineColor );
929  mpOutDev->SetFillColor( aOldFillColor );
930  }
931  }
932 
933  if ( bOldMap )
934  {
935  mpOutDev->EnableMapMode( bOldMap );
936  aRect = mpOutDev->PixelToLogic( aRect );
937  }
938 
939  return aRect;
940 }
941 
943 {
944  if ( rRect.IsEmpty() )
945  {
946  return rRect;
947  }
948 
949  tools::Rectangle aRect = rRect;
950  const bool bOldMap = mpOutDev->IsMapModeEnabled();
951 
952  if ( bOldMap )
953  {
954  aRect = mpOutDev->LogicToPixel( aRect );
955  mpOutDev->EnableMapMode( false );
956  }
957 
958  const Color aOldLineColor = mpOutDev->GetLineColor();
959  const Color aOldFillColor = mpOutDev->GetFillColor();
960  ImplDrawButton( mpOutDev, aRect, nStyle );
961  mpOutDev->SetLineColor( aOldLineColor );
962  mpOutDev->SetFillColor( aOldFillColor );
963 
964  // keep border free, although it is used at default representation
965  aRect.AdjustLeft( 1 );
966  aRect.AdjustTop( 1 );
967  aRect.AdjustRight( -1 );
968  aRect.AdjustBottom( -1 );
969 
970  if ( nStyle & DrawButtonFlags::NoLightBorder )
971  {
972  aRect.AdjustLeft( 1 );
973  aRect.AdjustTop( 1 );
974  }
975  else if ( nStyle & DrawButtonFlags::NoLeftLightBorder )
976  {
977  aRect.AdjustLeft( 1 );
978  }
979 
980  if ( nStyle & DrawButtonFlags::Pressed )
981  {
982  if ( (aRect.GetHeight() > 10) && (aRect.GetWidth() > 10) )
983  {
984  aRect.AdjustLeft(4 );
985  aRect.AdjustTop(4 );
986  aRect.AdjustRight( -1 );
987  aRect.AdjustBottom( -1 );
988  }
989  else
990  {
991  aRect.AdjustLeft(3 );
992  aRect.AdjustTop(3 );
993  aRect.AdjustRight( -2 );
994  aRect.AdjustBottom( -2 );
995  }
996  }
997  else if ( nStyle & DrawButtonFlags::Checked )
998  {
999  aRect.AdjustLeft(3 );
1000  aRect.AdjustTop(3 );
1001  aRect.AdjustRight( -2 );
1002  aRect.AdjustBottom( -2 );
1003  }
1004  else
1005  {
1006  aRect.AdjustLeft(2 );
1007  aRect.AdjustTop(2 );
1008  aRect.AdjustRight( -3 );
1009  aRect.AdjustBottom( -3 );
1010  }
1011 
1012  if ( bOldMap )
1013  {
1014  mpOutDev->EnableMapMode( bOldMap );
1015  aRect = mpOutDev->PixelToLogic( aRect );
1016  }
1017 
1018  return aRect;
1019 }
1020 
1021 void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical )
1022 {
1023  Point aStart( rStart ), aStop( rStop );
1024  const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
1025  vcl::Window *const pWin = (mpOutDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(mpOutDev.get()) : nullptr;
1026  if(pWin)
1027  {
1029  bool nativeSupported = pWin->IsNativeControlSupported( ControlType::Fixedline, nPart );
1030  ImplControlValue aValue;
1031  tools::Rectangle aRect(rStart,rStop);
1032  if(nativeSupported && pWin->DrawNativeControl(ControlType::Fixedline,nPart,aRect,ControlState::NONE,aValue,OUString()))
1033  return;
1034  }
1035 
1037  if ( rStyleSettings.GetOptions() & StyleSettingsOptions::Mono )
1039  else
1040  mpOutDev->SetLineColor( rStyleSettings.GetShadowColor() );
1041 
1042  mpOutDev->DrawLine( aStart, aStop );
1043  if ( !(rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) )
1044  {
1045  mpOutDev->SetLineColor( rStyleSettings.GetLightColor() );
1046  if( bVertical )
1047  {
1048  aStart.AdjustX( 1 );
1049  aStop.AdjustX( 1 );
1050  }
1051  else
1052  {
1053  aStart.AdjustY( 1 );
1054  aStop.AdjustY( 1 );
1055  }
1056  mpOutDev->DrawLine( aStart, aStop );
1057  }
1058  mpOutDev->Pop();
1059 }
1060 
1062 {
1063  const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
1064 
1065  Size aOutputSize = rRect.GetSize();
1066 
1067  mpOutDev->SetLineColor(rStyleSettings.GetDarkShadowColor());
1068  mpOutDev->SetFillColor(rStyleSettings.GetDarkShadowColor());
1069 
1070  const sal_Int32 nNumberOfPoints = 3;
1071 
1072  long nHalfWidth = aOutputSize.Width() / 2.0f;
1073 
1074  float fDistance = aOutputSize.Height();
1075  fDistance /= (nNumberOfPoints + 1);
1076 
1077  long nRadius = aOutputSize.Width();
1078  nRadius /= (nNumberOfPoints + 2);
1079 
1080  for (long i = 1; i <= nNumberOfPoints; i++)
1081  {
1082  tools::Rectangle aLocation(nHalfWidth - nRadius,
1083  round(fDistance * i) - nRadius,
1084  nHalfWidth + nRadius,
1085  round(fDistance * i) + nRadius);
1086  mpOutDev->DrawEllipse(aLocation);
1087  }
1088 }
1089 
1090 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
long Width() const
const Color & GetShadowColor() const
OutDevType GetOutDevType() const
Definition: outdev.hxx:522
long GetWidth() const
const Wallpaper & GetBackground() const
Definition: outdev.hxx:631
long GetHeight() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption)
Request rendering of a particular control and/or part.
long AdjustX(long nHorzMove)
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
long Height() const
Point BottomLeft() const
long AdjustLeft(long nHorzMoveDelta)
const StyleSettings & GetStyleSettings() const
const Color & GetFaceColor() const
bool IsMapModeEnabled() const
Definition: outdev.hxx:1669
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
Definition: decoview.cxx:848
void DrawPolygon(const tools::Polygon &rPoly)
Render the given polygon.
Definition: polygon.cxx:156
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:890
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
DrawButtonFlags
Definition: decoview.hxx:78
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
void EnableMapMode(bool bEnable=true)
Definition: map.cxx:647
tools::Rectangle DrawButton(const tools::Rectangle &rRect, DrawButtonFlags nStyle)
Definition: decoview.cxx:942
void SetPoint(const Point &rPt, sal_uInt16 nPos)
float x
DrawFrameStyle
Definition: decoview.hxx:46
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
const Color & GetLightBorderColor() const
long AdjustBottom(long nVertMoveDelta)
void Move(long nHorzMoveDelta, long nVertMoveDelta)
bool IsEmpty() const
long Right() const
SymbolType
Definition: vclenum.hxx:73
bool GetUseFlatMenus() const
const Color & GetLightColor() const
long Top() const
void IncreaseLuminance(sal_uInt8 cLumInc)
sal_uInt16 GetColorError(const Color &rCompareColor) const
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:88
void DrawHighlightFrame(const tools::Rectangle &rRect, DrawHighlightFrameStyle nStyle)
Definition: decoview.cxx:861
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:32
float y
DrawFrameFlags
Definition: decoview.hxx:56
Point BottomRight() const
const Color & GetDarkShadowColor() const
void SetLineColor()
bool IsRTLEnabled() const
Definition: outdev.hxx:1354
void DecreaseLuminance(sal_uInt8 cLumDec)
VclPtr< OutputDevice > mpOutDev
Definition: decoview.hxx:100
long AdjustY(long nVertMove)
bool IsDark() const
bool IsNativeWidgetEnabled() const
Definition: window.cxx:3703
void SetSize(const Size &rSize)
int i
const Color & GetColor() const
Definition: wall.cxx:204
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:652
void SetFillColor()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
const Color & GetLineColor() const
Definition: outdev.hxx:618
long Bottom() const
DrawSymbolFlags
Definition: decoview.hxx:34
const AllSettings & GetSettings() const
Definition: outdev.hxx:420
DecorationView(OutputDevice *pOutDev)
Definition: decoview.cxx:801
DocumentType const eType
const Color & GetCheckedColor() const
void DrawPixel(const Point &rPt)
Definition: pixel.cxx:54
long X() const
void DrawSeparator(const Point &rStart, const Point &rStop, bool bVertical=true)
Definition: decoview.cxx:1021
Size GetSize() const
StyleSettingsOptions GetOptions() const
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1035
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1185
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:940
const Color & GetMenuBorderColor() const
bool IsGradient() const
Definition: wall.cxx:283
long AdjustRight(long nHorzMoveDelta)
Definition: ctrl.hxx:33
void DrawHandle(const tools::Rectangle &rRectangle)
Definition: decoview.cxx:1061
long AdjustTop(long nVertMoveDelta)
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
long Left() const
void DrawEllipse(const tools::Rectangle &rRect)
bool IsBitmap() const
Definition: wall.cxx:255
DrawHighlightFrameStyle
Definition: decoview.hxx:71
WindowType GetType() const
Definition: window2.cxx:963
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
static constexpr auto BUTTON_DRAW_FLATTEST
Definition: decoview.cxx:26
void DrawSymbol(const tools::Rectangle &rRect, SymbolType eType, const Color &rColor, DrawSymbolFlags nStyle=DrawSymbolFlags::NONE)
Definition: decoview.cxx:805
void Push(PushFlags nFlags=PushFlags::ALL)
Definition: outdevstate.cxx:60
void setWidth(long nWidth)
SAL_DLLPRIVATE sal_Int32 GetDPIY() const
Get the output device's DPI y-axis value.
Definition: outdev.hxx:507
Point TopRight() const
SAL_DLLPRIVATE sal_Int32 GetDPIX() const
Get the output device's DPI x-axis value.
Definition: outdev.hxx:501
const Color & GetMonoColor() const
Point Center() const
long Y() const
const Color & GetFillColor() const
Definition: outdev.hxx:623
bool GetUseFlatBorders() const
void setHeight(long nHeight)