jsseek: update deprecated GTK API

This commit is contained in:
Luis de Bethencourt 2015-04-01 14:37:23 +01:00
parent fc5d98c3bc
commit fc74875edc

View file

@ -24,9 +24,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
* with newer GTK versions (>= 3.3.0) */
#define GDK_DISABLE_DEPRECATION_WARNINGS
#include <glib.h>
#include <glib/gstdio.h>
@ -2727,20 +2724,22 @@ main (int argc, char **argv)
video_window = gtk_drawing_area_new ();
g_signal_connect (video_window, "draw", G_CALLBACK (draw_cb), NULL);
g_signal_connect (video_window, "realize", G_CALLBACK (realize_cb), NULL);
gtk_widget_set_double_buffered (video_window, FALSE);
statusbar = gtk_statusbar_new ();
status_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar), "seek");
gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stopped");
hbox = gtk_hbox_new (FALSE, 0);
vbox = gtk_vbox_new (FALSE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
flaggrid = gtk_grid_new ();
gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
/* media controls */
play_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PLAY);
pause_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PAUSE);
stop_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_STOP);
play_button = gtk_button_new_from_icon_name ("media-playback-start",
GTK_ICON_SIZE_BUTTON);
pause_button = gtk_button_new_from_icon_name ("media-playback-pause",
GTK_ICON_SIZE_BUTTON);
stop_button = gtk_button_new_from_icon_name ("media-playback-stop",
GTK_ICON_SIZE_BUTTON);
/* seek flags */
accurate_checkbox = gtk_check_button_new_with_label ("Accurate Seek");
@ -2777,7 +2776,7 @@ main (int argc, char **argv)
GtkWidget *hbox;
step = gtk_expander_new ("step options");
hbox = gtk_hbox_new (FALSE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
format_combo = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (format_combo),
@ -2798,7 +2797,8 @@ main (int argc, char **argv)
gtk_spin_button_set_value (GTK_SPIN_BUTTON (step_rate_spinbutton), 1.0);
gtk_box_pack_start (GTK_BOX (hbox), step_rate_spinbutton, FALSE, FALSE, 2);
step_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_FORWARD);
step_button = gtk_button_new_from_icon_name ("media-seek-forward",
GTK_ICON_SIZE_BUTTON);
gtk_button_set_label (GTK_BUTTON (step_button), "Step");
gtk_box_pack_start (GTK_BOX (hbox), step_button, FALSE, FALSE, 2);
@ -2814,7 +2814,8 @@ main (int argc, char **argv)
shuttle_adjustment =
GTK_ADJUSTMENT (gtk_adjustment_new (0.0, -3.00, 4.0, 0.1, 1.0, 1.0));
shuttle_hscale = gtk_hscale_new (shuttle_adjustment);
shuttle_hscale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL,
shuttle_adjustment);
gtk_scale_set_digits (GTK_SCALE (shuttle_hscale), 2);
gtk_scale_set_value_pos (GTK_SCALE (shuttle_hscale), GTK_POS_TOP);
g_signal_connect (shuttle_hscale, "value_changed",
@ -2830,7 +2831,7 @@ main (int argc, char **argv)
/* seek bar */
adjustment =
GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, 100.0, 0.1, 1.0, 1.0));
hscale = gtk_hscale_new (adjustment);
hscale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
gtk_scale_set_digits (GTK_SCALE (hscale), 2);
gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_RIGHT);
gtk_range_set_show_fill_level (GTK_RANGE (hscale), TRUE);
@ -2845,7 +2846,7 @@ main (int argc, char **argv)
if (pipeline_type == 16) {
/* the playbin panel controls for the video/audio/subtitle tracks */
panel = gtk_hbox_new (FALSE, 0);
panel = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
video_combo = gtk_combo_box_text_new ();
audio_combo = gtk_combo_box_text_new ();
text_combo = gtk_combo_box_text_new ();
@ -2862,7 +2863,7 @@ main (int argc, char **argv)
g_signal_connect (G_OBJECT (text_combo), "changed",
G_CALLBACK (text_combo_cb), pipeline);
/* playbin panel for flag checkboxes and volume/mute */
boxes = gtk_hbox_new (FALSE, 0);
boxes = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
vis_checkbox = gtk_check_button_new_with_label ("Vis");
video_checkbox = gtk_check_button_new_with_label ("Video");
audio_checkbox = gtk_check_button_new_with_label ("Audio");
@ -2906,8 +2907,9 @@ main (int argc, char **argv)
g_signal_connect (G_OBJECT (volume_spinbutton), "value_changed",
G_CALLBACK (volume_spinbutton_changed_cb), pipeline);
/* playbin panel for snapshot */
boxes2 = gtk_hbox_new (FALSE, 0);
shot_button = gtk_button_new_from_stock (GTK_STOCK_SAVE);
boxes2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
shot_button = gtk_button_new_from_icon_name ("document-save",
GTK_ICON_SIZE_BUTTON);
gtk_widget_set_tooltip_text (shot_button,
"save a screenshot .png in the current directory");
g_signal_connect (G_OBJECT (shot_button), "clicked", G_CALLBACK (shot_cb),
@ -2949,7 +2951,7 @@ main (int argc, char **argv)
if (panel && boxes && boxes2) {
expander = gtk_expander_new ("playbin options");
pb2vbox = gtk_vbox_new (FALSE, 0);
pb2vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start (GTK_BOX (pb2vbox), panel, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (pb2vbox), boxes, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (pb2vbox), boxes2, FALSE, FALSE, 2);