Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | As the rest of Sato is GTK+ 2, patch gtk-play to use GTK+ 2. When the rest of |
| 2 | Sato has been ported to GTK+ 3 this patch can be dropped. |
| 3 | |
| 4 | Upstream-Status: Inappropriate |
| 5 | Signed-off-by: Ross Burton <ross.burton@intel.com> |
| 6 | |
| 7 | |
| 8 | diff --git a/configure.ac b/configure.ac |
| 9 | index b8af13b..90ab74c 100644 |
| 10 | --- a/configure.ac |
| 11 | +++ b/configure.ac |
| 12 | @@ -60,7 +60,7 @@ AC_SUBST(GLIB_PREFIX) |
| 13 | GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-1.0`" |
| 14 | AC_SUBST(GST_PREFIX) |
| 15 | |
| 16 | -PKG_CHECK_MODULES(GTK, [gtk+-3.0], [have_gtk="yes"], [have_gtk="no"]) |
| 17 | +PKG_CHECK_MODULES(GTK, [gtk+-2.0], [have_gtk="yes"], [have_gtk="no"]) |
| 18 | AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" != "xno") |
| 19 | |
| 20 | GOBJECT_INTROSPECTION_CHECK([1.31.1]) |
| 21 | diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c |
| 22 | index f015077..954d6fb 100644 |
| 23 | --- a/gtk/gtk-play.c |
| 24 | +++ b/gtk/gtk-play.c |
| 25 | @@ -34,6 +34,46 @@ typedef struct |
| 26 | gulong seekbar_value_changed_signal_id; |
| 27 | } GtkPlay; |
| 28 | |
| 29 | +/* Compat stubs */ |
| 30 | +GtkWidget * |
| 31 | +gtk_box_new (GtkOrientation orientation, |
| 32 | + gint spacing) |
| 33 | +{ |
| 34 | + switch (orientation) { |
| 35 | + case GTK_ORIENTATION_HORIZONTAL: |
| 36 | + return gtk_hbox_new (FALSE, spacing); |
| 37 | + case GTK_ORIENTATION_VERTICAL: |
| 38 | + return gtk_vbox_new (FALSE, spacing); |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +GtkWidget* |
| 43 | +gtk_button_new_from_icon_name (const gchar *icon_name, |
| 44 | + GtkIconSize size) |
| 45 | +{ |
| 46 | + GtkWidget *button; |
| 47 | + GtkWidget *image; |
| 48 | + |
| 49 | + image = gtk_image_new_from_icon_name (icon_name, size); |
| 50 | + button = g_object_new (GTK_TYPE_BUTTON, |
| 51 | + "image", image, |
| 52 | + NULL); |
| 53 | + return button; |
| 54 | +} |
| 55 | + |
| 56 | +GtkWidget * |
| 57 | +gtk_scale_new_with_range (GtkOrientation orientation, |
| 58 | + gdouble min, |
| 59 | + gdouble max, |
| 60 | + gdouble step) |
| 61 | +{ |
| 62 | + switch (orientation) { |
| 63 | + case GTK_ORIENTATION_HORIZONTAL: |
| 64 | + return gtk_hscale_new_with_range (min, max, step); |
| 65 | + case GTK_ORIENTATION_VERTICAL: |
| 66 | + return gtk_vscale_new_with_range (min, max, step); |
| 67 | + } |
| 68 | +} |
| 69 | |
| 70 | static void |
| 71 | set_title (GtkPlay * play, const gchar * title) |