mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 05:06:31 +01:00
many changes, read the diffs
git-svn-id: svn://localhost/trunk/ardour2@214 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
0faaa3ad7b
commit
d43cc4e7b5
21 changed files with 378 additions and 303 deletions
|
|
@ -207,7 +207,7 @@ executable = 'ardour.bin'
|
||||||
|
|
||||||
ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
|
ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
|
||||||
mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
|
mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
|
||||||
#itest = gtkardour.Program(target = 'itest', source = itest_files)
|
itest = gtkardour.Program(target = 'itest', source = itest_files)
|
||||||
|
|
||||||
Default(ardour)
|
Default(ardour)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <gtk/gtkaccelmap.h>
|
#include <gtk/gtkaccelmap.h>
|
||||||
#include <gtk/gtkuimanager.h>
|
#include <gtk/gtkuimanager.h>
|
||||||
|
|
@ -32,6 +33,7 @@
|
||||||
#include <ardour/ardour.h>
|
#include <ardour/ardour.h>
|
||||||
|
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
|
|
@ -199,35 +201,25 @@ ActionManager::get_widget (const char * name)
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action>
|
RefPtr<Action>
|
||||||
ActionManager::get_action (const char * _name)
|
ActionManager::get_action (const char* group_name, const char* action_name)
|
||||||
{
|
{
|
||||||
/* the C++ API for functions used here appears to be broken in
|
/* the C++ API for functions used here appears to be broken in
|
||||||
gtkmm2.6, so we fall back to the C level.
|
gtkmm2.6, so we fall back to the C level.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ustring name(_name);
|
|
||||||
GList* list = gtk_ui_manager_get_action_groups (ui_manager->gobj());
|
GList* list = gtk_ui_manager_get_action_groups (ui_manager->gobj());
|
||||||
GList* node;
|
GList* node;
|
||||||
RefPtr<Action> act;
|
RefPtr<Action> act;
|
||||||
|
|
||||||
if (name.substr (0,9) != "<Actions>") {
|
|
||||||
error << "badly specified action name: " << name << endmsg;
|
|
||||||
return act;
|
|
||||||
}
|
|
||||||
|
|
||||||
ustring::size_type last_slash = name.find_last_of ('/');
|
|
||||||
ustring group_name = name.substr (10, last_slash - 10);
|
|
||||||
ustring action_name = name.substr (last_slash+1);
|
|
||||||
|
|
||||||
for (node = list; node; node = g_list_next (node)) {
|
for (node = list; node; node = g_list_next (node)) {
|
||||||
|
|
||||||
GtkActionGroup* _ag = (GtkActionGroup*) node->data;
|
GtkActionGroup* _ag = (GtkActionGroup*) node->data;
|
||||||
|
|
||||||
if (group_name == gtk_action_group_get_name (_ag)) {
|
if (strcmp (group_name, gtk_action_group_get_name (_ag)) == 0) {
|
||||||
|
|
||||||
GtkAction* _act;
|
GtkAction* _act;
|
||||||
|
|
||||||
if ((_act = gtk_action_group_get_action (_ag, action_name.c_str())) != 0) {
|
if ((_act = gtk_action_group_get_action (_ag, action_name)) != 0) {
|
||||||
act = Glib::wrap (_act, true);
|
act = Glib::wrap (_act, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -246,14 +238,33 @@ ActionManager::set_sensitive (vector<RefPtr<Action> >& actions, bool state)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ActionManager::uncheck_toggleaction (const char * actionname)
|
ActionManager::uncheck_toggleaction (const char * name)
|
||||||
{
|
{
|
||||||
RefPtr<Action> act = get_action (actionname);
|
char *last_slash = strrchr (name, '/');
|
||||||
|
|
||||||
|
if (last_slash == 0) {
|
||||||
|
fatal << string_compose (_("programmer error: %1 %2"), X_("illegal toggle action name"), name) << endmsg;
|
||||||
|
/*NOTREACHED*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 10 = strlen ("<Actions>/") */
|
||||||
|
size_t len = last_slash - (name + 10);
|
||||||
|
|
||||||
|
char* group_name = new char[len+1];
|
||||||
|
memcpy (group_name, name + 10, len);
|
||||||
|
group_name[len] = '\0';
|
||||||
|
|
||||||
|
char* action_name = last_slash + 1;
|
||||||
|
|
||||||
|
RefPtr<Action> act = get_action (group_name, action_name);
|
||||||
if (act) {
|
if (act) {
|
||||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
tact->set_active (false);
|
tact->set_active (false);
|
||||||
} else {
|
} else {
|
||||||
error << "Invalid action name: " << actionname << endmsg;
|
error << "Unknown action name: " << name << endmsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] group_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class ActionManager
|
||||||
static Glib::RefPtr<Gtk::UIManager> ui_manager;
|
static Glib::RefPtr<Gtk::UIManager> ui_manager;
|
||||||
|
|
||||||
static Gtk::Widget* get_widget (const char * name);
|
static Gtk::Widget* get_widget (const char * name);
|
||||||
static Glib::RefPtr<Gtk::Action> get_action (const char * name);
|
static Glib::RefPtr<Gtk::Action> get_action (const char* group, const char* name);
|
||||||
|
|
||||||
static void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
|
static void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -831,10 +831,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
||||||
theArdourUI = this;
|
theArdourUI = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// allow run-time rebinding of accels
|
|
||||||
|
|
||||||
Settings::get_default()->property_gtk_can_change_accels() = true;
|
|
||||||
|
|
||||||
ActionManager::init ();
|
ActionManager::init ();
|
||||||
|
|
||||||
m_new_session_dialog = 0;
|
m_new_session_dialog = 0;
|
||||||
|
|
|
||||||
|
|
@ -279,19 +279,19 @@ ARDOUR_UI::setup_transport ()
|
||||||
|
|
||||||
RefPtr<Action> act;
|
RefPtr<Action> act;
|
||||||
|
|
||||||
act = ActionManager::get_action (X_("<Actions>/Transport/Stop"));
|
act = ActionManager::get_action (X_("Transport"), X_("Stop"));
|
||||||
act->connect_proxy (stop_button);
|
act->connect_proxy (stop_button);
|
||||||
act = ActionManager::get_action (X_("<Actions>/Transport/Roll"));
|
act = ActionManager::get_action (X_("Transport"), X_("Roll"));
|
||||||
act->connect_proxy (roll_button);
|
act->connect_proxy (roll_button);
|
||||||
act = ActionManager::get_action (X_("<Actions>/Transport/Record"));
|
act = ActionManager::get_action (X_("Transport"), X_("Record"));
|
||||||
act->connect_proxy (rec_button);
|
act->connect_proxy (rec_button);
|
||||||
act = ActionManager::get_action (X_("<Actions>/Transport/GotoStart"));
|
act = ActionManager::get_action (X_("Transport"), X_("GotoStart"));
|
||||||
act->connect_proxy (goto_start_button);
|
act->connect_proxy (goto_start_button);
|
||||||
act = ActionManager::get_action (X_("<Actions>/Transport/GotoEnd"));
|
act = ActionManager::get_action (X_("Transport"), X_("GotoEnd"));
|
||||||
act->connect_proxy (goto_end_button);
|
act->connect_proxy (goto_end_button);
|
||||||
act = ActionManager::get_action (X_("<Actions>/Transport/Loop"));
|
act = ActionManager::get_action (X_("Transport"), X_("Loop"));
|
||||||
act->connect_proxy (auto_loop_button);
|
act->connect_proxy (auto_loop_button);
|
||||||
act = ActionManager::get_action (X_("<Actions>/Transport/PlaySelection"));
|
act = ActionManager::get_action (X_("Transport"), X_("PlaySelection"));
|
||||||
act->connect_proxy (play_selection_button);
|
act->connect_proxy (play_selection_button);
|
||||||
|
|
||||||
ARDOUR_UI::instance()->tooltips().set_tip (roll_button, _("Play from playhead"));
|
ARDOUR_UI::instance()->tooltips().set_tip (roll_button, _("Play from playhead"));
|
||||||
|
|
|
||||||
|
|
@ -180,14 +180,16 @@ ARDOUR_UI::unload_session ()
|
||||||
int
|
int
|
||||||
ARDOUR_UI::create_connection_editor ()
|
ARDOUR_UI::create_connection_editor ()
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
if (connection_editor == 0) {
|
if (connection_editor == 0) {
|
||||||
// connection_editor = new ConnectionEditor ();
|
connection_editor = new ConnectionEditor ();
|
||||||
// connection_editor->signal_unmap().connect (sigc::bind (ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleConnections")));
|
connection_editor->signal_unmap().connect (sigc::bind (ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleConnections")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
// connection_editor->set_session (session);
|
connection_editor->set_session (session);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -199,13 +201,17 @@ ARDOUR_UI::toggle_connection_editor ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//GTK2FIX
|
|
||||||
#if 0
|
#if 0
|
||||||
|
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleConnections"));
|
||||||
|
if (act) {
|
||||||
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
|
|
||||||
if (connection_editor_check->get_active()){
|
if (tact->get_active()) {
|
||||||
|
connection_editor->show_all ();
|
||||||
connection_editor->present ();
|
connection_editor->present ();
|
||||||
} else {
|
} else {
|
||||||
connection_editor->hide_all();
|
connection_editor->hide ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -213,11 +219,16 @@ ARDOUR_UI::toggle_connection_editor ()
|
||||||
void
|
void
|
||||||
ARDOUR_UI::toggle_big_clock_window ()
|
ARDOUR_UI::toggle_big_clock_window ()
|
||||||
{
|
{
|
||||||
if (big_clock_window->is_visible()) {
|
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleBigClock"));
|
||||||
big_clock_window->hide ();
|
if (act) {
|
||||||
} else {
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
|
|
||||||
|
if (tact->get_active()) {
|
||||||
big_clock_window->show_all ();
|
big_clock_window->show_all ();
|
||||||
big_clock_window->present ();
|
big_clock_window->present ();
|
||||||
|
} else {
|
||||||
|
big_clock_window->hide ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -230,10 +241,16 @@ ARDOUR_UI::toggle_options_window ()
|
||||||
option_editor->set_session (session);
|
option_editor->set_session (session);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (option_editor->is_visible()) {
|
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleOptionsEditor"));
|
||||||
option_editor->hide ();
|
if (act) {
|
||||||
} else {
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
|
|
||||||
|
if (tact->get_active()) {
|
||||||
|
option_editor->show_all ();
|
||||||
option_editor->present ();
|
option_editor->present ();
|
||||||
|
} else {
|
||||||
|
option_editor->hide ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -264,10 +281,16 @@ ARDOUR_UI::toggle_location_window ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location_ui->is_visible()) {
|
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleLocations"));
|
||||||
location_ui->hide();
|
if (act) {
|
||||||
} else {
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
|
|
||||||
|
if (tact->get_active()) {
|
||||||
|
location_ui->show_all ();
|
||||||
location_ui->present ();
|
location_ui->present ();
|
||||||
|
} else {
|
||||||
|
location_ui->hide ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -289,10 +312,16 @@ ARDOUR_UI::toggle_route_params_window ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (route_params->is_visible ()) {
|
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleInspector"));
|
||||||
route_params->hide ();
|
if (act) {
|
||||||
} else {
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
|
|
||||||
|
if (tact->get_active()) {
|
||||||
|
route_params->show_all ();
|
||||||
route_params->present ();
|
route_params->present ();
|
||||||
|
} else {
|
||||||
|
route_params->hide ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -314,7 +343,7 @@ ARDOUR_UI::toggle_sound_file_browser ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Action> act = ActionManager::ui_manager->get_action (X_("<Actions>/Common/ToggleSoundFileBrowser"));
|
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleSoundFileBrowser"));
|
||||||
if (act) {
|
if (act) {
|
||||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "regionview.h"
|
#include "regionview.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "canvas_impl.h"
|
||||||
|
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
@ -78,8 +79,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
||||||
vestigial_frame->hide();
|
vestigial_frame->hide();
|
||||||
show_vestigial = false;
|
show_vestigial = false;
|
||||||
|
|
||||||
// GTK2FIX
|
group->signal_event().connect (bind (mem_fun (tv.editor, &PublicEditor::canvas_crossfade_view_event), group, this));
|
||||||
// group->signal_event.connect (bind (mem_fun (tv.editor, &PublicEditor::canvas_crossfade_view_event), group, this));
|
|
||||||
|
|
||||||
crossfade_changed (Change (~0));
|
crossfade_changed (Change (~0));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -523,27 +523,27 @@ Editor::Editor (AudioEngine& eng)
|
||||||
bottom_hbox.set_spacing (3);
|
bottom_hbox.set_spacing (3);
|
||||||
|
|
||||||
route_display_model = ListStore::create(route_display_columns);
|
route_display_model = ListStore::create(route_display_columns);
|
||||||
route_list.set_model (route_display_model);
|
route_list_display.set_model (route_display_model);
|
||||||
route_list.append_column (_("Tracks"), route_display_columns.text);
|
route_list_display.append_column (_("Tracks"), route_display_columns.text);
|
||||||
route_list.set_name ("TrackListDisplay");
|
route_list_display.set_name ("TrackListDisplay");
|
||||||
route_list.get_selection()->set_mode (Gtk::SELECTION_MULTIPLE);
|
route_list_display.get_selection()->set_mode (Gtk::SELECTION_MULTIPLE);
|
||||||
route_list.set_reorderable (true);
|
route_list_display.set_reorderable (true);
|
||||||
|
|
||||||
route_list.set_size_request (75,-1);
|
route_list_display.set_size_request (75,-1);
|
||||||
route_list.set_headers_visible (true);
|
route_list_display.set_headers_visible (true);
|
||||||
route_list.set_headers_clickable (true);
|
route_list_display.set_headers_clickable (true);
|
||||||
|
|
||||||
// GTK2FIX
|
// GTK2FIX
|
||||||
// route_list.signal_rows_reordered().connect (mem_fun (*this, &Editor::queue_route_list_reordered));
|
// route_list_display.signal_rows_reordered().connect (mem_fun (*this, &Editor::queue_route_list_reordered));
|
||||||
|
|
||||||
// GTK2FIX
|
// GTK2FIX
|
||||||
// route_display_model->set_sort_func (0, mem_fun (*this, &Editor::route_list_compare_func));
|
// route_display_model->set_sort_func (0, mem_fun (*this, &Editor::route_list_compare_func));
|
||||||
|
|
||||||
route_list_scroller.add (route_list);
|
route_list_scroller.add (route_list_display);
|
||||||
route_list_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
route_list_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||||
|
|
||||||
route_list.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::route_display_selection_changed));
|
route_list_display.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::route_display_selection_changed));
|
||||||
route_list.signal_columns_changed().connect (mem_fun(*this, &Editor::route_list_column_click));
|
route_list_display.signal_columns_changed().connect (mem_fun(*this, &Editor::route_list_column_click));
|
||||||
|
|
||||||
edit_group_list_button_label.set_text (_("Edit Groups"));
|
edit_group_list_button_label.set_text (_("Edit Groups"));
|
||||||
edit_group_list_button_label.set_name ("EditGroupTitleButton");
|
edit_group_list_button_label.set_name ("EditGroupTitleButton");
|
||||||
|
|
@ -551,58 +551,57 @@ Editor::Editor (AudioEngine& eng)
|
||||||
edit_group_list_button.set_name ("EditGroupTitleButton");
|
edit_group_list_button.set_name ("EditGroupTitleButton");
|
||||||
|
|
||||||
group_model = ListStore::create(group_columns);
|
group_model = ListStore::create(group_columns);
|
||||||
edit_group_list.set_model (group_model);
|
edit_group_display.set_model (group_model);
|
||||||
edit_group_list.append_column (_("active"), group_columns.is_active);
|
edit_group_display.append_column (_("active"), group_columns.is_active);
|
||||||
edit_group_list.append_column (_("groupname"), group_columns.text);
|
edit_group_display.append_column (_("groupname"), group_columns.text);
|
||||||
edit_group_list.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
|
edit_group_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
|
||||||
edit_group_list.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
|
edit_group_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
|
||||||
|
|
||||||
/* use checkbox for the active column */
|
/* use checkbox for the active column */
|
||||||
|
|
||||||
CellRendererToggle *active_cell = dynamic_cast<CellRendererToggle*>(edit_group_list.get_column_cell_renderer (0));
|
CellRendererToggle *active_cell = dynamic_cast<CellRendererToggle*>(edit_group_display.get_column_cell_renderer (0));
|
||||||
active_cell->property_activatable() = true;
|
active_cell->property_activatable() = true;
|
||||||
active_cell->property_radio() = false;
|
active_cell->property_radio() = false;
|
||||||
|
|
||||||
edit_group_list.set_name ("MixerGroupList");
|
edit_group_display.set_name ("MixerGroupList");
|
||||||
//edit_group_list.set_shadow_type (Gtk::SHADOW_IN);
|
//edit_group_display.set_shadow_type (Gtk::SHADOW_IN);
|
||||||
|
|
||||||
edit_group_list.columns_autosize ();
|
edit_group_display.columns_autosize ();
|
||||||
edit_group_list.get_selection()->set_mode (Gtk::SELECTION_MULTIPLE);
|
edit_group_display.get_selection()->set_mode (Gtk::SELECTION_MULTIPLE);
|
||||||
edit_group_list.set_reorderable (false);
|
edit_group_display.set_reorderable (false);
|
||||||
|
|
||||||
edit_group_list.set_size_request (75, -1);
|
edit_group_display.set_size_request (75, -1);
|
||||||
edit_group_list.set_headers_visible (true);
|
edit_group_display.set_headers_visible (true);
|
||||||
|
|
||||||
edit_group_list_scroller.add (edit_group_list);
|
edit_group_list_scroller.add (edit_group_display);
|
||||||
edit_group_list_scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
edit_group_list_scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||||
|
|
||||||
edit_group_list_button.signal_clicked().connect (mem_fun(*this, &Editor::edit_group_list_button_clicked));
|
edit_group_list_button.signal_clicked().connect (mem_fun(*this, &Editor::edit_group_list_button_clicked));
|
||||||
edit_group_list.signal_button_press_event().connect (mem_fun(*this, &Editor::edit_group_list_button_press_event));
|
edit_group_display.signal_button_press_event().connect (mem_fun(*this, &Editor::edit_group_list_button_press_event));
|
||||||
edit_group_list.get_selection()->signal_changed().connect (mem_fun(*this, &Editor::edit_group_selection_changed));
|
edit_group_display.get_selection()->signal_changed().connect (mem_fun(*this, &Editor::edit_group_selection_changed));
|
||||||
|
|
||||||
TreeModel::Row row = *(group_model->append());
|
TreeModel::Row row = *(group_model->append());
|
||||||
row[group_columns.is_active] = false;
|
row[group_columns.is_active] = false;
|
||||||
row[group_columns.text] = (_("-all-"));
|
row[group_columns.text] = (_("-all-"));
|
||||||
row[group_columns.routegroup] = 0;
|
row[group_columns.routegroup] = 0;
|
||||||
edit_group_list.get_selection()->select (row);
|
edit_group_display.get_selection()->select (row);
|
||||||
|
|
||||||
edit_group_vbox.pack_start (edit_group_list_button, false, false);
|
edit_group_vbox.pack_start (edit_group_list_button, false, false);
|
||||||
edit_group_vbox.pack_start (edit_group_list_scroller, true, true);
|
edit_group_vbox.pack_start (edit_group_list_scroller, true, true);
|
||||||
|
|
||||||
region_list_model = TreeStore::create (region_list_columns);
|
|
||||||
region_list_sort_model = TreeModelSort::create (region_list_model);
|
|
||||||
region_list_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
|
||||||
|
|
||||||
region_list_display.set_model (region_list_sort_model);
|
|
||||||
region_list_display.append_column (_("Regions"), region_list_columns.name);
|
|
||||||
region_list_display.set_reorderable (true);
|
|
||||||
region_list_display.set_size_request (100, -1);
|
region_list_display.set_size_request (100, -1);
|
||||||
region_list_display.set_data ("editor", this);
|
|
||||||
region_list_display.set_flags (Gtk::CAN_FOCUS);
|
|
||||||
region_list_display.set_name ("RegionListDisplay");
|
region_list_display.set_name ("RegionListDisplay");
|
||||||
|
|
||||||
region_list_scroller.add (region_list_display);
|
region_list_model = TreeStore::create (region_list_columns);
|
||||||
region_list_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
region_list_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||||
|
|
||||||
|
region_list_display.set_model (region_list_model);
|
||||||
|
region_list_display.append_column (_("Regions"), region_list_columns.name);
|
||||||
|
region_list_display.set_reorderable (true);
|
||||||
|
region_list_display.get_selection()->set_mode (SELECTION_SINGLE);
|
||||||
|
region_list_display.add_object_drag (region_list_columns.region.index(), "regions");
|
||||||
|
|
||||||
|
/* setup DnD handling */
|
||||||
|
|
||||||
list<Gtk::TargetEntry> region_list_target_table;
|
list<Gtk::TargetEntry> region_list_target_table;
|
||||||
|
|
||||||
|
|
@ -611,9 +610,11 @@ Editor::Editor (AudioEngine& eng)
|
||||||
region_list_target_table.push_back (TargetEntry ("text/uri-list"));
|
region_list_target_table.push_back (TargetEntry ("text/uri-list"));
|
||||||
region_list_target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
|
region_list_target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
|
||||||
|
|
||||||
// GTK2FIX
|
region_list_display.add_drop_targets (region_list_target_table);
|
||||||
// region_list_display.drag_dest_set (region_list_target_table, DEST_DEFAULT_ALL, GdkDragAction (Gdk::ACTION_COPY|Gdk::ACTION_MOVE));
|
region_list_display.signal_drag_data_received().connect (mem_fun(*this, &Editor::region_list_display_drag_data_received));
|
||||||
// region_list_display.signal_drag_data_received().connect (mem_fun(*this, &Editor::region_list_display_drag_data_received));
|
|
||||||
|
region_list_scroller.add (region_list_display);
|
||||||
|
region_list_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||||
|
|
||||||
region_list_display.signal_key_press_event().connect (mem_fun(*this, &Editor::region_list_display_key_press));
|
region_list_display.signal_key_press_event().connect (mem_fun(*this, &Editor::region_list_display_key_press));
|
||||||
region_list_display.signal_key_release_event().connect (mem_fun(*this, &Editor::region_list_display_key_release));
|
region_list_display.signal_key_release_event().connect (mem_fun(*this, &Editor::region_list_display_key_release));
|
||||||
|
|
@ -666,9 +667,7 @@ Editor::Editor (AudioEngine& eng)
|
||||||
global_hpacker.pack_start (global_vpacker, true, true);
|
global_hpacker.pack_start (global_vpacker, true, true);
|
||||||
|
|
||||||
set_name ("EditorWindow");
|
set_name ("EditorWindow");
|
||||||
cerr << "Adding accel group " << ActionManager::ui_manager->get_accel_group()->gobj() << endl;
|
|
||||||
add_accel_group (ActionManager::ui_manager->get_accel_group());
|
add_accel_group (ActionManager::ui_manager->get_accel_group());
|
||||||
cerr << "... done\n";
|
|
||||||
|
|
||||||
vpacker.pack_end (global_hpacker, true, true);
|
vpacker.pack_end (global_hpacker, true, true);
|
||||||
|
|
||||||
|
|
@ -1235,17 +1234,17 @@ Editor::connect_to_session (Session *t)
|
||||||
redisplay_named_selections ();
|
redisplay_named_selections ();
|
||||||
|
|
||||||
// GTK2FIX
|
// GTK2FIX
|
||||||
// route_list.set_model (Glib::RefPtr<TreeModel>(0));
|
// route_list_display.set_model (Glib::RefPtr<TreeModel>(0));
|
||||||
route_display_model->clear ();
|
route_display_model->clear ();
|
||||||
|
|
||||||
session->foreach_route (this, &Editor::handle_new_route);
|
session->foreach_route (this, &Editor::handle_new_route);
|
||||||
// route_list.select_all ();
|
// route_list_display.select_all ();
|
||||||
// GTK2FIX
|
// GTK2FIX
|
||||||
//route_list.sort ();
|
//route_list_display.sort ();
|
||||||
|
|
||||||
route_list_reordered ();
|
route_list_reordered ();
|
||||||
|
|
||||||
// route_list.set_model (route_display_model);
|
// route_list_display.set_model (route_display_model);
|
||||||
|
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||||
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
|
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
|
||||||
|
|
@ -1279,7 +1278,7 @@ Editor::connect_to_session (Session *t)
|
||||||
TreeModel::Children rows = route_display_model->children();
|
TreeModel::Children rows = route_display_model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
||||||
//route_list.freeze ();
|
//route_list_display.freeze ();
|
||||||
|
|
||||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||||
TimeAxisView *tv = (*i)[route_display_columns.tv];
|
TimeAxisView *tv = (*i)[route_display_columns.tv];
|
||||||
|
|
@ -1287,13 +1286,13 @@ Editor::connect_to_session (Session *t)
|
||||||
|
|
||||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
||||||
if (atv->route().master()) {
|
if (atv->route().master()) {
|
||||||
route_list.get_selection()->unselect (i);
|
route_list_display.get_selection()->unselect (i);
|
||||||
//(*i)->unselect ();
|
//(*i)->unselect ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//route_list.thaw ();
|
//route_list_display.thaw ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2762,20 +2761,27 @@ Editor::stop_canvas_autoscroll ()
|
||||||
|
|
||||||
int
|
int
|
||||||
Editor::convert_drop_to_paths (vector<string>& paths,
|
Editor::convert_drop_to_paths (vector<string>& paths,
|
||||||
GdkDragContext *context,
|
const RefPtr<Gdk::DragContext>& context,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
GtkSelectionData *data,
|
const SelectionData& data,
|
||||||
guint info,
|
guint info,
|
||||||
guint time)
|
guint time)
|
||||||
|
|
||||||
{
|
{
|
||||||
string spath;
|
if (session == 0) {
|
||||||
char *path;
|
return -1;
|
||||||
int state;
|
}
|
||||||
gchar *tname = gdk_atom_name (data->type);
|
|
||||||
|
|
||||||
if (session == 0 || strcmp (tname, "text/plain") != 0) {
|
vector<ustring> uris = data.get_uris();
|
||||||
|
|
||||||
|
if (uris.empty()) {
|
||||||
|
|
||||||
|
/* This is seriously fucked up. Nautilus doesn't say that its URI lists
|
||||||
|
are actually URI lists. So do it by hand.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (data.get_target() != "text/plain") {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2783,111 +2789,59 @@ Editor::convert_drop_to_paths (vector<string>& paths,
|
||||||
where each pathname is delimited by \r\n
|
where each pathname is delimited by \r\n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
path = (char *) data->data;
|
cerr << "by hand parsing of URI list\n";
|
||||||
state = 0;
|
|
||||||
|
|
||||||
for (int n = 0; n < data->length; ++n) {
|
const char* p = data.get_text().c_str();
|
||||||
|
const char* q;
|
||||||
|
|
||||||
switch (state) {
|
while (p)
|
||||||
case 0:
|
{
|
||||||
if (path[n] == '\r') {
|
if (*p != '#')
|
||||||
state = 1;
|
{
|
||||||
} else {
|
while (g_ascii_isspace (*p))
|
||||||
spath += path[n];
|
p++;
|
||||||
|
|
||||||
|
q = p;
|
||||||
|
while (*q && (*q != '\n') && (*q != '\r'))
|
||||||
|
q++;
|
||||||
|
|
||||||
|
if (q > p)
|
||||||
|
{
|
||||||
|
q--;
|
||||||
|
while (q > p && g_ascii_isspace (*q))
|
||||||
|
q--;
|
||||||
|
|
||||||
|
if (q > p)
|
||||||
|
{
|
||||||
|
uris.push_back (ustring (p, q - p + 1));
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
case 1:
|
}
|
||||||
if (path[n] == '\n') {
|
p = strchr (p, '\n');
|
||||||
paths.push_back (spath);
|
if (p)
|
||||||
spath = "";
|
p++;
|
||||||
state = 0;
|
}
|
||||||
} else {
|
|
||||||
warning << _("incorrectly formatted URI list, ignored")
|
cerr << "end result = " << uris.size() << endl;
|
||||||
<< endmsg;
|
|
||||||
|
if (uris.empty()) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nautilus and presumably some other file managers prefix even text/plain with file:// */
|
for (vector<ustring>::iterator i = uris.begin(); i != uris.end(); ++i) {
|
||||||
|
cerr << "looking at " << (*i) << endl;
|
||||||
for (vector<string>::iterator p = paths.begin(); p != paths.end(); ++p) {
|
if ((*i).substr (0,7) == "file://") {
|
||||||
|
string p = *i;
|
||||||
// cerr << "dropped text was " << *p << endl;
|
url_decode (p);
|
||||||
|
cerr << "adding " << p << endl;
|
||||||
url_decode (*p);
|
paths.push_back (p.substr (7));
|
||||||
|
|
||||||
// cerr << "decoded was " << *p << endl;
|
|
||||||
|
|
||||||
if ((*p).substr (0,7) == "file://") {
|
|
||||||
(*p) = (*p).substr (7);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Editor::track_canvas_drag_data_received (GdkDragContext *context,
|
|
||||||
gint x,
|
|
||||||
gint y,
|
|
||||||
GtkSelectionData *data,
|
|
||||||
guint info,
|
|
||||||
guint time)
|
|
||||||
{
|
|
||||||
TimeAxisView* tvp;
|
|
||||||
AudioTimeAxisView* tv;
|
|
||||||
double cy;
|
|
||||||
vector<string> paths;
|
|
||||||
string spath;
|
|
||||||
GdkEvent ev;
|
|
||||||
jack_nframes_t frame;
|
|
||||||
|
|
||||||
if (convert_drop_to_paths (paths, context, x, y, data, info, time)) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* D-n-D coordinates are window-relative, so convert to "world" coordinates
|
|
||||||
*/
|
|
||||||
|
|
||||||
double wx;
|
|
||||||
double wy;
|
|
||||||
|
|
||||||
track_canvas.c2w( x, y, wx, wy);
|
|
||||||
|
|
||||||
ev.type = GDK_BUTTON_RELEASE;
|
|
||||||
ev.button.x = wx;
|
|
||||||
ev.button.y = wy;
|
|
||||||
|
|
||||||
frame = event_frame (&ev, 0, &cy);
|
|
||||||
|
|
||||||
snap_to (frame);
|
|
||||||
|
|
||||||
if ((tvp = trackview_by_y_position (cy)) == 0) {
|
|
||||||
|
|
||||||
/* drop onto canvas background: create a new track */
|
|
||||||
|
|
||||||
insert_paths_as_new_tracks (paths, false);
|
|
||||||
|
|
||||||
|
|
||||||
} else if ((tv = dynamic_cast<AudioTimeAxisView*>(tvp)) != 0) {
|
|
||||||
|
|
||||||
/* check that its an audio track, not a bus */
|
|
||||||
|
|
||||||
if (tv->get_diskstream()) {
|
|
||||||
|
|
||||||
for (vector<string>::iterator p = paths.begin(); p != paths.end(); ++p) {
|
|
||||||
insert_sndfile_into (*p, true, tv, frame);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
gtk_drag_finish (context, TRUE, FALSE, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::new_tempo_section ()
|
Editor::new_tempo_section ()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
|
|
||||||
#include <gtkmm2ext/selector.h>
|
#include <gtkmm2ext/selector.h>
|
||||||
#include <gtkmm2ext/click_box.h>
|
#include <gtkmm2ext/click_box.h>
|
||||||
|
#include <gtkmm2ext/dndtreeview.h>
|
||||||
|
|
||||||
#include <ardour/stateful.h>
|
#include <ardour/stateful.h>
|
||||||
#include <ardour/session.h>
|
#include <ardour/session.h>
|
||||||
|
|
@ -688,7 +689,7 @@ class Editor : public PublicEditor
|
||||||
};
|
};
|
||||||
|
|
||||||
RegionListDisplayModelColumns region_list_columns;
|
RegionListDisplayModelColumns region_list_columns;
|
||||||
Gtk::TreeView region_list_display;
|
Gtkmm2ext::DnDTreeView region_list_display;
|
||||||
Glib::RefPtr<Gtk::TreeStore> region_list_model;
|
Glib::RefPtr<Gtk::TreeStore> region_list_model;
|
||||||
Glib::RefPtr<Gtk::TreeModelSort> region_list_sort_model;
|
Glib::RefPtr<Gtk::TreeModelSort> region_list_sort_model;
|
||||||
Glib::RefPtr<Gtk::Action> toggle_full_region_list_action;
|
Glib::RefPtr<Gtk::Action> toggle_full_region_list_action;
|
||||||
|
|
@ -738,7 +739,7 @@ class Editor : public PublicEditor
|
||||||
NamedSelectionDisplayModelColumns named_selection_columns;
|
NamedSelectionDisplayModelColumns named_selection_columns;
|
||||||
Glib::RefPtr<Gtk::TreeStore> named_selection_model;
|
Glib::RefPtr<Gtk::TreeStore> named_selection_model;
|
||||||
|
|
||||||
Gtk::TreeView named_selection_display;
|
Gtkmm2ext::DnDTreeView named_selection_display;
|
||||||
Gtk::ScrolledWindow named_selection_scroller;
|
Gtk::ScrolledWindow named_selection_scroller;
|
||||||
|
|
||||||
void name_selection();
|
void name_selection();
|
||||||
|
|
@ -1435,7 +1436,7 @@ class Editor : public PublicEditor
|
||||||
Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
|
Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
|
||||||
|
|
||||||
gint route_list_compare_func (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
|
gint route_list_compare_func (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
|
||||||
Gtk::TreeView route_list; //GTK2FIX rename to route_display
|
Gtkmm2ext::DnDTreeView route_list_display;
|
||||||
Gtk::ScrolledWindow route_list_scroller;
|
Gtk::ScrolledWindow route_list_scroller;
|
||||||
Gtk::Menu* route_list_menu;
|
Gtk::Menu* route_list_menu;
|
||||||
|
|
||||||
|
|
@ -1467,7 +1468,7 @@ class Editor : public PublicEditor
|
||||||
|
|
||||||
Gtk::Button edit_group_list_button;
|
Gtk::Button edit_group_list_button;
|
||||||
Gtk::Label edit_group_list_button_label;
|
Gtk::Label edit_group_list_button_label;
|
||||||
Gtk::TreeView edit_group_list;
|
Gtkmm2ext::DnDTreeView edit_group_display;
|
||||||
Gtk::ScrolledWindow edit_group_list_scroller;
|
Gtk::ScrolledWindow edit_group_list_scroller;
|
||||||
Gtk::Menu* edit_group_list_menu;
|
Gtk::Menu* edit_group_list_menu;
|
||||||
Gtk::VBox edit_group_vbox;
|
Gtk::VBox edit_group_vbox;
|
||||||
|
|
@ -1524,27 +1525,28 @@ class Editor : public PublicEditor
|
||||||
/* Drag-n-Drop */
|
/* Drag-n-Drop */
|
||||||
|
|
||||||
int convert_drop_to_paths (std::vector<std::string>& paths,
|
int convert_drop_to_paths (std::vector<std::string>& paths,
|
||||||
GdkDragContext *context,
|
const Glib::RefPtr<Gdk::DragContext>& context,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
GtkSelectionData *data,
|
const Gtk::SelectionData& data,
|
||||||
guint info,
|
guint info,
|
||||||
guint time);
|
guint time);
|
||||||
|
|
||||||
void track_canvas_drag_data_received (GdkDragContext *context,
|
void track_canvas_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
GtkSelectionData *data,
|
const Gtk::SelectionData& data,
|
||||||
guint info,
|
guint info,
|
||||||
guint time);
|
guint time);
|
||||||
|
|
||||||
void region_list_display_drag_data_received (GdkDragContext *context,
|
void region_list_display_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
GtkSelectionData *data,
|
const Gtk::SelectionData& data,
|
||||||
guint info,
|
guint info,
|
||||||
guint time);
|
guint time);
|
||||||
|
|
||||||
|
|
||||||
/* audio export */
|
/* audio export */
|
||||||
|
|
||||||
ExportDialog *export_dialog;
|
ExportDialog *export_dialog;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
#include "rgb_macros.h"
|
#include "rgb_macros.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "time_axis_view.h"
|
#include "time_axis_view.h"
|
||||||
|
#include "audio_time_axis.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
@ -399,3 +400,61 @@ Editor::time_canvas_map_handler (GdkEventAny* ev)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context,
|
||||||
|
int x, int y,
|
||||||
|
const SelectionData& data,
|
||||||
|
guint info, guint time)
|
||||||
|
{
|
||||||
|
TimeAxisView* tvp;
|
||||||
|
AudioTimeAxisView* tv;
|
||||||
|
double cy;
|
||||||
|
vector<string> paths;
|
||||||
|
string spath;
|
||||||
|
GdkEvent ev;
|
||||||
|
jack_nframes_t frame;
|
||||||
|
|
||||||
|
if (convert_drop_to_paths (paths, context, x, y, data, info, time)) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* D-n-D coordinates are window-relative, so convert to "world" coordinates
|
||||||
|
*/
|
||||||
|
|
||||||
|
double wx;
|
||||||
|
double wy;
|
||||||
|
|
||||||
|
track_canvas.c2w( x, y, wx, wy);
|
||||||
|
|
||||||
|
ev.type = GDK_BUTTON_RELEASE;
|
||||||
|
ev.button.x = wx;
|
||||||
|
ev.button.y = wy;
|
||||||
|
|
||||||
|
frame = event_frame (&ev, 0, &cy);
|
||||||
|
|
||||||
|
snap_to (frame);
|
||||||
|
|
||||||
|
if ((tvp = trackview_by_y_position (cy)) == 0) {
|
||||||
|
|
||||||
|
/* drop onto canvas background: create a new track */
|
||||||
|
|
||||||
|
insert_paths_as_new_tracks (paths, false);
|
||||||
|
|
||||||
|
|
||||||
|
} else if ((tv = dynamic_cast<AudioTimeAxisView*>(tvp)) != 0) {
|
||||||
|
|
||||||
|
/* check that its an audio track, not a bus */
|
||||||
|
|
||||||
|
if (tv->get_diskstream()) {
|
||||||
|
|
||||||
|
for (vector<string>::iterator p = paths.begin(); p != paths.end(); ++p) {
|
||||||
|
insert_sndfile_into (*p, true, tv, frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
context->drag_finish (true, false, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ Editor::select_all_edit_groups ()
|
||||||
|
|
||||||
Gtk::TreeModel::Children children = group_model->children();
|
Gtk::TreeModel::Children children = group_model->children();
|
||||||
for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
|
for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
|
||||||
edit_group_list.get_selection()->select (iter);
|
edit_group_display.get_selection()->select (iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@ Editor::edit_group_list_button_press_event (GdkEventButton* ev)
|
||||||
int cellx;
|
int cellx;
|
||||||
int celly;
|
int celly;
|
||||||
|
|
||||||
if (!edit_group_list.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
|
if (!edit_group_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,10 +135,10 @@ Editor::edit_group_list_button_press_event (GdkEventButton* ev)
|
||||||
case 1:
|
case 1:
|
||||||
|
|
||||||
if (Keyboard::is_edit_event (ev)) {
|
if (Keyboard::is_edit_event (ev)) {
|
||||||
// RouteGroup* group = (RouteGroup *) edit_group_list.row(row).get_data ();
|
// RouteGroup* group = (RouteGroup *) edit_group_display.row(row).get_data ();
|
||||||
// edit_route_group (group);
|
// edit_route_group (group);
|
||||||
|
|
||||||
return stop_signal (edit_group_list, "button_press_event");
|
return stop_signal (edit_group_display, "button_press_event");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* allow regular select to occur */
|
/* allow regular select to occur */
|
||||||
|
|
@ -157,7 +157,7 @@ Editor::edit_group_list_button_press_event (GdkEventButton* ev)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return stop_signal (edit_group_list, "button_press_event");
|
return stop_signal (edit_group_display, "button_press_event");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -165,7 +165,7 @@ Editor::edit_group_selection_changed ()
|
||||||
{
|
{
|
||||||
TreeModel::iterator i;
|
TreeModel::iterator i;
|
||||||
TreeModel::Children rows = group_model->children();
|
TreeModel::Children rows = group_model->children();
|
||||||
Glib::RefPtr<TreeSelection> selection = edit_group_list.get_selection();
|
Glib::RefPtr<TreeSelection> selection = edit_group_display.get_selection();
|
||||||
|
|
||||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||||
RouteGroup* group;
|
RouteGroup* group;
|
||||||
|
|
@ -212,12 +212,12 @@ Editor::group_flags_changed (void* src, RouteGroup* group)
|
||||||
// select row
|
// select row
|
||||||
}
|
}
|
||||||
|
|
||||||
CList_Helpers::RowIterator ri = edit_group_list.rows().find_data (group);
|
CList_Helpers::RowIterator ri = edit_group_display.rows().find_data (group);
|
||||||
|
|
||||||
if (group->is_active()) {
|
if (group->is_active()) {
|
||||||
edit_group_list.cell (ri->get_row_num(),0).set_pixmap (check_pixmap, check_mask);
|
edit_group_display.cell (ri->get_row_num(),0).set_pixmap (check_pixmap, check_mask);
|
||||||
} else {
|
} else {
|
||||||
edit_group_list.cell (ri->get_row_num(),0).set_pixmap (empty_pixmap, empty_mask);
|
edit_group_display.cell (ri->get_row_num(),0).set_pixmap (empty_pixmap, empty_mask);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1090,7 +1090,7 @@ Editor::handle_new_imageframe_time_axis_view(const string & track_name, void* sr
|
||||||
|
|
||||||
row[route_display_columns.text] = iftav->name();
|
row[route_display_columns.text] = iftav->name();
|
||||||
row[route_display_columns.tv] = iftav;
|
row[route_display_columns.tv] = iftav;
|
||||||
route_list.get_selection()->select (row);
|
route_list_display.get_selection()->select (row);
|
||||||
|
|
||||||
iftav->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)iftav)) ;
|
iftav->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)iftav)) ;
|
||||||
iftav->gui_changed.connect(mem_fun(*this, &Editor::handle_gui_changes)) ;
|
iftav->gui_changed.connect(mem_fun(*this, &Editor::handle_gui_changes)) ;
|
||||||
|
|
@ -1107,7 +1107,7 @@ Editor::handle_new_imageframe_marker_time_axis_view(const string & track_name, T
|
||||||
|
|
||||||
row[route_display_columns.text] = mta->name();
|
row[route_display_columns.text] = mta->name();
|
||||||
row[route_display_columns.tv] = mta;
|
row[route_display_columns.tv] = mta;
|
||||||
route_list.get_selection()->select (row);
|
route_list_display.get_selection()->select (row);
|
||||||
|
|
||||||
mta->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)mta)) ;
|
mta->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)mta)) ;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ void
|
||||||
Editor::kbd_driver (sigc::slot<void,GdkEvent*> theslot, bool use_track_canvas, bool use_time_canvas, bool can_select)
|
Editor::kbd_driver (sigc::slot<void,GdkEvent*> theslot, bool use_track_canvas, bool use_time_canvas, bool can_select)
|
||||||
{
|
{
|
||||||
gint x, y;
|
gint x, y;
|
||||||
double dx, dy;
|
double worldx, worldy;
|
||||||
GdkEvent ev;
|
GdkEvent ev;
|
||||||
Gdk::ModifierType mask;
|
Gdk::ModifierType mask;
|
||||||
Glib::RefPtr<Gdk::Window> evw = track_canvas.get_window()->get_pointer (x, y, mask);
|
Glib::RefPtr<Gdk::Window> evw = track_canvas.get_window()->get_pointer (x, y, mask);
|
||||||
|
|
@ -46,10 +46,11 @@ Editor::kbd_driver (sigc::slot<void,GdkEvent*> theslot, bool use_track_canvas, b
|
||||||
selection->set (entered_regionview);
|
selection->set (entered_regionview);
|
||||||
}
|
}
|
||||||
|
|
||||||
track_canvas.c2w(x, y, dx, dy);
|
track_canvas.window_to_world (x, y, worldx, worldy);
|
||||||
|
|
||||||
ev.type = GDK_BUTTON_PRESS;
|
ev.type = GDK_BUTTON_PRESS;
|
||||||
ev.button.x = dx;
|
ev.button.x = worldx;
|
||||||
ev.button.y = dy;
|
ev.button.y = worldy;
|
||||||
ev.button.state = 0; /* XXX correct? */
|
ev.button.state = 0; /* XXX correct? */
|
||||||
|
|
||||||
theslot (&ev);
|
theslot (&ev);
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
|
using namespace Glib;
|
||||||
using namespace Editing;
|
using namespace Editing;
|
||||||
|
|
||||||
#define wave_cursor_width 43
|
#define wave_cursor_width 43
|
||||||
|
|
@ -345,7 +346,7 @@ Editor::redisplay_regions ()
|
||||||
add_audio_region_to_region_display (*r);
|
add_audio_region_to_region_display (*r);
|
||||||
}
|
}
|
||||||
|
|
||||||
region_list_display.set_model (region_list_sort_model);
|
region_list_display.set_model (region_list_model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -362,7 +363,7 @@ Editor::build_region_list_menu ()
|
||||||
|
|
||||||
/* now grab specific menu items that we need */
|
/* now grab specific menu items that we need */
|
||||||
|
|
||||||
toggle_full_region_list_action = ActionManager::get_action ("<Actions>/RegionList/rlShowAll");
|
toggle_full_region_list_action = ActionManager::get_action (X_("RegionList"), X_("rlShowAll"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -646,7 +647,7 @@ Editor::reset_region_list_sort_type (RegionListSortType type)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
region_list_sort_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
// region_list_sort_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -656,7 +657,7 @@ Editor::reset_region_list_sort_direction (bool up)
|
||||||
// GTK2FIX
|
// GTK2FIX
|
||||||
//region_list_display.set_sort_type (up ? GTK_SORT_ASCENDING : GTK_SORT_DESCENDING);
|
//region_list_display.set_sort_type (up ? GTK_SORT_ASCENDING : GTK_SORT_DESCENDING);
|
||||||
/* reset to force resort */
|
/* reset to force resort */
|
||||||
region_list_sort_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
// region_list_sort_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -710,18 +711,15 @@ Editor::remove_region_from_region_list ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::region_list_display_drag_data_received (GdkDragContext *context,
|
Editor::region_list_display_drag_data_received (const RefPtr<Gdk::DragContext>& context,
|
||||||
gint x,
|
int x, int y,
|
||||||
gint y,
|
const SelectionData& data,
|
||||||
GtkSelectionData *data,
|
guint info, guint time)
|
||||||
guint info,
|
|
||||||
guint time)
|
|
||||||
{
|
{
|
||||||
vector<string> paths;
|
vector<string> paths;
|
||||||
|
|
||||||
if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
|
if (convert_drop_to_paths (paths, context, x, y, data, info, time) == 0) {
|
||||||
do_embed_sndfiles (paths, false);
|
do_embed_sndfiles (paths, false);
|
||||||
|
context->drag_finish (true, false, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_drag_finish (context, TRUE, FALSE, time);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ Editor::handle_new_route (Route& route)
|
||||||
ignore_route_list_reorder = true;
|
ignore_route_list_reorder = true;
|
||||||
|
|
||||||
if (tv->marked_for_display()) {
|
if (tv->marked_for_display()) {
|
||||||
route_list.get_selection()->select (row);
|
route_list_display.get_selection()->select (row);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((atv = dynamic_cast<AudioTimeAxisView*> (tv)) != 0) {
|
if ((atv = dynamic_cast<AudioTimeAxisView*> (tv)) != 0) {
|
||||||
|
|
@ -151,7 +151,7 @@ Editor::route_display_selection_changed ()
|
||||||
TimeAxisView *tv;
|
TimeAxisView *tv;
|
||||||
TreeModel::Children rows = route_display_model->children();
|
TreeModel::Children rows = route_display_model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
Glib::RefPtr<TreeSelection> selection = route_list.get_selection();
|
Glib::RefPtr<TreeSelection> selection = route_list_display.get_selection();
|
||||||
|
|
||||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||||
tv = (*i)[route_display_columns.tv];
|
tv = (*i)[route_display_columns.tv];
|
||||||
|
|
@ -177,7 +177,7 @@ Editor::unselect_strip_in_display (TimeAxisView& tv)
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = route_display_model->children();
|
TreeModel::Children rows = route_display_model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
Glib::RefPtr<TreeSelection> selection = route_list.get_selection();
|
Glib::RefPtr<TreeSelection> selection = route_list_display.get_selection();
|
||||||
|
|
||||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||||
if ((*i)[route_display_columns.tv] == &tv) {
|
if ((*i)[route_display_columns.tv] == &tv) {
|
||||||
|
|
@ -191,7 +191,7 @@ Editor::select_strip_in_display (TimeAxisView* tv)
|
||||||
{
|
{
|
||||||
TreeModel::Children rows = route_display_model->children();
|
TreeModel::Children rows = route_display_model->children();
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
Glib::RefPtr<TreeSelection> selection = route_list.get_selection();
|
Glib::RefPtr<TreeSelection> selection = route_list_display.get_selection();
|
||||||
|
|
||||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||||
if ((*i)[route_display_columns.tv] == tv) {
|
if ((*i)[route_display_columns.tv] == tv) {
|
||||||
|
|
@ -272,14 +272,14 @@ Editor::hide_all_tracks (bool with_select)
|
||||||
TimeAxisView *tv = row[route_display_columns.tv];
|
TimeAxisView *tv = row[route_display_columns.tv];
|
||||||
|
|
||||||
if (with_select) {
|
if (with_select) {
|
||||||
route_list.get_selection()->unselect (i);
|
route_list_display.get_selection()->unselect (i);
|
||||||
} else {
|
} else {
|
||||||
tv->set_marked_for_display (false);
|
tv->set_marked_for_display (false);
|
||||||
tv->hide();
|
tv->hide();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//route_list.thaw ();
|
//route_list_display.thaw ();
|
||||||
reset_scrolling_region ();
|
reset_scrolling_region ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -328,7 +328,7 @@ Editor::select_all_routes ()
|
||||||
TreeModel::Children::iterator i;
|
TreeModel::Children::iterator i;
|
||||||
|
|
||||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||||
route_list.get_selection()->select (i);
|
route_list_display.get_selection()->select (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -345,7 +345,7 @@ Editor::select_all_audiotracks ()
|
||||||
|
|
||||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
||||||
if (atv->is_audio_track()) {
|
if (atv->is_audio_track()) {
|
||||||
route_list.get_selection()->select (i);
|
route_list_display.get_selection()->select (i);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -366,7 +366,7 @@ Editor::unselect_all_audiotracks ()
|
||||||
|
|
||||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
||||||
if (atv->is_audio_track()) {
|
if (atv->is_audio_track()) {
|
||||||
route_list.get_selection()->unselect (i);
|
route_list_display.get_selection()->unselect (i);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -387,7 +387,7 @@ Editor::select_all_audiobus ()
|
||||||
|
|
||||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
||||||
if (!atv->is_audio_track()) {
|
if (!atv->is_audio_track()) {
|
||||||
route_list.get_selection()->select (i);
|
route_list_display.get_selection()->select (i);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -408,7 +408,7 @@ Editor::unselect_all_audiobus ()
|
||||||
|
|
||||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
||||||
if (!atv->is_audio_track()) {
|
if (!atv->is_audio_track()) {
|
||||||
route_list.get_selection()->unselect (i);
|
route_list_display.get_selection()->unselect (i);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -575,15 +575,12 @@ LocationUI::LocationUI ()
|
||||||
set_wmclass(_("ardour_locations"), "Ardour");
|
set_wmclass(_("ardour_locations"), "Ardour");
|
||||||
|
|
||||||
set_name ("LocationWindow");
|
set_name ("LocationWindow");
|
||||||
signal_delete_event().connect (bind (ptr_fun (just_hide_it), static_cast<Window*>(this)));
|
|
||||||
|
|
||||||
add (location_hpacker);
|
|
||||||
|
|
||||||
|
get_vbox()->pack_start (location_hpacker);
|
||||||
|
|
||||||
location_vpacker.set_border_width (10);
|
location_vpacker.set_border_width (10);
|
||||||
location_vpacker.set_spacing (5);
|
location_vpacker.set_spacing (5);
|
||||||
|
|
||||||
|
|
||||||
location_vpacker.pack_start (loop_edit_row, false, false);
|
location_vpacker.pack_start (loop_edit_row, false, false);
|
||||||
location_vpacker.pack_start (punch_edit_row, false, false);
|
location_vpacker.pack_start (punch_edit_row, false, false);
|
||||||
|
|
||||||
|
|
@ -861,3 +858,9 @@ LocationUI::session_gone()
|
||||||
ArdourDialog::session_gone ();
|
ArdourDialog::session_gone ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
LocationUI::on_delete_event (GdkEventAny* ev)
|
||||||
|
{
|
||||||
|
hide ();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,13 +148,10 @@ class LocationUI : public ArdourDialog
|
||||||
void set_session (ARDOUR::Session *);
|
void set_session (ARDOUR::Session *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
ARDOUR::LocationStack* locations;
|
ARDOUR::LocationStack* locations;
|
||||||
|
|
||||||
void session_gone();
|
void session_gone();
|
||||||
|
|
||||||
|
|
||||||
Gtk::VBox location_vpacker;
|
Gtk::VBox location_vpacker;
|
||||||
Gtk::HBox location_hpacker;
|
Gtk::HBox location_hpacker;
|
||||||
|
|
||||||
|
|
@ -197,6 +194,9 @@ class LocationUI : public ArdourDialog
|
||||||
void location_removed (ARDOUR::Location *);
|
void location_removed (ARDOUR::Location *);
|
||||||
void location_added (ARDOUR::Location *);
|
void location_added (ARDOUR::Location *);
|
||||||
void map_locations (ARDOUR::Locations::LocationList&);
|
void map_locations (ARDOUR::Locations::LocationList&);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool on_delete_event (GdkEventAny*);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __ardour_location_ui_h__
|
#endif // __ardour_location_ui_h__
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include <gtkmm2ext/dndtreeview.h>
|
#include <gtkmm2ext/dndtreeview.h>
|
||||||
|
|
||||||
|
|
@ -13,6 +14,7 @@ DnDTreeView::DnDTreeView ()
|
||||||
: TreeView ()
|
: TreeView ()
|
||||||
{
|
{
|
||||||
draggable.push_back (TargetEntry ("GTK_TREE_MODEL_ROW", TARGET_SAME_WIDGET));
|
draggable.push_back (TargetEntry ("GTK_TREE_MODEL_ROW", TARGET_SAME_WIDGET));
|
||||||
|
data_column = -1;
|
||||||
|
|
||||||
enable_model_drag_source (draggable);
|
enable_model_drag_source (draggable);
|
||||||
enable_model_drag_dest (draggable);
|
enable_model_drag_dest (draggable);
|
||||||
|
|
@ -20,6 +22,16 @@ DnDTreeView::DnDTreeView ()
|
||||||
suggested_action = Gdk::DragAction (0);
|
suggested_action = Gdk::DragAction (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DnDTreeView::add_drop_targets (list<TargetEntry>& targets)
|
||||||
|
{
|
||||||
|
for (list<TargetEntry>::iterator i = targets.begin(); i != targets.end(); ++i) {
|
||||||
|
draggable.push_back (*i);
|
||||||
|
}
|
||||||
|
enable_model_drag_source (draggable);
|
||||||
|
enable_model_drag_dest (draggable);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DnDTreeView::add_object_drag (int column, string type_name)
|
DnDTreeView::add_object_drag (int column, string type_name)
|
||||||
{
|
{
|
||||||
|
|
@ -57,11 +69,13 @@ DnDTreeView::serialize_pointers (RefPtr<TreeModel> model, TreeSelection::ListHan
|
||||||
void
|
void
|
||||||
DnDTreeView::on_drag_data_get(const RefPtr<DragContext>& context, SelectionData& selection_data, guint info, guint time)
|
DnDTreeView::on_drag_data_get(const RefPtr<DragContext>& context, SelectionData& selection_data, guint info, guint time)
|
||||||
{
|
{
|
||||||
|
cerr << "DnDTreeview::drag_data_get, target = " << selection_data.get_target() << endl;
|
||||||
|
|
||||||
if (selection_data.get_target() == "GTK_TREE_MODEL_ROW") {
|
if (selection_data.get_target() == "GTK_TREE_MODEL_ROW") {
|
||||||
|
|
||||||
TreeView::on_drag_data_get (context, selection_data, info, time);
|
TreeView::on_drag_data_get (context, selection_data, info, time);
|
||||||
|
|
||||||
} else {
|
} else if (data_column >= 0) {
|
||||||
|
|
||||||
Gtk::TreeSelection::ListHandle_Path selection = get_selection()->get_selected_rows ();
|
Gtk::TreeSelection::ListHandle_Path selection = get_selection()->get_selected_rows ();
|
||||||
SerializedObjectPointers* sr = serialize_pointers (get_model(), &selection, selection_data.get_target());
|
SerializedObjectPointers* sr = serialize_pointers (get_model(), &selection, selection_data.get_target());
|
||||||
|
|
@ -73,6 +87,8 @@ DnDTreeView::on_drag_data_get(const RefPtr<DragContext>& context, SelectionData&
|
||||||
void
|
void
|
||||||
DnDTreeView::on_drag_data_received(const RefPtr<DragContext>& context, int x, int y, const SelectionData& selection_data, guint info, guint time)
|
DnDTreeView::on_drag_data_received(const RefPtr<DragContext>& context, int x, int y, const SelectionData& selection_data, guint info, guint time)
|
||||||
{
|
{
|
||||||
|
cerr << "DnDTreeview::drag_data_received @ " << x << ',' << y << " target = " << selection_data.get_target() << endl;
|
||||||
|
|
||||||
if (suggested_action) {
|
if (suggested_action) {
|
||||||
/* this is a drag motion callback. just update the status to
|
/* this is a drag motion callback. just update the status to
|
||||||
say that we are still dragging, and that's it.
|
say that we are still dragging, and that's it.
|
||||||
|
|
@ -86,7 +102,8 @@ DnDTreeView::on_drag_data_received(const RefPtr<DragContext>& context, int x, in
|
||||||
|
|
||||||
TreeView::on_drag_data_received (context, x, y, selection_data, info, time);
|
TreeView::on_drag_data_received (context, x, y, selection_data, info, time);
|
||||||
|
|
||||||
} else {
|
} else if (data_column >= 0) {
|
||||||
|
|
||||||
/* object D-n-D */
|
/* object D-n-D */
|
||||||
|
|
||||||
const SerializedObjectPointers* sr = reinterpret_cast<const SerializedObjectPointers *>(selection_data.get_data());
|
const SerializedObjectPointers* sr = reinterpret_cast<const SerializedObjectPointers *>(selection_data.get_data());
|
||||||
|
|
@ -95,8 +112,8 @@ DnDTreeView::on_drag_data_received(const RefPtr<DragContext>& context, int x, in
|
||||||
signal_object_drop (sr->type, sr->cnt, const_cast<void**>(sr->ptr));
|
signal_object_drop (sr->type, sr->cnt, const_cast<void**>(sr->ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
context->drag_finish (true, false, time);
|
} else {
|
||||||
|
/* some kind of target type added by the app, which will be handled by a signal handler */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,10 @@ UI::UI (string name, int *argc, char ***argv, string rcfile)
|
||||||
theMain = new Main (argc, argv);
|
theMain = new Main (argc, argv);
|
||||||
tips = new Tooltips;
|
tips = new Tooltips;
|
||||||
|
|
||||||
|
// allow run-time rebinding of accels
|
||||||
|
|
||||||
|
Settings::get_default()->property_gtk_can_change_accels() = true;
|
||||||
|
|
||||||
if (pthread_key_create (&thread_request_buffer_key, 0)) {
|
if (pthread_key_create (&thread_request_buffer_key, 0)) {
|
||||||
cerr << _("cannot create thread request buffer key") << endl;
|
cerr << _("cannot create thread request buffer key") << endl;
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ class DnDTreeView : public Gtk::TreeView
|
||||||
DnDTreeView ();
|
DnDTreeView ();
|
||||||
~DnDTreeView() {}
|
~DnDTreeView() {}
|
||||||
|
|
||||||
|
void add_drop_targets (std::list<Gtk::TargetEntry>&);
|
||||||
void add_object_drag (int column, std::string type_name);
|
void add_object_drag (int column, std::string type_name);
|
||||||
sigc::signal<void,std::string,uint32_t,void**> signal_object_drop;
|
sigc::signal<void,std::string,uint32_t,void**> signal_object_drop;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue