tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebKitDOM_MediaQueryList.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     Copyright (C) 2011 Samsung Electronics
6
7     This library is free software; you can redistribute it and/or
8     modify it under the terms of the GNU Lesser General Public
9     License as published by the Free Software Foundation; either
10     version 2.1 of the License, or (at your option) any later version.
11
12     This library is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15     Lesser General Public License for more details.
16
17     You should have received a copy of the GNU Lesser General Public
18     License along with this library; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20 */
21
22 #include "config.h"
23 #include "WebKitDOM_MediaQueryList.h"
24 #include "WebKitDOM_MediaQueryList_Private.h"
25
26 #include "KURL.h"
27 #include "MediaQueryList.h"
28 #include "MediaQueryListListener.h"
29 #include "WebKitDOM_MediaQueryListListener.h"
30 #include "WebKitDOM_MediaQueryListListener_Private.h"
31 #include "WebKitDOM_String.h"
32 #include "WebKitDOM_String_Private.h"
33 #include "wtf/text/AtomicString.h"
34 #include <wtf/text/CString.h>
35 #include <wtf/GetPtr.h>
36 #include <wtf/RefPtr.h>
37
38 void ewk_webkitdom_mediaquerylist_get_media(WebKitDOM_MediaQueryList* self, WebKitDOM_String* ret)
39 {
40     if (!self)
41         return;
42
43     WebCore::MediaQueryList* coreObj = _to_webcore_mediaquerylist(self);
44     WTF::String result = coreObj->media();
45     _to_webkit_string(&result, ret);
46 }
47
48 Eina_Bool ewk_webkitdom_mediaquerylist_get_matches(WebKitDOM_MediaQueryList* self)
49 {
50     if (!self)
51         return EINA_FALSE;
52
53     WebCore::MediaQueryList* coreObj = _to_webcore_mediaquerylist(self);
54     return coreObj->matches();
55 }
56
57 void ewk_webkitdom_mediaquerylist_add_listener(WebKitDOM_MediaQueryList* self, WebKitDOM_MediaQueryListListener* listener)
58 {
59     if (!self)
60         return;
61
62     WebCore::MediaQueryList* coreObj = _to_webcore_mediaquerylist(self);
63     coreObj->addListener(_to_webcore_mediaquerylistlistener(listener));
64 }
65
66 void ewk_webkitdom_mediaquerylist_remove_listener(WebKitDOM_MediaQueryList* self, WebKitDOM_MediaQueryListListener* listener)
67 {
68     if (!self)
69         return;
70
71     WebCore::MediaQueryList* coreObj = _to_webcore_mediaquerylist(self);
72     coreObj->removeListener(_to_webcore_mediaquerylistlistener(listener));
73 }
74
75
76 void ewk_webkitdom_mediaquerylist_deinit(const WebKitDOM_Object* objPtr)
77 {
78     if( WEBKITDOM_ISNULL(objPtr) )
79        return;
80     ((WebCore::MediaQueryList*)(objPtr->p_coreObject))->deref();
81     (((WebKitDOM_Object*)(objPtr))->p_coreObject) = 0;
82 }
83
84 void _copy_webkit_mediaquerylist(WebKitDOM_MediaQueryList* kitObjSrc, WebKitDOM_MediaQueryList* ret)
85 {
86     if (WEBKITDOM_COREOBJ(kitObjSrc) == WEBKITDOM_COREOBJ(ret))
87         return;
88     WebCore::MediaQueryList* tmpPtr = _to_webcore_mediaquerylist(ret);
89     if (tmpPtr)
90         tmpPtr->deref();
91     if (!WEBKITDOM_ISNULL(kitObjSrc))
92         _to_webcore_mediaquerylist(kitObjSrc)->ref();
93     ((WebKitDOM_Object*)ret)->p_coreObject = WEBKITDOM_COREOBJ(kitObjSrc);
94 }
95
96 WebCore::MediaQueryList* _to_webcore_mediaquerylist(const WebKitDOM_MediaQueryList* kitObj)
97 {
98     return (WebCore::MediaQueryList*)WEBKITDOM_COREOBJ(kitObj);
99 }
100
101 WebKitDOM_MediaQueryList* _to_webkit_mediaquerylist(WebCore::MediaQueryList* coreObj, WebKitDOM_MediaQueryList* ret)
102 {
103     WebCore::MediaQueryList* tmpPtr = _to_webcore_mediaquerylist(ret);
104     if (tmpPtr && tmpPtr != coreObj)
105         tmpPtr->deref();
106     if (coreObj)
107         coreObj->ref();
108     ((WebKitDOM_Object*)ret)->p_coreObject = coreObj;
109     return ret;
110 }
111