]> granicus.if.org Git - handbrake/commitdiff
PixelRatio Test branch with mp4 working and latest contrib libs
authorprigaux <pri@nopapers.org>
Thu, 18 Jan 2007 10:34:42 +0000 (10:34 +0000)
committerprigaux <pri@nopapers.org>
Thu, 18 Jan 2007 10:34:42 +0000 (10:34 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/PixelRatioWorking@172 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk2/callbacks.c [new file with mode: 0644]
gtk2/callbacks.h [new file with mode: 0644]
gtk2/gtk2hb.glade [new file with mode: 0644]
gtk2/interface.c [new file with mode: 0644]
gtk2/interface.h [new file with mode: 0644]
gtk2/main.c [new file with mode: 0644]
gtk2/status.h [new file with mode: 0644]
gtk2/support.c [new file with mode: 0644]
gtk2/support.h [new file with mode: 0644]

diff --git a/gtk2/callbacks.c b/gtk2/callbacks.c
new file mode 100644 (file)
index 0000000..8237342
--- /dev/null
@@ -0,0 +1,623 @@
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include "../core/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)
+
+
+static int i_settings_preview_picture;
+static int i_settings_width = 0;
+static int i_settings_crop_top = 0;
+static int i_settings_crop_bottom = 0;
+static int i_settings_crop_left = 0;
+static int i_settings_crop_right = 0;
+static int b_settings_deinterlace = 0;
+
+gboolean on_win_main_delete_event      (GtkWidget       *widget,
+                                        GdkEvent        *event,
+                                        gpointer         user_data)
+{
+    HBClose( &hb_handle );
+
+    hb_handle = NULL;
+
+    gtk_main_quit();
+    return FALSE;
+}
+
+
+void on_button_browse_device              (GtkButton       *button,
+                                        gpointer         user_data)
+{
+    GtkWidget *win_open;
+
+    /* Create the open window */
+    win_open = create_win_open();
+    gtk_object_set_data( GTK_OBJECT(win_open), "entry", "entry_device" );
+    gtk_widget_show( win_open );
+    gdk_window_raise( win_open->window );
+}
+
+/***
+ * Open file dialog box handle (you should have set entry to the right entry name of hb_win_main
+ */
+gboolean on_win_open_delete_event      (GtkWidget       *widget,
+                                        GdkEvent        *event,
+                                        gpointer         user_data)
+{
+    GtkWidget *win_open = gtk_widget_get_toplevel( GTK_WIDGET (widget) );
+
+    gtk_widget_destroy( win_open );
+    return FALSE;
+}
+
+void on_ok_button1_clicked             (GtkButton       *button,
+                                        gpointer         user_data)
+{
+    GtkWidget *win_open = gtk_widget_get_toplevel( GTK_WIDGET (button) );
+
+    char       *psz_entry = gtk_object_get_data( GTK_OBJECT( win_open ), "entry" );
+    const char *psz_file = gtk_file_selection_get_filename( GTK_FILE_SELECTION( win_open ) );
+
+    GtkWidget *entry = lookup_widget( hb_win_main, psz_entry );
+
+    gtk_entry_set_text( GTK_ENTRY( entry ), psz_file );
+    if( !strcmp( psz_entry, "entry_device" ) && *psz_file )
+    {
+        /* Feed libhb with a device */
+        HBScanDVD( hb_handle, psz_file, 0 );
+    }
+    gtk_widget_destroy( win_open );
+}
+
+
+void on_cancel_button1_clicked         (GtkButton       *button,
+                                        gpointer         user_data)
+{
+    GtkWidget *win_open = gtk_widget_get_toplevel( GTK_WIDGET (button) );
+    gtk_widget_destroy( win_open );
+}
+
+void on_entry_device_activate( GtkEntry        *entry,
+                               gpointer         user_data)
+{
+    const char *psz_file = gtk_entry_get_text( GTK_ENTRY( entry ) );
+
+    /* Feed libhb with a device */
+    if( *psz_file )
+    {
+        HBScanDVD( hb_handle, psz_file, 0 );
+    }
+}
+
+static void menu_language_new( GtkOptionMenu *optionmenu, char *name, HBTitle *title, int i_default )
+{
+    int i;
+
+    /* build audio menu */
+    GtkWidget *menu = gtk_menu_new();
+    GtkWidget *item;
+
+    item = gtk_menu_item_new_with_mnemonic( "None" );
+    gtk_widget_show( item );
+    gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
+
+    for( i = 0; i < HBListCount( title->audioList ); i++ )
+    {
+        HBAudio *audio = (HBAudio*) HBListItemAt( title->audioList, i );
+
+        item = gtk_menu_item_new_with_mnemonic( audio->language );
+        gtk_widget_show( item );
+        gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
+    }
+
+    gtk_option_menu_set_menu( GTK_OPTION_MENU(optionmenu), menu );
+    GLADE_HOOKUP_OBJECT( hb_win_main, menu, name );
+
+    gtk_option_menu_set_history( GTK_OPTION_MENU(optionmenu), i_default );
+}
+
+void on_optionmenu_title_changed( GtkOptionMenu   *optionmenu,
+                                  gpointer         user_data)
+{
+    GtkWidget *optionmenu_language = lookup_widget( hb_win_main, "optionmenu_language" );
+    GtkWidget *optionmenu_language2 = lookup_widget( hb_win_main, "optionmenu_language2" );
+
+    HBTitle *title;
+
+    int i = gtk_option_menu_get_history( optionmenu );
+
+    title = (HBTitle*) HBListItemAt( hb_status->titleList, i );
+
+    /* FIXME is it ok ?*/
+    gtk_option_menu_remove_menu( GTK_OPTION_MENU(optionmenu_language) );
+    gtk_option_menu_remove_menu( GTK_OPTION_MENU(optionmenu_language2) );
+
+    if( title )
+    {
+        /* build audio menu */
+        menu_language_new( GTK_OPTION_MENU(optionmenu_language), "menu_language", title, 1 );
+        menu_language_new( GTK_OPTION_MENU(optionmenu_language2), "menu_language2", title, 0 );
+    }
+}
+
+
+
+
+
+
+
+void on_button_browse_file_clicked( GtkButton       *button,
+                                    gpointer         user_data)
+{
+    GtkWidget *win_open;
+
+    /* Create the open window */
+    win_open = create_win_open();
+    gtk_object_set_data( GTK_OBJECT(win_open), "entry", "entry_file" );
+    gtk_widget_show( win_open );
+    gdk_window_raise( win_open->window );
+}
+
+
+static void on_settings_darea_expose_event_callback( GtkWidget *widget, GdkEventExpose *event, gpointer data )
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(widget) );
+    char label[1024];
+
+    int i;
+    uint8_t *rgba;
+
+    GtkWidget *optionmenu_title = lookup_widget( hb_win_main, "optionmenu_title" );
+    HBTitle   *title;
+
+    title = HBListItemAt( hb_status->titleList, gtk_option_menu_get_history( GTK_OPTION_MENU(optionmenu_title) ) );
+    title->deinterlace = b_settings_deinterlace;
+    title->outWidth = i_settings_width;
+
+    title->topCrop = i_settings_crop_top;
+    title->bottomCrop = i_settings_crop_bottom;
+    title->leftCrop = i_settings_crop_left;
+    title->rightCrop = i_settings_crop_right;
+
+    rgba = HBGetPreview( hb_handle, title, i_settings_preview_picture );
+
+    if( title->outWidth != i_settings_width ||
+        title->topCrop != i_settings_crop_top ||
+        title->bottomCrop != i_settings_crop_bottom ||
+        title->leftCrop != i_settings_crop_left ||
+        title->rightCrop != i_settings_crop_right )
+    {
+        i_settings_width = title->outWidth;
+
+        i_settings_crop_top = title->topCrop;
+        i_settings_crop_bottom = title->bottomCrop;
+        i_settings_crop_left = title->leftCrop;
+        i_settings_crop_right = title->rightCrop;
+
+        gtk_spin_button_set_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_width")), i_settings_width );
+        gtk_spin_button_set_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_crop_top")), i_settings_crop_top );
+        gtk_spin_button_set_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_crop_bottom")), i_settings_crop_bottom );
+        gtk_spin_button_set_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_crop_left")), i_settings_crop_left );
+        gtk_spin_button_set_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_crop_right")), i_settings_crop_right );
+    }
+
+    sprintf( label, "Final size: %dx%d", title->outWidth, title->outHeight );
+    gtk_label_set_text( GTK_LABEL(lookup_widget(win, "label_settings")), label );
+
+    /* FIXME do that only under x86 */
+    for( i = 0; i < (title->outWidthMax + 2)*(title->outHeightMax + 2); i++ )
+    {
+        const uint8_t r = rgba[4*i+2];
+        const uint8_t g = rgba[4*i+1];
+        const uint8_t b = rgba[4*i+0];
+        const uint8_t a = rgba[4*i+3];
+
+        rgba[4*i+0] = r;
+        rgba[4*i+1] = g;
+        rgba[4*i+2] = b;
+        rgba[4*i+3] = a;
+    }
+    gdk_draw_rgb_32_image( widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
+                           0, 0, title->outWidthMax + 2, title->outHeightMax + 2,
+                           GDK_RGB_DITHER_MAX,
+                           rgba,
+                           (title->outWidthMax+2) * 4 );
+
+    free( rgba );
+}
+
+void on_spinbutton_width_value_changed( GtkSpinButton   *spinbutton,
+                                        gpointer         user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(spinbutton) );
+
+    g_print( "on_spinbutton_width_value_changed\n" );
+
+    i_settings_width = gtk_spin_button_get_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_width")) );
+
+    gtk_widget_queue_draw( lookup_widget(win, "drawingarea" ) );
+
+}
+/*
+ * FIXME use only one callback
+ */
+void
+on_spinbutton_crop_top_value_changed   (GtkSpinButton   *spinbutton,
+                                        gpointer         user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(spinbutton) );
+
+    i_settings_crop_top = gtk_spin_button_get_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_crop_top")) );
+
+    gtk_widget_queue_draw( lookup_widget(win, "drawingarea" ) );
+}
+
+
+void
+on_spinbutton_crop_bottom_value_changed
+                                        (GtkSpinButton   *spinbutton,
+                                        gpointer         user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(spinbutton) );
+
+    i_settings_crop_bottom = gtk_spin_button_get_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_crop_bottom")) );
+
+    gtk_widget_queue_draw( lookup_widget(win, "drawingarea" ) );
+}
+
+
+void
+on_spinbutton_crop_left_value_changed  (GtkSpinButton   *spinbutton,
+                                        gpointer         user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(spinbutton) );
+
+    i_settings_crop_left = gtk_spin_button_get_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_crop_left")) );
+
+    gtk_widget_queue_draw( lookup_widget(win, "drawingarea" ) );
+}
+
+
+void
+on_spinbutton_crop_right_value_changed (GtkSpinButton   *spinbutton,
+                                        gpointer         user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(spinbutton) );
+
+    i_settings_crop_right = gtk_spin_button_get_value( GTK_SPIN_BUTTON(lookup_widget(win, "spinbutton_crop_right")) );
+
+    gtk_widget_queue_draw( lookup_widget(win, "drawingarea" ) );
+}
+
+
+void on_button_settings_clicked( GtkButton       *button,
+                                 gpointer         user_data)
+{
+    GtkWidget *optionmenu_title = lookup_widget( hb_win_main, "optionmenu_title" );
+    HBTitle   *title;
+
+    GtkWidget *settings = create_win_settings();
+    GtkWidget *darea = lookup_widget( settings, "drawingarea" );
+
+    title = HBListItemAt( hb_status->titleList, gtk_option_menu_get_history( GTK_OPTION_MENU(optionmenu_title) ) );
+
+    i_settings_preview_picture = 0;
+
+    gtk_widget_set_size_request( darea, title->outWidthMax + 2, title->outHeightMax + 2 );
+
+    g_signal_connect (G_OBJECT(darea), "expose_event",
+                    G_CALLBACK (on_settings_darea_expose_event_callback), NULL);
+
+    gtk_spin_button_set_value( GTK_SPIN_BUTTON(lookup_widget(settings, "spinbutton_width")), title->outWidth );
+
+    gtk_widget_show( settings );
+}
+
+static void DisplayError( char *title, char *msg )
+{
+    GtkWidget *dialog;
+
+    dialog = gtk_message_dialog_new( NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+                                    "<b>%s</b>\n\n%s", title, msg );
+    gtk_label_set_use_markup( GTK_LABEL( GTK_MESSAGE_DIALOG(dialog)->label), TRUE );
+    gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK );
+    gtk_window_set_modal( GTK_WINDOW(dialog), TRUE );
+    gtk_dialog_run( GTK_DIALOG(dialog) );
+    gtk_widget_destroy( dialog );
+}
+
+void on_button_start_clicked( GtkButton       *button,
+                              gpointer         user_data)
+{
+    int        i;
+
+    if( hb_status->i_state != HB_STATE_ENCODING )
+    {
+        GtkWidget *optionmenu_title = lookup_widget( hb_win_main, "optionmenu_title" );
+        GtkWidget *widget;
+        HBTitle   *title = HBListItemAt( hb_status->titleList, gtk_option_menu_get_history( GTK_OPTION_MENU(optionmenu_title) ) );
+
+        int i_ab;
+
+        widget = lookup_widget( hb_win_main, "entry_file" );
+        title->file = strdup( gtk_entry_get_text( GTK_ENTRY(widget) ) );
+
+        if( title->file == NULL || *title->file == '\0' )
+        {
+            DisplayError( "Missing parameters", "You need to specify a file" );
+            return;
+        }
+
+        widget = lookup_widget( hb_win_main, "checkbutton_2pass" );
+        title->twoPass = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget) );
+
+        title->deinterlace = b_settings_deinterlace;
+
+        title->outWidth = i_settings_width;
+
+        title->topCrop = i_settings_crop_top;
+        title->bottomCrop = i_settings_crop_bottom;
+        title->leftCrop = i_settings_crop_left;
+        title->rightCrop = i_settings_crop_right;
+
+        widget = lookup_widget( hb_win_main, "radiobutton_cbitrate" );
+        if( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON( widget ) ) )
+        {
+            widget = lookup_widget( hb_win_main, "spinbutton_bitrate" );
+            title->bitrate = gtk_spin_button_get_value( GTK_SPIN_BUTTON( widget ) );
+        }
+        else
+        {
+            int i_size;
+            widget = lookup_widget( hb_win_main, "spinbutton_size" );
+            i_size = gtk_spin_button_get_value( GTK_SPIN_BUTTON( widget ) );
+
+            /* FIXME FIXME target size FIXME FIXME */
+            title->bitrate = 1024;
+            /* FIXME */
+        }
+
+        widget = lookup_widget( hb_win_main, "optionmenu_codec" );
+        switch( gtk_option_menu_get_history( GTK_OPTION_MENU(widget) ) )
+        {
+            case 0:
+                title->codec = HB_CODEC_FFMPEG;
+                break;
+            case 1:
+                title->codec = HB_CODEC_XVID;
+                break;
+            case 2:
+                title->codec = HB_CODEC_X264;
+                break;
+        }
+
+        widget = lookup_widget( hb_win_main, "optionmenu_format" );
+        switch( gtk_option_menu_get_history( GTK_OPTION_MENU(widget) ) )
+        {
+            case 0:
+            {
+                /* Auto detect */
+                char *p = strrchr( title->file, '.' );
+                if( p && !strcasecmp( p, ".avi" ) )
+                {
+                    title->mux = HB_MUX_AVI;
+                }
+                else if( p && !strcasecmp( p, ".mp4" ) )
+                {
+                    title->mux = HB_MUX_MP4;
+                }
+                else if( p && !strcasecmp( p, ".ogm" ) )
+                {
+                    title->mux = HB_MUX_OGM;
+                }
+                else
+                {
+                    title->mux = HB_MUX_AVI;
+                }
+                break;
+            }
+            case 1:
+                title->mux = HB_MUX_AVI;
+                break;
+            case 2:
+                title->mux = HB_MUX_MP4;
+                break;
+            case 3:
+                title->mux = HB_MUX_OGM;
+                break;
+        }
+
+        /* audio */
+        widget = lookup_widget( hb_win_main, "optionmenu_bitrate" );
+        switch( gtk_option_menu_get_history( GTK_OPTION_MENU(widget) ) )
+        {
+            case 0:
+                i_ab = 64;
+                break;
+            case 1:
+                i_ab = 92;
+                break;
+            case 2:
+                i_ab = 128;
+                break;
+            case 3:
+                i_ab = 160;
+                break;
+            case 4:
+                i_ab = 192;
+                break;
+            case 5:
+                i_ab = 256;
+                break;
+            case 6:
+            default:
+                i_ab = 320;
+                break;
+
+        }
+
+        HBListInit( &title->ripAudioList );
+        widget = lookup_widget( hb_win_main, "optionmenu_language" );
+        if( ( i = gtk_option_menu_get_history( GTK_OPTION_MENU(widget) ) ) > 0 )
+        {
+            HBAudio   *audio = HBListItemAt( title->audioList, i - 1 );
+
+            audio->outBitrate = i_ab;
+            if( title->mux == HB_MUX_AVI )
+            {
+                audio->outCodec = HB_CODEC_MP3;
+            }
+            else if( title->mux == HB_MUX_MP4 )
+            {
+                audio->outCodec = HB_CODEC_AAC;
+            }
+            else if( title->mux == HB_MUX_OGM )
+            {
+                audio->outCodec = HB_CODEC_VORBIS;
+            }
+            HBListAdd( title->ripAudioList, audio );
+        }
+
+        widget = lookup_widget( hb_win_main, "optionmenu_language2" );
+        if( ( i = gtk_option_menu_get_history( GTK_OPTION_MENU(widget) ) ) > 0 )
+        {
+            HBAudio   *audio = HBListItemAt( title->audioList, i - 1 );
+
+            audio->outBitrate = i_ab;
+            if( title->mux == HB_MUX_AVI )
+            {
+                audio->outCodec = HB_CODEC_MP3;
+            }
+            else if( title->mux == HB_MUX_MP4 )
+            {
+                audio->outCodec = HB_CODEC_AAC;
+            }
+            else if( title->mux == HB_MUX_OGM )
+            {
+                audio->outCodec = HB_CODEC_VORBIS;
+            }
+            HBListAdd( title->ripAudioList, audio );
+        }
+        HBStartRip( hb_handle, title );
+    }
+    else if( hb_status->i_state == HB_STATE_ENCODING )
+    {
+        HBStopRip( hb_handle );
+    }
+}
+
+
+void on_entry_file_activate( GtkEntry        *entry,
+                             gpointer         user_data)
+{
+#if 0
+    GtkWidget *widget = lookup_widget( hb_win_main, "button_start" );
+    char *psz_file = gtk_entry_get_text( entry );
+
+    if( psz_file && *psz_file )
+    {
+        gtk_widget_set_sensitive( widget, TRUE );
+    }
+    else
+    {
+        gtk_widget_set_sensitive( widget, FALSE );
+    }
+#endif
+}
+
+
+static void SettingsUpdate( GtkWidget *win )
+{
+    b_settings_deinterlace = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(lookup_widget(win, "checkbutton_deinterlace")) );
+}
+
+gboolean on_win_settings_delete_event( GtkWidget       *widget,
+                                       GdkEvent        *event,
+                                       gpointer         user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET (widget) );
+
+    SettingsUpdate( win );
+    gtk_widget_destroy( win );
+
+    return FALSE;
+}
+
+
+void on_button_ok_settings_clicked( GtkButton       *button,
+                                    gpointer         user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(button) );
+
+    SettingsUpdate( win );
+
+    gtk_widget_destroy( win );
+}
+
+
+void on_button_settings_next_clicked( GtkButton       *button,
+                                      gpointer         user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(button) );
+
+    if( i_settings_preview_picture < 9 )
+    {
+        i_settings_preview_picture++;
+        gtk_widget_queue_draw( lookup_widget(win, "drawingarea" ) );
+    }
+
+    if( i_settings_preview_picture == 9 )
+    {
+        gtk_widget_set_sensitive( lookup_widget(win, "button_settings_next"), FALSE );
+    }
+    if( i_settings_preview_picture > 0 )
+    {
+        gtk_widget_set_sensitive( lookup_widget(win, "button_settings_previous"), TRUE );
+    }
+}
+
+
+void on_button_settings_previous_clicked( GtkButton *button,
+                                          gpointer   user_data)
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(button) );
+
+    if( i_settings_preview_picture > 0 )
+    {
+        i_settings_preview_picture--;
+        gtk_widget_queue_draw( lookup_widget(win, "drawingarea" ) );
+    }
+
+    if( i_settings_preview_picture < 9 )
+    {
+        gtk_widget_set_sensitive( lookup_widget(win, "button_settings_next"), TRUE );
+    }
+    if( i_settings_preview_picture == 0 )
+    {
+        gtk_widget_set_sensitive( lookup_widget(win, "button_settings_previous"), FALSE );
+    }
+}
+
+
+void on_checkbutton_deinterlace_toggled( GtkToggleButton *togglebutton,
+                                         gpointer         user_data )
+{
+    GtkWidget *win = gtk_widget_get_toplevel( GTK_WIDGET(togglebutton) );
+    b_settings_deinterlace = gtk_toggle_button_get_active( togglebutton );
+    gtk_widget_queue_draw( lookup_widget(win, "drawingarea" ) );
+}
+
+
diff --git a/gtk2/callbacks.h b/gtk2/callbacks.h
new file mode 100644 (file)
index 0000000..7040f35
--- /dev/null
@@ -0,0 +1,75 @@
+#include <gtk/gtk.h>
+
+extern GtkWidget *hb_win_main;
+extern HBHandle  *hb_handle;
+extern HBStatus  *hb_status;
+
+gboolean on_win_main_delete_event( GtkWidget       *widget,
+                                   GdkEvent        *event,
+                                   gpointer         user_data);
+
+gboolean on_win_open_delete_event      (GtkWidget       *widget,
+                                        GdkEvent        *event,
+                                        gpointer         user_data);
+
+
+void on_button_browse_device                   (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_ok_button1_clicked                  (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_cancel_button1_clicked              (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_entry_device_activate               (GtkEntry        *entry,
+                                        gpointer         user_data);
+
+void on_optionmenu_title_changed            (GtkOptionMenu   *optionmenu,
+                                        gpointer         user_data);
+
+void on_button_browse_file_clicked          (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_button_settings_clicked             (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_button_start_clicked                (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_entry_file_activate                 (GtkEntry        *entry,
+                                        gpointer         user_data);
+
+gboolean on_win_settings_delete_event           (GtkWidget       *widget,
+                                        GdkEvent        *event,
+                                        gpointer         user_data);
+
+void on_button_ok_settings_clicked          (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_button_settings_next_clicked        (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_button_settings_previous_clicked    (GtkButton       *button,
+                                        gpointer         user_data);
+
+void on_checkbutton_deinterlace_toggled     (GtkToggleButton *togglebutton,
+                                        gpointer         user_data);
+void on_spinbutton_width_value_changed( GtkSpinButton   *spinbutton,
+                                        gpointer         user_data);
+
+void on_spinbutton_crop_top_value_changed   (GtkSpinButton   *spinbutton,
+                                         gpointer         user_data);
+
+void on_spinbutton_crop_bottom_value_changed
+                                        (GtkSpinButton   *spinbutton,
+                                        gpointer         user_data);
+
+void
+on_spinbutton_crop_left_value_changed  (GtkSpinButton   *spinbutton,
+                                        gpointer         user_data);
+
+void
+on_spinbutton_crop_right_value_changed (GtkSpinButton   *spinbutton,
+                                        gpointer         user_data);
+
diff --git a/gtk2/gtk2hb.glade b/gtk2/gtk2hb.glade
new file mode 100644 (file)
index 0000000..50b3e81
--- /dev/null
@@ -0,0 +1,1863 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="win_main">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">HandBrake</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <signal name="delete_event" handler="on_win_main_delete_event" last_modification_time="Fri, 05 Dec 2003 23:54:16 GMT"/>
+
+  <child>
+    <widget class="GtkVBox" id="vbox1">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child>
+       <widget class="GtkFrame" id="frame_dvd">
+         <property name="visible">True</property>
+         <property name="label_xalign">0</property>
+         <property name="label_yalign">0.5</property>
+         <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+         <child>
+           <widget class="GtkVBox" id="vbox11">
+             <property name="border_width">5</property>
+             <property name="visible">True</property>
+             <property name="homogeneous">False</property>
+             <property name="spacing">0</property>
+
+             <child>
+               <widget class="GtkAlignment" id="alignment13">
+                 <property name="visible">True</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">1</property>
+                 <property name="xscale">1</property>
+                 <property name="yscale">1</property>
+
+                 <child>
+                   <widget class="GtkHBox" id="hbox1">
+                     <property name="visible">True</property>
+                     <property name="homogeneous">False</property>
+                     <property name="spacing">0</property>
+
+                     <child>
+                       <widget class="GtkLabel" id="label3">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Device </property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">True</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkCombo" id="combo1">
+                         <property name="visible">True</property>
+                         <property name="value_in_list">False</property>
+                         <property name="allow_empty">True</property>
+                         <property name="case_sensitive">False</property>
+                         <property name="enable_arrow_keys">True</property>
+                         <property name="enable_arrows_always">False</property>
+
+                         <child internal-child="entry">
+                           <widget class="GtkEntry" id="entry_device">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="editable">True</property>
+                             <property name="visibility">True</property>
+                             <property name="max_length">0</property>
+                             <property name="text" translatable="yes"></property>
+                             <property name="has_frame">True</property>
+                             <property name="invisible_char" translatable="yes">*</property>
+                             <property name="activates_default">False</property>
+                             <signal name="activate" handler="on_entry_device_activate" last_modification_time="Sat, 06 Dec 2003 02:59:59 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child internal-child="list">
+                           <widget class="GtkList" id="combo-list1">
+                             <property name="visible">True</property>
+                             <property name="selection_mode">GTK_SELECTION_BROWSE</property>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">True</property>
+                         <property name="fill">True</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkButton" id="button_browse_device">
+                         <property name="visible">True</property>
+                         <property name="can_default">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="relief">GTK_RELIEF_NORMAL</property>
+                         <signal name="clicked" handler="on_button_browse_device" last_modification_time="Sat, 06 Dec 2003 02:19:48 GMT"/>
+
+                         <child>
+                           <widget class="GtkAlignment" id="alignment1">
+                             <property name="visible">True</property>
+                             <property name="xalign">0.5</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xscale">0</property>
+                             <property name="yscale">0</property>
+
+                             <child>
+                               <widget class="GtkHBox" id="hbox2">
+                                 <property name="visible">True</property>
+                                 <property name="homogeneous">False</property>
+                                 <property name="spacing">2</property>
+
+                                 <child>
+                                   <widget class="GtkImage" id="image1">
+                                     <property name="visible">True</property>
+                                     <property name="stock">gtk-open</property>
+                                     <property name="icon_size">4</property>
+                                     <property name="xalign">0.5</property>
+                                     <property name="yalign">0.5</property>
+                                     <property name="xpad">0</property>
+                                     <property name="ypad">0</property>
+                                   </widget>
+                                   <packing>
+                                     <property name="padding">0</property>
+                                     <property name="expand">False</property>
+                                     <property name="fill">False</property>
+                                   </packing>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkLabel" id="label4">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">Browse</property>
+                                     <property name="use_underline">True</property>
+                                     <property name="use_markup">False</property>
+                                     <property name="justify">GTK_JUSTIFY_LEFT</property>
+                                     <property name="wrap">False</property>
+                                     <property name="selectable">False</property>
+                                     <property name="xalign">0.5</property>
+                                     <property name="yalign">0.5</property>
+                                     <property name="xpad">0</property>
+                                     <property name="ypad">0</property>
+                                   </widget>
+                                   <packing>
+                                     <property name="padding">0</property>
+                                     <property name="expand">False</property>
+                                     <property name="fill">False</property>
+                                   </packing>
+                                 </child>
+                               </widget>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">False</property>
+                       </packing>
+                     </child>
+                   </widget>
+                 </child>
+               </widget>
+               <packing>
+                 <property name="padding">0</property>
+                 <property name="expand">True</property>
+                 <property name="fill">False</property>
+               </packing>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label1">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">DVD</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0.5</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="type">label_item</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">True</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkVBox" id="vbox_parameters">
+         <property name="homogeneous">False</property>
+         <property name="spacing">0</property>
+
+         <child>
+           <widget class="GtkFrame" id="frame_video">
+             <property name="visible">True</property>
+             <property name="label_xalign">0</property>
+             <property name="label_yalign">0.5</property>
+             <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+             <child>
+               <widget class="GtkHBox" id="hbox18">
+                 <property name="border_width">5</property>
+                 <property name="visible">True</property>
+                 <property name="homogeneous">True</property>
+                 <property name="spacing">0</property>
+
+                 <child>
+                   <widget class="GtkAlignment" id="alignment7">
+                     <property name="visible">True</property>
+                     <property name="xalign">0</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xscale">1</property>
+                     <property name="yscale">1</property>
+
+                     <child>
+                       <widget class="GtkVBox" id="vbox7">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">True</property>
+                         <property name="spacing">0</property>
+
+                         <child>
+                           <widget class="GtkLabel" id="label13">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Title</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="label12">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Codec</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioButton" id="radiobutton_cbitrate">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="label" translatable="yes">Custom bitrate</property>
+                             <property name="use_underline">True</property>
+                             <property name="relief">GTK_RELIEF_NORMAL</property>
+                             <property name="active">True</property>
+                             <property name="inconsistent">False</property>
+                             <property name="draw_indicator">True</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioButton" id="radiobutton_tsize">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="label" translatable="yes">Target size</property>
+                             <property name="use_underline">True</property>
+                             <property name="relief">GTK_RELIEF_NORMAL</property>
+                             <property name="active">False</property>
+                             <property name="inconsistent">False</property>
+                             <property name="draw_indicator">True</property>
+                             <property name="group">radiobutton_cbitrate</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkCheckButton" id="checkbutton_2pass">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="label" translatable="yes">2-pass encoding</property>
+                             <property name="use_underline">True</property>
+                             <property name="relief">GTK_RELIEF_NORMAL</property>
+                             <property name="active">True</property>
+                             <property name="inconsistent">False</property>
+                             <property name="draw_indicator">True</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkAlignment" id="alignment8">
+                     <property name="visible">True</property>
+                     <property name="xalign">1</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xscale">1</property>
+                     <property name="yscale">1</property>
+
+                     <child>
+                       <widget class="GtkVBox" id="vbox8">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">True</property>
+                         <property name="spacing">0</property>
+
+                         <child>
+                           <widget class="GtkOptionMenu" id="optionmenu_title">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="history">-1</property>
+                             <signal name="changed" handler="on_optionmenu_title_changed" last_modification_time="Sat, 06 Dec 2003 04:23:30 GMT"/>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkOptionMenu" id="optionmenu_codec">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="history">0</property>
+
+                             <child>
+                               <widget class="GtkMenu" id="menu_codec">
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="mpeg-4_(ffmpeg)1">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">MPEG-4 (FFmpeg)</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="mpeg-4_(xvid)1">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">MPEG-4 (XviD)</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="h264_(x264)1">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">H264 (x264)</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+                               </widget>
+                             </child>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkSpinButton" id="spinbutton_bitrate">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">1</property>
+                             <property name="digits">0</property>
+                             <property name="numeric">False</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">False</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">1024 100 5000 1 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkSpinButton" id="spinbutton_size">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="climb_rate">1</property>
+                             <property name="digits">0</property>
+                             <property name="numeric">False</property>
+                             <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                             <property name="snap_to_ticks">False</property>
+                             <property name="wrap">False</property>
+                             <property name="adjustment">700 0 2000 1 10 10</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkButton" id="button_settings">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="label" translatable="yes">Crop &amp; Resize..</property>
+                             <property name="use_underline">True</property>
+                             <property name="relief">GTK_RELIEF_NORMAL</property>
+                             <signal name="clicked" handler="on_button_settings_clicked" last_modification_time="Sat, 06 Dec 2003 05:00:14 GMT"/>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+               </widget>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label6">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">Video</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0.5</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+               </widget>
+               <packing>
+                 <property name="type">label_item</property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="padding">0</property>
+             <property name="expand">False</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkFrame" id="frame_audio">
+             <property name="visible">True</property>
+             <property name="label_xalign">0</property>
+             <property name="label_yalign">0.5</property>
+             <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+             <child>
+               <widget class="GtkHBox" id="hbox19">
+                 <property name="border_width">5</property>
+                 <property name="visible">True</property>
+                 <property name="homogeneous">True</property>
+                 <property name="spacing">0</property>
+
+                 <child>
+                   <widget class="GtkAlignment" id="alignment9">
+                     <property name="visible">True</property>
+                     <property name="xalign">0</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xscale">1</property>
+                     <property name="yscale">1</property>
+
+                     <child>
+                       <widget class="GtkVBox" id="vbox9">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">True</property>
+                         <property name="spacing">0</property>
+
+                         <child>
+                           <widget class="GtkLabel" id="label14">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Language</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="label15">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Secondary language</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="label16">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Bitrate</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkAlignment" id="alignment10">
+                     <property name="visible">True</property>
+                     <property name="xalign">1</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xscale">1</property>
+                     <property name="yscale">1</property>
+
+                     <child>
+                       <widget class="GtkVBox" id="vbox10">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">True</property>
+                         <property name="spacing">0</property>
+
+                         <child>
+                           <widget class="GtkOptionMenu" id="optionmenu_language">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="history">-1</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkOptionMenu" id="optionmenu_language2">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="history">-1</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkOptionMenu" id="optionmenu_bitrate">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="history">0</property>
+
+                             <child>
+                               <widget class="GtkMenu" id="menu1">
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="2">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">64</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="4">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">96</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="7">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">128</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="10">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">160</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="11">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">192</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="12">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">256</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="13">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">320</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+                               </widget>
+                             </child>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+               </widget>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label8">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">Audio</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0.5</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+               </widget>
+               <packing>
+                 <property name="type">label_item</property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="padding">0</property>
+             <property name="expand">False</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkFrame" id="frame_output">
+             <property name="visible">True</property>
+             <property name="label_xalign">0</property>
+             <property name="label_yalign">0.5</property>
+             <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+             <child>
+               <widget class="GtkVBox" id="vbox2">
+                 <property name="border_width">5</property>
+                 <property name="visible">True</property>
+                 <property name="homogeneous">False</property>
+                 <property name="spacing">0</property>
+
+                 <child>
+                   <widget class="GtkHBox" id="hbox20">
+                     <property name="visible">True</property>
+                     <property name="homogeneous">True</property>
+                     <property name="spacing">0</property>
+
+                     <child>
+                       <widget class="GtkAlignment" id="alignment11">
+                         <property name="visible">True</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xscale">1</property>
+                         <property name="yscale">1</property>
+
+                         <child>
+                           <widget class="GtkLabel" id="label17">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Format</property>
+                             <property name="use_underline">False</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">True</property>
+                         <property name="fill">True</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkAlignment" id="alignment12">
+                         <property name="visible">True</property>
+                         <property name="xalign">1</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xscale">1</property>
+                         <property name="yscale">1</property>
+
+                         <child>
+                           <widget class="GtkOptionMenu" id="optionmenu_format">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="history">0</property>
+
+                             <child>
+                               <widget class="GtkMenu" id="menu2">
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="auto1">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">Auto</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="avi1">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">AVI</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="mp1">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">MP4</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkMenuItem" id="ogm1">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">OGM</property>
+                                     <property name="use_underline">True</property>
+                                   </widget>
+                                 </child>
+                               </widget>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">True</property>
+                         <property name="fill">True</property>
+                       </packing>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkHBox" id="hbox6">
+                     <property name="visible">True</property>
+                     <property name="homogeneous">False</property>
+                     <property name="spacing">0</property>
+
+                     <child>
+                       <widget class="GtkLabel" id="label18">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">File </property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">True</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkCombo" id="combo2">
+                         <property name="visible">True</property>
+                         <property name="value_in_list">False</property>
+                         <property name="allow_empty">True</property>
+                         <property name="case_sensitive">False</property>
+                         <property name="enable_arrow_keys">True</property>
+                         <property name="enable_arrows_always">False</property>
+
+                         <child internal-child="entry">
+                           <widget class="GtkEntry" id="entry_file">
+                             <property name="visible">True</property>
+                             <property name="can_focus">True</property>
+                             <property name="editable">True</property>
+                             <property name="visibility">True</property>
+                             <property name="max_length">0</property>
+                             <property name="text" translatable="yes"></property>
+                             <property name="has_frame">True</property>
+                             <property name="invisible_char" translatable="yes">*</property>
+                             <property name="activates_default">False</property>
+                             <signal name="activate" handler="on_entry_file_activate" last_modification_time="Sat, 06 Dec 2003 05:04:29 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child internal-child="list">
+                           <widget class="GtkList" id="list1">
+                             <property name="visible">True</property>
+                             <property name="selection_mode">GTK_SELECTION_BROWSE</property>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">True</property>
+                         <property name="fill">True</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkButton" id="button_browse_file">
+                         <property name="visible">True</property>
+                         <property name="can_default">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="relief">GTK_RELIEF_NORMAL</property>
+                         <signal name="clicked" handler="on_button_browse_file_clicked" last_modification_time="Sat, 06 Dec 2003 04:52:12 GMT"/>
+
+                         <child>
+                           <widget class="GtkAlignment" id="alignment2">
+                             <property name="visible">True</property>
+                             <property name="xalign">0.5</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xscale">0</property>
+                             <property name="yscale">0</property>
+
+                             <child>
+                               <widget class="GtkHBox" id="hbox7">
+                                 <property name="visible">True</property>
+                                 <property name="homogeneous">False</property>
+                                 <property name="spacing">2</property>
+
+                                 <child>
+                                   <widget class="GtkImage" id="image4">
+                                     <property name="visible">True</property>
+                                     <property name="stock">gtk-open</property>
+                                     <property name="icon_size">4</property>
+                                     <property name="xalign">0.5</property>
+                                     <property name="yalign">0.5</property>
+                                     <property name="xpad">0</property>
+                                     <property name="ypad">0</property>
+                                   </widget>
+                                   <packing>
+                                     <property name="padding">0</property>
+                                     <property name="expand">False</property>
+                                     <property name="fill">False</property>
+                                   </packing>
+                                 </child>
+
+                                 <child>
+                                   <widget class="GtkLabel" id="label19">
+                                     <property name="visible">True</property>
+                                     <property name="label" translatable="yes">Browse</property>
+                                     <property name="use_underline">True</property>
+                                     <property name="use_markup">False</property>
+                                     <property name="justify">GTK_JUSTIFY_LEFT</property>
+                                     <property name="wrap">False</property>
+                                     <property name="selectable">False</property>
+                                     <property name="xalign">0.5</property>
+                                     <property name="yalign">0.5</property>
+                                     <property name="xpad">0</property>
+                                     <property name="ypad">0</property>
+                                   </widget>
+                                   <packing>
+                                     <property name="padding">0</property>
+                                     <property name="expand">False</property>
+                                     <property name="fill">False</property>
+                                   </packing>
+                                 </child>
+                               </widget>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">False</property>
+                       </packing>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+               </widget>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label9">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">Output</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0.5</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+               </widget>
+               <packing>
+                 <property name="type">label_item</property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="padding">6</property>
+             <property name="expand">False</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkHButtonBox" id="hbuttonbox1">
+             <property name="visible">True</property>
+             <property name="layout_style">GTK_BUTTONBOX_END</property>
+             <property name="spacing">0</property>
+
+             <child>
+               <widget class="GtkButton" id="button_start">
+                 <property name="visible">True</property>
+                 <property name="can_default">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="relief">GTK_RELIEF_NORMAL</property>
+                 <signal name="clicked" handler="on_button_start_clicked" last_modification_time="Sat, 06 Dec 2003 04:59:15 GMT"/>
+
+                 <child>
+                   <widget class="GtkAlignment" id="alignment3">
+                     <property name="visible">True</property>
+                     <property name="xalign">0.5</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xscale">0</property>
+                     <property name="yscale">0</property>
+
+                     <child>
+                       <widget class="GtkHBox" id="hbox9">
+                         <property name="visible">True</property>
+                         <property name="homogeneous">False</property>
+                         <property name="spacing">2</property>
+
+                         <child>
+                           <widget class="GtkImage" id="button_start_image">
+                             <property name="visible">True</property>
+                             <property name="stock">gtk-apply</property>
+                             <property name="icon_size">4</property>
+                             <property name="xalign">0.5</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+
+                         <child>
+                           <widget class="GtkLabel" id="button_start_label">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Start</property>
+                             <property name="use_underline">True</property>
+                             <property name="use_markup">False</property>
+                             <property name="justify">GTK_JUSTIFY_LEFT</property>
+                             <property name="wrap">False</property>
+                             <property name="selectable">False</property>
+                             <property name="xalign">0.5</property>
+                             <property name="yalign">0.5</property>
+                             <property name="xpad">0</property>
+                             <property name="ypad">0</property>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">False</property>
+                             <property name="fill">False</property>
+                           </packing>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+           <packing>
+             <property name="padding">4</property>
+             <property name="expand">False</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkHBox" id="hbox10">
+         <property name="visible">True</property>
+         <property name="homogeneous">False</property>
+         <property name="spacing">0</property>
+
+         <child>
+           <widget class="GtkProgressBar" id="progressbar">
+             <property name="visible">True</property>
+             <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
+             <property name="fraction">0</property>
+             <property name="pulse_step">0.1</property>
+           </widget>
+           <packing>
+             <property name="padding">0</property>
+             <property name="expand">False</property>
+             <property name="fill">False</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkStatusbar" id="statusbar">
+             <property name="visible">True</property>
+             <property name="has_resize_grip">True</property>
+           </widget>
+           <packing>
+             <property name="padding">0</property>
+             <property name="expand">True</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkFileSelection" id="win_open">
+  <property name="border_width">10</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Select File</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">True</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="show_fileops">True</property>
+  <signal name="delete_event" handler="on_win_open_delete_event" last_modification_time="Sat, 06 Dec 2003 00:17:21 GMT"/>
+
+  <child internal-child="cancel_button">
+    <widget class="GtkButton" id="cancel_button1">
+      <property name="visible">True</property>
+      <property name="can_default">True</property>
+      <property name="can_focus">True</property>
+      <property name="relief">GTK_RELIEF_NORMAL</property>
+      <signal name="clicked" handler="on_cancel_button1_clicked" last_modification_time="Sat, 06 Dec 2003 00:17:46 GMT"/>
+    </widget>
+  </child>
+
+  <child internal-child="ok_button">
+    <widget class="GtkButton" id="ok_button1">
+      <property name="visible">True</property>
+      <property name="can_default">True</property>
+      <property name="can_focus">True</property>
+      <property name="relief">GTK_RELIEF_NORMAL</property>
+      <signal name="clicked" handler="on_ok_button1_clicked" last_modification_time="Sat, 06 Dec 2003 00:17:56 GMT"/>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkWindow" id="win_settings">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Picture settings</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">True</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <signal name="delete_event" handler="on_win_settings_delete_event" last_modification_time="Sat, 06 Dec 2003 19:07:23 GMT"/>
+
+  <child>
+    <widget class="GtkVBox" id="vbox4">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child>
+       <widget class="GtkDrawingArea" id="drawingarea">
+         <property name="visible">True</property>
+       </widget>
+       <packing>
+         <property name="padding">10</property>
+         <property name="expand">True</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkTable" id="table5">
+         <property name="visible">True</property>
+         <property name="n_rows">1</property>
+         <property name="n_columns">3</property>
+         <property name="homogeneous">False</property>
+         <property name="row_spacing">0</property>
+         <property name="column_spacing">0</property>
+
+         <child>
+           <widget class="GtkVBox" id="vbox5">
+             <property name="visible">True</property>
+             <property name="homogeneous">False</property>
+             <property name="spacing">0</property>
+
+             <child>
+               <widget class="GtkHButtonBox" id="hbuttonbox2">
+                 <property name="visible">True</property>
+                 <property name="layout_style">GTK_BUTTONBOX_END</property>
+                 <property name="spacing">0</property>
+
+                 <child>
+                   <widget class="GtkButton" id="button_settings_previous">
+                     <property name="visible">True</property>
+                     <property name="sensitive">False</property>
+                     <property name="can_default">True</property>
+                     <property name="can_focus">True</property>
+                     <property name="relief">GTK_RELIEF_NORMAL</property>
+                     <signal name="clicked" handler="on_button_settings_previous_clicked" last_modification_time="Sat, 06 Dec 2003 20:58:51 GMT"/>
+
+                     <child>
+                       <widget class="GtkAlignment" id="alignment5">
+                         <property name="visible">True</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xscale">0</property>
+                         <property name="yscale">0</property>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox12">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">2</property>
+
+                             <child>
+                               <widget class="GtkImage" id="image7">
+                                 <property name="visible">True</property>
+                                 <property name="stock">gtk-go-back</property>
+                                 <property name="icon_size">4</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+
+                             <child>
+                               <widget class="GtkLabel" id="label22">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">Previous</property>
+                                 <property name="use_underline">True</property>
+                                 <property name="use_markup">False</property>
+                                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                                 <property name="wrap">False</property>
+                                 <property name="selectable">False</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkButton" id="button_settings_next">
+                     <property name="visible">True</property>
+                     <property name="can_default">True</property>
+                     <property name="can_focus">True</property>
+                     <property name="relief">GTK_RELIEF_NORMAL</property>
+                     <signal name="clicked" handler="on_button_settings_next_clicked" last_modification_time="Sat, 06 Dec 2003 20:51:27 GMT"/>
+
+                     <child>
+                       <widget class="GtkAlignment" id="alignment6">
+                         <property name="visible">True</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xscale">0</property>
+                         <property name="yscale">0</property>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox13">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">2</property>
+
+                             <child>
+                               <widget class="GtkImage" id="image8">
+                                 <property name="visible">True</property>
+                                 <property name="stock">gtk-go-forward</property>
+                                 <property name="icon_size">4</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+
+                             <child>
+                               <widget class="GtkLabel" id="label23">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">Next</property>
+                                 <property name="use_underline">True</property>
+                                 <property name="use_markup">False</property>
+                                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                                 <property name="wrap">False</property>
+                                 <property name="selectable">False</property>
+                                 <property name="xalign">0.5</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+               </widget>
+               <packing>
+                 <property name="padding">0</property>
+                 <property name="expand">True</property>
+                 <property name="fill">True</property>
+               </packing>
+             </child>
+
+             <child>
+               <placeholder/>
+             </child>
+           </widget>
+           <packing>
+             <property name="left_attach">2</property>
+             <property name="right_attach">3</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkVBox" id="vbox6">
+             <property name="visible">True</property>
+             <property name="homogeneous">False</property>
+             <property name="spacing">0</property>
+
+             <child>
+               <widget class="GtkHBox" id="hbox17">
+                 <property name="visible">True</property>
+                 <property name="homogeneous">True</property>
+                 <property name="spacing">0</property>
+
+                 <child>
+                   <widget class="GtkTable" id="table8">
+                     <property name="visible">True</property>
+                     <property name="n_rows">3</property>
+                     <property name="n_columns">3</property>
+                     <property name="homogeneous">False</property>
+                     <property name="row_spacing">0</property>
+                     <property name="column_spacing">0</property>
+
+                     <child>
+                       <widget class="GtkSpinButton" id="spinbutton_width">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="climb_rate">1</property>
+                         <property name="digits">0</property>
+                         <property name="numeric">True</property>
+                         <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                         <property name="snap_to_ticks">False</property>
+                         <property name="wrap">False</property>
+                         <property name="adjustment">0 0 4096 16 16 10</property>
+                         <signal name="value_changed" handler="on_spinbutton_width_value_changed" last_modification_time="Sun, 07 Dec 2003 23:24:59 GMT"/>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">2</property>
+                         <property name="right_attach">3</property>
+                         <property name="top_attach">0</property>
+                         <property name="bottom_attach">1</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkSpinButton" id="spinbutton_crop_top">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="climb_rate">1</property>
+                         <property name="digits">0</property>
+                         <property name="numeric">False</property>
+                         <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                         <property name="snap_to_ticks">False</property>
+                         <property name="wrap">False</property>
+                         <property name="adjustment">0 0 4096 2 10 10</property>
+                         <signal name="value_changed" handler="on_spinbutton_crop_top_value_changed" last_modification_time="Sun, 07 Dec 2003 23:42:52 GMT"/>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">2</property>
+                         <property name="right_attach">3</property>
+                         <property name="top_attach">1</property>
+                         <property name="bottom_attach">2</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label26">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Bottom crop</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">2</property>
+                         <property name="bottom_attach">3</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label25">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Top crop</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">1</property>
+                         <property name="bottom_attach">2</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label24">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Picture width</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">0</property>
+                         <property name="bottom_attach">1</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkSpinButton" id="spinbutton_crop_bottom">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="climb_rate">1</property>
+                         <property name="digits">0</property>
+                         <property name="numeric">False</property>
+                         <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                         <property name="snap_to_ticks">False</property>
+                         <property name="wrap">False</property>
+                         <property name="adjustment">0 0 4096 2 10 10</property>
+                         <signal name="value_changed" handler="on_spinbutton_crop_bottom_value_changed" last_modification_time="Sun, 07 Dec 2003 23:43:06 GMT"/>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">2</property>
+                         <property name="right_attach">3</property>
+                         <property name="top_attach">2</property>
+                         <property name="bottom_attach">3</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">5</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkTable" id="table9">
+                     <property name="visible">True</property>
+                     <property name="n_rows">3</property>
+                     <property name="n_columns">3</property>
+                     <property name="homogeneous">False</property>
+                     <property name="row_spacing">0</property>
+                     <property name="column_spacing">0</property>
+
+                     <child>
+                       <widget class="GtkSpinButton" id="spinbutton_crop_left">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="climb_rate">1</property>
+                         <property name="digits">0</property>
+                         <property name="numeric">False</property>
+                         <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                         <property name="snap_to_ticks">False</property>
+                         <property name="wrap">False</property>
+                         <property name="adjustment">0 0 4096 2 10 10</property>
+                         <signal name="value_changed" handler="on_spinbutton_crop_left_value_changed" last_modification_time="Sun, 07 Dec 2003 23:43:30 GMT"/>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">2</property>
+                         <property name="right_attach">3</property>
+                         <property name="top_attach">1</property>
+                         <property name="bottom_attach">2</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label28">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Right crop</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">2</property>
+                         <property name="bottom_attach">3</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label27">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Left crop</property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">1</property>
+                         <property name="bottom_attach">2</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkSpinButton" id="spinbutton_crop_right">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="climb_rate">1</property>
+                         <property name="digits">0</property>
+                         <property name="numeric">False</property>
+                         <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+                         <property name="snap_to_ticks">False</property>
+                         <property name="wrap">False</property>
+                         <property name="adjustment">0 0 4096 2 10 10</property>
+                         <signal name="value_changed" handler="on_spinbutton_crop_right_value_changed" last_modification_time="Sun, 07 Dec 2003 23:43:42 GMT"/>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">2</property>
+                         <property name="right_attach">3</property>
+                         <property name="top_attach">2</property>
+                         <property name="bottom_attach">3</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkCheckButton" id="checkbutton_deinterlace">
+                         <property name="visible">True</property>
+                         <property name="can_focus">True</property>
+                         <property name="label" translatable="yes">deinterlace</property>
+                         <property name="use_underline">True</property>
+                         <property name="relief">GTK_RELIEF_NORMAL</property>
+                         <property name="active">False</property>
+                         <property name="inconsistent">False</property>
+                         <property name="draw_indicator">True</property>
+                         <signal name="toggled" handler="on_checkbutton_deinterlace_toggled" last_modification_time="Sat, 06 Dec 2003 21:12:08 GMT"/>
+                       </widget>
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+                         <property name="top_attach">0</property>
+                         <property name="bottom_attach">1</property>
+                         <property name="x_options">fill</property>
+                         <property name="y_options"></property>
+                       </packing>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">5</property>
+                     <property name="expand">True</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+               </widget>
+               <packing>
+                 <property name="padding">0</property>
+                 <property name="expand">True</property>
+                 <property name="fill">True</property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="y_options">fill</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">True</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkHSeparator" id="hseparator1">
+         <property name="visible">True</property>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkTable" id="table4">
+         <property name="visible">True</property>
+         <property name="n_rows">1</property>
+         <property name="n_columns">2</property>
+         <property name="homogeneous">False</property>
+         <property name="row_spacing">0</property>
+         <property name="column_spacing">0</property>
+
+         <child>
+           <widget class="GtkButton" id="button1">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <signal name="clicked" handler="on_button_ok_settings_clicked" last_modification_time="Sat, 06 Dec 2003 19:07:02 GMT"/>
+
+             <child>
+               <widget class="GtkAlignment" id="alignment4">
+                 <property name="visible">True</property>
+                 <property name="xalign">0.5</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xscale">0</property>
+                 <property name="yscale">0</property>
+
+                 <child>
+                   <widget class="GtkHBox" id="hbox11">
+                     <property name="visible">True</property>
+                     <property name="homogeneous">False</property>
+                     <property name="spacing">2</property>
+
+                     <child>
+                       <widget class="GtkImage" id="image5">
+                         <property name="visible">True</property>
+                         <property name="stock">gtk-apply</property>
+                         <property name="icon_size">4</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">False</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkLabel" id="label20">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Ok</property>
+                         <property name="use_underline">True</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">False</property>
+                       </packing>
+                     </child>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+           <packing>
+             <property name="left_attach">1</property>
+             <property name="right_attach">2</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="x_options">fill</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label_settings">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">label21</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="left_attach">0</property>
+             <property name="right_attach">1</property>
+             <property name="top_attach">0</property>
+             <property name="bottom_attach">1</property>
+             <property name="y_options"></property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">5</property>
+         <property name="expand">False</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>
diff --git a/gtk2/interface.c b/gtk2/interface.c
new file mode 100644 (file)
index 0000000..826889c
--- /dev/null
@@ -0,0 +1,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;
+}
+
diff --git a/gtk2/interface.h b/gtk2/interface.h
new file mode 100644 (file)
index 0000000..303e644
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+GtkWidget* create_win_main (void);
+GtkWidget* create_win_open (void);
+GtkWidget* create_win_settings (void);
diff --git a/gtk2/main.c b/gtk2/main.c
new file mode 100644 (file)
index 0000000..d4e4d5d
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * Initial main.c file generated by Glade. Edit as required.
+ * Glade will not overwrite this file.
+ */
+
+#include "../core/HandBrake.h"
+
+#include <gtk/gtk.h>
+
+#include "interface.h"
+#include "support.h"
+
+#include "status.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)
+
+GtkWidget *hb_win_main = NULL;
+HBHandle  *hb_handle = NULL;
+HBStatus  *hb_status = NULL;
+
+static int HBMain( void *data );
+
+/* libhb callbacks */
+static void Scanning( void * data, int title, int titleCount );
+static void ScanDone( void * data, HBList * titleList );
+static void Encoding( void * data, float position, int pass,
+                      int passCount, float frameRate,
+                      float avgFrameRate, int remainingTime );
+static void RipDone( void * data, int result );
+
+
+int main (int argc, char **argv )
+{
+    HBCallbacks callbacks;
+    GtkWidget   *widget;
+    GList       *items = NULL;
+
+    int i_dummy;
+
+    /* Create HB stuff */
+    if( ( hb_handle = HBInit( 1, 0 ) ) == NULL )
+    {
+        g_print( "HBInit: failed\n" );
+        return -1;
+    }
+
+    /* Emulate a HBStatus */
+    hb_status = malloc( sizeof( HBStatus ) );
+    hb_status->i_state = HB_STATE_NEED_DEVICE;
+    hb_status->b_new = 1;
+    hb_status->i_title = 0;
+    hb_status->i_title_count = 0;
+    hb_status->titleList = NULL;
+    hb_status->position = 0.0;
+    hb_status->i_remaining = 0;
+    hb_status->fps = 0.0;
+
+    /* Set libhb callbacks */
+    callbacks.data     = NULL;
+    callbacks.scanning = Scanning;
+    callbacks.scanDone = ScanDone;
+    callbacks.encoding = Encoding;
+    callbacks.ripDone  = RipDone;
+    HBSetCallbacks( hb_handle, callbacks );
+
+    gtk_set_locale ();
+    gtk_init (&argc, &argv);
+
+    //add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
+
+    /* Create the main window */
+    hb_win_main = create_win_main();
+    gtk_window_set_title( GTK_WINDOW(hb_win_main), "HandBrake " HB_VERSION );
+
+    widget = lookup_widget( hb_win_main, "combo1" );
+    gtk_combo_disable_activate( GTK_COMBO( widget ) );
+
+    widget = lookup_widget( hb_win_main, "combo2" );
+    gtk_combo_disable_activate( GTK_COMBO( widget ) );
+
+    widget = lookup_widget( hb_win_main, "optionmenu_bitrate" );
+    gtk_option_menu_set_history( GTK_OPTION_MENU(widget), 2 );
+
+    /* build dvd list */
+    items = g_list_append (items, "" );
+    items = g_list_append (items, "/dev/dvd" );
+    gtk_combo_set_popdown_strings( GTK_COMBO(lookup_widget( hb_win_main, "combo1") ), items );
+
+    /* Display the main window */
+    gtk_widget_show( hb_win_main );
+
+    i_dummy = gtk_timeout_add( 100, (GtkFunction)HBMain, NULL );
+    gtk_main();
+    gtk_timeout_remove( i_dummy );
+
+    return 0;
+}
+
+static void StatusBarUpdate( char *msg )
+{
+    GtkWidget *widget = lookup_widget( hb_win_main, "statusbar" );
+
+    gtk_statusbar_push( GTK_STATUSBAR(widget),
+                        gtk_statusbar_get_context_id(GTK_STATUSBAR(widget), "status" ),
+                        msg );
+}
+
+static void DisplayError( char *title, char *msg )
+{
+    GtkWidget *dialog = gtk_message_dialog_new( NULL, GTK_DIALOG_MODAL,
+                                                GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+                                                "<b>%s</b>\n\n%s", title, msg );
+    gtk_label_set_use_markup( GTK_LABEL( GTK_MESSAGE_DIALOG(dialog)->label), TRUE );
+    gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK );
+    gtk_window_set_modal( GTK_WINDOW(dialog), TRUE );
+    gtk_dialog_run( GTK_DIALOG(dialog) );
+    gtk_widget_destroy( dialog );
+}
+
+static void DisplayInfo( char *msg )
+{
+    GtkWidget *dialog = gtk_message_dialog_new( NULL, GTK_DIALOG_MODAL,
+                                                GTK_MESSAGE_INFO, GTK_BUTTONS_OK, msg );
+    gtk_label_set_use_markup( GTK_LABEL( GTK_MESSAGE_DIALOG(dialog)->label), TRUE );
+    gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK );
+    gtk_window_set_modal( GTK_WINDOW(dialog), TRUE );
+    gtk_dialog_run( GTK_DIALOG(dialog) );
+    gtk_widget_destroy( dialog );
+}
+
+static int HBMain( void *data )
+{
+    int        b_new = hb_status->b_new;
+    GtkWidget  *widget;
+    gchar      msg[1000];
+
+    hb_status->b_new = 0;
+
+    switch( hb_status->i_state )
+    {
+        case HB_STATE_NEED_DEVICE:
+            if( b_new )
+            {
+                g_print( "HBMain: HB_MODE_NEED_DEVICE\n" );
+                gtk_widget_set_sensitive( lookup_widget( hb_win_main, "frame_dvd"), TRUE );
+                StatusBarUpdate( "Enter a device" );
+            }
+            break;
+
+        case HB_STATE_SCANNING:
+            if( b_new )
+            {
+                g_print( "HBMain: HB_MODE_SCANNING\n" );
+            }
+
+            gtk_widget_set_sensitive( lookup_widget( hb_win_main, "frame_dvd"), FALSE );
+
+            gtk_progress_bar_pulse( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" ) ));
+            if( hb_status->i_title )
+            {
+                sprintf( msg, "Scanning title %d/%d...", hb_status->i_title, hb_status->i_title_count );
+            }
+            else
+            {
+                sprintf( msg, "Opening device..." );
+            }
+            StatusBarUpdate( msg );
+            break;
+
+        case HB_STATE_INVALID_DEVICE:
+            if( b_new )
+            {
+                g_print( "HBMain: HB_MODE_INVALID_DEVICE\n" );
+
+                gtk_widget_set_sensitive( lookup_widget( hb_win_main, "frame_dvd"), TRUE );
+
+                gtk_entry_set_text( GTK_ENTRY(lookup_widget( hb_win_main, "entry_device")), "" );
+
+                gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), 0.0 );
+
+                StatusBarUpdate( "Enter a valid device" );
+
+                /* error dialog */
+                DisplayError( "Invalid device", "Please select a valide device" );
+            }
+            break;
+
+        case HB_STATE_READY_TO_RIP:
+            if( b_new )
+            {
+                GtkWidget *optionmenu_title = lookup_widget( hb_win_main, "optionmenu_title" );
+                GtkWidget *menu;
+                GtkWidget *item;
+                int i;
+
+                g_print( "HBMain: HB_MODE_READY_TO_RIP\n" );
+
+                /* create title menu */
+                menu = gtk_menu_new();
+                for( i = 0; i < HBListCount( hb_status->titleList ); i++ )
+                {
+                    HBTitle *title = (HBTitle*) HBListItemAt( hb_status->titleList, i );
+                    char string[1024];
+
+                    sprintf( string, "%d - %02dh%02dm%02ds",
+                             title->title, title->hours, title->minutes,
+                             title->seconds );
+
+                    item = gtk_menu_item_new_with_mnemonic( string );
+                    gtk_widget_show( item );
+                    gtk_menu_shell_append( GTK_MENU_SHELL(menu), item );
+                }
+
+                gtk_option_menu_set_menu( GTK_OPTION_MENU(optionmenu_title), menu );
+                GLADE_HOOKUP_OBJECT( hb_win_main, menu, "menu_title" );
+
+                /* unhide */
+                widget = lookup_widget( hb_win_main, "vbox_parameters" );
+                gtk_widget_show( widget );
+
+                gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), 0.0 );
+                gtk_progress_bar_set_text( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), "" );
+
+                StatusBarUpdate( "Select your parameters" );
+            }
+            break;
+
+        case HB_STATE_ENCODING:
+            if( b_new )
+            {
+                /* change the name to Stop */
+                widget = lookup_widget( hb_win_main, "button_start_label" );
+                gtk_label_set_text( GTK_LABEL( widget ), "Stop" );
+
+                widget = lookup_widget( hb_win_main, "button_start_image" );
+                gtk_image_set_from_stock( GTK_IMAGE(widget), "gtk-cancel", GTK_ICON_SIZE_BUTTON );
+
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_video"), FALSE );
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_audio"), FALSE );
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_output"), FALSE );
+            }
+
+            if( hb_status->position <= 0 )
+            {
+                StatusBarUpdate( "Starting..." );
+            }
+            else
+            {
+                char string[1024];
+
+                /* Status bar */
+                sprintf( string, "Encoding: %02dh%02dm%02ds remaining",
+                         hb_status->i_remaining / 3600,
+                         ( hb_status->i_remaining % 3600 ) / 60,
+                         hb_status->i_remaining % 60 );
+                StatusBarUpdate( string );
+
+                /* Progressbar */
+                sprintf( string, "%.2f %% (%.2f fps)", 100 * hb_status->position, hb_status->fps );
+                gtk_progress_bar_set_text( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), string );
+                gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), hb_status->position );
+            }
+            break;
+
+        case HB_STATE_DONE:
+        case HB_STATE_CANCELED:
+            if( b_new )
+            {
+                g_print( "HBMain: HB_MODE_DONE/HB_MODE_CANCELED\n" );
+
+                /* change the name to Start */
+                widget = lookup_widget( hb_win_main, "button_start_label" );
+                gtk_label_set_text( GTK_LABEL( widget ), "Start" );
+
+                widget = lookup_widget( hb_win_main, "button_start_image" );
+                gtk_image_set_from_stock( GTK_IMAGE(widget), "gtk-apply", GTK_ICON_SIZE_BUTTON );
+
+                gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), 0.0 );
+                gtk_progress_bar_set_text( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), "" );
+
+                if( hb_status->i_state == HB_STATE_DONE )
+                {
+                    StatusBarUpdate( "Done." );
+                    DisplayInfo( "Encoding finished with success." );
+                }
+                else
+                {
+                    StatusBarUpdate( "Canceled." );
+                    DisplayInfo("Encoding canceled.");
+                }
+
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_video"), TRUE );
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_audio"), TRUE );
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_output"), TRUE );
+            }
+            break;
+
+        case HB_STATE_ERROR:
+            if( b_new )
+            {
+                char *msg = "Unknown";
+
+                g_print( "HBMain: HB_MODE_ERROR\n" );
+
+                /* change the name to Start */
+                widget = lookup_widget( hb_win_main, "button_start_label" );
+                gtk_label_set_text( GTK_LABEL( widget ), "Start" );
+
+                widget = lookup_widget( hb_win_main, "button_start_image" );
+                gtk_image_set_from_stock( GTK_IMAGE(widget), "gtk-apply", GTK_ICON_SIZE_BUTTON );
+
+                gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), 0.0 );
+                gtk_progress_bar_set_text( GTK_PROGRESS_BAR(lookup_widget( hb_win_main, "progressbar" )), "" );
+
+                StatusBarUpdate( "Error." );
+                switch( hb_status->i_error )
+                {
+#if 0
+                    case HB_ERROR_A52_SYNC:
+                        msg = "corrupted AC3 data.";
+                        break;
+                    case HB_ERROR_AVI_WRITE:
+                        msg = "could not write to file.";
+                        break;
+                    case HB_ERROR_DVD_OPEN:
+                        msg = "could not open device.";
+                        break;
+                    case HB_ERROR_DVD_READ:
+                        msg = "DVD read failed.";
+                        break;
+                    case HB_ERROR_MP3_INIT:
+                        msg = "could not init MP3 encoder.";
+                        break;
+                    case HB_ERROR_MP3_ENCODE:
+                        msg = "MP3 encoder failed.";
+                        break;
+                    case HB_ERROR_MPEG4_INIT:
+                        msg = "could not init MPEG4 encoder.";
+                        break;
+#endif
+                    default:
+                        msg = "Generic error";
+                        break;
+                }
+                DisplayError( "An error occured", msg );
+
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_video"), TRUE );
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_audio"), TRUE );
+                gtk_widget_set_sensitive( lookup_widget(hb_win_main, "frame_output"), TRUE );
+            }
+            break;
+    }
+
+
+    return TRUE;
+}
+
+
+static void Scanning( void * data, int title, int titleCount )
+{
+    if( hb_status->i_state != HB_STATE_SCANNING )
+    {
+        hb_status->i_state = HB_STATE_SCANNING;
+        hb_status->b_new = 1;
+    }
+    hb_status->i_title = title;
+    hb_status->i_title_count = titleCount;
+}
+
+static void ScanDone( void * data, HBList * titleList )
+{
+    if( titleList == NULL )
+    {
+        hb_status->i_state = HB_STATE_INVALID_DEVICE;
+    }
+    else
+    {
+        hb_status->i_state = HB_STATE_READY_TO_RIP;
+    }
+    hb_status->b_new = 1;
+
+    hb_status->titleList = titleList;
+}
+
+static void Encoding( void * data, float position, int pass,
+                      int passCount, float frameRate,
+                      float avgFrameRate, int remainingTime )
+{
+    if( hb_status->i_state != HB_STATE_ENCODING )
+    {
+        hb_status->i_state = HB_STATE_ENCODING;
+        hb_status->b_new = 1;
+    }
+
+    hb_status->position = position;
+    hb_status->fps = frameRate;
+    hb_status->i_remaining = remainingTime;
+}
+
+static void RipDone( void * data, int result )
+{
+    /* TODO check result */
+    hb_status->i_state = HB_STATE_DONE;
+    hb_status->b_new = 1;
+}
+
diff --git a/gtk2/status.h b/gtk2/status.h
new file mode 100644 (file)
index 0000000..c98e4c9
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *
+ */
+
+enum HBState_e
+{
+    HB_STATE_NEED_DEVICE,
+    HB_STATE_SCANNING,
+    HB_STATE_INVALID_DEVICE,
+    HB_STATE_READY_TO_RIP,
+    HB_STATE_ENCODING,
+    HB_STATE_DONE,
+    HB_STATE_CANCELED,
+    HB_STATE_ERROR,
+};
+
+typedef struct
+{
+    int i_state;
+    int i_error;
+    int b_new;
+
+    int i_title;
+    int i_title_count;
+
+    HBList *titleList;
+
+    float   position;
+    int     i_remaining;
+    float   fps;
+
+} HBStatus;
+
diff --git a/gtk2/support.c b/gtk2/support.c
new file mode 100644 (file)
index 0000000..7dc3c78
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * 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 <gtk/gtk.h>
+
+#include "support.h"
+
+GtkWidget*
+lookup_widget                          (GtkWidget       *widget,
+                                        const gchar     *widget_name)
+{
+  GtkWidget *parent, *found_widget;
+
+  for (;;)
+    {
+      if (GTK_IS_MENU (widget))
+        parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
+      else
+        parent = widget->parent;
+      if (!parent)
+        parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
+      if (parent == NULL)
+        break;
+      widget = parent;
+    }
+
+  found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
+                                                 widget_name);
+  if (!found_widget)
+    g_warning ("Widget not found: %s", widget_name);
+  return found_widget;
+}
+
+static GList *pixmaps_directories = NULL;
+
+/* Use this function to set the directory containing installed pixmaps. */
+void
+add_pixmap_directory                   (const gchar     *directory)
+{
+  pixmaps_directories = g_list_prepend (pixmaps_directories,
+                                        g_strdup (directory));
+}
+
+/* This is an internally used function to find pixmap files. */
+static gchar*
+find_pixmap_file                       (const gchar     *filename)
+{
+  GList *elem;
+
+  /* We step through each of the pixmaps directory to find it. */
+  elem = pixmaps_directories;
+  while (elem)
+    {
+      gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
+                                         G_DIR_SEPARATOR_S, filename);
+      if (g_file_test (pathname, G_FILE_TEST_EXISTS))
+        return pathname;
+      g_free (pathname);
+      elem = elem->next;
+    }
+  return NULL;
+}
+
+/* This is an internally used function to create pixmaps. */
+GtkWidget*
+create_pixmap                          (GtkWidget       *widget,
+                                        const gchar     *filename)
+{
+  gchar *pathname = NULL;
+  GtkWidget *pixmap;
+
+  if (!filename || !filename[0])
+      return gtk_image_new ();
+
+  pathname = find_pixmap_file (filename);
+
+  if (!pathname)
+    {
+      g_warning ("Couldn't find pixmap file: %s", filename);
+      return gtk_image_new ();
+    }
+
+  pixmap = gtk_image_new_from_file (pathname);
+  g_free (pathname);
+  return pixmap;
+}
+
+/* This is an internally used function to create pixmaps. */
+GdkPixbuf*
+create_pixbuf                          (const gchar     *filename)
+{
+  gchar *pathname = NULL;
+  GdkPixbuf *pixbuf;
+  GError *error = NULL;
+
+  if (!filename || !filename[0])
+      return NULL;
+
+  pathname = find_pixmap_file (filename);
+
+  if (!pathname)
+    {
+      g_warning ("Couldn't find pixmap file: %s", filename);
+      return NULL;
+    }
+
+  pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
+  if (!pixbuf)
+    {
+      fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
+               pathname, error->message);
+      g_error_free (error);
+    }
+  g_free (pathname);
+  return pixbuf;
+}
+
+/* This is used to set ATK action descriptions. */
+void
+glade_set_atk_action_description       (AtkAction       *action,
+                                        const gchar     *action_name,
+                                        const gchar     *description)
+{
+  gint n_actions, i;
+
+  n_actions = atk_action_get_n_actions (action);
+  for (i = 0; i < n_actions; i++)
+    {
+      if (!strcmp (atk_action_get_name (action, i), action_name))
+        atk_action_set_description (action, i, description);
+    }
+}
+
diff --git a/gtk2/support.h b/gtk2/support.h
new file mode 100644 (file)
index 0000000..2dea079
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+/*
+ * Public Functions.
+ */
+
+/*
+ * This function returns a widget in a component created by Glade.
+ * Call it with the toplevel widget in the component (i.e. a window/dialog),
+ * or alternatively any widget in the component, and the name of the widget
+ * you want returned.
+ */
+GtkWidget*  lookup_widget              (GtkWidget       *widget,
+                                        const gchar     *widget_name);
+
+
+/* Use this function to set the directory containing installed pixmaps. */
+void        add_pixmap_directory       (const gchar     *directory);
+
+
+/*
+ * Private Functions.
+ */
+
+/* This is used to create the pixmaps used in the interface. */
+GtkWidget*  create_pixmap              (GtkWidget       *widget,
+                                        const gchar     *filename);
+
+/* This is used to create the pixbufs used in the interface. */
+GdkPixbuf*  create_pixbuf              (const gchar     *filename);
+
+/* This is used to set ATK action descriptions. */
+void        glade_set_atk_action_description (AtkAction       *action,
+                                              const gchar     *action_name,
+                                              const gchar     *description);
+