[seed] rename with_length to _full, since relay of calling for enums sent the wrong data, and got the wrong



commit 1e537cdba82557298cf074fc00cd6eab7b4c8098
Author: Alan Knowles <alan roojs com>
Date:   Sat May 12 18:20:01 2012 +0800

    rename with_length to _full, since relay of calling for enums sent the wrong data, and got the wrong result..

 libseed/seed-engine.c |    8 +++++---
 libseed/seed-types.c  |   23 ++++++++++++++---------
 libseed/seed-types.h  |    5 +++--
 3 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/libseed/seed-engine.c b/libseed/seed-engine.c
index ff10c60..2e782e8 100644
--- a/libseed/seed-engine.c
+++ b/libseed/seed-engine.c
@@ -690,7 +690,9 @@ seed_gobject_method_invoked (JSContextRef ctx,
       tag = g_type_info_get_tag (type_info);
 
       // might need to add g_type_info_is_pointer (type_info) check here..
-      
+       SEED_NOTE (INVOCATION, "method: %s returned value of type %s ",
+	    g_base_info_get_name (info),  g_type_tag_to_string(tag)
+        );
       if (tag == GI_TYPE_TAG_VOID) 
         {
           // if we have no out args - returns undefined
@@ -796,8 +798,8 @@ seed_gobject_method_invoked (JSContextRef ctx,
 	}
 	
 	
-	jsout_val = seed_value_from_gi_argument_with_length (ctx, &out_values[out_args_pos],
-						 type_info, exception, array_len);
+	jsout_val = seed_value_from_gi_argument_full (ctx, &out_values[out_args_pos],
+						 type_info, exception, array_len, g_type_info_get_tag (type_info) );
   
       }
 #if GOBJECT_INTROSPECTION_VERSION > 0x000613
diff --git a/libseed/seed-types.c b/libseed/seed-types.c
index 05c6396..bb1e725 100644
--- a/libseed/seed-types.c
+++ b/libseed/seed-types.c
@@ -824,25 +824,28 @@ seed_value_from_gi_argument (JSContextRef ctx,
 			     JSValueRef * exception)
 {
   
- return seed_value_from_gi_argument_with_length (
+ return seed_value_from_gi_argument_full (
                             ctx,
 			    arg,
 			    type_info,
 			    exception,
-			    0);
+			    0,
+                            g_type_info_get_tag (type_info) );
 }
   
 JSValueRef
-seed_value_from_gi_argument_with_length (JSContextRef ctx,
+seed_value_from_gi_argument_full (JSContextRef ctx,
 			     GArgument * arg,
 			     GITypeInfo * type_info,
 			     JSValueRef * exception,
-			     gint array_len)
+			     gint array_len,
+                             GITypeTag gi_tag
+                             )
 {
-  GITypeTag gi_tag = g_type_info_get_tag (type_info);
+  
   //seed_value_from_gi_argument_with_length : g_type_tag_to_string(gi_tag)
    SEED_NOTE (INVOCATION,
-            "seed_value_from_gi_argument_with_length: arg_type = %s ",
+            "seed_value_from_gi_argument_full: arg_type = %s ",
             g_type_tag_to_string(gi_tag)
             ); 
 
@@ -1003,13 +1006,15 @@ seed_value_from_gi_argument_with_length (JSContextRef ctx,
             JSValueRef ret;
             GITypeTag etype = g_enum_info_get_storage_type (interface); 
 	    
+            // needs GITypeInfo - we are sending it  GIBaseInfo
             
-            ret =  seed_value_from_gi_argument_with_length (
+            ret =  seed_value_from_gi_argument_full (
                             ctx,
 			    arg,
-			    interface,
+			    type_info,
 			    exception,
-			    0);
+			    0,
+                            etype);
             g_base_info_unref (interface);
             return ret;
 	  }
diff --git a/libseed/seed-types.h b/libseed/seed-types.h
index 227aad8..addf40c 100644
--- a/libseed/seed-types.h
+++ b/libseed/seed-types.h
@@ -47,11 +47,12 @@ JSValueRef seed_value_from_gi_argument (JSContextRef ctx,
 				        GITypeInfo * type_info,
 				        JSValueRef * exception);
 
-JSValueRef seed_value_from_gi_argument_with_length (JSContextRef ctx,
+JSValueRef seed_value_from_gi_argument_full (JSContextRef ctx,
 				        GArgument * arg,
 				        GITypeInfo * type_info,
 				        JSValueRef * exception,
-                                        gint array_len);
+                                        gint array_len,
+                                        GITypeTag gi_tag);
 gboolean seed_gi_release_arg (GITransfer transfer,
 			      GITypeInfo * type_info, GArgument * arg);
 



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