source: synfigstudio/trunk/fuentes/src/gui/renddesc.cpp @ 481

Last change on this file since 481 was 481, checked in by jrpelegrina, 5 years ago

First release to xenial

File size: 23.1 KB
Line 
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**  Copyright (c) 2010 Carlos López
11**
12**      This package is free software; you can redistribute it and/or
13**      modify it under the terms of the GNU General Public License as
14**      published by the Free Software Foundation; either version 2 of
15**      the License, or (at your option) any later version.
16**
17**      This package is distributed in the hope that it will be useful,
18**      but WITHOUT ANY WARRANTY; without even the implied warranty of
19**      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20**      General Public License for more details.
21**      \endlegal
22*/
23/* ========================================================================= */
24
25/* === H E A D E R S ======================================================= */
26
27#ifdef USING_PCH
28#       include "pch.h"
29#else
30#ifdef HAVE_CONFIG_H
31#       include <config.h>
32#endif
33
34#include "renddesc.h"
35#include <gtkmm/label.h>
36#include <gtkmm/frame.h>
37#include <gtkmm/alignment.h>
38#include <gtkmm/box.h>
39#include <gtkmm/grid.h>
40#include <ETL/misc>
41#include <synfig/general.h>
42//#include <gtkmm/separator.h>
43
44#include "general.h"
45
46#endif
47
48/* === U S I N G =========================================================== */
49
50using namespace std;
51using namespace etl;
52using namespace synfig;
53using namespace studio;
54
55/* === M A C R O S ========================================================= */
56
57#ifndef SYNFIG_MAX_PIXEL_WIDTH
58#define SYNFIG_MAX_PIXEL_WIDTH  (~(1<<31))
59#endif
60
61#ifndef SYNFIG_MAX_PIXEL_HEIGHT
62#define SYNFIG_MAX_PIXEL_HEIGHT (~(1<<31))
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
81Widget_RendDesc::Widget_RendDesc():
82        Gtk::Notebook(),
83        adjustment_width(Gtk::Adjustment::create(1,1,SYNFIG_MAX_PIXEL_WIDTH)),
84        adjustment_height(Gtk::Adjustment::create(1,1,SYNFIG_MAX_PIXEL_HEIGHT)),
85        adjustment_xres(Gtk::Adjustment::create(0,0.0000000001,10000000)),
86        adjustment_yres(Gtk::Adjustment::create(0,0.0000000001,10000000)),
87        adjustment_phy_width(Gtk::Adjustment::create(0,0.0000000001,10000000)),
88        adjustment_phy_height(Gtk::Adjustment::create(0,0.0000000001,10000000)),
89        adjustment_fps(Gtk::Adjustment::create(0,0.0000000001,10000000)),
90        adjustment_span(Gtk::Adjustment::create(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
108Widget_RendDesc::~Widget_RendDesc()
109{
110}
111
112void 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
120void
121Widget_RendDesc::refresh()
122{
123        UpdateLock lock(update_lock);
124        //Image Tab
125        adjustment_width->set_value(rend_desc_.get_w());
126        adjustment_height->set_value(rend_desc_.get_h());
127        adjustment_phy_width->set_value(METERS2INCHES(rend_desc_.get_physical_w()));
128        adjustment_phy_height->set_value(METERS2INCHES(rend_desc_.get_physical_h()));
129        adjustment_xres->set_value(DPM2DPI(rend_desc_.get_x_res()));
130        adjustment_yres->set_value(DPM2DPI(rend_desc_.get_y_res()));
131        toggle_wh_ratio->set_active((bool)(rend_desc_.get_flags()&RendDesc::LINK_IM_ASPECT));
132        toggle_res_ratio->set_active((bool)(rend_desc_.get_flags()&RendDesc::LINK_RES));
133
134        int w_ratio, h_ratio;
135        rend_desc_.get_pixel_ratio_reduced(w_ratio, h_ratio);
136        std::ostringstream px_ratio_str;
137        px_ratio_str << _("Image Size Ratio : ") << w_ratio << '/' << h_ratio;
138        pixel_ratio_label->set_label(px_ratio_str.str());
139
140        entry_tl->set_value(rend_desc_.get_tl());
141        entry_br->set_value(rend_desc_.get_br());
142        adjustment_span->set_value(rend_desc_.get_span());
143
144        //Time Tab
145        entry_start_time->set_fps(rend_desc_.get_frame_rate());
146        entry_start_time->set_value(rend_desc_.get_time_start());
147        entry_end_time->set_fps(rend_desc_.get_frame_rate());
148        entry_end_time->set_value(rend_desc_.get_time_end());
149        entry_duration->set_fps(rend_desc_.get_frame_rate());
150        entry_duration->set_value(rend_desc_.get_duration());
151
152        adjustment_fps->set_value(rend_desc_.get_frame_rate());
153
154        //Other Tab
155        toggle_px_aspect->set_active((bool)(rend_desc_.get_flags()&RendDesc::PX_ASPECT));
156        toggle_px_width->set_active((bool)(rend_desc_.get_flags()&RendDesc::PX_W));
157        toggle_px_height->set_active((bool)(rend_desc_.get_flags()&RendDesc::PX_H));
158
159        toggle_im_aspect->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_ASPECT));
160        toggle_im_width->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_W));
161        toggle_im_height->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_H));
162        toggle_im_span->set_active((bool)(rend_desc_.get_flags()&RendDesc::IM_SPAN));
163        entry_focus->set_value(rend_desc_.get_focus());
164}
165
166void Widget_RendDesc::apply_rend_desc(const synfig::RendDesc &rend_desc)
167{
168        set_rend_desc(rend_desc);
169}
170
171const synfig::RendDesc &
172Widget_RendDesc::get_rend_desc()
173{
174        return rend_desc_;
175}
176
177void
178Widget_RendDesc::on_width_changed()
179{
180        if(update_lock)return;
181        UpdateLock lock(update_lock);
182        rend_desc_.set_w(round_to_int(adjustment_width->get_value()));
183        refresh();
184        signal_changed()();
185}
186
187void
188Widget_RendDesc::on_lock_changed()
189{
190        if(update_lock)return;
191        UpdateLock lock(update_lock);
192
193#define DO_TOGGLE(x,y)  if(toggle_ ## x->get_active()) \
194                rend_desc_.set_flags(rend_desc_.get_flags()|RendDesc:: y); \
195        else \
196                rend_desc_.set_flags(rend_desc_.get_flags()&~RendDesc:: y)
197
198        DO_TOGGLE(px_aspect,PX_ASPECT);
199        DO_TOGGLE(px_width,PX_W);
200        DO_TOGGLE(px_height,PX_H);
201
202        DO_TOGGLE(im_aspect,IM_ASPECT);
203        DO_TOGGLE(im_width,IM_W);
204        DO_TOGGLE(im_height,IM_H);
205        DO_TOGGLE(im_span,IM_SPAN);
206
207#undef DO_TOGGLE
208
209        refresh();
210        signal_changed()();
211}
212
213void
214Widget_RendDesc::on_height_changed()
215{
216        if(update_lock)return;
217        UpdateLock lock(update_lock);
218        rend_desc_.set_h(round_to_int(adjustment_height->get_value()));
219        refresh();
220        signal_changed()();
221}
222
223void
224Widget_RendDesc::on_phy_width_changed()
225{
226        if(update_lock)return;
227        UpdateLock lock(update_lock);
228        rend_desc_.set_physical_w(INCHES2METERS(adjustment_phy_width->get_value()));
229        refresh();
230        signal_changed()();
231}
232
233void
234Widget_RendDesc::on_phy_height_changed()
235{
236        if(update_lock)return;
237        UpdateLock lock(update_lock);
238        rend_desc_.set_physical_h(INCHES2METERS(adjustment_phy_height->get_value()));
239        refresh();
240        signal_changed()();
241}
242
243void
244Widget_RendDesc::on_xres_changed()
245{
246        if(update_lock)return;
247        UpdateLock lock(update_lock);
248        rend_desc_.set_x_res(DPI2DPM(adjustment_xres->get_value()));
249        refresh();
250        signal_changed()();
251}
252
253void
254Widget_RendDesc::on_yres_changed()
255{
256        if(update_lock)return;
257        UpdateLock lock(update_lock);
258        rend_desc_.set_y_res(DPI2DPM(adjustment_yres->get_value()));
259        refresh();
260        signal_changed()();
261}
262
263void
264Widget_RendDesc::on_start_time_changed()
265{
266        if(update_lock)return;
267        UpdateLock lock(update_lock);
268        rend_desc_.set_time_start(entry_start_time->get_value());
269        refresh();
270        signal_changed()();
271}
272
273void
274Widget_RendDesc::on_end_time_changed()
275{
276        if(update_lock)return;
277        UpdateLock lock(update_lock);
278        rend_desc_.set_time_end(entry_end_time->get_value());
279        refresh();
280        signal_changed()();
281}
282
283
284void
285Widget_RendDesc::on_duration_changed()
286{
287        if(update_lock)return;
288        UpdateLock lock(update_lock);
289        rend_desc_.set_duration(entry_duration->get_value());
290        refresh();
291        signal_changed()();
292}
293
294void
295Widget_RendDesc::on_fps_changed()
296{
297        if(update_lock)return;
298        UpdateLock lock(update_lock);
299        rend_desc_.set_frame_rate(adjustment_fps->get_value());
300        refresh();
301        signal_changed()();
302}
303
304void
305Widget_RendDesc::on_tl_changed()
306{
307        if(update_lock)return;
308        UpdateLock lock(update_lock);
309        rend_desc_.set_tl(entry_tl->get_value());
310        refresh();
311        signal_changed()();
312}
313
314void
315Widget_RendDesc::on_br_changed()
316{
317        if(update_lock)return;
318        UpdateLock lock(update_lock);
319        rend_desc_.set_br(entry_br->get_value());
320        refresh();
321        signal_changed()();
322}
323
324void
325Widget_RendDesc::on_focus_changed()
326{
327        if(update_lock)return;
328        UpdateLock lock(update_lock);
329        rend_desc_.set_focus(entry_focus->get_value());
330        refresh();
331        signal_changed()();
332}
333
334void
335Widget_RendDesc::on_span_changed()
336{
337        if(update_lock)return;
338        UpdateLock lock(update_lock);
339        rend_desc_.set_span(adjustment_span->get_value());
340        refresh();
341        signal_changed()();
342}
343
344void
345Widget_RendDesc::disable_time_section()
346{
347        time_frame->set_sensitive(false);
348}
349
350void
351Widget_RendDesc::enable_time_section()
352{
353        time_frame->set_sensitive(true);
354}
355
356void
357Widget_RendDesc::on_ratio_wh_toggled()
358{
359        if(update_lock)return;
360        UpdateLock lock(update_lock);
361
362        if(toggle_wh_ratio->get_active())
363        {
364                rend_desc_.set_pixel_ratio(adjustment_width->get_value(), adjustment_height->get_value());
365                rend_desc_.set_flags(rend_desc_.get_flags()|RendDesc::LINK_IM_ASPECT);
366        }
367        else
368        {
369                rend_desc_.set_flags(rend_desc_.get_flags()&~RendDesc::LINK_IM_ASPECT);
370        }
371}
372
373void
374Widget_RendDesc::on_ratio_res_toggled()
375{
376        if(update_lock)return;
377        UpdateLock lock(update_lock);
378
379        if(toggle_res_ratio->get_active())
380        {
381                rend_desc_.set_res_ratio(adjustment_xres->get_value(), adjustment_yres->get_value());
382                rend_desc_.set_flags(rend_desc_.get_flags()|RendDesc::LINK_RES);
383        }
384        else
385        {
386                rend_desc_.set_flags(rend_desc_.get_flags()&~RendDesc::LINK_RES);
387        }
388}
389
390void
391Widget_RendDesc::create_widgets()
392{
393        entry_width=manage(new Gtk::SpinButton(adjustment_width,1,0));
394        entry_width->set_alignment(1);
395        entry_height=manage(new Gtk::SpinButton(adjustment_height,1,0));
396        entry_height->set_alignment(1);
397        entry_xres=manage(new Gtk::SpinButton(adjustment_xres,0.5,1));
398        entry_xres->set_alignment(1);
399        entry_yres=manage(new Gtk::SpinButton(adjustment_yres,0.5,1));
400        entry_yres->set_alignment(1);
401        entry_phy_width=manage(new Gtk::SpinButton(adjustment_phy_width,0.25,2));
402        entry_phy_width->set_alignment(1);
403        entry_phy_height=manage(new Gtk::SpinButton(adjustment_phy_height,0.25,2));
404        entry_phy_height->set_alignment(1);
405        entry_span=manage(new Gtk::SpinButton(adjustment_span,0.1,4));
406        entry_span->set_alignment(1);
407        entry_tl=manage(new Widget_Vector());
408        entry_tl->set_digits(4);
409        entry_br=manage(new Widget_Vector());
410        entry_br->set_digits(4);
411        entry_fps=manage(new Gtk::SpinButton(adjustment_fps,1,5));
412        entry_start_time=manage(new Widget_Time());
413        entry_end_time=manage(new Widget_Time());
414        entry_duration=manage(new Widget_Time());
415        entry_focus=manage(new Widget_Vector());
416        toggle_px_aspect=manage(new Gtk::CheckButton(_("_Pixel Aspect"), true));
417        toggle_px_aspect->set_alignment(0, 0.5);
418        toggle_px_width=manage(new Gtk::CheckButton(_("Pi_xel Width"), true));
419        toggle_px_width->set_alignment(0, 0.5);
420        toggle_px_height=manage(new Gtk::CheckButton(_("Pix_el Height"), true));
421        toggle_px_height->set_alignment(0, 0.5);
422        toggle_im_aspect=manage(new Gtk::CheckButton(_("Image _Aspect"), true));
423        toggle_im_aspect->set_alignment(0, 0.5);
424        toggle_im_width=manage(new Gtk::CheckButton(_("Image _Width"), true));
425        toggle_im_width->set_alignment(0, 0.5);
426        toggle_im_height=manage(new Gtk::CheckButton(_("Image _Height"), true));
427        toggle_im_height->set_alignment(0, 0.5);
428        toggle_im_span=manage(new Gtk::CheckButton(_("Image _Span"), true));
429        toggle_im_span->set_alignment(0, 0.5);
430
431        toggle_wh_ratio=manage(new Widget_Link(_("Link width and height"), _("Unlink width and height")));
432        toggle_res_ratio=manage(new Widget_Link(_("Link x and y resolution"), _("Unlink x and y resolution")));
433
434        pixel_ratio_label=manage(new Gtk::Label("", 0, 0.5, false));
435}
436
437void
438Widget_RendDesc::connect_signals()
439{
440        entry_width->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_width_changed));
441        entry_height->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_height_changed));
442        entry_xres->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_xres_changed));
443        entry_yres->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_yres_changed));
444        entry_phy_width->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_phy_width_changed));
445        entry_phy_height->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_phy_height_changed));
446        entry_span->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_span_changed));
447        entry_tl->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_tl_changed));
448        entry_br->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_br_changed));
449        entry_fps->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_fps_changed));
450        entry_start_time->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_start_time_changed));
451        entry_end_time->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_end_time_changed));
452        entry_duration->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_duration_changed));
453        entry_focus->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_RendDesc::on_focus_changed));
454        toggle_px_aspect->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
455        toggle_px_width->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
456        toggle_px_height->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
457        toggle_im_aspect->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
458        toggle_im_width->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
459        toggle_im_height->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
460        toggle_im_span->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_lock_changed));
461
462        toggle_wh_ratio->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_ratio_wh_toggled));
463        toggle_res_ratio->signal_toggled().connect(sigc::mem_fun(*this, &studio::Widget_RendDesc::on_ratio_res_toggled));
464}
465
466Gtk::Widget *
467Widget_RendDesc::create_image_tab()
468{
469        Gtk::Alignment *paddedPanel = manage(new Gtk::Alignment(0, 0, 1, 1));
470        paddedPanel->set_padding(12, 12, 12, 12);
471
472        Gtk::Box *panelBox = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 12));
473        panelBox->set_homogeneous(false);
474        paddedPanel->add(*panelBox);
475
476        Gtk::Frame *imageSizeFrame = manage(new Gtk::Frame(_("Image Size")));
477        imageSizeFrame->set_shadow_type(Gtk::SHADOW_NONE);
478        ((Gtk::Label *) imageSizeFrame->get_label_widget())->set_markup(_("<b>Image Size</b>"));
479//      panelBox->pack_start(*imageSizeFrame, false, false, 0);
480        panelBox->pack_start(*imageSizeFrame, Gtk::PACK_SHRINK);
481
482        Gtk::Alignment *tableSizePadding = manage(new Gtk::Alignment(0, 0, 1, 1));
483        tableSizePadding->set_padding(6, 0, 24, 0);
484        Gtk::Grid *imageSizeGrid = manage(new Gtk::Grid());
485
486        tableSizePadding->add(*imageSizeGrid);
487        imageSizeFrame->add(*tableSizePadding);
488
489        Gtk::Label *size_width_label = manage(new Gtk::Label(_("_Width"), 0, 0.5, true));
490        size_width_label->set_mnemonic_widget(*entry_width);
491
492        Gtk::Label *size_height_label = manage(new Gtk::Label(_("_Height"), 0, 0.5, true));
493        size_height_label->set_mnemonic_widget(*entry_height);
494
495        Gtk::Label *size_xres_label = manage(new Gtk::Label(_("_XRes"), 0, 0.5, true));
496        size_xres_label->set_mnemonic_widget(*entry_xres);
497
498        Gtk::Label *size_yres_label = manage(new Gtk::Label(_("_YRes"), 0, 0.5, true));
499        size_yres_label->set_mnemonic_widget(*entry_yres);
500
501        Gtk::Label *size_physwidth_label = manage(new Gtk::Label(_("_Physical Width"), 0, 0.5, true));
502        size_physwidth_label->set_mnemonic_widget(*entry_phy_width);
503
504        Gtk::Label *size_physheight_label = manage(new Gtk::Label(_("Phy_sical Height"), 0, 0.5, true));
505        size_physheight_label->set_mnemonic_widget(*entry_phy_height);
506
507        imageSizeGrid->set_row_spacing(6);
508
509        imageSizeGrid->attach(*size_width_label,                0, 0, 1, 1);
510        imageSizeGrid->attach(*size_height_label,               0, 1, 1, 1);
511        entry_width->set_hexpand(true);
512        entry_height->set_hexpand(true);
513        imageSizeGrid->attach(*entry_width,                     1, 0, 1, 1);
514        imageSizeGrid->attach(*entry_height,                    1, 1, 1, 1);
515        toggle_wh_ratio->set_margin_right(6);
516        imageSizeGrid->attach(*toggle_wh_ratio,                 2, 0, 1, 2);
517
518        imageSizeGrid->attach(*size_xres_label,                 3, 0, 1, 1);
519        imageSizeGrid->attach(*size_yres_label,                 3, 1, 1, 1);
520        entry_xres->set_hexpand(true);
521        entry_yres->set_hexpand(true);
522        imageSizeGrid->attach(*entry_xres,                              4, 0, 1, 1);
523        imageSizeGrid->attach(*entry_yres,                              4, 1, 1, 1);
524        toggle_res_ratio->set_margin_right(6);
525        imageSizeGrid->attach(*toggle_res_ratio,                5, 0, 1, 2);
526
527        imageSizeGrid->attach(*size_physwidth_label,    6, 0, 1, 1);
528        imageSizeGrid->attach(*size_physheight_label,   6, 1, 1, 1);
529        entry_phy_width->set_hexpand(true);
530        entry_phy_height->set_hexpand(true);
531        imageSizeGrid->attach(*entry_phy_width,                 7, 0, 1, 1);
532        imageSizeGrid->attach(*entry_phy_height,                7, 1, 1, 1);
533
534        imageSizeGrid->attach(*pixel_ratio_label,               0, 3, 3, 1);
535
536        Gtk::Frame *imageAreaFrame = manage(new Gtk::Frame(_("Image Area")));
537        imageAreaFrame->set_shadow_type(Gtk::SHADOW_NONE);
538        ((Gtk::Label *) imageAreaFrame->get_label_widget())->set_markup(_("<b>Image Area</b>"));
539        //panelBox->pack_start(*imageAreaFrame, false, false, 0);
540        panelBox->pack_start(*imageAreaFrame, Gtk::PACK_SHRINK);
541
542        Gtk::Alignment *imageAreaPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
543        imageAreaPadding->set_padding(6, 0, 24, 0);
544        imageAreaFrame->add(*imageAreaPadding);
545
546        Gtk::Box *imageAreaBox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,12));
547        Gtk::Box *imageAreaTlbrLabelBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL,6));
548        Gtk::Box *imageAreaTlbrBox = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL,6));
549        Gtk::Box *imageAreaSpanBox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,6));
550        imageAreaPadding->add(*imageAreaBox);
551
552        Gtk::Label *imageAreaTopLeftLabel = manage(new Gtk::Label(_("_Top Left"), 0, 0.5, true));
553        imageAreaTopLeftLabel->set_mnemonic_widget(*entry_tl);
554
555        Gtk::Label *imageAreaBottomRightLabel = manage(new Gtk::Label(_("_Bottom Right"), 0, 0.5, true));
556        imageAreaBottomRightLabel->set_mnemonic_widget(*entry_br);
557
558        Gtk::Label *size_span = manage(new Gtk::Label(_("I_mage Span"), 0, 0.5, true));
559        size_span->set_mnemonic_widget(*entry_span);
560
561        imageAreaTlbrLabelBox->pack_start(*imageAreaTopLeftLabel);
562        imageAreaTlbrLabelBox->pack_start(*imageAreaBottomRightLabel);
563        imageAreaTlbrBox->pack_start(*entry_tl);
564        imageAreaTlbrBox->pack_start(*entry_br);
565
566        imageAreaSpanBox->pack_start(*size_span);
567        imageAreaSpanBox->pack_start(*entry_span);
568
569        imageAreaBox->pack_start(*imageAreaTlbrLabelBox);
570        imageAreaBox->pack_start(*imageAreaTlbrBox);
571        imageAreaBox->pack_start(*imageAreaSpanBox);
572
573        paddedPanel->show_all();
574        return paddedPanel;
575}
576
577Gtk::Widget *
578Widget_RendDesc::create_time_tab()
579{
580        Gtk::Alignment *paddedPanel = manage(new Gtk::Alignment(0, 0, 1, 1));
581        paddedPanel->set_padding(12, 12, 12, 12);
582
583        Gtk::Box *panelBox = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 12));  // for future widgets
584        panelBox->set_homogeneous(false);
585        paddedPanel->add(*panelBox);
586
587        time_frame = manage(new Gtk::Frame(_("Time Settings")));
588        time_frame->set_shadow_type(Gtk::SHADOW_NONE);
589        ((Gtk::Label *) time_frame->get_label_widget())->set_markup(_("<b>Time Settings</b>"));
590        panelBox->pack_start(*time_frame, Gtk::PACK_SHRINK);
591
592        Gtk::Alignment *timeFramePadding = manage(new Gtk::Alignment(0, 0, 1, 1));
593        timeFramePadding->set_padding(6, 0, 24, 0);
594        time_frame->add(*timeFramePadding);
595
596        Gtk::Grid *timeFrameGrid = manage(new Gtk::Grid());
597        timeFramePadding->add(*timeFrameGrid);
598        timeFrameGrid->set_row_spacing(6);
599        timeFrameGrid->set_column_spacing(250);
600
601        Gtk::Label *timeFPSLabel = manage(new Gtk::Label(_("_Frames per second"), 0, 0.5, true));
602        timeFPSLabel->set_mnemonic_widget(*entry_fps);
603        timeFrameGrid->attach(*timeFPSLabel, 0, 0, 1, 1);
604        entry_fps->set_hexpand(true);
605        timeFrameGrid->attach(*entry_fps, 1, 0, 1, 1);
606
607        Gtk::Label *timeStartLabel = manage(new Gtk::Label(_("_Start Time"), 0, 0.5, true));
608        timeStartLabel->set_mnemonic_widget(*entry_start_time);
609        timeFrameGrid->attach(*timeStartLabel, 0, 1, 1, 1);
610        timeFrameGrid->attach(*entry_start_time, 1, 1, 1, 1);
611
612        Gtk::Label *timeEndLabel = manage(new Gtk::Label(_("_End Time"), 0, 0.5, true));
613        timeEndLabel->set_mnemonic_widget(*entry_end_time);
614        timeFrameGrid->attach(*timeEndLabel, 0, 2, 1, 1);
615        timeFrameGrid->attach(*entry_end_time, 1, 2, 1, 1);
616
617        Gtk::Label *timeDurationLabel = manage(new Gtk::Label(_("_Duration"), 0, 0.5, true));
618        timeDurationLabel->set_mnemonic_widget(*entry_duration);
619        timeFrameGrid->attach(*timeDurationLabel, 0, 3, 1, 1);
620        timeFrameGrid->attach(*entry_duration, 1, 3, 1, 1);
621
622        paddedPanel->show_all();
623        return paddedPanel;
624}
625
626Gtk::Widget *
627Widget_RendDesc::create_other_tab()
628{
629        Gtk::Alignment *paddedPanel = manage(new Gtk::Alignment(0, 0, 1, 1));
630        paddedPanel->set_padding(12, 12, 12, 12);
631
632        Gtk::Box *panelBox = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 12));
633        panelBox->set_homogeneous(false);
634        paddedPanel->add(*panelBox);
635
636        Gtk::Frame *lockFrame = manage(new Gtk::Frame(_("Locks and Links")));
637        lockFrame->set_shadow_type(Gtk::SHADOW_NONE);
638        ((Gtk::Label *) lockFrame->get_label_widget())->set_markup(_("<b>Locks and Links</b>"));
639        panelBox->pack_start(*lockFrame, Gtk::PACK_SHRINK);
640
641        Gtk::Alignment *lockPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
642        lockPadding->set_padding(6, 0, 24, 0);
643        lockFrame->add(*lockPadding);
644
645        Gtk::Grid *lockGrid = manage(new Gtk::Grid());
646        lockGrid->set_row_spacing(6);
647        lockGrid->set_column_spacing(12);
648        lockPadding->add(*lockGrid);
649
650        lockGrid->attach(*toggle_im_width,              0, 0, 1, 1);
651        toggle_im_width->set_hexpand(true);
652        lockGrid->attach(*toggle_im_height,             1, 0, 1, 1);
653        toggle_im_height->set_hexpand(true);
654        lockGrid->attach(*toggle_im_aspect,             2, 0, 1, 1);
655        toggle_im_aspect->set_hexpand(true);
656        lockGrid->attach(*toggle_im_span,               3, 0, 1, 1);
657        toggle_im_span->set_hexpand(true);
658
659        lockGrid->attach(*toggle_px_width,              0, 1, 1, 1);
660        lockGrid->attach(*toggle_px_height,             1, 1, 1, 1);
661        lockGrid->attach(*toggle_px_aspect,             2, 1, 1, 1);
662
663        Gtk::Frame *focusFrame = manage(new Gtk::Frame(_("Focus Point")));
664        focusFrame->set_shadow_type(Gtk::SHADOW_NONE);
665        ((Gtk::Label *) focusFrame->get_label_widget())->set_markup(_("<b>Focus Point</b>"));
666        panelBox->pack_start(*focusFrame, Gtk::PACK_SHRINK);
667
668        Gtk::Alignment *focusPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
669        focusPadding->set_padding(6, 0, 24, 0);
670        focusFrame->add(*focusPadding);
671
672        Gtk::Box *focusBox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 12));
673        focusPadding->add(*focusBox);
674
675        Gtk::Label *focusLabel = manage(new Gtk::Label(_("_Focus Point"), 0, 0.5, true));
676        focusLabel->set_mnemonic_widget(*entry_focus);
677        focusBox->pack_start(*focusLabel, Gtk::PACK_SHRINK);
678        focusBox->pack_start(*entry_focus, Gtk::PACK_EXPAND_WIDGET);
679
680        paddedPanel->show_all();
681        return paddedPanel;
682}
Note: See TracBrowser for help on using the repository browser.