g_debug("dep_check () %s", name);
+ if (rev_map == NULL) return TRUE;
array = ghb_dict_lookup(rev_map, name);
count = ghb_array_len(array);
*out_hide = FALSE;
name = gtk_widget_get_name(widget);
g_debug("ghb_check_dependency () %s", name);
+ if (dep_map == NULL) return;
array = ghb_dict_lookup(dep_map, name);
count = ghb_array_len(array);
for (ii = 0; ii < count; ii++)
GObject *dep_object;
g_debug("ghb_check_all_depencencies ()");
+ if (rev_map == NULL) return;
ghb_dict_iter_init(&iter, rev_map);
// middle (void*) cast prevents gcc warning "defreferencing type-punned
// pointer will break strict-aliasing rules"
val = dict()
stack.append(val)
elif tag == "icon":
- fname = attr["file"]
- fname = find_file(fname)
+ fbase = attr["file"]
+ fname = find_file(fbase)
key = attr["name"]
if fname != None and key != None:
val = dict()
val["height"] = pb.get_height()
val["rowstride"] = pb.get_rowstride()
val["data"] = plistlib.Data(pb.get_pixels())
+ elif fname == None:
+ print >> sys.stderr, ( "Error: No such icon file %s" % fbase )
+ sys.exit(1)
elif tag == "plist":
- fname = attr["file"]
- fname = find_file(fname)
+ fbase = attr["file"]
+ fname = find_file(fbase)
key = attr["name"]
if fname != None and key != None:
val = plistlib.readPlist(fname)
+ elif fname == None:
+ print >> sys.stderr, ( "Error: No such plist file %s" % fbase )
+ sys.exit(1)
elif tag == "string":
- fname = attr["file"]
- fname = find_file(fname)
+ fbase = attr["file"]
+ fname = find_file(fbase)
key = attr["name"]
if fname != None and key != None:
try:
val = ff.read()
except Exception, err:
print >> sys.stderr, ( "Error: %s" % str(err) )
+ sys.exit(1)
+ elif fname == None:
+ print >> sys.stderr, ( "Error: No such string file %s" % fbase )
+ sys.exit(1)
if val != None:
if type(current) == types.DictType:
global inc_list
for inc_dir in inc_list:
- inc = "%s/%s" % inc_dir, name
+ inc = "%s/%s" % (inc_dir, name)
if os.path.isfile(inc):
return inc
#include "values.h"
#include "resources.h"
+#if 0
+void
+ghb_load_icons()
+{
+ GHashTableIter iter;
+ gchar *name;
+ GValue *gval;
+
+ GValue *icons = ghb_resource_get("icons");
+ ghb_dict_iter_init(&iter, icons);
+ // middle (void*) cast prevents gcc warning "defreferencing type-punned
+ // pointer will break strict-aliasing rules"
+ while (g_hash_table_iter_next(
+ &iter, (gpointer*)(void*)&name, (gpointer*)(void*)&gval))
+ {
+ gint colorspace, bps, width, height, rowstride;
+ gboolean alpha;
+ ghb_rawdata_t *rd;
+ gint size;
+ GdkPixbuf *pb;
+
+ colorspace = ghb_value_int(ghb_dict_lookup(gval, "colorspace"));
+ alpha = ghb_value_boolean(ghb_dict_lookup(gval, "alpha"));
+ bps = ghb_value_int(ghb_dict_lookup(gval, "bps"));
+ width = ghb_value_int(ghb_dict_lookup(gval, "width"));
+ height = ghb_value_int(ghb_dict_lookup(gval, "height"));
+ rowstride = ghb_value_int(ghb_dict_lookup(gval, "rowstride"));
+ rd = g_value_get_boxed(ghb_dict_lookup(gval, "data"));
+ pb = gdk_pixbuf_new_from_data(
+ rd->data, colorspace, alpha, bps,
+ width, height, rowstride,
+ NULL, NULL);
+ size = gdk_pixbuf_get_height(pb);
+ gtk_icon_theme_add_builtin_icon(name, size, pb);
+ gdk_pixbuf_unref(pb);
+ }
+}
+
+#else
+
void
ghb_load_icons()
{
gdk_pixbuf_unref(pb);
}
}
+#endif