From 35faf1afc5a4a015bfe70be49d528b8a3ea4b0d5 Mon Sep 17 00:00:00 2001 From: gballintijn Date: Fri, 19 Jun 2009 08:53:38 +0000 Subject: [PATCH] Added the necessary buttons to the canvas window to enable the user to go to the beginning, end, previous frame, and next frame. Before this was only possible using key bindings. Note: The patch does not add the previous or next *second* buttons. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2382 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/images/Makefile.am | 13 +- synfig-studio/trunk/images/seek_begin.sif | 339 +++++++++++++++++++++++ synfig-studio/trunk/images/seek_end.sif | 339 +++++++++++++++++++++++ synfig-studio/trunk/images/seek_next_frame.sif | 339 +++++++++++++++++++++++ synfig-studio/trunk/images/seek_prev_frame.sif | 339 +++++++++++++++++++++++ synfig-studio/trunk/src/gtkmm/Makefile.am | 6 +- synfig-studio/trunk/src/gtkmm/canvasview.cpp | 33 ++- synfig-studio/trunk/src/gtkmm/framedial.cpp | 80 ++++++ synfig-studio/trunk/src/gtkmm/framedial.h | 73 +++++ synfig-studio/trunk/src/gtkmm/iconcontroller.cpp | 5 + 10 files changed, 1554 insertions(+), 12 deletions(-) create mode 100644 synfig-studio/trunk/images/seek_begin.sif create mode 100644 synfig-studio/trunk/images/seek_end.sif create mode 100644 synfig-studio/trunk/images/seek_next_frame.sif create mode 100644 synfig-studio/trunk/images/seek_prev_frame.sif create mode 100644 synfig-studio/trunk/src/gtkmm/framedial.cpp create mode 100644 synfig-studio/trunk/src/gtkmm/framedial.h diff --git a/synfig-studio/trunk/images/Makefile.am b/synfig-studio/trunk/images/Makefile.am index d7a4ad9..5db7c38 100644 --- a/synfig-studio/trunk/images/Makefile.am +++ b/synfig-studio/trunk/images/Makefile.am @@ -70,7 +70,12 @@ EXTRA_DIST = \ polyline_icon.sif \ star_icon.sif \ set_fill_color.sif \ - set_outline_color.sif + set_outline_color.sif \ + seek_begin.sif \ + seek_end.sif \ + seek_next_frame.sif \ + seek_prev_frame.sif + IMAGES = \ @@ -138,7 +143,11 @@ IMAGES = \ polyline_icon.$(EXT) \ star_icon.$(EXT) \ set_fill_color.$(EXT) \ - set_outline_color.$(EXT) + set_outline_color.$(EXT) \ + seek_begin.$(EXT) \ + seek_end.$(EXT) \ + seek_next_frame.$(EXT) \ + seek_prev_frame.$(EXT) MAINTAINERCLEANFILES = \ diff --git a/synfig-studio/trunk/images/seek_begin.sif b/synfig-studio/trunk/images/seek_begin.sif new file mode 100644 index 0000000..8198a46 --- /dev/null +++ b/synfig-studio/trunk/images/seek_begin.sif @@ -0,0 +1,339 @@ + + + Jump to first frame + + + + + + + + + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + -0.1781170517 + 0.0458015278 + + + + + + + + + + + + + + + + + + + + + + 1.3129770756 + 1.6488549709 + + + + + -0.7430025339 + 0.0712468177 + + + + + 1.2824426889 + -1.6488549709 + + + + + + + + + + + + + + + + + + + + + 1.000000 + 1.000000 + 1.000000 + 1.000000 + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + -1.1806615591 + 1.7201018333 + + + + + -0.7124682069 + -1.6590330601 + + + + + + + + + + + + + + + + + + + + + + + + + 1.000000 + 1.000000 + 1.000000 + 1.000000 + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + diff --git a/synfig-studio/trunk/images/seek_end.sif b/synfig-studio/trunk/images/seek_end.sif new file mode 100644 index 0000000..c7aaec6 --- /dev/null +++ b/synfig-studio/trunk/images/seek_end.sif @@ -0,0 +1,339 @@ + + + Jump to last frame + + + + + + + + + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 1.1147744656 + 1.7167723179 + + + + + 0.6465811133 + -1.6623625755 + + + + + + + + + + + + + + + + + + + + + + + + + 1.000000 + 1.000000 + 1.000000 + 1.000000 + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + -0.1781170517 + 0.0458015278 + + + + + + + + + + + + + + + + + + + + + + -1.0226300955 + 1.6455254555 + + + + + 1.0333495140 + 0.0679172799 + + + + + -0.9920957088 + -1.6521844864 + + + + + + + + + + + + + + + + + + + + + 1.000000 + 1.000000 + 1.000000 + 1.000000 + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + diff --git a/synfig-studio/trunk/images/seek_next_frame.sif b/synfig-studio/trunk/images/seek_next_frame.sif new file mode 100644 index 0000000..9b79070 --- /dev/null +++ b/synfig-studio/trunk/images/seek_next_frame.sif @@ -0,0 +1,339 @@ + + + Jump to next frame + + + + + + + + + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + -0.9920424223 + 1.6923077106 + + + + + -1.4602357149 + -1.6868271828 + + + + + + + + + + + + + + + + + + + + + + + + + 1.000000 + 1.000000 + 1.000000 + 1.000000 + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + -0.1781170517 + 0.0458015278 + + + + + + + + + + + + + + + + + + + + + + -0.3623986542 + 1.6039716005 + + + + + 1.6935809851 + 0.0263634212 + + + + + -0.3318642676 + -1.6937383413 + + + + + + + + + + + + + + + + + + + + + 1.000000 + 1.000000 + 1.000000 + 1.000000 + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + diff --git a/synfig-studio/trunk/images/seek_prev_frame.sif b/synfig-studio/trunk/images/seek_prev_frame.sif new file mode 100644 index 0000000..adeeef0 --- /dev/null +++ b/synfig-studio/trunk/images/seek_prev_frame.sif @@ -0,0 +1,339 @@ + + + Jump to previous frame + + + + + + + + + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + -0.1781170517 + 0.0458015278 + + + + + + + + + + + + + + + + + + + + + + 0.7133283019 + 1.5936350822 + + + + + -1.3426512480 + 0.0160269383 + + + + + 0.6827939153 + -1.7040748596 + + + + + + + + + + + + + + + + + + + + + 1.000000 + 1.000000 + 1.000000 + 1.000000 + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0000000000 + 0.0000000000 + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.9893617034 + 1.6914893389 + + + + + 1.4575549364 + -1.6876455545 + + + + + + + + + + + + + + + + + + + + + + + + + 1.000000 + 1.000000 + 1.000000 + 1.000000 + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.000000 + 0.000000 + 0.000000 + 1.000000 + + + + + 0.1000000015 + -0.1000000015 + + + + + 0.1000000015 + 0.1000000015 + + + + + + + + + + + + + + + + + diff --git a/synfig-studio/trunk/src/gtkmm/Makefile.am b/synfig-studio/trunk/src/gtkmm/Makefile.am index 9c3ba34..4742357 100644 --- a/synfig-studio/trunk/src/gtkmm/Makefile.am +++ b/synfig-studio/trunk/src/gtkmm/Makefile.am @@ -292,7 +292,8 @@ OTHER_HH = \ toolbox.h \ valuelink.h \ workarea.h \ - zoomdial.h + zoomdial.h \ + framedial.h OTHER_CC = \ main.cpp \ @@ -322,7 +323,8 @@ OTHER_CC = \ toolbox.cpp \ valuelink.cpp \ workarea.cpp \ - zoomdial.cpp + zoomdial.cpp \ + framedial.cpp INCLUDES = \ diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index 3154ae4..72a3ed6 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -99,6 +99,7 @@ #include "preview.h" #include "audiocontainer.h" #include "widget_timeslider.h" +#include "framedial.h" #include #include @@ -941,8 +942,6 @@ CanvasView::create_time_bar() keyframebutton->signal_clicked().connect(sigc::mem_fun(*this, &studio::CanvasView::on_keyframe_button_pressed)); keyframebutton->show(); - Gtk::Table *table= manage(new class Gtk::Table(2, 3, false)); - //setup the audio display disp_audio->set_size_request(-1,32); //disp_audio->show(); disp_audio->set_time_adjustment(&time_adjustment()); @@ -956,14 +955,32 @@ CanvasView::create_time_bar() sigc::mem_fun(*audio,&AudioContainer::stop_scrubbing) ); - table->attach(*manage(disp_audio), 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); - table->attach(*timeslider, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK, 0, 0); - table->attach(*time_window_scroll, 0, 1, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK, 0, 0); + FrameDial *framedial = manage(new class FrameDial()); + framedial->signal_seek_begin().connect( + sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time), Time::begin()) + ); + framedial->signal_seek_prev_frame().connect( + sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_frame), -1) + ); + framedial->signal_seek_next_frame().connect( + sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_frame), 1) + ); + framedial->signal_seek_end().connect( + sigc::bind(sigc::mem_fun(*canvas_interface().get(), &synfigapp::CanvasInterface::seek_time), Time::end()) + ); + framedial->show(); + + Gtk::Table *table = manage(new class Gtk::Table(4, 3, false)); + timebar = table; - table->attach(*animatebutton, 1, 2, 0, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - table->attach(*keyframebutton, 2, 3, 0, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - timebar=table; + table->attach(*manage(disp_audio), 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + table->attach(*framedial, 0, 1, 1, 2,Gtk::SHRINK, Gtk::SHRINK); + table->attach(*timeslider, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + table->attach(*time_window_scroll, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK); + table->attach(*animatebutton, 2, 3, 0, 3, Gtk::SHRINK, Gtk::SHRINK); + table->attach(*keyframebutton, 3, 4, 0, 3, Gtk::SHRINK, Gtk::SHRINK); table->show(); + return table; } diff --git a/synfig-studio/trunk/src/gtkmm/framedial.cpp b/synfig-studio/trunk/src/gtkmm/framedial.cpp new file mode 100644 index 0000000..a88af27 --- /dev/null +++ b/synfig-studio/trunk/src/gtkmm/framedial.cpp @@ -0,0 +1,80 @@ +/* === S Y N F I G ========================================================= */ +/*! \file framedial.cpp +** \brief Template File +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2009 Gerco Ballintijn +** +** This package 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 package 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. +** \endlegal +*/ +/* ========================================================================= */ + +/* === H E A D E R S ======================================================= */ + +#ifdef USING_PCH +# include "pch.h" +#else +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "framedial.h" +#include + +#endif + +/* === U S I N G =========================================================== */ + +using namespace std; +using namespace studio; + +/* === M A C R O S ========================================================= */ + +/* === G L O B A L S ======================================================= */ + +/* === P R O C E D U R E S ================================================= */ + +/* === M E T H O D S ======================================================= */ + +FrameDial::FrameDial(): Gtk::Table(3, 1, false) +{ + Gtk::IconSize iconsize = Gtk::IconSize::from_name("synfig-small_icon"); + + seek_begin = create_icon(iconsize, "synfig-seek_begin", _("Seek to Begin")); + seek_prev_frame = create_icon(iconsize, "synfig-seek_prev_frame", _("Previous Frame")); + seek_next_frame = create_icon(iconsize, "synfig-seek_next_frame", _("Next Frame")); + seek_end = create_icon(iconsize, "synfig-seek_end", _("Seek to End")); + + attach(*seek_begin, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*seek_prev_frame, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*seek_next_frame, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*seek_end, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); +} + +Gtk::Button * +FrameDial::create_icon(Gtk::IconSize iconsize, const char * stockid, + const char * tooltip) +{ + Gtk::Button *button = manage(new class Gtk::Button()); + Gtk::Image *icon = manage(new Gtk::Image(Gtk::StockID(stockid), iconsize)); + button->add(*icon); + tooltips.set_tip(*button, tooltip); + icon->set_padding(0, 0); + icon->show(); + button->set_relief(Gtk::RELIEF_NONE); + button->show(); + + return button; +} diff --git a/synfig-studio/trunk/src/gtkmm/framedial.h b/synfig-studio/trunk/src/gtkmm/framedial.h new file mode 100644 index 0000000..58136b7 --- /dev/null +++ b/synfig-studio/trunk/src/gtkmm/framedial.h @@ -0,0 +1,73 @@ +/* === S Y N F I G ========================================================= */ +/*! \file zoomdial.h +** \brief Template Header +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore +** Copyright (c) 2009 Gerco Ballintijn +** +** This package 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 package 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. +** \endlegal +*/ +/* ========================================================================= */ + +/* === S T A R T =========================================================== */ + +#ifndef __SYNFIG_STUDIO_FRAMEDIAL_H +#define __SYNFIG_STUDIO_FRAMEDIAL_H + +/* === H E A D E R S ======================================================= */ + +#include +#include +#include + +#include "general.h" + +/* === M A C R O S ========================================================= */ + +/* === T Y P E D E F S ===================================================== */ + +/* === C L A S S E S & S T R U C T S ======================================= */ + +namespace studio +{ + +class FrameDial : public Gtk::Table +{ + Gtk::Tooltips tooltips; + + Gtk::Button *seek_begin; + Gtk::Button *seek_prev_frame; + Gtk::Button *seek_next_frame; + Gtk::Button *seek_end; + + Gtk::Button *create_icon(Gtk::IconSize iconsize, const char * stockid, const char * tooltip); + +public: + FrameDial(); + + Glib::SignalProxy0 signal_seek_begin() { return seek_begin->signal_clicked(); } + Glib::SignalProxy0 signal_seek_prev_frame() { return seek_prev_frame->signal_clicked(); } + Glib::SignalProxy0 signal_seek_next_frame() { return seek_next_frame->signal_clicked(); } + Glib::SignalProxy0 signal_seek_end() { return seek_end->signal_clicked(); } + +}; // END of class FrameDial + +}; // END of namespace studio + + +/* === E N D =============================================================== */ + +#endif diff --git a/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp b/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp index 7cbf27b..32d3001 100644 --- a/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp +++ b/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp @@ -188,6 +188,11 @@ IconController::IconController(const synfig::String& /*basepath*/) INIT_STOCK_ICON(set_outline_color,"set_outline_color."IMAGE_EXT,_("Set as Outline")); INIT_STOCK_ICON(set_fill_color,"set_fill_color."IMAGE_EXT,_("Set as Fill")); + INIT_STOCK_ICON(seek_begin,"seek_begin."IMAGE_EXT,_("Seek to Begin")); + INIT_STOCK_ICON(seek_prev_frame,"seek_prev_frame."IMAGE_EXT,_("Previous Frame")); + INIT_STOCK_ICON(seek_next_frame,"seek_next_frame."IMAGE_EXT,_("Next Frame")); + INIT_STOCK_ICON(seek_end,"seek_end."IMAGE_EXT,_("Seek to End")); + INIT_STOCK_ICON_CLONE(cvs_add,"gtk-add",_("CVS Add")); INIT_STOCK_ICON_CLONE(cvs_update,"gtk-open",_("CVS Update")); INIT_STOCK_ICON_CLONE(cvs_commit,"gtk-save",_("CVS Commit")); -- 2.7.4