summaryrefslogtreecommitdiffstats
path: root/gtk2/interface.c
blob: 826889c319572cdd1106a0e2092b80a4ecafad8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

#include "HandBrake.h"
#include "status.h"
#include "callbacks.h"
#include "interface.h"
#include "support.h"

#define GLADE_HOOKUP_OBJECT(component,widget,name) \
  g_object_set_data_full (G_OBJECT (component), name, \
    gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)

#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
  g_object_set_data (G_OBJECT (component), name, widget)

GtkWidget*
create_win_main (void)
{
  GtkWidget *win_main;
  GtkWidget *vbox1;
  GtkWidget *frame_dvd;
  GtkWidget *vbox11;
  GtkWidget *alignment13;
  GtkWidget *hbox1;
  GtkWidget *label3;
  GtkWidget *combo1;
  GtkWidget *entry_device;
  GtkWidget *button_browse_device;
  GtkWidget *alignment1;
  GtkWidget *hbox2;
  GtkWidget *image1;
  GtkWidget *label4;
  GtkWidget *label1;
  GtkWidget *vbox_parameters;
  GtkWidget *frame_video;
  GtkWidget *hbox18;
  GtkWidget *alignment7;
  GtkWidget *vbox7;
  GtkWidget *label13;
  GtkWidget *label12;
  GtkWidget *radiobutton_cbitrate;
  GSList *radiobutton_cbitrate_group = NULL;
  GtkWidget *radiobutton_tsize;
  GtkWidget *checkbutton_2pass;
  GtkWidget *alignment8;
  GtkWidget *vbox8;
  GtkWidget *optionmenu_title;
  GtkWidget *optionmenu_codec;
  GtkWidget *menu_codec;
  GtkWidget *mpeg_4__ffmpeg_1;
  GtkWidget *mpeg_4__xvid_1;
  GtkWidget *h264__x264_1;
  GtkObject *spinbutton_bitrate_adj;
  GtkWidget *spinbutton_bitrate;
  GtkObject *spinbutton_size_adj;
  GtkWidget *spinbutton_size;
  GtkWidget *button_settings;
  GtkWidget *label6;
  GtkWidget *frame_audio;
  GtkWidget *hbox19;
  GtkWidget *alignment9;
  GtkWidget *vbox9;
  GtkWidget *label14;
  GtkWidget *label15;
  GtkWidget *label16;
  GtkWidget *alignment10;
  GtkWidget *vbox10;
  GtkWidget *optionmenu_language;
  GtkWidget *optionmenu_language2;
  GtkWidget *optionmenu_bitrate;
  GtkWidget *menu1;
  GtkWidget *_2;
  GtkWidget *_4;
  GtkWidget *_7;
  GtkWidget *_10;
  GtkWidget *_11;
  GtkWidget *_12;
  GtkWidget *_13;
  GtkWidget *label8;
  GtkWidget *frame_output;
  GtkWidget *vbox2;
  GtkWidget *hbox20;
  GtkWidget *alignment11;
  GtkWidget *label17;
  GtkWidget *alignment12;
  GtkWidget *optionmenu_format;
  GtkWidget *menu2;
  GtkWidget *auto1;
  GtkWidget *avi1;
  GtkWidget *mp1;
  GtkWidget *ogm1;
  GtkWidget *hbox6;
  GtkWidget *label18;
  GtkWidget *combo2;
  GtkWidget *entry_file;
  GtkWidget *button_browse_file;
  GtkWidget *alignment2;
  GtkWidget *hbox7;
  GtkWidget *image4;
  GtkWidget *label19;
  GtkWidget *label9;
  GtkWidget *hbuttonbox1;
  GtkWidget *button_start;
  GtkWidget *alignment3;
  GtkWidget *hbox9;
  GtkWidget *button_start_image;
  GtkWidget *button_start_label;
  GtkWidget *hbox10;
  GtkWidget *progressbar;
  GtkWidget *statusbar;

  win_main = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (win_main), "HandBrake");

  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox1);
  gtk_container_add (GTK_CONTAINER (win_main), vbox1);

  frame_dvd = gtk_frame_new (NULL);
  gtk_widget_show (frame_dvd);
  gtk_box_pack_start (GTK_BOX (vbox1), frame_dvd, TRUE, TRUE, 0);

  vbox11 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox11);
  gtk_container_add (GTK_CONTAINER (frame_dvd), vbox11);
  gtk_container_set_border_width (GTK_CONTAINER (vbox11), 5);

  alignment13 = gtk_alignment_new (0, 1, 1, 1);
  gtk_widget_show (alignment13);
  gtk_box_pack_start (GTK_BOX (vbox11), alignment13, TRUE, FALSE, 0);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_container_add (GTK_CONTAINER (alignment13), hbox1);

  label3 = gtk_label_new ("Device ");
  gtk_widget_show (label3);
  gtk_box_pack_start (GTK_BOX (hbox1), label3, FALSE, TRUE, 0);

  combo1 = gtk_combo_new ();
  g_object_set_data (G_OBJECT (GTK_COMBO (combo1)->popwin),
                     "GladeParentKey", combo1);
  gtk_widget_show (combo1);
  gtk_box_pack_start (GTK_BOX (hbox1), combo1, TRUE, TRUE, 0);

  entry_device = GTK_COMBO (combo1)->entry;
  gtk_widget_show (entry_device);

  button_browse_device = gtk_button_new ();
  gtk_widget_show (button_browse_device);
  gtk_box_pack_start (GTK_BOX (hbox1), button_browse_device, FALSE, FALSE, 0);
  GTK_WIDGET_SET_FLAGS (button_browse_device, GTK_CAN_DEFAULT);

  alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment1);
  gtk_container_add (GTK_CONTAINER (button_browse_device), alignment1);

  hbox2 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox2);
  gtk_container_add (GTK_CONTAINER (alignment1), hbox2);

  image1 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image1);
  gtk_box_pack_start (GTK_BOX (hbox2), image1, FALSE, FALSE, 0);

  label4 = gtk_label_new_with_mnemonic ("Browse");
  gtk_widget_show (label4);
  gtk_box_pack_start (GTK_BOX (hbox2), label4, FALSE, FALSE, 0);

  label1 = gtk_label_new ("DVD");
  gtk_widget_show (label1);
  gtk_frame_set_label_widget (GTK_FRAME (frame_dvd), label1);

  vbox_parameters = gtk_vbox_new (FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox1), vbox_parameters, FALSE, TRUE, 0);

  frame_video = gtk_frame_new (NULL);
  gtk_widget_show (frame_video);
  gtk_box_pack_start (GTK_BOX (vbox_parameters), frame_video, FALSE, TRUE, 0);

  hbox18 = gtk_hbox_new (TRUE, 0);
  gtk_widget_show (hbox18);
  gtk_container_add (GTK_CONTAINER (frame_video), hbox18);
  gtk_container_set_border_width (GTK_CONTAINER (hbox18), 5);

  alignment7 = gtk_alignment_new (0, 0.5, 1, 1);
  gtk_widget_show (alignment7);
  gtk_box_pack_start (GTK_BOX (hbox18), alignment7, TRUE, TRUE, 0);

  vbox7 = gtk_vbox_new (TRUE, 0);
  gtk_widget_show (vbox7);
  gtk_container_add (GTK_CONTAINER (alignment7), vbox7);

  label13 = gtk_label_new ("Title");
  gtk_widget_show (label13);
  gtk_box_pack_start (GTK_BOX (vbox7), label13, FALSE, FALSE, 0);
  gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);

  label12 = gtk_label_new ("Codec");
  gtk_widget_show (label12);
  gtk_box_pack_start (GTK_BOX (vbox7), label12, FALSE, FALSE, 0);
  gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);

  radiobutton_cbitrate = gtk_radio_button_new_with_mnemonic (NULL, "Custom bitrate");
  gtk_widget_show (radiobutton_cbitrate);
  gtk_box_pack_start (GTK_BOX (vbox7), radiobutton_cbitrate, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_cbitrate), radiobutton_cbitrate_group);
  radiobutton_cbitrate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_cbitrate));
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_cbitrate), TRUE);

  radiobutton_tsize = gtk_radio_button_new_with_mnemonic (NULL, "Target size");
  gtk_widget_show (radiobutton_tsize);
  gtk_box_pack_start (GTK_BOX (vbox7), radiobutton_tsize, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_tsize), radiobutton_cbitrate_group);
  radiobutton_cbitrate_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_tsize));

  checkbutton_2pass = gtk_check_button_new_with_mnemonic ("2-pass encoding");
  gtk_widget_show (checkbutton_2pass);
  gtk_box_pack_start (GTK_BOX (vbox7), checkbutton_2pass, FALSE, FALSE, 0);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton_2pass), TRUE);

  alignment8 = gtk_alignment_new (1, 0.5, 1, 1);
  gtk_widget_show (alignment8);
  gtk_box_pack_start (GTK_BOX (hbox18), alignment8, TRUE, TRUE, 0);

  vbox8 = gtk_vbox_new (TRUE, 0);
  gtk_widget_show (vbox8);
  gtk_container_add (GTK_CONTAINER (alignment8), vbox8);

  optionmenu_title = gtk_option_menu_new ();
  gtk_widget_show (optionmenu_title);
  gtk_box_pack_start (GTK_BOX (vbox8), optionmenu_title, FALSE, FALSE, 0);

  optionmenu_codec = gtk_option_menu_new ();
  gtk_widget_show (optionmenu_codec);
  gtk_box_pack_start (GTK_BOX (vbox8), optionmenu_codec, FALSE, FALSE, 0);

  menu_codec = gtk_menu_new ();

  mpeg_4__ffmpeg_1 = gtk_menu_item_new_with_mnemonic ("MPEG-4 (FFmpeg)");
  gtk_widget_show (mpeg_4__ffmpeg_1);
  gtk_container_add (GTK_CONTAINER (menu_codec), mpeg_4__ffmpeg_1);

  mpeg_4__xvid_1 = gtk_menu_item_new_with_mnemonic ("MPEG-4 (XviD)");
  gtk_widget_show (mpeg_4__xvid_1);
  gtk_container_add (GTK_CONTAINER (menu_codec), mpeg_4__xvid_1);

  h264__x264_1 = gtk_menu_item_new_with_mnemonic ("H264 (x264)");
  gtk_widget_show (h264__x264_1);
  gtk_container_add (GTK_CONTAINER (menu_codec), h264__x264_1);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu_codec), menu_codec);

  spinbutton_bitrate_adj = gtk_adjustment_new (1024, 100, 5000, 1, 10, 10);
  spinbutton_bitrate = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_bitrate_adj), 1, 0);
  gtk_widget_show (spinbutton_bitrate);
  gtk_box_pack_start (GTK_BOX (vbox8), spinbutton_bitrate, FALSE, FALSE, 0);

  spinbutton_size_adj = gtk_adjustment_new (700, 0, 2000, 1, 10, 10);
  spinbutton_size = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_size_adj), 1, 0);
  gtk_widget_show (spinbutton_size);
  gtk_box_pack_start (GTK_BOX (vbox8), spinbutton_size, FALSE, FALSE, 0);

  button_settings = gtk_button_new_with_mnemonic ("Crop & Resize..");
  gtk_widget_show (button_settings);
  gtk_box_pack_start (GTK_BOX (vbox8), button_settings, FALSE, FALSE, 0);

  label6 = gtk_label_new ("Video");
  gtk_widget_show (label6);
  gtk_frame_set_label_widget (GTK_FRAME (frame_video), label6);

  frame_audio = gtk_frame_new (NULL);
  gtk_widget_show (frame_audio);
  gtk_box_pack_start (GTK_BOX (vbox_parameters), frame_audio, FALSE, TRUE, 0);

  hbox19 = gtk_hbox_new (TRUE, 0);
  gtk_widget_show (hbox19);
  gtk_container_add (GTK_CONTAINER (frame_audio), hbox19);
  gtk_container_set_border_width (GTK_CONTAINER (hbox19), 5);

  alignment9 = gtk_alignment_new (0, 0.5, 1, 1);
  gtk_widget_show (alignment9);
  gtk_box_pack_start (GTK_BOX (hbox19), alignment9, TRUE, TRUE, 0);

  vbox9 = gtk_vbox_new (TRUE, 0);
  gtk_widget_show (vbox9);
  gtk_container_add (GTK_CONTAINER (alignment9), vbox9);

  label14 = gtk_label_new ("Language");
  gtk_widget_show (label14);
  gtk_box_pack_start (GTK_BOX (vbox9), label14, FALSE, FALSE, 0);
  gtk_misc_set_alignment (GTK_MISC (label14), 0, 0.5);

  label15 = gtk_label_new ("Secondary language");
  gtk_widget_show (label15);
  gtk_box_pack_start (GTK_BOX (vbox9), label15, FALSE, FALSE, 0);
  gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);

  label16 = gtk_label_new ("Bitrate");
  gtk_widget_show (label16);
  gtk_box_pack_start (GTK_BOX (vbox9), label16, FALSE, FALSE, 0);
  gtk_misc_set_alignment (GTK_MISC (label16), 0, 0.5);

  alignment10 = gtk_alignment_new (1, 0.5, 1, 1);
  gtk_widget_show (alignment10);
  gtk_box_pack_start (GTK_BOX (hbox19), alignment10, TRUE, TRUE, 0);

  vbox10 = gtk_vbox_new (TRUE, 0);
  gtk_widget_show (vbox10);
  gtk_container_add (GTK_CONTAINER (alignment10), vbox10);

  optionmenu_language = gtk_option_menu_new ();
  gtk_widget_show (optionmenu_language);
  gtk_box_pack_start (GTK_BOX (vbox10), optionmenu_language, FALSE, FALSE, 0);

  optionmenu_language2 = gtk_option_menu_new ();
  gtk_widget_show (optionmenu_language2);
  gtk_box_pack_start (GTK_BOX (vbox10), optionmenu_language2, FALSE, FALSE, 0);

  optionmenu_bitrate = gtk_option_menu_new ();
  gtk_widget_show (optionmenu_bitrate);
  gtk_box_pack_start (GTK_BOX (vbox10), optionmenu_bitrate, FALSE, FALSE, 0);

  menu1 = gtk_menu_new ();

  _2 = gtk_menu_item_new_with_mnemonic ("64");
  gtk_widget_show (_2);
  gtk_container_add (GTK_CONTAINER (menu1), _2);

  _4 = gtk_menu_item_new_with_mnemonic ("96");
  gtk_widget_show (_4);
  gtk_container_add (GTK_CONTAINER (menu1), _4);

  _7 = gtk_menu_item_new_with_mnemonic ("128");
  gtk_widget_show (_7);
  gtk_container_add (GTK_CONTAINER (menu1), _7);

  _10 = gtk_menu_item_new_with_mnemonic ("160");
  gtk_widget_show (_10);
  gtk_container_add (GTK_CONTAINER (menu1), _10);

  _11 = gtk_menu_item_new_with_mnemonic ("192");
  gtk_widget_show (_11);
  gtk_container_add (GTK_CONTAINER (menu1), _11);

  _12 = gtk_menu_item_new_with_mnemonic ("256");
  gtk_widget_show (_12);
  gtk_container_add (GTK_CONTAINER (menu1), _12);

  _13 = gtk_menu_item_new_with_mnemonic ("320");
  gtk_widget_show (_13);
  gtk_container_add (GTK_CONTAINER (menu1), _13);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu_bitrate), menu1);

  label8 = gtk_label_new ("Audio");
  gtk_widget_show (label8);
  gtk_frame_set_label_widget (GTK_FRAME (frame_audio), label8);

  frame_output = gtk_frame_new (NULL);
  gtk_widget_show (frame_output);
  gtk_box_pack_start (GTK_BOX (vbox_parameters), frame_output, FALSE, TRUE, 6);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (frame_output), vbox2);
  gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5);

  hbox20 = gtk_hbox_new (TRUE, 0);
  gtk_widget_show (hbox20);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox20, TRUE, TRUE, 0);

  alignment11 = gtk_alignment_new (0, 0.5, 1, 1);
  gtk_widget_show (alignment11);
  gtk_box_pack_start (GTK_BOX (hbox20), alignment11, TRUE, TRUE, 0);

  label17 = gtk_label_new ("Format");
  gtk_widget_show (label17);
  gtk_container_add (GTK_CONTAINER (alignment11), label17);
  gtk_misc_set_alignment (GTK_MISC (label17), 0, 0.5);

  alignment12 = gtk_alignment_new (1, 0.5, 1, 1);
  gtk_widget_show (alignment12);
  gtk_box_pack_start (GTK_BOX (hbox20), alignment12, TRUE, TRUE, 0);

  optionmenu_format = gtk_option_menu_new ();
  gtk_widget_show (optionmenu_format);
  gtk_container_add (GTK_CONTAINER (alignment12), optionmenu_format);

  menu2 = gtk_menu_new ();

  auto1 = gtk_menu_item_new_with_mnemonic ("Auto");
  gtk_widget_show (auto1);
  gtk_container_add (GTK_CONTAINER (menu2), auto1);

  avi1 = gtk_menu_item_new_with_mnemonic ("AVI");
  gtk_widget_show (avi1);
  gtk_container_add (GTK_CONTAINER (menu2), avi1);

  mp1 = gtk_menu_item_new_with_mnemonic ("MP4");
  gtk_widget_show (mp1);
  gtk_container_add (GTK_CONTAINER (menu2), mp1);

  ogm1 = gtk_menu_item_new_with_mnemonic ("OGM");
  gtk_widget_show (ogm1);
  gtk_container_add (GTK_CONTAINER (menu2), ogm1);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu_format), menu2);

  hbox6 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox6);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox6, TRUE, TRUE, 0);

  label18 = gtk_label_new ("File ");
  gtk_widget_show (label18);
  gtk_box_pack_start (GTK_BOX (hbox6), label18, FALSE, TRUE, 0);

  combo2 = gtk_combo_new ();
  g_object_set_data (G_OBJECT (GTK_COMBO (combo2)->popwin),
                     "GladeParentKey", combo2);
  gtk_widget_show (combo2);
  gtk_box_pack_start (GTK_BOX (hbox6), combo2, TRUE, TRUE, 0);

  entry_file = GTK_COMBO (combo2)->entry;
  gtk_widget_show (entry_file);

  button_browse_file = gtk_button_new ();
  gtk_widget_show (button_browse_file);
  gtk_box_pack_start (GTK_BOX (hbox6), button_browse_file, FALSE, FALSE, 0);
  GTK_WIDGET_SET_FLAGS (button_browse_file, GTK_CAN_DEFAULT);

  alignment2 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment2);
  gtk_container_add (GTK_CONTAINER (button_browse_file), alignment2);

  hbox7 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox7);
  gtk_container_add (GTK_CONTAINER (alignment2), hbox7);

  image4 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image4);
  gtk_box_pack_start (GTK_BOX (hbox7), image4, FALSE, FALSE, 0);

  label19 = gtk_label_new_with_mnemonic ("Browse");
  gtk_widget_show (label19);
  gtk_box_pack_start (GTK_BOX (hbox7), label19, FALSE, FALSE, 0);

  label9 = gtk_label_new ("Output");
  gtk_widget_show (label9);
  gtk_frame_set_label_widget (GTK_FRAME (frame_output), label9);

  hbuttonbox1 = gtk_hbutton_box_new ();
  gtk_widget_show (hbuttonbox1);
  gtk_box_pack_start (GTK_BOX (vbox_parameters), hbuttonbox1, FALSE, TRUE, 4);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);

  button_start = gtk_button_new ();
  gtk_widget_show (button_start);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_start);
  GTK_WIDGET_SET_FLAGS (button_start, GTK_CAN_DEFAULT);

  alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment3);
  gtk_container_add (GTK_CONTAINER (button_start), alignment3);

  hbox9 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox9);
  gtk_container_add (GTK_CONTAINER (alignment3), hbox9);

  button_start_image = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (button_start_image);
  gtk_box_pack_start (GTK_BOX (hbox9), button_start_image, FALSE, FALSE, 0);

  button_start_label = gtk_label_new_with_mnemonic ("Start");
  gtk_widget_show (button_start_label);
  gtk_box_pack_start (GTK_BOX (hbox9), button_start_label, FALSE, FALSE, 0);

  hbox10 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox10);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox10, FALSE, FALSE, 0);

  progressbar = gtk_progress_bar_new ();
  gtk_widget_show (progressbar);
  gtk_box_pack_start (GTK_BOX (hbox10), progressbar, FALSE, FALSE, 0);

  statusbar = gtk_statusbar_new ();
  gtk_widget_show (statusbar);
  gtk_box_pack_start (GTK_BOX (hbox10), statusbar, TRUE, TRUE, 0);

  g_signal_connect ((gpointer) win_main, "delete_event",
                    G_CALLBACK (on_win_main_delete_event),
                    NULL);
  g_signal_connect ((gpointer) entry_device, "activate",
                    G_CALLBACK (on_entry_device_activate),
                    NULL);
  g_signal_connect ((gpointer) button_browse_device, "clicked",
                    G_CALLBACK (on_button_browse_device),
                    NULL);
  g_signal_connect ((gpointer) optionmenu_title, "changed",
                    G_CALLBACK (on_optionmenu_title_changed),
                    NULL);
  g_signal_connect ((gpointer) button_settings, "clicked",
                    G_CALLBACK (on_button_settings_clicked),
                    NULL);
  g_signal_connect ((gpointer) entry_file, "activate",
                    G_CALLBACK (on_entry_file_activate),
                    NULL);
  g_signal_connect ((gpointer) button_browse_file, "clicked",
                    G_CALLBACK (on_button_browse_file_clicked),
                    NULL);
  g_signal_connect ((gpointer) button_start, "clicked",
                    G_CALLBACK (on_button_start_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (win_main, win_main, "win_main");
  GLADE_HOOKUP_OBJECT (win_main, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (win_main, frame_dvd, "frame_dvd");
  GLADE_HOOKUP_OBJECT (win_main, vbox11, "vbox11");
  GLADE_HOOKUP_OBJECT (win_main, alignment13, "alignment13");
  GLADE_HOOKUP_OBJECT (win_main, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (win_main, label3, "label3");
  GLADE_HOOKUP_OBJECT (win_main, combo1, "combo1");
  GLADE_HOOKUP_OBJECT (win_main, entry_device, "entry_device");
  GLADE_HOOKUP_OBJECT (win_main, button_browse_device, "button_browse_device");
  GLADE_HOOKUP_OBJECT (win_main, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (win_main, hbox2, "hbox2");
  GLADE_HOOKUP_OBJECT (win_main, image1, "image1");
  GLADE_HOOKUP_OBJECT (win_main, label4, "label4");
  GLADE_HOOKUP_OBJECT (win_main, label1, "label1");
  GLADE_HOOKUP_OBJECT (win_main, vbox_parameters, "vbox_parameters");
  GLADE_HOOKUP_OBJECT (win_main, frame_video, "frame_video");
  GLADE_HOOKUP_OBJECT (win_main, hbox18, "hbox18");
  GLADE_HOOKUP_OBJECT (win_main, alignment7, "alignment7");
  GLADE_HOOKUP_OBJECT (win_main, vbox7, "vbox7");
  GLADE_HOOKUP_OBJECT (win_main, label13, "label13");
  GLADE_HOOKUP_OBJECT (win_main, label12, "label12");
  GLADE_HOOKUP_OBJECT (win_main, radiobutton_cbitrate, "radiobutton_cbitrate");
  GLADE_HOOKUP_OBJECT (win_main, radiobutton_tsize, "radiobutton_tsize");
  GLADE_HOOKUP_OBJECT (win_main, checkbutton_2pass, "checkbutton_2pass");
  GLADE_HOOKUP_OBJECT (win_main, alignment8, "alignment8");
  GLADE_HOOKUP_OBJECT (win_main, vbox8, "vbox8");
  GLADE_HOOKUP_OBJECT (win_main, optionmenu_title, "optionmenu_title");
  GLADE_HOOKUP_OBJECT (win_main, optionmenu_codec, "optionmenu_codec");
  GLADE_HOOKUP_OBJECT (win_main, menu_codec, "menu_codec");
  GLADE_HOOKUP_OBJECT (win_main, mpeg_4__ffmpeg_1, "mpeg_4__ffmpeg_1");
  GLADE_HOOKUP_OBJECT (win_main, mpeg_4__xvid_1, "mpeg_4__xvid_1");
  GLADE_HOOKUP_OBJECT (win_main, h264__x264_1, "h264__x264_1");
  GLADE_HOOKUP_OBJECT (win_main, spinbutton_bitrate, "spinbutton_bitrate");
  GLADE_HOOKUP_OBJECT (win_main, spinbutton_size, "spinbutton_size");
  GLADE_HOOKUP_OBJECT (win_main, button_settings, "button_settings");
  GLADE_HOOKUP_OBJECT (win_main, label6, "label6");
  GLADE_HOOKUP_OBJECT (win_main, frame_audio, "frame_audio");
  GLADE_HOOKUP_OBJECT (win_main, hbox19, "hbox19");
  GLADE_HOOKUP_OBJECT (win_main, alignment9, "alignment9");
  GLADE_HOOKUP_OBJECT (win_main, vbox9, "vbox9");
  GLADE_HOOKUP_OBJECT (win_main, label14, "label14");
  GLADE_HOOKUP_OBJECT (win_main, label15, "label15");
  GLADE_HOOKUP_OBJECT (win_main, label16, "label16");
  GLADE_HOOKUP_OBJECT (win_main, alignment10, "alignment10");
  GLADE_HOOKUP_OBJECT (win_main, vbox10, "vbox10");
  GLADE_HOOKUP_OBJECT (win_main, optionmenu_language, "optionmenu_language");
  GLADE_HOOKUP_OBJECT (win_main, optionmenu_language2, "optionmenu_language2");
  GLADE_HOOKUP_OBJECT (win_main, optionmenu_bitrate, "optionmenu_bitrate");
  GLADE_HOOKUP_OBJECT (win_main, menu1, "menu1");
  GLADE_HOOKUP_OBJECT (win_main, _2, "_2");
  GLADE_HOOKUP_OBJECT (win_main, _4, "_4");
  GLADE_HOOKUP_OBJECT (win_main, _7, "_7");
  GLADE_HOOKUP_OBJECT (win_main, _10, "_10");
  GLADE_HOOKUP_OBJECT (win_main, _11, "_11");
  GLADE_HOOKUP_OBJECT (win_main, _12, "_12");
  GLADE_HOOKUP_OBJECT (win_main, _13, "_13");
  GLADE_HOOKUP_OBJECT (win_main, label8, "label8");
  GLADE_HOOKUP_OBJECT (win_main, frame_output, "frame_output");
  GLADE_HOOKUP_OBJECT (win_main, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (win_main, hbox20, "hbox20");
  GLADE_HOOKUP_OBJECT (win_main, alignment11, "alignment11");
  GLADE_HOOKUP_OBJECT (win_main, label17, "label17");
  GLADE_HOOKUP_OBJECT (win_main, alignment12, "alignment12");
  GLADE_HOOKUP_OBJECT (win_main, optionmenu_format, "optionmenu_format");
  GLADE_HOOKUP_OBJECT (win_main, menu2, "menu2");
  GLADE_HOOKUP_OBJECT (win_main, auto1, "auto1");
  GLADE_HOOKUP_OBJECT (win_main, avi1, "avi1");
  GLADE_HOOKUP_OBJECT (win_main, mp1, "mp1");
  GLADE_HOOKUP_OBJECT (win_main, ogm1, "ogm1");
  GLADE_HOOKUP_OBJECT (win_main, hbox6, "hbox6");
  GLADE_HOOKUP_OBJECT (win_main, label18, "label18");
  GLADE_HOOKUP_OBJECT (win_main, combo2, "combo2");
  GLADE_HOOKUP_OBJECT (win_main, entry_file, "entry_file");
  GLADE_HOOKUP_OBJECT (win_main, button_browse_file, "button_browse_file");
  GLADE_HOOKUP_OBJECT (win_main, alignment2, "alignment2");
  GLADE_HOOKUP_OBJECT (win_main, hbox7, "hbox7");
  GLADE_HOOKUP_OBJECT (win_main, image4, "image4");
  GLADE_HOOKUP_OBJECT (win_main, label19, "label19");
  GLADE_HOOKUP_OBJECT (win_main, label9, "label9");
  GLADE_HOOKUP_OBJECT (win_main, hbuttonbox1, "hbuttonbox1");
  GLADE_HOOKUP_OBJECT (win_main, button_start, "button_start");
  GLADE_HOOKUP_OBJECT (win_main, alignment3, "alignment3");
  GLADE_HOOKUP_OBJECT (win_main, hbox9, "hbox9");
  GLADE_HOOKUP_OBJECT (win_main, button_start_image, "button_start_image");
  GLADE_HOOKUP_OBJECT (win_main, button_start_label, "button_start_label");
  GLADE_HOOKUP_OBJECT (win_main, hbox10, "hbox10");
  GLADE_HOOKUP_OBJECT (win_main, progressbar, "progressbar");
  GLADE_HOOKUP_OBJECT (win_main, statusbar, "statusbar");

  return win_main;
}

GtkWidget*
create_win_open (void)
{
  GtkWidget *win_open;
  GtkWidget *ok_button1;
  GtkWidget *cancel_button1;

  win_open = gtk_file_selection_new ("Select File");
  gtk_container_set_border_width (GTK_CONTAINER (win_open), 10);
  gtk_window_set_modal (GTK_WINDOW (win_open), TRUE);

  ok_button1 = GTK_FILE_SELECTION (win_open)->ok_button;
  gtk_widget_show (ok_button1);
  GTK_WIDGET_SET_FLAGS (ok_button1, GTK_CAN_DEFAULT);

  cancel_button1 = GTK_FILE_SELECTION (win_open)->cancel_button;
  gtk_widget_show (cancel_button1);
  GTK_WIDGET_SET_FLAGS (cancel_button1, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) win_open, "delete_event",
                    G_CALLBACK (on_win_open_delete_event),
                    NULL);
  g_signal_connect ((gpointer) ok_button1, "clicked",
                    G_CALLBACK (on_ok_button1_clicked),
                    NULL);
  g_signal_connect ((gpointer) cancel_button1, "clicked",
                    G_CALLBACK (on_cancel_button1_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (win_open, win_open, "win_open");
  GLADE_HOOKUP_OBJECT_NO_REF (win_open, ok_button1, "ok_button1");
  GLADE_HOOKUP_OBJECT_NO_REF (win_open, cancel_button1, "cancel_button1");

  return win_open;
}

GtkWidget*
create_win_settings (void)
{
  GtkWidget *win_settings;
  GtkWidget *vbox4;
  GtkWidget *drawingarea;
  GtkWidget *table5;
  GtkWidget *vbox5;
  GtkWidget *hbuttonbox2;
  GtkWidget *button_settings_previous;
  GtkWidget *alignment5;
  GtkWidget *hbox12;
  GtkWidget *image7;
  GtkWidget *label22;
  GtkWidget *button_settings_next;
  GtkWidget *alignment6;
  GtkWidget *hbox13;
  GtkWidget *image8;
  GtkWidget *label23;
  GtkWidget *vbox6;
  GtkWidget *hbox17;
  GtkWidget *table8;
  GtkObject *spinbutton_width_adj;
  GtkWidget *spinbutton_width;
  GtkObject *spinbutton_crop_top_adj;
  GtkWidget *spinbutton_crop_top;
  GtkWidget *label26;
  GtkWidget *label25;
  GtkWidget *label24;
  GtkObject *spinbutton_crop_bottom_adj;
  GtkWidget *spinbutton_crop_bottom;
  GtkWidget *table9;
  GtkObject *spinbutton_crop_left_adj;
  GtkWidget *spinbutton_crop_left;
  GtkWidget *label28;
  GtkWidget *label27;
  GtkObject *spinbutton_crop_right_adj;
  GtkWidget *spinbutton_crop_right;
  GtkWidget *checkbutton_deinterlace;
  GtkWidget *hseparator1;
  GtkWidget *table4;
  GtkWidget *button1;
  GtkWidget *alignment4;
  GtkWidget *hbox11;
  GtkWidget *image5;
  GtkWidget *label20;
  GtkWidget *label_settings;

  win_settings = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (win_settings), "Picture settings");
  gtk_window_set_modal (GTK_WINDOW (win_settings), TRUE);

  vbox4 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox4);
  gtk_container_add (GTK_CONTAINER (win_settings), vbox4);

  drawingarea = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea);
  gtk_box_pack_start (GTK_BOX (vbox4), drawingarea, TRUE, TRUE, 10);

  table5 = gtk_table_new (1, 3, FALSE);
  gtk_widget_show (table5);
  gtk_box_pack_start (GTK_BOX (vbox4), table5, TRUE, TRUE, 0);

  vbox5 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox5);
  gtk_table_attach (GTK_TABLE (table5), vbox5, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  hbuttonbox2 = gtk_hbutton_box_new ();
  gtk_widget_show (hbuttonbox2);
  gtk_box_pack_start (GTK_BOX (vbox5), hbuttonbox2, TRUE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_END);

  button_settings_previous = gtk_button_new ();
  gtk_widget_show (button_settings_previous);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), button_settings_previous);
  gtk_widget_set_sensitive (button_settings_previous, FALSE);
  GTK_WIDGET_SET_FLAGS (button_settings_previous, GTK_CAN_DEFAULT);

  alignment5 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment5);
  gtk_container_add (GTK_CONTAINER (button_settings_previous), alignment5);

  hbox12 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox12);
  gtk_container_add (GTK_CONTAINER (alignment5), hbox12);

  image7 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image7);
  gtk_box_pack_start (GTK_BOX (hbox12), image7, FALSE, FALSE, 0);

  label22 = gtk_label_new_with_mnemonic ("Previous");
  gtk_widget_show (label22);
  gtk_box_pack_start (GTK_BOX (hbox12), label22, FALSE, FALSE, 0);

  button_settings_next = gtk_button_new ();
  gtk_widget_show (button_settings_next);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), button_settings_next);
  GTK_WIDGET_SET_FLAGS (button_settings_next, GTK_CAN_DEFAULT);

  alignment6 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment6);
  gtk_container_add (GTK_CONTAINER (button_settings_next), alignment6);

  hbox13 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox13);
  gtk_container_add (GTK_CONTAINER (alignment6), hbox13);

  image8 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image8);
  gtk_box_pack_start (GTK_BOX (hbox13), image8, FALSE, FALSE, 0);

  label23 = gtk_label_new_with_mnemonic ("Next");
  gtk_widget_show (label23);
  gtk_box_pack_start (GTK_BOX (hbox13), label23, FALSE, FALSE, 0);

  vbox6 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox6);
  gtk_table_attach (GTK_TABLE (table5), vbox6, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  hbox17 = gtk_hbox_new (TRUE, 0);
  gtk_widget_show (hbox17);
  gtk_box_pack_start (GTK_BOX (vbox6), hbox17, TRUE, TRUE, 0);

  table8 = gtk_table_new (3, 3, FALSE);
  gtk_widget_show (table8);
  gtk_box_pack_start (GTK_BOX (hbox17), table8, TRUE, TRUE, 5);

  spinbutton_width_adj = gtk_adjustment_new (0, 0, 4096, 16, 16, 10);
  spinbutton_width = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_width_adj), 1, 0);
  gtk_widget_show (spinbutton_width);
  gtk_table_attach (GTK_TABLE (table8), spinbutton_width, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton_width), TRUE);

  spinbutton_crop_top_adj = gtk_adjustment_new (0, 0, 4096, 2, 10, 10);
  spinbutton_crop_top = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_crop_top_adj), 1, 0);
  gtk_widget_show (spinbutton_crop_top);
  gtk_table_attach (GTK_TABLE (table8), spinbutton_crop_top, 2, 3, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label26 = gtk_label_new ("Bottom crop");
  gtk_widget_show (label26);
  gtk_table_attach (GTK_TABLE (table8), label26, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label26), 0, 0.5);

  label25 = gtk_label_new ("Top crop");
  gtk_widget_show (label25);
  gtk_table_attach (GTK_TABLE (table8), label25, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label25), 0, 0.5);

  label24 = gtk_label_new ("Picture width");
  gtk_widget_show (label24);
  gtk_table_attach (GTK_TABLE (table8), label24, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  spinbutton_crop_bottom_adj = gtk_adjustment_new (0, 0, 4096, 2, 10, 10);
  spinbutton_crop_bottom = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_crop_bottom_adj), 1, 0);
  gtk_widget_show (spinbutton_crop_bottom);
  gtk_table_attach (GTK_TABLE (table8), spinbutton_crop_bottom, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  table9 = gtk_table_new (3, 3, FALSE);
  gtk_widget_show (table9);
  gtk_box_pack_start (GTK_BOX (hbox17), table9, TRUE, TRUE, 5);

  spinbutton_crop_left_adj = gtk_adjustment_new (0, 0, 4096, 2, 10, 10);
  spinbutton_crop_left = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_crop_left_adj), 1, 0);
  gtk_widget_show (spinbutton_crop_left);
  gtk_table_attach (GTK_TABLE (table9), spinbutton_crop_left, 2, 3, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label28 = gtk_label_new ("Right crop");
  gtk_widget_show (label28);
  gtk_table_attach (GTK_TABLE (table9), label28, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label28), 0, 0.5);

  label27 = gtk_label_new ("Left crop");
  gtk_widget_show (label27);
  gtk_table_attach (GTK_TABLE (table9), label27, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label27), 0, 0.5);

  spinbutton_crop_right_adj = gtk_adjustment_new (0, 0, 4096, 2, 10, 10);
  spinbutton_crop_right = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_crop_right_adj), 1, 0);
  gtk_widget_show (spinbutton_crop_right);
  gtk_table_attach (GTK_TABLE (table9), spinbutton_crop_right, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  checkbutton_deinterlace = gtk_check_button_new_with_mnemonic ("deinterlace");
  gtk_widget_show (checkbutton_deinterlace);
  gtk_table_attach (GTK_TABLE (table9), checkbutton_deinterlace, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  hseparator1 = gtk_hseparator_new ();
  gtk_widget_show (hseparator1);
  gtk_box_pack_start (GTK_BOX (vbox4), hseparator1, FALSE, TRUE, 0);

  table4 = gtk_table_new (1, 2, FALSE);
  gtk_widget_show (table4);
  gtk_box_pack_start (GTK_BOX (vbox4), table4, FALSE, TRUE, 5);

  button1 = gtk_button_new ();
  gtk_widget_show (button1);
  gtk_table_attach (GTK_TABLE (table4), button1, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  alignment4 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment4);
  gtk_container_add (GTK_CONTAINER (button1), alignment4);

  hbox11 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox11);
  gtk_container_add (GTK_CONTAINER (alignment4), hbox11);

  image5 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image5);
  gtk_box_pack_start (GTK_BOX (hbox11), image5, FALSE, FALSE, 0);

  label20 = gtk_label_new_with_mnemonic ("Ok");
  gtk_widget_show (label20);
  gtk_box_pack_start (GTK_BOX (hbox11), label20, FALSE, FALSE, 0);

  label_settings = gtk_label_new ("label21");
  gtk_widget_show (label_settings);
  gtk_table_attach (GTK_TABLE (table4), label_settings, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label_settings), 0, 0.5);

  g_signal_connect ((gpointer) win_settings, "delete_event",
                    G_CALLBACK (on_win_settings_delete_event),
                    NULL);
  g_signal_connect ((gpointer) button_settings_previous, "clicked",
                    G_CALLBACK (on_button_settings_previous_clicked),
                    NULL);
  g_signal_connect ((gpointer) button_settings_next, "clicked",
                    G_CALLBACK (on_button_settings_next_clicked),
                    NULL);
  g_signal_connect ((gpointer) spinbutton_width, "value_changed",
                    G_CALLBACK (on_spinbutton_width_value_changed),
                    NULL);
  g_signal_connect ((gpointer) spinbutton_crop_top, "value_changed",
                    G_CALLBACK (on_spinbutton_crop_top_value_changed),
                    NULL);
  g_signal_connect ((gpointer) spinbutton_crop_bottom, "value_changed",
                    G_CALLBACK (on_spinbutton_crop_bottom_value_changed),
                    NULL);
  g_signal_connect ((gpointer) spinbutton_crop_left, "value_changed",
                    G_CALLBACK (on_spinbutton_crop_left_value_changed),
                    NULL);
  g_signal_connect ((gpointer) spinbutton_crop_right, "value_changed",
                    G_CALLBACK (on_spinbutton_crop_right_value_changed),
                    NULL);
  g_signal_connect ((gpointer) checkbutton_deinterlace, "toggled",
                    G_CALLBACK (on_checkbutton_deinterlace_toggled),
                    NULL);
  g_signal_connect ((gpointer) button1, "clicked",
                    G_CALLBACK (on_button_ok_settings_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (win_settings, win_settings, "win_settings");
  GLADE_HOOKUP_OBJECT (win_settings, vbox4, "vbox4");
  GLADE_HOOKUP_OBJECT (win_settings, drawingarea, "drawingarea");
  GLADE_HOOKUP_OBJECT (win_settings, table5, "table5");
  GLADE_HOOKUP_OBJECT (win_settings, vbox5, "vbox5");
  GLADE_HOOKUP_OBJECT (win_settings, hbuttonbox2, "hbuttonbox2");
  GLADE_HOOKUP_OBJECT (win_settings, button_settings_previous, "button_settings_previous");
  GLADE_HOOKUP_OBJECT (win_settings, alignment5, "alignment5");
  GLADE_HOOKUP_OBJECT (win_settings, hbox12, "hbox12");
  GLADE_HOOKUP_OBJECT (win_settings, image7, "image7");
  GLADE_HOOKUP_OBJECT (win_settings, label22, "label22");
  GLADE_HOOKUP_OBJECT (win_settings, button_settings_next, "button_settings_next");
  GLADE_HOOKUP_OBJECT (win_settings, alignment6, "alignment6");
  GLADE_HOOKUP_OBJECT (win_settings, hbox13, "hbox13");
  GLADE_HOOKUP_OBJECT (win_settings, image8, "image8");
  GLADE_HOOKUP_OBJECT (win_settings, label23, "label23");
  GLADE_HOOKUP_OBJECT (win_settings, vbox6, "vbox6");
  GLADE_HOOKUP_OBJECT (win_settings, hbox17, "hbox17");
  GLADE_HOOKUP_OBJECT (win_settings, table8, "table8");
  GLADE_HOOKUP_OBJECT (win_settings, spinbutton_width, "spinbutton_width");
  GLADE_HOOKUP_OBJECT (win_settings, spinbutton_crop_top, "spinbutton_crop_top");
  GLADE_HOOKUP_OBJECT (win_settings, label26, "label26");
  GLADE_HOOKUP_OBJECT (win_settings, label25, "label25");
  GLADE_HOOKUP_OBJECT (win_settings, label24, "label24");
  GLADE_HOOKUP_OBJECT (win_settings, spinbutton_crop_bottom, "spinbutton_crop_bottom");
  GLADE_HOOKUP_OBJECT (win_settings, table9, "table9");
  GLADE_HOOKUP_OBJECT (win_settings, spinbutton_crop_left, "spinbutton_crop_left");
  GLADE_HOOKUP_OBJECT (win_settings, label28, "label28");
  GLADE_HOOKUP_OBJECT (win_settings, label27, "label27");
  GLADE_HOOKUP_OBJECT (win_settings, spinbutton_crop_right, "spinbutton_crop_right");
  GLADE_HOOKUP_OBJECT (win_settings, checkbutton_deinterlace, "checkbutton_deinterlace");
  GLADE_HOOKUP_OBJECT (win_settings, hseparator1, "hseparator1");
  GLADE_HOOKUP_OBJECT (win_settings, table4, "table4");
  GLADE_HOOKUP_OBJECT (win_settings, button1, "button1");
  GLADE_HOOKUP_OBJECT (win_settings, alignment4, "alignment4");
  GLADE_HOOKUP_OBJECT (win_settings, hbox11, "hbox11");
  GLADE_HOOKUP_OBJECT (win_settings, image5, "image5");
  GLADE_HOOKUP_OBJECT (win_settings, label20, "label20");
  GLADE_HOOKUP_OBJECT (win_settings, label_settings, "label_settings");

  return win_settings;
}