Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

FlowCanvas::Item Class Reference
[FlowCanvas]

An item on a Canvas. More...

#include <Item.hpp>

Inheritance diagram for FlowCanvas::Item:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Item (boost::shared_ptr< Canvas > canvas, const std::string &name, double x, double y, uint32_t color)
virtual ~Item ()
bool selected () const
virtual void set_selected (bool s)
virtual void set_minimum_width (double w)
virtual void select_tick ()=0
virtual void move (double dx, double dy)=0
virtual void zoom (double z)
boost::weak_ptr< Canvascanvas () const
bool popup_menu (guint button, guint32 activate_time)
virtual void create_menu ()
Gtk::Menu * menu () const
void set_menu (Gtk::Menu *m)
double width () const
double height () const
virtual void resize ()=0
virtual void load_location ()
virtual void store_location ()
bool is_within (const Gnome::Canvas::Rect &rect) const
bool point_is_within (double x, double y) const
 Returns whether or not the point x, y (world units) is within the item.
const std::string & name () const
virtual void set_name (const std::string &n)
uint32_t base_color () const
virtual void set_border_color (uint32_t c)
virtual void set_base_color (uint32_t c)
virtual void set_default_base_color ()=0
void set_partner (boost::shared_ptr< Item > partner)
 Set the partner of this node.
boost::weak_ptr< Itempartner ()

Public Attributes

sigc::signal< void > signal_pointer_entered
sigc::signal< void > signal_pointer_exited
sigc::signal< void > signal_selected
sigc::signal< void > signal_unselected
sigc::signal< void,
GdkEventButton * > 
signal_clicked
sigc::signal< void,
GdkEventButton * > 
signal_double_clicked
sigc::signal< void, double,
double > 
signal_dragged
sigc::signal< void, double,
double > 
signal_dropped

Protected Member Functions

virtual void on_drag (double dx, double dy)
virtual void on_drop ()
virtual void on_click (GdkEventButton *ev)
virtual void on_double_click (GdkEventButton *ev)
virtual void set_height (double h)=0
virtual void set_width (double w)=0
bool on_event (GdkEvent *event)

Protected Attributes

const boost::weak_ptr< Canvas_canvas
boost::weak_ptr< Item_partner
Gtk::Menu * _menu
std::string _name
double _minimum_width
double _width
double _height
uint32_t _border_color
uint32_t _color
bool _selected:1

Detailed Description

An item on a Canvas.


Constructor & Destructor Documentation

FlowCanvas::Item::Item ( boost::shared_ptr< Canvas canvas,
const std::string &  name,
double  x,
double  y,
uint32_t  color 
)
virtual FlowCanvas::Item::~Item (  )  [inline, virtual]

Member Function Documentation

bool FlowCanvas::Item::selected (  )  const [inline]

References _selected.

virtual void FlowCanvas::Item::set_selected ( bool  s  )  [virtual]

Reimplemented in FlowCanvas::Module.

virtual void FlowCanvas::Item::set_minimum_width ( double  w  )  [inline, virtual]

References _minimum_width.

virtual void FlowCanvas::Item::select_tick (  )  [pure virtual]

Implemented in FlowCanvas::Module.

virtual void FlowCanvas::Item::move ( double  dx,
double  dy 
) [pure virtual]

Implemented in FlowCanvas::Module.

virtual void FlowCanvas::Item::zoom ( double  z  )  [inline, virtual]

Reimplemented in FlowCanvas::Module.

boost::weak_ptr<Canvas> FlowCanvas::Item::canvas (  )  const [inline]

References _canvas.

bool FlowCanvas::Item::popup_menu ( guint  button,
guint32  activate_time 
) [inline]

References _menu, and create_menu().

virtual void FlowCanvas::Item::create_menu (  )  [inline, virtual]

Referenced by popup_menu().

Gtk::Menu* FlowCanvas::Item::menu (  )  const [inline]

References _menu.

void FlowCanvas::Item::set_menu ( Gtk::Menu *  m  )  [inline]

References _menu.

double FlowCanvas::Item::width (  )  const [inline]

References _width.

Referenced by is_within().

double FlowCanvas::Item::height (  )  const [inline]

References _height.

Referenced by is_within().

virtual void FlowCanvas::Item::resize (  )  [pure virtual]

Implemented in FlowCanvas::Module.

virtual void FlowCanvas::Item::load_location (  )  [inline, virtual]
virtual void FlowCanvas::Item::store_location (  )  [inline, virtual]
bool FlowCanvas::Item::is_within ( const Gnome::Canvas::Rect &  rect  )  const [inline]

References height(), and width().

bool FlowCanvas::Item::point_is_within ( double  x,
double  y 
) const [inline]

Returns whether or not the point x, y (world units) is within the item.

References _height, and _width.

const std::string& FlowCanvas::Item::name (  )  const [inline]

References _name.

virtual void FlowCanvas::Item::set_name ( const std::string &  n  )  [inline, virtual]

Reimplemented in FlowCanvas::Module.

References _name.

uint32_t FlowCanvas::Item::base_color (  )  const [inline]

References _color.

virtual void FlowCanvas::Item::set_border_color ( uint32_t  c  )  [inline, virtual]

Reimplemented in FlowCanvas::Module.

References _border_color.

virtual void FlowCanvas::Item::set_base_color ( uint32_t  c  )  [inline, virtual]

Reimplemented in FlowCanvas::Module.

References _color.

virtual void FlowCanvas::Item::set_default_base_color (  )  [pure virtual]

Implemented in FlowCanvas::Module.

void FlowCanvas::Item::set_partner ( boost::shared_ptr< Item partner  )  [inline]

Set the partner of this node.

Partner nodes are nodes that should be visually aligned to correspond to each other, even if they are not necessarily connected (e.g. for separate modules representing the inputs and outputs of a single interface). The partner is invisibly connected as if it had an input that is connected to this item, e.g. foo.set_partner(bar) will arrange like: [foo] [bar] with a left-to-right flow direction.

References _partner.

boost::weak_ptr<Item> FlowCanvas::Item::partner (  )  [inline]

References _partner.

virtual void FlowCanvas::Item::on_drag ( double  dx,
double  dy 
) [protected, virtual]
virtual void FlowCanvas::Item::on_drop (  )  [protected, virtual]
virtual void FlowCanvas::Item::on_click ( GdkEventButton *  ev  )  [protected, virtual]
virtual void FlowCanvas::Item::on_double_click ( GdkEventButton *  ev  )  [protected, virtual]
virtual void FlowCanvas::Item::set_height ( double  h  )  [protected, pure virtual]

Implemented in FlowCanvas::Module.

virtual void FlowCanvas::Item::set_width ( double  w  )  [protected, pure virtual]

Implemented in FlowCanvas::Module.

bool FlowCanvas::Item::on_event ( GdkEvent *  event  )  [protected]

Reimplemented in FlowCanvas::Module.


Member Data Documentation

sigc::signal<void, GdkEventButton*> FlowCanvas::Item::signal_clicked
sigc::signal<void, GdkEventButton*> FlowCanvas::Item::signal_double_clicked
sigc::signal<void, double, double> FlowCanvas::Item::signal_dragged
sigc::signal<void, double, double> FlowCanvas::Item::signal_dropped
const boost::weak_ptr<Canvas> FlowCanvas::Item::_canvas [protected]

Referenced by canvas().

boost::weak_ptr<Item> FlowCanvas::Item::_partner [protected]

Referenced by partner(), and set_partner().

Gtk::Menu* FlowCanvas::Item::_menu [protected]

Referenced by menu(), popup_menu(), and set_menu().

std::string FlowCanvas::Item::_name [protected]

Referenced by name(), and set_name().

Referenced by set_minimum_width().

double FlowCanvas::Item::_width [protected]

Referenced by point_is_within(), and width().

double FlowCanvas::Item::_height [protected]

Referenced by height(), and point_is_within().

uint32_t FlowCanvas::Item::_border_color [protected]

Referenced by set_border_color().

uint32_t FlowCanvas::Item::_color [protected]

Referenced by base_color(), and set_base_color().

bool FlowCanvas::Item::_selected [protected]

Referenced by selected().


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