- group = &parent;
- group->set_property ("x", unit_position);
- group->set_property ("y", 1.0);
- // cerr << "set mark al points, nc = " << points->num_points << endl;
- mark = new Gnome::Canvas::Polygon (*group);
- mark->set_property ("points", points);
- mark->set_property ("fill_color_rgba", rgba);
- mark->set_property ("outline_color", Gdk::Color ("black"));
-
- Pango::FontDescription font = get_font_for_style (N_("MarkerText"));
-
- text = new Gnome::Canvas::Text (*group);
- text->set_property ("text", annotation.c_str());
- text->set_property ("x", label_offset);
- text->set_property ("y", 0.0);
- text->set_property ("fontdesc", font);
- text->set_property ("anchor", Gtk::ANCHOR_NW);
- text->set_property ("fill_color", Gdk::Color ("black"));
-
- group->signal_event().connect() (bind (mem_fun (editor, &PublicEditor::reposition), group, this));
+ group = new Group (parent, unit_position, 1.0);
+
+ mark = new Polygon (*group);
+ mark->property_points() = *points;
+ mark->property_fill_color_rgba() = rgba;
+ mark->property_outline_color_rgba() = rgba;
+ mark->property_width_pixels() = 1;
+
+ /* setup name pixbuf sizes */
+ name_font = get_font_for_style (N_("MarkerText"));
+
+ Gtk::Window win;
+ Gtk::Label foo;
+ win.add (foo);
+
+ Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
+ int width;
+ int height;
+
+ layout->set_font_description (*name_font);
+ Gtkmm2ext::get_ink_pixel_size (layout, width, height);
+ name_height = height + 6;
+
+ name_pixbuf = new ArdourCanvas::Pixbuf(*group);
+ name_pixbuf->property_x() = label_offset;
+
+ set_name (annotation.c_str());
+
+ editor.ZoomChanged.connect (mem_fun (*this, &Marker::reposition));
+
+ mark->set_data ("marker", this);
+
+ if (handle_events) {
+ group->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_marker_event), mark, this));
+ }
+
+ line = 0;
+