25#include "vselection.h"
27#include "vcomposite.h"
31VFillCmd::VFillCmd(
VDocument *doc,
const VFill &fill,
const TQString &icon )
32 :
VCommand( doc, i18n(
"Fill Objects" ), icon ), m_fill( fill )
34 m_selection = document()->selection()->clone();
36 if( m_selection->objects().count() == 1 )
37 setName( i18n(
"Fill Object" ) );
48VFillCmd::changeFill(
const VFill &fill )
53 m_selection = document()->selection()->clone();
55 VObjectListIterator itr( m_selection->objects() );
57 for( ; itr.current() ; ++itr )
59 visit( *itr.current() );
66VFillCmd::visitVGroup(
VGroup& group )
68 VObjectListIterator itr( group.
objects() );
70 for( ; itr.current() ; ++itr )
72 m_oldfills.push_back(
VFill( *( itr.current()->fill() ) ) );
73 itr.current()->setFill( m_fill );
74 m_objects.append(itr.current() );
79VFillCmd::visitVPath(
VPath& composite )
81 m_oldfills.push_back(
VFill( *( composite.
fill() ) ) );
83 m_objects.append( &composite );
87VFillCmd::visitVText( VText& text )
89 m_oldfills.push_back(
VFill( *( text.fill() ) ) );
90 text.setFill( m_fill );
91 m_objects.append( &text );
98 m_selection = document()->selection()->clone();
99 VObjectListIterator itr( m_selection->objects() );
101 for( ; itr.current() ; ++itr )
103 visit( *itr.current() );
112 VObjectListIterator itr( m_objects );
116 for( ; itr.current() ; ++itr )
118 itr.current()->setFill( m_oldfills[ i++ ] );
The base class for all karbon commands.
All non-visual, static doc info is in here.
Manages the fill of shapes.
Base class for all sort of VObject conglomerats.
const VObjectList & objects() const
Read only access to the grouped objects.
virtual VFill * fill() const
Gets the object's actual fill.
virtual void setFill(const VFill &fill)
Sets the fill to a given new fill.
A composite path consists of one or many subpaths.