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