The Gnome Chemistry Utils  0.14.0
Public Member Functions | List of all members
gccv::LineItem Class Reference

Base class for line items, whether straight or curved. More...

#include <line-item.h>

Inheritance diagram for gccv::LineItem:
gccv::Item gccv::BezierArrow gccv::FillItem gccv::Line gccv::PolyLine gccv::Squiggle gccv::Circle gccv::Leaf gccv::Polygon gccv::Rectangle gccv::Arrow gccv::Text

Public Member Functions

 LineItem (Canvas *canvas)
 LineItem (Group *parent, ItemClient *client=NULL)
virtual ~LineItem ()
GOColor GetEffectiveLineColor () const
void ApplyLine (cairo_t *cr) const
void SetDashes (double const *dashes, int num_dashes, double offset)
void SetLineWidth (double val)
double GetLineWidth (void) const
void SetLineColor (GOColor val)
GOColor GetLineColor (void) const
void SetAutoColor (bool val)
bool GetAutoColor (void) const
- Public Member Functions inherited from gccv::Item
 Item (Canvas *canvas)
 Item (Group *parent, ItemClient *client=NULL)
virtual ~Item ()
void GetBounds (double &x0, double &y0, double &x1, double &y1) const
void Invalidate () const
void SetVisible (bool visible)
virtual double Distance (double x, double y, Item **item) const
virtual void BuildPath (cairo_t *cr) const
virtual void Draw (cairo_t *cr, bool is_vector) const
virtual bool Draw (cairo_t *cr, double x0, double y0, double x1, double y1, bool is_vector) const
virtual void Move (double x, double y)
bool IsTopLevel () const
void SetClient (ItemClient *val)
ItemClientGetClient (void)
Group const * GetParent (void) const
bool GetVisible (void) const
void SetOperator (cairo_operator_t val)
cairo_operator_t GetOperator (void) const

Additional Inherited Members

- Protected Member Functions inherited from gccv::Item
void BoundsChanged ()
virtual void UpdateBounds ()
Canvas const * GetCanvas () const
- Protected Attributes inherited from gccv::Item
double m_x0
double m_y0
double m_x1
double m_y1

Detailed Description

Base class for line items, whether straight or curved.

This base class implements the common properties of all lines.

Definition at line 40 of file line-item.h.

Constructor & Destructor Documentation

gccv::LineItem::LineItem ( Canvas canvas)
Parameters
canvasa Canvas.

Creates a new LineItem and sets it as a child of the root Group of canvas.

gccv::LineItem::LineItem ( Group parent,
ItemClient client = NULL 
)
Parameters
parentthe Group to which the new LineItem will be added.
clientthe ItemClient for the new LineItem if any.

Creates a new LineItem inside parent and sets client as its associated ItemClient.

virtual gccv::LineItem::~LineItem ( )
virtual

The destructor.

Member Function Documentation

void gccv::LineItem::ApplyLine ( cairo_t *  cr) const
Parameters
crthe cairo_t to which the line must be rendered.

Sets the line style to cairo. cairo_restore must be called when done.

gccv::LineItem::GetAutoColor ( void  ) const
inline
Returns
the line color mode, true if automatic, false otherwise.

Definition at line 113 of file line-item.h.

GOColor gccv::LineItem::GetEffectiveLineColor ( ) const
Returns
the line color whether it is an automatic color or not.
gccv::LineItem::GetLineColor ( void  ) const
inline
Returns
the line color.

Definition at line 103 of file line-item.h.

gccv::LineItem::GetLineWidth ( void  ) const
inline
Returns
the line width

Definition at line 94 of file line-item.h.

gccv::LineItem::SetAutoColor ( bool  auto)
inline
Parameters
autowhether to use a color from the theme.

if auto is true, the color used to draw the line whiil be retrieved from the Gtk+ theme instead of using the LineColor member.

Definition at line 113 of file line-item.h.

void gccv::LineItem::SetDashes ( double const *  dashes,
int  num_dashes,
double  offset 
)
Parameters
dashesthe dashes lengths.
num_dashesthe dashes number inside the pattern.
offsetthe dashes offset at line start.

Sets the line dashes, see cairo_set_dash for more details on the parameters values.

gccv::LineItem::SetLineColor ( GOColor  color)
inline
Parameters
colorthe new line color.

Sets the LineItem color.

Definition at line 103 of file line-item.h.

gccv::LineItem::SetLineWidth ( double  width)
inline
Parameters
widththe new line width.

Sets the LineItem line width.

Definition at line 94 of file line-item.h.


The documentation for this class was generated from the following file: