Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_04 / synfig-studio / src / gtkmm / renddesc.h
1 /*! ========================================================================
2 ** Synfig
3 ** Template Header File
4 ** $Id: renddesc.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
5 **
6 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
7 **
8 **      This package is free software; you can redistribute it and/or
9 **      modify it under the terms of the GNU General Public License as
10 **      published by the Free Software Foundation; either version 2 of
11 **      the License, or (at your option) any later version.
12 **
13 **      This package is distributed in the hope that it will be useful,
14 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
15 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 **      General Public License for more details.
17 **
18 ** === N O T E S ===========================================================
19 **
20 ** ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SYNFIG_GTKMM_RENDDESC_H
25 #define __SYNFIG_GTKMM_RENDDESC_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <gtkmm/table.h>
30 #include <gtkmm/frame.h>
31 #include <synfig/renddesc.h>
32 #include <gtkmm/spinbutton.h>
33 #include <gtkmm/adjustment.h>
34 #include <gtkmm/checkbutton.h>
35 #include "widget_vector.h"
36 #include "widget_time.h"
37
38 /* === M A C R O S ========================================================= */
39
40 /* === T Y P E D E F S ===================================================== */
41
42 /* === C L A S S E S & S T R U C T S ======================================= */
43
44 namespace studio {
45
46 class Widget_RendDesc : public Gtk::Table
47 {
48         synfig::RendDesc rend_desc_;
49         sigc::signal<void> signal_changed_;
50
51         Gtk::Adjustment adjustment_width;
52         Gtk::Adjustment adjustment_height;
53         Gtk::Adjustment adjustment_xres;
54         Gtk::Adjustment adjustment_yres;
55         Gtk::Adjustment adjustment_phy_width;
56         Gtk::Adjustment adjustment_phy_height;
57         Gtk::Adjustment adjustment_fps;
58         //Gtk::Adjustment adjustment_start_time;
59         //Gtk::Adjustment adjustment_end_time;
60         //Gtk::Adjustment adjustment_start_frame;
61         //Gtk::Adjustment adjustment_end_frame;
62         Gtk::Adjustment adjustment_span;
63         
64         Gtk::SpinButton *entry_width;   
65         Gtk::SpinButton *entry_height;  
66         Gtk::SpinButton *entry_xres;    
67         Gtk::SpinButton *entry_yres;    
68         Gtk::SpinButton *entry_phy_width;       
69         Gtk::SpinButton *entry_phy_height;      
70         Gtk::SpinButton *entry_fps;     
71 //      Gtk::SpinButton *entry_start_time;      
72 //      Gtk::SpinButton *entry_end_time;        
73 //      Gtk::SpinButton *entry_start_frame;     
74 //      Gtk::SpinButton *entry_end_frame;       
75         Gtk::SpinButton *entry_span;    
76
77         Gtk::CheckButton *toggle_px_aspect;
78         Gtk::CheckButton *toggle_px_width;
79         Gtk::CheckButton *toggle_px_height;
80
81         Gtk::CheckButton *toggle_im_aspect;
82         Gtk::CheckButton *toggle_im_width;
83         Gtk::CheckButton *toggle_im_height;
84         Gtk::CheckButton *toggle_im_span;
85
86         Gtk::Table *time_table;
87         Gtk::Frame *time_frame;
88
89         Widget_Vector *entry_tl;
90         Widget_Vector *entry_br;
91
92         Widget_Vector *entry_focus;
93
94         Widget_Time *entry_start_time;
95         Widget_Time *entry_end_time;
96
97         mutable int update_lock;
98
99         struct UpdateLock
100         {
101                 int &locked;
102                 UpdateLock(int &locked):locked(locked){locked++;}
103                 ~UpdateLock(){locked--;}
104         };
105         
106 public:
107
108         sigc::signal<void> &signal_changed() { return signal_changed_; }
109
110         Widget_RendDesc();
111         ~Widget_RendDesc();
112         
113         //! Sets the RendDesc
114         void set_rend_desc(const synfig::RendDesc &rend_desc);
115
116         //! Applies the given RendDesc to the current RendDesc
117         void apply_rend_desc(const synfig::RendDesc &rend_desc);
118
119         //! Retrieves the current RendDesc
120         const synfig::RendDesc &get_rend_desc();
121
122         void disable_time_section();
123         
124         void enable_time_section();
125         
126         void refresh();
127 private:
128         
129         void on_width_changed();
130         void on_height_changed();
131         void on_xres_changed();
132         void on_yres_changed();
133         void on_phy_width_changed();
134         void on_phy_height_changed();
135         void on_tl_changed();
136         void on_br_changed();
137         void on_fps_changed();
138         void on_start_time_changed();
139         void on_end_time_changed();
140         //void on_start_frame_changed();
141         //void on_end_frame_changed();
142         void on_lock_changed();
143         void on_focus_changed();
144         void on_span_changed();
145 };
146         
147 }; // END of namespace studio
148
149 /* === E N D =============================================================== */
150
151 #endif