mega commit to remove gtk_object cruft, and much other stuff
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 28 Nov 2005 22:36:26 +0000 (22:36 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 28 Nov 2005 22:36:26 +0000 (22:36 +0000)
git-svn-id: svn://localhost/trunk/ardour2@139 d708f5d6-7413-0410-9779-e7cbd77b26cf

30 files changed:
gtk2_ardour/SConscript
gtk2_ardour/actions.cc
gtk2_ardour/ardour-menus.xml
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/audio_time_axis.cc
gtk2_ardour/automation_line.cc
gtk2_ardour/automation_time_axis.cc
gtk2_ardour/canvas-imageframe.c
gtk2_ardour/canvas-waveview.c
gtk2_ardour/connection_editor.cc
gtk2_ardour/crossfade_edit.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor_markers.cc
gtk2_ardour/editor_mixer.cc
gtk2_ardour/editor_mouse.cc
gtk2_ardour/editor_region_list.cc
gtk2_ardour/editor_rulers.cc
gtk2_ardour/editor_selection_list.cc
gtk2_ardour/editor_tempodisplay.cc
gtk2_ardour/imageframe_time_axis.cc
gtk2_ardour/marker_time_axis_view.cc
gtk2_ardour/mixer_ui.cc
gtk2_ardour/redirect_box.cc
gtk2_ardour/regionview.cc
gtk2_ardour/regionview.h
gtk2_ardour/route_params_ui.cc
gtk2_ardour/streamview.cc
gtk2_ardour/time_axis_view.cc
gtk2_ardour/utils.cc
gtk2_ardour/utils.h

index 4479f345ad941d56f0f70cd6b9c9229f6042c3af..168db5871bdde11628bf4890fc13958a88c2dae1 100644 (file)
@@ -89,6 +89,7 @@ editing.cc
 editor.cc
 editor_actions.cc
 editor_audiotrack.cc
+editor_canvas.cc
 editor_canvas_events.cc
 editor_cursors.cc
 editor_edit_groups.cc
index 1d90134830faa4ab09c124b7925f31baac55b532..1ac2ea7228b84d435052b509b5c43a730a62c564 100644 (file)
@@ -51,13 +51,17 @@ ActionManager::init ()
        ui_manager = UIManager::create ();
 
        try {
-         ui_manager->add_ui_from_file (ARDOUR::find_config_file("ardour-menus.xml"));
+               ui_manager->add_ui_from_file (ARDOUR::find_config_file("ardour-menus.xml"));
        } catch (Glib::MarkupError& err) {
                error << "badly formatted UI definition file" << endmsg;
        } catch (...) {
-         std::cerr << "ardour action xml file not found" << endl;
+               cerr << "ardour action xml file not found" << endl;
        }
-    
+       
+       RefPtr<ActionGroup> grp = ActionGroup::create ("misc");
+       register_action (grp, "null", "relax");
+       
+       ui_manager->insert_action_group (grp);
 }
 
 RefPtr<Action>
index 2d01aaaf1db7722a968bab7b4841cf48d408da90..a451055bc16e11f286b4f25607f7e71c59b11e04 100644 (file)
@@ -1,28 +1,7 @@
 <ui>
 
-    <popup name='ShuttleUnitsMenu'>
-       <menuitem action='SetShuttleUnitsSemitones'/>
-       <menuitem action='SetShuttleUnitsPercentage'/>
-    </popup>
-
-    <popup name='ShuttleStyleMenu'>
-       <menuitem action='SetShuttleActionSprung'/>
-       <menuitem action='SetShuttleActionWheel'/>
-    </popup>
-
-    <popup name='RegionListMenu'>
-       <menuitem action='rlAudition'/>
-       <menuitem action='rlHide'/>
-       <menuitem action='rlRemove'/>
-       <separator/>
-       <menuitem action='rlShowAll'/>
-       <separator/>
-        <menuitem action='rlImportAudio'/>
-        <menuitem action='rlEmbedAudio'/>
-    </popup>
-
-    <menubar name='Main'>
-        <menu action='Session'>
+    <menubar name='Main' action='null'>
+        <menu name='Session' action='null'>
            <menuitem action='New'/>
            <menuitem action='Open'/>
            <menuitem action='Recent'/>
            <separator/>
            <menuitem action='AddTrackBus'/>
            <separator/>
-           <menu action='Export'>
+           <menu name='Export' action='null'>
                <menuitem action='ExportSession'/>
                <menuitem action='ExportRange'/>
            </menu>
            <separator/>
-           <menu name='Cleanup'>
+           <menu name='Cleanup' action='null'>
                <menuitem action='CleanupUnused'/>
                <menuitem action='FlushWastebasket'/>
            </menu>
            <separator/>
            <menuitem action='Quit'/>
         </menu>
-        <menu name='JACK'>
-               <menuitem action='Disconnect'/>
-               <menuitem action='Connect'/>
-               <menu name='Latency'>
+        <menu name='JACK' action='null'>
+               <menuitem action='JACKDisconnect'/>
+               <menuitem action='JACKReconnect'/>
+               <menu name='Latency' action='null'>
                    <menuitem action='JACKLatency32'/>
                    <menuitem action='JACKLatency64'/>
                    <menuitem action='JACKLatency128'/>
@@ -57,7 +36,7 @@
                    <menuitem action='JACKLatency8192'/>
                </menu>
         </menu>
-        <menu name='Windows'>
+        <menu name='Windows' action = 'null'>
                <menuitem action='GotoEditor'/>
                <menuitem action='GotoMixer'/>
                <menuitem action='ToggleOptionsEditor'/>
@@ -65,7 +44,6 @@
                <menuitem action='ToggleConnections'/>
                <menuitem action='ToggleLocations'/>
                <menuitem action='ToggleBigClock'/>
-               <menuitem action='ToggleAbout'/>
         </menu>
      </menubar>
 </ui>
index b7e9d89f0326c99202bb82287b2e182c36314763..87a5ebf2e5fedfc4240fca18d69e4f3fcd4dab08 100644 (file)
@@ -63,7 +63,10 @@ ARDOUR_UI::install_actions ()
        Glib::RefPtr<ActionGroup> main_actions = ActionGroup::create (X_("Main"));
        Glib::RefPtr<Action> act;
 
-       ActionManager::ActionManager::register_action (main_actions, X_("New"), _("New"),  bind (mem_fun(*this, &ARDOUR_UI::new_session), false, string ()));
+       act = ActionManager::ActionManager::register_action (main_actions, X_("New"), _("New"),  bind (mem_fun(*this, &ARDOUR_UI::new_session), false, string ()));
+
+       cerr << "\n\n\n NEW has accel path " << act->get_accel_path() << endl;
+
        ActionManager::ActionManager::register_action (main_actions, X_("Open"), _("Open"),  mem_fun(*this, &ARDOUR_UI::open_session));
        ActionManager::ActionManager::register_action (main_actions, X_("Recent"), _("Recent"),  mem_fun(*this, &ARDOUR_UI::open_recent_session));
        act = ActionManager::register_action (main_actions, X_("Close"), _("Close"),  mem_fun(*this, &ARDOUR_UI::close_session));
index 1c25863e23203ed5cdba33249076bd8e2d0aebb3..1f7f813a47f1ece34ba9b2ef191f4f44b7df6483 100644 (file)
@@ -500,12 +500,10 @@ AudioTimeAxisView::show_timestretch (jack_nframes_t start, jack_nframes_t end)
        x2 = (end - 1) / editor.get_current_zoom();
        y2 = height - 2;
        
-       gtk_object_set (GTK_OBJECT(timestretch_rect), 
-                       "x1", x1,
-                       "y1", 1.0,
-                       "x2", x2,
-                       "y2", y2,
-                       NULL);
+       timestretch_rect->property_x1() = x1;
+       timestretch_rect->property_y1() = 1.0;
+       timestretch_rect->property_x2() = x2;
+       timestretch_rect->property_y2() = y2;
 }
 
 void
