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>
28 #include <graphic/UnoGraphic.hxx>
30 
31 using namespace ::com::sun::star;
32 
33 namespace
34 {
35 
36 void ImplDrawDefault(OutputDevice& rOutDev, const OUString* pText,
37  vcl::Font* pFont, const BitmapEx* pBitmapEx,
38  const Point& rDestPt, const Size& rDestSize)
39 {
40  sal_uInt16 nPixel = static_cast<sal_uInt16>(rOutDev.PixelToLogic( Size( 1, 1 ) ).Width());
41  sal_uInt16 nPixelWidth = nPixel;
42  Point aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
43  Size aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) );
44  bool bFilled = ( pBitmapEx != nullptr || pFont != nullptr );
45  tools::Rectangle aBorderRect( aPoint, aSize );
46 
47  rOutDev.Push();
48 
49  rOutDev.SetFillColor();
50 
51  // On the printer a black rectangle and on the screen one with 3D effect
52  rOutDev.DrawBorder(aBorderRect);
53 
54  aPoint.AdjustX(nPixelWidth + 2*nPixel );
55  aPoint.AdjustY(nPixelWidth + 2*nPixel );
56  aSize.AdjustWidth( -(2*nPixelWidth + 4*nPixel) );
57  aSize.AdjustHeight( -(2*nPixelWidth + 4*nPixel) );
58 
59  if( !aSize.IsEmpty() && pBitmapEx && !pBitmapEx->IsEmpty() )
60  {
61  Size aBitmapSize( rOutDev.PixelToLogic( pBitmapEx->GetSizePixel() ) );
62 
63  if( aSize.Height() > aBitmapSize.Height() && aSize.Width() > aBitmapSize.Width() )
64  {
65  rOutDev.DrawBitmapEx( aPoint, *pBitmapEx );
66  aPoint.AdjustX(aBitmapSize.Width() + 2*nPixel );
67  aSize.AdjustWidth( -(aBitmapSize.Width() + 2*nPixel) );
68  }
69  }
70 
71  if ( !aSize.IsEmpty() && pFont && pText && pText->getLength() && rOutDev.IsOutputEnabled() )
72  {
73  MapMode aMapMode( MapUnit::MapPoint );
74  Size aSz = rOutDev.LogicToLogic( Size( 0, 12 ), &aMapMode, nullptr );
75  tools::Long nThreshold = aSz.Height() / 2;
76  tools::Long nStep = nThreshold / 3;
77 
78  if ( !nStep )
79  nStep = aSz.Height() - nThreshold;
80 
81  for(;; aSz.AdjustHeight( -nStep ) )
82  {
83  pFont->SetFontSize( aSz );
84  rOutDev.SetFont( *pFont );
85 
86  tools::Long nTextHeight = rOutDev.GetTextHeight();
87  tools::Long nTextWidth = rOutDev.GetTextWidth( *pText );
88  if ( nTextHeight )
89  {
90  // The approximation does not respect imprecisions caused
91  // by word wraps
92  tools::Long nLines = aSize.Height() / nTextHeight;
93  tools::Long nWidth = aSize.Width() * nLines; // Approximation!!!
94 
95  if ( nTextWidth <= nWidth || aSz.Height() <= nThreshold )
96  {
97  sal_Int32 nStart = 0;
98  sal_Int32 nLen = 0;
99 
100  while( nStart < pText->getLength() && (*pText)[nStart] == ' ' )
101  nStart++;
102  while( nStart+nLen < pText->getLength() && (*pText)[nStart+nLen] != ' ' )
103  nLen++;
104  while( nStart < pText->getLength() && nLines-- )
105  {
106  sal_Int32 nNext = nLen;
107  do
108  {
109  while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] == ' ' )
110  nNext++;
111  while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] != ' ' )
112  nNext++;
113  nTextWidth = rOutDev.GetTextWidth( *pText, nStart, nNext );
114  if ( nTextWidth > aSize.Width() )
115  break;
116  nLen = nNext;
117  }
118  while ( nStart+nNext < pText->getLength() );
119 
120  sal_Int32 n = nLen;
121  nTextWidth = rOutDev.GetTextWidth( *pText, nStart, n );
122  while( nTextWidth > aSize.Width() )
123  nTextWidth = rOutDev.GetTextWidth( *pText, nStart, --n );
124  rOutDev.DrawText( aPoint, *pText, nStart, n );
125 
126  aPoint.AdjustY(nTextHeight );
127  nStart = sal::static_int_cast<sal_uInt16>(nStart + nLen);
128  nLen = nNext-nLen;
129  while( nStart < pText->getLength() && (*pText)[nStart] == ' ' )
130  {
131  nStart++;
132  nLen--;
133  }
134  }
135  break;
136  }
137  }
138  else
139  break;
140  }
141  }
142 
143  // If the default graphic does not have content, we draw a red rectangle
144  if( !bFilled )
145  {
146  aBorderRect.AdjustLeft( 1 );
147  aBorderRect.AdjustTop( 1 );
148  aBorderRect.AdjustRight( -1 );
149  aBorderRect.AdjustBottom( -1 );
150 
151  rOutDev.SetLineColor( COL_LIGHTRED );
152  rOutDev.DrawLine( aBorderRect.TopLeft(), aBorderRect.BottomRight() );
153  rOutDev.DrawLine( aBorderRect.TopRight(), aBorderRect.BottomLeft() );
154  }
155 
156  rOutDev.Pop();
157 }
158 
159 } // end anonymous namespace
160 
162  : mxImpGraphic(vcl::graphic::Manager::get().newInstance())
163 {
164 }
165 
166 Graphic::Graphic(const Graphic& rGraphic)
167 {
168  if( rGraphic.IsAnimated() )
170  else
171  mxImpGraphic = rGraphic.mxImpGraphic;
172 }
173 
174 Graphic::Graphic(Graphic&& rGraphic) noexcept
175  : mxImpGraphic(std::move(rGraphic.mxImpGraphic))
176 {
177 }
178 
179 Graphic::Graphic(std::shared_ptr<GfxLink> const & rGfxLink, sal_Int32 nPageIndex)
180  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rGfxLink, nPageIndex))
181 {
182 }
183 
184 Graphic::Graphic(GraphicExternalLink const & rGraphicExternalLink)
185  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rGraphicExternalLink))
186 {
187 }
188 
190  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rBmpEx))
191 {
192 }
193 
194 // We use XGraphic for passing toolbar images across app UNO aps
195 // and we need to be able to see and preserve 'stock' images too.
196 Graphic::Graphic(const Image& rImage)
197  // FIXME: should really defer the BitmapEx load.
198  : mxImpGraphic(std::make_shared<ImpGraphic>(rImage.GetBitmapEx()))
199 {
200  OUString aStock = rImage.GetStock();
201  if (aStock.getLength())
202  mxImpGraphic->setOriginURL("private:graphicrepository/" + aStock);
203 }
204 
205 Graphic::Graphic(const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr)
206  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rVectorGraphicDataPtr))
207 {
208 }
209 
210 Graphic::Graphic(const Animation& rAnimation)
211  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rAnimation))
212 {
213 }
214 
216  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rMtf))
217 {
218 }
219 
220 Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic )
221 {
222  const ::Graphic* pGraphic = comphelper::getFromUnoTunnel<::Graphic>(rxGraphic);
223 
224  if( pGraphic )
225  {
226  if (pGraphic->IsAnimated())
227  mxImpGraphic = vcl::graphic::Manager::get().copy(pGraphic->mxImpGraphic);
228  else
229  mxImpGraphic = pGraphic->mxImpGraphic;
230  }
231  else
233 }
234 
236 {
237  if (mxImpGraphic.use_count() > 1)
238  {
240  }
241 }
242 
244 {
245  return mxImpGraphic->isAvailable();
246 }
247 
249 {
250  return mxImpGraphic->makeAvailable();
251 }
252 
253 Graphic& Graphic::operator=( const Graphic& rGraphic )
254 {
255  if( &rGraphic != this )
256  {
257  if( rGraphic.IsAnimated() )
259  else
260  mxImpGraphic = rGraphic.mxImpGraphic;
261  }
262 
263  return *this;
264 }
265 
266 Graphic& Graphic::operator=(Graphic&& rGraphic) noexcept
267 {
268  mxImpGraphic = std::move(rGraphic.mxImpGraphic);
269  return *this;
270 }
271 
272 bool Graphic::operator==( const Graphic& rGraphic ) const
273 {
274  return (*mxImpGraphic == *rGraphic.mxImpGraphic);
275 }
276 
277 bool Graphic::operator!=( const Graphic& rGraphic ) const
278 {
279  return (*mxImpGraphic != *rGraphic.mxImpGraphic);
280 }
281 
282 bool Graphic::IsNone() const
283 {
284  return GraphicType::NONE == mxImpGraphic->getType();
285 }
286 
288 {
290  mxImpGraphic->clear();
291 }
292 
294 {
295  return mxImpGraphic->getType();
296 }
297 
299 {
301  mxImpGraphic->setDefaultType();
302 }
303 
305 {
306  return mxImpGraphic->isSupportedGraphic();
307 }
308 
310 {
311  return mxImpGraphic->isTransparent();
312 }
313 
314 bool Graphic::IsAlpha() const
315 {
316  return mxImpGraphic->isAlpha();
317 }
318 
320 {
321  return mxImpGraphic->isAnimated();
322 }
323 
324 bool Graphic::IsEPS() const
325 {
326  return mxImpGraphic->isEPS();
327 }
328 
330 {
331  return mxImpGraphic->getBitmapEx(rParameters);
332 }
333 
335 {
336  return mxImpGraphic->getAnimation();
337 }
338 
340 {
341  return mxImpGraphic->getGDIMetaFile();
342 }
343 
345 {
346  return mxImpGraphic->getBitmapExRef();
347 }
348 
349 uno::Reference<css::graphic::XGraphic> Graphic::GetXGraphic() const
350 {
351  uno::Reference<css::graphic::XGraphic> xGraphic;
352 
353  if (GetType() != GraphicType::NONE)
354  {
356  pUnoGraphic->init(*this);
357  xGraphic = pUnoGraphic;
358  }
359 
360  return xGraphic;
361 }
362 
364 {
365  return mxImpGraphic->getPrefSize();
366 }
367 
368 void Graphic::SetPrefSize( const Size& rPrefSize )
369 {
371  mxImpGraphic->setPrefSize( rPrefSize );
372 }
373 
375 {
376  return mxImpGraphic->getPrefMapMode();
377 }
378 
379 void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode )
380 {
382  mxImpGraphic->setPrefMapMode( rPrefMapMode );
383 }
384 
386 {
387  double nGrfDPIx;
388  double nGrfDPIy;
389 
390  const MapMode aGrfMap(GetPrefMapMode());
391  const Size aGrfPixelSize(GetSizePixel());
392  const Size aGrfPrefMapModeSize(GetPrefSize());
393  if (aGrfMap.GetMapUnit() == MapUnit::MapInch)
394  {
395  nGrfDPIx = aGrfPixelSize.Width() / ( static_cast<double>(aGrfMap.GetScaleX()) * aGrfPrefMapModeSize.Width() );
396  nGrfDPIy = aGrfPixelSize.Height() / ( static_cast<double>(aGrfMap.GetScaleY()) * aGrfPrefMapModeSize.Height() );
397  }
398  else
399  {
400  const Size aGrf1000thInchSize = OutputDevice::LogicToLogic(
401  aGrfPrefMapModeSize, aGrfMap, MapMode(MapUnit::Map1000thInch));
402  nGrfDPIx = aGrf1000thInchSize.Width() == 0
403  ? 0.0 : 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width();
404  nGrfDPIy = aGrf1000thInchSize.Height() == 0
405  ? 0.0 : 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height();
406  }
407 
408  return basegfx::B2DSize(nGrfDPIx, nGrfDPIy);
409 }
410 
411 Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
412 {
413  Size aRet;
414 
415  if( GraphicType::Bitmap == mxImpGraphic->getType() )
416  aRet = mxImpGraphic->getSizePixel();
417  else
418  aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() );
419 
420  return aRet;
421 }
422 
424 {
425  return mxImpGraphic->getSizeBytes();
426 }
427 
428 void Graphic::Draw(OutputDevice& rOutDev, const Point& rDestPt) const
429 {
430  mxImpGraphic->draw(rOutDev, rDestPt);
431 }
432 
433 void Graphic::Draw(OutputDevice& rOutDev, const Point& rDestPt,
434  const Size& rDestSz) const
435 {
436  if( GraphicType::Default == mxImpGraphic->getType() )
437  ImplDrawDefault(rOutDev, nullptr, nullptr, nullptr, rDestPt, rDestSz);
438  else
439  mxImpGraphic->draw(rOutDev, rDestPt, rDestSz);
440 }
441 
442 void Graphic::DrawEx(OutputDevice& rOutDev, const OUString& rText,
443  vcl::Font& rFont, const BitmapEx& rBitmap,
444  const Point& rDestPt, const Size& rDestSz)
445 {
446  ImplDrawDefault(rOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz);
447 }
448 
449 void Graphic::StartAnimation(OutputDevice& rOutDev, const Point& rDestPt,
450  const Size& rDestSz, tools::Long nExtraData,
451  OutputDevice* pFirstFrameOutDev)
452 {
454  mxImpGraphic->startAnimation(rOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev);
455 }
456 
457 void Graphic::StopAnimation( const OutputDevice* pOutDev, tools::Long nExtraData )
458 {
460  mxImpGraphic->stopAnimation( pOutDev, nExtraData );
461 }
462 
464 {
465  mxImpGraphic->setAnimationNotifyHdl( rLink );
466 }
467 
469 {
470  return mxImpGraphic->getAnimationNotifyHdl();
471 }
472 
474 {
475  return mxImpGraphic->getAnimationLoopCount();
476 }
477 
478 std::shared_ptr<GraphicReader>& Graphic::GetReaderContext()
479 {
480  return mxImpGraphic->getContext();
481 }
482 
483 void Graphic::SetReaderContext( const std::shared_ptr<GraphicReader> &pReader )
484 {
485  mxImpGraphic->setContext( pReader );
486 }
487 
488 void Graphic::SetDummyContext( bool value )
489 {
490  mxImpGraphic->setDummyContext( value );
491 }
492 
494 {
495  return mxImpGraphic->isDummyContext();
496 }
497 
498 void Graphic::SetGfxLink( const std::shared_ptr<GfxLink>& rGfxLink )
499 {
501  mxImpGraphic->setGfxLink(rGfxLink);
502 }
503 
504 const std::shared_ptr<GfxLink> & Graphic::GetSharedGfxLink() const
505 {
506  return mxImpGraphic->getSharedGfxLink();
507 }
508 
510 {
511  return mxImpGraphic->getGfxLink();
512 }
513 
514 bool Graphic::IsGfxLink() const
515 {
516  return mxImpGraphic->isGfxLink();
517 }
518 
520 {
521  return mxImpGraphic->getChecksum();
522 }
523 
524 const std::shared_ptr<VectorGraphicData>& Graphic::getVectorGraphicData() const
525 {
526  return mxImpGraphic->getVectorGraphicData();
527 }
528 
529 sal_Int32 Graphic::getPageNumber() const
530 {
531  return mxImpGraphic->getPageNumber();
532 }
533 
534 OUString Graphic::getOriginURL() const
535 {
536  if (mxImpGraphic)
537  {
538  return mxImpGraphic->getOriginURL();
539  }
540  return OUString();
541 }
542 
543 void Graphic::setOriginURL(OUString const & rOriginURL)
544 {
545  if (mxImpGraphic)
546  {
547  mxImpGraphic->setOriginURL(rOriginURL);
548  }
549 }
550 
551 OString Graphic::getUniqueID() const
552 {
553  OString aUniqueString;
554  if (mxImpGraphic)
555  aUniqueString = mxImpGraphic->getUniqueID();
556  return aUniqueString;
557 }
558 
559 css::uno::Sequence<sal_Int8> Graphic::getUnoTunnelId() {
560  static const comphelper::UnoIdInit gId;
561  return gId.getSeq();
562 }
563 
564 /* 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:488
BitmapEx GetBitmapEx(BitmapEx const &rBitmapEx, DrawModeFlags nDrawMode)
Definition: drawmode.cxx:224
const Fraction & GetScaleX() const
Definition: mapmod.cxx:142
void StartAnimation(OutputDevice &rOutDev, const Point &rDestPt, const Size &rDestSize, tools::Long nExtraData=0, OutputDevice *pFirstFrameOutDev=nullptr)
Definition: graph.cxx:449
sal_uInt64 BitmapChecksum
Definition: checksum.hxx:30
void SetFontSize(const Size &)
Definition: font/font.cxx:127
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
Definition: map.cxx:1564
bool IsNone() const
Definition: graph.cxx:282
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
Definition: graph.cxx:411
std::shared_ptr< ImpGraphic > mxImpGraphic
Definition: graph.hxx:85
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
Definition: bitmapex.cxx:33
BitmapChecksum GetChecksum() const
Definition: graph.cxx:519
sal_uIntPtr sal_uLong
long Long
void SetPrefMapMode(const MapMode &rPrefMapMode)
Definition: graph.cxx:379
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
Definition: stack.cxx:33
bool IsOutputEnabled() const
Definition: outdev.hxx:476
sal_Int64 n
GraphicType
Definition: graph.hxx:34
bool IsSupportedGraphic() const
Definition: graph.cxx:304
void setOriginURL(OUString const &rOriginURL)
Definition: graph.cxx:543
exports com.sun.star. graphic
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
Definition: graph.cxx:428
SAL_DLLPRIVATE void ImplTestRefCount()
Definition: graph.cxx:235
bool IsTransparent() const
Definition: graph.cxx:309
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:208
static css::uno::Sequence< sal_Int8 > getUnoTunnelId()
Definition: graph.cxx:559
const std::shared_ptr< GfxLink > & GetSharedGfxLink() const
Definition: graph.cxx:504
bool IsGfxLink() const
Definition: graph.cxx:514
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1069
constexpr tools::Long Width() const
void Clear()
Definition: graph.cxx:287
void SetReaderContext(const std::shared_ptr< GraphicReader > &pReader)
Definition: graph.cxx:483
const Fraction & GetScaleY() const
Definition: mapmod.cxx:144
B2DVector B2DSize
sal_Int32 getPageNumber() const
Get the page number of the multi-page source this Graphic is rendered from.
Definition: graph.cxx:529
const GDIMetaFile & GetGDIMetaFile() const
Definition: graph.cxx:339
void Pop()
Definition: stack.cxx:92
bool isAvailable() const
Definition: graph.cxx:243
void SetAnimationNotifyHdl(const Link< Animation *, void > &rLink)
Definition: graph.cxx:463
void SetGfxLink(const std::shared_ptr< GfxLink > &rGfxLink)
Definition: graph.cxx:498
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:160
bool IsAnimated() const
Definition: graph.cxx:319
Animation GetAnimation() const
Definition: graph.cxx:334
const css::uno::Sequence< sal_Int8 > & getSeq() const
OUString GetStock() const
Definition: Image.cxx:79
bool IsEmpty() const
Definition: BitmapEx.cxx:177
void SetLineColor()
Definition: line.cxx:36
#define nPixel
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: text.cxx:863
std::shared_ptr< ImpGraphic > newInstance()
Definition: Manager.cxx:215
GraphicType GetType() const
Definition: graph.cxx:293
static Manager & get()
Definition: Manager.cxx:54
bool operator!=(const Graphic &rGraphic) const
Definition: graph.cxx:277
void SetFillColor()
Definition: fill.cxx:29
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:168
const BitmapEx & GetBitmapExRef() const
Gives direct access to the contained BitmapEx.
Definition: graph.cxx:344
OUString getOriginURL() const
Definition: graph.cxx:534
MapUnit GetMapUnit() const
Definition: mapmod.cxx:138
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Definition: graph.cxx:329
GfxLink GetGfxLink() const
Definition: graph.cxx:509
bool IsAlpha() const
Definition: graph.cxx:314
sal_uLong GetSizeBytes() const
Definition: graph.cxx:423
basegfx::B2DSize GetPPI() const
Definition: graph.cxx:385
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1109
Size GetPrefSize() const
Definition: graph.cxx:363
Link< Animation *, void > GetAnimationNotifyHdl() const
Definition: graph.cxx:468
Graphic()
Definition: graph.cxx:161
MapMode GetPrefMapMode() const
Definition: graph.cxx:374
constexpr tools::Long Height() const
static void DrawEx(OutputDevice &rOutDev, const OUString &rText, vcl::Font &rFont, const BitmapEx &rBitmap, const Point &rDestPt, const Size &rDestSize)
Definition: graph.cxx:442
sal_uInt32 GetAnimationLoopCount() const
Definition: graph.cxx:473
void SetFont(const vcl::Font &rNewFont)
Definition: outdev/font.cxx:53
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:874
std::shared_ptr< GraphicReader > & GetReaderContext()
Definition: graph.cxx:478
OString getUniqueID() const
Definition: graph.cxx:551
Definition: image.hxx:39
bool makeAvailable()
Definition: graph.cxx:248
double getLength(const B2DPolygon &rCandidate)
void SetPrefSize(const Size &rPrefSize)
Definition: graph.cxx:368
tools::Long AdjustHeight(tools::Long n)
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
Definition: graph.cxx:349
void StopAnimation(const OutputDevice *pOutputDevice, tools::Long nExtraData)
Definition: graph.cxx:457
void SetDefaultType()
Definition: graph.cxx:298
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
Definition: graph.cxx:524
const Size & GetSizePixel() const
Definition: bitmapex.hxx:73
Graphic & operator=(const Graphic &rGraphic)
Definition: graph.cxx:253
bool operator==(const Graphic &rGraphic) const
Definition: graph.cxx:272
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
Definition: text.cxx:774
bool IsDummyContext() const
Definition: graph.cxx:493
bool IsEPS() const
Definition: graph.cxx:324