X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=gtk%2Fsrc%2Fvalues.c;h=17319a582ef3afc7f3b0b9863430671981fdf9e0;hb=2c55a7172bfed971b7255f93323950d23ab775cf;hp=94b417f6d39165d47cf5d6846c7447b0f5eb08ec;hpb=7f9e1e2552c13a16423d2668c734740e020e95ff;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/gtk/src/values.c b/gtk/src/values.c index 94b417f6..17319a58 100644 --- a/gtk/src/values.c +++ b/gtk/src/values.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "values.h" static void dict_delete_key(gpointer data); @@ -77,7 +78,43 @@ debug_show_type(GType tp) { str ="dict"; } - g_debug("%s", str); + g_debug("Type %s", str); +} + +void +debug_show_value(GValue *gval) +{ + GType tp; + + tp = G_VALUE_TYPE(gval); + if (tp == G_TYPE_STRING) + { + g_message("Type %s value %s", "string", g_value_get_string(gval)); + } + else if (tp == G_TYPE_INT) + { + g_message("Type %s value %d", "int", g_value_get_int(gval)); + } + else if (tp == G_TYPE_INT64) + { + g_message("Type %s value %" PRId64, "int64", g_value_get_int64(gval)); + } + else if (tp == G_TYPE_DOUBLE) + { + g_message("Type %s value %f", "double", g_value_get_double(gval)); + } + else if (tp == G_TYPE_BOOLEAN) + { + g_message("Type %s value %d", "boolean", g_value_get_boolean(gval)); + } + else if (tp == ghb_array_get_type()) + { + g_message("Type %s", "boolean"); + } + else if (tp == ghb_dict_get_type()) + { + g_message("Type %s", "dict"); + } } gint @@ -216,6 +253,10 @@ ghb_value_cmp(const GValue *vala, const GValue *valb) GType typa; GType typb; + if ((vala == NULL && valb != NULL) || (vala != NULL && valb == NULL)) + { + return 1; + } typa = G_VALUE_TYPE(vala); typb = G_VALUE_TYPE(valb); if (typa != typb) @@ -533,7 +574,7 @@ ghb_dict_iter_init(GHashTableIter *iter, GValue *gval) } GValue* -ghb_dict_lookup(GValue *gval, const gchar *key) +ghb_dict_lookup(const GValue *gval, const gchar *key) { GHashTable *dict = g_value_get_boxed(gval); return g_hash_table_lookup(dict, key);