X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fwidget_keyframe_list.h;h=1e41770bfb271d1353e8024923ce725a53860e2b;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=6a7ef7344e68fc5670cff8441b84da14aca20dde;hpb=d984a091f5a0cb0c903d4abfcf7a7afb57ec82e3;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/widget_keyframe_list.h b/synfig-studio/trunk/src/gtkmm/widget_keyframe_list.h index 6a7ef73..1e41770 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_keyframe_list.h +++ b/synfig-studio/trunk/src/gtkmm/widget_keyframe_list.h @@ -29,7 +29,12 @@ /* === H E A D E R S ======================================================= */ #include +#include +#include #include +#include +#include + /* === M A C R O S ========================================================= */ @@ -41,61 +46,105 @@ namespace studio { class Widget_Keyframe_List : public Gtk::DrawingArea { - sigc::signal signal_value_changed_; - sigc::signal signal_clicked_; + //! Tooltips class. It is deprecated since gtkmm 2.12 + //! replace with Tooltip class or use the own tooltip widget's members + Gtk::Tooltips tooltips; + + //! The canvas interface being watched + etl::loose_handle canvas_interface_; + + //! Time adjustment window + Gtk::Adjustment adj_default; + Gtk::Adjustment *adj_timescale; - sigc::signal signal_keyframe_selected_; + //!The list of keyframes to be drawn on the widget and moved with mouse + synfig::KeyframeList default_kf_list_; + mutable synfig::KeyframeList* kf_list_; - synfig::KeyframeList kf_list_; + //! The frames per second of the canvas + float fps; + //! Time radius to click a keyframe + synfig::Time time_ratio; + + //!True if it is editable. Keyframes can be moved. bool editable_; + //!True if a keyframe is being dragged. + bool dragging_; + + //!True if a keyframe has been moved bool changed_; + //!Holds the selected keyframe of the keyframe list synfig::Keyframe selected_kf; + synfig::Keyframe selected_none; + bool selected_; - void popup_menu(float x); + //!The time of the selected keyframe + synfig::Time selected_kf_time; - //void insert_cpoint(float x); + //!The time of the selected keyframe during draging + synfig::Time dragging_kf_time; - //void remove_cpoint(float x); + //!Connectors for handling the signals of the time adjustment + sigc::connection time_value_change; + sigc::connection time_other_change; public: + //!Default constructor Widget_Keyframe_List(); + //!Destructror ~Widget_Keyframe_List(); - sigc::signal& signal_value_changed() { return signal_value_changed_; } - sigc::signal& signal_clicked() { return signal_clicked_; } - - sigc::signal& signal_keyframe_selected() { return signal_keyframe_selected_; } + //!Loads a new keyframe list on the widget. + void set_kf_list(synfig::KeyframeList* x); - void set_value(const synfig::KeyframeList& x); - - const synfig::KayframeList& get_value()const { return kf_list_; } + //!Member for private data. + synfig::KeyframeList* get_kf_list()const { return kf_list_; } + //!Member for private data void set_editable(bool x=true) { editable_=x; } + //!Member for private data bool get_editable()const { return editable_; } - + //!Store the selected keyframe value void set_selected_keyframe(const synfig::Keyframe &x); - const synfig::Kayframe& get_selected_keyframe() { return selected_kf; } + //!Returns the selected keyframe + const synfig::Keyframe& get_selected_keyframe() { return selected_kf; } + + //! Set the time adjustment and proper connects its change signals + void set_time_adjustment(Gtk::Adjustment *x); - void update_keyframe(const synfig::Keyframe &x); + //! Set the fps + void set_fps(float x); + //! Set the canvas interface + void set_canvas_interface(etl::loose_handle h); + //! Performs the keyframe movement. Returns true if it was sucessful + //! @return true: if success otherwise false + //! |delta=false: permorm normal move. true: perform delta movement + bool perform_move_kf(bool delta); + + +/* ======================= EVENTS HANDLERS ===========================*/ + //!Redraw event. Should draw all the keyframes + the selected + the dragged bool redraw(GdkEventExpose*bleh=NULL); + //!Mouse event handler. bool on_event(GdkEvent *event); }; // END of class Keyframe_List }; // END of namespace studio + /* === E N D =============================================================== */ #endif