X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmtest.cc;h=3103a8305365d8aebf01703c1efce77013d80a0d;hb=b502bbc61895d61c39bf240b47e8a3664be2c541;hp=7d62509159ef9d222c18f7943e55d2ba6f817590;hpb=9643eb4b2320c2ec77613cddd6a66056514bcdfa;p=ardour.git diff --git a/gtk2_ardour/mtest.cc b/gtk2_ardour/mtest.cc index 7d62509159..3103a83053 100644 --- a/gtk2_ardour/mtest.cc +++ b/gtk2_ardour/mtest.cc @@ -1,3 +1,22 @@ +/* + Copyright (C) 2000-2007 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. + +*/ + #include #include #include @@ -7,7 +26,6 @@ using namespace Gtk; using namespace std; -using namespace sigc; using namespace Glib; void @@ -28,7 +46,7 @@ make_action (Glib::RefPtr group, string name, string label, RefPtr< act->set_accel_group (accels); cerr << "action " << name << " has path " << act->get_accel_path() << endl; - + return act; } @@ -45,12 +63,12 @@ make_action (Glib::RefPtr group, string name, string label) return act; } -bool -lookup_entry (const ustring accel_path, Gtk::AccelKey& key) +bool +lookup_entry (const string accel_path, Gtk::AccelKey& key) { GtkAccelKey gkey; bool known = gtk_accel_map_lookup_entry (accel_path.c_str(), &gkey); - + if (known) { key = AccelKey (gkey.accel_key, Gdk::ModifierType (gkey.accel_mods)); } else { @@ -64,9 +82,9 @@ RefPtr copy_actions (const RefPtr src) { RefPtr grp = ActionGroup::create (src->get_name()); - + ListHandle > group_actions = src->get_actions(); - + for (ListHandle >::iterator a = group_actions.begin(); a != group_actions.end(); ++a) { RefPtr act = Action::create ((*a)->get_name(), (*a)->property_label()); grp->add (act); @@ -110,20 +128,20 @@ main (int argc, char* argv[]) uimanager->add_ui_from_file ("mtest.menus"); other_uimanager->add_ui_from_file ("mtest_other.menus"); - + // AccelMap::load ("mtest.bindings"); RefPtr accels = hidden.get_accel_group(); make_action (actions, "TopMenu", "top"); - make_action (actions, "Foo", "foo", accels, bind (sigc::ptr_fun (printit), "foo"), GDK_p, Gdk::ModifierType (0)); + make_action (actions, "Foo", "foo", accels, sigc::bind (sigc::ptr_fun (printit), "foo"), GDK_p, Gdk::ModifierType (0)); make_action (other_actions, "OTopMenu", "otop"); - make_action (other_actions, "OFoo", "foo", accels, bind (sigc::ptr_fun (printit), "o-foo"), GDK_p, Gdk::ModifierType (0)); + make_action (other_actions, "OFoo", "foo", accels, sigc::bind (sigc::ptr_fun (printit), "o-foo"), GDK_p, Gdk::ModifierType (0)); + + make_action (shared_actions, "Bar", "bar", accels, sigc::bind (sigc::ptr_fun (printit), "barshared"), GDK_p, Gdk::CONTROL_MASK); + RefPtr act = make_action (shared_actions, "Baz", "baz", accels, sigc::bind (sigc::ptr_fun (printit), "baz-shared"), GDK_p, Gdk::SHIFT_MASK); - make_action (shared_actions, "Bar", "bar", accels, bind (sigc::ptr_fun (printit), "barshared"), GDK_p, Gdk::CONTROL_MASK); - RefPtr act = make_action (shared_actions, "Baz", "baz", accels, bind (sigc::ptr_fun (printit), "baz-shared"), GDK_p, Gdk::SHIFT_MASK); - act->connect_proxy (button); act->connect_proxy (other_button);