#include <string>
#include <climits>
-#include <gtk-canvas.h>
+#include <libgnomecanvasmm/libgnomecanvasmm.h>
#include <pbd/error.h>
if ((ms = dynamic_cast<const MeterSection*>(*i)) != 0) {
snprintf (buf, sizeof(buf), "%g/%g", ms->beats_per_bar(), ms->note_divisor ());
- metric_marks.push_back (new MeterMarker (*this, GTK_CANVAS_GROUP(meter_group), color_map[cMeterMarker], buf,
- *(const_cast<MeterSection*>(ms)), PublicEditor::canvas_meter_marker_event));
+ metric_marks.push_back (new MeterMarker (*this, *meter_group, color_map[cMeterMarker], buf,
+ *(const_cast<MeterSection*>(ms))));
} else if ((ts = dynamic_cast<const TempoSection*>(*i)) != 0) {
snprintf (buf, sizeof (buf), "%.2f", ts->beats_per_minute());
- metric_marks.push_back (new TempoMarker (*this, GTK_CANVAS_GROUP(tempo_group), color_map[cTempoMarker], buf,
- *(const_cast<TempoSection*>(ts)), PublicEditor::canvas_tempo_marker_event));
+ metric_marks.push_back (new TempoMarker (*this, *tempo_group, color_map[cTempoMarker], buf,
+ *(const_cast<TempoSection*>(ts))));
}
}
void
Editor::tempo_map_changed (Change ignored)
{
- ENSURE_GUI_THREAD(bind (slot (*this, &Editor::tempo_map_changed), ignored));
+ ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::tempo_map_changed), ignored));
if (current_bbt_points) {
delete current_bbt_points;
Editor::hide_measures ()
{
for (TimeLineList::iterator i = used_measure_lines.begin(); i != used_measure_lines.end(); ++i) {
- gtk_canvas_item_hide (*i);
+ (*i)->hide();
free_measure_lines.push_back (*i);
}
used_measure_lines.clear ();
}
-GtkCanvasItem *
+ArdourCanvas::Line *
Editor::get_time_line ()
{
- GtkCanvasItem *line;
+ ArdourCanvas::Line *line;
if (free_measure_lines.empty()) {
- line = gtk_canvas_item_new (GTK_CANVAS_GROUP(time_line_group),
- gtk_canvas_simpleline_get_type(),
- NULL);
+ line = new ArdourCanvas::Line (*time_line_group);
// cerr << "measure line @ " << line << endl;
used_measure_lines.push_back (line);
} else {
TempoMap::BBTPointList::iterator i;
TempoMap::BBTPointList *all_bbt_points;
- GtkCanvasItem *line;
+ ArdourCanvas::Line *line;
gdouble xpos, last_xpos;
uint32_t cnt;
uint32_t color;
if (cnt == 0 || xpos - last_xpos > 4.0) {
line = get_time_line ();
- gtk_object_set (GTK_OBJECT(line),
- "x1", xpos,
- "x2", xpos,
- "y2", (gdouble) canvas_height,
- "color_rgba", color,
- NULL);
- gtk_canvas_item_raise_to_top (line);
- gtk_canvas_item_show (line);
+ line->set_property ("x1", xpos);
+ line->set_property ("x2", xpos);
+ line->set_property ("y2", (gdouble) canvas_height);
+ line->set_property ("color_rgba", color);
+ line->raise_to_top();
+ line->show();
last_xpos = xpos;
++cnt;
}
/* the cursors are always on top of everything */
- gtk_canvas_item_raise_to_top (cursor_group);
- gtk_canvas_item_lower_to_bottom (time_line_group);
+ cursor_group->raise_to_top();
+ time_line_group->lower_to_bottom();
}
void
TempoMap& map(session->tempo_map());
TempoDialog tempo_dialog (map, frame, _("add"));
- tempo_dialog.bpm_entry.activate.connect (bind (slot (tempo_dialog, &ArdourDialog::stop), 0));
- tempo_dialog.ok_button.signal_clicked().connect (bind (slot (tempo_dialog, &ArdourDialog::stop), 0));
- tempo_dialog.cancel_button.signal_clicked().connect (bind (slot (tempo_dialog, &ArdourDialog::stop), -1));
+ tempo_dialog.bpm_entry.signal_activate().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), 0));
+ tempo_dialog.ok_button.signal_clicked().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), 0));
+ tempo_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), -1));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
- tempo_dialog.realize ();
- tempo_dialog.get_window().set_decorations (GdkWMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH));
+ // GTK2FIX
+ // tempo_dialog.realize ();
+ // tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (tempo_dialog);
TempoMap& map(session->tempo_map());
MeterDialog meter_dialog (map, frame, _("add"));
- meter_dialog.ok_button.signal_clicked().connect (bind (slot (meter_dialog, &ArdourDialog::stop), 0));
- meter_dialog.cancel_button.signal_clicked().connect (bind (slot (meter_dialog, &ArdourDialog::stop), -1));
+ meter_dialog.ok_button.signal_clicked().connect (bind (mem_fun (meter_dialog, &ArdourDialog::stop), 0));
+ meter_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (meter_dialog, &ArdourDialog::stop), -1));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
- meter_dialog.realize ();
- meter_dialog.get_window().set_decorations (GdkWMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH));
+ // GTK2FIX
+ // meter_dialog.realize ();
+ // meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (meter_dialog);
}
void
-Editor::remove_tempo_marker (GtkCanvasItem* item)
+Editor::remove_tempo_marker (ArdourCanvas::Item* item)
{
Marker* marker;
TempoMarker* tempo_marker;
}
if (tempo_marker->tempo().movable()) {
- Gtk::Main::idle.connect (bind (slot (*this, &Editor::real_remove_tempo_marker), &tempo_marker->tempo()));
+ Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::real_remove_tempo_marker), &tempo_marker->tempo()));
}
}
{
MeterDialog meter_dialog (*section, _("done"));
- meter_dialog.ok_button.signal_clicked().connect (bind (slot (meter_dialog, &ArdourDialog::stop), 0));
- meter_dialog.cancel_button.signal_clicked().connect (bind (slot (meter_dialog, &ArdourDialog::stop), -1));
+ meter_dialog.ok_button.signal_clicked().connect (bind (mem_fun (meter_dialog, &ArdourDialog::stop), 0));
+ meter_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (meter_dialog, &ArdourDialog::stop), -1));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
- meter_dialog.realize ();
- meter_dialog.get_window().set_decorations (GdkWMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH));
+ // GTK2FIX
+ // meter_dialog.realize ();
+ // meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (meter_dialog);
{
TempoDialog tempo_dialog (*section, _("done"));
- tempo_dialog.bpm_entry.activate.connect (bind (slot (tempo_dialog, &ArdourDialog::stop), 0));
- tempo_dialog.ok_button.signal_clicked().connect (bind (slot (tempo_dialog, &ArdourDialog::stop), 0));
- tempo_dialog.cancel_button.signal_clicked().connect (bind (slot (tempo_dialog, &ArdourDialog::stop), -1));
+ tempo_dialog.bpm_entry.signal_activate().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), 0));
+ tempo_dialog.ok_button.signal_clicked().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), 0));
+ tempo_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), -1));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
- tempo_dialog.realize ();
- tempo_dialog.get_window().set_decorations (GdkWMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH));
+ // GTK2FIX
+ // tempo_dialog.realize ();
+ // tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (tempo_dialog);
}
void
-Editor::edit_tempo_marker (GtkCanvasItem *item)
+Editor::edit_tempo_marker (ArdourCanvas::Item *item)
{
Marker* marker;
TempoMarker* tempo_marker;
}
void
-Editor::edit_meter_marker (GtkCanvasItem *item)
+Editor::edit_meter_marker (ArdourCanvas::Item *item)
{
Marker* marker;
MeterMarker* meter_marker;
}
void
-Editor::remove_meter_marker (GtkCanvasItem* item)
+Editor::remove_meter_marker (ArdourCanvas::Item* item)
{
Marker* marker;
MeterMarker* meter_marker;
}
if (meter_marker->meter().movable()) {
- Gtk::Main::idle.connect (bind (slot (*this, &Editor::real_remove_meter_marker), &meter_marker->meter()));
+ Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::real_remove_meter_marker), &meter_marker->meter()));
}
}