my log
[synfig.git] / synfig-studio / trunk / src / gtkmm / dialog_preview.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file dialog_preview.h
3 **      \brief Preview dialog Header
4 **
5 **      $Id: dialog_preview.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SYNFIG_GTKMM_DIALOG_PREVIEW_H
25 #define __SYNFIG_GTKMM_DIALOG_PREVIEW_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <gtkmm/adjustment.h>
30 #include <gtkmm/dialog.h>
31 #include <gtkmm/menu.h>
32 #include <gtkmm/spinbutton.h>
33 #include <gtkmm/dialogsettings.h>
34
35 #include "preview.h"
36 #include <gtkmm/widget_time.h>
37
38 /* === M A C R O S ========================================================= */
39
40 /* === T Y P E D E F S ===================================================== */
41
42
43 /* === C L A S S E S & S T R U C T S ======================================= */
44
45 namespace studio {
46
47 struct PreviewInfo
48 {
49         float zoom,fps,begintime,endtime;
50         bool overbegin,overend;
51 };
52
53 class Dialog_Preview : public Gtk::Dialog
54 {
55         Widget_Preview  preview;
56         DialogSettings  settings;
57         
58         //etl::handle<synfig::Canvas> canvas;
59                         
60 public:
61         Dialog_Preview();
62         ~Dialog_Preview();
63
64     void set_preview(etl::handle<Preview> prev);
65
66         Widget_Preview &get_widget() {return preview;}
67         const Widget_Preview &get_widget() const {return preview;}
68
69         virtual void on_hide();
70         //other forwarding functions...
71 }; // END of Dialog_Preview
72
73 class Dialog_PreviewOptions : public Gtk::Dialog
74 {
75         //all the info needed to construct a render description...      
76         Gtk::Adjustment adj_zoom;       // factor at which to resize the window...
77         
78         Gtk::Adjustment adj_fps;        // how often to take samples of the animation
79         
80         studio::Widget_Time time_begin;
81         studio::Widget_Time time_end;
82                         
83         Gtk::CheckButton check_overbegin;
84         Gtk::CheckButton check_overend;
85         
86         DialogSettings  settings;
87         
88         float   globalfps;
89         
90         // for finishing
91         void on_ok_pressed();
92         
93         //for ui stuff
94         void on_overbegin_toggle();
95         void on_overend_toggle();
96         
97         sigc::signal<void,const PreviewInfo &>  signal_finish_;
98 public:
99         Dialog_PreviewOptions();
100         ~Dialog_PreviewOptions();
101
102         float get_zoom() const { return adj_zoom.get_value(); }
103         void set_zoom(float z) { adj_zoom.set_value(z); }
104         
105         float get_fps() const { return adj_fps.get_value(); }
106         void set_fps(float z) { adj_fps.set_value(z); }
107         
108         float get_global_fps() const { return globalfps; }
109         void set_global_fps(float f);
110         
111         synfig::Time get_begintime() const { return time_begin.get_value(); }
112         void set_begintime(const synfig::Time &t) { time_begin.set_value(t); }
113         
114         synfig::Time get_endtime() const { return time_end.get_value(); }
115         void set_endtime(const synfig::Time &t) { time_end.set_value(t); }
116         
117         bool get_begin_override() const { return check_overbegin.get_active(); }
118         void set_begin_override(bool o) { check_overbegin.set_active(o); }
119         
120         bool get_end_override() const { return check_overend.get_active(); }
121         void set_end_override(bool o) { check_overend.set_active(o); }
122         
123         sigc::signal<void,const PreviewInfo &>  &signal_finish() {return signal_finish_;}
124 };
125
126 }; // END of namespace studio
127
128 /* === E N D =============================================================== */
129
130 #endif