332bdb7e944988d7431a930a3a63968a266205c3
[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 webkit_dom_object_get_property(GObject* object, guint propertyId, GValue*, GParamSpec* paramSpec)
23 {
24     G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, paramSpec);
25 }
26
27 static void webkit_dom_object_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
28 {
29     switch (prop_id) {
30     case PROP_CORE_OBJECT:
31         WEBKIT_DOM_OBJECT(object)->coreObject = g_value_get_pointer(value);
32         break;
33     default:
34         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
35         break;
36     }
37 }
38
39 static void webkit_dom_object_class_init(WebKitDOMObjectClass* klass)
40 {
41     GObjectClass* gobjectClass = G_OBJECT_CLASS(klass);
42     gobjectClass->set_property = webkit_dom_object_set_property;
43     gobjectClass->get_property = webkit_dom_object_get_property;
44
45     g_object_class_install_property(gobjectClass,
46                                     PROP_CORE_OBJECT,
47                                     g_param_spec_pointer("core-object",
48                                                          "Core Object",
49                                                          "The WebCore object the WebKitDOMObject wraps",
50                                                          static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
51 }
52