LibreOffice Module vcl (master)  1
graph.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 <tools/fract.hxx>
21 #include <vcl/outdev.hxx>
22 #include <vcl/svapp.hxx>
23 #include <vcl/graph.hxx>
24 #include <impgraph.hxx>
25 #include <com/sun/star/lang/XUnoTunnel.hpp>
26 #include <com/sun/star/graphic/XGraphic.hpp>
28 #include <graphic/UnoGraphic.hxx>
30 
31 
32 using namespace ::com::sun::star;
33 
34 namespace
35 {
36 
37 void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
38  vcl::Font* pFont, const BitmapEx* pBitmapEx,
39  const Point& rDestPt, const Size& rDestSize )
40 {
41  sal_uInt16 nPixel = static_cast<sal_uInt16>(pOutDev->PixelToLogic( Size( 1, 1 ) ).Width());
42  sal_uInt16 nPixelWidth = nPixel;
43  Point aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
44  Size aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) );
45  bool bFilled = ( pBitmapEx != nullptr || pFont != nullptr );
46  tools::Rectangle aBorderRect( aPoint, aSize );
47 
48  pOutDev->Push();
49 
50  pOutDev->SetFillColor();
51 
52  // On the printer a black rectangle and on the screen one with 3D effect
53  if ( pOutDev->GetOutDevType() == OUTDEV_PRINTER )
54  pOutDev->SetLineColor( COL_BLACK );
55  else
56  {
57  aBorderRect.AdjustLeft(nPixel );
58  aBorderRect.AdjustTop(nPixel );
59 
60  pOutDev->SetLineColor( COL_LIGHTGRAY );
61  pOutDev->DrawRect( aBorderRect );
62 
63  aBorderRect.AdjustLeft( -nPixel );
64  aBorderRect.AdjustTop( -nPixel );
65  aBorderRect.AdjustRight( -nPixel );
66  aBorderRect.AdjustBottom( -nPixel );
67  pOutDev->SetLineColor( COL_GRAY );
68  }
69 
70  pOutDev->DrawRect( aBorderRect );
71 
72  aPoint.AdjustX(nPixelWidth + 2*nPixel );
73  aPoint.AdjustY(nPixelWidth + 2*nPixel );
74  aSize.AdjustWidth( -(2*nPixelWidth + 4*nPixel) );
75  aSize.AdjustHeight( -(2*nPixelWidth + 4*nPixel) );
76 
77  if( aSize.Width() > 0 && aSize.Height() > 0
78  && ( pBitmapEx && !!*pBitmapEx ) )
79  {
80  Size aBitmapSize( pOutDev->PixelToLogic( pBitmapEx->GetSizePixel() ) );
81 
82  if( aSize.Height() > aBitmapSize.Height() && aSize.Width() > aBitmapSize.Width() )
83  {
84  pOutDev->DrawBitmapEx( aPoint, *pBitmapEx );
85  aPoint.AdjustX(aBitmapSize.Width() + 2*nPixel );
86  aSize.AdjustWidth( -(aBitmapSize.Width() + 2*nPixel) );
87  }
88  }
89 
90  if ( aSize.Width() > 0 && aSize.Height() > 0 && pFont && pText && pText->getLength()
91  && pOutDev->IsOutputEnabled() )
92  {
93  MapMode aMapMode( MapUnit::MapPoint );
94  Size aSz = pOutDev->LogicToLogic( Size( 0, 12 ), &aMapMode, nullptr );
95  long nThreshold = aSz.Height() / 2;
96  long nStep = nThreshold / 3;
97 
98  if ( !nStep )
99  nStep = aSz.Height() - nThreshold;
100 
101  for(;; aSz.AdjustHeight( -nStep ) )
102  {
103  pFont->SetFontSize( aSz );
104  pOutDev->SetFont( *pFont );
105 
106  long nTextHeight = pOutDev->GetTextHeight();
107  long nTextWidth = pOutDev->GetTextWidth( *pText );
108  if ( nTextHeight )
109  {
110  // The approximation does not respect imprecisions caused
111  // by word wraps
112  long nLines = aSize.Height() / nTextHeight;
113  long nWidth = aSize.Width() * nLines; // Approximation!!!
114 
115  if ( nTextWidth <= nWidth || aSz.Height() <= nThreshold )
116  {
117  sal_Int32 nStart = 0;
118  sal_Int32 nLen = 0;
119 
120  while( nStart < pText->getLength() && (*pText)[nStart] == ' ' )
121  nStart++;
122  while( nStart+nLen < pText->getLength() && (*pText)[nStart+nLen] != ' ' )
123  nLen++;
124  while( nStart < pText->getLength() && nLines-- )
125  {
126  sal_Int32 nNext = nLen;
127  do
128  {
129  while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] == ' ' )
130  nNext++;
131  while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] != ' ' )
132  nNext++;
133  nTextWidth = pOutDev->GetTextWidth( *pText, nStart, nNext );
134  if ( nTextWidth > aSize.Width() )
135  break;
136  nLen = nNext;
137  }
138  while ( nStart+nNext < pText->getLength() );
139 
140  sal_Int32 n = nLen;
141  nTextWidth = pOutDev->GetTextWidth( *pText, nStart, n );
142  while( nTextWidth > aSize.Width() )
143  nTextWidth = pOutDev->GetTextWidth( *pText, nStart, --n );
144  pOutDev->DrawText( aPoint, *pText, nStart, n );
145 
146  aPoint.AdjustY(nTextHeight );
147  nStart = sal::static_int_cast<sal_uInt16>(nStart + nLen);
148  nLen = nNext-nLen;
149  while( nStart < pText->getLength() && (*pText)[nStart] == ' ' )
150  {
151  nStart++;
152  nLen--;
153  }
154  }
155  break;
156  }
157  }
158  else
159  break;
160  }
161  }
162 
163  // If the default graphic does not have content, we draw a red rectangle
164  if( !bFilled )
165  {
166  aBorderRect.AdjustLeft( 1 );
167  aBorderRect.AdjustTop( 1 );
168  aBorderRect.AdjustRight( -1 );
169  aBorderRect.AdjustBottom( -1 );
170 
171  pOutDev->SetLineColor( COL_LIGHTRED );
172  pOutDev->DrawLine( aBorderRect.TopLeft(), aBorderRect.BottomRight() );
173  pOutDev->DrawLine( aBorderRect.TopRight(), aBorderRect.BottomLeft() );
174  }
175 
176  pOutDev->Pop();
177 }
178 
179 } // end anonymous namespace
180 
182  : mxImpGraphic(vcl::graphic::Manager::get().newInstance())
183 {
184 }
185 
186 Graphic::Graphic(const Graphic& rGraphic)
187 {
188  if( rGraphic.IsAnimated() )
190  else
191  mxImpGraphic = rGraphic.mxImpGraphic;
192 }
193 
194 Graphic::Graphic(Graphic&& rGraphic) noexcept
195  : mxImpGraphic(std::move(rGraphic.mxImpGraphic))
196 {
197 }
198 
199 Graphic::Graphic(GraphicExternalLink const & rGraphicExternalLink)
200  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rGraphicExternalLink))
201 {
202 }
203 
205  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rBmp))
206 {
207 }
208 
210  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rBmpEx))
211 {
212 }
213 
214 Graphic::Graphic(const VectorGraphicDataPtr& rVectorGraphicDataPtr)
215  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rVectorGraphicDataPtr))
216 {
217 }
218 
219 Graphic::Graphic(const Animation& rAnimation)
220  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rAnimation))
221 {
222 }
223 
225  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rMtf))
226 {
227 }
228 
229 Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic )
230 {
231  uno::Reference< lang::XUnoTunnel > xTunnel( rxGraphic, uno::UNO_QUERY );
232  const ::Graphic* pGraphic = ( xTunnel.is() ?
233  reinterpret_cast< ::Graphic* >( xTunnel->getSomething( getUnoTunnelId() ) ) :
234  nullptr );
235 
236  if( pGraphic )
237  {
238  if (pGraphic->IsAnimated())
239  mxImpGraphic = vcl::graphic::Manager::get().copy(pGraphic->mxImpGraphic);
240  else
241  mxImpGraphic = pGraphic->mxImpGraphic;
242  }
243  else
245 }
246 
248 {
249  if (mxImpGraphic.use_count() > 1)
250  {
252  }
253 }
254 
256 {
257  return mxImpGraphic->isAvailable();
258 }
259 
261 {
262  return mxImpGraphic->makeAvailable();
263 }
264 
265 Graphic& Graphic::operator=( const Graphic& rGraphic )
266 {
267  if( &rGraphic != this )
268  {
269  if( rGraphic.IsAnimated() )
271  else
272  mxImpGraphic = rGraphic.mxImpGraphic;
273  }
274 
275  return *this;
276 }
277 
278 Graphic& Graphic::operator=(Graphic&& rGraphic) noexcept
279 {
280  mxImpGraphic = std::move(rGraphic.mxImpGraphic);
281  return *this;
282 }
283 
284 bool Graphic::operator==( const Graphic& rGraphic ) const
285 {
286  return (*mxImpGraphic == *rGraphic.mxImpGraphic);
287 }
288 
289 bool Graphic::operator!=( const Graphic& rGraphic ) const
290 {
291  return (*mxImpGraphic != *rGraphic.mxImpGraphic);
292 }
293 
294 bool Graphic::IsNone() const
295 {
296  return GraphicType::NONE == mxImpGraphic->ImplGetType();
297 }
298 
300 {
302  mxImpGraphic->ImplClear();
303 }
304 
306 {
307  return mxImpGraphic->ImplGetType();
308 }
309 
311 {
313  mxImpGraphic->ImplSetDefaultType();
314 }
315 
317 {
318  return mxImpGraphic->ImplIsSupportedGraphic();
319 }
320 
322 {
323  return mxImpGraphic->ImplIsTransparent();
324 }
325 
326 bool Graphic::IsAlpha() const
327 {
328  return mxImpGraphic->ImplIsAlpha();
329 }
330 
332 {
333  return mxImpGraphic->ImplIsAnimated();
334 }
335 
336 bool Graphic::IsEPS() const
337 {
338  return mxImpGraphic->ImplIsEPS();
339 }
340 
342 {
343  return mxImpGraphic->ImplGetBitmapEx(rParameters);
344 }
345 
347 {
348  return mxImpGraphic->ImplGetAnimation();
349 }
350 
352 {
353  return mxImpGraphic->ImplGetGDIMetaFile();
354 }
355 
357 {
358  return mxImpGraphic->ImplGetBitmapExRef();
359 }
360 
361 uno::Reference<graphic::XGraphic> Graphic::GetXGraphic() const
362 {
363  uno::Reference<graphic::XGraphic> xGraphic;
364 
365  if (GetType() != GraphicType::NONE)
366  {
367  unographic::Graphic* pUnoGraphic = new unographic::Graphic;
368  pUnoGraphic->init(*this);
369  xGraphic = pUnoGraphic;
370  }
371 
372  return xGraphic;
373 }
374 
376 {
377  return mxImpGraphic->ImplGetPrefSize();
378 }
379 
380 void Graphic::SetPrefSize( const Size& rPrefSize )
381 {
383  mxImpGraphic->ImplSetPrefSize( rPrefSize );
384 }
385 
387 {
388  return mxImpGraphic->ImplGetPrefMapMode();
389 }
390 
391 void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode )
392 {
394  mxImpGraphic->ImplSetPrefMapMode( rPrefMapMode );
395 }
396 
398 {
399  double nGrfDPIx;
400  double nGrfDPIy;
401 
402  const MapMode aGrfMap(GetPrefMapMode());
403  const Size aGrfPixelSize(GetSizePixel());
404  const Size aGrfPrefMapModeSize(GetPrefSize());
405  if (aGrfMap.GetMapUnit() == MapUnit::MapInch)
406  {
407  nGrfDPIx = aGrfPixelSize.Width() / ( static_cast<double>(aGrfMap.GetScaleX()) * aGrfPrefMapModeSize.Width() );
408  nGrfDPIy = aGrfPixelSize.Height() / ( static_cast<double>(aGrfMap.GetScaleY()) * aGrfPrefMapModeSize.Height() );
409  }
410  else
411  {
412  const Size aGrf1000thInchSize = OutputDevice::LogicToLogic(
413  aGrfPrefMapModeSize, aGrfMap, MapMode(MapUnit::Map1000thInch));
414  nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width();
415  nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height();
416  }
417 
418  return basegfx::B2DSize(nGrfDPIx, nGrfDPIy);
419 }
420 
421 Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
422 {
423  Size aRet;
424 
425  if( GraphicType::Bitmap == mxImpGraphic->ImplGetType() )
426  aRet = mxImpGraphic->ImplGetSizePixel();
427  else
428  aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() );
429 
430  return aRet;
431 }
432 
434 {
435  return mxImpGraphic->ImplGetSizeBytes();
436 }
437 
438 void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const
439 {
440  mxImpGraphic->ImplDraw( pOutDev, rDestPt );
441 }
442 
444  const Point& rDestPt, const Size& rDestSz ) const
445 {
446  if( GraphicType::Default == mxImpGraphic->ImplGetType() )
447  ImplDrawDefault( pOutDev, nullptr, nullptr, nullptr, rDestPt, rDestSz );
448  else
449  mxImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz );
450 }
451 
452 void Graphic::DrawEx( OutputDevice* pOutDev, const OUString& rText,
453  vcl::Font& rFont, const BitmapEx& rBitmap,
454  const Point& rDestPt, const Size& rDestSz )
455 {
456  ImplDrawDefault( pOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz );
457 }
458 
459 void Graphic::StartAnimation( OutputDevice* pOutDev, const Point& rDestPt,
460  const Size& rDestSz, long nExtraData,
461  OutputDevice* pFirstFrameOutDev )
462 {
464  mxImpGraphic->ImplStartAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev );
465 }
466 
467 void Graphic::StopAnimation( OutputDevice* pOutDev, long nExtraData )
468 {
470  mxImpGraphic->ImplStopAnimation( pOutDev, nExtraData );
471 }
472 
474 {
475  mxImpGraphic->ImplSetAnimationNotifyHdl( rLink );
476 }
477 
479 {
480  return mxImpGraphic->ImplGetAnimationNotifyHdl();
481 }
482 
484 {
485  return mxImpGraphic->ImplGetAnimationLoopCount();
486 }
487 
488 std::shared_ptr<GraphicReader>& Graphic::GetContext()
489 {
490  return mxImpGraphic->ImplGetContext();
491 }
492 
493 void Graphic::SetContext( const std::shared_ptr<GraphicReader> &pReader )
494 {
495  mxImpGraphic->ImplSetContext( pReader );
496 }
497 
498 void Graphic::SetDummyContext( bool value )
499 {
500  mxImpGraphic->ImplSetDummyContext( value );
501 }
502 
504 {
505  return mxImpGraphic->ImplIsDummyContext();
506 }
507 
508 void Graphic::SetGfxLink( const std::shared_ptr<GfxLink>& rGfxLink )
509 {
511  mxImpGraphic->ImplSetLink( rGfxLink );
512 }
513 
514 std::shared_ptr<GfxLink> Graphic::GetSharedGfxLink() const
515 {
516  return mxImpGraphic->ImplGetSharedGfxLink();
517 }
518 
520 {
521  return mxImpGraphic->ImplGetLink();
522 }
523 
524 bool Graphic::IsGfxLink() const
525 {
526  return mxImpGraphic->ImplIsLink();
527 }
528 
530 {
531  return mxImpGraphic->ImplGetChecksum();
532 }
533 
534 bool Graphic::ExportNative( SvStream& rOStream ) const
535 {
536  return mxImpGraphic->ImplExportNative( rOStream );
537 }
538 
539 void ReadGraphic(SvStream& rIStream, Graphic& rGraphic)
540 {
541  rGraphic.ImplTestRefCount();
542  ReadImpGraphic(rIStream, *rGraphic.mxImpGraphic);
543 }
544 
545 void WriteGraphic( SvStream& rOStream, const Graphic& rGraphic )
546 {
547  WriteImpGraphic(rOStream, *rGraphic.mxImpGraphic);
548 }
549 
551 {
552  return mxImpGraphic->getVectorGraphicData();
553 }
554 
555 void Graphic::setPdfData(const std::shared_ptr<std::vector<sal_Int8>>& rPdfData)
556 {
558  mxImpGraphic->setPdfData(rPdfData);
559 }
560 
561 const std::shared_ptr<std::vector<sal_Int8>> & Graphic::getPdfData() const
562 {
563  return mxImpGraphic->getPdfData();
564 }
565 
567 {
568  std::shared_ptr<std::vector<sal_Int8>> pPdfData(getPdfData());
569  return pPdfData && !pPdfData->empty();
570 }
571 
572 void Graphic::setPageNumber(sal_Int32 nPageNumber)
573 {
574  mxImpGraphic->mnPageNumber = nPageNumber;
575 }
576 
577 sal_Int32 Graphic::getPageNumber() const
578 {
579  return mxImpGraphic->mnPageNumber;
580 }
581 
582 OUString Graphic::getOriginURL() const
583 {
584  if (mxImpGraphic)
585  {
586  return mxImpGraphic->getOriginURL();
587  }
588  return OUString();
589 }
590 
591 void Graphic::setOriginURL(OUString const & rOriginURL)
592 {
593  if (mxImpGraphic)
594  {
595  mxImpGraphic->setOriginURL(rOriginURL);
596  }
597 }
598 
599 OString Graphic::getUniqueID() const
600 {
601  OString aUniqueString;
602  if (mxImpGraphic)
603  aUniqueString = mxImpGraphic->getUniqueID();
604  return aUniqueString;
605 }
606 
607 namespace {
608 
609 struct Id: public rtl::Static<cppu::OImplementationId, Id> {};
610 
611 }
612 
613 css::uno::Sequence<sal_Int8> Graphic::getUnoTunnelId() {
614  return Id::get().getImplementationId();
615 }
616 
617 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
void SetDummyContext(bool value)
Definition: graph.cxx:498
const Fraction & GetScaleX() const
Definition: mapmod.cxx:167
long Width() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
Definition: text.cxx:779
OutDevType GetOutDevType() const
Definition: outdev.hxx:522
sal_uInt64 BitmapChecksum
Definition: checksum.hxx:30
const VectorGraphicDataPtr & getVectorGraphicData() const
Definition: graph.cxx:550
void SetFontSize(const Size &)
Definition: font/font.cxx:116
void ReadGraphic(SvStream &rIStream, Graphic &rGraphic)
Definition: graph.cxx:539
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
Definition: map.cxx:1678
bool IsNone() const
Definition: graph.cxx:294
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
Definition: graph.cxx:421
void SetContext(const std::shared_ptr< GraphicReader > &pReader)
Definition: graph.cxx:493
long Height() const
std::shared_ptr< ImpGraphic > mxImpGraphic
Definition: graph.hxx:108
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
This is an overloaded member function, provided for convenience. It differs from the above function o...
BitmapChecksum GetChecksum() const
Definition: graph.cxx:529
bool ExportNative(SvStream &rOStream) const
Definition: graph.cxx:534
sal_uIntPtr sal_uLong
void SetPrefMapMode(const MapMode &rPrefMapMode)
Definition: graph.cxx:391
bool IsOutputEnabled() const
Definition: outdev.hxx:588
GraphicType
Definition: graph.hxx:36
bool IsSupportedGraphic() const
Definition: graph.cxx:316
std::shared_ptr< GraphicReader > & GetContext()
Definition: graph.cxx:488
void setOriginURL(OUString const &rOriginURL)
Definition: graph.cxx:591
SAL_DLLPRIVATE void ImplTestRefCount()
Definition: graph.cxx:247
bool IsTransparent() const
Definition: graph.cxx:321
std::shared_ptr< ImpGraphic > copy(std::shared_ptr< ImpGraphic > const &pImpGraphic)
Definition: Manager.cxx:156
long AdjustHeight(long n)
static css::uno::Sequence< sal_Int8 > getUnoTunnelId()
Definition: graph.cxx:613
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
Definition: graph.cxx:361
bool IsGfxLink() const
Definition: graph.cxx:524
void setPdfData(const std::shared_ptr< std::vector< sal_Int8 >> &rPdfData)
Definition: graph.cxx:555
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1055
void Clear()
Definition: graph.cxx:299
const std::shared_ptr< std::vector< sal_Int8 > > & getPdfData() const
Definition: graph.cxx:561
const Fraction & GetScaleY() const
Definition: mapmod.cxx:169
B2DVector B2DSize
sal_Int32 getPageNumber() const
Get the page number of the multi-page source this Graphic is rendered from.
Definition: graph.cxx:577
std::shared_ptr< GfxLink > GetSharedGfxLink() const
Definition: graph.cxx:514
const GDIMetaFile & GetGDIMetaFile() const
Definition: graph.cxx:351
bool isAvailable() const
Definition: graph.cxx:255
void StopAnimation(OutputDevice *pOutputDevice, long nExtraData)
Definition: graph.cxx:467
void SetAnimationNotifyHdl(const Link< Animation *, void > &rLink)
Definition: graph.cxx:473
void SetGfxLink(const std::shared_ptr< GfxLink > &rGfxLink)
Definition: graph.cxx:508
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:88
bool IsAnimated() const
Definition: graph.cxx:331
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:32
Animation GetAnimation() const
Definition: graph.cxx:346
void SetLineColor()
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
Definition: graph.cxx:438
#define nPixel
std::shared_ptr< ImpGraphic > newInstance()
Definition: Manager.cxx:163
GraphicType GetType() const
Definition: graph.cxx:305
void ReadImpGraphic(SvStream &rIStm, ImpGraphic &rImpGraphic)
Definition: impgraph.cxx:1752
static Manager & get()
Definition: Manager.cxx:55
bool operator!=(const Graphic &rGraphic) const
Definition: graph.cxx:289
void WriteGraphic(SvStream &rOStream, const Graphic &rGraphic)
Definition: graph.cxx:545
void SetFillColor()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
const BitmapEx & GetBitmapExRef() const
Gives direct access to the contained BitmapEx.
Definition: graph.cxx:356
void StartAnimation(OutputDevice *pOutDev, const Point &rDestPt, const Size &rDestSize, long nExtraData=0, OutputDevice *pFirstFrameOutDev=nullptr)
Definition: graph.cxx:459
OUString getOriginURL() const
Definition: graph.cxx:582
MapUnit GetMapUnit() const
Definition: mapmod.cxx:163
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Definition: graph.cxx:341
GfxLink GetGfxLink() const
Definition: graph.cxx:519
bool IsAlpha() const
Definition: graph.cxx:326
void WriteImpGraphic(SvStream &rOStm, const ImpGraphic &rImpGraphic)
Definition: impgraph.cxx:1931
sal_uInt32 Id
void setPageNumber(sal_Int32 nPageNumber)
Set the page number of the multi-page source this Graphic is rendered from.
Definition: graph.cxx:572
long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:888
long X() const
sal_uLong GetSizeBytes() const
Definition: graph.cxx:433
basegfx::B2DSize GetPPI() const
Definition: graph.cxx:397
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1185
Size GetPrefSize() const
Definition: graph.cxx:375
std::shared_ptr< VectorGraphicData > VectorGraphicDataPtr
Link< Animation *, void > GetAnimationNotifyHdl() const
Definition: graph.cxx:478
Graphic()
Definition: graph.cxx:181
MapMode GetPrefMapMode() const
Definition: graph.cxx:386
sal_uInt32 GetAnimationLoopCount() const
Definition: graph.cxx:483
void SetFont(const vcl::Font &rNewFont)
OString getUniqueID() const
Definition: graph.cxx:599
void init(const ::Graphic &rGraphic)
Definition: UnoGraphic.cxx:46
bool makeAvailable()
Definition: graph.cxx:260
double getLength(const B2DPolygon &rCandidate)
void SetPrefSize(const Size &rPrefSize)
Definition: graph.cxx:380
long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: text.cxx:877
bool hasPdfData() const
Definition: graph.cxx:566
void SetDefaultType()
Definition: graph.cxx:310
const Size & GetSizePixel() const
Definition: bitmapex.hxx:83
Graphic & operator=(const Graphic &rGraphic)
Definition: graph.cxx:265
bool operator==(const Graphic &rGraphic) const
Definition: graph.cxx:284
void Push(PushFlags nFlags=PushFlags::ALL)
Definition: outdevstate.cxx:60
static void DrawEx(OutputDevice *pOutDev, const OUString &rText, vcl::Font &rFont, const BitmapEx &rBitmap, const Point &rDestPt, const Size &rDestSize)
Definition: graph.cxx:452
bool IsDummyContext() const
Definition: graph.cxx:503
long Y() const
bool IsEPS() const
Definition: graph.cxx:336