1 |
/* |
/* |
2 |
Copyright (c) 2014-2019 Christian Schoenebeck |
Copyright (c) 2014-2020 Christian Schoenebeck |
3 |
|
|
4 |
This file is part of "gigedit" and released under the terms of the |
This file is part of "gigedit" and released under the terms of the |
5 |
GNU General Public License version 2. |
GNU General Public License version 2. |
6 |
*/ |
*/ |
989 |
|
|
990 |
void CombineInstrumentsDialog::on_order_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context) |
void CombineInstrumentsDialog::on_order_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context) |
991 |
{ |
{ |
992 |
|
#if DEBUG_COMBINE_INSTRUMENTS |
993 |
printf("Drag begin\n"); |
printf("Drag begin\n"); |
994 |
|
#endif |
995 |
first_call_to_drag_data_get = true; |
first_call_to_drag_data_get = true; |
996 |
} |
} |
997 |
|
|
998 |
void CombineInstrumentsDialog::on_order_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, |
void CombineInstrumentsDialog::on_order_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, |
999 |
Gtk::SelectionData& selection_data, guint, guint) |
Gtk::SelectionData& selection_data, guint, guint) |
1000 |
{ |
{ |
1001 |
|
#if DEBUG_COMBINE_INSTRUMENTS |
1002 |
printf("Drag data get\n"); |
printf("Drag data get\n"); |
1003 |
|
#endif |
1004 |
if (!first_call_to_drag_data_get) return; |
if (!first_call_to_drag_data_get) return; |
1005 |
first_call_to_drag_data_get = false; |
first_call_to_drag_data_get = false; |
1006 |
|
|
1020 |
printf("Drag data get: !src\n"); |
printf("Drag data get: !src\n"); |
1021 |
return; |
return; |
1022 |
} |
} |
1023 |
|
#if DEBUG_COMBINE_INSTRUMENTS |
1024 |
printf("src=%ld\n", (size_t)src); |
printf("src=%ld\n", (size_t)src); |
1025 |
|
#endif |
1026 |
|
|
1027 |
// pass the source gig::Instrument as pointer |
// pass the source gig::Instrument as pointer |
1028 |
selection_data.set(selection_data.get_target(), 0/*unused*/, (const guchar*)&src, |
selection_data.set(selection_data.get_target(), 0/*unused*/, (const guchar*)&src, |
1033 |
const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, |
const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, |
1034 |
const Gtk::SelectionData& selection_data, guint, guint time) |
const Gtk::SelectionData& selection_data, guint, guint time) |
1035 |
{ |
{ |
1036 |
|
#if DEBUG_COMBINE_INSTRUMENTS |
1037 |
printf("Drag data received\n"); |
printf("Drag data received\n"); |
1038 |
|
#endif |
1039 |
if (!selection_data.get_data()) { |
if (!selection_data.get_data()) { |
1040 |
printf("selection_data.get_data() == NULL\n"); |
printf("selection_data.get_data() == NULL\n"); |
1041 |
return; |
return; |
1046 |
printf("!src\n"); |
printf("!src\n"); |
1047 |
return; |
return; |
1048 |
} |
} |
1049 |
|
#if DEBUG_COMBINE_INSTRUMENTS |
1050 |
printf("src=%ld\n", (size_t)src); |
printf("src=%ld\n", (size_t)src); |
1051 |
|
#endif |
1052 |
|
|
1053 |
gig::Instrument* dst = NULL; |
gig::Instrument* dst = NULL; |
1054 |
{ |
{ |
1065 |
return; |
return; |
1066 |
} |
} |
1067 |
|
|
1068 |
|
#if DEBUG_COMBINE_INSTRUMENTS |
1069 |
printf("dragdrop received src='%s' dst='%s'\n", src->pInfo->Name.c_str(), dst->pInfo->Name.c_str()); |
printf("dragdrop received src='%s' dst='%s'\n", src->pInfo->Name.c_str(), dst->pInfo->Name.c_str()); |
1070 |
|
#endif |
1071 |
|
|
1072 |
// swap the two items |
// swap the two items |
1073 |
typedef Gtk::TreeModel::Children Children; |
typedef Gtk::TreeModel::Children Children; |