5 #include <gtkmm/widget.h>
6 #include <pangomm/layout.h>
7 #include <cairomm/context.h>
9 #include "drawable.hpp"
10 #include "core/word.hpp"
12 class Vertex
: public Drawable
<Vertex
*>
15 Vertex(Gtk::Widget
&parent
, const Word
&word
);
16 virtual ~Vertex(void);
17 void set_font(const Glib::ustring
&font
);
18 void set_coordinates(gdouble x
, gdouble y
);
19 gdouble
get_x(void) const;
20 gdouble
get_y(void) const;
21 gdouble
get_width(void) const;
22 gdouble
get_height(void) const;
23 void get_top_anchor(gdouble
&x
, gdouble
&y
) const;
24 void get_bottom_anchor(gdouble
&x
, gdouble
&y
) const;
25 virtual void draw(Cairo::RefPtr
<Cairo::Context
> cr
);
26 void add_friend(const Vertex
&v
);
27 void delete_friend(const Vertex
&v
);
28 bool is_friend(const Vertex
&v
) const;
29 virtual bool select(Cairo::RefPtr
<Cairo::Context
> cr
, gdouble x
, gdouble y
);
30 virtual void deselect(void);
32 bool _is_in_region(Cairo::RefPtr
<Cairo::Context
> cr
, gdouble x
, gdouble y
) const;
44 Glib::RefPtr
<Pango::Layout
> _layout
;
45 std::vector
<const Vertex
*> _friends
;
48 inline void Vertex::set_coordinates(gdouble x
, gdouble y
)
54 inline gdouble
Vertex::get_x(void) const
59 inline gdouble
Vertex::get_y(void) const
64 inline gdouble
Vertex::get_width(void) const
69 inline gdouble
Vertex::get_height(void) const
74 inline void Vertex::get_top_anchor(gdouble
&x
, gdouble
&y
) const
80 inline void Vertex::get_bottom_anchor(gdouble
&x
, gdouble
&y
) const