00001 /* === S Y N F I G ========================================================= */ 00021 /* ========================================================================= */ 00022 00023 /* === S T A R T =========================================================== */ 00024 00025 #ifndef __SYNFIG_GTKMM_DIALOG_PREVIEW_H 00026 #define __SYNFIG_GTKMM_DIALOG_PREVIEW_H 00027 00028 /* === H E A D E R S ======================================================= */ 00029 00030 #include <gtkmm/adjustment.h> 00031 #include <gtkmm/dialog.h> 00032 #include <gtkmm/menu.h> 00033 #include <gtkmm/spinbutton.h> 00034 #include <gtkmm/dialogsettings.h> 00035 00036 #include "preview.h" 00037 #include <gtkmm/widget_time.h> 00038 00039 /* === M A C R O S ========================================================= */ 00040 00041 /* === T Y P E D E F S ===================================================== */ 00042 00043 00044 /* === C L A S S E S & S T R U C T S ======================================= */ 00045 00046 namespace studio { 00047 00048 struct PreviewInfo 00049 { 00050 float zoom,fps,begintime,endtime; 00051 bool overbegin,overend; 00052 }; 00053 00054 class Dialog_Preview : public Gtk::Dialog 00055 { 00056 Widget_Preview preview; 00057 DialogSettings settings; 00058 00059 //etl::handle<synfig::Canvas> canvas; 00060 00061 public: 00062 Dialog_Preview(); 00063 ~Dialog_Preview(); 00064 00065 void set_preview(etl::handle<Preview> prev); 00066 00067 Widget_Preview &get_widget() {return preview;} 00068 const Widget_Preview &get_widget() const {return preview;} 00069 00070 virtual void on_hide(); 00071 //other forwarding functions... 00072 }; // END of Dialog_Preview 00073 00074 class Dialog_PreviewOptions : public Gtk::Dialog 00075 { 00076 //all the info needed to construct a render description... 00077 Gtk::Adjustment adj_zoom; // factor at which to resize the window... 00078 00079 Gtk::Adjustment adj_fps; // how often to take samples of the animation 00080 00081 studio::Widget_Time time_begin; 00082 studio::Widget_Time time_end; 00083 00084 Gtk::CheckButton check_overbegin; 00085 Gtk::CheckButton check_overend; 00086 00087 DialogSettings settings; 00088 00089 float globalfps; 00090 00091 // for finishing 00092 void on_ok_pressed(); 00093 void on_cancel_pressed(); 00094 00095 //for ui stuff 00096 void on_overbegin_toggle(); 00097 void on_overend_toggle(); 00098 00099 sigc::signal<void,const PreviewInfo &> signal_finish_; 00100 public: 00101 Dialog_PreviewOptions(); 00102 ~Dialog_PreviewOptions(); 00103 00104 float get_zoom() const { return adj_zoom.get_value(); } 00105 void set_zoom(float z) { adj_zoom.set_value(z); } 00106 00107 float get_fps() const { return adj_fps.get_value(); } 00108 void set_fps(float z) { adj_fps.set_value(z); } 00109 00110 float get_global_fps() const { return globalfps; } 00111 void set_global_fps(float f); 00112 00113 synfig::Time get_begintime() const { return time_begin.get_value(); } 00114 void set_begintime(const synfig::Time &t) { time_begin.set_value(t); } 00115 00116 synfig::Time get_endtime() const { return time_end.get_value(); } 00117 void set_endtime(const synfig::Time &t) { time_end.set_value(t); } 00118 00119 bool get_begin_override() const { return check_overbegin.get_active(); } 00120 void set_begin_override(bool o) { check_overbegin.set_active(o); } 00121 00122 bool get_end_override() const { return check_overend.get_active(); } 00123 void set_end_override(bool o) { check_overend.set_active(o); } 00124 00125 sigc::signal<void,const PreviewInfo &> &signal_finish() {return signal_finish_;} 00126 }; 00127 00128 }; // END of namespace studio 00129 00130 /* === E N D =============================================================== */ 00131 00132 #endif