2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include "NGJavaScriptCallable.h"
26 @implementation NGJavaScriptCallable
28 static void _finalize(JSContext *cx, JSObject *obj);
30 JSClass NGJavaScriptCallable_JSClass = {
31 "NGJavaScriptCallable",
32 JSCLASS_HAS_PRIVATE /* flags */,
41 /* Optionally non-null members start here. */
42 NULL, //JSGetObjectOps getObjectOps;
43 NULL, //JSCheckAccessOp checkAccess;
44 NULL, //JSNative call;
45 NULL, //JSNative construct;
46 NULL, //JSXDRObjectOp xdrObject;
47 NULL, //JSHasInstanceOp hasInstance;
51 + (void *)jsObjectClass {
52 return &NGJavaScriptCallable_JSClass;
55 static void _finalize(JSContext *cx, JSObject *obj) {
56 NGJavaScriptCallable *self;
58 if ((self = JS_GetPrivate(cx, obj)) == nil) {
59 JS_FinalizeStub(cx, obj);
61 else if (self->handle == obj) {
65 fprintf(stderr, "%s: aborting ..\n", __PRETTY_FUNCTION__);
68 fprintf(stderr, "%s: invalid finalize ..\n", __PRETTY_FUNCTION__);
73 @end /* NGJavaScriptCallable */