|
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 #include "glib-object.h" |
|
12 #include "WebKitDOMBinding.h" |
|
13 |
|
14 enum { |
|
15 PROP_0, |
|
16 PROP_CORE_OBJECT |
|
17 }; |
|
18 |
|
19 G_DEFINE_TYPE(WebKitDOMObject, webkit_dom_object, G_TYPE_OBJECT); |
|
20 |
|
21 static void webkit_dom_object_init(WebKitDOMObject* object) |
|
22 { |
|
23 } |
|
24 |
|
25 static void webkit_dom_object_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) |
|
26 { |
|
27 switch (prop_id) { |
|
28 default: |
|
29 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); |
|
30 break; |
|
31 } |
|
32 } |
|
33 |
|
34 static void webkit_dom_object_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) |
|
35 { |
|
36 switch (prop_id) { |
|
37 case PROP_CORE_OBJECT: |
|
38 WEBKIT_DOM_OBJECT(object)->coreObject = g_value_get_pointer(value); |
|
39 break; |
|
40 default: |
|
41 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); |
|
42 break; |
|
43 } |
|
44 } |
|
45 |
|
46 static void webkit_dom_object_class_init(WebKitDOMObjectClass* klass) |
|
47 { |
|
48 GObjectClass* gobjectClass = G_OBJECT_CLASS(klass); |
|
49 gobjectClass->set_property = webkit_dom_object_set_property; |
|
50 gobjectClass->get_property = webkit_dom_object_get_property; |
|
51 |
|
52 g_object_class_install_property(gobjectClass, |
|
53 PROP_CORE_OBJECT, |
|
54 g_param_spec_pointer("core-object", |
|
55 "Core Object", |
|
56 "The WebCore object the WebKitDOMObject wraps", |
|
57 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY))); |
|
58 } |
|
59 |