Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_05 / synfig-studio / src / gtkmm / adjust_window.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file adjust_window.h
3 **      \brief Adjustment Window Header
4 **
5 **      $Id: adjust_window.h,v 1.1.1.1 2005/01/07 03:34:35 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2004 Adrian Bentley
9 **
10 **      This package is free software; you can redistribute it and/or
11 **      modify it under the terms of the GNU General Public License as
12 **      published by the Free Software Foundation; either version 2 of
13 **      the License, or (at your option) any later version.
14 **
15 **      This package is distributed in the hope that it will be useful,
16 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **      General Public License for more details.
19 **      \endlegal
20 */
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         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                                         Gtk::Adjustment *adj = 0);
77
78         virtual ~Adjust_Window();
79
80 public: //child interface
81         Gtk::Adjustment *get_child_adjustment();
82         const Gtk::Adjustment *get_child_adjustment() const;
83         void set_child_adjustment(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