initial import
[vuplus_webkit] / Source / WebCore / bindings / scripts / test / GObject / WebKitDOMTestMediaQueryListListener.cpp
1 /*
2     This file is part of the WebKit open source project.
3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Library General Public
7     License as published by the Free Software Foundation; either
8     version 2 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13     Library General Public License for more details.
14
15     You should have received a copy of the GNU Library General Public License
16     along with this library; see the file COPYING.LIB.  If not, write to
17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18     Boston, MA 02110-1301, USA.
19 */
20
21 #include <glib-object.h>
22 #include "config.h"
23
24 #include <wtf/GetPtr.h>
25 #include <wtf/RefPtr.h>
26 #include "DOMObjectCache.h"
27 #include "ExceptionCode.h"
28 #include "JSMainThreadExecState.h"
29 #include "TestMediaQueryListListener.h"
30 #include "WebKitDOMBinding.h"
31 #include "gobject/ConvertToUTF8String.h"
32 #include "webkit/WebKitDOMTestMediaQueryListListener.h"
33 #include "webkit/WebKitDOMTestMediaQueryListListenerPrivate.h"
34 #include "webkitdefines.h"
35 #include "webkitglobalsprivate.h"
36 #include "webkitmarshal.h"
37
38 namespace WebKit {
39     
40 WebKitDOMTestMediaQueryListListener* kit(WebCore::TestMediaQueryListListener* obj)
41 {
42     g_return_val_if_fail(obj, 0);
43
44     if (gpointer ret = DOMObjectCache::get(obj))
45         return static_cast<WebKitDOMTestMediaQueryListListener*>(ret);
46
47     return static_cast<WebKitDOMTestMediaQueryListListener*>(DOMObjectCache::put(obj, WebKit::wrapTestMediaQueryListListener(obj)));
48 }
49     
50 } // namespace WebKit //
51
52
53 G_DEFINE_TYPE(WebKitDOMTestMediaQueryListListener, webkit_dom_test_media_query_list_listener, WEBKIT_TYPE_DOM_OBJECT)
54
55 namespace WebKit {
56
57 WebCore::TestMediaQueryListListener* core(WebKitDOMTestMediaQueryListListener* request)
58 {
59     g_return_val_if_fail(request, 0);
60
61     WebCore::TestMediaQueryListListener* coreObject = static_cast<WebCore::TestMediaQueryListListener*>(WEBKIT_DOM_OBJECT(request)->coreObject);
62     g_return_val_if_fail(coreObject, 0);
63
64     return coreObject;
65 }
66
67 } // namespace WebKit
68 enum {
69     PROP_0,
70 };
71
72
73 static void webkit_dom_test_media_query_list_listener_finalize(GObject* object)
74 {
75     WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
76     
77     if (dom_object->coreObject) {
78         WebCore::TestMediaQueryListListener* coreObject = static_cast<WebCore::TestMediaQueryListListener *>(dom_object->coreObject);
79
80         WebKit::DOMObjectCache::forget(coreObject);
81         coreObject->deref();
82
83         dom_object->coreObject = NULL;
84     }
85
86     G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->finalize(object);
87 }
88
89 static void webkit_dom_test_media_query_list_listener_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
90 {
91     WebCore::JSMainThreadNullState state;
92     switch (prop_id) {
93     default:
94         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
95         break;
96     }
97 }
98
99
100 static void webkit_dom_test_media_query_list_listener_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
101 {
102     WebCore::JSMainThreadNullState state;
103     switch (prop_id) {
104     default:
105         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
106         break;
107     }
108 }
109
110
111 static void webkit_dom_test_media_query_list_listener_constructed(GObject* object)
112 {
113
114     if (G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->constructed)
115         G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->constructed(object);
116 }
117
118 static void webkit_dom_test_media_query_list_listener_class_init(WebKitDOMTestMediaQueryListListenerClass* requestClass)
119 {
120     GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
121     gobjectClass->finalize = webkit_dom_test_media_query_list_listener_finalize;
122     gobjectClass->set_property = webkit_dom_test_media_query_list_listener_set_property;
123     gobjectClass->get_property = webkit_dom_test_media_query_list_listener_get_property;
124     gobjectClass->constructed = webkit_dom_test_media_query_list_listener_constructed;
125
126
127
128 }
129
130 static void webkit_dom_test_media_query_list_listener_init(WebKitDOMTestMediaQueryListListener* request)
131 {
132 }
133
134 namespace WebKit {
135 WebKitDOMTestMediaQueryListListener* wrapTestMediaQueryListListener(WebCore::TestMediaQueryListListener* coreObject)
136 {
137     g_return_val_if_fail(coreObject, 0);
138
139     /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
140      * in a C-allocated GObject structure.  See the finalize() code for the
141      * matching deref().
142      */
143     coreObject->ref();
144
145     return  WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER(g_object_new(WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER,
146                                                "core-object", coreObject, NULL));
147 }
148 } // namespace WebKit