synfig-studio  1.0.3
adjust_window.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
21 /* ========================================================================= */
22 
23 /* === S T A R T =========================================================== */
24 
25 #ifndef __SYNFIG_TEMPLATE_H
26 #define __SYNFIG_TEMPLATE_H
27 
28 /* === H E A D E R S ======================================================= */
29 #include <gtkmm/adjustment.h>
30 
31 /* === M A C R O S ========================================================= */
32 
33 /* === T Y P E D E F S ===================================================== */
34 
35 /* === C L A S S E S & S T R U C T S ======================================= */
36 
37 namespace studio {
38 
39 /* Sets up an adjustment that controls/communicates with another adjustment
40  (could be expanded to multiple children)
41 
42  The current value and pagesize define the lower and upper bounds of the
43  child adjustment.
44 
45  NEED TO REPLACE FUNCTIONALITY IN:
46  refresh_rend_desc
47  refresh_time_window
48  on_time_changed - possibly....
49 
50  time_zoom_in - possibly...
51  time_zoom_out - possibly...
52 
53  play - possibly...
54 
55  THINGS TO CHECK:
56  disp_audio's use of time_adjustment
57  children_tree's use of time_adjustment
58  layer_tree's use of time_adjustment
59 */
60 class Adjust_Window : public Gtk::Adjustment
61 {
62  Glib::RefPtr<Gtk::Adjustment> adj_child;
63 
64  sigc::connection childchanged; //we only care about the non-value parts of the child
65 
66  virtual void on_changed(); //value+pagesize corresponds to child upper
67  virtual void on_value_changed(); //value corresponds to child lower
68 
69 protected: //update interface
70  virtual void update_child();
71  virtual void update_fromchild();
72 
73 public: //structors
74  Adjust_Window(double value, double lower, double upper,
75  double step_increment=1, double page_increment=10, double page_size=0,
76  const Glib::RefPtr<Gtk::Adjustment> &adj = Glib::RefPtr<Gtk::Adjustment>());
77 
78  virtual ~Adjust_Window();
79 
80 public: //child interface
81  Glib::RefPtr<Gtk::Adjustment> get_child_adjustment();
82  Glib::RefPtr<const Gtk::Adjustment> get_child_adjustment() const;
83  void set_child_adjustment(const Glib::RefPtr<Gtk::Adjustment> &child);
84 
85 public: //Sub value interface
86  double get_sub_lower() const;
87  double get_sub_upper() const;
88 };
89 
90 }; // END of namespace studio
91 
92 /* === E N D =============================================================== */
93 
94 #endif