Fix a crash when running single-threaded and dragging the time slider.
[synfig.git] / synfig-studio / trunk / src / gtkmm / renddesc.cpp
1 /* === S Y N F I G ========================================================= */
2 /*!     \file gtkmm/renddesc.cpp
3 **      \brief Template File
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **      Copyright (c) 2007 Chris Moore
10 **
11 **      This package is free software; you can redistribute it and/or
12 **      modify it under the terms of the GNU General Public License as
13 **      published by the Free Software Foundation; either version 2 of
14 **      the License, or (at your option) any later version.
15 **
16 **      This package is distributed in the hope that it will be useful,
17 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
18 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 **      General Public License for more details.
20 **      \endlegal
21 */
22 /* ========================================================================= */
23
24 /* === H E A D E R S ======================================================= */
25
26 #ifdef USING_PCH
27 #       include "pch.h"
28 #else
29 #ifdef HAVE_CONFIG_H
30 #       include <config.h>
31 #endif
32
33 #include "renddesc.h"
34 #include <gtkmm/label.h>
35 #include <gtkmm/frame.h>
36 #include <gtkmm/alignment.h>
37 #include <gtkmm/box.h>
38 #include <ETL/misc>
39 #include <synfig/general.h>
40 //#include <gtkmm/separator.h>
41
42 #endif
43
44 /* === U S I N G =========================================================== */
45
46 using namespace std;
47 using namespace etl;
48 using namespace synfig;
49 using namespace studio;
50
51 /* === M A C R O S ========================================================= */
52
53 #ifndef SYNFIG_MAX_PIXEL_WIDTH
54 #define SYNFIG_MAX_PIXEL_WIDTH  (~(1<<31))
55 #endif
56
57 #ifndef SYNFIG_MAX_PIXEL_HEIGHT
58 #define SYNFIG_MAX_PIXEL_HEIGHT (~(1<<31))
59 #endif
60
61 #if ! defined(_)
62 #define _(x)    (x)
63 #endif
64
65 #ifndef DPM2DPI
66 #define DPM2DPI(x)      ((x)/39.3700787402)
67 #define DPI2DPM(x)      ((x)*39.3700787402)
68 #endif
69
70 #ifndef METERS2INCHES
71 #define METERS2INCHES(x)        ((x)*39.3700787402)
72 #define INCHES2METERS(x)        ((x)/39.3700787402)
73 #endif
74
75 /* === G L O B A L S ======================================================= */
76
77 /* === P R O C E D U R E S ================================================= */
78
79 /* === M E T H O D S ======================================================= */
80
81 Widget_RendDesc::Widget_RendDesc():
82         Gtk::Notebook(),
83         adjustment_width(1,1,SYNFIG_MAX_PIXEL_WIDTH),
84         adjustment_height(1,1,SYNFIG_MAX_PIXEL_HEIGHT),
85         adjustment_xres(0,0.0000000001,10000000),
86         adjustment_yres(0,0.0000000001,10000000),
87         adjustment_phy_width(0,0.0000000001,10000000),
88         adjustment_phy_height(0,0.0000000001,10000000),
89         adjustment_fps(0,0.0000000001,10000000),
90         adjustment_span(0,0.0000000001,10000000)
91 {
92         update_lock=0;
93
94         create_widgets();
95         connect_signals();
96
97         Gtk::Label *image_tab_label = manage(new Gtk::Label(_("Image")));
98         Gtk::Label *time_tab_label = manage(new Gtk::Label(_("Time")));
99         Gtk::Label *other_tab_label = manage(new Gtk::Label(_("Other")));
100         Gtk::Widget *imageTab = create_image_tab();
101         Gtk::Widget *timeTab = create_time_tab();
102         Gtk::Widget *otherTab = create_other_tab();
103         append_page(*imageTab, *image_tab_label);
104         append_page(*timeTab, *time_tab_label);
105         append_page(*otherTab, *other_tab_label);
106 }
107
108 Widget_RendDesc::~Widget_RendDesc()
109 {
110 }
111
112 void Widget_RendDesc::set_rend_desc(const synfig::RendDesc &rend_desc)
113 {
114         if(update_lock)return;
115
116         rend_desc_=rend_desc;
117         refresh();
118 }
119
120 void
121 Widget_RendDesc::refresh()
122 {
123         UpdateLock lock(update_lock);
124         adjustment_width.set_value(rend_desc_.get_w());
125         adjustment_height.set_value(rend_desc_.get_h());
126         adjustment_phy_width.set_value(METERS2INCHES(rend_desc_.get_physical_w()));
127         adjustment_phy_height.set_value(METERS2INCHES(rend_desc_.get_physical_h()));
128         adjustment_xres.set_value(DPM2DPI(rend_desc_.get_x_res()));
129         adjustment_yres.set_value(DPM2DPI(rend_desc_.get_y_res()));
130         entry_start_time->set_fps(rend_desc_.get_frame_rate());
131         entry_start_time->set_value(rend_desc_.get_time_start());
132         entry_end_time->set_fps(rend_desc_.get_frame_rate());
133         entry_end_time->set_value(rend_desc_.get_time_end());
134
135         adjustment_fps.set_value(rend_desc_.get_frame_rate());
136         adjustment_span.set_value(rend_desc_.get_span());
137         entry_tl->set_value(rend_desc_.get_tl());
138         entry_br->set_value(rend_desc_.get_br());
139         entry_focus->set_value(rend_desc_.get_focus());
140
141         toggle_px_aspect->set_active((bool)(rend_desc_.get_flags()&RendDesc::PX_ASPECT));
142         toggle_px_width->set_active((bool)(rend_desc_.get_flags()&RendDesc::PX_W));
143         toggle_px_height->set_active((bool)(rend_desc_.get_flags()&RendDesc::PX_H));
144
145         toggle_im_aspect->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_ASPECT));
146         toggle_im_width->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_W));
147         toggle_im_height->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_H));
148         toggle_im_span->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_SPAN));
149 }
150
151 void Widget_RendDesc::apply_rend_desc(const synfig::RendDesc &rend_desc)
152 {
153         set_rend_desc(rend_desc);
154 }
155
156 const synfig::RendDesc &
157 Widget_RendDesc::get_rend_desc()
158 {
159         return rend_desc_;
160 }
161
162 void
163 Widget_RendDesc::on_width_changed()
164 {
165         if(update_lock)return;
166         UpdateLock lock(update_lock);
167         rend_desc_.set_w(round_to_int(adjustment_width.get_value()));
168         refresh();
169         signal_changed()();
170 }
171
172 void
173 Widget_RendDesc::on_lock_changed()
174 {
175         if(update_lock)return;
176         UpdateLock lock(update_lock);
177
178 #define DO_TOGGLE(x,y)  if(toggle_ ## x->get_active()) \
179                 rend_desc_.set_flags(rend_desc_.get_flags()|RendDesc:: y); \
180         else \
181                 rend_desc_.set_flags(rend_desc_.get_flags()&~RendDesc:: y)
182
183         DO_TOGGLE(px_aspect,PX_ASPECT);
184         DO_TOGGLE(px_width,PX_W);
185         DO_TOGGLE(px_height,PX_H);
186
187         DO_TOGGLE(im_aspect,IM_ASPECT);
188         DO_TOGGLE(im_width,IM_W);
189         DO_TOGGLE(im_height,IM_H);
190         DO_TOGGLE(im_span,IM_SPAN);
191
192 #undef DO_TOGGLE
193
194         refresh();
195         signal_changed()();
196 }
197
198 void
199 Widget_RendDesc::on_height_changed()
200 {
201         if(update_lock)return;
202         UpdateLock lock(update_lock);
203         rend_desc_.set_h(round_to_int(adjustment_height.get_value()));
204         refresh();
205         signal_changed()();
206 }
207
208 void
209 Widget_RendDesc::on_phy_width_changed()
210 {
211         if(update_lock)return;
212         UpdateLock lock(update_lock);
213         rend_desc_.set_physical_w(INCHES2METERS(adjustment_phy_width.get_value()));
214         refresh();
215         signal_changed()();
216 }
217
218 void
219 Widget_RendDesc::on_phy_height_changed()
220 {
221         if(update_lock)return;
222         UpdateLock lock(update_lock);
223         rend_desc_.set_physical_h(INCHES2METERS(adjustment_phy_height.get_value()));
224         refresh();
225         signal_changed()();
226 }
227
228 void
229 Widget_RendDesc::on_xres_changed()
230 {
231         if(update_lock)return;
232         UpdateLock lock(update_lock);
233         rend_desc_.set_x_res(DPI2DPM(adjustment_xres.get_value()));
234         refresh();
235         signal_changed()();
236 }
237
238 void
239 Widget_RendDesc::on_yres_changed()
240 {
241         if(update_lock)return;
242         UpdateLock lock(update_lock);
243         rend_desc_.set_y_res(DPI2DPM(adjustment_yres.get_value()));
244         refresh();
245         signal_changed()();
246 }
247
248 void
249 Widget_RendDesc::on_start_time_changed()
250 {
251         if(update_lock)return;
252         UpdateLock lock(update_lock);
253         rend_desc_.set_time_start(entry_start_time->get_value());
254         refresh();
255         signal_changed()();
256 }
257
258 void
259 Widget_RendDesc::on_end_time_changed()
260 {
261         if(update_lock)return;
262         UpdateLock lock(update_lock);
263         rend_desc_.set_time_end(entry_end_time->get_value());
264         refresh();
265         signal_changed()();
266 }
267
268 /*
269 void
270 Widget_RendDesc::on_start_frame_changed()
271 {
272         if(update_lock)return;
273         UpdateLock lock(update_lock);
274         rend_desc_.set_frame_start((int)(adjustment_start_frame.get_value()+0.5));
275         refresh();
276         signal_changed()();
277 }
278
279 void
280 Widget_RendDesc::on_end_frame_changed()
281 {
282         if(update_lock)return;
283         UpdateLock lock(update_lock);
284         rend_desc_.set_frame_end((int)(adjustment_end_frame.get_value()+0.5));
285         refresh();
286         signal_changed()();
287 }
288 */
289
290 void
291 Widget_RendDesc::on_fps_changed()
292 {
293         if(update_lock)return;
294         UpdateLock lock(update_lock);
295         rend_desc_.set_frame_rate((int)(adjustment_fps.get_value()+0.5));
296         refresh();
297         signal_changed()();
298 }
299
300 void
301 Widget_RendDesc::on_tl_changed()
302 {
303         if(update_lock)return;
304         UpdateLock lock(update_lock);
305         rend_desc_.set_tl(entry_tl->get_value());
306         refresh();
307         signal_changed()();
308 }
309
310 void
311 Widget_RendDesc::on_br_changed()
312 {
313         if(update_lock)return;
314         UpdateLock lock(update_lock);
315         rend_desc_.set_br(entry_br->get_value());
316         refresh();
317         signal_changed()();
318 }
319
320 void
321 Widget_RendDesc::on_focus_changed()
322 {
323         if(update_lock)return;
324         UpdateLock lock(update_lock);
325         rend_desc_.set_focus(entry_focus->get_value());
326         refresh();
327         signal_changed()();
328 }
329
330 void
331 Widget_RendDesc::on_span_changed()
332 {
333         if(update_lock)return;
334         UpdateLock lock(update_lock);
335         rend_desc_.set_span(adjustment_span.get_value());
336         refresh();
337         signal_changed()();
338 }
339
340 void
341 Widget_RendDesc::disable_time_section()
342 {
343         time_frame->set_sensitive(false);
344
345 /*
346         Gtk::Table::TableList &list=time_table->children();
347         Gtk::Table::TableList::iterator iter;
348         for(iter=list.begin();iter!=list.end();iter++)
349                 iter->get_widget()->set_sensitive(false);
350 */
351 }
352
353 void
354 Widget_RendDesc::enable_time_section()
355 {
356         time_frame->set_sensitive(true);
357
358 /*
359         Gtk::Table::TableList &list=time_table->children();
360         Gtk::Table::TableList::iterator iter;
361         for(iter=list.begin();iter!=list.end();iter++)
362                 iter->get_widget()->set_sensitive(true);
363
364 */
365 }
366
367 void
368 Widget_RendDesc::create_widgets()
369 {
370         entry_width=manage(new Gtk::SpinButton(adjustment_width,1,0));
371         entry_width->set_alignment(1);
372         entry_height=manage(new Gtk::SpinButton(adjustment_height,1,0));
373         entry_height->set_alignment(1);
374         entry_xres=manage(new Gtk::SpinButton(adjustment_xres,0.5,1));
375         entry_xres->set_alignment(1);
376         entry_yres=manage(new Gtk::SpinButton(adjustment_yres,0.5,1));
377         entry_yres->set_alignment(1);
378         entry_phy_width=manage(new Gtk::SpinButton(adjustment_phy_width,0.25,2));
379         entry_phy_width->set_alignment(1);
380         entry_phy_height=manage(new Gtk::SpinButton(adjustment_phy_height,0.25,2));
381         entry_phy_height->set_alignment(1);
382         entry_span=manage(new Gtk::SpinButton(adjustment_span,0.1,4));
383         entry_span->set_alignment(1);
384         entry_tl=manage(new Widget_Vector());
385         entry_br=manage(new Widget_Vector());
386         entry_fps=manage(new Gtk::SpinButton(adjustment_fps,1,5));
387         entry_start_time=manage(new Widget_Time());
388         entry_end_time=manage(new Widget_Time());
389         //entry_start_frame=manage(new Gtk::SpinButton(adjustment_start_frame,1,0));
390         //entry_end_frame=manage(new Gtk::SpinButton(adjustment_end_frame,1,0));
391         entry_focus=manage(new Widget_Vector());
392         toggle_px_aspect=manage(new Gtk::CheckButton(_("_Pixel Aspect"), true));
393         toggle_px_aspect->set_alignment(0, 0.5);
394         toggle_px_width=manage(new Gtk::CheckButton(_("Pi_xel Width"), true));
395         toggle_px_width->set_alignment(0, 0.5);
396         toggle_px_height=manage(new Gtk::CheckButton(_("Pix_el Height"), true));
397         toggle_px_height->set_alignment(0, 0.5);
398         toggle_im_aspect=manage(new Gtk::CheckButton(_("Image _Aspect"), true));
399         toggle_im_aspect->set_alignment(0, 0.5);
400         toggle_im_width=manage(new Gtk::CheckButton(_("Image _Width"), true));
401         toggle_im_width->set_alignment(0, 0.5);
402         toggle_im_height=manage(new Gtk::CheckButton(_("Image _Height"), true));
403         toggle_im_height->set_alignment(0, 0.5);
404         toggle_im_span=manage(new Gtk::CheckButton(_("Image _Span"), true));
405         toggle_im_span->set_alignment(0, 0.5);
406         time_frame=manage(new Gtk::Frame(_("Time")));
407 }
408
409 void
410 Widget_RendDesc::connect_signals()
411 {
412         entry_width->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_width_changed));
413         entry_height->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_height_changed));
414         entry_xres->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_xres_changed));
415         entry_yres->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_yres_changed));
416         entry_phy_width->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_phy_width_changed));
417         entry_phy_height->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_phy_height_changed));
418         entry_span->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_span_changed));
419         entry_tl->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_tl_changed));
420         entry_br->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_br_changed));
421         entry_fps->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_fps_changed));
422         entry_start_time->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_start_time_changed));
423         entry_end_time->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_end_time_changed));
424         //entry_start_frame->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_start_frame_changed));
425         //entry_end_frame->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_end_frame_changed));
426         entry_focus->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_focus_changed));
427         toggle_px_aspect->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
428         toggle_px_width->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
429         toggle_px_height->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
430         toggle_im_aspect->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
431         toggle_im_width->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
432         toggle_im_height->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
433         toggle_im_span->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
434 }
435
436 Gtk::Widget *
437 Widget_RendDesc::create_image_tab()
438 {
439         Gtk::Alignment *paddedPanel = manage(new Gtk::Alignment(0, 0, 1, 1));
440         paddedPanel->set_padding(12, 12, 12, 12);
441
442         Gtk::VBox *panelBox = manage(new Gtk::VBox(false, 12));
443         paddedPanel->add(*panelBox);
444
445         Gtk::Frame *imageFrame = manage(new Gtk::Frame(_("Image Size")));
446         imageFrame->set_shadow_type(Gtk::SHADOW_NONE);
447         ((Gtk::Label *) imageFrame->get_label_widget())->set_markup(_("<b>Image Size</b>"));
448         panelBox->pack_start(*imageFrame, false, false, 0);
449
450         Gtk::Alignment *tablePadding = manage(new Gtk::Alignment(0, 0, 1, 1));
451         tablePadding->set_padding(6, 0, 24, 0);
452         Gtk::Table *imageSizeTable = manage(new Gtk::Table(2, 6, false));
453         imageSizeTable->set_row_spacings(6);
454         imageSizeTable->set_col_spacings(12);
455         tablePadding->add(*imageSizeTable);
456         imageFrame->add(*tablePadding);
457
458         Gtk::Label *size_width_label = manage(new Gtk::Label(_("_Width"), 0, 0.5, true));
459         size_width_label->set_mnemonic_widget(*entry_width);
460
461         Gtk::Label *size_height_label = manage(new Gtk::Label(_("_Height"), 0, 0.5, true));
462         size_height_label->set_mnemonic_widget(*entry_height);
463
464         Gtk::Label *size_xres_label = manage(new Gtk::Label(_("_XRes"), 0, 0.5, true));
465         size_xres_label->set_mnemonic_widget(*entry_xres);
466
467         Gtk::Label *size_yres_label = manage(new Gtk::Label(_("_YRes"), 0, 0.5, true));
468         size_yres_label->set_mnemonic_widget(*entry_yres);
469
470         Gtk::Label *size_physwidth_label = manage(new Gtk::Label(_("_Physical Width"), 0, 0.5, true));
471         size_physwidth_label->set_mnemonic_widget(*entry_phy_width);
472
473         Gtk::Label *size_physheight_label = manage(new Gtk::Label(_("Phy_sical Height"), 0, 0.5, true));
474         size_physheight_label->set_mnemonic_widget(*entry_phy_height);
475
476         Gtk::Label *size_span = manage(new Gtk::Label(_("I_mage Span"), 0, 0.5, true));
477         size_span->set_mnemonic_widget(*entry_span);
478
479         imageSizeTable->attach(*size_width_label, 0, 1, 0, 1, Gtk::SHRINK|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
480         imageSizeTable->attach(*size_height_label, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
481         imageSizeTable->attach(*entry_width, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
482         imageSizeTable->attach(*entry_height, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
483
484         imageSizeTable->attach(*size_xres_label, 2, 3, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
485         imageSizeTable->attach(*size_yres_label, 2, 3, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
486         imageSizeTable->attach(*entry_xres, 3, 4, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
487         imageSizeTable->attach(*entry_yres, 3, 4, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
488
489         imageSizeTable->attach(*size_physwidth_label, 4, 5, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
490         imageSizeTable->attach(*size_physheight_label, 4, 5, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
491         imageSizeTable->attach(*entry_phy_width, 5, 6, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
492         imageSizeTable->attach(*entry_phy_height, 5, 6, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
493
494         imageSizeTable->attach(*size_span, 0, 1, 2, 3, Gtk::SHRINK|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
495         imageSizeTable->attach(*entry_span, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
496
497         Gtk::Frame *imageAreaFrame = manage(new Gtk::Frame(_("Image Area")));
498         imageAreaFrame->set_shadow_type(Gtk::SHADOW_NONE);
499         ((Gtk::Label *) imageAreaFrame->get_label_widget())->set_markup(_("<b>Image Area</b>"));
500         panelBox->pack_start(*imageAreaFrame, false, false, 0);
501
502         Gtk::Alignment *imageAreaPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
503         imageAreaPadding->set_padding(6, 0, 24, 0);
504         imageAreaFrame->add(*imageAreaPadding);
505
506         Gtk::Table *imageAreaTable = manage(new Gtk::Table(2, 2, false));
507         imageAreaTable->set_row_spacings(6);
508         imageAreaTable->set_col_spacings(12);
509         imageAreaPadding->add(*imageAreaTable);
510
511         Gtk::Label *imageAreaTopLeftLabel = manage(new Gtk::Label(_("_Top Left"), 0, 0.5, true));
512         imageAreaTopLeftLabel->set_mnemonic_widget(*entry_tl);
513
514         Gtk::Label *imageAreaBottomRightLabel = manage(new Gtk::Label(_("_Bottom Right"), 0, 0.5, true));
515         imageAreaBottomRightLabel->set_mnemonic_widget(*entry_br);
516
517         imageAreaTable->attach(*imageAreaTopLeftLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
518         imageAreaTable->attach(*imageAreaBottomRightLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
519         imageAreaTable->attach(*entry_tl, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
520         imageAreaTable->attach(*entry_br, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
521
522         paddedPanel->show_all();
523         return paddedPanel;
524 }
525
526 Gtk::Widget *
527 Widget_RendDesc::create_time_tab()
528 {
529         Gtk::Alignment *paddedPanel = manage(new Gtk::Alignment(0, 0, 1, 1));
530         paddedPanel->set_padding(12, 12, 12, 12);
531
532         Gtk::VBox *panelBox = manage(new Gtk::VBox(false, 12)); // for future widgets
533         paddedPanel->add(*panelBox);
534
535         Gtk::Frame *time_frame = manage(new Gtk::Frame("Time Settings"));
536         time_frame->set_shadow_type(Gtk::SHADOW_NONE);
537         ((Gtk::Label *) time_frame->get_label_widget())->set_markup("<b>Time Settings</b>");
538         panelBox->pack_start(*time_frame, false, false, 0);
539
540         Gtk::Alignment *timeFramePadding = manage(new Gtk::Alignment(0, 0, 1, 1));
541         timeFramePadding->set_padding(6, 0, 24, 0);
542         time_frame->add(*timeFramePadding);
543
544         Gtk::Table *timeFrameTable = manage(new Gtk::Table(3, 2, false));
545         timeFrameTable->set_row_spacings(6);
546         timeFrameTable->set_col_spacings(12);
547         timeFramePadding->add(*timeFrameTable);
548
549         Gtk::Label *timeFPSLabel = manage(new Gtk::Label(_("_Frames per second"), 0, 0.5, true));
550         timeFPSLabel->set_mnemonic_widget(*entry_fps);
551         timeFrameTable->attach(*timeFPSLabel, 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
552         timeFrameTable->attach(*entry_fps, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
553
554         Gtk::Label *timeStartLabel = manage(new Gtk::Label(_("_Start Time"), 0, 0.5, true));
555         timeStartLabel->set_mnemonic_widget(*entry_start_time);
556         timeFrameTable->attach(*timeStartLabel, 0, 1, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
557         timeFrameTable->attach(*entry_start_time, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
558
559         Gtk::Label *timeEndLabel = manage(new Gtk::Label(_("_End Time"), 0, 0.5, true));
560         timeEndLabel->set_mnemonic_widget(*entry_end_time);
561         timeFrameTable->attach(*timeEndLabel, 0, 1, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
562         timeFrameTable->attach(*entry_end_time, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
563
564         paddedPanel->show_all();
565         return paddedPanel;
566 }
567
568 Gtk::Widget *
569 Widget_RendDesc::create_other_tab()
570 {
571         Gtk::Alignment *paddedPanel = manage(new Gtk::Alignment(0, 0, 1, 1));
572         paddedPanel->set_padding(12, 12, 12, 12);
573
574         Gtk::VBox *panelBox = manage(new Gtk::VBox(false, 12));
575         paddedPanel->add(*panelBox);
576
577         Gtk::Frame *lockFrame = manage(new Gtk::Frame(_("Locks and Links")));
578         lockFrame->set_shadow_type(Gtk::SHADOW_NONE);
579         ((Gtk::Label *) lockFrame->get_label_widget())->set_markup(_("<b>Locks and Links</b>"));
580         panelBox->pack_start(*lockFrame, false, false, 0);
581
582         Gtk::Alignment *lockPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
583         lockPadding->set_padding(6, 0, 24, 0);
584         lockFrame->add(*lockPadding);
585
586         Gtk::Table *lockTable = manage(new Gtk::Table(2, 4, false));
587         lockTable->set_row_spacings(6);
588         lockTable->set_col_spacings(12);
589         lockPadding->add(*lockTable);
590
591         lockTable->attach(*toggle_im_width, 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
592         lockTable->attach(*toggle_im_height, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
593         lockTable->attach(*toggle_im_aspect, 2, 3, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
594         lockTable->attach(*toggle_im_span, 3, 4, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
595
596         lockTable->attach(*toggle_px_width, 0, 1, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
597         lockTable->attach(*toggle_px_height, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
598         lockTable->attach(*toggle_px_aspect, 2, 3, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
599
600         Gtk::Frame *focusFrame = manage(new Gtk::Frame(_("Focus Point")));
601         focusFrame->set_shadow_type(Gtk::SHADOW_NONE);
602         ((Gtk::Label *) focusFrame->get_label_widget())->set_markup(_("<b>Focus Point</b>"));
603         panelBox->pack_start(*focusFrame, false, false, 0);
604
605         Gtk::Alignment *focusPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
606         focusPadding->set_padding(6, 0, 24, 0);
607         focusFrame->add(*focusPadding);
608
609         Gtk::HBox *focusBox = manage(new Gtk::HBox(false, 12));
610         focusPadding->add(*focusBox);
611
612         Gtk::Label *focusLabel = manage(new Gtk::Label(_("_Focus Point"), 0, 0.5, true));
613         focusLabel->set_mnemonic_widget(*entry_focus);
614         focusBox->pack_start(*focusLabel, false, false, 0);
615         focusBox->pack_start(*entry_focus, true, true, 0);
616
617         paddedPanel->show_all();
618         return paddedPanel;
619 }
620
621 /*
622  * vim:ts=4:sw=4
623  */