my log
[synfig.git] / synfig-studio / trunk / 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 Robert B. Quattlebaum Jr.
7 **
8 ** This software and associated documentation
9 ** are CONFIDENTIAL and PROPRIETARY property of
10 ** the above-mentioned copyright holder.
11 **
12 ** You may not copy, print, publish, or in any
13 ** other way distribute this software without
14 ** a prior written agreement with
15 ** the copyright holder.
16 **
17 ** === N O T E S ===========================================================
18 **
19 ** ========================================================================= */
20
21 /* === S T A R T =========================================================== */
22
23 #ifndef __SYNFIG_GTKMM_RENDDESC_H
24 #define __SYNFIG_GTKMM_RENDDESC_H
25
26 /* === H E A D E R S ======================================================= */
27
28 #include <gtkmm/table.h>
29 #include <gtkmm/frame.h>
30 #include <synfig/renddesc.h>
31 #include <gtkmm/spinbutton.h>
32 #include <gtkmm/adjustment.h>
33 #include <gtkmm/checkbutton.h>
34 #include "widget_vector.h"
35 #include "widget_time.h"
36
37 /* === M A C R O S ========================================================= */
38
39 /* === T Y P E D E F S ===================================================== */
40
41 /* === C L A S S E S & S T R U C T S ======================================= */
42
43 namespace studio {
44
45 class Widget_RendDesc : public Gtk::Table
46 {
47         synfig::RendDesc rend_desc_;
48         sigc::signal<void> signal_changed_;
49
50         Gtk::Adjustment adjustment_width;
51         Gtk::Adjustment adjustment_height;
52         Gtk::Adjustment adjustment_xres;
53         Gtk::Adjustment adjustment_yres;
54         Gtk::Adjustment adjustment_phy_width;
55         Gtk::Adjustment adjustment_phy_height;
56         Gtk::Adjustment adjustment_fps;
57         //Gtk::Adjustment adjustment_start_time;
58         //Gtk::Adjustment adjustment_end_time;
59         //Gtk::Adjustment adjustment_start_frame;
60         //Gtk::Adjustment adjustment_end_frame;
61         Gtk::Adjustment adjustment_span;
62         
63         Gtk::SpinButton *entry_width;   
64         Gtk::SpinButton *entry_height;  
65         Gtk::SpinButton *entry_xres;    
66         Gtk::SpinButton *entry_yres;    
67         Gtk::SpinButton *entry_phy_width;       
68         Gtk::SpinButton *entry_phy_height;      
69         Gtk::SpinButton *entry_fps;     
70 //      Gtk::SpinButton *entry_start_time;      
71 //      Gtk::SpinButton *entry_end_time;        
72 //      Gtk::SpinButton *entry_start_frame;     
73 //      Gtk::SpinButton *entry_end_frame;       
74         Gtk::SpinButton *entry_span;    
75
76         Gtk::CheckButton *toggle_px_aspect;
77         Gtk::CheckButton *toggle_px_width;
78         Gtk::CheckButton *toggle_px_height;
79
80         Gtk::CheckButton *toggle_im_aspect;
81         Gtk::CheckButton *toggle_im_width;
82         Gtk::CheckButton *toggle_im_height;
83         Gtk::CheckButton *toggle_im_span;
84
85         Gtk::Table *time_table;
86         Gtk::Frame *time_frame;
87
88         Widget_Vector *entry_tl;
89         Widget_Vector *entry_br;
90
91         Widget_Vector *entry_focus;
92
93         Widget_Time *entry_start_time;
94         Widget_Time *entry_end_time;
95
96         mutable int update_lock;
97
98         struct UpdateLock
99         {
100                 int &locked;
101                 UpdateLock(int &locked):locked(locked){locked++;}
102                 ~UpdateLock(){locked--;}
103         };
104         
105 public:
106
107         sigc::signal<void> &signal_changed() { return signal_changed_; }
108
109         Widget_RendDesc();
110         ~Widget_RendDesc();
111         
112         //! Sets the RendDesc
113         void set_rend_desc(const synfig::RendDesc &rend_desc);
114
115         //! Applies the given RendDesc to the current RendDesc
116         void apply_rend_desc(const synfig::RendDesc &rend_desc);
117
118         //! Retrieves the current RendDesc
119         const synfig::RendDesc &get_rend_desc();
120
121         void disable_time_section();
122         
123         void enable_time_section();
124         
125         void refresh();
126 private:
127         
128         void on_width_changed();
129         void on_height_changed();
130         void on_xres_changed();
131         void on_yres_changed();
132         void on_phy_width_changed();
133         void on_phy_height_changed();
134         void on_tl_changed();
135         void on_br_changed();
136         void on_fps_changed();
137         void on_start_time_changed();
138         void on_end_time_changed();
139         //void on_start_frame_changed();
140         //void on_end_frame_changed();
141         void on_lock_changed();
142         void on_focus_changed();
143         void on_span_changed();
144 };
145         
146 }; // END of namespace studio
147
148 /* === E N D =============================================================== */
149
150 #endif