1 /* === S Y N F I G ========================================================= */
2 /*! \file dialogs/dialog_preview.h
3 ** \brief Preview dialog Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_GTKMM_DIALOG_PREVIEW_H
26 #define __SYNFIG_GTKMM_DIALOG_PREVIEW_H
28 /* === H E A D E R S ======================================================= */
30 #include <gtkmm/adjustment.h>
31 #include <gtkmm/dialog.h>
32 #include <gtkmm/menu.h>
33 #include <gtkmm/spinbutton.h>
34 #include <gui/dialogsettings.h>
37 #include <gui/widgets/widget_time.h>
39 /* === M A C R O S ========================================================= */
41 /* === T Y P E D E F S ===================================================== */
44 /* === C L A S S E S & S T R U C T S ======================================= */
50 float zoom,fps,begintime,endtime;
51 bool overbegin,overend;
54 class Dialog_Preview : public Gtk::Dialog
56 Widget_Preview preview;
57 DialogSettings settings;
59 //etl::handle<synfig::Canvas> canvas;
65 void set_preview(etl::handle<Preview> prev);
67 Widget_Preview &get_widget() {return preview;}
68 const Widget_Preview &get_widget() const {return preview;}
70 virtual void on_hide();
71 //other forwarding functions...
72 }; // END of Dialog_Preview
74 class Dialog_PreviewOptions : public Gtk::Dialog
76 //all the info needed to construct a render description...
77 Gtk::Adjustment adj_zoom; // factor at which to resize the window...
79 Gtk::Adjustment adj_fps; // how often to take samples of the animation
81 studio::Widget_Time time_begin;
82 studio::Widget_Time time_end;
84 Gtk::CheckButton check_overbegin;
85 Gtk::CheckButton check_overend;
87 DialogSettings settings;
93 void on_cancel_pressed();
96 void on_overbegin_toggle();
97 void on_overend_toggle();
99 sigc::signal<void,const PreviewInfo &> signal_finish_;
101 Dialog_PreviewOptions();
102 ~Dialog_PreviewOptions();
104 float get_zoom() const { return adj_zoom.get_value(); }
105 void set_zoom(float z) { adj_zoom.set_value(z); }
107 float get_fps() const { return adj_fps.get_value(); }
108 void set_fps(float z) { adj_fps.set_value(z); }
110 float get_global_fps() const { return globalfps; }
111 void set_global_fps(float f);
113 synfig::Time get_begintime() const { return time_begin.get_value(); }
114 void set_begintime(const synfig::Time &t) { time_begin.set_value(t); }
116 synfig::Time get_endtime() const { return time_end.get_value(); }
117 void set_endtime(const synfig::Time &t) { time_end.set_value(t); }
119 bool get_begin_override() const { return check_overbegin.get_active(); }
120 void set_begin_override(bool o) { check_overbegin.set_active(o); }
122 bool get_end_override() const { return check_overend.get_active(); }
123 void set_end_override(bool o) { check_overend.set_active(o); }
125 sigc::signal<void,const PreviewInfo &> &signal_finish() {return signal_finish_;}
128 }; // END of namespace studio
130 /* === E N D =============================================================== */