my log
[synfig.git] / synfig-studio / trunk / 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 software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SYNFIG_TEMPLATE_H
25 #define __SYNFIG_TEMPLATE_H
26
27 /* === H E A D E R S ======================================================= */
28 #include <gtkmm/adjustment.h>
29
30 /* === M A C R O S ========================================================= */
31
32 /* === T Y P E D E F S ===================================================== */
33
34 /* === C L A S S E S & S T R U C T S ======================================= */
35
36 namespace studio {
37
38 /* Sets up an adjustment that controls/communicates with another adjustment
39         (could be expanded to multiple children)
40         
41         The current value and pagesize define the lower and upper bounds of the
42         child adjustment.
43         
44         NEED TO REPLACE FUNCTIONALITY IN:
45         refresh_rend_desc
46         refresh_time_window
47         on_time_changed - possibly....
48         
49         time_zoom_in - possibly...
50         time_zoom_out - possibly...
51         
52         play - possibly...
53         
54         THINGS TO CHECK:
55         disp_audio's use of time_adjustment
56         children_tree's use of time_adjustment
57         layer_tree's use of time_adjustment
58 */
59 class Adjust_Window : public Gtk::Adjustment
60 {
61         Gtk::Adjustment *adj_child;
62         
63         sigc::connection childchanged; //we only care about the non-value parts of the child
64         
65         virtual void on_changed(); //value+pagesize corresponds to child upper
66         virtual void on_value_changed(); //value corresponds to child lower
67
68 protected: //update interface
69         virtual void update_child();
70         virtual void update_fromchild();
71         
72 public: //structors
73         Adjust_Window(double value, double lower, double upper, 
74                                         double step_increment=1, double page_increment=10, double page_size=0,
75                                         Gtk::Adjustment *adj = 0);
76
77         virtual ~Adjust_Window();
78
79 public: //child interface
80         Gtk::Adjustment *get_child_adjustment();
81         const Gtk::Adjustment *get_child_adjustment() const;
82         void set_child_adjustment(Gtk::Adjustment *child);
83
84 public: //Sub value interface
85         double get_sub_lower() const;
86         double get_sub_upper() const;
87 };
88         
89 }; // END of namespace studio
90
91 /* === E N D =============================================================== */
92
93 #endif