Improve code generator scripts to support converting ScriptString.
[WebKit-https.git] / WebCore / bindings / scripts / test / GObject / WebKitDOMTestObj.cpp
index 632283f..8c1bae2 100644 (file)
@@ -31,8 +31,6 @@
 #include "webkit/WebKitDOMSerializedScriptValuePrivate.h"
 #include "webkit/WebKitDOMTestObj.h"
 #include "webkit/WebKitDOMTestObjPrivate.h"
-#include "webkit/WebKitDOMlog.h"
-#include "webkit/WebKitDOMlogPrivate.h"
 #include "webkitmarshal.h"
 #include "webkitprivate.h"
 
@@ -153,9 +151,6 @@ webkit_dom_test_obj_method_with_exception (WebKitDOMTestObj *self, GError **erro
 }
 
 
-/* TODO: custom function webkit_dom_test_obj_custom_args_and_exception */
-
-
 /* TODO: event function webkit_dom_test_obj_add_event_listener */
 
 
@@ -474,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)
 
@@ -522,6 +527,7 @@ enum {
     PROP_ATTR_WITH_SETTER_EXCEPTION,
     PROP_ATTR_WITH_GETTER_EXCEPTION,
     PROP_CUSTOM_ATTR,
+    PROP_SCRIPT_STRING_ATTR,
 };
 
 
@@ -543,10 +549,9 @@ static void webkit_dom_test_obj_finalize(GObject* object)
 
 static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
 {
-    WebKitDOMTestObj *self = WEBKIT_DOM_TEST_OBJ(object);
+     WebKitDOMTestObj *self = WEBKIT_DOM_TEST_OBJ(object);
     WebCore::TestObj* coreSelf = WebKit::core(self);
-
-    switch (prop_id) {
+     switch (prop_id) {
     case PROP_INT_ATTR:
     {
          coreSelf->setIntAttr((g_value_get_long(value)) );
@@ -577,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;
@@ -591,10 +591,9 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con
 
 static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
 {
-    WebKitDOMTestObj* self = WEBKIT_DOM_TEST_OBJ(object);
+     WebKitDOMTestObj* self = WEBKIT_DOM_TEST_OBJ(object);
     WebCore::TestObj* coreSelf = WebKit::core(self);
-
-    switch (prop_id) {
+     switch (prop_id) {
     case PROP_READ_ONLY_INT_ATTR:
     {
          g_value_set_long(value, coreSelf->readOnlyIntAttr());
@@ -652,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:
@@ -763,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));