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 <vcl/image.hxx>
25 #include <impgraph.hxx>
26 #include <com/sun/star/graphic/XGraphic.hpp>
29 #include <graphic/UnoGraphic.hxx>
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 // We use XGraphic for passing toolbar images across app UNO aps
215 // and we need to be able to see and preserve 'stock' images too.
216 Graphic::Graphic(const Image& rImage)
217  // FIXME: should really defer the BitmapEx load.
218  : mxImpGraphic(new ImpGraphic(rImage.GetBitmapEx()))
219 {
220  OUString aStock = rImage.GetStock();
221  if (aStock.getLength())
222  mxImpGraphic->setOriginURL("private:graphicrepository/" + aStock);
223 }
224 
225 Graphic::Graphic(const VectorGraphicDataPtr& rVectorGraphicDataPtr)
226  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rVectorGraphicDataPtr))
227 {
228 }
229 
230 Graphic::Graphic(const Animation& rAnimation)
231  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rAnimation))
232 {
233 }
234 
236  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rMtf))
237 {
238 }
239 
240 Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic )
241 {
242  const ::Graphic* pGraphic = comphelper::getUnoTunnelImplementation<::Graphic>(rxGraphic);
243 
244  if( pGraphic )
245  {
246  if (pGraphic->IsAnimated())
247  mxImpGraphic = vcl::graphic::Manager::get().copy(pGraphic->mxImpGraphic);
248  else
249  mxImpGraphic = pGraphic->mxImpGraphic;
250  }
251  else
253 }
254 
256 {
257  if (mxImpGraphic.use_count() > 1)
258  {
260  }
261 }
262 
264 {
265  return mxImpGraphic->isAvailable();
266 }
267 
269 {
270  return mxImpGraphic->makeAvailable();
271 }
272 
273 Graphic& Graphic::operator=( const Graphic& rGraphic )
274 {
275  if( &rGraphic != this )
276  {
277  if( rGraphic.IsAnimated() )
279  else
280  mxImpGraphic = rGraphic.mxImpGraphic;
281  }
282 
283  return *this;
284 }
285 
286 Graphic& Graphic::operator=(Graphic&& rGraphic) noexcept
287 {
288  mxImpGraphic = std::move(rGraphic.mxImpGraphic);
289  return *this;
290 }
291 
292 bool Graphic::operator==( const Graphic& rGraphic ) const
293 {
294  return (*mxImpGraphic == *rGraphic.mxImpGraphic);
295 }
296 
297 bool Graphic::operator!=( const Graphic& rGraphic ) const
298 {
299  return (*mxImpGraphic != *rGraphic.mxImpGraphic);
300 }
301 
302 bool Graphic::IsNone() const
303 {
304  return GraphicType::NONE == mxImpGraphic->ImplGetType();
305 }
306 
308 {
310  mxImpGraphic->ImplClear();
311 }
312 
314 {
315  return mxImpGraphic->ImplGetType();
316 }
317 
319 {
321  mxImpGraphic->ImplSetDefaultType();
322 }
323 
325 {
326  return mxImpGraphic->ImplIsSupportedGraphic();
327 }
328 
330 {
331  return mxImpGraphic->ImplIsTransparent();
332 }
333 
334 bool Graphic::IsAlpha() const
335 {
336  return mxImpGraphic->ImplIsAlpha();
337 }
338 
340 {
341  return mxImpGraphic->ImplIsAnimated();
342 }
343 
344 bool Graphic::IsEPS() const
345 {
346  return mxImpGraphic->ImplIsEPS();
347 }
348 
350 {
351  return mxImpGraphic->ImplGetBitmapEx(rParameters);
352 }
353 
355 {
356  return mxImpGraphic->ImplGetAnimation();
357 }
358 
360 {
361  return mxImpGraphic->ImplGetGDIMetaFile();
362 }
363 
365 {
366  return mxImpGraphic->ImplGetBitmapExRef();
367 }
368 
369 uno::Reference<graphic::XGraphic> Graphic::GetXGraphic() const
370 {
371  uno::Reference<graphic::XGraphic> xGraphic;
372 
373  if (GetType() != GraphicType::NONE)
374  {
375  unographic::Graphic* pUnoGraphic = new unographic::Graphic;
376  pUnoGraphic->init(*this);
377  xGraphic = pUnoGraphic;
378  }
379 
380  return xGraphic;
381 }
382 
384 {
385  return mxImpGraphic->ImplGetPrefSize();
386 }
387 
388 void Graphic::SetPrefSize( const Size& rPrefSize )
389 {
391  mxImpGraphic->ImplSetPrefSize( rPrefSize );
392 }
393 
395 {
396  return mxImpGraphic->ImplGetPrefMapMode();
397 }
398 
399 void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode )
400 {
402  mxImpGraphic->ImplSetPrefMapMode( rPrefMapMode );
403 }
404 
406 {
407  double nGrfDPIx;
408  double nGrfDPIy;
409 
410  const MapMode aGrfMap(GetPrefMapMode());
411  const Size aGrfPixelSize(GetSizePixel());
412  const Size aGrfPrefMapModeSize(GetPrefSize());
413  if (aGrfMap.GetMapUnit() == MapUnit::MapInch)
414  {
415  nGrfDPIx = aGrfPixelSize.Width() / ( static_cast<double>(aGrfMap.GetScaleX()) * aGrfPrefMapModeSize.Width() );
416  nGrfDPIy = aGrfPixelSize.Height() / ( static_cast<double>(aGrfMap.GetScaleY()) * aGrfPrefMapModeSize.Height() );
417  }
418  else
419  {
420  const Size aGrf1000thInchSize = OutputDevice::LogicToLogic(
421  aGrfPrefMapModeSize, aGrfMap, MapMode(MapUnit::Map1000thInch));
422  nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width();
423  nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height();
424  }
425 
426  return basegfx::B2DSize(nGrfDPIx, nGrfDPIy);
427 }
428 
429 Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
430 {
431  Size aRet;
432 
433  if( GraphicType::Bitmap == mxImpGraphic->ImplGetType() )
434  aRet = mxImpGraphic->ImplGetSizePixel();
435  else
436  aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() );
437 
438  return aRet;
439 }
440 
442 {
443  return mxImpGraphic->ImplGetSizeBytes();
444 }
445 
446 void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const
447 {
448  mxImpGraphic->ImplDraw( pOutDev, rDestPt );
449 }
450 
452  const Point& rDestPt, const Size& rDestSz ) const
453 {
454  if( GraphicType::Default == mxImpGraphic->ImplGetType() )
455  ImplDrawDefault( pOutDev, nullptr, nullptr, nullptr, rDestPt, rDestSz );
456  else
457  mxImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz );
458 }
459 
460 void Graphic::DrawEx( OutputDevice* pOutDev, const OUString& rText,
461  vcl::Font& rFont, const BitmapEx& rBitmap,
462  const Point& rDestPt, const Size& rDestSz )
463 {
464  ImplDrawDefault( pOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz );
465 }
466 
467 void Graphic::StartAnimation( OutputDevice* pOutDev, const Point& rDestPt,
468  const Size& rDestSz, long nExtraData,
469  OutputDevice* pFirstFrameOutDev )
470 {
472  mxImpGraphic->ImplStartAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev );
473 }
474 
475 void Graphic::StopAnimation( OutputDevice* pOutDev, long nExtraData )
476 {
478  mxImpGraphic->ImplStopAnimation( pOutDev, nExtraData );
479 }
480 
482 {
483  mxImpGraphic->ImplSetAnimationNotifyHdl( rLink );
484 }
485 
487 {
488  return mxImpGraphic->ImplGetAnimationNotifyHdl();
489 }
490 
492 {
493  return mxImpGraphic->ImplGetAnimationLoopCount();
494 }
495 
496 std::shared_ptr<GraphicReader>& Graphic::GetContext()
497 {
498  return mxImpGraphic->ImplGetContext();
499 }
500 
501 void Graphic::SetContext( const std::shared_ptr<GraphicReader> &pReader )
502 {
503  mxImpGraphic->ImplSetContext( pReader );
504 }
505 
506 void Graphic::SetDummyContext( bool value )
507 {
508  mxImpGraphic->ImplSetDummyContext( value );
509 }
510 
512 {
513  return mxImpGraphic->ImplIsDummyContext();
514 }
515 
516 void Graphic::SetGfxLink( const std::shared_ptr<GfxLink>& rGfxLink )
517 {
519  mxImpGraphic->ImplSetLink( rGfxLink );
520 }
521 
522 std::shared_ptr<GfxLink> Graphic::GetSharedGfxLink() const
523 {
524  return mxImpGraphic->ImplGetSharedGfxLink();
525 }
526 
528 {
529  return mxImpGraphic->ImplGetLink();
530 }
531 
532 bool Graphic::IsGfxLink() const
533 {
534  return mxImpGraphic->ImplIsLink();
535 }
536 
538 {
539  return mxImpGraphic->ImplGetChecksum();
540 }
541 
542 bool Graphic::ExportNative( SvStream& rOStream ) const
543 {
544  return mxImpGraphic->ImplExportNative( rOStream );
545 }
546 
547 void ReadGraphic(SvStream& rIStream, Graphic& rGraphic)
548 {
549  rGraphic.ImplTestRefCount();
550  ReadImpGraphic(rIStream, *rGraphic.mxImpGraphic);
551 }
552 
553 void WriteGraphic( SvStream& rOStream, const Graphic& rGraphic )
554 {
555  WriteImpGraphic(rOStream, *rGraphic.mxImpGraphic);
556 }
557 
559 {
560  return mxImpGraphic->getVectorGraphicData();
561 }
562 
563 void Graphic::setPdfData(const std::shared_ptr<std::vector<sal_Int8>>& rPdfData)
564 {
566  mxImpGraphic->setPdfData(rPdfData);
567 }
568 
569 const std::shared_ptr<std::vector<sal_Int8>> & Graphic::getPdfData() const
570 {
571  return mxImpGraphic->getPdfData();
572 }
573 
575 {
576  std::shared_ptr<std::vector<sal_Int8>> pPdfData(getPdfData());
577  return pPdfData && !pPdfData->empty();
578 }
579 
580 void Graphic::setPageNumber(sal_Int32 nPageNumber)
581 {
582  mxImpGraphic->mnPageNumber = nPageNumber;
583 }
584 
585 sal_Int32 Graphic::getPageNumber() const
586 {
587  return mxImpGraphic->mnPageNumber;
588 }
589 
590 OUString Graphic::getOriginURL() const
591 {
592  if (mxImpGraphic)
593  {
594  return mxImpGraphic->getOriginURL();
595  }
596  return OUString();
597 }
598 
599 void Graphic::setOriginURL(OUString const & rOriginURL)
600 {
601  if (mxImpGraphic)
602  {
603  mxImpGraphic->setOriginURL(rOriginURL);
604  }
605 }
606 
607 OString Graphic::getUniqueID() const
608 {
609  OString aUniqueString;
610  if (mxImpGraphic)
611  aUniqueString = mxImpGraphic->getUniqueID();
612  return aUniqueString;
613 }
614 
615 namespace {
616 
617 struct Id: public rtl::Static<cppu::OImplementationId, Id> {};
618 
619 }
620 
621 css::uno::Sequence<sal_Int8> Graphic::getUnoTunnelId() {
622  return Id::get().getImplementationId();
623 }
624 
625 /* 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:506
const Fraction & GetScaleX() const
Definition: mapmod.cxx:172
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:558
void SetFontSize(const Size &)
Definition: font/font.cxx:117
void ReadGraphic(SvStream &rIStream, Graphic &rGraphic)
Definition: graph.cxx:547
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
Definition: map.cxx:1674
bool IsNone() const
Definition: graph.cxx:302
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
Definition: graph.cxx:429
void SetContext(const std::shared_ptr< GraphicReader > &pReader)
Definition: graph.cxx:501
long Height() const
std::shared_ptr< ImpGraphic > mxImpGraphic
Definition: graph.hxx:109
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:537
bool ExportNative(SvStream &rOStream) const
Definition: graph.cxx:542
sal_uIntPtr sal_uLong
void SetPrefMapMode(const MapMode &rPrefMapMode)
Definition: graph.cxx:399
bool IsOutputEnabled() const
Definition: outdev.hxx:588
GraphicType
Definition: graph.hxx:36
bool IsSupportedGraphic() const
Definition: graph.cxx:324
std::shared_ptr< GraphicReader > & GetContext()
Definition: graph.cxx:496
void setOriginURL(OUString const &rOriginURL)
Definition: graph.cxx:599
SAL_DLLPRIVATE void ImplTestRefCount()
Definition: graph.cxx:255
bool IsTransparent() const
Definition: graph.cxx:329
std::shared_ptr< ImpGraphic > copy(std::shared_ptr< ImpGraphic > const &pImpGraphic)
Definition: Manager.cxx:164
long AdjustHeight(long n)
static css::uno::Sequence< sal_Int8 > getUnoTunnelId()
Definition: graph.cxx:621
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
Definition: graph.cxx:369
bool IsGfxLink() const
Definition: graph.cxx:532
void setPdfData(const std::shared_ptr< std::vector< sal_Int8 >> &rPdfData)
Definition: graph.cxx:563
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1054
void Clear()
Definition: graph.cxx:307
const std::shared_ptr< std::vector< sal_Int8 > > & getPdfData() const
Definition: graph.cxx:569
const Fraction & GetScaleY() const
Definition: mapmod.cxx:174
B2DVector B2DSize
sal_Int32 getPageNumber() const
Get the page number of the multi-page source this Graphic is rendered from.
Definition: graph.cxx:585
std::shared_ptr< GfxLink > GetSharedGfxLink() const
Definition: graph.cxx:522
const GDIMetaFile & GetGDIMetaFile() const
Definition: graph.cxx:359
bool isAvailable() const
Definition: graph.cxx:263
void StopAnimation(OutputDevice *pOutputDevice, long nExtraData)
Definition: graph.cxx:475
void SetAnimationNotifyHdl(const Link< Animation *, void > &rLink)
Definition: graph.cxx:481
void SetGfxLink(const std::shared_ptr< GfxLink > &rGfxLink)
Definition: graph.cxx:516
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:88
bool IsAnimated() const
Definition: graph.cxx:339
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:32
Animation GetAnimation() const
Definition: graph.cxx:354
OUString GetStock() const
Definition: Image.cxx:79
void SetLineColor()
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
Definition: graph.cxx:446
#define nPixel
std::shared_ptr< ImpGraphic > newInstance()
Definition: Manager.cxx:171
GraphicType GetType() const
Definition: graph.cxx:313
void ReadImpGraphic(SvStream &rIStm, ImpGraphic &rImpGraphic)
Definition: impgraph.cxx:1769
static Manager & get()
Definition: Manager.cxx:56
bool operator!=(const Graphic &rGraphic) const
Definition: graph.cxx:297
void WriteGraphic(SvStream &rOStream, const Graphic &rGraphic)
Definition: graph.cxx:553
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:364
void StartAnimation(OutputDevice *pOutDev, const Point &rDestPt, const Size &rDestSize, long nExtraData=0, OutputDevice *pFirstFrameOutDev=nullptr)
Definition: graph.cxx:467
OUString getOriginURL() const
Definition: graph.cxx:590
MapUnit GetMapUnit() const
Definition: mapmod.cxx:168
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Definition: graph.cxx:349
GfxLink GetGfxLink() const
Definition: graph.cxx:527
bool IsAlpha() const
Definition: graph.cxx:334
void WriteImpGraphic(SvStream &rOStm, const ImpGraphic &rImpGraphic)
Definition: impgraph.cxx:1948
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:580
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:441
basegfx::B2DSize GetPPI() const
Definition: graph.cxx:405
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1185
Size GetPrefSize() const
Definition: graph.cxx:383
std::shared_ptr< VectorGraphicData > VectorGraphicDataPtr
Link< Animation *, void > GetAnimationNotifyHdl() const
Definition: graph.cxx:486
Graphic()
Definition: graph.cxx:181
MapMode GetPrefMapMode() const
Definition: graph.cxx:394
sal_uInt32 GetAnimationLoopCount() const
Definition: graph.cxx:491
void SetFont(const vcl::Font &rNewFont)
OString getUniqueID() const
Definition: graph.cxx:607
void init(const ::Graphic &rGraphic)
Definition: UnoGraphic.cxx:45
Definition: image.hxx:40
bool makeAvailable()
Definition: graph.cxx:268
double getLength(const B2DPolygon &rCandidate)
void SetPrefSize(const Size &rPrefSize)
Definition: graph.cxx:388
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:574
void SetDefaultType()
Definition: graph.cxx:318
const Size & GetSizePixel() const
Definition: bitmapex.hxx:83
Graphic & operator=(const Graphic &rGraphic)
Definition: graph.cxx:273
bool operator==(const Graphic &rGraphic) const
Definition: graph.cxx:292
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:460
bool IsDummyContext() const
Definition: graph.cxx:511
long Y() const
bool IsEPS() const
Definition: graph.cxx:344