- group = gtk_canvas_item_new (parent,
- gtk_canvas_group_get_type(),
- "x", unit_position,
- "y", 1.0,
- NULL);
-
- // cerr << "set mark al points, nc = " << points->num_points << endl;
- mark = gtk_canvas_item_new (GTK_CANVAS_GROUP(group),
- gtk_canvas_polygon_get_type(),
- "points", points,
- "fill_color_rgba", rgba,
- "outline_color", "black",
- NULL);
-
- string fontname = get_font_for_style (N_("MarkerText"));
-
- text = gtk_canvas_item_new (GTK_CANVAS_GROUP(group),
- gtk_canvas_text_get_type (),
- "text", annotation.c_str(),
- "x", label_offset,
- "y", 0.0,
- "font", fontname.c_str(),
- "anchor", GTK_ANCHOR_NW,
- "fill_color", "black",
- NULL);
-
- gtk_object_set_data (GTK_OBJECT(group), "marker", this);
- gtk_signal_connect (GTK_OBJECT(group), "event", (GtkSignalFunc) callback, &editor);
-
- editor.ZoomChanged.connect (slot (*this, &Marker::reposition));
+ 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;
+