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