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(pDev->GetButtonBorderSize());
484 
485  pDev->SetLineColor();
486  pDev->SetFillColor( aBlackColor );
487  const tools::Rectangle aOrigFillRect(aFillRect);
489  {
490  // shrink fill rect
491  aFillRect.AdjustLeft(aBrdSize.Width() );
492  aFillRect.AdjustTop(aBrdSize.Height() );
493  // draw top and left borders (aOrigFillRect-aFillRect)
494  pDev->DrawRect( tools::Rectangle( aOrigFillRect.Left(), aOrigFillRect.Top(),
495  aOrigFillRect.Right(), aFillRect.Top()-1 ) );
496  pDev->DrawRect( tools::Rectangle( aOrigFillRect.Left(), aOrigFillRect.Top(),
497  aFillRect.Left()-1, aOrigFillRect.Bottom() ) );
498  }
499  else
500  {
501  // shrink fill rect
502  aFillRect.AdjustRight( -(aBrdSize.Width()) );
503  aFillRect.AdjustBottom( -(aBrdSize.Height()) );
504  // draw bottom and right borders (aOrigFillRect-aFillRect)
505  pDev->DrawRect( tools::Rectangle( aOrigFillRect.Left(), aFillRect.Bottom()+1,
506  aOrigFillRect.Right(), aOrigFillRect.Bottom() ) );
507  pDev->DrawRect( tools::Rectangle( aFillRect.Right()+1, aOrigFillRect.Top(),
508  aOrigFillRect.Right(), aOrigFillRect.Bottom() ) );
509  }
510 
511  // Hack: in monochrome mode on printers we like to have grey buttons
512  pDev->SetFillColor(pDev->GetMonochromeButtonColor());
513  pDev->DrawRect( aFillRect );
514  }
515  else
516  {
517  if ( nStyle & DrawButtonFlags::Default )
518  {
519  const Color aDefBtnColor = rStyleSettings.GetDarkShadowColor();
520  ImplDrawDPILineRect( pDev, aFillRect, &aDefBtnColor );
521  }
522 
523  if ( nStyle & DrawButtonFlags::NoLeftLightBorder )
524  {
525  pDev->SetLineColor( rStyleSettings.GetLightBorderColor() );
526  pDev->DrawLine( Point( aFillRect.Left(), aFillRect.Top() ),
527  Point( aFillRect.Left(), aFillRect.Bottom() ) );
528  aFillRect.AdjustLeft( 1 );
529  }
530 
531  Color aColor1;
532  Color aColor2;
534  {
535  aColor1 = rStyleSettings.GetDarkShadowColor();
536  aColor2 = rStyleSettings.GetLightColor();
537  }
538  else
539  {
540  if ( nStyle & DrawButtonFlags::NoLightBorder )
541  aColor1 = rStyleSettings.GetLightBorderColor();
542  else
543  aColor1 = rStyleSettings.GetLightColor();
544  if ( (nStyle & BUTTON_DRAW_FLATTEST) == DrawButtonFlags::Flat )
545  aColor2 = rStyleSettings.GetShadowColor();
546  else
547  aColor2 = rStyleSettings.GetDarkShadowColor();
548  }
549 
550  ImplDraw2ColorFrame( pDev, aFillRect, aColor1, aColor2 );
551 
552  if ( (nStyle & BUTTON_DRAW_FLATTEST) != DrawButtonFlags::Flat )
553  {
555  {
556  aColor1 = rStyleSettings.GetShadowColor();
557  aColor2 = rStyleSettings.GetLightBorderColor();
558  }
559  else
560  {
561  if ( nStyle & DrawButtonFlags::NoLightBorder )
562  aColor1 = rStyleSettings.GetLightColor();
563  else
564  aColor1 = rStyleSettings.GetLightBorderColor();
565  aColor2 = rStyleSettings.GetShadowColor();
566  }
567  ImplDraw2ColorFrame( pDev, aFillRect, aColor1, aColor2 );
568  }
569 
570  pDev->SetLineColor();
572  pDev->SetFillColor( rStyleSettings.GetCheckedColor() );
573  else
574  pDev->SetFillColor( rStyleSettings.GetFaceColor() );
575  pDev->DrawRect( aFillRect );
576  }
577 }
578 
579 void ImplDrawFrame( OutputDevice *const pDev, tools::Rectangle& rRect,
580  const StyleSettings& rStyleSettings, DrawFrameStyle nStyle, DrawFrameFlags nFlags )
581 {
582  vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(pDev) : nullptr;
583 
584  const bool bMenuStyle(nFlags & DrawFrameFlags::Menu);
585 
586  // UseFlatBorders disables 3D style for all frames except menus
587  // menus may use different border colors (eg on XP)
588  // normal frames will be drawn using the shadow color
589  // whereas window frame borders will use black
590  bool bFlatBorders = !bMenuStyle && rStyleSettings.GetUseFlatBorders();
591 
592  // no flat borders for standard VCL controls (ie formcontrols that keep their classic look)
593  // will not affect frame windows (like dropdowns)
594  if( bFlatBorders && pWin && pWin->GetType() == WindowType::BORDERWINDOW && (pWin != pWin->ImplGetFrameWindow()) )
595  {
596  // check for formcontrol, i.e., a control without NWF enabled
597  Control *const pControl = dynamic_cast< Control* >( pWin->GetWindow( GetWindowType::Client ) );
598  if( !pControl || !pControl->IsNativeWidgetEnabled() )
599  bFlatBorders = false;
600  }
601 
602  const bool bNoDraw(nFlags & DrawFrameFlags::NoDraw);
603 
604  if ( (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) ||
605  (pDev->GetOutDevType() == OUTDEV_PRINTER) ||
606  bFlatBorders )
607  nFlags |= DrawFrameFlags::Mono;
608 
609  if( nStyle != DrawFrameStyle::NWF &&
611  {
612  long nControlFlags = static_cast<long>(nStyle);
613  nControlFlags |= static_cast<long>(nFlags);
614  nControlFlags |= static_cast<long>(pWin->GetType() == WindowType::BORDERWINDOW ?
616  ImplControlValue aControlValue( nControlFlags );
617 
618  tools::Rectangle aBound, aContent;
619  tools::Rectangle aNatRgn( rRect );
621  aNatRgn, ControlState::NONE, aControlValue, aBound, aContent) )
622  {
623  // if bNoDraw is true then don't call the drawing routine
624  // but just update the target rectangle
625  if( bNoDraw ||
627  aControlValue, OUString()) )
628  {
629  rRect = aContent;
630  return;
631  }
632  }
633  }
634 
635  if ( nFlags & DrawFrameFlags::Mono )
636  {
637  // no round corners for window frame borders
638  const bool bRound = bFlatBorders && !(nFlags & DrawFrameFlags::WindowBorder);
639 
640  if ( bNoDraw )
641  {
642  ImplDrawDPILineRect( pDev, rRect, nullptr, bRound );
643  }
644  else
645  {
646  Color aColor = bRound ? rStyleSettings.GetShadowColor()
648  // when the MonoColor wasn't set, check face color
649  if (
650  (bRound && aColor.IsDark()) ||
651  (
652  (aColor == COL_BLACK) &&
654  )
655  )
656  {
657  aColor = COL_WHITE;
658  }
659  ImplDrawDPILineRect( pDev, rRect, &aColor, bRound );
660  }
661  }
662  else
663  {
664  if ( bNoDraw )
665  {
666  switch ( nStyle )
667  {
668  case DrawFrameStyle::In:
669  case DrawFrameStyle::Out:
670  rRect.AdjustLeft( 1 );
671  rRect.AdjustTop( 1 );
672  rRect.AdjustRight( -1 );
673  rRect.AdjustBottom( -1 );
674  break;
675 
679  rRect.AdjustLeft(2 );
680  rRect.AdjustTop(2 );
681  rRect.AdjustRight( -2 );
682  rRect.AdjustBottom( -2 );
683  break;
684 
685  case DrawFrameStyle::NWF:
686  // enough space for the native rendering
687  rRect.AdjustLeft(4 );
688  rRect.AdjustTop(4 );
689  rRect.AdjustRight( -4 );
690  rRect.AdjustBottom( -4 );
691  break;
692  default: break;
693  }
694  }
695  else
696  {
697  switch ( nStyle )
698  {
700  pDev->SetFillColor();
701  pDev->SetLineColor( rStyleSettings.GetLightColor() );
702  pDev->DrawRect( tools::Rectangle( rRect.Left()+1, rRect.Top()+1,
703  rRect.Right(), rRect.Bottom() ) );
704  pDev->SetLineColor( rStyleSettings.GetShadowColor() );
705  pDev->DrawRect( tools::Rectangle( rRect.Left(), rRect.Top(),
706  rRect.Right()-1, rRect.Bottom()-1 ) );
707 
708  // adjust target rectangle
709  rRect.AdjustLeft(2 );
710  rRect.AdjustTop(2 );
711  rRect.AdjustRight( -2 );
712  rRect.AdjustBottom( -2 );
713  break;
714 
715  case DrawFrameStyle::In:
716  ImplDraw2ColorFrame( pDev, rRect,
717  rStyleSettings.GetShadowColor(),
718  rStyleSettings.GetLightColor() );
719  break;
720 
721  case DrawFrameStyle::Out:
722  ImplDraw2ColorFrame( pDev, rRect,
723  rStyleSettings.GetLightColor(),
724  rStyleSettings.GetShadowColor() );
725  break;
726 
728  if( bFlatBorders )
729  {
730  // no 3d effect
731  ImplDraw2ColorFrame( pDev, rRect,
732  rStyleSettings.GetShadowColor(),
733  rStyleSettings.GetShadowColor() );
734  ImplDraw2ColorFrame( pDev, rRect,
735  rStyleSettings.GetFaceColor(),
736  rStyleSettings.GetFaceColor() );
737  }
738  else
739  {
740  ImplDraw2ColorFrame( pDev, rRect,
741  rStyleSettings.GetShadowColor(),
742  rStyleSettings.GetLightColor() );
743  ImplDraw2ColorFrame( pDev, rRect,
744  rStyleSettings.GetDarkShadowColor(),
745  rStyleSettings.GetLightBorderColor() );
746  }
747  break;
748 
750  if( bMenuStyle )
751  {
752  ImplDraw2ColorFrame( pDev, rRect,
753  rStyleSettings.GetMenuBorderColor(),
754  rStyleSettings.GetDarkShadowColor() );
755  if ( !rStyleSettings.GetUseFlatMenus() )
756  {
757  ImplDraw2ColorFrame( pDev, rRect,
758  rStyleSettings.GetLightColor(),
759  rStyleSettings.GetShadowColor() );
760  }
761  }
762  else
763  {
764  ImplDraw2ColorFrame( pDev, rRect,
765  bFlatBorders ? // no 3d effect
766  rStyleSettings.GetDarkShadowColor() :
767  rStyleSettings.GetLightBorderColor(),
768  rStyleSettings.GetDarkShadowColor() );
769  ImplDraw2ColorFrame( pDev, rRect,
770  rStyleSettings.GetLightColor(),
771  rStyleSettings.GetShadowColor() );
772  }
773  break;
774 
775  case DrawFrameStyle::NWF:
776  // no rendering, just enough space for the native rendering
777  rRect.AdjustLeft(4 );
778  rRect.AdjustTop(4 );
779  rRect.AdjustRight( -4 );
780  rRect.AdjustBottom( -4 );
781  break;
782  default: break;
783  }
784  }
785  }
786 }
787 
788 } // end anonymous namespace
789 
791  mpOutDev(pOutDev)
792 {}
793 
795  const Color& rColor, DrawSymbolFlags nStyle )
796 {
797  const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
798  const tools::Rectangle aRect = mpOutDev->LogicToPixel( rRect );
799  const Color aOldLineColor = mpOutDev->GetLineColor();
800  const Color aOldFillColor = mpOutDev->GetFillColor();
801  const bool bOldMapMode = mpOutDev->IsMapModeEnabled();
802  Color nColor(rColor);
803  mpOutDev->EnableMapMode( false );
804 
805  if ( (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) ||
807  nStyle |= DrawSymbolFlags::Mono;
808 
809  if ( nStyle & DrawSymbolFlags::Mono )
810  {
811  // Monochrome: set color to black if enabled, to gray if disabled
812  nColor = ( nStyle & DrawSymbolFlags::Disable ) ? COL_GRAY : COL_BLACK;
813  }
814  else
815  {
816  if ( nStyle & DrawSymbolFlags::Disable )
817  {
818  // Draw shifted and brighter symbol for embossed look
819  mpOutDev->SetLineColor( rStyleSettings.GetLightColor() );
820  mpOutDev->SetFillColor( rStyleSettings.GetLightColor() );
821  ImplDrawSymbol( mpOutDev, aRect + Point(1, 1) , eType );
822  nColor = rStyleSettings.GetShadowColor();
823  }
824  }
825 
826  // Set selected color and draw the symbol
827  mpOutDev->SetLineColor( nColor );
828  mpOutDev->SetFillColor( nColor );
829  ImplDrawSymbol( mpOutDev, aRect, eType );
830 
831  // Restore previous settings
832  mpOutDev->SetLineColor( aOldLineColor );
833  mpOutDev->SetFillColor( aOldFillColor );
834  mpOutDev->EnableMapMode( bOldMapMode );
835 }
836 
838  const Color& rLeftTopColor,
839  const Color& rRightBottomColor )
840 {
841  tools::Rectangle aRect = mpOutDev->LogicToPixel( rRect );
842  const Color aOldLineColor = mpOutDev->GetLineColor();
843  const bool bOldMapMode = mpOutDev->IsMapModeEnabled();
844  mpOutDev->EnableMapMode( false );
845  ImplDraw2ColorFrame( mpOutDev, aRect, rLeftTopColor, rRightBottomColor );
846  mpOutDev->SetLineColor( aOldLineColor );
847  mpOutDev->EnableMapMode( bOldMapMode );
848 }
849 
851  DrawHighlightFrameStyle nStyle )
852 {
853  const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
854  Color aLightColor = rStyleSettings.GetLightColor();
855  Color aShadowColor = rStyleSettings.GetShadowColor();
856 
857  if ( (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) ||
859  {
860  aLightColor = COL_BLACK;
861  aShadowColor = COL_BLACK;
862  }
863  else
864  {
865  Wallpaper aBackground = mpOutDev->GetBackground();
866  if ( aBackground.IsBitmap() || aBackground.IsGradient() )
867  {
868  aLightColor = rStyleSettings.GetFaceColor();
869  aShadowColor = COL_BLACK;
870  }
871  else
872  {
873  Color aBackColor = aBackground.GetColor();
874  if ( (aLightColor.GetColorError( aBackColor ) < 96) ||
875  (aShadowColor.GetColorError( aBackColor ) < 96) )
876  {
877  aLightColor = COL_WHITE;
878  aShadowColor = COL_BLACK;
879 
880  if ( aLightColor.GetColorError( aBackColor ) < 96 )
881  aLightColor.DecreaseLuminance( 64 );
882  if ( aShadowColor.GetColorError( aBackColor ) < 96 )
883  aShadowColor.IncreaseLuminance( 64 );
884  }
885  }
886  }
887 
888  if ( nStyle == DrawHighlightFrameStyle::In )
889  {
890  Color aTempColor = aLightColor;
891  aLightColor = aShadowColor;
892  aShadowColor = aTempColor;
893  }
894 
895  DrawFrame( rRect, aLightColor, aShadowColor );
896 }
897 
899 {
900  tools::Rectangle aRect = rRect;
901  bool bOldMap = mpOutDev->IsMapModeEnabled();
902  if ( bOldMap )
903  {
904  aRect = mpOutDev->LogicToPixel( aRect );
905  mpOutDev->EnableMapMode( false );
906  }
907 
908  if ( !rRect.IsEmpty() )
909  {
910  if ( nFlags & DrawFrameFlags::NoDraw )
911  ImplDrawFrame( mpOutDev, aRect, mpOutDev->GetSettings().GetStyleSettings(), nStyle, nFlags );
912  else
913  {
914  Color aOldLineColor = mpOutDev->GetLineColor();
915  Color aOldFillColor = mpOutDev->GetFillColor();
916  ImplDrawFrame( mpOutDev, aRect, mpOutDev->GetSettings().GetStyleSettings(), nStyle, nFlags );
917  mpOutDev->SetLineColor( aOldLineColor );
918  mpOutDev->SetFillColor( aOldFillColor );
919  }
920  }
921 
922  if ( bOldMap )
923  {
924  mpOutDev->EnableMapMode( bOldMap );
925  aRect = mpOutDev->PixelToLogic( aRect );
926  }
927 
928  return aRect;
929 }
930 
932 {
933  if ( rRect.IsEmpty() )
934  {
935  return rRect;
936  }
937 
938  tools::Rectangle aRect = rRect;
939  const bool bOldMap = mpOutDev->IsMapModeEnabled();
940 
941  if ( bOldMap )
942  {
943  aRect = mpOutDev->LogicToPixel( aRect );
944  mpOutDev->EnableMapMode( false );
945  }
946 
947  const Color aOldLineColor = mpOutDev->GetLineColor();
948  const Color aOldFillColor = mpOutDev->GetFillColor();
949  ImplDrawButton( mpOutDev, aRect, nStyle );
950  mpOutDev->SetLineColor( aOldLineColor );
951  mpOutDev->SetFillColor( aOldFillColor );
952 
953  // keep border free, although it is used at default representation
954  aRect.AdjustLeft( 1 );
955  aRect.AdjustTop( 1 );
956  aRect.AdjustRight( -1 );
957  aRect.AdjustBottom( -1 );
958 
959  if ( nStyle & DrawButtonFlags::NoLightBorder )
960  {
961  aRect.AdjustLeft( 1 );
962  aRect.AdjustTop( 1 );
963  }
964  else if ( nStyle & DrawButtonFlags::NoLeftLightBorder )
965  {
966  aRect.AdjustLeft( 1 );
967  }
968 
969  if ( nStyle & DrawButtonFlags::Pressed )
970  {
971  if ( (aRect.GetHeight() > 10) && (aRect.GetWidth() > 10) )
972  {
973  aRect.AdjustLeft(4 );
974  aRect.AdjustTop(4 );
975  aRect.AdjustRight( -1 );
976  aRect.AdjustBottom( -1 );
977  }
978  else
979  {
980  aRect.AdjustLeft(3 );
981  aRect.AdjustTop(3 );
982  aRect.AdjustRight( -2 );
983  aRect.AdjustBottom( -2 );
984  }
985  }
986  else if ( nStyle & DrawButtonFlags::Checked )
987  {
988  aRect.AdjustLeft(3 );
989  aRect.AdjustTop(3 );
990  aRect.AdjustRight( -2 );
991  aRect.AdjustBottom( -2 );
992  }
993  else
994  {
995  aRect.AdjustLeft(2 );
996  aRect.AdjustTop(2 );
997  aRect.AdjustRight( -3 );
998  aRect.AdjustBottom( -3 );
999  }
1000 
1001  if ( bOldMap )
1002  {
1003  mpOutDev->EnableMapMode( bOldMap );
1004  aRect = mpOutDev->PixelToLogic( aRect );
1005  }
1006 
1007  return aRect;
1008 }
1009 
1010 void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical )
1011 {
1012  Point aStart( rStart ), aStop( rStop );
1013  const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
1014  vcl::Window *const pWin = (mpOutDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(mpOutDev.get()) : nullptr;
1015  if(pWin)
1016  {
1018  bool nativeSupported = pWin->IsNativeControlSupported( ControlType::Fixedline, nPart );
1019  ImplControlValue aValue;
1020  tools::Rectangle aRect(rStart,rStop);
1021  if(nativeSupported && pWin->DrawNativeControl(ControlType::Fixedline,nPart,aRect,ControlState::NONE,aValue,OUString()))
1022  return;
1023  }
1024 
1026  if ( rStyleSettings.GetOptions() & StyleSettingsOptions::Mono )
1028  else
1029  mpOutDev->SetLineColor( rStyleSettings.GetShadowColor() );
1030 
1031  mpOutDev->DrawLine( aStart, aStop );
1032  if ( !(rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) )
1033  {
1034  mpOutDev->SetLineColor( rStyleSettings.GetLightColor() );
1035  if( bVertical )
1036  {
1037  aStart.AdjustX( 1 );
1038  aStop.AdjustX( 1 );
1039  }
1040  else
1041  {
1042  aStart.AdjustY( 1 );
1043  aStop.AdjustY( 1 );
1044  }
1045  mpOutDev->DrawLine( aStart, aStop );
1046  }
1047  mpOutDev->Pop();
1048 }
1049 
1051 {
1052  const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
1053 
1054  Size aOutputSize = rRect.GetSize();
1055 
1056  mpOutDev->SetLineColor(rStyleSettings.GetDarkShadowColor());
1057  mpOutDev->SetFillColor(rStyleSettings.GetDarkShadowColor());
1058 
1059  const sal_Int32 nNumberOfPoints = 3;
1060 
1061  long nHalfWidth = aOutputSize.Width() / 2.0f;
1062 
1063  float fDistance = aOutputSize.Height();
1064  fDistance /= (nNumberOfPoints + 1);
1065 
1066  long nRadius = aOutputSize.Width();
1067  nRadius /= (nNumberOfPoints + 2);
1068 
1069  for (long i = 1; i <= nNumberOfPoints; i++)
1070  {
1071  tools::Rectangle aLocation(nHalfWidth - nRadius,
1072  round(fDistance * i) - nRadius,
1073  nHalfWidth + nRadius,
1074  round(fDistance * i) + nRadius);
1075  mpOutDev->DrawEllipse(aLocation);
1076  }
1077 }
1078 
1079 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
long Width() const
const Color & GetShadowColor() const
OutDevType GetOutDevType() const
Definition: outdev.hxx:524
virtual Color GetMonochromeButtonColor()
Definition: outdev.hxx:540
long GetWidth() const
const Wallpaper & GetBackground() const
Definition: outdev.hxx:643
long GetHeight() const
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:1671
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
Definition: decoview.cxx:837
void DrawPolygon(const tools::Polygon &rPoly)
Render the given polygon.
Definition: polygon.cxx:156
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:901
DrawButtonFlags
Definition: decoview.hxx:53
void EnableMapMode(bool bEnable=true)
Definition: map.cxx:646
tools::Rectangle DrawButton(const tools::Rectangle &rRect, DrawButtonFlags nStyle)
Definition: decoview.cxx:931
void SetPoint(const Point &rPt, sal_uInt16 nPos)
float x
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
int n2
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:850
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:51
float y
DocumentType eType
Point BottomRight() const
const Color & GetDarkShadowColor() const
void SetLineColor()
bool IsRTLEnabled() const
Definition: outdev.hxx:1356
void DecreaseLuminance(sal_uInt8 cLumDec)
int i
VclPtr< OutputDevice > mpOutDev
Definition: decoview.hxx:75
bool IsDark() const
bool IsNativeWidgetEnabled() const
Definition: window.cxx:3679
void SetSize(const Size &rSize)
const Color & GetColor() const
Definition: wall.cxx:204
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:636
void SetFillColor()
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_GRAY
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:302
const Color & GetLineColor() const
Definition: outdev.hxx:630
long Bottom() const
DrawSymbolFlags
Definition: decoview.hxx:34
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor=COL_AUTO)
Request rendering of a particular control and/or part.
const AllSettings & GetSettings() const
Definition: outdev.hxx:418
DecorationView(OutputDevice *pOutDev)
Definition: decoview.cxx:790
const Color & GetCheckedColor() const
void DrawPixel(const Point &rPt)
Definition: pixel.cxx:54
sal_Int32 nLineWidth
void DrawSeparator(const Point &rStart, const Point &rStop, bool bVertical=true)
Definition: decoview.cxx:1010
Size GetSize() const
StyleSettingsOptions GetOptions() const
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1039
DrawFrameStyle
Definition: vclenum.hxx:336
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1186
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:941
const Color & GetMenuBorderColor() const
bool IsGradient() const
Definition: wall.cxx:283
long AdjustRight(long nHorzMoveDelta)
Definition: ctrl.hxx:33
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
void DrawHandle(const tools::Rectangle &rRectangle)
Definition: decoview.cxx:1050
long AdjustTop(long nVertMoveDelta)
void * p
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
virtual Size GetButtonBorderSize()
Definition: outdev.hxx:539
long Left() const
void DrawEllipse(const tools::Rectangle &rRect)
bool IsBitmap() const
Definition: wall.cxx:255
DrawHighlightFrameStyle
Definition: decoview.hxx:46
WindowType GetType() const
Definition: window2.cxx:974
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
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:794
DrawFrameFlags
Definition: vclenum.hxx:348
void Push(PushFlags nFlags=PushFlags::ALL)
Definition: outdevstate.cxx:60
SAL_DLLPRIVATE sal_Int32 GetDPIY() const
Get the output device's DPI y-axis value.
Definition: outdev.hxx:509
Point TopRight() const
SAL_DLLPRIVATE sal_Int32 GetDPIX() const
Get the output device's DPI x-axis value.
Definition: outdev.hxx:503
const Color & GetMonoColor() const
Point Center() const
const Color & GetFillColor() const
Definition: outdev.hxx:635
bool GetUseFlatBorders() const