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  long nThreshold = aSz.Height() / 2;
77  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  long nTextHeight = pOutDev->GetTextHeight();
88  long nTextWidth = pOutDev->GetTextWidth( *pText );
89  if ( nTextHeight )
90  {
91  // The approximation does not respect imprecisions caused
92  // by word wraps
93  long nLines = aSize.Height() / nTextHeight;
94  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(rBmp))
187 {
188 }
189 
191  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rBmpEx))
192 {
193 }
194 
195 // We use XGraphic for passing toolbar images across app UNO aps
196 // and we need to be able to see and preserve 'stock' images too.
197 Graphic::Graphic(const Image& rImage)
198  // FIXME: should really defer the BitmapEx load.
199  : mxImpGraphic(std::make_shared<ImpGraphic>(rImage.GetBitmapEx()))
200 {
201  OUString aStock = rImage.GetStock();
202  if (aStock.getLength())
203  mxImpGraphic->setOriginURL("private:graphicrepository/" + aStock);
204 }
205 
206 Graphic::Graphic(const std::shared_ptr<VectorGraphicData>& rVectorGraphicDataPtr)
207  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rVectorGraphicDataPtr))
208 {
209 }
210 
211 Graphic::Graphic(const Animation& rAnimation)
212  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rAnimation))
213 {
214 }
215 
217  : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rMtf))
218 {
219 }
220 
221 Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic )
222 {
223  const ::Graphic* pGraphic = comphelper::getUnoTunnelImplementation<::Graphic>(rxGraphic);
224 
225  if( pGraphic )
226  {
227  if (pGraphic->IsAnimated())
228  mxImpGraphic = vcl::graphic::Manager::get().copy(pGraphic->mxImpGraphic);
229  else
230  mxImpGraphic = pGraphic->mxImpGraphic;
231  }
232  else
234 }
235 
237 {
238  if (mxImpGraphic.use_count() > 1)
239  {
241  }
242 }
243 
245 {
246  return mxImpGraphic->isAvailable();
247 }
248 
250 {
251  return mxImpGraphic->makeAvailable();
252 }
253 
254 Graphic& Graphic::operator=( const Graphic& rGraphic )
255 {
256  if( &rGraphic != this )
257  {
258  if( rGraphic.IsAnimated() )
260  else
261  mxImpGraphic = rGraphic.mxImpGraphic;
262  }
263 
264  return *this;
265 }
266 
267 Graphic& Graphic::operator=(Graphic&& rGraphic) noexcept
268 {
269  mxImpGraphic = std::move(rGraphic.mxImpGraphic);
270  return *this;
271 }
272 
273 bool Graphic::operator==( const Graphic& rGraphic ) const
274 {
275  return (*mxImpGraphic == *rGraphic.mxImpGraphic);
276 }
277 
278 bool Graphic::operator!=( const Graphic& rGraphic ) const
279 {
280  return (*mxImpGraphic != *rGraphic.mxImpGraphic);
281 }
282 
283 bool Graphic::IsNone() const
284 {
285  return GraphicType::NONE == mxImpGraphic->ImplGetType();
286 }
287 
289 {
291  mxImpGraphic->ImplClear();
292 }
293 
295 {
296  return mxImpGraphic->ImplGetType();
297 }
298 
300 {
302  mxImpGraphic->ImplSetDefaultType();
303 }
304 
306 {
307  return mxImpGraphic->ImplIsSupportedGraphic();
308 }
309 
311 {
312  return mxImpGraphic->ImplIsTransparent();
313 }
314 
315 bool Graphic::IsAlpha() const
316 {
317  return mxImpGraphic->ImplIsAlpha();
318 }
319 
321 {
322  return mxImpGraphic->ImplIsAnimated();
323 }
324 
325 bool Graphic::IsEPS() const
326 {
327  return mxImpGraphic->ImplIsEPS();
328 }
329 
331 {
332  return mxImpGraphic->ImplGetBitmapEx(rParameters);
333 }
334 
336 {
337  return mxImpGraphic->ImplGetAnimation();
338 }
339 
341 {
342  return mxImpGraphic->ImplGetGDIMetaFile();
343 }
344 
346 {
347  return mxImpGraphic->ImplGetBitmapExRef();
348 }
349 
350 uno::Reference<graphic::XGraphic> Graphic::GetXGraphic() const
351 {
352  uno::Reference<graphic::XGraphic> xGraphic;
353 
354  if (GetType() != GraphicType::NONE)
355  {
356  unographic::Graphic* pUnoGraphic = new unographic::Graphic;
357  pUnoGraphic->init(*this);
358  xGraphic = pUnoGraphic;
359  }
360 
361  return xGraphic;
362 }
363 
365 {
366  return mxImpGraphic->ImplGetPrefSize();
367 }
368 
369 void Graphic::SetPrefSize( const Size& rPrefSize )
370 {
372  mxImpGraphic->ImplSetPrefSize( rPrefSize );
373 }
374 
376 {
377  return mxImpGraphic->ImplGetPrefMapMode();
378 }
379 
380 void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode )
381 {
383  mxImpGraphic->ImplSetPrefMapMode( rPrefMapMode );
384 }
385 
387 {
388  double nGrfDPIx;
389  double nGrfDPIy;
390 
391  const MapMode aGrfMap(GetPrefMapMode());
392  const Size aGrfPixelSize(GetSizePixel());
393  const Size aGrfPrefMapModeSize(GetPrefSize());
394  if (aGrfMap.GetMapUnit() == MapUnit::MapInch)
395  {
396  nGrfDPIx = aGrfPixelSize.Width() / ( static_cast<double>(aGrfMap.GetScaleX()) * aGrfPrefMapModeSize.Width() );
397  nGrfDPIy = aGrfPixelSize.Height() / ( static_cast<double>(aGrfMap.GetScaleY()) * aGrfPrefMapModeSize.Height() );
398  }
399  else
400  {
401  const Size aGrf1000thInchSize = OutputDevice::LogicToLogic(
402  aGrfPrefMapModeSize, aGrfMap, MapMode(MapUnit::Map1000thInch));
403  nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width();
404  nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height();
405  }
406 
407  return basegfx::B2DSize(nGrfDPIx, nGrfDPIy);
408 }
409 
410 Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
411 {
412  Size aRet;
413 
414  if( GraphicType::Bitmap == mxImpGraphic->ImplGetType() )
415  aRet = mxImpGraphic->ImplGetSizePixel();
416  else
417  aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() );
418 
419  return aRet;
420 }
421 
423 {
424  return mxImpGraphic->ImplGetSizeBytes();
425 }
426 
427 void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const
428 {
429  mxImpGraphic->ImplDraw( pOutDev, rDestPt );
430 }
431 
433  const Point& rDestPt, const Size& rDestSz ) const
434 {
435  if( GraphicType::Default == mxImpGraphic->ImplGetType() )
436  ImplDrawDefault( pOutDev, nullptr, nullptr, nullptr, rDestPt, rDestSz );
437  else
438  mxImpGraphic->ImplDraw( pOutDev, rDestPt, rDestSz );
439 }
440 
441 void Graphic::DrawEx( OutputDevice* pOutDev, const OUString& rText,
442  vcl::Font& rFont, const BitmapEx& rBitmap,
443  const Point& rDestPt, const Size& rDestSz )
444 {
445  ImplDrawDefault( pOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz );
446 }
447 
448 void Graphic::StartAnimation( OutputDevice* pOutDev, const Point& rDestPt,
449  const Size& rDestSz, long nExtraData,
450  OutputDevice* pFirstFrameOutDev )
451 {
453  mxImpGraphic->ImplStartAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev );
454 }
455 
456 void Graphic::StopAnimation( OutputDevice* pOutDev, long nExtraData )
457 {
459  mxImpGraphic->ImplStopAnimation( pOutDev, nExtraData );
460 }
461 
463 {
464  mxImpGraphic->ImplSetAnimationNotifyHdl( rLink );
465 }
466 
468 {
469  return mxImpGraphic->ImplGetAnimationNotifyHdl();
470 }
471 
473 {
474  return mxImpGraphic->ImplGetAnimationLoopCount();
475 }
476 
477 std::shared_ptr<GraphicReader>& Graphic::GetReaderContext()
478 {
479  return mxImpGraphic->ImplGetContext();
480 }
481 
482 void Graphic::SetReaderContext( const std::shared_ptr<GraphicReader> &pReader )
483 {
484  mxImpGraphic->ImplSetContext( pReader );
485 }
486 
487 void Graphic::SetDummyContext( bool value )
488 {
489  mxImpGraphic->ImplSetDummyContext( value );
490 }
491 
493 {
494  return mxImpGraphic->ImplIsDummyContext();
495 }
496 
497 void Graphic::SetGfxLink( const std::shared_ptr<GfxLink>& rGfxLink )
498 {
500  mxImpGraphic->ImplSetLink( rGfxLink );
501 }
502 
503 std::shared_ptr<GfxLink> Graphic::GetSharedGfxLink() const
504 {
505  return mxImpGraphic->ImplGetSharedGfxLink();
506 }
507 
509 {
510  return mxImpGraphic->ImplGetLink();
511 }
512 
513 bool Graphic::IsGfxLink() const
514 {
515  return mxImpGraphic->ImplIsLink();
516 }
517 
519 {
520  return mxImpGraphic->ImplGetChecksum();
521 }
522 
523 bool Graphic::ExportNative( SvStream& rOStream ) const
524 {
525  return mxImpGraphic->ImplExportNative( rOStream );
526 }
527 
528 void ReadGraphic(SvStream& rIStream, Graphic& rGraphic)
529 {
530  rGraphic.ImplTestRefCount();
531  ReadImpGraphic(rIStream, *rGraphic.mxImpGraphic);
532 }
533 
534 void WriteGraphic( SvStream& rOStream, const Graphic& rGraphic )
535 {
536  WriteImpGraphic(rOStream, *rGraphic.mxImpGraphic);
537 }
538 
539 const std::shared_ptr<VectorGraphicData>& Graphic::getVectorGraphicData() const
540 {
541  return mxImpGraphic->getVectorGraphicData();
542 }
543 
544 sal_Int32 Graphic::getPageNumber() const
545 {
546  return mxImpGraphic->getPageNumber();
547 }
548 
549 OUString Graphic::getOriginURL() const
550 {
551  if (mxImpGraphic)
552  {
553  return mxImpGraphic->getOriginURL();
554  }
555  return OUString();
556 }
557 
558 void Graphic::setOriginURL(OUString const & rOriginURL)
559 {
560  if (mxImpGraphic)
561  {
562  mxImpGraphic->setOriginURL(rOriginURL);
563  }
564 }
565 
566 OString Graphic::getUniqueID() const
567 {
568  OString aUniqueString;
569  if (mxImpGraphic)
570  aUniqueString = mxImpGraphic->getUniqueID();
571  return aUniqueString;
572 }
573 
574 namespace {
575 
576 struct Id: public rtl::Static<cppu::OImplementationId, Id> {};
577 
578 }
579 
580 css::uno::Sequence<sal_Int8> Graphic::getUnoTunnelId() {
581  return Id::get().getImplementationId();
582 }
583 
584 /* 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:487
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:787
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:528
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
Definition: map.cxx:1676
bool IsNone() const
Definition: graph.cxx:283
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
Definition: graph.cxx:410
long Height() const
std::shared_ptr< ImpGraphic > mxImpGraphic
Definition: graph.hxx:86
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:518
bool ExportNative(SvStream &rOStream) const
Definition: graph.cxx:523
sal_uIntPtr sal_uLong
void SetPrefMapMode(const MapMode &rPrefMapMode)
Definition: graph.cxx:380
bool IsOutputEnabled() const
Definition: outdev.hxx:600
sal_Int64 n
GraphicType
Definition: graph.hxx:35
bool IsSupportedGraphic() const
Definition: graph.cxx:305
void setOriginURL(OUString const &rOriginURL)
Definition: graph.cxx:558
exports com.sun.star. graphic
SAL_DLLPRIVATE void ImplTestRefCount()
Definition: graph.cxx:236
bool IsTransparent() const
Definition: graph.cxx:310
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
long AdjustHeight(long n)
static css::uno::Sequence< sal_Int8 > getUnoTunnelId()
Definition: graph.cxx:580
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
Definition: graph.cxx:350
bool IsGfxLink() const
Definition: graph.cxx:513
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1060
void Clear()
Definition: graph.cxx:288
void SetReaderContext(const std::shared_ptr< GraphicReader > &pReader)
Definition: graph.cxx:482
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:544
std::shared_ptr< GfxLink > GetSharedGfxLink() const
Definition: graph.cxx:503
const GDIMetaFile & GetGDIMetaFile() const
Definition: graph.cxx:340
bool isAvailable() const
Definition: graph.cxx:244
void StopAnimation(OutputDevice *pOutputDevice, long nExtraData)
Definition: graph.cxx:456
void SetAnimationNotifyHdl(const Link< Animation *, void > &rLink)
Definition: graph.cxx:462
void SetGfxLink(const std::shared_ptr< GfxLink > &rGfxLink)
Definition: graph.cxx:497
void DrawLine(const Point &rStartPt, const Point &rEndPt)
Definition: line.cxx:88
bool IsAnimated() const
Definition: graph.cxx:320
Animation GetAnimation() const
Definition: graph.cxx:335
OUString GetStock() const
Definition: Image.cxx:79
void SetLineColor()
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
Definition: graph.cxx:427
#define nPixel
std::shared_ptr< ImpGraphic > newInstance()
Definition: Manager.cxx:174
GraphicType GetType() const
Definition: graph.cxx:294
void ReadImpGraphic(SvStream &rIStm, ImpGraphic &rImpGraphic)
Definition: impgraph.cxx:1621
static Manager & get()
Definition: Manager.cxx:54
bool operator!=(const Graphic &rGraphic) const
Definition: graph.cxx:278
void WriteGraphic(SvStream &rOStream, const Graphic &rGraphic)
Definition: graph.cxx:534
void SetFillColor()
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:345
void StartAnimation(OutputDevice *pOutDev, const Point &rDestPt, const Size &rDestSize, long nExtraData=0, OutputDevice *pFirstFrameOutDev=nullptr)
Definition: graph.cxx:448
OUString getOriginURL() const
Definition: graph.cxx:549
MapUnit GetMapUnit() const
Definition: mapmod.cxx:168
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Definition: graph.cxx:330
GfxLink GetGfxLink() const
Definition: graph.cxx:508
bool IsAlpha() const
Definition: graph.cxx:315
void WriteImpGraphic(SvStream &rOStm, const ImpGraphic &rImpGraphic)
Definition: impgraph.cxx:1780
sal_uInt32 Id
long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:895
sal_uLong GetSizeBytes() const
Definition: graph.cxx:422
basegfx::B2DSize GetPPI() const
Definition: graph.cxx:386
Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1187
Size GetPrefSize() const
Definition: graph.cxx:364
Link< Animation *, void > GetAnimationNotifyHdl() const
Definition: graph.cxx:467
Graphic()
Definition: graph.cxx:162
MapMode GetPrefMapMode() const
Definition: graph.cxx:375
sal_uInt32 GetAnimationLoopCount() const
Definition: graph.cxx:472
void SetFont(const vcl::Font &rNewFont)
std::shared_ptr< GraphicReader > & GetReaderContext()
Definition: graph.cxx:477
OString getUniqueID() const
Definition: graph.cxx:566
void init(const ::Graphic &rGraphic)
Definition: UnoGraphic.cxx:45
Definition: image.hxx:39
bool makeAvailable()
Definition: graph.cxx:249
double getLength(const B2DPolygon &rCandidate)
void SetPrefSize(const Size &rPrefSize)
Definition: graph.cxx:369
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:884
void SetDefaultType()
Definition: graph.cxx:299
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
Definition: graph.cxx:539
const Size & GetSizePixel() const
Definition: bitmapex.hxx:83
Graphic & operator=(const Graphic &rGraphic)
Definition: graph.cxx:254
bool operator==(const Graphic &rGraphic) const
Definition: graph.cxx:273
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:441
Reference< XGraphic > xGraphic
bool IsDummyContext() const
Definition: graph.cxx:492
bool IsEPS() const
Definition: graph.cxx:325