* @param ifta the parent ImageFrameTimeAxis of this view helper
*/
ImageFrameTimeAxisView::ImageFrameTimeAxisView (ImageFrameTimeAxis& tv)
- : _trackview (tv)
+ : _trackview (tv),
+ canvas_group (*_trackview.canvas_display),
+ canvas_rect (canvas_group, 0.0, 0.0, 1000000.0, tv.height)
{
region_color = _trackview.color() ;
stream_base_color = color_map[cImageTrackBase] ;
- canvas_group = gtk_canvas_item_new (GTK_CANVAS_GROUP(_trackview.canvas_display), gtk_canvas_group_get_type (), 0) ;
+ canvas_rect.property_outline_color_rgba() = color_map[cImageTrackOutline];
+ canvas_rect.property_fill_color_rgba() = stream_base_color;
- canvas_rect = gtk_canvas_item_new (GTK_CANVAS_GROUP(canvas_group),
- gtk_canvas_simplerect_get_type(),
- "x1", 0.0,
- "y1", 0.0,
- "x2", 1000000.0,
- "y2", (double) tv.height,
- "outline_color_rgba", color_map[cImageTrackOutline],
- "fill_color_rgba", stream_base_color,
- 0) ;
-
- gtk_signal_connect(GTK_OBJECT(canvas_rect), "event", (GtkSignalFunc) PublicEditor::canvas_imageframe_view_event, &_trackview) ;
+ canvas_rect.signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_imageframe_view_event), (ArdourCanvas::Item*) &canvas_rect, &tv));
_samples_per_unit = _trackview.editor.get_current_zoom() ;
- _trackview.editor.ZoomChanged.connect (slot (*this, &ImageFrameTimeAxisView::reset_samples_per_unit)) ;
+ _trackview.editor.ZoomChanged.connect (mem_fun(*this, &ImageFrameTimeAxisView::reset_samples_per_unit)) ;
selected_imageframe_group = 0 ;
selected_imageframe_view = 0 ;
iter = next ;
}
- // Destroy all our canvas components
- if(canvas_rect)
- {
- gtk_object_destroy(GTK_OBJECT(canvas_rect)) ;
- canvas_rect = 0 ;
- }
-
- if(canvas_group)
- {
- gtk_object_destroy(GTK_OBJECT(canvas_group));
- canvas_group = 0 ;
- }
}
ImageFrameTimeAxisView::set_height (gdouble h)
{
/* limit the values to something sane-ish */
- if (h < 10.0 || h > 1000.0)
- {
+ if (h < 10.0 || h > 1000.0) {
return(-1) ;
}
- if(canvas_rect != 0)
- {
- gtk_object_set(GTK_OBJECT(canvas_rect), "y2", h, NULL) ;
- }
+ canvas_rect.property_y2() = h ;
+
for(ImageFrameGroupList::const_iterator citer = imageframe_groups.begin(); citer != imageframe_groups.end(); ++citer)
{
ImageFrameTimeAxisView::set_position (gdouble x, gdouble y)
{
- gtk_canvas_item_set (canvas_group, "x", x, "y", y, NULL);
+ canvas_group.property_x() = x;
+ canvas_group.property_y() = y;
+
return 0;
}
* @param color the new base color
*/
void
-ImageFrameTimeAxisView::apply_color(GdkColor& color)
+ImageFrameTimeAxisView::apply_color(Gdk::Color& color)
{
region_color = color ;
for(ImageFrameGroupList::const_iterator citer = imageframe_groups.begin(); citer != imageframe_groups.end(); citer++)
imageframe_groups.push_front(iftag) ;
- iftag->GoingAway.connect(bind(slot (*this,&ImageFrameTimeAxisView::remove_imageframe_group), iftag, (void*)this)) ;
+ iftag->GoingAway.connect(bind(mem_fun(*this,&ImageFrameTimeAxisView::remove_imageframe_group), iftag, (void*)this)) ;
ImageFrameGroupAdded(iftag, src) ; /* EMIT_SIGNAL */
}
void
ImageFrameTimeAxisView::remove_imageframe_group(ImageFrameTimeAxisGroup* iftag, void* src)
{
- ENSURE_GUI_THREAD(bind (slot (*this, &ImageFrameTimeAxisView::remove_imageframe_group), iftag, src));
+ ENSURE_GUI_THREAD(bind (mem_fun(*this, &ImageFrameTimeAxisView::remove_imageframe_group), iftag, src));
ImageFrameGroupList::iterator i;
if((i = find (imageframe_groups.begin(), imageframe_groups.end(), iftag)) != imageframe_groups.end())
if(selected_imageframe_view)
{
- selected_imageframe_view->set_selected(false, this) ;
+ selected_imageframe_view->set_selected(false) ;
}
selected_imageframe_view = ifv ;
- selected_imageframe_view->set_selected(true, this) ;
+ selected_imageframe_view->set_selected(true) ;
}
/**
if(selected_imageframe_view)
{
- selected_imageframe_view->set_selected(false, this) ;
+ selected_imageframe_view->set_selected(false) ;
}
selected_imageframe_view = 0 ;
}