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->SetPagePaintingAllowed(false);
146 pView->SetBufferedOutputAllowed(true);
147 pView->SetBufferedOverlayAllowed(true);
148
149#if !ENABLE_WASM_STRIP_ACCESSIBILITY
150 // Tell the accessibility object about the changes.
151 if (mpAccContext.is())
152 mpAccContext->setModelAndView (pModel.get(), pView.get());
153#endif
154}
155
156void GraphCtrl::SetGraphic( const Graphic& rGraphic, bool bNewModel )
157{
158 aGraphic = rGraphic;
159 xVD->SetOutputSizePixel(Size(0, 0)); //force redraw
160
161 if ( aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
163 else
165
166 if ( mbSdrMode && bNewModel )
167 InitSdrModel();
168
169 aGraphSizeLink.Call( this );
170
171 Resize();
172
173 Invalidate();
175}
176
178{
180 xVD->SetOutputSizePixel(GetOutputSizePixel());
181 xVD->SetBackground(rDevice.GetBackground());
182 xVD->Erase();
183 const bool bGraphicValid(GraphicType::NONE != aGraphic.GetType());
184 if (bGraphicValid)
186}
187
189{
191
193 {
194 MapMode aDisplayMap( aMap100 );
195 Point aNewPos;
196 Size aNewSize;
198 const Size aWinSize = rDevice.PixelToLogic( GetOutputSizePixel(), aDisplayMap );
199 const tools::Long nWidth = aWinSize.Width();
200 const tools::Long nHeight = aWinSize.Height();
201 double fGrfWH = static_cast<double>(aGraphSize.Width()) / aGraphSize.Height();
202 double fWinWH = static_cast<double>(nWidth) / nHeight;
203
204 // Adapt Bitmap to Thumb size
205 if ( fGrfWH < fWinWH)
206 {
207 aNewSize.setWidth( static_cast<tools::Long>( static_cast<double>(nHeight) * fGrfWH ) );
208 aNewSize.setHeight( nHeight );
209 }
210 else
211 {
212 aNewSize.setWidth( nWidth );
213 aNewSize.setHeight( static_cast<tools::Long>( static_cast<double>(nWidth) / fGrfWH ) );
214 }
215
216 aNewPos.setX( ( nWidth - aNewSize.Width() ) >> 1 );
217 aNewPos.setY( ( nHeight - aNewSize.Height() ) >> 1 );
218
219 // Implementing MapMode for Engine
220 aDisplayMap.SetScaleX( Fraction( aNewSize.Width(), aGraphSize.Width() ) );
221 aDisplayMap.SetScaleY( Fraction( aNewSize.Height(), aGraphSize.Height() ) );
222
223 aDisplayMap.SetOrigin( OutputDevice::LogicToLogic( aNewPos, aMap100, aDisplayMap ) );
224 rDevice.SetMapMode( aDisplayMap );
225 xVD->SetMapMode( aDisplayMap );
226 }
227
228 Invalidate();
229}
230
231void GraphCtrl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
232{
233 // #i72889# used split repaint to be able to paint an own background
234 // even to the buffered view
235 const bool bGraphicValid(GraphicType::NONE != aGraphic.GetType());
236
237 if (GetOutputSizePixel() != xVD->GetOutputSizePixel())
238 GraphicToVD();
239
240 if (mbSdrMode)
241 {
242 SdrPaintWindow* pPaintWindow = pView->BeginCompleteRedraw(&rRenderContext);
243 pPaintWindow->SetOutputToWindow(true);
244
245 if (bGraphicValid)
246 {
248
250 rTarget.SetBackground(rDevice.GetBackground());
251 rTarget.Erase();
252
253 rTarget.DrawOutDev(Point(), xVD->GetOutputSize(), Point(), xVD->GetOutputSize(), *xVD);
254 }
255
256 const vcl::Region aRepaintRegion(rRect);
257 pView->DoCompleteRedraw(*pPaintWindow, aRepaintRegion);
258 pView->EndCompleteRedraw(*pPaintWindow, true);
259 }
260 else
261 {
262 // #i73381# in non-SdrMode, paint to local directly
263 rRenderContext.DrawOutDev(rRect.TopLeft(), rRect.GetSize(),
264 rRect.TopLeft(), rRect.GetSize(),
265 *xVD);
266 }
267}
268
270{
272}
273
275{
277}
278
280{
282}
283
284bool GraphCtrl::KeyInput( const KeyEvent& rKEvt )
285{
286 vcl::KeyCode aCode( rKEvt.GetKeyCode() );
287 bool bProc = false;
288
290
291 switch ( aCode.GetCode() )
292 {
293 case KEY_DELETE:
294 case KEY_BACKSPACE:
295 {
296 if ( mbSdrMode )
297 {
298 pView->DeleteMarked();
299 bProc = true;
300 }
301 }
302 break;
303
304 case KEY_ESCAPE:
305 {
306 if ( mbSdrMode )
307 {
308 if ( pView->IsAction() )
309 {
310 pView->BrkAction();
311 bProc = true;
312 }
313 else if ( pView->AreObjectsMarked() )
314 {
315 pView->UnmarkAllObj();
316 bProc = true;
317 }
318 }
319 }
320 break;
321
322 case KEY_F11:
323 case KEY_TAB:
324 {
325 if( mbSdrMode )
326 {
327 if( !aCode.IsMod1() && !aCode.IsMod2() )
328 {
329 bool bForward = !aCode.IsShift();
330 // select next object
331 if ( ! pView->MarkNextObj( bForward ))
332 {
333 // At first or last object. Cycle to the other end
334 // of the list.
335 pView->UnmarkAllObj();
336 pView->MarkNextObj (bForward);
337 }
338 bProc = true;
339 }
340 else if(aCode.IsMod1())
341 {
342 // select next handle
343 const SdrHdlList& rHdlList = pView->GetHdlList();
344 bool bForward(!aCode.IsShift());
345
346 const_cast<SdrHdlList&>(rHdlList).TravelFocusHdl(bForward);
347
348 bProc = true;
349 }
350 }
351 }
352 break;
353
354 case KEY_END:
355 {
356
357 if ( aCode.IsMod1() )
358 {
359 // mark last object
360 pView->UnmarkAllObj();
361 pView->MarkNextObj();
362
363 bProc = true;
364 }
365 }
366 break;
367
368 case KEY_HOME:
369 {
370 if ( aCode.IsMod1() )
371 {
372 pView->UnmarkAllObj();
373 pView->MarkNextObj(true);
374
375 bProc = true;
376 }
377 }
378 break;
379
380 case KEY_UP:
381 case KEY_DOWN:
382 case KEY_LEFT:
383 case KEY_RIGHT:
384 {
385 tools::Long nX = 0;
386 tools::Long nY = 0;
387
388 if (aCode.GetCode() == KEY_UP)
389 {
390 // Scroll up
391 nX = 0;
392 nY =-1;
393 }
394 else if (aCode.GetCode() == KEY_DOWN)
395 {
396 // Scroll down
397 nX = 0;
398 nY = 1;
399 }
400 else if (aCode.GetCode() == KEY_LEFT)
401 {
402 // Scroll left
403 nX =-1;
404 nY = 0;
405 }
406 else if (aCode.GetCode() == KEY_RIGHT)
407 {
408 // Scroll right
409 nX = 1;
410 nY = 0;
411 }
412
413 if (pView->AreObjectsMarked() && !aCode.IsMod1() )
414 {
415 if(aCode.IsMod2())
416 {
417 // move in 1 pixel distance
418 Size aLogicSizeOnePixel = rDevice.PixelToLogic(Size(1,1));
419 nX *= aLogicSizeOnePixel.Width();
420 nY *= aLogicSizeOnePixel.Height();
421 }
422 else
423 {
424 // old, fixed move distance
425 nX *= 100;
426 nY *= 100;
427 }
428
429 // II
430 const SdrHdlList& rHdlList = pView->GetHdlList();
431 SdrHdl* pHdl = rHdlList.GetFocusHdl();
432
433 if(nullptr == pHdl)
434 {
435 // restrict movement to WorkArea
436 const tools::Rectangle& rWorkArea = pView->GetWorkArea();
437
438 if(!rWorkArea.IsEmpty())
439 {
440 tools::Rectangle aMarkRect(pView->GetMarkedObjRect());
441 aMarkRect.Move(nX, nY);
442
443 if(!aMarkRect.Contains(rWorkArea))
444 {
445 if(aMarkRect.Left() < rWorkArea.Left())
446 {
447 nX += rWorkArea.Left() - aMarkRect.Left();
448 }
449
450 if(aMarkRect.Right() > rWorkArea.Right())
451 {
452 nX -= aMarkRect.Right() - rWorkArea.Right();
453 }
454
455 if(aMarkRect.Top() < rWorkArea.Top())
456 {
457 nY += rWorkArea.Top() - aMarkRect.Top();
458 }
459
460 if(aMarkRect.Bottom() > rWorkArea.Bottom())
461 {
462 nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
463 }
464 }
465 }
466
467 // no handle selected
468 if(0 != nX || 0 != nY)
469 {
470 pView->MoveAllMarked(Size(nX, nY));
471 }
472 }
473 else
474 {
475 // move handle with index nHandleIndex
476 if (nX || nY)
477 {
478 // now move the Handle (nX, nY)
479 Point aStartPoint(pHdl->GetPos());
480 Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
481 const SdrDragStat& rDragStat = pView->GetDragStat();
482
483 // start dragging
484 pView->BegDragObj(aStartPoint, nullptr, pHdl, 0);
485
486 if(pView->IsDragObj())
487 {
488 bool bWasNoSnap = rDragStat.IsNoSnap();
489 bool bWasSnapEnabled = pView->IsSnapEnabled();
490
491 // switch snapping off
492 if(!bWasNoSnap)
493 const_cast<SdrDragStat&>(rDragStat).SetNoSnap();
494 if(bWasSnapEnabled)
495 pView->SetSnapEnabled(false);
496
497 pView->MovAction(aEndPoint);
498 pView->EndDragObj();
499
500 // restore snap
501 if(!bWasNoSnap)
502 const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap);
503 if(bWasSnapEnabled)
504 pView->SetSnapEnabled(bWasSnapEnabled);
505 }
506 }
507 }
508
509 bProc = true;
510 }
511 }
512 break;
513
514 case KEY_SPACE:
515 {
516 const SdrHdlList& rHdlList = pView->GetHdlList();
517 SdrHdl* pHdl = rHdlList.GetFocusHdl();
518
519 if(pHdl)
520 {
521 if(pHdl->GetKind() == SdrHdlKind::Poly)
522 {
523 // rescue ID of point with focus
524 sal_uInt32 nPol(pHdl->GetPolyNum());
525 sal_uInt32 nPnt(pHdl->GetPointNum());
526
527 if(pView->IsPointMarked(*pHdl))
528 {
529 if(rKEvt.GetKeyCode().IsShift())
530 {
531 pView->UnmarkPoint(*pHdl);
532 }
533 }
534 else
535 {
536 if(!rKEvt.GetKeyCode().IsShift())
537 {
538 pView->UnmarkAllPoints();
539 }
540
541 pView->MarkPoint(*pHdl);
542 }
543
544 if(nullptr == rHdlList.GetFocusHdl())
545 {
546 // restore point with focus
547 SdrHdl* pNewOne = nullptr;
548
549 for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a)
550 {
551 SdrHdl* pAct = rHdlList.GetHdl(a);
552
553 if(pAct
554 && pAct->GetKind() == SdrHdlKind::Poly
555 && pAct->GetPolyNum() == nPol
556 && pAct->GetPointNum() == nPnt)
557 {
558 pNewOne = pAct;
559 }
560 }
561
562 if(pNewOne)
563 {
564 const_cast<SdrHdlList&>(rHdlList).SetFocusHdl(pNewOne);
565 }
566 }
567
568 bProc = true;
569 }
570 }
571 }
572 break;
573
574 default:
575 break;
576 }
577
578 if (bProc)
579 ReleaseMouse();
580
582
583 return bProc;
584}
585
587{
588 if ( mbSdrMode && ( rMEvt.GetClicks() < 2 ) )
589 {
591
592 const Point aLogPt( rDevice.PixelToLogic( rMEvt.GetPosPixel() ) );
593
594 if ( !tools::Rectangle( Point(), aGraphSize ).Contains( aLogPt ) && !pView->IsEditMode() )
596 else
597 {
598 // Get Focus for key inputs
599 GrabFocus();
600
601 if ( nPolyEdit )
602 {
603 SdrViewEvent aVEvt;
604 SdrHitKind eHit = pView->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt );
605
606 if ( nPolyEdit == SID_BEZIER_INSERT && eHit == SdrHitKind::MarkedObject )
607 pView->BegInsObjPoint( aLogPt, rMEvt.IsMod1());
608 else
609 pView->MouseButtonDown( rMEvt, &rDevice );
610 }
611 else
612 pView->MouseButtonDown( rMEvt, &rDevice );
613 }
614
615 SdrObject* pCreateObj = pView->GetCreateObj();
616
617 // We want to realize the insert
618 if ( pCreateObj && !pCreateObj->GetUserCall() )
619 pCreateObj->SetUserCall( pUserCall.get() );
620
621 SetPointer( pView->GetPreferredPointer( aLogPt, &rDevice ) );
622 }
623 else
625
627
628 return false;
629}
630
632{
634 const Point aLogPos( rDevice.PixelToLogic( rMEvt.GetPosPixel() ) );
635
636 if ( mbSdrMode )
637 {
638 pView->MouseMove( rMEvt, &rDevice );
639
640 if( ( SID_BEZIER_INSERT == nPolyEdit ) &&
641 !pView->PickHandle( aLogPos ) &&
642 !pView->IsInsObjPoint() )
643 {
644 SetPointer( PointerStyle::Cross );
645 }
646 else
647 SetPointer( pView->GetPreferredPointer( aLogPos, &rDevice ) );
648 }
649 else
651
652 if ( aMousePosLink.IsSet() )
653 {
654 if ( tools::Rectangle( Point(), aGraphSize ).Contains( aLogPos ) )
655 aMousePos = aLogPos;
656 else
657 aMousePos = Point();
658
659 aMousePosLink.Call( this );
660 }
661
663
664 return false;
665}
666
668{
669 if ( mbSdrMode )
670 {
672
673 if ( pView->IsInsObjPoint() )
674 pView->EndInsObjPoint( SdrCreateCmd::ForceEnd );
675 else
676 pView->MouseButtonUp( rMEvt, &rDevice );
677
678 ReleaseMouse();
679 SetPointer( pView->GetPreferredPointer( rDevice.PixelToLogic( rMEvt.GetPosPixel() ), &rDevice ) );
680 }
681 else
683
685
686 return false;
687}
688
690{
691 SdrObject* pSdrObj = nullptr;
692
693 if ( mbSdrMode )
694 {
695 const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
696
697 if ( rMarkList.GetMarkCount() == 1 )
698 pSdrObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
699 }
700
701 return pSdrObj;
702}
703
704void GraphCtrl::SetEditMode( const bool _bEditMode )
705{
706 if ( mbSdrMode )
707 {
708 bEditMode = _bEditMode;
709 pView->SetEditMode( bEditMode );
711 pView->SetCurrentObj(eObjKind);
712 }
713 else
714 bEditMode = false;
715
717}
718
719void GraphCtrl::SetPolyEditMode( const sal_uInt16 _nPolyEdit )
720{
721 if ( mbSdrMode && ( _nPolyEdit != nPolyEdit ) )
722 {
723 nPolyEdit = _nPolyEdit;
724 pView->SetFrameDragSingles( nPolyEdit == 0 );
725 }
726 else
727 nPolyEdit = 0;
728
730}
731
732void GraphCtrl::SetObjKind( const SdrObjKind _eObjKind )
733{
734 if ( mbSdrMode )
735 {
736 bEditMode = false;
737 pView->SetEditMode( bEditMode );
738 eObjKind = _eObjKind;
739 pView->SetCurrentObj(eObjKind);
740 }
741 else
743
745}
746
747IMPL_LINK_NOARG(GraphCtrl, UpdateHdl, Timer *, void)
748{
749 mbInIdleUpdate = true;
750 aUpdateLink.Call( this );
751 mbInIdleUpdate = false;
752}
753
755{
756 if (!mbInIdleUpdate)
758}
759
760namespace
761{
762 class WeldOverlayManager final : public sdr::overlay::OverlayManager
763 {
764 weld::CustomWidgetController& m_rGraphCtrl;
765
766 public:
767 WeldOverlayManager(weld::CustomWidgetController& rGraphCtrl, OutputDevice& rDevice)
768 : OverlayManager(rDevice)
769 , m_rGraphCtrl(rGraphCtrl)
770 {
771 }
772
773 // invalidate the given range at local OutputDevice
774 virtual void invalidateRange(const basegfx::B2DRange& rRange) override
775 {
776 tools::Rectangle aInvalidateRectangle(RangeToInvalidateRectangle(rRange));
777 m_rGraphCtrl.Invalidate(aInvalidateRectangle);
778 }
779 };
780}
781
783{
784 assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
785 if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
786 {
787 rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager(new WeldOverlayManager(rGraphCtrl, rDevice));
788 InitOverlayManager(xOverlayManager);
789 return xOverlayManager;
790 }
791 return SdrView::CreateOverlayManager(rDevice);
792}
793
795{
796 assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
797 if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
798 {
800 return;
801 }
803}
804
806{
807 assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
808 if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
809 {
810 rGraphCtrl.Invalidate(rArea);
811 return;
812 }
813 SdrView::InvalidateOneWin(rDevice, rArea);
814}
815
817{
818 // turn SetOutputToWindow back off again before
819 // turning back into our baseclass during dtoring
820 const sal_uInt32 nWindowCount(PaintWindowCount());
821 for (sal_uInt32 nWinNum(0); nWinNum < nWindowCount; nWinNum++)
822 {
823 SdrPaintWindow* pPaintWindow = GetPaintWindow(nWinNum);
824 pPaintWindow->SetOutputToWindow(false);
825 }
826}
827
829{
830 int x, y, width, height;
831 if (GetDrawingArea()->get_extents_relative_to(*mpDialog, x, y, width, height))
832 return Point(x, y);
833 return Point();
834}
835
836css::uno::Reference< css::accessibility::XAccessible > GraphCtrl::CreateAccessible()
837{
838#if !ENABLE_WASM_STRIP_ACCESSIBILITY
839 if(mpAccContext == nullptr )
840 {
841 // Disable accessibility if no model/view data available
842 if (pView && pModel)
844 }
845#endif
846 return mpAccContext;
847}
848
849/* 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:794
virtual rtl::Reference< sdr::overlay::OverlayManager > CreateOverlayManager(OutputDevice &rDevice) const override
Definition: graphctl.cxx:782
virtual ~GraphCtrlView() override
Definition: graphctl.cxx:816
GraphCtrl & rGraphCtrl
Definition: graphctl.hxx:133
SdrObject * GetSelectedSdrObject() const
Definition: graphctl.cxx:689
weld::Dialog * mpDialog
Definition: graphctl.hxx:66
ScopedVclPtrInstance< VirtualDevice > xVD
Definition: graphctl.hxx:52
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: graphctl.cxx:667
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:836
virtual void Resize() override
Definition: graphctl.cxx:188
virtual bool KeyInput(const KeyEvent &rKEvt) override
Definition: graphctl.cxx:284
MapMode aMap100
Definition: graphctl.hxx:57
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: graphctl.cxx:586
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: graphctl.cxx:69
void SetPolyEditMode(const sal_uInt16 nPolyEdit)
Definition: graphctl.cxx:719
virtual ~GraphCtrl() override
Definition: graphctl.cxx:75
std::unique_ptr< SdrView > pView
Definition: graphctl.hxx:75
Point GetPositionInDialog() const
Definition: graphctl.cxx:828
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:754
void SetEditMode(const bool bEditMode)
Definition: graphctl.cxx:704
virtual void MarkListHasChanged()
Definition: graphctl.cxx:279
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: graphctl.cxx:231
Idle aUpdateIdle
Definition: graphctl.hxx:53
virtual void SdrObjChanged(const SdrObject &rObj)
Definition: graphctl.cxx:269
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:177
void SetGraphic(const Graphic &rGraphic, bool bNewModel=true)
Definition: graphctl.cxx:156
Link< GraphCtrl *, void > aGraphSizeLink
Definition: graphctl.hxx:55
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: graphctl.cxx:631
void SetObjKind(const SdrObjKind eObjKind)
Definition: graphctl.cxx:732
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:274
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
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:836
void SetUserCall(SdrObjUserCall *pUser)
Definition: svdobj.cxx:2721
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:377
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:863
sal_uInt32 PaintWindowCount() const
Definition: svdpntv.hxx:218
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:747
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