Oolite
Loading...
Searching...
No Matches
OOJSGuiScreenKeyDefinition.h
Go to the documentation of this file.
1/*
2
3OOJSGuiScreenKeyDefinition.h (QuickJS-ng)
4
5
6Oolite
7Copyright (C) 2004-2013 Giles C Williams and contributors
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22MA 02110-1301, USA.
23
24*/
25
26#import "OOJSScript.h"
27#include <quickjs.h>
28
29/* The definition owns references to its callback and callbackThis, which are
30 released on dealloc and when the JavaScript engine is reset.
31*/
33@private
34 JSValue _callback; // Owned.
35 JSValue _callbackThis; // Owned.
37
38 NSString* _name;
39 NSDictionary* _registerKeys;
40}
41
42- (NSString*)name;
43- (void)setName:(NSString*)name;
44- (NSDictionary*)registerKeys;
45- (void)setRegisterKeys:(NSDictionary*)registerKeys;
46// Returned values are owned by the caller.
47- (JSValue)callback;
48- (void)setCallback:(JSValueConst)callback;
49- (JSValue)callbackThis;
50- (void)setCallbackThis:(JSValueConst)callbackthis;
51
52- (void)runCallback:(NSString*)key;
53
54- (NSComparisonResult)interfaceCompare:(OOJSGuiScreenKeyDefinition*)other;
55
56@end