#include <string>
#include <list>
+#include <libgnomecanvasmm/libgnomecanvasmm.h>
+#include <libgnomecanvasmm/canvas.h>
+#include <libgnomecanvasmm/item.h>
+
#include <pbd/error.h>
#include <gtkmm2ext/utils.h>
#include "selection.h"
#include "keyboard.h"
#include "rgb_macros.h"
+#include "utils.h"
#include "i18n.h"
using namespace sigc;
using namespace ARDOUR;
using namespace Editing;
-using namespace Gnome::Canvas;
+using namespace ArdourCanvas;
const double trim_handle_size = 6.0; /* pixels */
name_entry.signal_button_release_event().connect (mem_fun (*this, &TimeAxisView::name_entry_button_release));
name_entry.signal_button_press_event().connect (mem_fun (*this, &TimeAxisView::name_entry_button_press));
- name_entry.signal_focus_in_event().connect (sigc::ptr_fun (ARDOUR_UI::generic_focus_in_event));
- name_entry.signal_focus_out_event().connect (sigc::ptr_fun (ARDOUR_UI::generic_focus_out_event));
-
Gtkmm2ext::set_size_request_to_display_given_text (name_entry, N_("gTortnam"), 10, 10); // just represents a short name
name_label.set_name ("TrackLabel");
}
for (list<SelectionRect*>::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) {
- gtk_object_destroy (GTK_OBJECT((*i)->rect));
- gtk_object_destroy (GTK_OBJECT((*i)->start_trim));
- gtk_object_destroy (GTK_OBJECT((*i)->end_trim));
+ delete (*i)->rect;
+ delete (*i)->start_trim;
+ delete (*i)->end_trim;
+
}
for (list<SelectionRect*>::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i) {
- gtk_object_destroy (GTK_OBJECT((*i)->rect));
- gtk_object_destroy (GTK_OBJECT((*i)->start_trim));
- gtk_object_destroy (GTK_OBJECT((*i)->end_trim));
+ delete (*i)->rect;
+ delete (*i)->start_trim;
+ delete (*i)->end_trim;
}
if (selection_group) {
(*i)->canvas_display->show();
}
- if (GTK_OBJECT_FLAGS(GTK_OBJECT((*i)->canvas_display)) & GNOME_CANVAS_ITEM_VISIBLE) {
+ if (canvas_item_visible ((*i)->canvas_display)) {
++nth;
effective_height += (*i)->show_at (y + effective_height, nth, parent);
}
height = (guint32) h;
controls_frame.set_size_request (-1, height);
- if (GTK_OBJECT_FLAGS(GTK_OBJECT(selection_group)) & GNOME_CANVAS_ITEM_VISIBLE) {
+ if (canvas_item_visible (selection_group)) {
/* resize the selection rect */
show_selection (editor.get_selection().time);
}
(*i)->show_selection (ts);
}
- if (GTK_OBJECT_FLAGS(GTK_OBJECT(selection_group)) & GNOME_CANVAS_ITEM_VISIBLE) {
+ if (canvas_item_visible (selection_group)) {
while (!used_selection_rects.empty()) {
free_selection_rects.push_front (used_selection_rects.front());
used_selection_rects.pop_front();
x2 = (start + cnt - 1) / editor.get_current_zoom();
y2 = height;
- gtk_object_set (GTK_OBJECT(rect->rect),
- "x1", x1,
- "y1", 1.0,
- "x2", x2,
- "y2", y2,
- NULL);
+ rect->rect->property_x1() = x1;
+ rect->rect->property_y1() = 1.0;
+ rect->rect->property_x2() = x2;
+ rect->rect->property_y2() = y2;
// trim boxes are at the top for selections
if (x2 > x1) {
- gtk_object_set (GTK_OBJECT(rect->start_trim),
- "x1", x1,
- "y1", 1.0,
- "x2", x1 + trim_handle_size,
- "y2", 1.0 + trim_handle_size,
- NULL);
- gtk_object_set (GTK_OBJECT(rect->end_trim),
- "x1", x2 - trim_handle_size,
- "y1", 1.0,
- "x2", x2,
- "y2", 1.0 + trim_handle_size,
- NULL);
+ rect->start_trim->property_x1() = x1;
+ rect->start_trim->property_y1() = 1.0;
+ rect->start_trim->property_x2() = x1 + trim_handle_size;
+ rect->start_trim->property_y2() = 1.0 + trim_handle_size;
+
+ rect->end_trim->property_x1() = x2 - trim_handle_size;
+ rect->end_trim->property_y1() = 1.0;
+ rect->end_trim->property_x2() = x2;
+ rect->end_trim->property_y2() = 1.0 + trim_handle_size;
+
rect->start_trim->show();
rect->end_trim->show();
} else {
void
TimeAxisView::hide_selection ()
{
- if (GTK_OBJECT_FLAGS(GTK_OBJECT(selection_group)) & GNOME_CANVAS_ITEM_VISIBLE) {
+ if (canvas_item_visible (selection_group)) {
while (!used_selection_rects.empty()) {
free_selection_rects.push_front (used_selection_rects.front());
used_selection_rects.pop_front();
}
void
-TimeAxisView::order_selection_trims (Gnome::Canvas::Item *item, bool put_start_on_top)
+TimeAxisView::order_selection_trims (ArdourCanvas::Item *item, bool put_start_on_top)
{
/* find the selection rect this is for. we have the item corresponding to one
of the trim handles.
free_selection_rects.push_front (rect);
- rect->rect->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_rect_event), rect));
- rect->start_trim->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_start_trim_event), rect));
- rect->end_trim->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_end_trim_event), rect));
+ rect->rect->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_rect_event), rect->rect, rect));
+ rect->start_trim->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_start_trim_event), rect->rect, rect));
+ rect->end_trim->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_selection_end_trim_event), rect->rect, rect));
}
rect = free_selection_rects.front();