[aravis] boolean: return G_TYPE_BOOLEAN as value_type.



commit 3f92b13a755c4b6459efeadcf8a65cf5a45eed38
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Wed Sep 4 15:06:09 2013 +0200

    boolean: return G_TYPE_BOOLEAN as value_type.

 src/arvgcboolean.c |    7 +++++++
 src/arvtool.c      |    5 +++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/arvgcboolean.c b/src/arvgcboolean.c
index 6ca69fc..dcef250 100644
--- a/src/arvgcboolean.c
+++ b/src/arvgcboolean.c
@@ -102,6 +102,12 @@ arv_gc_boolean_get_value_as_string (ArvGcFeatureNode *node, GError **error)
        return string;
 }
 
+static GType
+arv_gc_boolean_get_value_type (ArvGcFeatureNode *node)
+{
+       return G_TYPE_BOOLEAN;
+}
+
 /* ArvGcBoolean implementation */
 
 static gint64
@@ -233,6 +239,7 @@ arv_gc_boolean_class_init (ArvGcBooleanClass *this_class)
        dom_node_class->pre_remove_child = arv_gc_boolean_pre_remove_child;
        gc_feature_node_class->set_value_from_string = arv_gc_boolean_set_value_from_string;
        gc_feature_node_class->get_value_as_string = arv_gc_boolean_get_value_as_string;
+       gc_feature_node_class->get_value_type = arv_gc_boolean_get_value_type;
 }
 
 /* ArvGcInteger interface implementation */
diff --git a/src/arvtool.c b/src/arvtool.c
index 1267397..2e0bc4a 100644
--- a/src/arvtool.c
+++ b/src/arvtool.c
@@ -162,6 +162,11 @@ arv_tool_execute_command (int argc, char **argv, const char *device_name)
                                                        printf ("%s = %s\n", tokens[0],
                                                                arv_gc_string_get_value (ARV_GC_STRING 
(feature), NULL));
                                                        break;
+                                               case G_TYPE_BOOLEAN:
+                                                       printf ("%s = %s\n", tokens[0],
+                                                               arv_gc_integer_get_value (ARV_GC_INTEGER 
(feature), NULL) != 0 ?
+                                                               "true" : "false");
+                                                       break;
                                                default:
                                                        printf ("%s = %s\n", tokens[0],
                                                                arv_gc_feature_node_get_value_as_string


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]