Improve code generator scripts to support converting ScriptString.
[WebKit-https.git] / WebCore / bindings / scripts / test / GObject / WebKitDOMTestObj.cpp
index d0535c6..8c1bae2 100644 (file)
@@ -469,6 +469,16 @@ webkit_dom_test_obj_set_attr_with_getter_exception (WebKitDOMTestObj *self, glon
 
 }
 
+gchar* 
+webkit_dom_test_obj_get_script_string_attr (WebKitDOMTestObj *self)
+{
+    g_return_val_if_fail (self, 0);
+    WebCore::TestObj * item = WebKit::core(self);
+    gchar*  res = convertToUTF8String(item->scriptStringAttr());
+    return res;
+
+}
+
 
 G_DEFINE_TYPE(WebKitDOMTestObj, webkit_dom_test_obj, WEBKIT_TYPE_DOM_OBJECT)
 
@@ -517,6 +527,7 @@ enum {
     PROP_ATTR_WITH_SETTER_EXCEPTION,
     PROP_ATTR_WITH_GETTER_EXCEPTION,
     PROP_CUSTOM_ATTR,
+    PROP_SCRIPT_STRING_ATTR,
 };
 
 
@@ -571,11 +582,6 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con
          coreSelf->setAttrWithGetterException((g_value_get_long(value)) );
          break;
     }
-    case PROP_CUSTOM_ATTR:
-    {
-         coreSelf->setCustomAttr((g_value_get_long(value)) );
-         break;
-    }
      default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;
@@ -645,9 +651,9 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa
          g_value_set_long(value, coreSelf->attrWithGetterException());
          break;
     }
-    case PROP_CUSTOM_ATTR:
+    case PROP_SCRIPT_STRING_ATTR:
     {
-         g_value_set_long(value, coreSelf->customAttr());
+         g_value_take_string(value, convertToUTF8String(coreSelf->scriptStringAttr()));
          break;
     }
      default:
@@ -756,14 +762,12 @@ G_MAXLONG, /* max */
 0, /* default */
                                                            WEBKIT_PARAM_READWRITE));
      g_object_class_install_property(gobjectClass,
-                                    PROP_CUSTOM_ATTR,
-                                    g_param_spec_long("custom-attr", /* name */
-                                                           "test_obj_custom-attr", /* short description */
-                                                           "read-write  glong TestObj.custom-attr", /* longer - could do with some extra doc stuff here */
-                                                           G_MINLONG, /* min */
-G_MAXLONG, /* max */
-0, /* default */
-                                                           WEBKIT_PARAM_READWRITE));
+                                    PROP_SCRIPT_STRING_ATTR,
+                                    g_param_spec_string("script-string-attr", /* name */
+                                                           "test_obj_script-string-attr", /* short description */
+                                                           "read-only  gchar*  TestObj.script-string-attr", /* longer - could do with some extra doc stuff here */
+                                                           "", /* default */
+                                                           WEBKIT_PARAM_READABLE));