LibreOffice Module svx (master) 1
graphctl.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 <config_wasm_strip.h>
21
22#include <svl/itempool.hxx>
23#include <vcl/settings.hxx>
24#include <vcl/ptrstyle.hxx>
25#include <vcl/svapp.hxx>
26
27#include <svx/graphctl.hxx>
30#include <svx/svxids.hrc>
31#include <svx/svdpage.hxx>
33
34void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& /*rOldBoundRect*/ )
35{
36 switch( eType )
37 {
40 rWin.SdrObjChanged( rObj );
41 break;
42
44 rWin.SdrObjCreated( rObj );
45 break;
46
47 default:
48 break;
49 }
51}
52
54 : aUpdateIdle("svx GraphCtrl Update")
55 , aMap100(MapUnit::Map100thMM)
56 , eObjKind(SdrObjKind::NONE)
57 , nPolyEdit(0)
58 , bEditMode(false)
59 , mbSdrMode(false)
60 , mbInIdleUpdate(false)
61 , mpDialog(pDialog)
62{
63 pUserCall.reset(new GraphCtrlUserCall( *this ));
64 aUpdateIdle.SetPriority( TaskPriority::LOWEST );
65 aUpdateIdle.SetInvokeHandler( LINK( this, GraphCtrl, UpdateHdl ) );
67}
68
70{
72 EnableRTL(false);
73}
74
76{
78
79#if !ENABLE_WASM_STRIP_ACCESSIBILITY
80 if( mpAccContext.is() )
81 {
82 mpAccContext->disposing();
83 mpAccContext.clear();
84 }
85#endif
86
87 pView.reset();
88 pModel.reset();
89 pUserCall.reset();
90}
91
92void GraphCtrl::SetSdrMode(bool bSdrMode)
93{
94 mbSdrMode = bSdrMode;
95
98 rDevice.SetBackground( Wallpaper( rStyleSettings.GetWindowColor() ) );
99 xVD->SetBackground( Wallpaper( rStyleSettings.GetWindowColor() ) );
100 rDevice.SetMapMode( aMap100 );
101 xVD->SetMapMode( aMap100 );
102
103 pView.reset();
104 pModel.reset();
105
106 if ( mbSdrMode )
107 InitSdrModel();
108
110}
111
113{
114 SolarMutexGuard aGuard;
115
117
118 // destroy old junk
119 pView.reset();
120 pModel.reset();
121
122 // Creating a Model
123 pModel.reset(new SdrModel(nullptr, nullptr, true));
124 pModel->GetItemPool().FreezeIdRanges();
125 pModel->SetScaleUnit(aMap100.GetMapUnit());
126 pModel->SetDefaultFontHeight( 500 );
127
128 pPage = new SdrPage( *pModel );
129
130 pPage->SetSize( aGraphSize );
131 pPage->SetBorder( 0, 0, 0, 0 );
132 pModel->InsertPage( pPage.get() );
133 pModel->SetChanged( false );
134
135 // Creating a View
136 pView.reset(new GraphCtrlView(*pModel, this));
137 pView->SetWorkArea( tools::Rectangle( Point(), aGraphSize ) );
138 pView->EnableExtendedMouseEventDispatcher( true );
139 pView->ShowSdrPage(pView->GetModel().GetPage(0));
140 pView->SetFrameDragSingles();
141 pView->SetMarkedPointsSmooth( SdrPathSmoothKind::Symmetric );
142 pView->SetEditMode();
143
144 // #i72889# set needed flags
145 pView->SetPageDecorationAllowed(false);
146 pView->SetMasterPageVisualizationAllowed(false);
147 pView->SetBufferedOutputAllowed(true);
148 pView->SetBufferedOverlayAllowed(true);
149
150#if !ENABLE_WASM_STRIP_ACCESSIBILITY
151 // Tell the accessibility object about the changes.
152 if (mpAccContext.is())
153 mpAccContext->setModelAndView (pModel.get(), pView.get());
154#endif
155}
156
157void GraphCtrl::SetGraphic( const Graphic& rGraphic, bool bNewModel )
158{
159 aGraphic = rGraphic;
160 xVD->SetOutputSizePixel(Size(0, 0)); //force redraw
161
162 if ( aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
164 else
166
167 if ( mbSdrMode && bNewModel )
168 InitSdrModel();
169
170 aGraphSizeLink.Call( this );
171
172 Resize();
173
174 Invalidate();
176}
177
179{
181 xVD->SetOutputSizePixel(GetOutputSizePixel());
182 xVD->SetBackground(rDevice.GetBackground());
183 xVD->Erase();
184 const bool bGraphicValid(GraphicType::NONE != aGraphic.GetType());
185 if (bGraphicValid)
187}
188
190{
192
194 {
195 MapMode aDisplayMap( aMap100 );
196 Point aNewPos;
197 Size aNewSize;
199 const Size aWinSize = rDevice.PixelToLogic( GetOutputSizePixel(), aDisplayMap );
200 const tools::Long nWidth = aWinSize.Width();
201 const tools::Long nHeight = aWinSize.Height();
202 double fGrfWH = static_cast<double>(aGraphSize.Width()) / aGraphSize.Height();
203 double fWinWH = static_cast<double>(nWidth) / nHeight;
204
205 // Adapt Bitmap to Thumb size
206 if ( fGrfWH < fWinWH)
207 {
208 aNewSize.setWidth( static_cast<tools::Long>( static_cast<double>(nHeight) * fGrfWH ) );
209 aNewSize.setHeight( nHeight );
210 }
211 else
212 {
213 aNewSize.setWidth( nWidth );
214 aNewSize.setHeight( static_cast<tools::Long>( static_cast<double>(nWidth) / fGrfWH ) );
215 }
216
217 aNewPos.setX( ( nWidth - aNewSize.Width() ) >> 1 );
218 aNewPos.setY( ( nHeight - aNewSize.Height() ) >> 1 );
219
220 // Implementing MapMode for Engine
221 aDisplayMap.SetScaleX( Fraction( aNewSize.Width(), aGraphSize.Width() ) );
222 aDisplayMap.SetScaleY( Fraction( aNewSize.Height(), aGraphSize.Height() ) );
223
224 aDisplayMap.SetOrigin( OutputDevice::LogicToLogic( aNewPos, aMap100, aDisplayMap ) );
225 rDevice.SetMapMode( aDisplayMap );
226 xVD->SetMapMode( aDisplayMap );
227 }
228
229 Invalidate();
230}
231
232void GraphCtrl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
233{
234 // #i72889# used split repaint to be able to paint an own background
235 // even to the buffered view
236 const bool bGraphicValid(GraphicType::NONE != aGraphic.GetType());
237
238 if (GetOutputSizePixel() != xVD->GetOutputSizePixel())
239 GraphicToVD();
240
241 if (mbSdrMode)
242 {
243 SdrPaintWindow* pPaintWindow = pView->BeginCompleteRedraw(&rRenderContext);
244 pPaintWindow->SetOutputToWindow(true);
245
246 if (bGraphicValid)
247 {
249
251 rTarget.SetBackground(rDevice.GetBackground());
252 rTarget.Erase();
253
254 rTarget.DrawOutDev(Point(), xVD->GetOutputSize(), Point(), xVD->GetOutputSize(), *xVD);
255 }
256
257 const vcl::Region aRepaintRegion(rRect);
258 pView->DoCompleteRedraw(*pPaintWindow, aRepaintRegion);
259 pView->EndCompleteRedraw(*pPaintWindow, true);
260 }
261 else
262 {
263 // #i73381# in non-SdrMode, paint to local directly
264 rRenderContext.DrawOutDev(rRect.TopLeft(), rRect.GetSize(),
265 rRect.TopLeft(), rRect.GetSize(),
266 *xVD);
267 }
268}
269
271{
273}
274
276{
278}
279
281{
283}
284
285bool GraphCtrl::KeyInput( const KeyEvent& rKEvt )
286{
287 vcl::KeyCode aCode( rKEvt.GetKeyCode() );
288 bool bProc = false;
289
291
292 switch ( aCode.GetCode() )
293 {
294 case KEY_DELETE:
295 case KEY_BACKSPACE:
296 {
297 if ( mbSdrMode )
298 {
299 pView->DeleteMarked();
300 bProc = true;
301 }
302 }
303 break;
304
305 case KEY_ESCAPE:
306 {
307 if ( mbSdrMode )
308 {
309 if ( pView->IsAction() )
310 {
311 pView->BrkAction();
312 bProc = true;
313 }
314 else if ( pView->AreObjectsMarked() )
315 {
316 pView->UnmarkAllObj();
317 bProc = true;
318 }
319 }
320 }
321 break;
322
323 case KEY_F11:
324 case KEY_TAB:
325 {
326 if( mbSdrMode )
327 {
328 if( !aCode.IsMod1() && !aCode.IsMod2() )
329 {
330 bool bForward = !aCode.IsShift();
331 // select next object
332 if ( ! pView->MarkNextObj( bForward ))
333 {
334 // At first or last object. Cycle to the other end
335 // of the list.
336 pView->UnmarkAllObj();
337 pView->MarkNextObj (bForward);
338 }
339 bProc = true;
340 }
341 else if(aCode.IsMod1())
342 {
343 // select next handle
344 const SdrHdlList& rHdlList = pView->GetHdlList();
345 bool bForward(!aCode.IsShift());
346
347 const_cast<SdrHdlList&>(rHdlList).TravelFocusHdl(bForward);
348
349 bProc = true;
350 }
351 }
352 }
353 break;
354
355 case KEY_END:
356 {
357
358 if ( aCode.IsMod1() )
359 {
360 // mark last object
361 pView->UnmarkAllObj();
362 pView->MarkNextObj();
363
364 bProc = true;
365 }
366 }
367 break;
368
369 case KEY_HOME:
370 {
371 if ( aCode.IsMod1() )
372 {
373 pView->UnmarkAllObj();
374 pView->MarkNextObj(true);
375
376 bProc = true;
377 }
378 }
379 break;
380
381 case KEY_UP:
382 case KEY_DOWN:
383 case KEY_LEFT:
384 case KEY_RIGHT:
385 {
386 tools::Long nX = 0;
387 tools::Long nY = 0;
388
389 if (aCode.GetCode() == KEY_UP)
390 {
391 // Scroll up
392 nX = 0;
393 nY =-1;
394 }
395 else if (aCode.GetCode() == KEY_DOWN)
396 {
397 // Scroll down
398 nX = 0;
399 nY = 1;
400 }
401 else if (aCode.GetCode() == KEY_LEFT)
402 {
403 // Scroll left
404 nX =-1;
405 nY = 0;
406 }
407 else if (aCode.GetCode() == KEY_RIGHT)
408 {
409 // Scroll right
410 nX = 1;
411 nY = 0;
412 }
413
414 if (pView->AreObjectsMarked() && !aCode.IsMod1() )
415 {
416 if(aCode.IsMod2())
417 {
418 // move in 1 pixel distance
419 Size aLogicSizeOnePixel = rDevice.PixelToLogic(Size(1,1));
420 nX *= aLogicSizeOnePixel.Width();
421 nY *= aLogicSizeOnePixel.Height();
422 }
423 else
424 {
425 // old, fixed move distance
426 nX *= 100;
427 nY *= 100;
428 }
429
430 // II
431 const SdrHdlList& rHdlList = pView->GetHdlList();
432 SdrHdl* pHdl = rHdlList.GetFocusHdl();
433
434 if(nullptr == pHdl)
435 {
436 // restrict movement to WorkArea
437 const tools::Rectangle& rWorkArea = pView->GetWorkArea();
438
439 if(!rWorkArea.IsEmpty())
440 {
441 tools::Rectangle aMarkRect(pView->GetMarkedObjRect());
442 aMarkRect.Move(nX, nY);
443
444 if(!aMarkRect.Contains(rWorkArea))
445 {
446 if(aMarkRect.Left() < rWorkArea.Left())
447 {
448 nX += rWorkArea.Left() - aMarkRect.Left();
449 }
450
451 if(aMarkRect.Right() > rWorkArea.Right())
452 {
453 nX -= aMarkRect.Right() - rWorkArea.Right();
454 }
455
456 if(aMarkRect.Top() < rWorkArea.Top())
457 {
458 nY += rWorkArea.Top() - aMarkRect.Top();
459 }
460
461 if(aMarkRect.Bottom() > rWorkArea.Bottom())
462 {
463 nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
464 }
465 }
466 }
467
468 // no handle selected
469 if(0 != nX || 0 != nY)
470 {
471 pView->MoveAllMarked(Size(nX, nY));
472 }
473 }
474 else
475 {
476 // move handle with index nHandleIndex
477 if (nX || nY)
478 {
479 // now move the Handle (nX, nY)
480 Point aStartPoint(pHdl->GetPos());
481 Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
482 const SdrDragStat& rDragStat = pView->GetDragStat();
483
484 // start dragging
485 pView->BegDragObj(aStartPoint, nullptr, pHdl, 0);
486
487 if(pView->IsDragObj())
488 {
489 bool bWasNoSnap = rDragStat.IsNoSnap();
490 bool bWasSnapEnabled = pView->IsSnapEnabled();
491
492 // switch snapping off
493 if(!bWasNoSnap)
494 const_cast<SdrDragStat&>(rDragStat).SetNoSnap();
495 if(bWasSnapEnabled)
496 pView->SetSnapEnabled(false);
497
498 pView->MovAction(aEndPoint);
499 pView->EndDragObj();
500
501 // restore snap
502 if(!bWasNoSnap)
503 const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap);
504 if(bWasSnapEnabled)
505 pView->SetSnapEnabled(bWasSnapEnabled);
506 }
507 }
508 }
509
510 bProc = true;
511 }
512 }
513 break;
514
515 case KEY_SPACE:
516 {
517 const SdrHdlList& rHdlList = pView->GetHdlList();
518 SdrHdl* pHdl = rHdlList.GetFocusHdl();
519
520 if(pHdl)
521 {
522 if(pHdl->GetKind() == SdrHdlKind::Poly)
523 {
524 // rescue ID of point with focus
525 sal_uInt32 nPol(pHdl->GetPolyNum());
526 sal_uInt32 nPnt(pHdl->GetPointNum());
527
528 if(pView->IsPointMarked(*pHdl))
529 {
530 if(rKEvt.GetKeyCode().IsShift())
531 {
532 pView->UnmarkPoint(*pHdl);
533 }
534 }
535 else
536 {
537 if(!rKEvt.GetKeyCode().IsShift())
538 {
539 pView->UnmarkAllPoints();
540 }
541
542 pView->MarkPoint(*pHdl);
543 }
544
545 if(nullptr == rHdlList.GetFocusHdl())
546 {
547 // restore point with focus
548 SdrHdl* pNewOne = nullptr;
549
550 for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a)
551 {
552 SdrHdl* pAct = rHdlList.GetHdl(a);
553
554 if(pAct
555 && pAct->GetKind() == SdrHdlKind::Poly
556 && pAct->GetPolyNum() == nPol
557 && pAct->GetPointNum() == nPnt)
558 {
559 pNewOne = pAct;
560 }
561 }
562
563 if(pNewOne)
564 {
565 const_cast<SdrHdlList&>(rHdlList).SetFocusHdl(pNewOne);
566 }
567 }
568
569 bProc = true;
570 }
571 }
572 }
573 break;
574
575 default:
576 break;
577 }
578
579 if (bProc)
580 ReleaseMouse();
581
583
584 return bProc;
585}
586
588{
589 if ( mbSdrMode && ( rMEvt.GetClicks() < 2 ) )
590 {
592
593 const Point aLogPt( rDevice.PixelToLogic( rMEvt.GetPosPixel() ) );
594
595 if ( !tools::Rectangle( Point(), aGraphSize ).Contains( aLogPt ) && !pView->IsEditMode() )
597 else
598 {
599 // Get Focus for key inputs
600 GrabFocus();
601
602 if ( nPolyEdit )
603 {
604 SdrViewEvent aVEvt;
605 SdrHitKind eHit = pView->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt );
606
607 if ( nPolyEdit == SID_BEZIER_INSERT && eHit == SdrHitKind::MarkedObject )
608 pView->BegInsObjPoint( aLogPt, rMEvt.IsMod1());
609 else
610 pView->MouseButtonDown( rMEvt, &rDevice );
611 }
612 else
613 pView->MouseButtonDown( rMEvt, &rDevice );
614 }
615
616 SdrObject* pCreateObj = pView->GetCreateObj();
617
618 // We want to realize the insert
619 if ( pCreateObj && !pCreateObj->GetUserCall() )
620 pCreateObj->SetUserCall( pUserCall.get() );
621
622 SetPointer( pView->GetPreferredPointer( aLogPt, &rDevice ) );
623 }
624 else
626
628
629 return false;
630}
631
633{
635 const Point aLogPos( rDevice.PixelToLogic( rMEvt.GetPosPixel() ) );
636
637 if ( mbSdrMode )
638 {
639 pView->MouseMove( rMEvt, &rDevice );
640
641 if( ( SID_BEZIER_INSERT == nPolyEdit ) &&
642 !pView->PickHandle( aLogPos ) &&
643 !pView->IsInsObjPoint() )
644 {
645 SetPointer( PointerStyle::Cross );
646 }
647 else
648 SetPointer( pView->GetPreferredPointer( aLogPos, &rDevice ) );
649 }
650 else
652
653 if ( aMousePosLink.IsSet() )
654 {
655 if ( tools::Rectangle( Point(), aGraphSize ).Contains( aLogPos ) )
656 aMousePos = aLogPos;
657 else
658 aMousePos = Point();
659
660 aMousePosLink.Call( this );
661 }
662
664
665 return false;
666}
667
669{
670 if ( mbSdrMode )
671 {
673
674 if ( pView->IsInsObjPoint() )
675 pView->EndInsObjPoint( SdrCreateCmd::ForceEnd );
676 else
677 pView->MouseButtonUp( rMEvt, &rDevice );
678
679 ReleaseMouse();
680 SetPointer( pView->GetPreferredPointer( rDevice.PixelToLogic( rMEvt.GetPosPixel() ), &rDevice ) );
681 }
682 else
684
686
687 return false;
688}
689
691{
692 SdrObject* pSdrObj = nullptr;
693
694 if ( mbSdrMode )
695 {
696 const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
697
698 if ( rMarkList.GetMarkCount() == 1 )
699 pSdrObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
700 }
701
702 return pSdrObj;
703}
704
705void GraphCtrl::SetEditMode( const bool _bEditMode )
706{
707 if ( mbSdrMode )
708 {
709 bEditMode = _bEditMode;
710 pView->SetEditMode( bEditMode );
712 pView->SetCurrentObj(eObjKind);
713 }
714 else
715 bEditMode = false;
716
718}
719
720void GraphCtrl::SetPolyEditMode( const sal_uInt16 _nPolyEdit )
721{
722 if ( mbSdrMode && ( _nPolyEdit != nPolyEdit ) )
723 {
724 nPolyEdit = _nPolyEdit;
725 pView->SetFrameDragSingles( nPolyEdit == 0 );
726 }
727 else
728 nPolyEdit = 0;
729
731}
732
733void GraphCtrl::SetObjKind( const SdrObjKind _eObjKind )
734{
735 if ( mbSdrMode )
736 {
737 bEditMode = false;
738 pView->SetEditMode( bEditMode );
739 eObjKind = _eObjKind;
740 pView->SetCurrentObj(eObjKind);
741 }
742 else
744
746}
747
748IMPL_LINK_NOARG(GraphCtrl, UpdateHdl, Timer *, void)
749{
750 mbInIdleUpdate = true;
751 aUpdateLink.Call( this );
752 mbInIdleUpdate = false;
753}
754
756{
757 if (!mbInIdleUpdate)
759}
760
761namespace
762{
763 class WeldOverlayManager final : public sdr::overlay::OverlayManager
764 {
765 weld::CustomWidgetController& m_rGraphCtrl;
766
767 public:
768 WeldOverlayManager(weld::CustomWidgetController& rGraphCtrl, OutputDevice& rDevice)
769 : OverlayManager(rDevice)
770 , m_rGraphCtrl(rGraphCtrl)
771 {
772 }
773
774 // invalidate the given range at local OutputDevice
775 virtual void invalidateRange(const basegfx::B2DRange& rRange) override
776 {
777 tools::Rectangle aInvalidateRectangle(RangeToInvalidateRectangle(rRange));
778 m_rGraphCtrl.Invalidate(aInvalidateRectangle);
779 }
780 };
781}
782
784{
785 assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
786 if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
787 {
788 rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager(new WeldOverlayManager(rGraphCtrl, rDevice));
789 InitOverlayManager(xOverlayManager);
790 return xOverlayManager;
791 }
792 return SdrView::CreateOverlayManager(rDevice);
793}
794
796{
797 assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
798 if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
799 {
801 return;
802 }
804}
805
807{
808 assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
809 if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
810 {
811 rGraphCtrl.Invalidate(rArea);
812 return;
813 }
814 SdrView::InvalidateOneWin(rDevice, rArea);
815}
816
818{
819 // turn SetOutputToWindow back off again before
820 // turning back into our baseclass during dtoring
821 const sal_uInt32 nWindowCount(PaintWindowCount());
822 for (sal_uInt32 nWinNum(0); nWinNum < nWindowCount; nWinNum++)
823 {
824 SdrPaintWindow* pPaintWindow = GetPaintWindow(nWinNum);
825 pPaintWindow->SetOutputToWindow(false);
826 }
827}
828
830{
831 int x, y, width, height;
832 if (GetDrawingArea()->get_extents_relative_to(*mpDialog, x, y, width, height))
833 return Point(x, y);
834 return Point();
835}
836
837css::uno::Reference< css::accessibility::XAccessible > GraphCtrl::CreateAccessible()
838{
839#if !ENABLE_WASM_STRIP_ACCESSIBILITY
840 if(mpAccContext == nullptr )
841 {
842 // Disable accessibility if no model/view data available
843 if (pView && pModel)
845 }
846#endif
847 return mpAccContext;
848}
849
850/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const StyleSettings & GetStyleSettings() const
static OutputDevice * GetDefaultDevice()
static const AllSettings & GetSettings()
GraphCtrl & rWin
Definition: graphctl.hxx:33
virtual void Changed(const SdrObject &rObj, SdrUserCallType eType, const tools::Rectangle &rOldBoundRect) override
Definition: graphctl.cxx:34
virtual void InvalidateOneWin(OutputDevice &rWin) override
If the View should not call Invalidate() on the windows, override the following 2 methods and do some...
Definition: graphctl.cxx:795
virtual rtl::Reference< sdr::overlay::OverlayManager > CreateOverlayManager(OutputDevice &rDevice) const override
Definition: graphctl.cxx:783
virtual ~GraphCtrlView() override
Definition: graphctl.cxx:817
GraphCtrl & rGraphCtrl
Definition: graphctl.hxx:133
SdrObject * GetSelectedSdrObject() const
Definition: graphctl.cxx:690
weld::Dialog * mpDialog
Definition: graphctl.hxx:66
ScopedVclPtrInstance< VirtualDevice > xVD
Definition: graphctl.hxx:52
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: graphctl.cxx:668
bool bEditMode
Definition: graphctl.hxx:63
bool mbInIdleUpdate
Definition: graphctl.hxx:65
friend class GraphCtrlUserCall
Definition: graphctl.hxx:49
void SetSdrMode(bool b)
Definition: graphctl.cxx:92
Size aGraphSize
Definition: graphctl.hxx:58
std::unique_ptr< GraphCtrlUserCall > pUserCall
Definition: graphctl.hxx:60
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Definition: graphctl.cxx:837
virtual void Resize() override
Definition: graphctl.cxx:189
virtual bool KeyInput(const KeyEvent &rKEvt) override
Definition: graphctl.cxx:285
MapMode aMap100
Definition: graphctl.hxx:57
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: graphctl.cxx:587
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: graphctl.cxx:69
void SetPolyEditMode(const sal_uInt16 nPolyEdit)
Definition: graphctl.cxx:720
virtual ~GraphCtrl() override
Definition: graphctl.cxx:75
std::unique_ptr< SdrView > pView
Definition: graphctl.hxx:75
Point GetPositionInDialog() const
Definition: graphctl.cxx:829
bool mbSdrMode
Definition: graphctl.hxx:64
GraphCtrl(weld::Dialog *pDialog)
Definition: graphctl.cxx:53
std::unique_ptr< SdrModel > pModel
Definition: graphctl.hxx:74
void QueueIdleUpdate()
Definition: graphctl.cxx:755
void SetEditMode(const bool bEditMode)
Definition: graphctl.cxx:705
virtual void MarkListHasChanged()
Definition: graphctl.cxx:280
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: graphctl.cxx:232
Idle aUpdateIdle
Definition: graphctl.hxx:53
virtual void SdrObjChanged(const SdrObject &rObj)
Definition: graphctl.cxx:270
SdrObjKind eObjKind
Definition: graphctl.hxx:61
Point aMousePos
Definition: graphctl.hxx:59
Link< GraphCtrl *, void > aMousePosLink
Definition: graphctl.hxx:54
void GraphicToVD()
Definition: graphctl.cxx:178
void SetGraphic(const Graphic &rGraphic, bool bNewModel=true)
Definition: graphctl.cxx:157
Link< GraphCtrl *, void > aGraphSizeLink
Definition: graphctl.hxx:55
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: graphctl.cxx:632
void SetObjKind(const SdrObjKind eObjKind)
Definition: graphctl.cxx:733
virtual void InitSdrModel()
Definition: graphctl.cxx:112
rtl::Reference< SvxGraphCtrlAccessibleContext > mpAccContext
Definition: graphctl.hxx:70
sal_uInt16 nPolyEdit
Definition: graphctl.hxx:62
virtual void SdrObjCreated(const SdrObject &rObj)
Definition: graphctl.cxx:275
Graphic aGraphic
Definition: graphctl.hxx:51
friend class GraphCtrlView
Definition: graphctl.hxx:48
Size GetPrefSize() const
GraphicType GetType() const
MapMode GetPrefMapMode() const
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
virtual void Start(bool bStartTimer=true) override
const vcl::KeyCode & GetKeyCode() const
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
MapUnit GetMapUnit() const
void SetScaleX(const Fraction &rScaleX)
bool IsMod1() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
const Wallpaper & GetBackground() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetMapMode()
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
void SetBackground()
OutDevType GetOutDevType() const
void setX(tools::Long nX)
void setY(tools::Long nY)
bool IsNoSnap() const
Definition: svddrag.hxx:130
size_t GetHdlCount() const
Definition: svdhdl.hxx:459
SdrHdl * GetFocusHdl() const
Definition: svdhdl.cxx:2129
SdrHdl * GetHdl(size_t nNum) const
Definition: svdhdl.hxx:460
SdrHdlKind GetKind() const
Definition: svdhdl.hxx:194
sal_uInt32 GetPolyNum() const
Definition: svdhdl.hxx:219
const Point & GetPos() const
Definition: svdhdl.hxx:197
sal_uInt32 GetPointNum() const
Definition: svdhdl.hxx:222
size_t GetMarkCount() const
Definition: svdmark.hxx:178
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:230
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
Abstract DrawObject.
Definition: svdobj.hxx:260
SdrObjUserCall * GetUserCall() const
Definition: svdobj.hxx:837
void SetUserCall(SdrObjUserCall *pUser)
Definition: svdobj.cxx:2757
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
Definition: svdpntv.cxx:75
virtual rtl::Reference< sdr::overlay::OverlayManager > CreateOverlayManager(OutputDevice &rDevice) const
virtual void InvalidateOneWin(OutputDevice &rWin)
If the View should not call Invalidate() on the windows, override the following 2 methods and do some...
Definition: svdpntv.cxx:865
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:241
static void InitOverlayManager(rtl::Reference< sdr::overlay::OverlayManager > xOverlayManager)
OutputDevice & GetTargetOutputDevice()
void SetOutputToWindow(bool bOutputToWindow)
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetWindowColor() const
void SetPriority(TaskPriority ePriority)
void Stop()
void SetInvokeHandler(const Link< Timer *, void > &rLink)
tools::Rectangle RangeToInvalidateRectangle(const basegfx::B2DRange &rRange) const
virtual void invalidateRange(const basegfx::B2DRange &rRange)
bool Contains(const Point &rPOINT) const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr Size GetSize() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
bool IsMod1() const
sal_uInt16 GetCode() const
bool IsShift() const
bool IsMod2() const
void SetPointer(PointerStyle ePointerStyle)
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
virtual bool MouseButtonDown(const MouseEvent &)
weld::DrawingArea * GetDrawingArea() const
void EnableRTL(bool bEnable)
virtual bool MouseButtonUp(const MouseEvent &)
Size const & GetOutputSizePixel() const
virtual OutputDevice & get_ref_device()=0
float y
float x
FilterGroup & rTarget
DocumentType eType
IMPL_LINK_NOARG(GraphCtrl, UpdateHdl, Timer *, void)
Definition: graphctl.cxx:748
uno_Any a
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
constexpr sal_uInt16 KEY_F11
constexpr sal_uInt16 KEY_BACKSPACE
constexpr sal_uInt16 KEY_END
MapUnit
NONE
long Long
OUTDEV_VIRDEV
SdrHitKind
Definition: svdmrkv.hxx:58
SdrUserCallType
Definition: svdobj.hxx:112
SdrObjKind
Definition: svdobjkind.hxx:25