X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Finterface.c;h=adc7b86f6d9f802d787fba4d09c91742f7f2cf21;hb=348abadd910a29af82380c3b896f4eb4b2467483;hp=ab586fb6a1d7121f2120a595bfb98f23c181c937;hpb=b9bc35b8268f383f71be77d7e90275c14c6f86f8;p=rugen diff --git a/src/interface.c b/src/interface.c index ab586fb..adc7b86 100644 --- a/src/interface.c +++ b/src/interface.c @@ -26,6 +26,106 @@ #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ g_object_set_data (G_OBJECT (component), name, widget) +static void create_buttons_transport(GtkWidget *top, GtkWidget *parent_box) +{ + int i; + GtkWidget *hbox; + gchar name[32]; + const static struct + { + gchar* tooltip; + gchar* filename; + } buttons[] = + { + { + "Beginning of playlist", + "stock_media-begin-16.png" + }, + { + "Start of clip", + "stock_media-prev-16.png" + }, + { + "Rewind", + "stock_media-rew-16.png" + }, + { + "Previous frame", + "stock_media-prev-frame-16.png" + }, + { + "Pause", + "stock_media-pause-16.png" + }, + { + "Play", + "stock_media-play-16.png" + }, + { + "Stop", + "stock_media-stop-16.png" + }, + { + "Next frame", + "stock_media-next-frame-16.png" + }, + { + "Fast forward", + "stock_media-fwd-16.png" + }, + { + "Next clip", + "stock_media-next-16.png" + }, + { + "End of playlist", + "stock_media-end-16.png" + }, + { + "Loop On", + "eof-loop-16.png" + }, + { + "Loop Off", + "eof-pause-16.png" + }, + { + NULL, + NULL + } + }; + + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + gtk_box_pack_start (GTK_BOX (parent_box), hbox, FALSE, TRUE, 0); + + + for(i = 0; buttons[i].filename; i++) + { + GtkWidget *transport, *image; + + transport = gtk_button_new (); + gtk_widget_show (transport); + gtk_box_pack_start (GTK_BOX (hbox), transport, TRUE, FALSE, 0); + gtk_widget_set_size_request (transport, 34, 25); + GTK_WIDGET_UNSET_FLAGS (transport, GTK_CAN_FOCUS); + gtk_button_set_relief (GTK_BUTTON (transport), GTK_RELIEF_NONE); + gtk_widget_set_tooltip_text (transport, buttons[i].tooltip); + + image = gtk_image_new_from_pixbuf(create_pixbuf(buttons[i].filename)); + gtk_widget_show (image); + gtk_container_add (GTK_CONTAINER (transport), image); + + snprintf(name, sizeof(name), "transport_%d", i); + GLADE_HOOKUP_OBJECT (top, transport, name); + + snprintf(name, sizeof(name), "transport_image_%d", i); + GLADE_HOOKUP_OBJECT (top, image, name); + }; + + GLADE_HOOKUP_OBJECT (top, hbox, "buttons_transport_hbox"); +}; + GtkWidget* create_gdv1394d (void) { @@ -55,38 +155,12 @@ create_gdv1394d (void) GtkWidget *label40; GtkWidget *hbox20; GtkWidget *label46; - GtkWidget *hbox16; - GtkWidget *transport_0; - GtkWidget *image19; - GtkWidget *transport_1; - GtkWidget *image18; - GtkWidget *transport_2; - GtkWidget *image17; - GtkWidget *transport_3; - GtkWidget *image12; - GtkWidget *transport_4; - GtkWidget *image11; - GtkWidget *transport_5; - GtkWidget *image9; - GtkWidget *transport_6; - GtkWidget *alignment9; - GtkWidget *hbox17; - GtkWidget *image10; - GtkWidget *label41; - GtkWidget *transport_7; - GtkWidget *image13; - GtkWidget *transport_8; - GtkWidget *image14; - GtkWidget *transport_9; - GtkWidget *image15; - GtkWidget *transport_10; - GtkWidget *image16; GtkWidget *label47; GtkWidget *vbox_trim; GtkWidget *statusbar; gdv1394d = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (gdv1394d), _("Rugen")); + gtk_window_set_title (GTK_WINDOW (gdv1394d), _("Melted Client")); gtk_window_set_default_size (GTK_WINDOW (gdv1394d), 640, 480); vbox1 = gtk_vbox_new (FALSE, 0); @@ -216,154 +290,7 @@ create_gdv1394d (void) gtk_box_pack_start (GTK_BOX (hbox20), label46, TRUE, TRUE, 0); gtk_label_set_justify (GTK_LABEL (label46), GTK_JUSTIFY_LEFT); - hbox16 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox16); - gtk_box_pack_start (GTK_BOX (hbox20), hbox16, FALSE, TRUE, 0); - - transport_0 = gtk_button_new (); - gtk_widget_show (transport_0); - gtk_box_pack_start (GTK_BOX (hbox16), transport_0, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_0, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_0, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_0), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_0, _("Beginning of playlist")); - - image19 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-begin-16.png") ); - gtk_widget_show (image19); - gtk_container_add (GTK_CONTAINER (transport_0), image19); - - transport_1 = gtk_button_new (); - gtk_widget_show (transport_1); - gtk_box_pack_start (GTK_BOX (hbox16), transport_1, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_1, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_1, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_1), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_1, _("Start of clip")); - - image18 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-prev-16.png") ); - gtk_widget_show (image18); - gtk_container_add (GTK_CONTAINER (transport_1), image18); - - transport_2 = gtk_button_new (); - gtk_widget_show (transport_2); - gtk_box_pack_start (GTK_BOX (hbox16), transport_2, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_2, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_2, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_2), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_2, _("Rewind")); - - image17 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-rew-16.png") ); - gtk_widget_show (image17); - gtk_container_add (GTK_CONTAINER (transport_2), image17); - - transport_3 = gtk_button_new (); - gtk_widget_show (transport_3); - gtk_box_pack_start (GTK_BOX (hbox16), transport_3, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_3, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_3, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_3), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_3, _("Previous frame")); - - image12 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-prev-frame-16.png") ); - gtk_widget_show (image12); - gtk_container_add (GTK_CONTAINER (transport_3), image12); - - transport_4 = gtk_button_new (); - gtk_widget_show (transport_4); - gtk_box_pack_start (GTK_BOX (hbox16), transport_4, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_4, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_4, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_4), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_4, _("Pause")); - - image11 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-pause-16.png") ); - gtk_widget_show (image11); - gtk_container_add (GTK_CONTAINER (transport_4), image11); - - transport_5 = gtk_button_new (); - gtk_widget_show (transport_5); - gtk_box_pack_start (GTK_BOX (hbox16), transport_5, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_5, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_5, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_5), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_5, _("Play")); - - image9 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-play-16.png") ); - gtk_widget_show (image9); - gtk_container_add (GTK_CONTAINER (transport_5), image9); - - transport_6 = gtk_button_new (); - gtk_widget_show (transport_6); - gtk_box_pack_start (GTK_BOX (hbox16), transport_6, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_6, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_6, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_6), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_6, _("Stop")); - - alignment9 = gtk_alignment_new (0.5, 0.5, 0, 0); - gtk_widget_show (alignment9); - gtk_container_add (GTK_CONTAINER (transport_6), alignment9); - - hbox17 = gtk_hbox_new (FALSE, 2); - gtk_widget_show (hbox17); - gtk_container_add (GTK_CONTAINER (alignment9), hbox17); - - image10 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-stop-16.png") ); - gtk_widget_show (image10); - gtk_box_pack_start (GTK_BOX (hbox17), image10, FALSE, FALSE, 0); - - label41 = gtk_label_new_with_mnemonic (""); - gtk_widget_show (label41); - gtk_box_pack_start (GTK_BOX (hbox17), label41, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (label41), GTK_JUSTIFY_LEFT); - - transport_7 = gtk_button_new (); - gtk_widget_show (transport_7); - gtk_box_pack_start (GTK_BOX (hbox16), transport_7, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_7, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_7, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_7), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_7, _("Next frame")); - - image13 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-next-frame-16.png") ); - gtk_widget_show (image13); - gtk_container_add (GTK_CONTAINER (transport_7), image13); - - transport_8 = gtk_button_new (); - gtk_widget_show (transport_8); - gtk_box_pack_start (GTK_BOX (hbox16), transport_8, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_8, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_8, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_8), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_8, _("Fast forward")); - - image14 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-fwd-16.png") ); - gtk_widget_show (image14); - gtk_container_add (GTK_CONTAINER (transport_8), image14); - - transport_9 = gtk_button_new (); - gtk_widget_show (transport_9); - gtk_box_pack_start (GTK_BOX (hbox16), transport_9, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_9, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_9, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_9), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_9, _("Next clip")); - - image15 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-next-16.png") ); - gtk_widget_show (image15); - gtk_container_add (GTK_CONTAINER (transport_9), image15); - - transport_10 = gtk_button_new (); - gtk_widget_show (transport_10); - gtk_box_pack_start (GTK_BOX (hbox16), transport_10, TRUE, FALSE, 0); - gtk_widget_set_size_request (transport_10, 34, 25); - GTK_WIDGET_UNSET_FLAGS (transport_10, GTK_CAN_FOCUS); - gtk_button_set_relief (GTK_BUTTON (transport_10), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (transport_10, _("End of playlist")); - - image16 = gtk_image_new_from_pixbuf( create_pixbuf ("stock_media-end-16.png") ); - gtk_widget_show (image16); - gtk_container_add (GTK_CONTAINER (transport_10), image16); + create_buttons_transport(gdv1394d, hbox20); label47 = gtk_label_new (""); gtk_widget_show (label47); @@ -403,32 +330,6 @@ create_gdv1394d (void) GLADE_HOOKUP_OBJECT (gdv1394d, label40, "label40"); GLADE_HOOKUP_OBJECT (gdv1394d, hbox20, "hbox20"); GLADE_HOOKUP_OBJECT (gdv1394d, label46, "label46"); - GLADE_HOOKUP_OBJECT (gdv1394d, hbox16, "hbox16"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_0, "transport_0"); - GLADE_HOOKUP_OBJECT (gdv1394d, image19, "image19"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_1, "transport_1"); - GLADE_HOOKUP_OBJECT (gdv1394d, image18, "image18"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_2, "transport_2"); - GLADE_HOOKUP_OBJECT (gdv1394d, image17, "image17"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_3, "transport_3"); - GLADE_HOOKUP_OBJECT (gdv1394d, image12, "image12"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_4, "transport_4"); - GLADE_HOOKUP_OBJECT (gdv1394d, image11, "image11"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_5, "transport_5"); - GLADE_HOOKUP_OBJECT (gdv1394d, image9, "image9"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_6, "transport_6"); - GLADE_HOOKUP_OBJECT (gdv1394d, alignment9, "alignment9"); - GLADE_HOOKUP_OBJECT (gdv1394d, hbox17, "hbox17"); - GLADE_HOOKUP_OBJECT (gdv1394d, image10, "image10"); - GLADE_HOOKUP_OBJECT (gdv1394d, label41, "label41"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_7, "transport_7"); - GLADE_HOOKUP_OBJECT (gdv1394d, image13, "image13"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_8, "transport_8"); - GLADE_HOOKUP_OBJECT (gdv1394d, image14, "image14"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_9, "transport_9"); - GLADE_HOOKUP_OBJECT (gdv1394d, image15, "image15"); - GLADE_HOOKUP_OBJECT (gdv1394d, transport_10, "transport_10"); - GLADE_HOOKUP_OBJECT (gdv1394d, image16, "image16"); GLADE_HOOKUP_OBJECT (gdv1394d, label47, "label47"); GLADE_HOOKUP_OBJECT (gdv1394d, vbox_trim, "vbox_trim"); GLADE_HOOKUP_OBJECT (gdv1394d, statusbar, "statusbar"); @@ -592,330 +493,68 @@ create_window_connection (void) return window_connection; } -GtkWidget* -create_page_status (void) +static GtkWidget* create_pane_status (GtkWidget* parent, GtkWidget* top) { - GtkWidget *page_status; - GtkWidget *scrolledwindow4; - GtkWidget *viewport1; - GtkWidget *table3; - GtkWidget *label_unit_0; - GtkWidget *label_unit_1; - GtkWidget *label_unit_2; - GtkWidget *label_unit_3; - GtkWidget *label_unit_4; - GtkWidget *label_unit_5; - GtkWidget *label_unit_6; - GtkWidget *label_unit_7; - GtkWidget *label_unit_8; - GtkWidget *label_unit_9; - GtkWidget *label_unit_10; - GtkWidget *label_unit_11; - GtkWidget *label_unit_13; - GtkWidget *label_unit_14; - GtkWidget *label_unit_15; - GtkWidget *radiobutton_0; - GSList *radiobutton_0_group = NULL; - GtkWidget *radiobutton_1; - GtkWidget *radiobutton_2; - GtkWidget *radiobutton_3; - GtkWidget *radiobutton_4; - GtkWidget *radiobutton_5; - GtkWidget *radiobutton_6; - GtkWidget *radiobutton_7; - GtkWidget *radiobutton_8; - GtkWidget *radiobutton_9; - GtkWidget *radiobutton_10; - GtkWidget *radiobutton_11; - GtkWidget *label_unit_12; - GtkWidget *radiobutton_12; - GtkWidget *radiobutton_13; - GtkWidget *radiobutton_14; - GtkWidget *radiobutton_15; - - page_status = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (page_status), _("page_status")); - - scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (scrolledwindow4); - gtk_container_add (GTK_CONTAINER (page_status), scrolledwindow4); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - viewport1 = gtk_viewport_new (NULL, NULL); - gtk_widget_show (viewport1); - gtk_container_add (GTK_CONTAINER (scrolledwindow4), viewport1); - - table3 = gtk_table_new (32, 1, FALSE); - gtk_widget_show (table3); - gtk_container_add (GTK_CONTAINER (viewport1), table3); - - label_unit_0 = gtk_label_new (_("00")); - gtk_table_attach (GTK_TABLE (table3), label_unit_0, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_0), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_0), 0, 0.5); - - label_unit_1 = gtk_label_new (_("01")); - gtk_table_attach (GTK_TABLE (table3), label_unit_1, 0, 1, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_1), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_1), 0, 0.5); - - label_unit_2 = gtk_label_new (_("02")); - gtk_table_attach (GTK_TABLE (table3), label_unit_2, 0, 1, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_2), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_2), 0, 0.5); - - label_unit_3 = gtk_label_new (_("03")); - gtk_table_attach (GTK_TABLE (table3), label_unit_3, 0, 1, 7, 8, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_3), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_3), 0, 0.5); - - label_unit_4 = gtk_label_new (_("04")); - gtk_table_attach (GTK_TABLE (table3), label_unit_4, 0, 1, 9, 10, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_4), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_4), 0, 0.5); - - label_unit_5 = gtk_label_new (_("05")); - gtk_table_attach (GTK_TABLE (table3), label_unit_5, 0, 1, 11, 12, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_5), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_5), 0, 0.5); - - label_unit_6 = gtk_label_new (_("06")); - gtk_table_attach (GTK_TABLE (table3), label_unit_6, 0, 1, 13, 14, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_6), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_6), 0, 0.5); - - label_unit_7 = gtk_label_new (_("07")); - gtk_table_attach (GTK_TABLE (table3), label_unit_7, 0, 1, 15, 16, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_7), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_7), 0, 0.5); - - label_unit_8 = gtk_label_new (_("08")); - gtk_table_attach (GTK_TABLE (table3), label_unit_8, 0, 1, 17, 18, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_8), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_8), 0, 0.5); - - label_unit_9 = gtk_label_new (_("09")); - gtk_table_attach (GTK_TABLE (table3), label_unit_9, 0, 1, 19, 20, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_9), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_9), 0, 0.5); - - label_unit_10 = gtk_label_new (_("10")); - gtk_table_attach (GTK_TABLE (table3), label_unit_10, 0, 1, 21, 22, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_10), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_10), 0, 0.5); - - label_unit_11 = gtk_label_new (_("11")); - gtk_table_attach (GTK_TABLE (table3), label_unit_11, 0, 1, 23, 24, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_11), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_11), 0, 0.5); - - label_unit_13 = gtk_label_new (_("13")); - gtk_table_attach (GTK_TABLE (table3), label_unit_13, 0, 1, 27, 28, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_13), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_13), 0, 0.5); - - label_unit_14 = gtk_label_new (_("14")); - gtk_table_attach (GTK_TABLE (table3), label_unit_14, 0, 1, 29, 30, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_14), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_14), 0, 0.5); - - label_unit_15 = gtk_label_new (_("15")); - gtk_table_attach (GTK_TABLE (table3), label_unit_15, 0, 1, 31, 32, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_15), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_15), 0, 0.5); - - radiobutton_0 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_0, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_0), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_0)); - - radiobutton_1 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_1, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_1), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_1)); - - radiobutton_2 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_2, 0, 1, 4, 5, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_2), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_2)); - - radiobutton_3 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_3, 0, 1, 6, 7, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_3), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_3)); - - radiobutton_4 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_4, 0, 1, 8, 9, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_4), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_4)); - - radiobutton_5 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_5, 0, 1, 10, 11, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_5), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_5)); - - radiobutton_6 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_6, 0, 1, 12, 13, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_6), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_6)); - - radiobutton_7 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_7, 0, 1, 14, 15, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_7), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_7)); - - radiobutton_8 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_8, 0, 1, 16, 17, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_8), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_8)); - - radiobutton_9 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_9, 0, 1, 18, 19, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_9), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_9)); - - radiobutton_10 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_10, 0, 1, 20, 21, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_10), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_10)); - - radiobutton_11 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_11, 0, 1, 22, 23, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_11), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_11)); - - label_unit_12 = gtk_label_new (_("12")); - gtk_table_attach (GTK_TABLE (table3), label_unit_12, 0, 1, 25, 26, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_label_set_justify (GTK_LABEL (label_unit_12), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label_unit_12), 0, 0.5); - - radiobutton_12 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_12, 0, 1, 24, 25, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_12), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_12)); - - radiobutton_13 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_13, 0, 1, 26, 27, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_13), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_13)); - - radiobutton_14 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_14, 0, 1, 28, 29, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_14), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_14)); - - radiobutton_15 = gtk_radio_button_new_with_mnemonic (NULL, _("")); - gtk_table_attach (GTK_TABLE (table3), radiobutton_15, 0, 1, 30, 31, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_15), radiobutton_0_group); - radiobutton_0_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_15)); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (page_status, page_status, "page_status"); - GLADE_HOOKUP_OBJECT (page_status, scrolledwindow4, "scrolledwindow4"); - GLADE_HOOKUP_OBJECT (page_status, viewport1, "viewport1"); - GLADE_HOOKUP_OBJECT (page_status, table3, "table3"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_0, "label_unit_0"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_1, "label_unit_1"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_2, "label_unit_2"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_3, "label_unit_3"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_4, "label_unit_4"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_5, "label_unit_5"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_6, "label_unit_6"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_7, "label_unit_7"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_8, "label_unit_8"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_9, "label_unit_9"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_10, "label_unit_10"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_11, "label_unit_11"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_13, "label_unit_13"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_14, "label_unit_14"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_15, "label_unit_15"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_0, "radiobutton_0"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_1, "radiobutton_1"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_2, "radiobutton_2"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_3, "radiobutton_3"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_4, "radiobutton_4"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_5, "radiobutton_5"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_6, "radiobutton_6"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_7, "radiobutton_7"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_8, "radiobutton_8"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_9, "radiobutton_9"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_10, "radiobutton_10"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_11, "radiobutton_11"); - GLADE_HOOKUP_OBJECT (page_status, label_unit_12, "label_unit_12"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_12, "radiobutton_12"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_13, "radiobutton_13"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_14, "radiobutton_14"); - GLADE_HOOKUP_OBJECT (page_status, radiobutton_15, "radiobutton_15"); - - return page_status; + int i; + char buf[32]; + + GtkWidget *scrolledwindow; + GtkWidget *viewport; + GtkWidget *table; + GSList *radiobutton_group = NULL; + + // create a scrolled area + scrolledwindow = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow); + if ( parent ) + gtk_container_add (GTK_CONTAINER (parent), scrolledwindow); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + GLADE_HOOKUP_OBJECT (top, scrolledwindow, "scrolledwindow4"); + + // create a viewport + viewport = gtk_viewport_new (NULL, NULL); + gtk_widget_show (viewport); + gtk_container_add (GTK_CONTAINER (scrolledwindow), viewport); + GLADE_HOOKUP_OBJECT (top, viewport, "viewport1"); + + // create a table for displaying radios + table = gtk_table_new (32, 1, FALSE); + gtk_widget_show (table); + gtk_container_add (GTK_CONTAINER (viewport), table); + GLADE_HOOKUP_OBJECT (top, table, "table3"); + + for (i = 0; i < 16; i++) + { + GtkWidget *label_unit; + GtkWidget *radiobutton; + + // label unit + snprintf(buf, sizeof(buf), "%.2d", i); + label_unit = gtk_label_new (buf); + gtk_table_attach (GTK_TABLE (table), label_unit, 0, 1, i * 2 + 1, i * 2 + 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label_unit), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label_unit), 0, 0.5); + snprintf(buf, sizeof(buf), "label_unit_%d", i); + GLADE_HOOKUP_OBJECT (top, label_unit, buf); + + // radio button + radiobutton = gtk_radio_button_new_with_mnemonic (NULL, _("")); + gtk_table_attach (GTK_TABLE (table), radiobutton, 0, 1, i * 2, i * 2 + 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton), radiobutton_group); + radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton)); + snprintf(buf, sizeof(buf), "radiobutton_%d", i); + GLADE_HOOKUP_OBJECT (top, radiobutton, buf); + } + + return scrolledwindow; } GtkWidget* -create_page_clips (void) +create_page_operate (void) { GtkWidget *page_clips; GtkWidget *vbox8; @@ -961,13 +600,38 @@ create_page_clips (void) GtkWidget *image24; GtkWidget *hbuttonbox5; GtkWidget *label45; + GtkWidget *hpaned0; + GtkWidget *frame1, *frame2; page_clips = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (page_clips), _("page_clips")); + gtk_window_set_title (GTK_WINDOW (page_clips), _("page_operate")); + GLADE_HOOKUP_OBJECT_NO_REF (page_clips, page_clips, "page_operate"); + + hpaned0 = gtk_hpaned_new (); + gtk_widget_show (hpaned0); + gtk_container_add (GTK_CONTAINER (page_clips), hpaned0); + GLADE_HOOKUP_OBJECT (page_clips, hpaned0, "hpaned0"); + + frame1 = gtk_frame_new ("Playlist"); + frame2 = gtk_frame_new ("Units"); + gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN); + gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN); + gtk_widget_show(frame1); + GLADE_HOOKUP_OBJECT (page_clips, frame1, "page_clips"); + gtk_widget_show(frame2); + GLADE_HOOKUP_OBJECT (page_clips, frame2, "page_status"); + + gtk_widget_set_size_request (hpaned0, 200 , -1); + gtk_paned_pack1 (GTK_PANED (hpaned0), frame1, TRUE, FALSE); + gtk_widget_set_size_request (frame1, 50, -1); + gtk_paned_pack2 (GTK_PANED (hpaned0), frame2, FALSE, FALSE); + gtk_widget_set_size_request (frame2, 250, -1); + + create_pane_status (frame2, page_clips); vbox8 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox8); - gtk_container_add (GTK_CONTAINER (page_clips), vbox8); + gtk_container_add (GTK_CONTAINER (frame1), vbox8); hbox26 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox26); @@ -1131,7 +795,7 @@ create_page_clips (void) GTK_WIDGET_UNSET_FLAGS (button_up, GTK_CAN_FOCUS); GTK_WIDGET_SET_FLAGS (button_up, GTK_CAN_DEFAULT); gtk_button_set_relief (GTK_BUTTON (button_up), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (button_up, _("Move current clip up")); + gtk_widget_set_tooltip_text (button_up, _("Move clip up")); image21 = gtk_image_new_from_stock ("gtk-go-up", GTK_ICON_SIZE_MENU); gtk_widget_show (image21); @@ -1143,7 +807,7 @@ create_page_clips (void) GTK_WIDGET_UNSET_FLAGS (button_down, GTK_CAN_FOCUS); GTK_WIDGET_SET_FLAGS (button_down, GTK_CAN_DEFAULT); gtk_button_set_relief (GTK_BUTTON (button_down), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (button_down, _("Move current clip down")); + gtk_widget_set_tooltip_text (button_down, _("Move clip down")); image22 = gtk_image_new_from_stock ("gtk-go-down", GTK_ICON_SIZE_MENU); gtk_widget_show (image22); @@ -1155,7 +819,7 @@ create_page_clips (void) GTK_WIDGET_UNSET_FLAGS (button_remove, GTK_CAN_FOCUS); GTK_WIDGET_SET_FLAGS (button_remove, GTK_CAN_DEFAULT); gtk_button_set_relief (GTK_BUTTON (button_remove), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (button_remove, _("Remove current clip")); + gtk_widget_set_tooltip_text (button_remove, _("Remove clip")); image23 = gtk_image_new_from_stock ("gtk-delete", GTK_ICON_SIZE_MENU); gtk_widget_show (image23); @@ -1183,7 +847,6 @@ create_page_clips (void) gtk_label_set_justify (GTK_LABEL (label45), GTK_JUSTIFY_LEFT); /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (page_clips, page_clips, "page_clips"); GLADE_HOOKUP_OBJECT (page_clips, vbox8, "vbox8"); GLADE_HOOKUP_OBJECT (page_clips, hbox26, "hbox26"); GLADE_HOOKUP_OBJECT (page_clips, label_directory, "label_directory");