index bf75edb461e2198d65eeff455e31f04fab86a2b6..dd3c14a23fd6fcdcdcaca5af9446ee7237c59064 100644 (file)
@@ -105,7 +105,7 @@ ControlPoint::ControlPoint (const ControlPoint& other, bool dummy_arg_to_force_s
 
 ControlPoint::~ControlPoint ()
 {
-       gtk_object_destroy (GTK_OBJECT(item));
+       delete item;
 }
 
 bool
@@ -246,8 +246,7 @@ AutomationLine::AutomationLine (string name, TimeAxisView& tv, ArdourCanvas::Gro
 AutomationLine::~AutomationLine ()
 {
        vector_delete (&control_points);
-
-       gtk_object_destroy (GTK_OBJECT(group));
+       delete group;
 }
 
 bool
index 286730bf14090f4a4b52f7a53c24d34ee8c1f96c..989c86b916bfa38b12d20bec2e16996a5e5032a2 100644 (file)
@@ -300,7 +300,7 @@ AutomationTimeAxisView::set_height (TrackHeight h)
        controls_table.show_all ();
 
        TimeAxisView::set_height (h);
-       gtk_object_set (GTK_OBJECT(base_rect), "y2", (double) h, NULL);
+       base_rect->property_y2() = h;
 
        for (vector<AutomationLine*>::iterator i = lines.begin(); i != lines.end(); ++i) {
                (*i)->set_height (h);
index 31ac9e36de689af1885261bbb3269310076bca99..6ba51c0fdc92b0c64b47d4ee96d938ea4e31a11b 100644 (file)
@@ -100,10 +100,9 @@ gnome_canvas_imageframe_class_init (GnomeCanvasImageFrameClass *class)
 
        g_object_class_install_property (gobject_class,
                                         PROP_PIXBUF,
-                                        g_param_spec_boxed ("pixbuf",
+                                        g_param_spec_pointer ("pixbuf",
                                                             _("pixbuf"),
                                                             _("the pixbuf"),
-                                                            GDK_TYPE_PIXBUF,
                                                             G_PARAM_WRITABLE)); 
        g_object_class_install_property (gobject_class,
                                         PROP_X,
@@ -291,10 +290,10 @@ gnome_canvas_imageframe_set_property (GObject *object,
 
        switch (prop_id) {
        case PROP_PIXBUF:
-               if (item->canvas->aa && g_value_get_boxed (value)) {
+               if (item->canvas->aa && g_value_get_pointer (value)) {
                        if (image->pixbuf != NULL)
                                art_pixbuf_free (image->pixbuf);
-                       image->pixbuf = g_value_get_boxed (value);
+                       image->pixbuf = g_value_get_pointer (value);
                }
                update = TRUE;
                break;
index 370c324d9d4c1ce7d87578cf20522765ed00ef5c..f47529973ec828e34d9a9f5d615be83199bb0ada 100644 (file)
-/*
-    Copyright (C) 2000-2002 Paul Davis 
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-    $Id$
-*/
-
-#include <stdio.h>
-#include <math.h>
-#include <libgnomecanvas/libgnomecanvas.h>
-#include <string.h>
-#include <limits.h>
-
-#include <ardour/dB.h>
-
-#include "canvas-waveview.h"
-#include "rgb_macros.h"
-
-enum {
-       PROP_0,
-       PROP_DATA_SRC,
-       PROP_CHANNEL,
-       PROP_LENGTH_FUNCTION,
-       PROP_SOURCEFILE_LENGTH_FUNCTION,
-       PROP_PEAK_FUNCTION,
-       PROP_GAIN_FUNCTION,
-       PROP_GAIN_SRC,
-       PROP_CACHE,
-       PROP_CACHE_UPDATER,
-       PROP_SAMPLES_PER_UNIT,
-       PROP_AMPLITUDE_ABOVE_AXIS,
-       PROP_X,
-       PROP_Y,
-       PROP_HEIGHT,
-       PROP_WAVE_COLOR,
-       PROP_RECTIFIED,
-       PROP_REGION_START
-};
-
-static void gnome_canvas_waveview_class_init     (GnomeCanvasWaveViewClass *class);
-
-static void gnome_canvas_waveview_init           (GnomeCanvasWaveView      *waveview);
-
-static void gnome_canvas_waveview_destroy        (GtkObject            *object);
-
-static void gnome_canvas_waveview_set_property   (GObject        *object,
-                                                 guint           prop_id,
-                                                 const GValue   *value,
-                                                 GParamSpec     *pspec);
-static void gnome_canvas_waveview_get_property   (GObject        *object,
-                                                 guint           prop_id,
-                                                 GValue         *value,
-                                                 GParamSpec     *pspec);
-
-static void   gnome_canvas_waveview_update       (GnomeCanvasItem *item,
-                                                 double          *affine,
-                                                 ArtSVP          *clip_path,
-                                                 int              flags);
-
-static void   gnome_canvas_waveview_bounds       (GnomeCanvasItem *item,
-                                                 double          *x1,
-                                                 double          *y1,
-                                                 double          *x2,
-                                                 double          *y2);
-
-static double gnome_canvas_waveview_point        (GnomeCanvasItem  *item,
-                                                 double            x,
-                                                 double            y,
-                                                 int               cx,
-                                                 int               cy,
-                                                 GnomeCanvasItem **actual_item);
-
-static void gnome_canvas_waveview_render         (GnomeCanvasItem *item,
-                                                 GnomeCanvasBuf  *buf);
-
-static void gnome_canvas_waveview_draw           (GnomeCanvasItem *item,
-                                                 GdkDrawable     *drawable,
-                                                 int              x,
-                                                 int              y,
-                                                 int              w,
-                                                 int              h);
-
-static void gnome_canvas_waveview_set_data_src   (GnomeCanvasWaveView *,
-                                                 void *);
-
-static void gnome_canvas_waveview_set_channel    (GnomeCanvasWaveView *,
-                                                 guint32);
-
-static gint32 gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview,
-                                                 gulong               start_sample,
-                                                 gulong               end_sample);
-
-static GnomeCanvasItemClass *parent_class;
-
-GType
-gnome_canvas_waveview_get_type (void)
-{
-       static GType waveview_type;
-
-       if (!waveview_type) {
-               static const GTypeInfo object_info = {
-                       sizeof (GnomeCanvasWaveViewClass),
-                       (GBaseInitFunc) NULL,
-                       (GBaseFinalizeFunc) NULL,
-                       (GClassInitFunc) gnome_canvas_waveview_class_init,
-                       (GClassFinalizeFunc) NULL,
-                       NULL,                   /* class_data */
-                       sizeof (GnomeCanvasWaveView),
-                       0,                      /* n_preallocs */
-                       (GInstanceInitFunc) gnome_canvas_waveview_init,
-                       NULL                    /* value_table */
-               };
-
-               waveview_type = g_type_register_static (GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasWaveView",
-                                                       &object_info, 0);
-       }
+ /*
+     Copyright (C) 2000-2002 Paul Davis 
 
-       return waveview_type;
-}
+     This program is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published by
+     the Free Software Foundation; either version 2 of the License, or
+     (at your option) any later version.
 
-static void
-gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
-{
-        GObjectClass *gobject_class;
-       GtkObjectClass *object_class;
-       GnomeCanvasItemClass *item_class;
+     This program is distributed in the hope that it will be useful,
+     but WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+     GNU General Public License for more details.
 
-       gobject_class = (GObjectClass *) class;
-       object_class = (GtkObjectClass *) class;
-       item_class = (GnomeCanvasItemClass *) class;
+     You should have received a copy of the GNU General Public License
+     along with this program; if not, write to the Free Software
+     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-       parent_class = g_type_class_peek_parent (class);
+     $Id$
+ */
 
-       gobject_class->set_property = gnome_canvas_waveview_set_property;
-       gobject_class->get_property = gnome_canvas_waveview_get_property;
-       
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_DATA_SRC,
-                 g_param_spec_boxed ("data_src", NULL, NULL,
-                                    GTK_TYPE_POINTER,
+ #include <stdio.h>
+ #include <math.h>
+ #include <libgnomecanvas/libgnomecanvas.h>
+ #include <string.h>
+ #include <limits.h>
+
+ #include <ardour/dB.h>
+
+ #include "canvas-waveview.h"
+ #include "rgb_macros.h"
+
+ enum {
+        PROP_0,
+        PROP_DATA_SRC,
+        PROP_CHANNEL,
+        PROP_LENGTH_FUNCTION,
+        PROP_SOURCEFILE_LENGTH_FUNCTION,
+        PROP_PEAK_FUNCTION,
+        PROP_GAIN_FUNCTION,
+        PROP_GAIN_SRC,
+        PROP_CACHE,
+        PROP_CACHE_UPDATER,
+        PROP_SAMPLES_PER_UNIT,
+        PROP_AMPLITUDE_ABOVE_AXIS,
+        PROP_X,
+        PROP_Y,
+        PROP_HEIGHT,
+        PROP_WAVE_COLOR,
+        PROP_RECTIFIED,
+        PROP_REGION_START
+ };
+
+ static void gnome_canvas_waveview_class_init     (GnomeCanvasWaveViewClass *class);
+
+ static void gnome_canvas_waveview_init           (GnomeCanvasWaveView      *waveview);
+
+ static void gnome_canvas_waveview_destroy        (GtkObject            *object);
+
+ static void gnome_canvas_waveview_set_property   (GObject        *object,
+                                                  guint           prop_id,
+                                                  const GValue   *value,
+                                                  GParamSpec     *pspec);
+ static void gnome_canvas_waveview_get_property   (GObject        *object,
+                                                  guint           prop_id,
+                                                  GValue         *value,
+                                                  GParamSpec     *pspec);
+
+ static void   gnome_canvas_waveview_update       (GnomeCanvasItem *item,
+                                                  double          *affine,
+                                                  ArtSVP          *clip_path,
+                                                  int              flags);
+
+ static void   gnome_canvas_waveview_bounds       (GnomeCanvasItem *item,
+                                                  double          *x1,
+                                                  double          *y1,
+                                                  double          *x2,
+                                                  double          *y2);
+
+ static double gnome_canvas_waveview_point        (GnomeCanvasItem  *item,
+                                                  double            x,
+                                                  double            y,
+                                                  int               cx,
+                                                  int               cy,
+                                                  GnomeCanvasItem **actual_item);
+
+ static void gnome_canvas_waveview_render         (GnomeCanvasItem *item,
+                                                  GnomeCanvasBuf  *buf);
+
+ static void gnome_canvas_waveview_draw           (GnomeCanvasItem *item,
+                                                  GdkDrawable     *drawable,
+                                                  int              x,
+                                                  int              y,
+                                                  int              w,
+                                                  int              h);
+
+ static void gnome_canvas_waveview_set_data_src   (GnomeCanvasWaveView *,
+                                                  void *);
+
+ static void gnome_canvas_waveview_set_channel    (GnomeCanvasWaveView *,
+                                                  guint32);
+
+ static gint32 gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview,
+                                                  gulong               start_sample,
+                                                  gulong               end_sample);
+
+ static GnomeCanvasItemClass *parent_class;
+
+ GType
+ gnome_canvas_waveview_get_type (void)
+ {
+        static GType waveview_type;
+
+        if (!waveview_type) {
+                static const GTypeInfo object_info = {
+                        sizeof (GnomeCanvasWaveViewClass),
+                        (GBaseInitFunc) NULL,
+                        (GBaseFinalizeFunc) NULL,
+                        (GClassInitFunc) gnome_canvas_waveview_class_init,
+                        (GClassFinalizeFunc) NULL,
+                        NULL,                  /* class_data */
+                        sizeof (GnomeCanvasWaveView),
+                        0,                     /* n_preallocs */
+                        (GInstanceInitFunc) gnome_canvas_waveview_init,
+                        NULL                   /* value_table */
+                };
+
+                waveview_type = g_type_register_static (GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasWaveView",
+                                                        &object_info, 0);
+        }
+
+        return waveview_type;
+ }
+
+ static void
+ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
+ {
+        GObjectClass *gobject_class;
+        GtkObjectClass *object_class;
+        GnomeCanvasItemClass *item_class;
+
+        gobject_class = (GObjectClass *) class;
+        object_class = (GtkObjectClass *) class;
+        item_class = (GnomeCanvasItemClass *) class;
+
+        parent_class = g_type_class_peek_parent (class);
+
+        gobject_class->set_property = gnome_canvas_waveview_set_property;
+        gobject_class->get_property = gnome_canvas_waveview_get_property;
+
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_DATA_SRC,
+                 g_param_spec_pointer ("data_src", NULL, NULL,
+                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_CHANNEL,
+                 g_param_spec_uint ("channel", NULL, NULL,
+                                    0, G_MAXUINT, 0,
                                     (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-       
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_CHANNEL,
-                 g_param_spec_uint ("channel", NULL, NULL,
-                                   0, G_MAXUINT, 0,
-                                   (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-       
-       g_object_class_install_property
-               (gobject_class,
-                PROP_LENGTH_FUNCTION,
-                g_param_spec_boxed ("length_function", NULL, NULL,
-                                    GTK_TYPE_POINTER,
-                                    (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-       
-       g_object_class_install_property
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_LENGTH_FUNCTION,
+                 g_param_spec_pointer ("length_function", NULL, NULL,
+                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
                 (gobject_class,
                  PROP_SOURCEFILE_LENGTH_FUNCTION,
-                 g_param_spec_boxed ("sourcefile_length_function", NULL, NULL,
-                                    GTK_TYPE_POINTER,
-                                    (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-       
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_PEAK_FUNCTION,
-                 g_param_spec_boxed ("peak_function", NULL, NULL,
-                                    GTK_TYPE_POINTER,
-                                    (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-       
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_GAIN_FUNCTION,
-                 g_param_spec_boxed ("gain_function", NULL, NULL,
-                                    GTK_TYPE_POINTER,
-                                    (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-       
-       g_object_class_install_property
-                (gobject_class,
+                 g_param_spec_pointer ("sourcefile_length_function", NULL, NULL,
+                                      (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_PEAK_FUNCTION,
+                 g_param_spec_pointer ("peak_function", NULL, NULL,
+                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_GAIN_FUNCTION,
+                 g_param_spec_pointer ("gain_function", NULL, NULL,
+                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
                  PROP_GAIN_SRC,
-                 g_param_spec_boxed ("gain_src", NULL, NULL,
-                                    GTK_TYPE_POINTER,
-                                    (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-       
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_CACHE,
-                 g_param_spec_boxed ("cache", NULL, NULL,
-                                    GTK_TYPE_POINTER,
-                                    (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+                 g_param_spec_pointer ("gain_src", NULL, NULL,
+                                      (G_PARAM_READABLE | G_PARAM_WRITABLE)));
        
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_CACHE_UPDATER,
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_CACHE,
+                 g_param_spec_pointer ("cache", NULL, NULL,
+                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_CACHE_UPDATER,
                  g_param_spec_boolean ("cache_updater", NULL, NULL,
                                       FALSE,
                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-       
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_SAMPLES_PER_UNIT,
-                 g_param_spec_double ("sample_per_unit", NULL, NULL,
-                                     0.0, G_MAXDOUBLE, 0.0,
-                                     (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_AMPLITUDE_ABOVE_AXIS,
-                 g_param_spec_double ("amplitude_above_axis", NULL, NULL,
-                                     0.0, G_MAXDOUBLE, 0.0,
-                                     (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_X,
-                 g_param_spec_double ("x", NULL, NULL,
-                                     0.0, G_MAXDOUBLE, 0.0,
-                                     (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_Y,
-                 g_param_spec_double ("y", NULL, NULL,
-                                     0.0, G_MAXDOUBLE, 0.0,
-                                     (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_HEIGHT,
-                 g_param_spec_double ("height", NULL, NULL,
-                                     0.0, G_MAXDOUBLE, 0.0,
-                                     (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
-        g_object_class_install_property
-                (gobject_class,
-                 PROP_WAVE_COLOR,
-                 g_param_spec_uint ("wave_color", NULL, NULL,
-                                   0, G_MAXUINT, 0,
-                                   (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
-       g_object_class_install_property
-                (gobject_class,
-                 PROP_RECTIFIED,
-                 g_param_spec_boolean ("rectified", NULL, NULL,
-                                      FALSE,
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_SAMPLES_PER_UNIT,
+                 g_param_spec_double ("samples_per_unit", NULL, NULL,
+                                      0.0, G_MAXDOUBLE, 0.0,
                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
-        g_object_class_install_property
-                (gobject_class,
-                 PROP_REGION_START,
-                 g_param_spec_uint ("region_start", NULL, NULL,
-                                   0, G_MAXUINT, 0,
-                                   (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
-       object_class->destroy = gnome_canvas_waveview_destroy;
-
-       item_class->update = gnome_canvas_waveview_update;
-       item_class->bounds = gnome_canvas_waveview_bounds;
-       item_class->point = gnome_canvas_waveview_point;
-       item_class->render = gnome_canvas_waveview_render;
-       item_class->draw = gnome_canvas_waveview_draw;
-}
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_AMPLITUDE_ABOVE_AXIS,
+                 g_param_spec_double ("amplitude_above_axis", NULL, NULL,
+                                      0.0, G_MAXDOUBLE, 0.0,
+                                      (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_X,
+                 g_param_spec_double ("x", NULL, NULL,
+                                      0.0, G_MAXDOUBLE, 0.0,
+                                      (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_Y,
+                 g_param_spec_double ("y", NULL, NULL,
+                                      0.0, G_MAXDOUBLE, 0.0,
+                                      (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_HEIGHT,
+                 g_param_spec_double ("height", NULL, NULL,
+                                      0.0, G_MAXDOUBLE, 0.0,
+                                      (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_WAVE_COLOR,
+                 g_param_spec_uint ("wave_color", NULL, NULL,
+                                    0, G_MAXUINT, 0,
+                                    (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_RECTIFIED,
+                 g_param_spec_boolean ("rectified", NULL, NULL,
+                                       FALSE,
+                                       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        g_object_class_install_property
+                (gobject_class,
+                 PROP_REGION_START,
+                 g_param_spec_uint ("region_start", NULL, NULL,
+                                    0, G_MAXUINT, 0,
+                                    (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+        
+        object_class->destroy = gnome_canvas_waveview_destroy;
+        
+        item_class->update = gnome_canvas_waveview_update;
+        item_class->bounds = gnome_canvas_waveview_bounds;
+        item_class->point = gnome_canvas_waveview_point;
+        item_class->render = gnome_canvas_waveview_render;
+        item_class->draw = gnome_canvas_waveview_draw;
+ }
 
 GnomeCanvasWaveViewCache*
 gnome_canvas_waveview_cache_new ()
index f1ee07149fa9480ab29a4d6292e20979dc6a1df8..938be6763e6d85396140cdb12abc65ef72fd186b 100644 (file)
@@ -333,8 +333,8 @@ ConnectionEditor::refill_connection_display ()
        input_connection_display.set_model (Glib::RefPtr<TreeModel>(0));
        output_connection_display.set_model (Glib::RefPtr<TreeModel>(0));
 
-       input_connection_model.clear();
-       output_connection_model.clear();
+       input_connection_model->clear();
+       output_connection_model->clear();
 
        current_connection = 0;
        
index b5242d5cf55a3aafce9877afaa9552143e4be033..521c6b5c686f2c24ff0f6cb42c36680272646eac 100644 (file)
@@ -454,7 +454,7 @@ CrossfadeEditor::canvas_event (GdkEvent* event)
 
 CrossfadeEditor::Point::~Point()
 {
-       gtk_object_destroy (GTK_OBJECT(box));
+       delete box;
 }
 
 CrossfadeEditor::Point*
index 1be409f4a1d6673adc146fe42ef291a5023abf2c..caa66290d2869e002203ce40f1048c22afd9585f 100644 (file)
@@ -26,8 +26,6 @@
 
 #include <sigc++/bind.h>
 
-#include <libgnomecanvasmm/init.h>
-
 #include <pbd/error.h>
 
 #include <gtkmm/image.h>
@@ -60,7 +58,6 @@
 #include "rgb_macros.h"
 #include "selection.h"
 #include "streamview.h"
-#include "simpleline.h"
 #include "time_axis_view.h"
 #include "utils.h"
 #include "crossfade_view.h"
@@ -85,9 +82,6 @@ using namespace Glib;
 using namespace Gtkmm2ext;
 using namespace Editing;
 
-/* XXX this is a hack. it ought to be the maximum value of an jack_nframes_t */
-
-const double max_canvas_coordinate = 100000000.0;
 const double Editor::timebar_height = 15.0;
 
 #include "editor_xpms"
@@ -795,186 +789,6 @@ Editor::left_track_canvas (GdkEventCrossing *ev)
 }
 
 
-void
-Editor::initialize_canvas ()
-{
-       ArdourCanvas::init ();
-
-       /* adjust sensitivity for "picking" items */
-
-       // GNOME_CANVAS(track_canvas)->close_enough = 2;
-
-       track_canvas.signal_event().connect (bind (mem_fun (*this, &Editor::track_canvas_event), (ArdourCanvas::Item*) 0));
-       track_canvas.set_name ("EditorMainCanvas");
-       track_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK);
-       track_canvas.signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
-       
-       /* set up drag-n-drop */
-       vector<Gtk::TargetEntry> target_table;
-       
-       target_table.push_back (TargetEntry ("STRING"));
-       target_table.push_back (TargetEntry ("text/plain"));
-       target_table.push_back (TargetEntry ("text/uri-list"));
-       target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
-
-       // GTK2FIX
-       // track_canvas.drag_dest_set (target_table, DEST_DEFAULT_ALL, GdkDragAction (Gdk::ACTION_COPY|Gdk::ACTION_MOVE));
-       // track_canvas.signal_drag_data_received().connect (mem_fun(*this, &Editor::track_canvas_drag_data_received));
-
-       /* stuff for the verbose canvas cursor */
-
-       Pango::FontDescription font = get_font_for_style (N_("VerboseCanvasCursor"));
-
-       verbose_canvas_cursor = new ArdourCanvas::Text (*track_canvas.root());
-       verbose_canvas_cursor->property_font_desc() = font;
-       // GTK2FIX
-       // verbose_canvas_cursor->property_anchor() = GTK_ANCHOR_NW;
-       verbose_canvas_cursor->property_fill_color_rgba() = color_map[cVerboseCanvasCursor];
-       
-       verbose_cursor_visible = false;
-       
-       /* a group to hold time (measure) lines */
-       
-       time_line_group = new ArdourCanvas::Group (*track_canvas.root(), 0.0, 0.0);
-       cursor_group = new ArdourCanvas::Group (*track_canvas.root(), 0.0, 0.0);
-       
-       time_canvas.set_name ("EditorTimeCanvas");
-       time_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK);
-       
-       meter_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0);
-       tempo_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0);
-       marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 2.0);
-       range_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 3.0);
-       transport_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 4.0);
-       
-       tempo_bar = new ArdourCanvas::SimpleRect (*tempo_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
-       tempo_bar->property_fill_color_rgba() = color_map[cTempoBar];
-       tempo_bar->property_outline_pixels() = 0;
-       
-       meter_bar = new ArdourCanvas::SimpleRect (*meter_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
-       meter_bar->property_fill_color_rgba() = color_map[cMeterBar];
-       meter_bar->property_outline_pixels() = 0;
-       
-       marker_bar = new ArdourCanvas::SimpleRect (*marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
-       marker_bar->property_fill_color_rgba() = color_map[cMarkerBar];
-       marker_bar->property_outline_pixels() = 0;
-       
-       range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
-       range_marker_bar->property_fill_color_rgba() = color_map[cRangeMarkerBar];
-       range_marker_bar->property_outline_pixels() = 0;
-       
-       transport_marker_bar = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
-       transport_marker_bar->property_fill_color_rgba() = color_map[cTransportMarkerBar];
-       transport_marker_bar->property_outline_pixels() = 0;
-       
-       range_bar_drag_rect = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
-       range_bar_drag_rect->property_fill_color_rgba() = color_map[cRangeDragBarRectFill];
-       range_bar_drag_rect->property_outline_color_rgba() = color_map[cRangeDragBarRect];
-       range_bar_drag_rect->property_outline_pixels() = 0;
-       range_bar_drag_rect->hide ();
-       
-       transport_bar_drag_rect = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
-       transport_bar_drag_rect ->property_fill_color_rgba() = color_map[cTransportDragRectFill];
-       transport_bar_drag_rect->property_outline_color_rgba() = color_map[cTransportDragRect];
-       transport_bar_drag_rect->property_outline_pixels() = 0;
-       transport_bar_drag_rect->hide ();
-       
-       marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
-       marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
-
-       marker_drag_line = new ArdourCanvas::Line (*track_canvas.root());
-       marker_drag_line->property_width_pixels() = 1;
-       marker_drag_line->property_fill_color_rgba() = color_map[cMarkerDragLine];
-       marker_drag_line->property_points() = marker_drag_line_points;
-       marker_drag_line->hide();
-
-       range_marker_drag_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
-       range_marker_drag_rect->property_fill_color_rgba() = color_map[cRangeDragRectFill];
-       range_marker_drag_rect->property_outline_color_rgba() = color_map[cRangeDragRect];
-       range_marker_drag_rect->hide ();
-       
-       transport_loop_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
-       transport_loop_range_rect->property_fill_color_rgba() = color_map[cTransportLoopRectFill];
-       transport_loop_range_rect->property_outline_color_rgba() = color_map[cTransportLoopRect];
-       transport_loop_range_rect->property_outline_pixels() = 1;
-       transport_loop_range_rect->hide();
-
-       transport_punch_range_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
-       transport_punch_range_rect->property_fill_color_rgba() = color_map[cTransportPunchRectFill];
-       transport_punch_range_rect->property_outline_color_rgba() = color_map[cTransportPunchRect];
-       transport_punch_range_rect->property_outline_pixels() = 0;
-       transport_punch_range_rect->hide();
-       
-       transport_loop_range_rect->lower_to_bottom (); // loop on the bottom
-
-       transport_punchin_line = new ArdourCanvas::SimpleLine (*time_line_group);
-       transport_punchin_line->property_x1() = 0.0;
-       transport_punchin_line->property_y1() = 0.0;
-       transport_punchin_line->property_x2() = 0.0;
-       transport_punchin_line->property_y2() = 0.0;
-       transport_punchin_line->property_color_rgba() = color_map[cPunchInLine];
-       transport_punchin_line->hide ();
-       
-       transport_punchout_line  = new ArdourCanvas::SimpleLine (*time_line_group);
-       transport_punchout_line->property_x1() = 0.0;
-       transport_punchout_line->property_y1() = 0.0;
-       transport_punchout_line->property_x2() = 0.0;
-       transport_punchout_line->property_y2() = 0.0;
-       transport_punchout_line->property_color_rgba() = color_map[cPunchOutLine];
-       transport_punchout_line->hide();
-       
-       // used to show zoom mode active zooming
-       zoom_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
-       zoom_rect->property_fill_color_rgba() = color_map[cZoomRectFill];
-       zoom_rect->property_outline_color_rgba() = color_map[cZoomRect];
-       zoom_rect->property_outline_pixels() = 1;
-       zoom_rect->hide();
-       
-       zoom_rect->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_zoom_rect_event), (ArdourCanvas::Item*) 0));
-       
-       // used as rubberband rect
-       rubberband_rect = new ArdourCanvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
-       rubberband_rect->property_outline_color_rgba() = color_map[cRubberBandRect];
-       rubberband_rect->property_fill_color_rgba() = (guint32) color_map[cRubberBandRectFill];
-       rubberband_rect->property_outline_pixels() = 1;
-       rubberband_rect->hide();
-       
-       tempo_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_tempo_bar_event), tempo_bar));
-       meter_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_meter_bar_event), meter_bar));
-       marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_marker_bar_event), marker_bar));
-       range_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_range_marker_bar_event), range_marker_bar));
-       transport_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_transport_marker_bar_event), transport_marker_bar));
-       
-       /* separator lines */
-       
-       tempo_line = new ArdourCanvas::SimpleLine (*tempo_group, 0, timebar_height, max_canvas_coordinate, timebar_height);
-       tempo_line->property_color_rgba() = RGBA_TO_UINT (0,0,0,255);
-
-       meter_line = new ArdourCanvas::SimpleLine (*meter_group, 0, timebar_height, max_canvas_coordinate, timebar_height);
-       meter_line->property_color_rgba() = RGBA_TO_UINT (0,0,0,255);
-
-       marker_line = new ArdourCanvas::SimpleLine (*marker_group, 0, timebar_height, max_canvas_coordinate, timebar_height);
-       marker_line->property_color_rgba() = RGBA_TO_UINT (0,0,0,255);
-       
-       range_marker_line = new ArdourCanvas::SimpleLine (*range_marker_group, 0, timebar_height, max_canvas_coordinate, timebar_height);
-       range_marker_line->property_color_rgba() = RGBA_TO_UINT (0,0,0,255);
-
-       transport_marker_line = new ArdourCanvas::SimpleLine (*transport_marker_group, 0, timebar_height, max_canvas_coordinate, timebar_height);
-       transport_marker_line->property_color_rgba() = RGBA_TO_UINT (0,0,0,255);
-
-       ZoomChanged.connect (bind (mem_fun(*this, &Editor::update_loop_range_view), false));
-       ZoomChanged.connect (bind (mem_fun(*this, &Editor::update_punch_range_view), false));
-       
-       double time_height = timebar_height * 5;
-       double time_width = FLT_MAX/frames_per_unit;
-       time_canvas.set_scroll_region(0.0, 0.0, time_width, time_height);
-       
-       edit_cursor = new Cursor (*this, "blue", &Editor::canvas_edit_cursor_event);
-       playhead_cursor = new Cursor (*this, "red", &Editor::canvas_playhead_cursor_event);
-       
-       track_canvas.signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate));
-}
-
 void
 Editor::show_window ()
 {
@@ -1265,103 +1079,6 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc)
        Resized (); /* EMIT_SIGNAL */
 }
 
-void
-Editor::reset_scrolling_region (Gtk::Allocation* alloc)
-{
-       guint32 last_canvas_unit;
-       double height;
-       guint32 canvas_alloc_height, canvas_alloc_width;
-       TrackViewList::iterator i;
-       static bool first_time = true;
-
-       /* We need to make sure that the canvas always has its
-          scrolling region set to larger of:
-
-          - the size allocated for it (within the container its packed in)
-          - the size required to see the entire session
-
-          If we don't ensure at least the first of these, the canvas
-          does some wierd and in my view unnecessary stuff to center
-          itself within the allocated area, which causes bad, bad
-          results.
-          
-          XXX GnomeCanvas has fixed this, and has an option to
-          control the centering behaviour.
-       */
-
-       last_canvas_unit = (guint32) ceil ((float) max_frames / frames_per_unit);
-
-       height = 0;
-
-       if (session) {
-               for (i = track_views.begin(); i != track_views.end(); ++i) {
-                       if ((*i)->control_parent) {
-                               height += (*i)->effective_height;
-                               height += track_spacing;
-                       }
-               }
-               
-               if (height) {
-                       height -= track_spacing;
-               }
-       }
-
-       canvas_height = (guint32) height;
-       
-       if (alloc) {
-               canvas_alloc_height = alloc->get_height();
-               canvas_alloc_width = alloc->get_width();
-       } else {
-               canvas_alloc_height = track_canvas.get_height();
-               canvas_alloc_width = track_canvas.get_width();
-       }
-
-       canvas_height = max (canvas_height, canvas_alloc_height);
-       track_canvas.set_scroll_region ( 0.0, 0.0, max (last_canvas_unit, canvas_alloc_width), canvas_height);
-
-       if (edit_cursor) edit_cursor->set_length (canvas_alloc_height);
-       if (playhead_cursor) playhead_cursor->set_length (canvas_alloc_height);
-
-       if (marker_drag_line) {
-               marker_drag_line_points.back().set_x(canvas_height);
-               // cerr << "set mlA points, nc = " << marker_drag_line_points.num_points << endl;
-               marker_drag_line->property_points() = marker_drag_line_points;
-       }
-       if (range_marker_drag_rect) {
-               range_marker_drag_rect->property_y1() = 0.0;
-               range_marker_drag_rect->property_y2() = (double) canvas_height;
-       }
-
-       if (transport_loop_range_rect) {
-               transport_loop_range_rect->property_y1() = 0.0;
-               transport_loop_range_rect->property_y2() = (double) canvas_height;
-       }
-
-       if (transport_punch_range_rect) {
-               transport_punch_range_rect->property_y1() = 0.0;
-               transport_punch_range_rect->property_y2() = (double) canvas_height;
-       }
-
-       if (transport_punchin_line) {
-               transport_punchin_line->property_y1() = 0.0;
-               transport_punchin_line->property_y2() = (double) canvas_height;
-       }
-
-       if (transport_punchout_line) {
-               transport_punchout_line->property_y1() = 0.0;
-               transport_punchout_line->property_y2() = (double) canvas_height;
-       }
-               
-       update_fixed_rulers ();
-
-       if (is_visible() && first_time) {
-               tempo_map_changed (Change (0));
-               first_time = false;
-       } else {
-               redisplay_tempo ();
-       }
-}
-
 void
 Editor::queue_session_control_changed (Session::ControlType t)
 {
@@ -1626,7 +1343,7 @@ Editor::connect_to_session (Session *t)
        redisplay_named_selections ();
 
        //route_list.freeze (); GTK2FIX
-       route_display_model.clear ();
+       route_display_model->clear ();
        session->foreach_route (this, &Editor::handle_new_route);
        // route_list.select_all ();
        // GTK2FIX
@@ -1740,7 +1457,7 @@ void
 Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
 {
        using namespace Menu_Helpers;
-       AudioRegionView* arv = static_cast<AudioRegionView*> (gtk_object_get_data (GTK_OBJECT(item), "regionview"));
+       AudioRegionView* arv = static_cast<AudioRegionView*> (item->get_data ("regionview"));
 
        if (arv == 0) {
                fatal << _("programming error: fade in canvas item has no regionview data pointer!") << endmsg;
index 4979cfd4de6a6c1bbc870bfb9de943df2f3c3d7f..47982ff72897963d4cd0b01928ade70dd3fa3392 100644 (file)
@@ -373,7 +373,7 @@ void
 Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
 {
        Marker * marker;
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (item->get_data("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -505,7 +505,7 @@ Editor::marker_menu_hide ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -523,7 +523,7 @@ Editor::marker_menu_play_from ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -553,7 +553,7 @@ Editor::marker_menu_set_playhead ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -581,7 +581,7 @@ Editor::marker_menu_set_from_playhead ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -609,7 +609,7 @@ Editor::marker_menu_set_from_selection ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -647,7 +647,7 @@ Editor::marker_menu_loop_range ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -674,7 +674,7 @@ Editor::marker_menu_edit ()
        TempoMarker* tm;
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -697,7 +697,7 @@ Editor::marker_menu_remove ()
        TempoMarker* tm;
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -716,7 +716,7 @@ Editor::marker_menu_rename ()
 {
        Marker* marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(marker_menu_item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
index 732340f24c95915ab575f831c5e90ac021fea599..70df0b1bf992a225dacef85bf9f38208cf7fec9e 100644 (file)
@@ -263,9 +263,9 @@ Editor::session_going_away ()
        /* rip everything out of the list displays */
 
        region_list_clear (); // no clear() method in gtkmm 1.2 
-       route_display_model.clear ();
-       named_selection_model.clear ();
-       group_model.clear ();
+       route_display_model->clear ();
+       named_selection_model->clear ();
+       group_model->clear ();
 
        edit_cursor_clock.set_session (0);
        selection_start_clock.set_session (0);
index 03e6d43e720fe9b1e4e13cda09b6a641beec990b..9324bed8ccad55b562ab47705fc4688b906e8e87 100644 (file)
@@ -315,7 +315,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
                        
                case AudioRegionViewNameHighlight:
                case AudioRegionViewName:
-                       if ((rv = reinterpret_cast<AudioRegionView *> (gtk_object_get_data(GTK_OBJECT(item), "regionview"))) != 0) {
+                       if ((rv = reinterpret_cast<AudioRegionView *> (item->get_data ("regionview"))) != 0) {
                                set_selected_regionview_from_click (Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift), true);
                        }
                        break;
@@ -323,7 +323,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
                case GainAutomationControlPointItem:
                case PanAutomationControlPointItem:
                case RedirectAutomationControlPointItem:
-                       if ((cp = reinterpret_cast<ControlPoint *> (gtk_object_get_data(GTK_OBJECT(item), "control_point"))) != 0) {
+                       if ((cp = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"))) != 0) {
                                set_selected_control_point_from_click (Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift), true);
                        }
                        break;
@@ -358,7 +358,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
 
                case AudioRegionViewNameHighlight:
                case AudioRegionViewName:
-                       rv = reinterpret_cast<AudioRegionView *> (gtk_object_get_data(GTK_OBJECT(item), "regionview"));
+                       rv = reinterpret_cast<AudioRegionView *> (item->get_data ("regionview"));
                default:
                        break;
                }
@@ -1125,7 +1125,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
        switch (item_type) {
        case GainControlPointItem:
                if (mouse_mode == MouseGain) {
-                       cp = reinterpret_cast<ControlPoint*>(gtk_object_get_data (GTK_OBJECT(item), "control_point"));
+                       cp = reinterpret_cast<ControlPoint*>(item->get_data ("control_point"));
                        cp->set_visible (true);
 
                        double at_x, at_y;
@@ -1149,7 +1149,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
        case GainAutomationControlPointItem:
        case PanAutomationControlPointItem:
        case RedirectAutomationControlPointItem:
-               cp = reinterpret_cast<ControlPoint*>(gtk_object_get_data (GTK_OBJECT(item), "control_point"));
+               cp = reinterpret_cast<ControlPoint*>(item->get_data ("control_point"));
                cp->set_visible (true);
                
                double at_x, at_y;
@@ -1224,7 +1224,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
                
                /* when the name is not an active item, the entire name highlight is for trimming */
 
-               if (!reinterpret_cast<AudioRegionView *> (gtk_object_get_data(GTK_OBJECT(item), "regionview"))->name_active()) {
+               if (!reinterpret_cast<AudioRegionView *> (item->get_data ("regionview"))->name_active()) {
                        if (mouse_mode == MouseObject && is_drawable()) {
                                track_canvas_scroller.get_window()->set_cursor (*trimmer_cursor);
                        }
@@ -1250,7 +1250,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
                        track_canvas_scroller.get_window()->set_cursor (*cursor);
 
                        AutomationTimeAxisView* atv;
-                       if ((atv = static_cast<AutomationTimeAxisView*>(gtk_object_get_data(GTK_OBJECT(item), "trackview"))) != 0) {
+                       if ((atv = static_cast<AutomationTimeAxisView*>(item->get_data ("trackview"))) != 0) {
                                clear_entered_track = false;
                                set_entered_track (atv);
                        }
@@ -1268,7 +1268,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
                break;
 
        case MarkerItem:
-               if ((marker = static_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+               if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) {
                        break;
                }
                marker->set_color_rgba (color_map[cEnteredMarker]);
@@ -1337,7 +1337,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
        case GainAutomationControlPointItem:
        case PanAutomationControlPointItem:
        case RedirectAutomationControlPointItem:
-               cp = reinterpret_cast<ControlPoint*>(gtk_object_get_data (GTK_OBJECT(item), "control_point"));
+               cp = reinterpret_cast<ControlPoint*>(item->get_data ("control_point"));
                if (cp->line.npoints() > 1) {
                        if (!cp->selected) {
                                cp->set_visible (false);
@@ -1371,7 +1371,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
        case GainAutomationLineItem:
        case RedirectAutomationLineItem:
        case PanAutomationLineItem:
-               al = reinterpret_cast<AutomationLine*> (gtk_object_get_data (GTK_OBJECT(item),"line"));
+               al = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
                {
                        ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
                        if (line)
@@ -1384,7 +1384,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
 
        case AudioRegionViewName:
                /* see enter_handler() for notes */
-               if (!reinterpret_cast<AudioRegionView *> (gtk_object_get_data(GTK_OBJECT(item), "regionview"))->name_active()) {
+               if (!reinterpret_cast<AudioRegionView *> (item->get_data ("regionview"))->name_active()) {
                        if (is_drawable() && mouse_mode == MouseObject) {
                                track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
                        }
@@ -1402,7 +1402,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
                break;
                
        case MarkerItem:
-               if ((marker = static_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+               if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) {
                        break;
                }
                loc = find_location_from_marker (marker, is_start);
@@ -1419,7 +1419,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
 
        case FadeInHandleItem:
        case FadeOutHandleItem:
-               rv = static_cast<AudioRegionView*>(gtk_object_get_data (GTK_OBJECT(item), "regionview"));
+               rv = static_cast<AudioRegionView*>(item->get_data ("regionview"));
                {
                        ArdourCanvas::SimpleRect *rect = dynamic_cast<ArdourCanvas::SimpleRect *> (item);
                        if (rect) {
@@ -1701,7 +1701,7 @@ Editor::start_fade_in_grab (ArdourCanvas::Item* item, GdkEvent* event)
 
        start_grab (event);
 
-       if ((drag_info.data = (gtk_object_get_data (GTK_OBJECT(item), "regionview"))) == 0) {
+       if ((drag_info.data = (item->get_data ("regionview"))) == 0) {
                fatal << _("programming error: fade in canvas item has no regionview data pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -1791,7 +1791,7 @@ Editor::start_fade_out_grab (ArdourCanvas::Item* item, GdkEvent* event)
 
        start_grab (event);
 
-       if ((drag_info.data = (gtk_object_get_data (GTK_OBJECT(item), "regionview"))) == 0) {
+       if ((drag_info.data = (item->get_data ("regionview"))) == 0) {
                fatal << _("programming error: fade out canvas item has no regionview data pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -1884,7 +1884,7 @@ Editor::start_cursor_grab (ArdourCanvas::Item* item, GdkEvent* event)
 
        start_grab (event);
 
-       if ((drag_info.data = (gtk_object_get_data (GTK_OBJECT(item), "cursor"))) == 0) {
+       if ((drag_info.data = (item->get_data ("cursor"))) == 0) {
                fatal << _("programming error: cursor canvas item has no cursor data pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -1974,7 +1974,7 @@ Editor::start_marker_grab (ArdourCanvas::Item* item, GdkEvent* event)
 {
        Marker* marker;
 
-       if ((marker = static_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -2112,7 +2112,7 @@ Editor::start_meter_marker_grab (ArdourCanvas::Item* item, GdkEvent* event)
        Marker* marker;
        MeterMarker* meter_marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
                fatal << _("programming error: meter marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -2191,7 +2191,7 @@ Editor::start_tempo_marker_grab (ArdourCanvas::Item* item, GdkEvent* event)
        Marker* marker;
        TempoMarker* tempo_marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "tempo_marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (item->get_data ("tempo_marker"))) == 0) {
                fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -2272,7 +2272,7 @@ Editor::remove_gain_control_point (ArdourCanvas::Item*item, GdkEvent* event)
 {
        ControlPoint* control_point;
 
-       if ((control_point = reinterpret_cast<ControlPoint *> (gtk_object_get_data (GTK_OBJECT(item), "control_point"))) == 0) {
+       if ((control_point = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"))) == 0) {
                fatal << _("programming error: control point canvas item has no control point object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -2291,7 +2291,7 @@ Editor::remove_control_point (ArdourCanvas::Item*item, GdkEvent* event)
 {
        ControlPoint* control_point;
 
-       if ((control_point = reinterpret_cast<ControlPoint *> (gtk_object_get_data (GTK_OBJECT(item), "control_point"))) == 0) {
+       if ((control_point = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"))) == 0) {
                fatal << _("programming error: control point canvas item has no control point object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -2304,7 +2304,7 @@ Editor::start_control_point_grab (ArdourCanvas::Item* item, GdkEvent* event)
 {
        ControlPoint* control_point;
        
-       if ((control_point = reinterpret_cast<ControlPoint *> (gtk_object_get_data (GTK_OBJECT(item), "control_point"))) == 0) {
+       if ((control_point = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"))) == 0) {
                fatal << _("programming error: control point canvas item has no control point object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -2402,7 +2402,7 @@ Editor::start_line_grab_from_line (ArdourCanvas::Item* item, GdkEvent* event)
 {
        AutomationLine* al;
        
-       if ((al = reinterpret_cast<AutomationLine*> (gtk_object_get_data (GTK_OBJECT(item), "line"))) == 0) {
+       if ((al = reinterpret_cast<AutomationLine*> (item->get_data ("line"))) == 0) {
                fatal << _("programming error: line canvas item has no line pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -4089,7 +4089,7 @@ Editor::hide_marker (ArdourCanvas::Item* item, GdkEvent* event)
        Marker* marker;
        bool is_start;
 
-       if ((marker = static_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) {
                fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -4397,12 +4397,10 @@ Editor::drag_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event)
                double x1 = frame_to_pixel (start);
                double x2 = frame_to_pixel (end);
                
-               gtk_object_set (GTK_OBJECT(rubberband_rect), 
-                               "x1", x1,
-                               "y1", y1,
-                               "x2", x2,
-                               "y2", y2,
-                               NULL);
+               rubberband_rect->property_x1() = x1;
+               rubberband_rect->property_y1() = y1;
+               rubberband_rect->property_x2() = x2;
+               rubberband_rect->property_y2() = y2;
 
                rubberband_rect->show();
                rubberband_rect->raise_to_top();
index 393ba0763ef9ca99a24520ab93426c5ffaba31ef..de0abee8bfc4cbfaaa8c277553e7b440bfcca129 100644 (file)
@@ -261,6 +261,7 @@ Editor::add_audio_region_to_region_display (AudioRegion *region)
                
                TreeModel::iterator i;
                TreeModel::Children rows = region_list_model->children();
+               bool found_parent = false;
 
                for (i = rows.begin(); i != rows.end(); ++i) {
 
@@ -271,13 +272,14 @@ Editor::add_audio_region_to_region_display (AudioRegion *region)
                                
                                if (region->source_equivalent (*r)) {
                                        row = *(region_list_model->append ((*i).children()));
+                                       found_parent = true;
                                        break;
                                }
                        }
                }
 
-               if (i == rows.end()) {
-                       TreeModel::Row row = *(region_list_model->append());
+               if (!found_parent) {
+                       row = *(region_list_model->append());
                }
 
                
@@ -328,9 +330,9 @@ void
 Editor::redisplay_regions ()
 {
        if (session) {
-               
+
                region_list_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
-               region_list_model.clear ();
+               region_list_model->clear ();
 
                /* now add everything we have, via a temporary list used to help with
                   sorting.
index 536c1d1e226a027e0add5db9ee39de527909deea..93af2a18be5ae0632471f857ca4641569b66c947 100644 (file)
@@ -617,7 +617,7 @@ Editor::update_ruler_visibility ()
        
        if (ruler_shown[ruler_time_tempo]) {
                lab_children.push_back (Element(tempo_label, PACK_SHRINK, PACK_START));
-               gtk_object_get (GTK_OBJECT(tempo_group), "y", &old_unit_pos);
+               old_unit_pos = tempo_group->property_y();
                if (tbpos != old_unit_pos) {
                        tempo_group->move(0.0, tbpos - old_unit_pos);
                }
index 51789880f03daaaf4a369c8c4b51f56d552ec472..e92051572fee808ea8215ff0966d08215b26eaea 100644 (file)
@@ -62,7 +62,7 @@ Editor::redisplay_named_selections ()
 {
         //GTK2FIX
         //named_selection_display.freeze ();
-       named_selection_model.clear ();
+       named_selection_model->clear ();
        session->foreach_named_selection (*this, &Editor::add_named_selection_to_named_selection_display);
        //named_selection_display.thaw ();
 }
index 217d99438f994150924097443334f6b00552895b..65d772db3e30fd4f278f8ebf1737170d00ce0dad 100644 (file)
@@ -325,7 +325,7 @@ Editor::remove_tempo_marker (ArdourCanvas::Item* item)
        Marker* marker;
        TempoMarker* tempo_marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
                fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -409,7 +409,7 @@ Editor::edit_tempo_marker (ArdourCanvas::Item *item)
        Marker* marker;
        TempoMarker* tempo_marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
                fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -428,7 +428,7 @@ Editor::edit_meter_marker (ArdourCanvas::Item *item)
        Marker* marker;
        MeterMarker* meter_marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
                fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
@@ -459,7 +459,7 @@ Editor::remove_meter_marker (ArdourCanvas::Item* item)
        Marker* marker;
        MeterMarker* meter_marker;
 
-       if ((marker = reinterpret_cast<Marker *> (gtk_object_get_data (GTK_OBJECT(item), "marker"))) == 0) {
+       if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
                fatal << _("programming error: meter marker canvas item has no marker object pointer!") << endmsg;
                /*NOTREACHED*/
        }
index 7551bf36bca78b382fc426749b3bcfb7ec94bed7..27d1b3e077f9dbad03ef78e8f330ecf644d15233 100644 (file)
@@ -116,21 +116,21 @@ ImageFrameTimeAxis::~ImageFrameTimeAxis ()
        
        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)
        {
-               gtk_object_destroy (GTK_OBJECT (selection_group));
+               delete selection_group;
                selection_group = 0 ;
        }
        
index 53010300b17f5f920ce9b058b355dcc8aa49136c..e08f5819519ecfbe1d87b0dc56e8875b4bd6b090 100644 (file)
@@ -95,13 +95,13 @@ MarkerTimeAxisView::~MarkerTimeAxisView()
        
        if(canvas_rect)
        {
-               gtk_object_destroy(GTK_OBJECT(canvas_rect)) ;
+               delete canvas_rect;
                canvas_rect = 0 ;
        }
        
        if(canvas_group)
        {
-               gtk_object_destroy(GTK_OBJECT(canvas_group)) ;
+               delete canvas_group;
                canvas_group = 0 ;
        }
 }
@@ -123,7 +123,7 @@ MarkerTimeAxisView::set_height(gdouble h)
                return -1 ;
        }
        
-       gtk_object_set (GTK_OBJECT(canvas_rect), "y2", h, NULL);
+       canvas_rect->property_y2() = h;
 
        for (MarkerViewList::iterator i = marker_view_list.begin(); i != marker_view_list.end(); ++i)
        {
index 364f7b0f3ef5b3df477562a985b4323f1fb287f8..221f45ec2a93621d6b05cd2afdb4a82e1565f9c8 100644 (file)
@@ -301,7 +301,7 @@ Mixer_UI::connect_to_session (Session* sess)
        // GTK2FIX
        // track_display_list.freeze ();
 
-       track_display_model.clear ();
+       track_display_model->clear ();
 
        session->foreach_route (this, &Mixer_UI::add_strip);
        
@@ -784,7 +784,7 @@ Mixer_UI::redisplay_snapshots ()
                return;
        }
 
-       snapshot_display_model.clear ();
+       snapshot_display_model->clear ();
 
        for (vector<string*>::iterator i = states->begin(); i != states->end(); ++i) {
                string statename = *(*i);
index 95296f08177b2aa2907cbedf5a45b94698371294..c3eecf97b2a8064d5510a0c963051eaa654b988d 100644 (file)
@@ -508,7 +508,7 @@ RedirectBox::redirects_changed (void *src)
        ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::redirects_changed), src));
        
        //redirect_display.freeze ();
-       model.clear ();
+       model->clear ();
        redirect_active_connections.clear ();
        redirect_name_connections.clear ();
 
index b07869bea57a2ea8fb9489adf4795d42d055cf96..7e6caad71d8de12179fea3a8e62817c5ed165c40 100644 (file)
@@ -122,29 +122,28 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView
        fade_out_shape = new ArdourCanvas::Polygon (*group);
        fade_out_shape->property_fill_color_rgba() = fade_color;
        fade_out_shape->set_data ("regionview", this);
-       
 
 
        {
-                       uint32_t r,g,b,a;
-                       UINT_TO_RGBA(fill_color,&r,&g,&b,&a);
-       
-
-       fade_in_handle = new ArdourCanvas::SimpleRect (*group);
-       fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
-       fade_in_handle->property_outline_pixels() = 0;
-       fade_in_handle->property_y1() = 2.0;
-       fade_in_handle->property_y2() = 7.0;
-
-       fade_in_handle->set_data ("regionview", this);
+               uint32_t r,g,b,a;
+               UINT_TO_RGBA(fill_color,&r,&g,&b,&a);
        
-       fade_out_handle = new ArdourCanvas::SimpleRect (*group);
-       fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
-       fade_out_handle->property_outline_pixels() = 0;
-       fade_out_handle->property_y1() = 2.0;
-       fade_out_handle->property_y2() = 7.0;
 
-       gtk_object_set_data (GTK_OBJECT(fade_out_handle), "regionview", this);
+               fade_in_handle = new ArdourCanvas::SimpleRect (*group);
+               fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
+               fade_in_handle->property_outline_pixels() = 0;
+               fade_in_handle->property_y1() = 2.0;
+               fade_in_handle->property_y2() = 7.0;
+               
+               fade_in_handle->set_data ("regionview", this);
+               
+               fade_out_handle = new ArdourCanvas::SimpleRect (*group);
+               fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
+               fade_out_handle->property_outline_pixels() = 0;
+               fade_out_handle->property_y1() = 2.0;
+               fade_out_handle->property_y2() = 7.0;
+               
+               fade_out_handle->set_data ("regionview", this);
        }
 
        string foo = region.name();
@@ -186,7 +185,6 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView
        set_colors ();
 
        /* XXX sync mark drag? */
-
 }
 
 AudioRegionView::~AudioRegionView ()
index 5468abaaf84100e9c035ea2542d7e418da856efe..9a7adf2719f457edfc98d0021fbce88ca2b9102b 100644 (file)
@@ -48,15 +48,15 @@ class AutomationTimeAxisView;
 class AudioRegionView : public TimeAxisViewItem
 {
   public:
-  AudioRegionView (ArdourCanvas::Group *, 
-                    AudioTimeAxisView&,
-                    ARDOUR::AudioRegion&,
-                    double initial_samples_per_unit,
-                    double amplitude_above_axis,
-                    Gdk::Color& base_color,
-                    bool wait_for_waves);
-    ~AudioRegionView ();
-
+       AudioRegionView (ArdourCanvas::Group *, 
+                        AudioTimeAxisView&,
+                        ARDOUR::AudioRegion&,
+                        double initial_samples_per_unit,
+                        double amplitude_above_axis,
+                        Gdk::Color& base_color,
+                        bool wait_for_waves);
+       ~AudioRegionView ();
+       
     ARDOUR::AudioRegion& region;  // ok, let 'em have it
     bool is_valid() const { return valid; }
     void set_valid (bool yn) { valid = yn; }
index 359ddc370e3de01c97288fad6052c5e6e0b1b972..7987496a815f22b1f01c9a72b2ff2477724e58c1 100644 (file)
@@ -364,7 +364,7 @@ RouteParams_UI::set_session (Session *sess)
        // GTK2FIX
        // route_select_list.freeze ();
 
-       route_display_model.clear();
+       route_display_model->clear();
 
        if (session) {
                session->foreach_route (this, &RouteParams_UI::add_route);
@@ -386,7 +386,7 @@ RouteParams_UI::session_gone ()
 {
        ENSURE_GUI_THREAD(mem_fun(*this, &RouteParams_UI::session_gone));
 
-       route_display_model.clear();
+       route_display_model->clear();
 
        cleanup_io_frames();
        cleanup_pre_view();
index 7ad23bb0eef6ccd1fab166317ce489b02c7bfcde..4213bc8431d6b14612a82234591b3cc885868688 100644 (file)
@@ -23,6 +23,7 @@
 #include "crossfade_view.h"
 #include "rgb_macros.h"
 #include "gui_thread.h"
+#include "utils.h"
 
 using namespace ARDOUR;
 using namespace Editing;
@@ -94,7 +95,7 @@ StreamView::StreamView (AudioTimeAxisView& tv)
 StreamView::~StreamView ()
 {
        undisplay_diskstream ();
-       gtk_object_destroy (GTK_OBJECT(canvas_group));
+       delete canvas_group;
 }
 
 void
@@ -123,7 +124,7 @@ StreamView::set_height (gdouble h)
                return -1;
        }
 
-       gtk_object_set (GTK_OBJECT(canvas_rect), "y2", h, NULL);
+       canvas_rect->property_y2() = h;
 
        for (AudioRegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
                (*i)->set_height (h);
@@ -135,7 +136,7 @@ StreamView::set_height (gdouble h)
 
        for (vector<RecBoxInfo>::iterator i = rec_rects.begin(); i != rec_rects.end(); ++i) {
                RecBoxInfo &recbox = (*i);
-               gtk_object_set (GTK_OBJECT( recbox.rectangle ), "y2", h - 1, NULL);
+               recbox.rectangle->property_y2() = h - 1.0;
        }
 
        return 0;
@@ -740,7 +741,7 @@ StreamView::setup_rec_box ()
                        /* transport stopped, clear boxes */
                        for (vector<RecBoxInfo>::iterator iter=rec_rects.begin(); iter != rec_rects.end(); ++iter) {
                                RecBoxInfo &rect = (*iter);
-                               gtk_object_destroy (GTK_OBJECT(rect.rectangle));
+                               delete rect.rectangle;
                        }
                        
                        rec_rects.clear();
@@ -829,7 +830,7 @@ StreamView::update_rec_regions ()
                        tmp = iter;
                        ++tmp;
 
-                       if ((GTK_OBJECT_FLAGS(GTK_OBJECT(rec_rects[n].rectangle)) & GNOME_CANVAS_ITEM_VISIBLE) == 0) {
+                       if (!canvas_item_visible (rec_rects[n].rectangle)) {
                                /* rect already hidden, this region is done */
                                iter = tmp;
                                continue;
index 47156bf672f583f41363e017556b7373de988430..6c97e2419947e982bc3f3e2e8da005c216dab84f 100644 (file)
@@ -47,6 +47,7 @@
 #include "selection.h"
 #include "keyboard.h"
 #include "rgb_macros.h"
+#include "utils.h"
 
 #include "i18n.h"
 
@@ -142,15 +143,16 @@ TimeAxisView::~TimeAxisView()
        }
 
        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) {
@@ -219,7 +221,7 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
                        (*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);
                }
@@ -342,7 +344,7 @@ TimeAxisView::set_height (TrackHeight h)
        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);
        }
@@ -495,7 +497,7 @@ TimeAxisView::show_selection (TimeSelection& ts)
                (*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();
@@ -522,28 +524,24 @@ TimeAxisView::show_selection (TimeSelection& ts)
                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 {
@@ -569,7 +567,7 @@ TimeAxisView::reshow_selection (TimeSelection& ts)
 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();
index a25067c35ed5f49d38bd26a7eefac8adc4fc1ca0..8998b56229ecc371fdd5d52d59a26fcd450b7ac7 100644 (file)
@@ -34,6 +34,7 @@
 #include "utils.h"
 #include "i18n.h"
 #include "rgb_macros.h"
+#include "canvas_impl.h"
 
 using namespace std;
 using namespace Gtk;
@@ -502,3 +503,8 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a)
        return (uint32_t) RGBA_TO_UINT(r,g,b,a);
 }
 
+bool 
+canvas_item_visible (ArdourCanvas::Item* item)
+{
+       return (item->gobj()->object.flags & GNOME_CANVAS_ITEM_VISIBLE) ? true : false;
+}
index 8463b67bb39fef3ac43b61e72d241c16e7591daa..3853edf7d4cdb68bdef514e455fed81a1441b0cd 100644 (file)
@@ -28,6 +28,7 @@
 #include <libgnomecanvasmm/line.h>
 #include <gdkmm/types.h>
 #include "canvas.h"
+
 namespace Gtk {
        class Window;
        class ComboBoxText;
@@ -73,4 +74,6 @@ uint32_t rgba_from_style (std::string style, uint32_t, uint32_t, uint32_t, uint3
 
 void decorate (Gtk::Window& w, Gdk::WMDecoration d);
 
+bool canvas_item_visible (ArdourCanvas::Item* item);
+
 #endif /* __ardour_gtk_utils_h__ */