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