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  pOutDev->DrawBorder(aBorderRect);
54 
55  aPoint.AdjustX(nPixelWidth + 2*nPixel );
56  aPoint.AdjustY(nPixelWidth + 2*nPixel );
57  aSize.AdjustWidth( -(2*nPixelWidth + 4*nPixel) );
58  aSize.AdjustHeight( -(2*nPixelWidth + 4*nPixel) );
59 
60  if( !aSize.IsEmpty() && pBitmapEx && !!*pBitmapEx )
61  {
62  Size aBitmapSize( pOutDev->PixelToLogic( pBitmapEx->GetSizePixel() ) );
63 
64  if( aSize.Height() > aBitmapSize.Height() && aSize.Width() > aBitmapSize.Width() )
65  {
66  pOutDev->DrawBitmapEx( aPoint, *pBitmapEx );
67  aPoint.AdjustX(aBitmapSize.Width() + 2*nPixel );
68  aSize.AdjustWidth( -(aBitmapSize.Width() + 2*nPixel) );
69  }
70  }
71 
72  if ( !aSize.IsEmpty() && pFont && pText && pText->getLength() && pOutDev->IsOutputEnabled() )
73  {
74  MapMode aMapMode( MapUnit::MapPoint );
75  Size aSz = pOutDev->LogicToLogic( Size( 0, 12 ), &aMapMode, nullptr );
76  tools::Long nThreshold = aSz.Height() / 2;
77  tools::Long nStep = nThreshold / 3;
78 
79  if ( !nStep )
80  nStep = aSz.Height() - nThreshold;
81 
82  for(;; aSz.AdjustHeight( -nStep ) )
83  {
84  pFont->SetFontSize( aSz );
85  pOutDev->SetFont( *pFont );
86 
87  tools::Long nTextHeight = pOutDev->GetTextHeight();
88  tools::Long nTextWidth = pOutDev->GetTextWidth( *pText );
89  if ( nTextHeight )
90  {
91  // The approximation does not respect imprecisions caused
92  // by word wraps
93  tools::Long nLines = aSize.Height() / nTextHeight;
94  tools::Long nWidth = aSize.Width() * nLines; // Approximation!!!
95 
96  if ( nTextWidth <= nWidth || aSz.Height() <= nThreshold )
97  {
98  sal_Int32 nStart = 0;
99  sal_Int32 nLen = 0;
100 
101  while( nStart < pText->getLength() && (*pText)[nStart] == ' ' )
102  nStart++;
103  while( nStart+nLen < pText->getLength() && (*pText)[nStart+nLen] != ' ' )
104  nLen++;
105  while( nStart < pText->getLength() && nLines-- )
106  {
107  sal_Int32 nNext = nLen;
108  do
109  {
110  while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] == ' ' )
111  nNext++;
112  while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] != ' ' )
113  nNext++;
114  nTextWidth = pOutDev->GetTextWidth( *pText, nStart, nNext );
115  if ( nTextWidth > aSize.Width() )
116  break;
117  nLen = nNext;
118  }
119  while ( nStart+nNext < pText->getLength() );
120 
121  sal_Int32 n = nLen;
122  nTextWidth = pOutDev->GetTextWidth( *pText, nStart, n );
123  while( nTextWidth > aSize.Width() )
124  nTextWidth = pOutDev->GetTextWidth( *pText, nStart, --n );
125  pOutDev->DrawText( aPoint, *pText, nStart, n );
126 
127  aPoint.AdjustY(nTextHeight );
128  nStart = sal::static_int_cast<sal_uInt16>(nStart + nLen);
129  nLen = nNext-nLen;
130  while( nStart < pText->getLength() && (*pText)[nStart] == ' ' )
131  {
132  nStart++;
133  nLen--;
134  }
135  }
136  break;
137  }
138  }
139  else
140  break;
141  }
142  }
143 
144  // If the default graphic does not have content, we draw a red rectangle
145  if( !bFilled )
146  {
147  aBorderRect.AdjustLeft( 1 );
148  aBorderRect.AdjustTop( 1 );
149  aBorderRect.AdjustRight( -1 );
150  aBorderRect.AdjustBottom( -1 );
151 
152  pOutDev->SetLineColor( COL_LIGHTRED );
153  pOutDev->DrawLine( aBorderRect.TopLeft(), aBorderRect.BottomRight() );
154  pOutDev->DrawLine( aBorderRect.TopRight(), aBorderRect.BottomLeft() );
155  }
156 
157  pOutDev->Pop();
158 }
159 
160 } // end anonymous namespace
161 
163  : mxImpGraphic(vcl::graphic::Manager::get().newInstance())
164 {
165 }
166 
167 Graphic::Graphic(const Graphic& rGraphic)
168 {
169  if( rGraphic.IsAnimated() )
171  else
172  mxImpGraphic = rGraphic.mxImpGraphic;
173 }
174 
175 Graphic::Graphic(Graphic&& rGraphic) noexcept
176  : mxImpGraphic(std::move(rGraphic.mxImpGraphic))
177 {
178 }
179 
180 Graphic::Graphic(GraphicExternalLink const & rGraphicExternalLink)
181  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rGraphicExternalLink))
182 {
183 }
184 
186  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rBmpEx))
187 {
188 }
189 
190 // We use XGraphic for passing toolbar images across app UNO aps
191 // and we need to be able to see and preserve 'stock' images too.
192 Graphic::Graphic(const Image& rImage)
193  // FIXME: should really defer the BitmapEx load.
194  : mxImpGraphic(std::make_shared<ImpGraphic>(rImage.GetBitmapEx()))
195 {
196  OUString aStock = rImage.GetStock();
197  if (aStock.getLength())
198  mxImpGraphic->setOriginURL("private:graphicrepository/" + aStock);
199 }
200 
201 Graphic::Graphic(const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr)
202  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rVectorGraphicDataPtr))
203 {
204 }
205 
206 Graphic::Graphic(const Animation& rAnimation)
207  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rAnimation))
208 {
209 }
210 
212  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rMtf))
213 {
214 }
215 
216 Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic )
217 {
218  const ::Graphic* pGraphic = comphelper::getUnoTunnelImplementation<::Graphic>(rxGraphic);
219 
220  if( pGraphic )
221  {
222  if (pGraphic->IsAnimated())
223  mxImpGraphic = vcl::graphic::Manager::get().copy(pGraphic->mxImpGraphic);
224  else
225  mxImpGraphic = pGraphic->mxImpGraphic;
226  }
227  else
229 }
230 
232 {
233  if (mxImpGraphic.use_count() > 1)
234  {
236  }
237 }
238 
240 {
241  return mxImpGraphic->isAvailable();
242 }
243 
245 {
246  return mxImpGraphic->makeAvailable();
247 }
248 
249 Graphic& Graphic::operator=( const Graphic& rGraphic )
250 {
251  if( &rGraphic != this )
252  {
253  if( rGraphic.IsAnimated() )
255  else
256  mxImpGraphic = rGraphic.mxImpGraphic;
257  }
258 
259  return *this;
260 }
261 
262 Graphic& Graphic::operator=(Graphic&& rGraphic) noexcept
263 {
264  mxImpGraphic = std::move(rGraphic.mxImpGraphic);
265  return *this;
266 }
267 
268 bool Graphic::operator==( const Graphic& rGraphic ) const
269 {
270  return (*mxImpGraphic == *rGraphic.mxImpGraphic);
271 }
272 
273 bool Graphic::operator!=( const Graphic& rGraphic ) const
274 {
275  return (*mxImpGraphic != *rGraphic.mxImpGraphic);
276 }
277 
278 bool Graphic::IsNone() const
279 {
280  return GraphicType::NONE == mxImpGraphic->ImplGetType();
281 }
282 
284 {
286  mxImpGraphic->ImplClear();
287 }
288 
290 {
291  return mxImpGraphic->ImplGetType();
292 }
293 
295 {
297  mxImpGraphic->ImplSetDefaultType();
298 }
299 
301 {
302  return mxImpGraphic->ImplIsSupportedGraphic();
303 }
304 
306 {
307  return mxImpGraphic->ImplIsTransparent();
308 }
309 
310 bool Graphic::IsAlpha() const
311 {
312  return mxImpGraphic->ImplIsAlpha();
313 }
314 
316 {
317  return mxImpGraphic->ImplIsAnimated();
318 }
319 
320 bool Graphic::IsEPS() const
321 {
322  return mxImpGraphic->ImplIsEPS();
323 }
324 
326 {
327  return mxImpGraphic->ImplGetBitmapEx(rParameters);
328 }
329 
331 {
332  return mxImpGraphic->ImplGetAnimation();
333 }
334 
336 {
337  return mxImpGraphic->ImplGetGDIMetaFile();
338 }
339 
341 {
342  return mxImpGraphic->ImplGetBitmapExRef();
343 }
344 
345 uno::Reference<graphic::XGraphic> Graphic::GetXGraphic() const
346 {
347  uno::Reference<graphic::XGraphic> xGraphic;
348 
349  if (GetType() != GraphicType::NONE)
350  {
351  unographic::Graphic* pUnoGraphic = new unographic::Graphic;
352  pUnoGraphic->init(*this);
353  xGraphic = pUnoGraphic;
354  }
355 
356  return xGraphic;
357 }
358 
360 {
361  return mxImpGraphic->ImplGetPrefSize();
362 }
363 
364 void Graphic::SetPrefSize( const Size& rPrefSize )
365 {
367  mxImpGraphic->ImplSetPrefSize( rPrefSize );
368 }
369 
371 {
372  return mxImpGraphic->ImplGetPrefMapMode();
373 }
374 
375 void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode )
376 {
378  mxImpGraphic->ImplSetPrefMapMode( rPrefMapMode );
379 }
380 
382 {
383  double nGrfDPIx;
384  double nGrfDPIy;
385 
386  const MapMode aGrfMap(GetPrefMapMode());
387  const Size aGrfPixelSize(GetSizePixel());
388  const Size aGrfPrefMapModeSize(GetPrefSize());
389  if (aGrfMap.GetMapUnit() == MapUnit::MapInch)
390  {
391  nGrfDPIx = aGrfPixelSize.Width() / ( static_cast<double>(aGrfMap.GetScaleX()) * aGrfPrefMapModeSize.Width() );
392  nGrfDPIy = aGrfPixelSize.Height() / ( static_cast<double>(aGrfMap.GetScaleY()) * aGrfPrefMapModeSize.Height() );
393  }
394  else
395  {
396  const Size aGrf1000thInchSize = OutputDevice::LogicToLogic(
397  aGrfPrefMapModeSize, aGrfMap, MapMode(MapUnit::Map1000thInch));
398  nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width();
399  nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height();
400  }
401 
402  return basegfx::B2DSize(nGrfDPIx, nGrfDPIy);
403 }
404 
405 Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
406 {
407  Size aRet;
408 
409  if( GraphicType::Bitmap == mxImpGraphic->ImplGetType() )
410  aRet = mxImpGraphic->ImplGetSizePixel();
411  else
412  aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() );
413 
414  return aRet;
415 }
416 
418 {
419  return mxImpGraphic->ImplGetSizeBytes();
420 }
421 
422 void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const
423 {
424  mxImpGraphic->ImplDraw( pOutDev, rDestPt );
425 }
426 
428  const Point& rDestPt, const Size& rDestSz ) const
429 {
430  if( GraphicType::Default == mxImpGraphic->ImplGetType() )
431  ImplDrawDefault( pOutDev, nullptr, nullptr, nullptr, rDestPt, rDestSz );
432  else
433  mxImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz );
434 }
435 
436 void Graphic::DrawEx( OutputDevice* pOutDev, const OUString& rText,
437  vcl::Font& rFont, const BitmapEx& rBitmap,
438  const Point& rDestPt, const Size& rDestSz )
439 {
440  ImplDrawDefault( pOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz );
441 }
442 
443 void Graphic::StartAnimation( OutputDevice* pOutDev, const Point& rDestPt,
444  const Size& rDestSz, tools::Long nExtraData,
445  OutputDevice* pFirstFrameOutDev )
446 {
448  mxImpGraphic->ImplStartAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev );
449 }
450 
451 void Graphic::StopAnimation( const OutputDevice* pOutDev, tools::Long nExtraData )
452 {
454  mxImpGraphic->ImplStopAnimation( pOutDev, nExtraData );
455 }
456 
458 {
459  mxImpGraphic->ImplSetAnimationNotifyHdl( rLink );
460 }
461 
463 {
464  return mxImpGraphic->ImplGetAnimationNotifyHdl();
465 }
466 
468 {
469  return mxImpGraphic->ImplGetAnimationLoopCount();
470 }
471 
472 std::shared_ptr<GraphicReader>& Graphic::GetReaderContext()
473 {
474  return mxImpGraphic->ImplGetContext();
475 }
476 
477 void Graphic::SetReaderContext( const std::shared_ptr<GraphicReader> &pReader )
478 {
479  mxImpGraphic->ImplSetContext( pReader );
480 }
481 
482 void Graphic::SetDummyContext( bool value )
483 {
484  mxImpGraphic->ImplSetDummyContext( value );
485 }
486 
488 {
489  return mxImpGraphic->ImplIsDummyContext();
490 }
491 
492 void Graphic::SetGfxLink( const std::shared_ptr<GfxLink>& rGfxLink )
493 {
495  mxImpGraphic->ImplSetLink( rGfxLink );
496 }
497 
498 std::shared_ptr<GfxLink> Graphic::GetSharedGfxLink() const
499 {
500  return mxImpGraphic->ImplGetSharedGfxLink();
501 }
502 
504 {
505  return mxImpGraphic->ImplGetLink();
506 }
507 
508 bool Graphic::IsGfxLink() const
509 {
510  return mxImpGraphic->ImplIsLink();
511 }
512 
514 {
515  return mxImpGraphic->ImplGetChecksum();
516 }
517 
518 bool Graphic::ExportNative( SvStream& rOStream ) const
519 {
520  return mxImpGraphic->ImplExportNative( rOStream );
521 }
522 
523 void ReadGraphic(SvStream& rIStream, Graphic& rGraphic)
524 {
525  rGraphic.ImplTestRefCount();
526  ReadImpGraphic(rIStream, *rGraphic.mxImpGraphic);
527 }
528 
529 void WriteGraphic( SvStream& rOStream, const Graphic& rGraphic )
530 {
531  WriteImpGraphic(rOStream, *rGraphic.mxImpGraphic);
532 }
533 
534 const std::shared_ptr<VectorGraphicData>& Graphic::getVectorGraphicData() const
535 {
536  return mxImpGraphic->getVectorGraphicData();
537 }
538 
539 sal_Int32 Graphic::getPageNumber() const
540 {
541  return mxImpGraphic->getPageNumber();
542 }
543 
544 OUString Graphic::getOriginURL() const
545 {
546  if (mxImpGraphic)
547  {
548  return mxImpGraphic->getOriginURL();
549  }
550  return OUString();
551 }
552 
553 void Graphic::setOriginURL(OUString const & rOriginURL)
554 {
555  if (mxImpGraphic)
556  {
557  mxImpGraphic->setOriginURL(rOriginURL);
558  }
559 }
560 
561 OString Graphic::getUniqueID() const
562 {
563  OString aUniqueString;
564  if (mxImpGraphic)
565  aUniqueString = mxImpGraphic->getUniqueID();
566  return aUniqueString;
567 }
568 
569 namespace {
570 
571 struct Id: public rtl::Static<cppu::OImplementationId, Id> {};
572 
573 }
574 
575 css::uno::Sequence<sal_Int8> Graphic::getUnoTunnelId() {
576  return Id::get().getImplementationId();
577 }
578 
579 /* 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:482
const Fraction & GetScaleX() const
Definition: mapmod.cxx:172
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:795
sal_uInt64 BitmapChecksum
Definition: checksum.hxx:30
void SetFontSize(const Size &)
Definition: font/font.cxx:117
void ReadGraphic(SvStream &rIStream, Graphic &rGraphic)
Definition: graph.cxx:523
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
Definition: map.cxx:1675
bool IsNone() const
Definition: graph.cxx:278
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
Definition: graph.cxx:405
std::shared_ptr< ImpGraphic > mxImpGraphic
Definition: graph.hxx:85
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:513
bool ExportNative(SvStream &rOStream) const
Definition: graph.cxx:518
sal_uIntPtr sal_uLong
long Long
void SetPrefMapMode(const MapMode &rPrefMapMode)
Definition: graph.cxx:375
bool IsOutputEnabled() const
Definition: outdev.hxx:600
sal_Int64 n
GraphicType
Definition: graph.hxx:34
bool IsSupportedGraphic() const
Definition: graph.cxx:300
void setOriginURL(OUString const &rOriginURL)
Definition: graph.cxx:553
exports com.sun.star. graphic
SAL_DLLPRIVATE void ImplTestRefCount()
Definition: graph.cxx:231
bool IsTransparent() const
Definition: graph.cxx:305
std::shared_ptr< T > make_shared(Args &&...args)
virtual void DrawBorder(tools::Rectangle aBorderRect)
Definition: rect.cxx:32
std::shared_ptr< ImpGraphic > copy(std::shared_ptr< ImpGraphic > const &pImpGraphic)
Definition: Manager.cxx:167
static css::uno::Sequence< sal_Int8 > getUnoTunnelId()
Definition: graph.cxx:575
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
Definition: graph.cxx:345
bool IsGfxLink() const
Definition: graph.cxx:508
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1051
void Clear()
Definition: graph.cxx:283
void SetReaderContext(const std::shared_ptr< GraphicReader > &pReader)
Definition: graph.cxx:477
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:539
std::shared_ptr< GfxLink > GetSharedGfxLink() const
Definition: graph.cxx:498
const GDIMetaFile & GetGDIMetaFile() const
Definition: graph.cxx:335
bool isAvailable() const
Definition: graph.cxx:239
void SetAnimationNotifyHdl(const Link< Animation *, void > &rLink)
Definition: graph.cxx:457
void SetGfxLink(const std::shared_ptr< GfxLink > &rGfxLink)
Definition: graph.cxx:492
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:88
bool IsAnimated() const
Definition: graph.cxx:315
Animation GetAnimation() const
Definition: graph.cxx:330
OUString GetStock() const
Definition: Image.cxx:79
void SetLineColor()
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
Definition: graph.cxx:422
#define nPixel
std::shared_ptr< ImpGraphic > newInstance()
Definition: Manager.cxx:174
GraphicType GetType() const
Definition: graph.cxx:289
void ReadImpGraphic(SvStream &rIStm, ImpGraphic &rImpGraphic)
Definition: impgraph.cxx:1634
static Manager & get()
Definition: Manager.cxx:54
bool operator!=(const Graphic &rGraphic) const
Definition: graph.cxx:273
void WriteGraphic(SvStream &rOStream, const Graphic &rGraphic)
Definition: graph.cxx:529
void SetFillColor()
tools::Long Width() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:302
const BitmapEx & GetBitmapExRef() const
Gives direct access to the contained BitmapEx.
Definition: graph.cxx:340
OUString getOriginURL() const
Definition: graph.cxx:544
MapUnit GetMapUnit() const
Definition: mapmod.cxx:168
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Definition: graph.cxx:325
GfxLink GetGfxLink() const
Definition: graph.cxx:503
bool IsAlpha() const
Definition: graph.cxx:310
void WriteImpGraphic(SvStream &rOStm, const ImpGraphic &rImpGraphic)
Definition: impgraph.cxx:1793
sal_uInt32 Id
sal_uLong GetSizeBytes() const
Definition: graph.cxx:417
basegfx::B2DSize GetPPI() const
Definition: graph.cxx:381
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1186
Size GetPrefSize() const
Definition: graph.cxx:359
void StartAnimation(OutputDevice *pOutDev, const Point &rDestPt, const Size &rDestSize, tools::Long nExtraData=0, OutputDevice *pFirstFrameOutDev=nullptr)
Definition: graph.cxx:443
Link< Animation *, void > GetAnimationNotifyHdl() const
Definition: graph.cxx:462
Graphic()
Definition: graph.cxx:162
MapMode GetPrefMapMode() const
Definition: graph.cxx:370
sal_uInt32 GetAnimationLoopCount() const
Definition: graph.cxx:467
void SetFont(const vcl::Font &rNewFont)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:903
std::shared_ptr< GraphicReader > & GetReaderContext()
Definition: graph.cxx:472
OString getUniqueID() const
Definition: graph.cxx:561
void init(const ::Graphic &rGraphic)
Definition: UnoGraphic.cxx:45
Definition: image.hxx:39
tools::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:892
tools::Long Height() const
bool makeAvailable()
Definition: graph.cxx:244
double getLength(const B2DPolygon &rCandidate)
void SetPrefSize(const Size &rPrefSize)
Definition: graph.cxx:364
tools::Long AdjustHeight(tools::Long n)
void StopAnimation(const OutputDevice *pOutputDevice, tools::Long nExtraData)
Definition: graph.cxx:451
void SetDefaultType()
Definition: graph.cxx:294
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
Definition: graph.cxx:534
const Size & GetSizePixel() const
Definition: bitmapex.hxx:84
Graphic & operator=(const Graphic &rGraphic)
Definition: graph.cxx:249
bool operator==(const Graphic &rGraphic) const
Definition: graph.cxx:268
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:436
Reference< XGraphic > xGraphic
bool IsDummyContext() const
Definition: graph.cxx:487
bool IsEPS() const
Definition: graph.cxx:320