WebCore/generated/JSScreen.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     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 "config.h"
       
    22 #include "JSScreen.h"
       
    23 
       
    24 #include "Screen.h"
       
    25 #include <runtime/JSNumberCell.h>
       
    26 #include <wtf/GetPtr.h>
       
    27 
       
    28 using namespace JSC;
       
    29 
       
    30 namespace WebCore {
       
    31 
       
    32 ASSERT_CLASS_FITS_IN_CELL(JSScreen);
       
    33 
       
    34 /* Hash table */
       
    35 #if ENABLE(JIT)
       
    36 #define THUNK_GENERATOR(generator) , generator
       
    37 #else
       
    38 #define THUNK_GENERATOR(generator)
       
    39 #endif
       
    40 
       
    41 static const HashTableValue JSScreenTableValues[9] =
       
    42 {
       
    43     { "height", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenHeight), (intptr_t)0 THUNK_GENERATOR(0) },
       
    44     { "width", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenWidth), (intptr_t)0 THUNK_GENERATOR(0) },
       
    45     { "colorDepth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenColorDepth), (intptr_t)0 THUNK_GENERATOR(0) },
       
    46     { "pixelDepth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenPixelDepth), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { "availLeft", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenAvailLeft), (intptr_t)0 THUNK_GENERATOR(0) },
       
    48     { "availTop", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenAvailTop), (intptr_t)0 THUNK_GENERATOR(0) },
       
    49     { "availHeight", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenAvailHeight), (intptr_t)0 THUNK_GENERATOR(0) },
       
    50     { "availWidth", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsScreenAvailWidth), (intptr_t)0 THUNK_GENERATOR(0) },
       
    51     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    52 };
       
    53 
       
    54 #undef THUNK_GENERATOR
       
    55 static JSC_CONST_HASHTABLE HashTable JSScreenTable = { 18, 15, JSScreenTableValues, 0 };
       
    56 /* Hash table for prototype */
       
    57 #if ENABLE(JIT)
       
    58 #define THUNK_GENERATOR(generator) , generator
       
    59 #else
       
    60 #define THUNK_GENERATOR(generator)
       
    61 #endif
       
    62 
       
    63 static const HashTableValue JSScreenPrototypeTableValues[1] =
       
    64 {
       
    65     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    66 };
       
    67 
       
    68 #undef THUNK_GENERATOR
       
    69 static JSC_CONST_HASHTABLE HashTable JSScreenPrototypeTable = { 1, 0, JSScreenPrototypeTableValues, 0 };
       
    70 const ClassInfo JSScreenPrototype::s_info = { "ScreenPrototype", 0, &JSScreenPrototypeTable, 0 };
       
    71 
       
    72 JSObject* JSScreenPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
    73 {
       
    74     return getDOMPrototype<JSScreen>(exec, globalObject);
       
    75 }
       
    76 
       
    77 const ClassInfo JSScreen::s_info = { "Screen", 0, &JSScreenTable, 0 };
       
    78 
       
    79 JSScreen::JSScreen(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<Screen> impl)
       
    80     : DOMObjectWithGlobalPointer(structure, globalObject)
       
    81     , m_impl(impl)
       
    82 {
       
    83 }
       
    84 
       
    85 JSScreen::~JSScreen()
       
    86 {
       
    87     forgetDOMObject(this, impl());
       
    88 }
       
    89 
       
    90 JSObject* JSScreen::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
    91 {
       
    92     return new (exec) JSScreenPrototype(globalObject, JSScreenPrototype::createStructure(globalObject->objectPrototype()));
       
    93 }
       
    94 
       
    95 bool JSScreen::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    96 {
       
    97     return getStaticValueSlot<JSScreen, Base>(exec, &JSScreenTable, this, propertyName, slot);
       
    98 }
       
    99 
       
   100 bool JSScreen::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   101 {
       
   102     return getStaticValueDescriptor<JSScreen, Base>(exec, &JSScreenTable, this, propertyName, descriptor);
       
   103 }
       
   104 
       
   105 JSValue jsScreenHeight(ExecState* exec, JSValue slotBase, const Identifier&)
       
   106 {
       
   107     JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
       
   108     UNUSED_PARAM(exec);
       
   109     Screen* imp = static_cast<Screen*>(castedThis->impl());
       
   110     JSValue result = jsNumber(exec, imp->height());
       
   111     return result;
       
   112 }
       
   113 
       
   114 JSValue jsScreenWidth(ExecState* exec, JSValue slotBase, const Identifier&)
       
   115 {
       
   116     JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
       
   117     UNUSED_PARAM(exec);
       
   118     Screen* imp = static_cast<Screen*>(castedThis->impl());
       
   119     JSValue result = jsNumber(exec, imp->width());
       
   120     return result;
       
   121 }
       
   122 
       
   123 JSValue jsScreenColorDepth(ExecState* exec, JSValue slotBase, const Identifier&)
       
   124 {
       
   125     JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
       
   126     UNUSED_PARAM(exec);
       
   127     Screen* imp = static_cast<Screen*>(castedThis->impl());
       
   128     JSValue result = jsNumber(exec, imp->colorDepth());
       
   129     return result;
       
   130 }
       
   131 
       
   132 JSValue jsScreenPixelDepth(ExecState* exec, JSValue slotBase, const Identifier&)
       
   133 {
       
   134     JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
       
   135     UNUSED_PARAM(exec);
       
   136     Screen* imp = static_cast<Screen*>(castedThis->impl());
       
   137     JSValue result = jsNumber(exec, imp->pixelDepth());
       
   138     return result;
       
   139 }
       
   140 
       
   141 JSValue jsScreenAvailLeft(ExecState* exec, JSValue slotBase, const Identifier&)
       
   142 {
       
   143     JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
       
   144     UNUSED_PARAM(exec);
       
   145     Screen* imp = static_cast<Screen*>(castedThis->impl());
       
   146     JSValue result = jsNumber(exec, imp->availLeft());
       
   147     return result;
       
   148 }
       
   149 
       
   150 JSValue jsScreenAvailTop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   151 {
       
   152     JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
       
   153     UNUSED_PARAM(exec);
       
   154     Screen* imp = static_cast<Screen*>(castedThis->impl());
       
   155     JSValue result = jsNumber(exec, imp->availTop());
       
   156     return result;
       
   157 }
       
   158 
       
   159 JSValue jsScreenAvailHeight(ExecState* exec, JSValue slotBase, const Identifier&)
       
   160 {
       
   161     JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
       
   162     UNUSED_PARAM(exec);
       
   163     Screen* imp = static_cast<Screen*>(castedThis->impl());
       
   164     JSValue result = jsNumber(exec, imp->availHeight());
       
   165     return result;
       
   166 }
       
   167 
       
   168 JSValue jsScreenAvailWidth(ExecState* exec, JSValue slotBase, const Identifier&)
       
   169 {
       
   170     JSScreen* castedThis = static_cast<JSScreen*>(asObject(slotBase));
       
   171     UNUSED_PARAM(exec);
       
   172     Screen* imp = static_cast<Screen*>(castedThis->impl());
       
   173     JSValue result = jsNumber(exec, imp->availWidth());
       
   174     return result;
       
   175 }
       
   176 
       
   177 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Screen* object)
       
   178 {
       
   179     return getDOMObjectWrapper<JSScreen>(exec, globalObject, object);
       
   180 }
       
   181 Screen* toScreen(JSC::JSValue value)
       
   182 {
       
   183     return value.inherits(&JSScreen::s_info) ? static_cast<JSScreen*>(asObject(value))->impl() : 0;
       
   184 }
       
   185 
       
   186 }