X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Fsrc%2Fgtkmm%2Fcellrenderer_timetrack.h;fp=synfig-studio%2Fsrc%2Fgtkmm%2Fcellrenderer_timetrack.h;h=519ac8dbbe85a010fd0caa7004828dd53b5acdd0;hb=a095981e18cc37a8ecc7cd237cc22b9c10329264;hp=0000000000000000000000000000000000000000;hpb=9459638ad6797b8139f1e9f0715c96076dbf0890;p=synfig.git diff --git a/synfig-studio/src/gtkmm/cellrenderer_timetrack.h b/synfig-studio/src/gtkmm/cellrenderer_timetrack.h new file mode 100644 index 0000000..519ac8d --- /dev/null +++ b/synfig-studio/src/gtkmm/cellrenderer_timetrack.h @@ -0,0 +1,207 @@ +/* === S Y N F I G ========================================================= */ +/*! \file cellrenderer_timetrack.h +** \brief Template Header +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007, 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_GTKMM_CELLRENDERER_TIMETRACK_H +#define __SYNFIG_GTKMM_CELLRENDERER_TIMETRACK_H + +/* === H E A D E R S ======================================================= */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#include +#include +#include +#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 Widget_ValueBase; + +/*! \class CellRenderer_TimeTrack +** \brief A cell renderer that displays the waypoints for Animated ValueNodes. +*/ +class CellRenderer_TimeTrack : + public Gtk::CellRenderer +{ + + /* + -- ** -- P R I V A T E D A T A --------------------------------------------- + */ + +private: + //! Time adjustment window + Gtk::Adjustment adjustment_; + + //! Signal for when the user clicks on a waypoint + sigc::signal&, const synfig::Time&, const synfig::Time&, int> signal_waypoint_clicked_cellrenderer_; + + sigc::signal signal_waypoint_changed_; + + //! Iterator for selected waypoint. (Should this be an UniqueID instead?) + synfig::ValueNode_Animated::WaypointList::iterator selected_waypoint; + + synfig::UniqueID selected; + + //! selected information for time... (will work for way points etc...) + //TODO: make multiple... on both time and value select... + std::set sel_times; + synfigapp::ValueDesc sel_value; + synfig::Time actual_time; + synfig::Time actual_dragtime; + int mode; + + //! ??? + synfig::Time selected_time; + + //! The path to the current item in the tree model + Glib::ustring path; + + //! ??? + bool selection; + + bool dragging; + + synfig::Time drag_time; + + etl::loose_handle canvas_interface_; + + /* + -- ** -- P R O P E R T I E S ------------------------------------------------- + */ + +private: + + //! ValueBase Desc + Glib::Property property_valuedesc_; + + //! Canvas + Glib::Property property_canvas_; + + //! ??? \see adjustment_ + Glib::Property property_adjustment_; + + //! \writeme + Glib::Property property_enable_timing_info_; + + /* + -- ** -- P R O P E R T Y I N T E R F A C E S ------------------------------- + */ + +public: + + Glib::PropertyProxy property_value_desc(); + + Glib::PropertyProxy property_canvas(); + + Glib::PropertyProxy property_adjustment(); + + /* + -- ** -- S I G N A L I N T E R F A C E S ----------------------------------- + */ + +public: + + sigc::signal&, const synfig::Time&, const synfig::Time&, int> &signal_waypoint_clicked_cellrenderer() + {return signal_waypoint_clicked_cellrenderer_; } + + sigc::signal &signal_waypoint_changed() + {return signal_waypoint_changed_; } + + /* + -- ** -- P U B L I C M E T H O D S ----------------------------------------- + */ + +public: + + CellRenderer_TimeTrack(); + ~CellRenderer_TimeTrack(); + + void set_adjustment(Gtk::Adjustment &x); + Gtk::Adjustment *get_adjustment(); + const Gtk::Adjustment *get_adjustment()const; + + etl::loose_handle canvas_interface()const {return canvas_interface_;} + void set_canvas_interface(etl::loose_handle h); //this should only be called by smart people + + synfig::Canvas::Handle get_canvas()const; + + bool is_selected(const synfig::Waypoint& waypoint)const; + + synfig::ValueNode_Animated::WaypointList::iterator find_waypoint(const synfig::Time& t, const synfig::Time& scope=synfig::Time::end()); + + virtual void + render_vfunc( + const Glib::RefPtr& window, + Gtk::Widget& widget, + const Gdk::Rectangle& background_area, + const Gdk::Rectangle& ca, + const Gdk::Rectangle& expose_area, + Gtk::CellRendererState flags); + + virtual bool + activate_vfunc( GdkEvent* event, + Gtk::Widget& widget, + const Glib::ustring& path, + const Gdk::Rectangle& background_area, + const Gdk::Rectangle& cell_area, + Gtk::CellRendererState flags); + +}; // END of class CellRenderer_TimeTrack + +}; // END of namespace studio + +/* === E N D =============================================================== */ + +#endif