summaryrefslogtreecommitdiffstats
path: root/gtk/src/create_resources.c
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 /gtk/src/create_resources.c
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
Diffstat (limited to 'gtk/src/create_resources.c')
-rw-r--r--gtk/src/create_resources.c25
1 files changed, 24 insertions, 1 deletions
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);