[GTK] Cleanup WebKitDOMObject
[WebKit-https.git] / Source / WebCore / bindings / gobject / WebKitDOMObject.cpp
1 /*
2  * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
3  * Copyright (C) 2008 Martin Soto <soto@freedesktop.org>
4  * Copyright (C) 2008 Alp Toker <alp@atoker.com>
5  * Copyright (C) 2008 Apple Inc.
6  * Copyright (C) 2009 Igalia S.L.
7  */
8 #include "config.h"
9 #include "WebKitDOMObject.h"
10
11 enum {
12     PROP_0,
13     PROP_CORE_OBJECT
14 };
15
16 G_DEFINE_TYPE(WebKitDOMObject, webkit_dom_object, G_TYPE_OBJECT)
17
18 static void webkit_dom_object_init(WebKitDOMObject*)
19 {
20 }
21
22 static void webkitDOMObjectSetProperty(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec)
23 {
24     switch (propertyId) {
25     case PROP_CORE_OBJECT:
26         WEBKIT_DOM_OBJECT(object)->coreObject = g_value_get_pointer(value);
27         break;
28     default:
29         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
30         break;
31     }
32 }
33
34 static void webkit_dom_object_class_init(WebKitDOMObjectClass* klass)
35 {
36     GObjectClass* gobjectClass = G_OBJECT_CLASS(klass);
37     gobjectClass->set_property = webkitDOMObjectSetProperty;
38
39     g_object_class_install_property(
40         gobjectClass,
41         PROP_CORE_OBJECT,
42         g_param_spec_pointer(
43             "core-object",
44             "Core Object",
45             "The WebCore object the WebKitDOMObject wraps",
46             static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)));
47 }