summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-12-28 18:19:48 +0000
committerjstebbins <[email protected]>2014-12-28 18:19:48 +0000
commitdc1da0134ffd8593d9a81b41dc235c6638f44a02 (patch)
treefa24d18a9f5f35165c16503e194341296cadc40f
parenta03845e869297931544d4d8ba5a15678411df155 (diff)
LinGui: Enable building with different versions of the xml UI description
This is necessary in order to cleanly track with new features and deprecations in gtk. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6665 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--gtk/configure.ac2
-rw-r--r--gtk/src/Makefile.am2
-rw-r--r--gtk/src/create_resources.c25
-rw-r--r--gtk/src/resources.list3
4 files changed, 28 insertions, 4 deletions
diff --git a/gtk/configure.ac b/gtk/configure.ac
index 6704bc693..f3e988eac 100644
--- a/gtk/configure.ac
+++ b/gtk/configure.ac
@@ -153,7 +153,7 @@ if test x"$BUILD_PKG_CONFIG" = x"no"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
-GHB_TOOLS_CFLAGS=`$BUILD_PKG_CONFIG --cflags glib-2.0 gdk-pixbuf-2.0`
+GHB_TOOLS_CFLAGS=`$BUILD_PKG_CONFIG --cflags glib-2.0 gdk-pixbuf-2.0 gtk+-3.0`
GHB_TOOLS_LIBS=`$BUILD_PKG_CONFIG --libs glib-2.0 gdk-pixbuf-2.0`
HB_LIBS="-lhandbrake -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson"
diff --git a/gtk/src/Makefile.am b/gtk/src/Makefile.am
index ee61e2122..dc1eb76d8 100644
--- a/gtk/src/Makefile.am
+++ b/gtk/src/Makefile.am
@@ -95,7 +95,7 @@ widget_reverse.deps: makedeps.py
widget.deps: makedeps.py
python2 $(srcdir)/makedeps.py
-resources.plist: create_resources resources.list $(icons_dep) internal_defaults.xml standard_presets.xml ghb.ui widget.deps widget_reverse.deps
+resources.plist: create_resources resources.list $(icons_dep) internal_defaults.xml standard_presets.xml ghb.ui ghb-3.12.ui widget.deps widget_reverse.deps
./create_resources -I$(srcdir) $(srcdir)/resources.list resources.plist
CREATE_RES.c = \
diff --git a/gtk/src/create_resources.c b/gtk/src/create_resources.c
index 3bd3c23f4..3ac723c70 100644
--- a/gtk/src/create_resources.c
+++ b/gtk/src/create_resources.c
@@ -8,6 +8,7 @@
#include "values.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk-pixbuf/gdk-pixdata.h>
+#include <gtk/gtk.h>
enum
{
@@ -274,11 +275,33 @@ start_element(
{
gchar *fname;
const gchar *name;
+ const gchar *version;
+ char *end;
+ int major = 0, minor = 0, micro = 0;
name = lookup_attr_value("file", attr_names, attr_values);
fname = find_file(inc_list, name);
name = lookup_attr_value("name", attr_names, attr_values);
- if (fname && name)
+ version = lookup_attr_value("version", attr_names, attr_values);
+ if (version)
+ {
+ major = strtol(version, &end, 10);
+ if (end != version && *end != 0)
+ {
+ version = end + 1;
+ minor = strtol(version, &end, 10);
+ if (end != version && *end != 0)
+ {
+ version = end + 1;
+ micro = strtol(version, &end, 10);
+ if (end != version && *end != 0)
+ {
+ version = end + 1;
+ }
+ }
+ }
+ }
+ if (fname && name && GTK_CHECK_VERSION(major, minor, micro))
{
gval = read_string_from_file(fname);
if (pd->key) g_free(pd->key);
diff --git a/gtk/src/resources.list b/gtk/src/resources.list
index b02864355..48899fa60 100644
--- a/gtk/src/resources.list
+++ b/gtk/src/resources.list
@@ -17,5 +17,6 @@
<plist name="standard-presets" file="standard_presets.xml" />
<plist name="widget-deps" file="widget.deps" />
<plist name="widget-reverse-deps" file="widget_reverse.deps" />
- <string name="ghb-ui" file="ghb.ui" />
+ <string version="3.10" name="ghb-ui" file="ghb.ui" />
+ <string version="3.12" name="ghb-ui" file="ghb-3.12.ui" />
</resources>