synfig-studio  1.0.3
render.h
Go to the documentation of this file.
1 /* === S Y N F I G ========================================================= */
22 /* ========================================================================= */
23 
24 /* === S T A R T =========================================================== */
25 
26 #ifndef __SYNFIG_STUDIO_GTKMM_RENDER_H
27 #define __SYNFIG_STUDIO_GTKMM_RENDER_H
28 
29 /* === H E A D E R S ======================================================= */
30 
31 #include <vector>
32 
33 #include <gtkmm/dialog.h>
34 #include <gtkmm/tooltip.h>
35 #include <gtkmm/table.h>
36 #include <gtkmm/entry.h>
37 #include <gtkmm/adjustment.h>
38 #include <gtkmm/spinbutton.h>
39 #include <gtkmm/checkbutton.h>
40 #include <gtkmm/comboboxtext.h>
41 
42 #include <synfig/string.h>
43 #include <synfig/targetparam.h>
44 #include <synfig/target.h>
45 
47 
48 #include "renddesc.h"
49 
51 
52 /* === M A C R O S ========================================================= */
53 
54 /* === T Y P E D E F S ===================================================== */
55 
56 /* === C L A S S E S & S T R U C T S ======================================= */
57 
58 namespace studio
59 {
60 class AsyncRenderer;
61 
62 class RenderSettings : public Gtk::Dialog
63 {
64  etl::handle<synfigapp::CanvasInterface> canvas_interface_;
65  Widget_RendDesc widget_rend_desc;
66 
67  Gtk::Entry entry_filename;
68 
69  Glib::RefPtr<Gtk::Adjustment> adjustment_quality;
70  Gtk::SpinButton entry_quality;
71 
72  Glib::RefPtr<Gtk::Adjustment> adjustment_antialias;
73  Gtk::SpinButton entry_antialias;
74 
75  Gtk::CheckButton toggle_single_frame;
76  Gtk::CheckButton toggle_extract_alpha;
77 
78  Gtk::ComboBoxText comboboxtext_target;
79  Gtk::Button *tparam_button;
80 
81  std::vector<synfig::String> target_names;
82  synfig::String target_name;
83  synfig::String calculated_target_name;
84  std::vector< std::pair<synfig::TargetAlphaMode,synfig::String> > render_passes;
85 
86  void set_target(synfig::String name);
87 
88  etl::handle<AsyncRenderer> async_renderer;
89 
90  synfig::TargetParam tparam;
91 
92  static std::map<synfig::String, Dialog_TargetParam *> dialog_book;
93 
94 public:
95  RenderSettings(Gtk::Window& parent,etl::handle<synfigapp::CanvasInterface> canvas_interface);
97  void set_entry_filename();
98 
99  //Use to add new param dialog.
100  static void register_dialog(synfig::String target_name, Dialog_TargetParam * dialog)
101  {dialog_book[target_name] = dialog;}
102 
103 private:
104  void on_rend_desc_changed();
105  void on_single_frame_toggle();
106  void on_choose_pressed();
107  void on_render_pressed();
108  void on_cancel_pressed();
109  void on_targetparam_pressed();
110  void submit_next_render_pass();
111  void on_comboboxtext_target_changed();
112  void on_finished();
113 }; // END of class RenderSettings
114 
115 }; // END of namespace studio
116 
117 
118 /* === E N D =============================================================== */
119 
120 #endif