synfig-studio  1.0.3
renddesc.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
25 /* === S T A R T =========================================================== */
26 
27 #ifndef __SYNFIG_GTKMM_RENDDESC_H
28 #define __SYNFIG_GTKMM_RENDDESC_H
29 
30 /* === H E A D E R S ======================================================= */
31 
32 #include <gtkmm/table.h>
33 #include <gtkmm/frame.h>
34 #include <synfig/renddesc.h>
35 #include <gtkmm/spinbutton.h>
36 #include <gtkmm/adjustment.h>
37 #include <gtkmm/checkbutton.h>
38 #include <gtkmm/notebook.h>
39 #include "widgets/widget_vector.h"
40 #include "widgets/widget_time.h"
41 #include "widgets/widget_link.h"
42 
43 /* === M A C R O S ========================================================= */
44 
45 /* === T Y P E D E F S ===================================================== */
46 
47 /* === C L A S S E S & S T R U C T S ======================================= */
48 
49 namespace studio {
50 
51 class Widget_RendDesc : public Gtk::Notebook
52 {
53  synfig::RendDesc rend_desc_;
54  sigc::signal<void> signal_changed_;
55 
56  Glib::RefPtr<Gtk::Adjustment> adjustment_width;
57  Glib::RefPtr<Gtk::Adjustment> adjustment_height;
58  Glib::RefPtr<Gtk::Adjustment> adjustment_xres;
59  Glib::RefPtr<Gtk::Adjustment> adjustment_yres;
60  Glib::RefPtr<Gtk::Adjustment> adjustment_phy_width;
61  Glib::RefPtr<Gtk::Adjustment> adjustment_phy_height;
62  Glib::RefPtr<Gtk::Adjustment> adjustment_fps;
63  Glib::RefPtr<Gtk::Adjustment> adjustment_span;
64 
65  Gtk::SpinButton *entry_width;
66  Gtk::SpinButton *entry_height;
67  Gtk::SpinButton *entry_xres;
68  Gtk::SpinButton *entry_yres;
69  Gtk::SpinButton *entry_phy_width;
70  Gtk::SpinButton *entry_phy_height;
71  Gtk::SpinButton *entry_fps;
72  Gtk::SpinButton *entry_span;
73 
74  Widget_Link *toggle_wh_ratio;
75  Widget_Link *toggle_res_ratio;
76 
77  Gtk::Label *pixel_ratio_label;
78 
79  Gtk::CheckButton *toggle_px_aspect;
80  Gtk::CheckButton *toggle_px_width;
81  Gtk::CheckButton *toggle_px_height;
82 
83  Gtk::CheckButton *toggle_im_aspect;
84  Gtk::CheckButton *toggle_im_width;
85  Gtk::CheckButton *toggle_im_height;
86  Gtk::CheckButton *toggle_im_span;
87 
88  Gtk::Frame *time_frame;
89 
90  Widget_Vector *entry_tl;
91  Widget_Vector *entry_br;
92 
93  Widget_Vector *entry_focus;
94 
95  Widget_Time *entry_start_time;
96  Widget_Time *entry_end_time;
97  Widget_Time *entry_duration;
98 
99  mutable int update_lock;
100 
101  struct UpdateLock
102  {
103  int &locked;
104  UpdateLock(int &locked):locked(locked){locked++;}
105  ~UpdateLock(){locked--;}
106  };
107 
108 public:
109 
110  sigc::signal<void> &signal_changed() { return signal_changed_; }
111 
112  Widget_RendDesc();
114 
116  void set_rend_desc(const synfig::RendDesc &rend_desc);
117 
119  void apply_rend_desc(const synfig::RendDesc &rend_desc);
120 
122  const synfig::RendDesc &get_rend_desc();
123 
124  void disable_time_section();
125 
126  void enable_time_section();
127 
128  void refresh();
129 private:
130 
131  void on_width_changed();
132  void on_height_changed();
133  void on_xres_changed();
134  void on_yres_changed();
135  void on_phy_width_changed();
136  void on_phy_height_changed();
137  void on_tl_changed();
138  void on_br_changed();
139  void on_fps_changed();
140  void on_start_time_changed();
141  void on_end_time_changed();
142  void on_duration_changed();
143  void on_lock_changed();
144  void on_focus_changed();
145  void on_span_changed();
146 
147  void on_ratio_wh_toggled();
148  void on_ratio_res_toggled();
149 
150  void create_widgets();
151  void connect_signals();
152  Gtk::Widget *create_image_tab();
153  Gtk::Widget *create_time_tab();
154  Gtk::Widget *create_other_tab();
155 };
156 
157 }; // END of namespace studio
158 
159 /* === E N D =============================================================== */
160 
161 #endif