20#include "karbon_view.h"
22#include <tqdragobject.h>
24#include <tqapplication.h>
25#include <tqclipboard.h>
26#include <tqpopupmenu.h>
27#include <tqpaintdevicemetrics.h>
31#include <kcolordrag.h>
33#include <kiconloader.h>
34#include <tdemessagebox.h>
35#include <tdeversion.h>
38#include <KoMainWindow.h>
39#include <KoFilterManager.h>
40#include <kstatusbar.h>
41#include <tdefiledialog.h>
42#include <kstdaction.h>
43#include <KoContextCelp.h>
44#include <KoUnitWidgets.h>
45#include <KoPageLayoutDia.h>
47#include <Kolinestyleaction.h>
51#include "vcleanupcmd.h"
52#include "vclipartcmd.h"
53#include "vclosepathcmd.h"
54#include "vdeletecmd.h"
55#include "vdistributecmd.h"
58#include "vstrokecmd.h"
59#include "vtransformcmd.h"
60#include "vinsertcmd.h"
61#include "vungroupcmd.h"
62#include "vzordercmd.h"
65#include "vconfiguredlg.h"
68#include <kopalettemanager.h>
69#include "vcolordocker.h"
70#include "vdocumentdocker.h"
71#include "vstrokedocker.h"
72#include "vstyledocker.h"
73#include "vtransformdocker.h"
79#include "vsmallpreview.h"
82#include "karbon_factory.h"
83#include "karbon_part.h"
84#include "karbon_view_iface.h"
86#include "vselection.h"
88#include "vtoolcontroller.h"
89#include "vcomposite.h"
91#include "vpainterfactory.h"
93#include "vkopainter.h"
94#include "vstrokefillpreview.h"
95#include "vtypebuttonbox.h"
96#include "vstatebutton.h"
99#include "karbon_drag.h"
107const int rulerWidth = 20;
108const int rulerHeight = 20;
110KarbonView::KarbonView(
KarbonPart* p, TQWidget* parent,
const char* name )
111 : KoView( p, parent, name ), KXMLGUIBuilder( shell() ), m_part( p )
114 m_toolController =
new VToolController(
this );
115 m_toolController->init();
117 setInstance( KarbonFactory::instance(),
true );
119 setClientBuilder(
this );
121 if( !p->isReadWrite() )
122 setXMLFile( TQString::fromLatin1(
"karbon_readonly.rc" ) );
124 setXMLFile( TQString::fromLatin1(
"karbon.rc" ) );
130 m_status =
new KStatusBarLabel( TQString(), 0, statusBar() );
131 m_status->setAlignment( AlignLeft | AlignVCenter );
132 m_status->setMinimumWidth( 300 );
133 addStatusBarItem( m_status, 1 );
134 m_cursorCoords =
new KStatusBarLabel( TQString(), 0, statusBar() );
135 m_cursorCoords->setAlignment( AlignLeft | AlignVCenter );
136 m_cursorCoords->setMinimumWidth( 50 );
137 addStatusBarItem( m_cursorCoords, 0 );
138 m_smallPreview =
new VSmallPreview(
this, name );
139 addStatusBarItem( m_smallPreview );
146 m_strokeFillPreview = 0L;
150 m_TransformDocker = 0L;
155 m_pPaletteManager =
new KoPaletteManager(
this, actionCollection(),
"karbon palette manager");
157 unsigned int max = part()->maxRecentFiles();
158 setNumberOfRecentFiles( max );
162 connect( p, TQ_SIGNAL( unitChanged( KoUnit::Unit ) ),
this, TQ_SLOT( setUnit( KoUnit::Unit ) ) );
165 m_horizRuler =
new VRuler( TQt::Horizontal,
this );
166 m_horizRuler->setUnit(p->unit());
167 connect( p, TQ_SIGNAL( unitChanged( KoUnit::Unit ) ), m_horizRuler, TQ_SLOT( setUnit( KoUnit::Unit ) ) );
169 m_vertRuler =
new VRuler( TQt::Vertical,
this );
170 m_vertRuler->setUnit(p->unit());
171 connect( p, TQ_SIGNAL( unitChanged( KoUnit::Unit ) ), m_vertRuler, TQ_SLOT( setUnit( KoUnit::Unit ) ) );
173 m_canvas =
new VCanvas(
this,
this, p );
174 connect( m_canvas, TQ_SIGNAL( contentsMoving(
int,
int ) ),
this, TQ_SLOT( canvasContentsMoving(
int,
int ) ) );
179 m_painterFactory =
new VPainterFactory;
180 m_painterFactory->setPainter( canvasWidget()->pixmap(), width(), height() );
181 m_painterFactory->setEditPainter( canvasWidget()->viewport(), width(), height() );
188 createTransformDock();
189 createDocumentTabDock();
190 createLayersTabDock();
191 createHistoryTabDock();
192 createResourceDock();
194 if( m_showRulerAction->isChecked() )
196 m_horizRuler->show();
201 m_horizRuler->hide();
205 m_horizRuler->installEventFilter(m_canvas);
206 m_vertRuler->installEventFilter(m_canvas);
212KarbonView::~KarbonView()
214 kdDebug(38000) <<
"Handling KarbonView dtor" << endl;
217 delete m_smallPreview;
219 delete m_cursorCoords;
221 delete m_painterFactory;
227 delete m_toolController;
230static TQt::Dock stringToDock(
const TQString& attrPosition )
232 TDEToolBar::Dock dock = TDEToolBar::DockTop;
233 if ( !attrPosition.isEmpty() ) {
234 if ( attrPosition ==
"top" )
236 else if ( attrPosition ==
"left" )
237 dock = TQt::DockLeft;
238 else if ( attrPosition ==
"right" )
239 dock = TQt::DockRight;
240 else if ( attrPosition ==
"bottom" )
241 dock = TQt::DockBottom;
242 else if ( attrPosition ==
"floating" )
243 dock = TQt::DockTornOff;
244 else if ( attrPosition ==
"flat" )
245 dock = TQt::DockMinimized;
252KarbonView::createContainer( TQWidget *parent,
int index,
const TQDomElement &element,
int &
id )
254 if( element.attribute(
"name" ) ==
"Tools" )
256 m_toolbox =
new VToolBox( mainWindow(),
"Tools", KarbonFactory::instance() );
257 toolController()->setUp( actionCollection(), m_toolbox );
259 kdDebug() <<
"Toolbox position: " << element.attribute(
"position" ) <<
"\n";
260 Dock dock = stringToDock( element.attribute(
"position" ).lower() );
262 mainWindow()->addDockWindow( m_toolbox, dock,
false);
263 mainWindow()->moveDockWindow( m_toolbox, dock,
false, 0, 0 );
269 m_strokeFillPreview =
new VStrokeFillPreview( part(), m_toolbox );
270 m_typeButtonBox =
new VTypeButtonBox( part(), m_toolbox );
272 connect( m_strokeFillPreview, TQ_SIGNAL( fillSelected() ), m_typeButtonBox, TQ_SLOT( setFill() ) );
273 connect( m_strokeFillPreview, TQ_SIGNAL( strokeSelected() ), m_typeButtonBox, TQ_SLOT( setStroke() ) );
275 connect( m_strokeFillPreview, TQ_SIGNAL( strokeChanged(
const VStroke & ) ),
this, TQ_SLOT( slotStrokeChanged(
const VStroke & ) ) );
276 connect( m_strokeFillPreview, TQ_SIGNAL( fillChanged(
const VFill & ) ),
this, TQ_SLOT( slotFillChanged(
const VFill & ) ) );
278 connect( m_strokeFillPreview, TQ_SIGNAL( strokeSelected() ), m_ColorManager, TQ_SLOT( setStrokeDocker() ) );
279 connect( m_strokeFillPreview, TQ_SIGNAL( fillSelected( ) ), m_ColorManager, TQ_SLOT( setFillDocker() ) );
281 connect( m_part->commandHistory(), TQ_SIGNAL( commandExecuted(
VCommand* ) ),
this, TQ_SLOT( commandExecuted(
VCommand* ) ) );
283 connect( m_ColorManager, TQ_SIGNAL(modeChanged( KDualColorButton::DualColor)),
this, TQ_SLOT( strokeFillSelectionChanged(KDualColorButton::DualColor) ) );
284 connect( m_ColorManager, TQ_SIGNAL(bgColorChanged(
const TQColor & )),
this, TQ_SLOT(colorChanged(
const TQColor & )) );
285 connect( m_ColorManager, TQ_SIGNAL(fgColorChanged(
const TQColor & )),
this, TQ_SLOT(colorChanged(
const TQColor & )) );
294 return KXMLGUIBuilder::createContainer( parent, index, element,
id );
298KarbonView::removeContainer( TQWidget *container, TQWidget *parent,
299 TQDomElement &element,
int id )
302 kdDebug(38000) << container << endl;
304 if( shell() && container == m_toolbox )
306 disconnect( m_part->commandHistory(), TQ_SIGNAL( commandExecuted(
VCommand* ) ),
this, TQ_SLOT( commandExecuted(
VCommand* ) ) );
307 disconnect( m_ColorManager, TQ_SIGNAL(modeChanged( KDualColorButton::DualColor)),
this, TQ_SLOT( strokeFillSelectionChanged(KDualColorButton::DualColor) ) );
308 disconnect( m_ColorManager, TQ_SIGNAL(bgColorChanged(
const TQColor & )),
this, TQ_SLOT(colorChanged(
const TQColor & )) );
309 disconnect( m_ColorManager, TQ_SIGNAL(fgColorChanged(
const TQColor & )),
this, TQ_SLOT(colorChanged(
const TQColor & )) );
312 m_toolController->youAintGotNoToolBox();
314 m_strokeFillPreview = 0;
321 KXMLGUIBuilder::removeContainer( container, parent, element,
id );
326KarbonView::dcopObject()
329 m_dcop =
new KarbonViewIface(
this );
335KarbonView::canvas()
const
341KarbonView::resizeEvent( TQResizeEvent* )
343 if( shell() && m_showRulerAction->isChecked())
345 m_canvas->setGeometry( rulerWidth, rulerHeight, width() - rulerWidth, height() - rulerHeight );
350 m_horizRuler->hide();
352 m_canvas->setGeometry( 0, 0, width(), height() );
360KarbonView::dropEvent( TQDropEvent *e )
365 VObjectList selection;
367 if( KColorDrag::decode( e, color ) )
369 float r = color.red() / 255.0;
370 float g = color.green() / 255.0;
371 float b = color.blue() / 255.0;
373 realcolor.
set( r, g, b );
376 if( m_strokeFillPreview->strokeIsSelected() )
377 part()->addCommand(
new VStrokeCmd( &part()->document(), realcolor ),
true );
379 part()->addCommand(
new VFillCmd( &part()->document(), realcolor ),
true );
381 else if( KarbonDrag::decode( e, selection, m_part->document() ) )
383 VObject *clipart = selection.first();
384 KoPoint p( e->pos() );
385 p = m_canvas->toContents( p );
386 TQWMatrix mat( 1, 0, 0, 1, p.x(), p.y() );
388 VTransformCmd trafo( 0L, mat );
389 trafo.visit( *clipart );
390 VClipartCmd* cmd =
new VClipartCmd( &m_part->document(), i18n(
"Insert Clipart" ), clipart );
392 m_part->addCommand( cmd,
true );
397KarbonView::print( KPrinter &printer )
400 kdDebug(38000) <<
"KarbonView::print" << endl;
402 TQPaintDeviceMetrics metrics( ( TQPaintDevice * ) & printer );
403 printer.setFullPage(
true );
405 KoPageLayout pageLayout = part()->pageLayout();
406 printer.setOrientation( pageLayout.orientation == PG_PORTRAIT ? KPrinter::Portrait : KPrinter::Landscape );
407 printer.setPageSize( (KPrinter::PageSize)KoPageFormat::printerPageSize( pageLayout.format ) );
410 double zoom = metrics.logicalDpiX() / 72.0;
414 mat.translate( 0, -part()->document().height()*zoom );
416 double w = zoom*part()->document().width();
417 double h = zoom*part()->document().height();
419 KoRect rect( 0, 0, w, h );
421 TQPixmap img(
static_cast<int>( w ),
static_cast<int>( h ) );
424 VKoPainter kop( ( TQPaintDevice * )&img,
static_cast<int>( w ),
static_cast<int>( h ) );
426 kop.setZoomFactor( zoom );
427 kop.setWorldMatrix( mat );
431 part()->document().draw( &kop, &rect );
441 p.drawPixmap( 0, 0, img );
446KarbonView::fileImportGraphic()
449 filter <<
"application/x-karbon" <<
"image/svg+xml" <<
"image/x-wmf" <<
"image/x-eps" <<
"application/postscript";
450 KFileDialog *dialog =
new KFileDialog(
"foo", TQString(), 0L,
"Choose Graphic to Add",
true);
451 dialog->setMimeFilter( filter,
"application/x-karbon" );
452 if(dialog->exec()!=TQDialog::Accepted) {
456 TQString fname = dialog->selectedFile();
460 if( part()->nativeFormatMimeType() == dialog->currentMimeFilter().latin1() )
461 part()->mergeNativeFormat( fname );
464 KoFilterManager man( part() );
465 KoFilter::ConversionStatus status;
466 TQString importedFile = man.import( fname, status );
467 part()->mergeNativeFormat( importedFile );
468 if( !importedFile.isEmpty() )
469 unlink( TQFile::encodeName( importedFile ) );
472 part()->repaintAllViews();
478 addSelectionToClipboard();
480 editDeleteSelection();
484KarbonView::editCopy()
486 addSelectionToClipboard();
490KarbonView::addSelectionToClipboard()
const
492 if( part()->document().selection()->objects().count() <= 0 )
495 KarbonDrag* kd =
new KarbonDrag();
496 kd->setObjectList( part()->document().selection()->objects() );
497 TQApplication::clipboard()->setData( kd );
501KarbonView::editPaste()
506 if( !kd.decode( TQApplication::clipboard()->data(), objects, part()->document() ) )
510 double copyOffset = part()->instance()->config()->readNumEntry(
"CopyOffset", 10 );
511 part()->addCommand(
new VInsertCmd( &part()->document(),
513 ? i18n(
"Paste Object" )
514 : i18n(
"Paste Objects" ),
515 &objects, copyOffset ),
518 part()->repaintAllViews();
523KarbonView::editSelectAll()
525 part()->document().selection()->append();
527 if( part()->document().selection()->objects().count() > 0 )
528 part()->repaintAllViews();
534KarbonView::editDeselectAll()
536 if( part()->document().selection()->objects().count() > 0 )
538 part()->document().selection()->clear();
539 part()->repaintAllViews();
546KarbonView::editDeleteSelection()
548 kdDebug(38000) <<
"*********" << endl;
550 if( part()->document().selection()->objects().count() > 0 )
559KarbonView::editPurgeHistory()
563 if( KMessageBox::warningContinueCancel(
this,
564 i18n(
"This action cannot be undone later. Do you really want to continue?" ),
565 i18n(
"Purge History" ),
567 "edit_purge_history" ) )
571 VCleanUpCmd cmd( &part()->document() );
574 part()->clearHistory();
579KarbonView::selectionAlignHorizontalLeft()
582 new VAlignCmd( &part()->document(), VAlignCmd::ALIGN_HORIZONTAL_LEFT ),
true );
585KarbonView::selectionAlignHorizontalCenter()
588 new VAlignCmd( &part()->document(), VAlignCmd::ALIGN_HORIZONTAL_CENTER ),
true );
592KarbonView::selectionAlignHorizontalRight()
595 new VAlignCmd( &part()->document(), VAlignCmd::ALIGN_HORIZONTAL_RIGHT ),
true );
599KarbonView::selectionAlignVerticalTop()
602 new VAlignCmd( &part()->document(), VAlignCmd::ALIGN_VERTICAL_TOP ),
true );
606KarbonView::selectionAlignVerticalCenter()
609 new VAlignCmd( &part()->document(), VAlignCmd::ALIGN_VERTICAL_CENTER ),
true );
613KarbonView::selectionAlignVerticalBottom()
616 new VAlignCmd( &part()->document(), VAlignCmd::ALIGN_VERTICAL_BOTTOM ),
true );
620KarbonView::selectionDistributeHorizontalCenter()
623 new VDistributeCmd( &part()->document(), VDistributeCmd::DISTRIBUTE_HORIZONTAL_CENTER ),
true );
627KarbonView::selectionDistributeHorizontalGap()
630 new VDistributeCmd( &part()->document(), VDistributeCmd::DISTRIBUTE_HORIZONTAL_GAP ),
true );
634KarbonView::selectionDistributeHorizontalLeft()
637 new VDistributeCmd( &part()->document(), VDistributeCmd::DISTRIBUTE_HORIZONTAL_LEFT ),
true );
641KarbonView::selectionDistributeHorizontalRight()
644 new VDistributeCmd( &part()->document(), VDistributeCmd::DISTRIBUTE_HORIZONTAL_RIGHT ),
true );
648KarbonView::selectionDistributeVerticalCenter()
651 new VDistributeCmd( &part()->document(), VDistributeCmd::DISTRIBUTE_VERTICAL_CENTER ),
true );
655KarbonView::selectionDistributeVerticalGap()
658 new VDistributeCmd( &part()->document(), VDistributeCmd::DISTRIBUTE_VERTICAL_GAP ),
true );
662KarbonView::selectionDistributeVerticalBottom()
665 new VDistributeCmd( &part()->document(), VDistributeCmd::DISTRIBUTE_VERTICAL_BOTTOM ),
true );
669KarbonView::selectionDistributeVerticalTop()
672 new VDistributeCmd( &part()->document(), VDistributeCmd::DISTRIBUTE_VERTICAL_TOP ),
true );
676KarbonView::selectionDuplicate()
678 if ( !part()->document().selection()->objects().count() )
684 VObjectListIterator itr( part()->document().selection()->objects() );
685 for ( ; itr.current() ; ++itr ) {
686 objects.append( itr.current()->clone() );
690 double copyOffset = part()->instance()->config()->readNumEntry(
"CopyOffset", 10 );
691 part()->addCommand(
new VInsertCmd( &part()->document(),
693 ? i18n(
"Duplicate Object" )
694 : i18n(
"Duplicate Objects" ),
695 &objects, copyOffset ),
698 part()->repaintAllViews();
703KarbonView::selectionBringToFront()
706 new VZOrderCmd( &part()->document(), VZOrderCmd::bringToFront ),
true );
710KarbonView::selectionMoveUp()
713 new VZOrderCmd( &part()->document(), VZOrderCmd::up ),
true );
717KarbonView::selectionMoveDown()
720 new VZOrderCmd( &part()->document(), VZOrderCmd::down ),
true );
724KarbonView::selectionSendToBack()
727 new VZOrderCmd( &part()->document(), VZOrderCmd::sendToBack ),
true );
731KarbonView::groupSelection()
733 part()->addCommand(
new VGroupCmd( &part()->document() ),
true );
737KarbonView::ungroupSelection()
739 part()->addCommand(
new VUnGroupCmd( &part()->document() ),
true );
743KarbonView::closePath()
745 part()->addCommand(
new VClosePathCmd( &part()->document() ),
true );
749KarbonView::slotActiveToolChanged(
VTool *tool )
751 toolController()->setCurrentTool( tool );
753 m_canvas->repaintAll();
757KarbonView::viewModeChanged()
759 canvasWidget()->pixmap()->fill();
761 if( m_viewAction->currentItem() == 1 )
762 m_painterFactory->setWireframePainter( canvasWidget()->pixmap(), width(), height() );
764 m_painterFactory->setPainter( canvasWidget()->pixmap(), width(), height() );
766 m_canvas->repaintAll();
770KarbonView::setZoomAt(
double zoom,
const KoPoint &p )
772 TQString zoomText = TQString(
"%1%" ).arg( zoom * 100.0, 0,
'f', 2 );
773 TQStringList stl = m_zoomAction->items();
774 if( stl.first() ==
"25%" )
776 stl.prepend( zoomText.latin1() );
777 m_zoomAction->setItems( stl );
778 m_zoomAction->setCurrentItem( 0 );
782 m_zoomAction->setCurrentItem( 0 );
783 m_zoomAction->changeItem( m_zoomAction->currentItem(), zoomText.latin1() );
789KarbonView::viewZoomIn()
791 setZoomAt( zoom() * 1.50 );
795KarbonView::viewZoomOut()
797 setZoomAt( zoom() * 0.75 );
801KarbonView::zoomChanged(
const KoPoint &p )
809 centerX = ( ( p.x() ) * zoom() + m_canvas->pageOffsetX() ) /
double( m_canvas->contentsWidth() );
810 centerY = 1 - ( ( p.y() ) * zoom() + m_canvas->pageOffsetY() ) /
double( m_canvas->contentsHeight() );
811 zoomFactor = m_zoomAction->currentText().remove(
'%' ).toDouble() / 100.0;
813 else if( m_zoomAction->currentText() == i18n(
"Zoom Width") )
816 centerY = double( m_canvas->contentsY() + 0.5 * m_canvas->visibleHeight() ) / double( m_canvas->contentsHeight() );
817 zoomFactor = double( m_canvas->visibleWidth() ) / double( part()->document().width() );
819 else if( m_zoomAction->currentText() == i18n(
"Whole Page") )
823 double zoomFactorX = double( m_canvas->visibleWidth() ) / double( part()->document().width() );
824 double zoomFactorY = double( m_canvas->visibleHeight() ) / double( part()->document().height() );
826 if(zoomFactorX < 0 && zoomFactorY > 0)
827 zoomFactor = zoomFactorY;
828 else if(zoomFactorX > 0 && zoomFactorY < 0)
829 zoomFactor = zoomFactorX;
830 else if(zoomFactorX < 0 && zoomFactorY < 0)
833 zoomFactor = kMin( zoomFactorX, zoomFactorY );
837 if( m_canvas->contentsWidth() > m_canvas->visibleWidth() )
838 centerX = double( m_canvas->contentsX() + 0.5 * m_canvas->visibleWidth() ) / double( m_canvas->contentsWidth() );
841 if( m_canvas->contentsHeight() > m_canvas->visibleHeight() )
842 centerY = double( m_canvas->contentsY() + 0.5 * m_canvas->visibleHeight() ) / double( m_canvas->contentsHeight() );
845 zoomFactor = m_zoomAction->currentText().remove(
'%' ).toDouble() / 100.0;
847 kdDebug(38000) <<
"centerX : " << centerX << endl;
848 kdDebug(38000) <<
"centerY : " << centerY << endl;
849 kdDebug(38000) <<
"zoomFactor : " << zoomFactor << endl;
850 if( zoomFactor == 0.0 )
return;
853 if( zoomFactor > 20 )
856 m_zoomAction->changeItem( m_zoomAction->currentItem(),
" 2000%" );
859 KoView::setZoom( zoomFactor );
861 m_canvas->viewport()->setUpdatesEnabled(
false );
863 m_canvas->resizeContents(
int( ( part()->pageLayout().ptWidth + 300 ) * zoomFactor ),
864 int( ( part()->pageLayout().ptHeight + 460 ) * zoomFactor ) );
867 VPainter *painter = painterFactory()->editpainter();
868 painter->setZoomFactor( zoomFactor );
870 m_canvas->setViewport( centerX, centerY );
871 m_canvas->repaintAll();
872 m_canvas->viewport()->setUpdatesEnabled(
true );
875 if( shell() && m_showRulerAction->isChecked() )
877 m_horizRuler->setZoom( zoomFactor );
878 m_vertRuler->setZoom( zoomFactor );
879 m_canvas->setGeometry( rulerWidth, rulerHeight, width() - rulerWidth, height() - rulerHeight );
884 m_horizRuler->hide();
887 m_canvas->viewport()->setFocus();
889 emit zoomChanged( zoomFactor );
893KarbonView::setLineStyle(
int style )
895 TQValueList<float> dashes;
896 if( style == TQt::NoPen )
897 part()->addCommand(
new VStrokeCmd( &part()->document(), dashes << 0 << 20 ),
true );
898 else if( style == TQt::SolidLine )
899 part()->addCommand(
new VStrokeCmd( &part()->document(), dashes ),
true );
900 else if( style == TQt::DashLine )
901 part()->addCommand(
new VStrokeCmd( &part()->document(), dashes << 12 << 6 ),
true );
902 else if( style == TQt::DotLine )
903 part()->addCommand(
new VStrokeCmd( &part()->document(), dashes << 2 << 2 ),
true );
904 else if( style == TQt::DashDotLine )
905 part()->addCommand(
new VStrokeCmd( &part()->document(), dashes << 12 << 2 << 2 << 2 ),
true );
906 else if( style == TQt::DashDotDotLine )
907 part()->addCommand(
new VStrokeCmd( &part()->document(), dashes << 12 << 2 << 2 << 2 << 2 << 2 ),
true );
911KarbonView::slotStrokeChanged(
const VStroke &c )
913 part()->document().selection()->setStroke( c );
918KarbonView::slotFillChanged(
const VFill &f )
920 part()->document().selection()->setFill( f );
925KarbonView::setLineWidth()
927 setLineWidth( m_setLineWidth->value() );
933KarbonView::setLineWidth(
double val )
935 part()->addCommand(
new VStrokeCmd( &part()->document(), val ),
true );
939KarbonView::initActions()
942 m_viewAction =
new TDESelectAction(
943 i18n(
"View &Mode" ), 0,
this,
944 TQ_SLOT( viewModeChanged() ), actionCollection(),
"view_mode" );
946 m_zoomAction =
new TDESelectAction(
947 i18n(
"&Zoom" ),
"viewmag", 0,
this,
948 TQ_SLOT( zoomChanged() ), actionCollection(),
"view_zoom" );
951 mstl << i18n(
"Normal" ) << i18n(
"Wireframe" );
952 m_viewAction->setItems( mstl );
953 m_viewAction->setCurrentItem( 0 );
954 m_viewAction->setEditable(
false );
958 stl << i18n(
"25%" );
960 stl << i18n(
"50%" );
962 stl << i18n(
"100%" );
964 stl << i18n(
"200%" );
966 stl << i18n(
"300%" );
968 stl << i18n(
"400%" );
970 stl << i18n(
"800%" );
971 stl << i18n(
"Whole Page" )
972 << i18n(
"Zoom Width" );
974 m_zoomAction->setItems( stl );
975 m_zoomAction->setEditable(
true );
976 m_zoomAction->setCurrentItem( 7 );
978 KStdAction::zoomIn(
this, TQ_SLOT( viewZoomIn() ), actionCollection(),
"view_zoom_in" );
979 KStdAction::zoomOut(
this, TQ_SLOT( viewZoomOut() ), actionCollection(),
"view_zoom_out" );
981 m_showPageMargins =
new TDEToggleAction( i18n(
"Show Page Margins"),
"view_margins", 0, actionCollection(),
"view_show_margins" );
982 connect( m_showPageMargins, TQ_SIGNAL(toggled(
bool)), TQ_SLOT(togglePageMargins(
bool)));
983#if KDE_IS_VERSION(3,2,90)
984 m_showPageMargins->setCheckedState(i18n(
"Hide Page Margins"));
992 KStdAction::cut(
this,
993 TQ_SLOT( editCut() ), actionCollection(),
"edit_cut" );
994 KStdAction::copy(
this,
995 TQ_SLOT( editCopy() ), actionCollection(),
"edit_copy" );
996 KStdAction::paste(
this,
997 TQ_SLOT( editPaste() ), actionCollection(),
"edit_paste" );
998 KStdAction::selectAll(
this, TQ_SLOT( editSelectAll() ), actionCollection(),
"edit_select_all" );
999 KStdAction::deselect(
this, TQ_SLOT( editDeselectAll() ), actionCollection(),
"edit_deselect_all" );
1002 i18n(
"&Import Graphic..." ), 0, 0,
this,
1003 TQ_SLOT( fileImportGraphic() ), actionCollection(),
"file_import" );
1004 m_deleteSelectionAction =
new TDEAction(
1005 i18n(
"D&elete" ),
"edit-delete", TQKeySequence(
"Del" ),
this,
1006 TQ_SLOT( editDeleteSelection() ), actionCollection(),
"edit_delete" );
1008 i18n(
"&History" ), 0, 0,
this,
1009 TQ_SLOT( editPurgeHistory() ), actionCollection(),
"edit_purge_history" );
1014 i18n(
"&Duplicate" ),
"duplicate", TQKeySequence(
"Ctrl+D" ),
this,
1015 TQ_SLOT( selectionDuplicate() ), actionCollection(),
"object_duplicate" );
1017 i18n(
"Bring to &Front" ),
"bring_forward", TQKeySequence(
"Ctrl+Shift+]" ),
this,
1018 TQ_SLOT( selectionBringToFront() ), actionCollection(),
"object_move_totop" );
1020 i18n(
"&Raise" ),
"raise", TQKeySequence(
"Ctrl+]" ),
this,
1021 TQ_SLOT( selectionMoveUp() ), actionCollection(),
"object_move_up" );
1023 i18n(
"&Lower" ),
"lower", TQKeySequence(
"Ctrl+[" ),
this,
1024 TQ_SLOT( selectionMoveDown() ), actionCollection(),
"object_move_down" );
1026 i18n(
"Send to &Back" ),
"send_backward", TQKeySequence(
"Ctrl+Shift+[" ),
this,
1027 TQ_SLOT( selectionSendToBack() ), actionCollection(),
"object_move_tobottom" );
1030 i18n(
"Align Left" ),
"aoleft", 0,
this,
1031 TQ_SLOT( selectionAlignHorizontalLeft() ),
1032 actionCollection(),
"object_align_horizontal_left" );
1034 i18n(
"Align Center (Horizontal)" ),
"aocenterh", 0,
this,
1035 TQ_SLOT( selectionAlignHorizontalCenter() ),
1036 actionCollection(),
"object_align_horizontal_center" );
1038 i18n(
"Align Right" ),
"aoright", 0,
this,
1039 TQ_SLOT( selectionAlignHorizontalRight() ),
1040 actionCollection(),
"object_align_horizontal_right" );
1042 i18n(
"Align Top" ),
"aotop", 0,
this,
1043 TQ_SLOT( selectionAlignVerticalTop() ),
1044 actionCollection(),
"object_align_vertical_top" );
1046 i18n(
"Align Middle (Vertical)" ),
"aocenterv", 0,
this,
1047 TQ_SLOT( selectionAlignVerticalCenter() ),
1048 actionCollection(),
"object_align_vertical_center" );
1050 i18n(
"Align Bottom" ),
"aobottom", 0,
this,
1051 TQ_SLOT( selectionAlignVerticalBottom() ),
1052 actionCollection(),
"object_align_vertical_bottom" );
1055 i18n(
"Distribute Center (Horizontal)" ),
"", 0,
this,
1056 TQ_SLOT( selectionDistributeHorizontalCenter() ),
1057 actionCollection(),
"object_distribute_horizontal_center" );
1059 i18n(
"Distribute Gaps (Horizontal)" ),
"", 0,
this,
1060 TQ_SLOT( selectionDistributeHorizontalGap() ),
1061 actionCollection(),
"object_distribute_horizontal_gap" );
1063 i18n(
"Distribute Left Borders" ),
"", 0,
this,
1064 TQ_SLOT( selectionDistributeHorizontalLeft() ),
1065 actionCollection(),
"object_distribute_horizontal_left" );
1067 i18n(
"Distribute Right Borders" ),
"", 0,
this,
1068 TQ_SLOT( selectionDistributeHorizontalRight() ),
1069 actionCollection(),
"object_distribute_horizontal_right" );
1071 i18n(
"Distribute Center (Vertical)" ),
"", 0,
this,
1072 TQ_SLOT( selectionDistributeVerticalCenter() ),
1073 actionCollection(),
"object_distribute_vertical_center" );
1075 i18n(
"Distribute Gaps (Vertical)" ),
"", 0,
this,
1076 TQ_SLOT( selectionDistributeVerticalGap() ),
1077 actionCollection(),
"object_distribute_vertical_gap" );
1079 i18n(
"Distribute Bottom Borders" ),
"", 0,
this,
1080 TQ_SLOT( selectionDistributeVerticalBottom() ),
1081 actionCollection(),
"object_distribute_vertical_bottom" );
1083 i18n(
"Distribute Top Borders" ),
"", 0,
this,
1084 TQ_SLOT( selectionDistributeVerticalTop() ),
1085 actionCollection(),
"object_distribute_vertical_top" );
1087 m_showRulerAction =
new TDEToggleAction( i18n(
"Show Rulers" ), 0,
this, TQ_SLOT( showRuler() ), actionCollection(),
"view_show_ruler" );
1088#if KDE_IS_VERSION(3,2,90)
1089 m_showRulerAction->setCheckedState(i18n(
"Hide Rulers"));
1091 m_showRulerAction->setToolTip( i18n(
"Shows or hides rulers." ) );
1092 m_showRulerAction->setChecked(
false );
1093 m_showGridAction =
new TDEToggleAction( i18n(
"Show Grid" ),
"view_grid",
this, TQ_SLOT( showGrid() ), actionCollection(),
"view_show_grid" );
1094#if KDE_IS_VERSION(3,2,90)
1095 m_showGridAction->setCheckedState(i18n(
"Hide Grid"));
1097 m_showGridAction->setToolTip( i18n(
"Shows or hides grid." ) );
1099 m_snapGridAction =
new TDEToggleAction( i18n(
"Snap to Grid" ), 0,
this, TQ_SLOT( snapToGrid() ), actionCollection(),
"view_snap_to_grid" );
1100 m_snapGridAction->setToolTip( i18n(
"Snaps to grid." ) );
1102 m_groupObjects =
new TDEAction(
1103 i18n(
"&Group Objects" ),
"group", TQKeySequence(
"Ctrl+G" ),
this,
1104 TQ_SLOT( groupSelection() ), actionCollection(),
"selection_group" );
1105 m_ungroupObjects =
new TDEAction(
1106 i18n(
"&Ungroup Objects" ),
"ungroup", TQKeySequence(
"Ctrl+Shift+G" ),
this,
1107 TQ_SLOT( ungroupSelection() ), actionCollection(),
"selection_ungroup" );
1108 m_closePath =
new TDEAction(
1109 i18n(
"&Close Path" ), TQKeySequence(
"Ctrl+U" ),
this,
1110 TQ_SLOT( closePath() ), actionCollection(),
"close_path" );
1114 m_lineStyleAction =
new KoLineStyleAction( i18n(
"Line Style" ),
"linestyle",
this, TQ_SLOT( setLineStyle(
int ) ), actionCollection(),
"setLineStyle" );
1117 m_setLineWidth =
new KoUnitDoubleSpinComboBox(
this, 0.0, 1000.0, 0.5, 1.0, KoUnit::U_PT, 1 );
1118 new KWidgetAction( m_setLineWidth, i18n(
"Set Line Width" ), 0,
this, TQ_SLOT( setLineWidth() ), actionCollection(),
"setLineWidth" );
1119 m_setLineWidth->insertItem( 0.25 );
1120 m_setLineWidth->insertItem( 0.5 );
1121 m_setLineWidth->insertItem( 0.75 );
1122 m_setLineWidth->insertItem( 1.0 );
1123 m_setLineWidth->insertItem( 2.0 );
1124 m_setLineWidth->insertItem( 3.0 );
1125 m_setLineWidth->insertItem( 4.0 );
1126 m_setLineWidth->insertItem( 5.0 );
1127 m_setLineWidth->insertItem( 10.0 );
1128 m_setLineWidth->insertItem( 20.0 );
1129 connect( m_setLineWidth, TQ_SIGNAL( valueChanged(
double ) ),
this, TQ_SLOT( setLineWidth() ) );
1131 m_configureAction =
new TDEAction(
1132 i18n(
"Configure Karbon..." ),
"configure", 0,
this,
1133 TQ_SLOT( configure() ), actionCollection(),
"configure" );
1135 new TDEAction( i18n(
"Page &Layout..." ), 0,
this,
1136 TQ_SLOT( pageLayout() ), actionCollection(),
"page_layout" );
1137 m_contextHelpAction =
new KoContextHelpAction( actionCollection(),
this );
1141KarbonView::paintEverything( TQPainter& ,
const TQRect& ,
bool )
1143 kdDebug(38000) <<
"view->paintEverything()" << endl;
1147KarbonView::mouseEvent( TQMouseEvent* event,
const KoPoint &p )
1149 int mx =
event->pos().x();
1150 int my =
event->pos().y();
1154 if( m_canvas->horizontalScrollBar()->isVisible() && ((m_canvas->horizontalScrollBar()->value() - m_canvas->pageOffsetX()) > 0))
1157 px = (mx + canvasWidget()->contentsX() - canvasWidget()->pageOffsetX());
1159 if( m_canvas->verticalScrollBar()->isVisible() && ((m_canvas->verticalScrollBar()->value() - m_canvas->pageOffsetY()) > 0))
1162 py = (my + canvasWidget()->contentsY() - canvasWidget()->pageOffsetY());
1164 m_horizRuler->updatePointer(px, py);
1165 m_vertRuler->updatePointer(px, py);
1168 xy.setX((mx + canvasWidget()->contentsX() - canvasWidget()->pageOffsetX())/zoom());
1169 xy.setY( tqRound(m_part->document().height()) - (my + canvasWidget()->contentsY() - canvasWidget()->pageOffsetY())/zoom());
1171 xy.setX(KoUnit::toUserValue(xy.x(), part()->unit()));
1172 xy.setY(KoUnit::toUserValue(xy.y(), part()->unit()));
1174 m_cursorCoords->setText( TQString(
"%1, %2" ).arg(TDEGlobal::_locale->formatNumber(xy.x(), 2)).arg(TDEGlobal::_locale->formatNumber(xy.y(), 2)) );
1176 if( toolController() )
1177 return toolController()->mouseEvent( event, p );
1183KarbonView::keyEvent( TQEvent* event )
1185 if( toolController() )
1186 return toolController()->keyEvent( event );
1192KarbonView::reorganizeGUI()
1196 if( part()->showStatusBar() )
1197 statusBar()->show();
1199 statusBar()->hide();
1204KarbonView::setNumberOfRecentFiles(
unsigned int number )
1207 shell()->setMaxRecentItems( number );
1211KarbonView::showRuler()
1213 if( shell() && m_showRulerAction->isChecked() )
1215 m_horizRuler->show();
1216 m_vertRuler->show();
1217 m_canvas->setGeometry( rulerWidth, rulerHeight, width() - rulerWidth, height() - rulerHeight );
1222 m_horizRuler->hide();
1223 m_vertRuler->hide();
1224 m_canvas->setGeometry( 0, 0, width(), height() );
1231KarbonView::showPageMargins()
1233 return ((TDEToggleAction*)actionCollection()->action(
"view_show_margins"))->isChecked();
1237KarbonView::togglePageMargins(
bool b)
1239 ((TDEToggleAction*)actionCollection()->action(
"view_show_margins"))->setChecked(b);
1240 m_canvas->repaintAll();
1244KarbonView::updateRuler()
1246 if(!m_canvas->horizontalScrollBar()->isVisible())
1248 if( (1 + m_canvas->pageOffsetX() - m_canvas->contentsX()) >= 0 )
1250 m_horizRuler->setGeometry( 1 + rulerWidth + m_canvas->pageOffsetX() - m_canvas->contentsX(), 0, tqRound( 1 + part()->document().width() * zoom() ), rulerHeight );
1251 m_horizRuler->updateVisibleArea(0,0);
1255 m_horizRuler->setGeometry( rulerWidth, 0, tqRound( 1 + part()->document().width() * zoom() ) - m_canvas->contentsX() + m_canvas->pageOffsetX(), rulerHeight );
1256 m_horizRuler->updateVisibleArea((m_canvas->contentsX() - m_canvas->pageOffsetX()),0);
1260 if(!m_canvas->verticalScrollBar()->isVisible())
1262 if( (1 + m_canvas->pageOffsetY() - m_canvas->contentsY()) >= 0 )
1264 m_vertRuler->setGeometry( 0, 1 + rulerHeight + m_canvas->pageOffsetY() - m_canvas->contentsY(), rulerWidth, 1 + tqRound( part()->document().height() * zoom() ));
1265 m_vertRuler->updateVisibleArea(0,0);
1269 m_vertRuler->setGeometry( 0, 1 + rulerHeight, rulerWidth, 1 + tqRound( part()->document().height() * zoom() ) + m_canvas->contentsY() - m_canvas->pageOffsetY() );
1270 m_vertRuler->updateVisibleArea(0, (m_canvas->contentsY() - m_canvas->pageOffsetY()));
1276KarbonView::showGrid()
1278 m_part->document().grid().isShow = m_showGridAction->isChecked();
1282KarbonView::snapToGrid()
1284 m_part->document().grid().isSnap = m_snapGridAction->isChecked();
1288KarbonView::showSelectionPopupMenu(
const TQPoint &pos )
1290 TQPtrList<TDEAction> actionList;
1291 if( m_groupObjects->isEnabled() )
1292 actionList.append( m_groupObjects );
1293 else if( m_ungroupObjects->isEnabled() )
1294 actionList.append( m_ungroupObjects );
1295 if( m_closePath->isEnabled() )
1296 actionList.append( m_closePath );
1297 plugActionList(
"selection_type_action", actionList );
1298 ((TQPopupMenu *)factory()->container(
"selection_popup",
this ) )->exec( pos );
1299 unplugActionList(
"selection_type_action" );
1303KarbonView::configure()
1305 VConfigureDlg dialog(
this );
1310KarbonView::pageLayout()
1313 KoPageLayout layout = part()->pageLayout();
1314 KoUnit::Unit unit = part()->unit();
1315 if( KoPageLayoutDia::pageLayout( layout, hf, FORMAT_AND_BORDERS | DISABLE_UNIT, unit ) )
1317 part()->setPageLayout( layout, unit );
1318 m_horizRuler->setUnit( unit );
1319 m_vertRuler->setUnit( unit );
1320 m_canvas->resizeContents(
int( ( part()->pageLayout().ptWidth + 300 ) * zoom() ),
1321 int( ( part()->pageLayout().ptHeight + 460 ) * zoom() ) );
1322 part()->repaintAllViews();
1324 emit pageLayoutChanged();
1329KarbonView::canvasContentsMoving(
int x,
int y )
1331 if( m_canvas->horizontalScrollBar()->isVisible() )
1333 if( shell() && m_showRulerAction->isChecked() )
1335 if( (1 + m_canvas->pageOffsetX() - x) >= 0)
1337 m_horizRuler->setGeometry( 1 + rulerWidth + m_canvas->pageOffsetX() - x, 0, tqRound( 1 + part()->document().width() * zoom() ), rulerHeight );
1338 m_horizRuler->updateVisibleArea(0,0);
1342 m_horizRuler->setGeometry( rulerWidth, 0, tqRound( 1 + part()->document().width() * zoom() ) - x + m_canvas->pageOffsetX(), rulerHeight );
1343 m_horizRuler->updateVisibleArea((x - m_canvas->pageOffsetX()),0);
1348 if( m_canvas->verticalScrollBar()->isVisible() )
1350 if( shell() && m_showRulerAction->isChecked() )
1352 if( (1 + m_canvas->pageOffsetY() - y) >= 0)
1354 m_vertRuler->setGeometry( 0, 1 + rulerHeight + m_canvas->pageOffsetY() - y , rulerWidth, 1 + tqRound( part()->document().height() * zoom() ));
1355 m_vertRuler->updateVisibleArea(0,0);
1359 m_vertRuler->setGeometry( 0, 1 + rulerHeight, rulerWidth, 1 + tqRound( part()->document().height() * zoom() ) - y + m_canvas->pageOffsetY() );
1360 m_vertRuler->updateVisibleArea(0, (y - m_canvas->pageOffsetY()));
1367KarbonView::selectionChanged()
1370 int count = selection->
objects().count();
1371 m_groupObjects->setEnabled(
false );
1372 m_closePath->setEnabled(
false );
1373 m_ungroupObjects->setEnabled(
false );
1383 m_strokeFillPreview->update( stroke, fill );
1384 m_smallPreview->update( stroke, fill );
1387 m_strokeDocker->setStroke( stroke );
1392 m_ungroupObjects->setEnabled( group );
1394 m_closePath->setEnabled( path && !path->isClosed() );
1397 m_groupObjects->setEnabled(
true );
1401 m_setLineWidth->setEnabled(
true );
1402 m_setLineWidth->updateValue( stroke.lineWidth() );
1404 m_lineStyleAction->setEnabled(
true );
1405 if( stroke.dashPattern().array().isEmpty() )
1406 m_lineStyleAction->setCurrentSelection( TQt::SolidLine );
1407 else if( stroke.dashPattern().array()[ 0 ] == 0. )
1408 m_lineStyleAction->setCurrentSelection( TQt::NoPen );
1409 else if( stroke.dashPattern().array()[ 0 ] == 2. )
1410 m_lineStyleAction->setCurrentSelection( TQt::DotLine );
1411 else if( stroke.dashPattern().array().count() == 2 )
1412 m_lineStyleAction->setCurrentSelection( TQt::DashLine );
1413 else if( stroke.dashPattern().array().count() == 4 )
1414 m_lineStyleAction->setCurrentSelection( TQt::DashDotLine );
1415 else if( stroke.dashPattern().array().count() == 6 )
1416 m_lineStyleAction->setCurrentSelection( TQt::DashDotDotLine );
1418 m_deleteSelectionAction->setEnabled(
true );
1427 m_strokeFillPreview->update( stroke, fill );
1429 m_lineStyleAction->setEnabled(
false );
1430 m_deleteSelectionAction->setEnabled(
false );
1432 emit selectionChange();
1435KarbonView::setCursor(
const TQCursor &c )
1437 m_canvas->setCursor( c );
1441KarbonView::repaintAll(
const KoRect &r )
1443 m_canvas->repaintAll( r );
1447KarbonView::repaintAll(
bool repaint )
1449 m_canvas->repaintAll( repaint );
1452KarbonView::setPos(
const KoPoint& p )
1454 m_canvas->setPos( p );
1458KarbonView::setViewportRect(
const KoRect &rect )
1460 m_canvas->setViewportRect( rect );
1464KarbonView::setUnit( KoUnit::Unit )
1468void KarbonView::createDocumentTabDock()
1470 m_DocumentTab =
new VDocumentTab(
this,
this);
1471 m_DocumentTab->setCaption(i18n(
"Document"));
1472 paletteManager()->addWidget(m_DocumentTab,
"DocumentTabDock",
"DocumentPanel");
1473 connect( m_part, TQ_SIGNAL( unitChanged( KoUnit::Unit ) ), m_DocumentTab, TQ_SLOT( updateDocumentInfo() ) );
1476void KarbonView::createLayersTabDock()
1478 m_LayersTab =
new VLayersTab(
this,
this);
1479 m_LayersTab->setCaption(i18n(
"Layers"));
1480 paletteManager()->addWidget(m_LayersTab,
"LayersTabDock",
"DocumentPanel");
1483void KarbonView::createHistoryTabDock()
1485 m_HistoryTab =
new VHistoryTab(part(),
this);
1486 m_HistoryTab->setCaption(i18n(
"History"));
1487 paletteManager()->addWidget(m_HistoryTab,
"HistoryTabDock",
"DocumentPanel");
1490void KarbonView::createStrokeDock()
1492 m_strokeDocker =
new VStrokeDocker(part(),
this);
1493 m_strokeDocker->setCaption(i18n(
"Stroke Properties"));
1494 paletteManager()->addWidget(m_strokeDocker,
"StrokeTabDock",
"StrokePanel");
1496 connect( part(), TQ_SIGNAL( unitChanged( KoUnit::Unit ) ), m_strokeDocker, TQ_SLOT( setUnit( KoUnit::Unit ) ) );
1499void KarbonView::createColorDock()
1501 m_ColorManager =
new VColorDocker(part(),
this);
1503 paletteManager()->addWidget(m_ColorManager,
"ColorTabDock",
"ColorPanel");
1505 connect(
this, TQ_SIGNAL( selectionChange() ), m_ColorManager, TQ_SLOT( update() ) );
1508void KarbonView::createTransformDock()
1510 m_TransformDocker =
new VTransformDocker(part(),
this);
1511 m_TransformDocker->setCaption(i18n(
"Transform"));
1512 paletteManager()->addWidget(m_TransformDocker,
"TransformTabDock",
"TransformPanel");
1514 connect(
this, TQ_SIGNAL( selectionChange() ), m_TransformDocker, TQ_SLOT( update() ) );
1515 connect( part(), TQ_SIGNAL( unitChanged( KoUnit::Unit ) ), m_TransformDocker, TQ_SLOT( setUnit( KoUnit::Unit ) ) );
1518void KarbonView::createResourceDock()
1520 m_styleDocker =
new VStyleDocker( part(),
this );
1521 m_styleDocker->setCaption(i18n(
"Resources"));
1522 paletteManager()->addWidget(m_styleDocker,
"ResourceTabDock",
"ResourcePanel");
1526KarbonView::toolController()
1528 return m_toolController;
1531void KarbonView::commandExecuted(
VCommand *command )
1537void KarbonView::strokeFillSelectionChanged( KDualColorButton::DualColor s )
1539 if( s == KDualColorButton::Foreground )
1540 m_strokeFillPreview->setStrokeSelected();
1542 m_strokeFillPreview->setFillSelected();
1546void KarbonView::colorChanged(
const TQColor &c )
1551#include "karbon_view.moc"
Keeps track of visual per document properties.
This class keeps track of color properties.
void set(float v1)
Sets the first color component.
The base class for all karbon commands.
virtual bool changesSelection() const
Returns if the command changes the actual document selection.
A class to provide undo/redoable deletion of VObjects.
A command for distributing objects.
VSelection * selection() const
Returns a pointer to the selection.
Manages the fill of shapes.
Base class for all sort of VObject conglomerats.
The base class for all karbon objects.
virtual void setStroke(const VStroke &stroke)
Sets the stroke to a given new stroke.
virtual VFill * fill() const
Gets the object's actual fill.
virtual VStroke * stroke() const
Gets the object's actual stroke.
virtual void setFill(const VFill &fill)
Sets the fill to a given new fill.
VDocument * document() const
Return document the object belongs to.
A composite path consists of one or many subpaths.
VSelection manages a set of selected vobjects.
const VObjectList & objects() const
Read only access to the selected objects.
Manages stroke properties.
Command that changes the z-order of the selection within a layer to front, back, one step up,...