From: Nikita Kitaev Date: Sat, 17 Apr 2010 06:24:33 +0000 (-0700) Subject: Move dials into subfolder X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=sidebyside;h=4f928cb3ae1c21f910274047ae28ad0714064daa;p=synfig.git Move dials into subfolder --- diff --git a/synfig-studio/src/gui/Makefile.am b/synfig-studio/src/gui/Makefile.am index c6ba46d..85e3570 100644 --- a/synfig-studio/src/gui/Makefile.am +++ b/synfig-studio/src/gui/Makefile.am @@ -289,11 +289,11 @@ OTHER_HH = \ toolbox.h \ valuelink.h \ workarea.h \ - zoomdial.h \ - framedial.h \ - keyframedial.h \ - toggleducksdial.h \ - resolutiondial.h + dials/zoomdial.h \ + dials/framedial.h \ + dials/keyframedial.h \ + dials/toggleducksdial.h \ + dials/resolutiondial.h OTHER_CC = \ main.cpp \ @@ -323,11 +323,11 @@ OTHER_CC = \ toolbox.cpp \ valuelink.cpp \ workarea.cpp \ - zoomdial.cpp \ - framedial.cpp \ - keyframedial.cpp \ - toggleducksdial.cpp \ - resolutiondial.cpp + dials/zoomdial.cpp \ + dials/framedial.cpp \ + dials/keyframedial.cpp \ + dials/toggleducksdial.cpp \ + dials/resolutiondial.cpp INCLUDES = \ -I$(top_srcdir)/src diff --git a/synfig-studio/src/gui/canvasview.cpp b/synfig-studio/src/gui/canvasview.cpp index 8fdd889..2485b7b 100644 --- a/synfig-studio/src/gui/canvasview.cpp +++ b/synfig-studio/src/gui/canvasview.cpp @@ -103,7 +103,7 @@ #include "preview.h" #include "audiocontainer.h" #include "widgets/widget_timeslider.h" -#include "keyframedial.h" +#include "dials/keyframedial.h" #include #include diff --git a/synfig-studio/src/gui/canvasview.h b/synfig-studio/src/gui/canvasview.h index 21a7f1d..3e0a47f 100644 --- a/synfig-studio/src/gui/canvasview.h +++ b/synfig-studio/src/gui/canvasview.h @@ -67,9 +67,9 @@ #include "dialogs/dialog_waypoint.h" #include "dialogs/dialog_keyframe.h" -#include "framedial.h" -#include "toggleducksdial.h" -#include "resolutiondial.h" +#include "dials/framedial.h" +#include "dials/toggleducksdial.h" +#include "dials/resolutiondial.h" #include "widgets/widget_keyframe_list.h" #include "duckmatic.h" diff --git a/synfig-studio/src/gui/dials/framedial.cpp b/synfig-studio/src/gui/dials/framedial.cpp new file mode 100644 index 0000000..6437930 --- /dev/null +++ b/synfig-studio/src/gui/dials/framedial.cpp @@ -0,0 +1,91 @@ +/* === 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) 2008 Chris Moore +** Copyright (c) 2009 Gerco Ballintijn +** Copyright (c) 2009 Carlos López +** +** 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 +#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(5, 1, false) +{ + Gtk::IconSize iconsize = Gtk::IconSize::from_name("synfig-small_icon"); + + seek_begin = create_icon(iconsize, Gtk::Stock::MEDIA_PREVIOUS, + _("Seek to Begin")); + seek_prev_frame = create_icon(iconsize, Gtk::Stock::MEDIA_REWIND, + _("Previous Frame")); + play_stop = create_icon(iconsize, Gtk::Stock::MEDIA_PLAY, + _("Play")); + seek_next_frame = create_icon(iconsize, Gtk::Stock::MEDIA_FORWARD, + _("Next Frame")); + seek_end = create_icon(iconsize, Gtk::Stock::MEDIA_NEXT, + _("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(*play_stop, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*seek_next_frame, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*seek_end, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); +} + +Gtk::Button * +FrameDial::create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & stockid, + const char * tooltip) +{ + Gtk::Button *button = manage(new class Gtk::Button()); + Gtk::Image *icon = manage(new Gtk::Image(stockid, size)); + 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/src/gui/dials/framedial.h b/synfig-studio/src/gui/dials/framedial.h new file mode 100644 index 0000000..4fc51ca --- /dev/null +++ b/synfig-studio/src/gui/dials/framedial.h @@ -0,0 +1,79 @@ +/* === 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 +** Copyright (c) 2009 Carlos López +** +** 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 *play_stop; + Gtk::Button *seek_next_frame; + Gtk::Button *seek_end; + + Gtk::Button *create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & 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_play_stop() { return play_stop->signal_clicked(); } + Glib::SignalProxy0 signal_seek_next_frame() { return seek_next_frame->signal_clicked(); } + Glib::SignalProxy0 signal_seek_end() { return seek_end->signal_clicked(); } + + Gtk::Button *get_play_button() { return play_stop; } + +}; // END of class FrameDial + +}; // END of namespace studio + + +/* === E N D =============================================================== */ + +#endif diff --git a/synfig-studio/src/gui/dials/keyframedial.cpp b/synfig-studio/src/gui/dials/keyframedial.cpp new file mode 100644 index 0000000..c7b5c56 --- /dev/null +++ b/synfig-studio/src/gui/dials/keyframedial.cpp @@ -0,0 +1,96 @@ +/* === S Y N F I G ========================================================= */ +/*! \file keyframedial.cpp +** \brief Template File +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2009 Gerco Ballintijn +** Copyright (c) 2009 Carlos Lopez +** +** 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 "keyframedial.h" +#include +#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 ======================================================= */ + +KeyFrameDial::KeyFrameDial(): Gtk::Table(1, 3, false) +{ + Gtk::IconSize iconsize = Gtk::IconSize::from_name("synfig-small_icon"); + + seek_prev_keyframe = create_icon(iconsize, Gtk::Stock::GO_BACK, _("Previous KeyFrame")); + seek_next_keyframe = create_icon(iconsize, Gtk::Stock::GO_FORWARD, _("Next KeyFrame")); + lock_keyframe = create_icon(Gtk::ICON_SIZE_BUTTON, "synfig-keyframe_lock_all",_("All Keyframes Locked")); + + attach(*seek_prev_keyframe, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*seek_next_keyframe, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*lock_keyframe, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); +} + +Gtk::Button * +KeyFrameDial::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; +} + +Gtk::Button * +KeyFrameDial::create_icon(Gtk::IconSize iconsize, const Gtk::BuiltinStockID & stockid, + const char * tooltip) +{ + Gtk::Button *button = manage(new class Gtk::Button()); + Gtk::Image *icon = manage(new Gtk::Image(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/src/gui/dials/keyframedial.h b/synfig-studio/src/gui/dials/keyframedial.h new file mode 100644 index 0000000..a6491c9 --- /dev/null +++ b/synfig-studio/src/gui/dials/keyframedial.h @@ -0,0 +1,74 @@ +/* === S Y N F I G ========================================================= */ +/*! \file keyframedial.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 +** Copyright (c) 2009 Carlos Lopez +** +** 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_KEYFRAMEDIAL_H +#define __SYNFIG_STUDIO_KEYFRAMEDIAL_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 KeyFrameDial : public Gtk::Table +{ + Gtk::Tooltips tooltips; + + Gtk::Button *seek_prev_keyframe; + Gtk::Button *seek_next_keyframe; + Gtk::Button *lock_keyframe; + + Gtk::Button *create_icon(Gtk::IconSize iconsize, const char * stockid, const char * tooltip); + Gtk::Button *create_icon(Gtk::IconSize iconsize, const Gtk::BuiltinStockID & stockid, const char * tooltip); + +public: + + KeyFrameDial(); + Glib::SignalProxy0 signal_seek_prev_keyframe() { return seek_prev_keyframe->signal_clicked(); } + Glib::SignalProxy0 signal_seek_next_keyframe() { return seek_next_keyframe->signal_clicked(); } + Glib::SignalProxy0 signal_lock_keyframe() { return lock_keyframe->signal_clicked(); } + Gtk::Button *get_lock_button() { return lock_keyframe; } + +}; // END of class KeyFrameDial + +}; // END of namespace studio + + +/* === E N D =============================================================== */ + +#endif diff --git a/synfig-studio/src/gui/dials/resolutiondial.cpp b/synfig-studio/src/gui/dials/resolutiondial.cpp new file mode 100644 index 0000000..b7ef2c9 --- /dev/null +++ b/synfig-studio/src/gui/dials/resolutiondial.cpp @@ -0,0 +1,96 @@ +/* === S Y N F I G ========================================================= */ +/*! \file resolutiondial.cpp +** \brief Template File +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2009 Gerco Ballintijn +** Copyright (c) 2009 Carlos Lopez +** +** 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 "resolutiondial.h" +#include +#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 ======================================================= */ + +ResolutionDial::ResolutionDial(Gtk::IconSize & size): Gtk::Table(3, 1, false) +{ + + increase_resolution = create_icon(size, Gtk::StockID("synfig-increase_resolution"), _("Increase Display Resolution")); + decrease_resolution = create_icon(size, Gtk::StockID("synfig-decrease_resolution"), _("Decrease Display Resolution")); + use_low_resolution = create_check(_("Low Res"), _("Use Low Resolution when enabled")); + + attach(*decrease_resolution, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*use_low_resolution, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*increase_resolution, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); +} + +Gtk::Button * +ResolutionDial::create_icon(Gtk::IconSize size, const Gtk::StockID & stockid, + const char * tooltip) +{ + Gtk::Button *button = manage(new class Gtk::Button()); + Gtk::Image *icon = manage(new Gtk::Image(stockid, size)); + 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; +} + +Gtk::CheckButton * +ResolutionDial::create_check(const char *label, const char * tooltip) +{ + Gtk::CheckButton *cbutton = manage(new class Gtk::CheckButton()); + cbutton->set_label(label); + tooltips.set_tip(*cbutton, tooltip); + cbutton->show(); + + return cbutton; +} + +void +ResolutionDial::update_lowres(bool flag) +{ + use_low_resolution->set_active(flag); +} diff --git a/synfig-studio/src/gui/dials/resolutiondial.h b/synfig-studio/src/gui/dials/resolutiondial.h new file mode 100644 index 0000000..611eb11 --- /dev/null +++ b/synfig-studio/src/gui/dials/resolutiondial.h @@ -0,0 +1,77 @@ +/* === S Y N F I G ========================================================= */ +/*! \file resolutiondial.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 +** Copyright (c) 2009 Carlos Lopez +** +** 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_RESOLUTIONDIAL_H +#define __SYNFIG_STUDIO_RESOLUTIONDIAL_H + +/* === H E A D E R S ======================================================= */ + +#include +#include +#include +#include "duckmatic.h" + +#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 ResolutionDial : public Gtk::Table +{ + Gtk::Tooltips tooltips; + + Gtk::Button *increase_resolution; + Gtk::Button *decrease_resolution; + Gtk::CheckButton *use_low_resolution; + + Gtk::Button *create_icon(Gtk::IconSize size, const Gtk::StockID & stockid, const char * tooltip); + Gtk::CheckButton *create_check(const char *text, const char *tooltip); + +public: + + ResolutionDial(Gtk::IconSize & size); + + void update_lowres(bool flag); + Glib::SignalProxy0 signal_increase_resolution() { return increase_resolution->signal_clicked(); } + Glib::SignalProxy0 signal_decrease_resolution() { return decrease_resolution->signal_clicked(); } + Glib::SignalProxy0 signal_use_low_resolution() { return use_low_resolution-> signal_toggled(); } + +}; // END of class ResolutionDial + +}; // END of namespace studio + + +/* === E N D =============================================================== */ + +#endif diff --git a/synfig-studio/src/gui/dials/toggleducksdial.cpp b/synfig-studio/src/gui/dials/toggleducksdial.cpp new file mode 100644 index 0000000..00ea236 --- /dev/null +++ b/synfig-studio/src/gui/dials/toggleducksdial.cpp @@ -0,0 +1,95 @@ +/* === S Y N F I G ========================================================= */ +/*! \file toggleducksdial.cpp +** \brief Template File +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2009 Gerco Ballintijn +** Copyright (c) 2009 Carlos Lopez +** +** 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 "toggleducksdial.h" +#include +#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 ======================================================= */ + +ToggleDucksDial::ToggleDucksDial(Gtk::IconSize & size): Gtk::Table(1, 6, false) +{ + ducks_position = create_label_button(size, "synfig-toggle_duck_position", _("Toggle position ducks")); + ducks_vertex = create_label_button(size, "synfig-toggle_duck_vertex", _("Toggle vertex ducks")); + ducks_tangent = create_label_button(size, "synfig-toggle_duck_tangent", _("Toggle tangent ducks")); + ducks_radius = create_label_button(size, "synfig-toggle_duck_radius", _("Toggle radius ducks")); + ducks_width = create_label_button(size, "synfig-toggle_duck_width", _("Toggle width ducks")); + ducks_angle = create_label_button(size, "synfig-toggle_duck_angle", _("Toggle angle ducks")); + + attach(*ducks_position, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*ducks_vertex, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*ducks_tangent, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*ducks_radius, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*ducks_width, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*ducks_angle, 5, 6, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); +} + +Gtk::ToggleButton * +ToggleDucksDial::create_label_button(Gtk::IconSize iconsize, const char *stockid, + const char * tooltip) +{ + Gtk::ToggleButton *tbutton = manage(new class Gtk::ToggleButton()); + Gtk::Image *icon = manage(new Gtk::Image(Gtk::StockID(stockid), iconsize)); + tooltips.set_tip(*tbutton, tooltip); + tbutton->add(*icon); + icon->set_padding(0, 0); + icon->show(); + tbutton->set_relief(Gtk::RELIEF_NONE); + tbutton->show(); + + return tbutton; +} + +void +ToggleDucksDial::update_toggles(Duck::Type mask) +{ + ducks_position-> set_active((mask & Duck::TYPE_POSITION)); + ducks_vertex -> set_active((mask & Duck::TYPE_VERTEX)); + ducks_tangent -> set_active((mask & Duck::TYPE_TANGENT)); + ducks_radius -> set_active((mask & Duck::TYPE_RADIUS)); + ducks_width -> set_active((mask & Duck::TYPE_WIDTH)); + ducks_angle -> set_active((mask & Duck::TYPE_ANGLE)); +} diff --git a/synfig-studio/src/gui/dials/toggleducksdial.h b/synfig-studio/src/gui/dials/toggleducksdial.h new file mode 100644 index 0000000..832e212 --- /dev/null +++ b/synfig-studio/src/gui/dials/toggleducksdial.h @@ -0,0 +1,81 @@ +/* === S Y N F I G ========================================================= */ +/*! \file toggleducksdial.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 +** Copyright (c) 2009 Carlos Lopez +** +** 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_TOOGLEDUCKSDIAL_H +#define __SYNFIG_STUDIO_TOOGLEDUCKSDIAL_H + +/* === H E A D E R S ======================================================= */ + +#include +#include +#include +#include "duckmatic.h" + +#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 ToggleDucksDial : public Gtk::Table +{ + Gtk::Tooltips tooltips; + + Gtk::ToggleButton *ducks_position; + Gtk::ToggleButton *ducks_vertex; + Gtk::ToggleButton *ducks_tangent; + Gtk::ToggleButton *ducks_radius; + Gtk::ToggleButton *ducks_width; + Gtk::ToggleButton *ducks_angle; + + Gtk::ToggleButton *create_label_button(Gtk::IconSize iconsize, const char * stockid, const char * tooltip); + +public: + + ToggleDucksDial(Gtk::IconSize & size); + void update_toggles(Duck::Type mask); + Glib::SignalProxy0 signal_ducks_position() { return ducks_position->signal_toggled(); } + Glib::SignalProxy0 signal_ducks_vertex() { return ducks_vertex-> signal_toggled(); } + Glib::SignalProxy0 signal_ducks_tangent() { return ducks_tangent-> signal_toggled(); } + Glib::SignalProxy0 signal_ducks_radius() { return ducks_radius-> signal_toggled(); } + Glib::SignalProxy0 signal_ducks_width() { return ducks_width-> signal_toggled(); } + Glib::SignalProxy0 signal_ducks_angle() { return ducks_angle-> signal_toggled(); } + +}; // END of class ToggleDucksDial + +}; // END of namespace studio + + +/* === E N D =============================================================== */ + +#endif diff --git a/synfig-studio/src/gui/dials/zoomdial.cpp b/synfig-studio/src/gui/dials/zoomdial.cpp new file mode 100644 index 0000000..ae2f4a4 --- /dev/null +++ b/synfig-studio/src/gui/dials/zoomdial.cpp @@ -0,0 +1,81 @@ +/* === S Y N F I G ========================================================= */ +/*! \file zoomdial.cpp +** \brief Template File +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** +** 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 "zoomdial.h" +#include +#include + +#include "general.h" + +#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 ======================================================= */ + +ZoomDial::ZoomDial(Gtk::IconSize & size): Table(3, 1, false) +{ + zoom_in = create_icon(size, Gtk::Stock::ZOOM_IN, _("Zoom In")); + zoom_out = create_icon(size, Gtk::Stock::ZOOM_OUT, _("Zoom Out")); + zoom_fit = create_icon(size, Gtk::Stock::ZOOM_FIT, _("Zoom to Fit")); + zoom_norm = create_icon(size, Gtk::Stock::ZOOM_100, _("Zoom to 100%")); + + attach(*zoom_out, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*zoom_norm, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*zoom_fit, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + attach(*zoom_in, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); +} + +Gtk::Button * +ZoomDial::create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & stockid, + const char * tooltip) +{ + Gtk::Button *button = manage(new class Gtk::Button()); + Gtk::Image *icon = manage(new Gtk::Image(stockid, size)); + 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/src/gui/dials/zoomdial.h b/synfig-studio/src/gui/dials/zoomdial.h new file mode 100644 index 0000000..1d9d63a --- /dev/null +++ b/synfig-studio/src/gui/dials/zoomdial.h @@ -0,0 +1,70 @@ +/* === 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 +** +** 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_ZOOMDIAL_H +#define __SYNFIG_STUDIO_ZOOMDIAL_H + +/* === H E A D E R S ======================================================= */ + +#include +#include +#include + +/* === 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 ZoomDial : public Gtk::Table +{ + Gtk::Tooltips tooltips; + + Gtk::Button *zoom_in; + Gtk::Button *zoom_out; + Gtk::Button *zoom_fit; + Gtk::Button *zoom_norm; + + Gtk::Button *create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & stockid, + const char * tooltip); + +public: + ZoomDial(Gtk::IconSize &size); + + Glib::SignalProxy0 signal_zoom_in() { return zoom_in->signal_clicked(); } + Glib::SignalProxy0 signal_zoom_out() { return zoom_out->signal_clicked(); } + Glib::SignalProxy0 signal_zoom_fit() { return zoom_fit->signal_clicked(); } + Glib::SignalProxy0 signal_zoom_norm() { return zoom_norm->signal_clicked(); } + +}; // END of class ZoomDial + +}; // END of namespace studio + +/* === E N D =============================================================== */ + +#endif diff --git a/synfig-studio/src/gui/framedial.cpp b/synfig-studio/src/gui/framedial.cpp deleted file mode 100644 index 6437930..0000000 --- a/synfig-studio/src/gui/framedial.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* === 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) 2008 Chris Moore -** Copyright (c) 2009 Gerco Ballintijn -** Copyright (c) 2009 Carlos López -** -** 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 -#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(5, 1, false) -{ - Gtk::IconSize iconsize = Gtk::IconSize::from_name("synfig-small_icon"); - - seek_begin = create_icon(iconsize, Gtk::Stock::MEDIA_PREVIOUS, - _("Seek to Begin")); - seek_prev_frame = create_icon(iconsize, Gtk::Stock::MEDIA_REWIND, - _("Previous Frame")); - play_stop = create_icon(iconsize, Gtk::Stock::MEDIA_PLAY, - _("Play")); - seek_next_frame = create_icon(iconsize, Gtk::Stock::MEDIA_FORWARD, - _("Next Frame")); - seek_end = create_icon(iconsize, Gtk::Stock::MEDIA_NEXT, - _("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(*play_stop, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*seek_next_frame, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*seek_end, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); -} - -Gtk::Button * -FrameDial::create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & stockid, - const char * tooltip) -{ - Gtk::Button *button = manage(new class Gtk::Button()); - Gtk::Image *icon = manage(new Gtk::Image(stockid, size)); - 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/src/gui/framedial.h b/synfig-studio/src/gui/framedial.h deleted file mode 100644 index 4fc51ca..0000000 --- a/synfig-studio/src/gui/framedial.h +++ /dev/null @@ -1,79 +0,0 @@ -/* === 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 -** Copyright (c) 2009 Carlos López -** -** 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 *play_stop; - Gtk::Button *seek_next_frame; - Gtk::Button *seek_end; - - Gtk::Button *create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & 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_play_stop() { return play_stop->signal_clicked(); } - Glib::SignalProxy0 signal_seek_next_frame() { return seek_next_frame->signal_clicked(); } - Glib::SignalProxy0 signal_seek_end() { return seek_end->signal_clicked(); } - - Gtk::Button *get_play_button() { return play_stop; } - -}; // END of class FrameDial - -}; // END of namespace studio - - -/* === E N D =============================================================== */ - -#endif diff --git a/synfig-studio/src/gui/keyframedial.cpp b/synfig-studio/src/gui/keyframedial.cpp deleted file mode 100644 index c7b5c56..0000000 --- a/synfig-studio/src/gui/keyframedial.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file keyframedial.cpp -** \brief Template File -** -** $Id$ -** -** \legal -** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2009 Gerco Ballintijn -** Copyright (c) 2009 Carlos Lopez -** -** 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 "keyframedial.h" -#include -#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 ======================================================= */ - -KeyFrameDial::KeyFrameDial(): Gtk::Table(1, 3, false) -{ - Gtk::IconSize iconsize = Gtk::IconSize::from_name("synfig-small_icon"); - - seek_prev_keyframe = create_icon(iconsize, Gtk::Stock::GO_BACK, _("Previous KeyFrame")); - seek_next_keyframe = create_icon(iconsize, Gtk::Stock::GO_FORWARD, _("Next KeyFrame")); - lock_keyframe = create_icon(Gtk::ICON_SIZE_BUTTON, "synfig-keyframe_lock_all",_("All Keyframes Locked")); - - attach(*seek_prev_keyframe, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*seek_next_keyframe, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*lock_keyframe, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); -} - -Gtk::Button * -KeyFrameDial::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; -} - -Gtk::Button * -KeyFrameDial::create_icon(Gtk::IconSize iconsize, const Gtk::BuiltinStockID & stockid, - const char * tooltip) -{ - Gtk::Button *button = manage(new class Gtk::Button()); - Gtk::Image *icon = manage(new Gtk::Image(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/src/gui/keyframedial.h b/synfig-studio/src/gui/keyframedial.h deleted file mode 100644 index a6491c9..0000000 --- a/synfig-studio/src/gui/keyframedial.h +++ /dev/null @@ -1,74 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file keyframedial.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 -** Copyright (c) 2009 Carlos Lopez -** -** 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_KEYFRAMEDIAL_H -#define __SYNFIG_STUDIO_KEYFRAMEDIAL_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 KeyFrameDial : public Gtk::Table -{ - Gtk::Tooltips tooltips; - - Gtk::Button *seek_prev_keyframe; - Gtk::Button *seek_next_keyframe; - Gtk::Button *lock_keyframe; - - Gtk::Button *create_icon(Gtk::IconSize iconsize, const char * stockid, const char * tooltip); - Gtk::Button *create_icon(Gtk::IconSize iconsize, const Gtk::BuiltinStockID & stockid, const char * tooltip); - -public: - - KeyFrameDial(); - Glib::SignalProxy0 signal_seek_prev_keyframe() { return seek_prev_keyframe->signal_clicked(); } - Glib::SignalProxy0 signal_seek_next_keyframe() { return seek_next_keyframe->signal_clicked(); } - Glib::SignalProxy0 signal_lock_keyframe() { return lock_keyframe->signal_clicked(); } - Gtk::Button *get_lock_button() { return lock_keyframe; } - -}; // END of class KeyFrameDial - -}; // END of namespace studio - - -/* === E N D =============================================================== */ - -#endif diff --git a/synfig-studio/src/gui/resolutiondial.cpp b/synfig-studio/src/gui/resolutiondial.cpp deleted file mode 100644 index b7ef2c9..0000000 --- a/synfig-studio/src/gui/resolutiondial.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file resolutiondial.cpp -** \brief Template File -** -** $Id$ -** -** \legal -** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2009 Gerco Ballintijn -** Copyright (c) 2009 Carlos Lopez -** -** 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 "resolutiondial.h" -#include -#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 ======================================================= */ - -ResolutionDial::ResolutionDial(Gtk::IconSize & size): Gtk::Table(3, 1, false) -{ - - increase_resolution = create_icon(size, Gtk::StockID("synfig-increase_resolution"), _("Increase Display Resolution")); - decrease_resolution = create_icon(size, Gtk::StockID("synfig-decrease_resolution"), _("Decrease Display Resolution")); - use_low_resolution = create_check(_("Low Res"), _("Use Low Resolution when enabled")); - - attach(*decrease_resolution, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*use_low_resolution, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*increase_resolution, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); -} - -Gtk::Button * -ResolutionDial::create_icon(Gtk::IconSize size, const Gtk::StockID & stockid, - const char * tooltip) -{ - Gtk::Button *button = manage(new class Gtk::Button()); - Gtk::Image *icon = manage(new Gtk::Image(stockid, size)); - 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; -} - -Gtk::CheckButton * -ResolutionDial::create_check(const char *label, const char * tooltip) -{ - Gtk::CheckButton *cbutton = manage(new class Gtk::CheckButton()); - cbutton->set_label(label); - tooltips.set_tip(*cbutton, tooltip); - cbutton->show(); - - return cbutton; -} - -void -ResolutionDial::update_lowres(bool flag) -{ - use_low_resolution->set_active(flag); -} diff --git a/synfig-studio/src/gui/resolutiondial.h b/synfig-studio/src/gui/resolutiondial.h deleted file mode 100644 index 611eb11..0000000 --- a/synfig-studio/src/gui/resolutiondial.h +++ /dev/null @@ -1,77 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file resolutiondial.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 -** Copyright (c) 2009 Carlos Lopez -** -** 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_RESOLUTIONDIAL_H -#define __SYNFIG_STUDIO_RESOLUTIONDIAL_H - -/* === H E A D E R S ======================================================= */ - -#include -#include -#include -#include "duckmatic.h" - -#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 ResolutionDial : public Gtk::Table -{ - Gtk::Tooltips tooltips; - - Gtk::Button *increase_resolution; - Gtk::Button *decrease_resolution; - Gtk::CheckButton *use_low_resolution; - - Gtk::Button *create_icon(Gtk::IconSize size, const Gtk::StockID & stockid, const char * tooltip); - Gtk::CheckButton *create_check(const char *text, const char *tooltip); - -public: - - ResolutionDial(Gtk::IconSize & size); - - void update_lowres(bool flag); - Glib::SignalProxy0 signal_increase_resolution() { return increase_resolution->signal_clicked(); } - Glib::SignalProxy0 signal_decrease_resolution() { return decrease_resolution->signal_clicked(); } - Glib::SignalProxy0 signal_use_low_resolution() { return use_low_resolution-> signal_toggled(); } - -}; // END of class ResolutionDial - -}; // END of namespace studio - - -/* === E N D =============================================================== */ - -#endif diff --git a/synfig-studio/src/gui/toggleducksdial.cpp b/synfig-studio/src/gui/toggleducksdial.cpp deleted file mode 100644 index 00ea236..0000000 --- a/synfig-studio/src/gui/toggleducksdial.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file toggleducksdial.cpp -** \brief Template File -** -** $Id$ -** -** \legal -** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2009 Gerco Ballintijn -** Copyright (c) 2009 Carlos Lopez -** -** 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 "toggleducksdial.h" -#include -#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 ======================================================= */ - -ToggleDucksDial::ToggleDucksDial(Gtk::IconSize & size): Gtk::Table(1, 6, false) -{ - ducks_position = create_label_button(size, "synfig-toggle_duck_position", _("Toggle position ducks")); - ducks_vertex = create_label_button(size, "synfig-toggle_duck_vertex", _("Toggle vertex ducks")); - ducks_tangent = create_label_button(size, "synfig-toggle_duck_tangent", _("Toggle tangent ducks")); - ducks_radius = create_label_button(size, "synfig-toggle_duck_radius", _("Toggle radius ducks")); - ducks_width = create_label_button(size, "synfig-toggle_duck_width", _("Toggle width ducks")); - ducks_angle = create_label_button(size, "synfig-toggle_duck_angle", _("Toggle angle ducks")); - - attach(*ducks_position, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*ducks_vertex, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*ducks_tangent, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*ducks_radius, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*ducks_width, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*ducks_angle, 5, 6, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); -} - -Gtk::ToggleButton * -ToggleDucksDial::create_label_button(Gtk::IconSize iconsize, const char *stockid, - const char * tooltip) -{ - Gtk::ToggleButton *tbutton = manage(new class Gtk::ToggleButton()); - Gtk::Image *icon = manage(new Gtk::Image(Gtk::StockID(stockid), iconsize)); - tooltips.set_tip(*tbutton, tooltip); - tbutton->add(*icon); - icon->set_padding(0, 0); - icon->show(); - tbutton->set_relief(Gtk::RELIEF_NONE); - tbutton->show(); - - return tbutton; -} - -void -ToggleDucksDial::update_toggles(Duck::Type mask) -{ - ducks_position-> set_active((mask & Duck::TYPE_POSITION)); - ducks_vertex -> set_active((mask & Duck::TYPE_VERTEX)); - ducks_tangent -> set_active((mask & Duck::TYPE_TANGENT)); - ducks_radius -> set_active((mask & Duck::TYPE_RADIUS)); - ducks_width -> set_active((mask & Duck::TYPE_WIDTH)); - ducks_angle -> set_active((mask & Duck::TYPE_ANGLE)); -} diff --git a/synfig-studio/src/gui/toggleducksdial.h b/synfig-studio/src/gui/toggleducksdial.h deleted file mode 100644 index 832e212..0000000 --- a/synfig-studio/src/gui/toggleducksdial.h +++ /dev/null @@ -1,81 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file toggleducksdial.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 -** Copyright (c) 2009 Carlos Lopez -** -** 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_TOOGLEDUCKSDIAL_H -#define __SYNFIG_STUDIO_TOOGLEDUCKSDIAL_H - -/* === H E A D E R S ======================================================= */ - -#include -#include -#include -#include "duckmatic.h" - -#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 ToggleDucksDial : public Gtk::Table -{ - Gtk::Tooltips tooltips; - - Gtk::ToggleButton *ducks_position; - Gtk::ToggleButton *ducks_vertex; - Gtk::ToggleButton *ducks_tangent; - Gtk::ToggleButton *ducks_radius; - Gtk::ToggleButton *ducks_width; - Gtk::ToggleButton *ducks_angle; - - Gtk::ToggleButton *create_label_button(Gtk::IconSize iconsize, const char * stockid, const char * tooltip); - -public: - - ToggleDucksDial(Gtk::IconSize & size); - void update_toggles(Duck::Type mask); - Glib::SignalProxy0 signal_ducks_position() { return ducks_position->signal_toggled(); } - Glib::SignalProxy0 signal_ducks_vertex() { return ducks_vertex-> signal_toggled(); } - Glib::SignalProxy0 signal_ducks_tangent() { return ducks_tangent-> signal_toggled(); } - Glib::SignalProxy0 signal_ducks_radius() { return ducks_radius-> signal_toggled(); } - Glib::SignalProxy0 signal_ducks_width() { return ducks_width-> signal_toggled(); } - Glib::SignalProxy0 signal_ducks_angle() { return ducks_angle-> signal_toggled(); } - -}; // END of class ToggleDucksDial - -}; // END of namespace studio - - -/* === E N D =============================================================== */ - -#endif diff --git a/synfig-studio/src/gui/workarea.h b/synfig-studio/src/gui/workarea.h index 989ac8d..09584c8 100644 --- a/synfig-studio/src/gui/workarea.h +++ b/synfig-studio/src/gui/workarea.h @@ -50,7 +50,7 @@ #include #include -#include "zoomdial.h" +#include "dials/zoomdial.h" #include "duckmatic.h" #include "instance.h" diff --git a/synfig-studio/src/gui/zoomdial.cpp b/synfig-studio/src/gui/zoomdial.cpp deleted file mode 100644 index ae2f4a4..0000000 --- a/synfig-studio/src/gui/zoomdial.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* === S Y N F I G ========================================================= */ -/*! \file zoomdial.cpp -** \brief Template File -** -** $Id$ -** -** \legal -** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** -** 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 "zoomdial.h" -#include -#include - -#include "general.h" - -#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 ======================================================= */ - -ZoomDial::ZoomDial(Gtk::IconSize & size): Table(3, 1, false) -{ - zoom_in = create_icon(size, Gtk::Stock::ZOOM_IN, _("Zoom In")); - zoom_out = create_icon(size, Gtk::Stock::ZOOM_OUT, _("Zoom Out")); - zoom_fit = create_icon(size, Gtk::Stock::ZOOM_FIT, _("Zoom to Fit")); - zoom_norm = create_icon(size, Gtk::Stock::ZOOM_100, _("Zoom to 100%")); - - attach(*zoom_out, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*zoom_norm, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*zoom_fit, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - attach(*zoom_in, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); -} - -Gtk::Button * -ZoomDial::create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & stockid, - const char * tooltip) -{ - Gtk::Button *button = manage(new class Gtk::Button()); - Gtk::Image *icon = manage(new Gtk::Image(stockid, size)); - 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/src/gui/zoomdial.h b/synfig-studio/src/gui/zoomdial.h deleted file mode 100644 index 1d9d63a..0000000 --- a/synfig-studio/src/gui/zoomdial.h +++ /dev/null @@ -1,70 +0,0 @@ -/* === 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 -** -** 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_ZOOMDIAL_H -#define __SYNFIG_STUDIO_ZOOMDIAL_H - -/* === H E A D E R S ======================================================= */ - -#include -#include -#include - -/* === 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 ZoomDial : public Gtk::Table -{ - Gtk::Tooltips tooltips; - - Gtk::Button *zoom_in; - Gtk::Button *zoom_out; - Gtk::Button *zoom_fit; - Gtk::Button *zoom_norm; - - Gtk::Button *create_icon(Gtk::IconSize size, const Gtk::BuiltinStockID & stockid, - const char * tooltip); - -public: - ZoomDial(Gtk::IconSize &size); - - Glib::SignalProxy0 signal_zoom_in() { return zoom_in->signal_clicked(); } - Glib::SignalProxy0 signal_zoom_out() { return zoom_out->signal_clicked(); } - Glib::SignalProxy0 signal_zoom_fit() { return zoom_fit->signal_clicked(); } - Glib::SignalProxy0 signal_zoom_norm() { return zoom_norm->signal_clicked(); } - -}; // END of class ZoomDial - -}; // END of namespace studio - -/* === E N D =============================================================== */ - -#endif