From d58be04cc06d8bcf0a18f7830026b3ace4da7316 Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 28 Nov 2008 18:58:46 +0000 Subject: [PATCH] Tidy the layout of the code that sets the keyboard shortcuts. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2301 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/app.cpp | 164 ++++++++++++++++------------------ 1 file changed, 75 insertions(+), 89 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index 18cab60..64f0f32 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -992,7 +992,7 @@ init_ui_manager() } // Add default keyboard accelerators -#define ACCEL(path,accel) \ +#define ACCEL(accel,path) \ { \ Gtk::AccelKey accel_key(accel,path); \ Gtk::AccelMap::add_entry(accel_key.get_path(), accel_key.get_key(), accel_key.get_mod()); \ @@ -1004,94 +1004,80 @@ init_ui_manager() Gtk::AccelMap::add_entry(accel_key.get_path(), accel_key.get_key(), accel_key.get_mod()); \ } - ACCEL("//select-all-ducks","a"); - ACCEL("//unselect-all-ducks","d"); - ACCEL("//select-all-layers","a"); - ACCEL("//unselect-all-layers","d"); - ACCEL("//render","F9"); - ACCEL("//preview","F11"); - ACCEL("//properties","F8"); - ACCEL("//options","F12"); - ACCEL("//import","i"); - ACCEL2(Gtk::AccelKey(GDK_Escape,static_cast(0),"//stop")); - ACCEL("//toggle-grid-show","g"); - ACCEL("//toggle-grid-snap","l"); - ACCEL2(Gtk::AccelKey('`',Gdk::CONTROL_MASK,"//toggle-low-res")); - ACCEL("//mask-position-ducks", "1"); - ACCEL("//mask-vertex-ducks", "2"); - ACCEL("//mask-tangent-ducks", "3"); - ACCEL("//mask-radius-ducks", "4"); - ACCEL("//mask-width-ducks", "5"); - ACCEL("//mask-angle-ducks", "6"); - - ACCEL2(Gtk::AccelKey(GDK_Page_Up,Gdk::SHIFT_MASK,"//action-layer_raise")); - ACCEL2(Gtk::AccelKey(GDK_Page_Down,Gdk::SHIFT_MASK,"//action-layer_lower")); - - ACCEL("//quality-01","1"); - ACCEL("//quality-02","2"); - ACCEL("//quality-03","3"); - ACCEL("//quality-04","4"); - ACCEL("//quality-05","5"); - ACCEL("//quality-06","6"); - ACCEL("//quality-07","7"); - ACCEL("//quality-08","8"); - ACCEL("//quality-09","9"); - ACCEL("//quality-10","0"); - ACCEL("//undo","z"); - ACCEL("//redo","r"); - ACCEL("//action-layer_remove","Delete"); - -/* ACCEL2(Gtk::AccelKey(']',static_cast(0),"//jump-next-keyframe")); - ACCEL2(Gtk::AccelKey('[',static_cast(0),"//jump-prev-keyframe")); - ACCEL2(Gtk::AccelKey('=',static_cast(0),"//canvas-zoom-in")); - ACCEL2(Gtk::AccelKey('-',static_cast(0),"//canvas-zoom-out")); - ACCEL("//time-zoom-in","+"); - ACCEL("//time-zoom-out","_"); -*/ - ACCEL2(Gtk::AccelKey('(',Gdk::CONTROL_MASK,"//decrease-low-res-pixel-size")); - ACCEL2(Gtk::AccelKey(')',Gdk::CONTROL_MASK,"//increase-low-res-pixel-size")); - - ACCEL2(Gtk::AccelKey('(',Gdk::MOD1_MASK|Gdk::CONTROL_MASK,"//amount-dec")); - ACCEL2(Gtk::AccelKey(')',Gdk::MOD1_MASK|Gdk::CONTROL_MASK,"//amount-inc")); - - ACCEL2(Gtk::AccelKey(']',Gdk::CONTROL_MASK,"//jump-next-keyframe")); - ACCEL2(Gtk::AccelKey('[',Gdk::CONTROL_MASK,"//jump-prev-keyframe")); - ACCEL2(Gtk::AccelKey('=',Gdk::CONTROL_MASK,"//canvas-zoom-in")); - ACCEL2(Gtk::AccelKey('-',Gdk::CONTROL_MASK,"//canvas-zoom-out")); - ACCEL2(Gtk::AccelKey('+',Gdk::CONTROL_MASK,"//time-zoom-in")); - ACCEL2(Gtk::AccelKey('_',Gdk::CONTROL_MASK,"//time-zoom-out")); - ACCEL2(Gtk::AccelKey('.',Gdk::CONTROL_MASK,"//seek-next-frame")); - ACCEL2(Gtk::AccelKey(',',Gdk::CONTROL_MASK,"//seek-prev-frame")); - ACCEL2(Gtk::AccelKey('>',Gdk::CONTROL_MASK,"//seek-next-second")); - ACCEL2(Gtk::AccelKey('<',Gdk::CONTROL_MASK,"//seek-prev-second")); - ACCEL2(Gtk::AccelKey('o',Gdk::MOD1_MASK,"//toggle-onion-skin")); - ACCEL("//play", "p"); - ACCEL("//seek-begin","Home"); - ACCEL("//seek-end","End"); - - ACCEL("//state-normal", "a"); - ACCEL("//state-smooth_move", "v"); - ACCEL("//state-scale", "s"); - ACCEL("//state-rotate", "t"); - ACCEL("//state-mirror", "m"); - - ACCEL("//state-circle", "c"); - ACCEL("//state-rectangle", "r"); - ACCEL("//state-star", "q"); - ACCEL("//state-gradient", "g"); - ACCEL("//state-polygon", "p"); - - ACCEL("//state-bline", "b"); - ACCEL("//state-text", "x"); - ACCEL("//state-fill", "f"); - ACCEL("//state-eyedrop", "e"); - ACCEL("//state-zoom", "z"); - - ACCEL("//state-draw", "d"); - ACCEL("//state-sketch", "k"); - ACCEL("//state-width", "w"); - - ACCEL("//canvas-zoom-fit","z"); + // the toolbox + ACCEL("a", "//state-normal" ); + ACCEL("v", "//state-smooth_move" ); + ACCEL("s", "//state-scale" ); + ACCEL("t", "//state-rotate" ); + ACCEL("m", "//state-mirror" ); + ACCEL("c", "//state-circle" ); + ACCEL("r", "//state-rectangle" ); + ACCEL("q", "//state-star" ); + ACCEL("g", "//state-gradient" ); + ACCEL("p", "//state-polygon" ); + ACCEL("b", "//state-bline" ); + ACCEL("x", "//state-text" ); + ACCEL("f", "//state-fill" ); + ACCEL("e", "//state-eyedrop" ); + ACCEL("z", "//state-zoom" ); + ACCEL("d", "//state-draw" ); + ACCEL("k", "//state-sketch" ); + ACCEL("w", "//state-width" ); + + // everything else + ACCEL("a", "//select-all-ducks" ); + ACCEL("d", "//unselect-all-ducks" ); + ACCEL("a", "//select-all-layers" ); + ACCEL("d", "//unselect-all-layers" ); + ACCEL("F9", "//render" ); + ACCEL("F11", "//preview" ); + ACCEL("F8", "//properties" ); + ACCEL("F12", "//options" ); + ACCEL("i", "//import" ); + ACCEL2(Gtk::AccelKey(GDK_Escape,static_cast(0), "//stop" )); + ACCEL("g", "//toggle-grid-show" ); + ACCEL("l", "//toggle-grid-snap" ); + ACCEL2(Gtk::AccelKey('`',Gdk::CONTROL_MASK, "//toggle-low-res" )); + ACCEL("1", "//mask-position-ducks" ); + ACCEL("2", "//mask-vertex-ducks" ); + ACCEL("3", "//mask-tangent-ducks" ); + ACCEL("4", "//mask-radius-ducks" ); + ACCEL("5", "//mask-width-ducks" ); + ACCEL("6", "//mask-angle-ducks" ); + ACCEL2(Gtk::AccelKey(GDK_Page_Up,Gdk::SHIFT_MASK, "//action-LayerRaise" )); + ACCEL2(Gtk::AccelKey(GDK_Page_Down,Gdk::SHIFT_MASK, "//action-LayerLower" )); + ACCEL("1", "//quality-01" ); + ACCEL("2", "//quality-02" ); + ACCEL("3", "//quality-03" ); + ACCEL("4", "//quality-04" ); + ACCEL("5", "//quality-05" ); + ACCEL("6", "//quality-06" ); + ACCEL("7", "//quality-07" ); + ACCEL("8", "//quality-08" ); + ACCEL("9", "//quality-09" ); + ACCEL("0", "//quality-10" ); + ACCEL("z", "//undo" ); + ACCEL("r", "//redo" ); + ACCEL("Delete", "//action-LayerRemove" ); + ACCEL2(Gtk::AccelKey('(',Gdk::CONTROL_MASK, "//decrease-low-res-pixel-size" )); + ACCEL2(Gtk::AccelKey(')',Gdk::CONTROL_MASK, "//increase-low-res-pixel-size" )); + ACCEL2(Gtk::AccelKey('(',Gdk::MOD1_MASK|Gdk::CONTROL_MASK, "//amount-dec" )); + ACCEL2(Gtk::AccelKey(')',Gdk::MOD1_MASK|Gdk::CONTROL_MASK, "//amount-inc" )); + ACCEL2(Gtk::AccelKey(']',Gdk::CONTROL_MASK, "//jump-next-keyframe" )); + ACCEL2(Gtk::AccelKey('[',Gdk::CONTROL_MASK, "//jump-prev-keyframe" )); + ACCEL2(Gtk::AccelKey('=',Gdk::CONTROL_MASK, "//canvas-zoom-in" )); + ACCEL2(Gtk::AccelKey('-',Gdk::CONTROL_MASK, "//canvas-zoom-out" )); + ACCEL2(Gtk::AccelKey('+',Gdk::CONTROL_MASK, "//time-zoom-in" )); + ACCEL2(Gtk::AccelKey('_',Gdk::CONTROL_MASK, "//time-zoom-out" )); + ACCEL2(Gtk::AccelKey('.',Gdk::CONTROL_MASK, "//seek-next-frame" )); + ACCEL2(Gtk::AccelKey(',',Gdk::CONTROL_MASK, "//seek-prev-frame" )); + ACCEL2(Gtk::AccelKey('>',Gdk::CONTROL_MASK, "//seek-next-second" )); + ACCEL2(Gtk::AccelKey('<',Gdk::CONTROL_MASK, "//seek-prev-second" )); + ACCEL2(Gtk::AccelKey('o',Gdk::MOD1_MASK, "//toggle-onion-skin" )); + ACCEL("z", "//canvas-zoom-fit" ); + ACCEL("p", "//play" ); + ACCEL("Home", "//seek-begin" ); + ACCEL("End", "//seek-end" ); #undef ACCEL } -- 2.7.4