Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOJSCall.h
Go to the documentation of this file.
1/*
2
3OOJSCall.h
4
5Basic JavaScript-to-ObjC bridge implementation.
6
7Oolite
8Copyright (C) 2004-2013 Giles C Williams and contributors
9
10This program is free software; you can redistribute it and/or
11modify it under the terms of the GNU General Public License
12as published by the Free Software Foundation; either version 2
13of the License, or (at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23MA 02110-1301, USA.
24
25*/
26
27#ifndef NDEBUG
28
29
30#import <Foundation/Foundation.h>
31#include <jsapi.h>
32
33
34/* OOJSCallObjCObjectMethod()
35
36 Function for implementing JavaScript call() methods.
37
38 The argument list is expected to be either a single string (selector), or
39 a string ending with a : followed by arbitrary arguments which will be
40 concatenated as a string. (This behaviour reflects Oolite's traditional
41 scripting system and the expectations of its script methods. It also has
42 the advantage that it can be done with GNUstep's buggy implementation of
43 NSMethodSignature.)
44
45 If the method returns an object, *outResult will be set to that object's
46 -oo_jsValueInContext:. Otherwise, it will be left unchanged.
47
48 argv is assumed to contain at least one value.
49*/
50BOOL OOJSCallObjCObjectMethod(JSContext *context, id object, NSString *oo_jsClassName, uintN argc, jsval *argv, jsval *outResult);
51
52#endif
BOOL OOJSCallObjCObjectMethod(JSContext *context, id object, NSString *oo_jsClassName, uintN argc, jsval *argv, jsval *outResult)
Definition OOJSCall.m:71