source: webkit/trunk/JavaScriptCore/API/JSClassRef.h@ 34947

Last change on this file since 34947 was 34599, checked in by [email protected], 17 years ago

JavaScriptCore headers use C++ style comments

https://bugs.webkit.org/show_bug.cgi?id=19552

Replace all C++ style comments with C style multiline
comments and remove all "mode" lines.

Reviewed by Sam.

  • Property svn:eol-style set to native
File size: 3.6 KB
Line 
1/*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef JSClassRef_h
27#define JSClassRef_h
28
29#include "JSObjectRef.h"
30
31#include <kjs/JSObject.h>
32#include <kjs/protect.h>
33#include <kjs/ustring.h>
34#include <wtf/HashMap.h>
35#include <wtf/RefCounted.h>
36
37struct StaticValueEntry {
38 StaticValueEntry(JSObjectGetPropertyCallback _getProperty, JSObjectSetPropertyCallback _setProperty, JSPropertyAttributes _attributes)
39 : getProperty(_getProperty), setProperty(_setProperty), attributes(_attributes)
40 {
41 }
42
43 JSObjectGetPropertyCallback getProperty;
44 JSObjectSetPropertyCallback setProperty;
45 JSPropertyAttributes attributes;
46};
47
48struct StaticFunctionEntry {
49 StaticFunctionEntry(JSObjectCallAsFunctionCallback _callAsFunction, JSPropertyAttributes _attributes)
50 : callAsFunction(_callAsFunction), attributes(_attributes)
51 {
52 }
53
54 JSObjectCallAsFunctionCallback callAsFunction;
55 JSPropertyAttributes attributes;
56};
57
58struct OpaqueJSClass : public RefCounted<OpaqueJSClass> {
59 static PassRefPtr<OpaqueJSClass> create(const JSClassDefinition*);
60 static PassRefPtr<OpaqueJSClass> createNoAutomaticPrototype(const JSClassDefinition*);
61 ~OpaqueJSClass();
62
63 KJS::JSObject* prototype(JSContextRef ctx);
64
65 typedef HashMap<RefPtr<KJS::UString::Rep>, StaticValueEntry*> StaticValuesTable;
66 typedef HashMap<RefPtr<KJS::UString::Rep>, StaticFunctionEntry*> StaticFunctionsTable;
67
68 KJS::UString className;
69 OpaqueJSClass* parentClass;
70 OpaqueJSClass* prototypeClass;
71
72 StaticValuesTable* staticValues;
73 StaticFunctionsTable* staticFunctions;
74
75 JSObjectInitializeCallback initialize;
76 JSObjectFinalizeCallback finalize;
77 JSObjectHasPropertyCallback hasProperty;
78 JSObjectGetPropertyCallback getProperty;
79 JSObjectSetPropertyCallback setProperty;
80 JSObjectDeletePropertyCallback deleteProperty;
81 JSObjectGetPropertyNamesCallback getPropertyNames;
82 JSObjectCallAsFunctionCallback callAsFunction;
83 JSObjectCallAsConstructorCallback callAsConstructor;
84 JSObjectHasInstanceCallback hasInstance;
85 JSObjectConvertToTypeCallback convertToType;
86
87private:
88 OpaqueJSClass();
89 OpaqueJSClass(const OpaqueJSClass&);
90 OpaqueJSClass(const JSClassDefinition*, OpaqueJSClass* protoClass);
91
92 friend void clearReferenceToPrototype(JSObjectRef prototype);
93 KJS::JSObject* cachedPrototype;
94};
95
96#endif // JSClassRef_h
Note: See TracBrowser for help on using the repository browser.