Initial trial of keyframe list. It doesn't compile.
[synfig.git] / synfig-studio / trunk / src / gtkmm / widget_keyframe_list.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file widget_keyframe_list.h
3 **      \brief A custom widget to manage keyframes in the timeline.
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **      Copyright (c) 2009 Carlos López
10 **
11 **      This package is free software; you can redistribute it and/or
12 **      modify it under the terms of the GNU General Public License as
13 **      published by the Free Software Foundation; either version 2 of
14 **      the License, or (at your option) any later version.
15 **
16 **      This package is distributed in the hope that it will be useful,
17 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
18 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 **      General Public License for more details.
20 **      \endlegal
21 */
22 /* ========================================================================= */
23
24 /* === S T A R T =========================================================== */
25
26 #ifndef __SYNFIG_STUDIO_WIDGET_KEYFRAME_LIST_H
27 #define __SYNFIG_STUDIO_WIDGET_KEYFRAME_LIST_H
28
29 /* === H E A D E R S ======================================================= */
30
31 #include <gtkmm/drawingarea.h>
32 #include <synfig/keyframe.h>
33
34 /* === M A C R O S ========================================================= */
35
36 /* === T Y P E D E F S ===================================================== */
37
38 /* === C L A S S E S & S T R U C T S ======================================= */
39
40 namespace studio {
41
42 class Widget_Keyframe_List : public Gtk::DrawingArea
43 {
44         sigc::signal<void> signal_value_changed_;
45         sigc::signal<void> signal_clicked_;
46
47         sigc::signal<void,synfig::Keyframe> signal_keyframe_selected_;
48
49         synfig::KeyframeList kf_list_;
50
51         bool editable_;
52
53         bool changed_;
54
55         synfig::Keyframe selected_kf;
56
57         void popup_menu(float x);
58
59         //void insert_cpoint(float x);
60
61         //void remove_cpoint(float x);
62
63 public:
64
65         Widget_Keyframe_List();
66
67         ~Widget_Keyframe_List();
68
69         sigc::signal<void>& signal_value_changed() { return signal_value_changed_; }
70         sigc::signal<void>& signal_clicked() { return signal_clicked_; }
71
72         sigc::signal<void,synfig::Keyframe>& signal_keyframe_selected() { return signal_keyframe_selected_; }
73
74         void set_value(const synfig::KeyframeList& x);
75
76         const synfig::KayframeList& get_value()const { return kf_list_; }
77
78         void set_editable(bool x=true) { editable_=x; }
79
80         bool get_editable()const { return editable_; }
81
82
83
84         void set_selected_keyframe(const synfig::Keyframe &x);
85
86         const synfig::Kayframe& get_selected_keyframe() { return selected_kf; }
87
88         void update_keyframe(const synfig::Keyframe &x);
89
90
91
92         bool redraw(GdkEventExpose*bleh=NULL);
93
94         bool on_event(GdkEvent *event);
95 }; // END of class Keyframe_List
96
97 }; // END of namespace studio
98
99 /* === E N D =============================================================== */
100
101 #endif