This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathInterface.h
More file actions
79 lines (61 loc) · 2.79 KB
/
Copy pathInterface.h
File metadata and controls
79 lines (61 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* Copyright (C) 2003-2015 LiveCode Ltd.
This file is part of LiveCode.
LiveCode is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License v3 as published by the Free
Software Foundation.
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
#ifndef __INTERFACE__
#define __INTERFACE__
#ifndef __VALUE__
#include "Value.h"
#endif
#ifndef __POSITION__
#include "Position.h"
#endif
typedef struct Interface *InterfaceRef;
// MW-2013-06-14: [[ ExternalsApiV5 ]] HandlerType and attributes (tail / java)
// now separate.
enum HandlerType
{
kHandlerTypeCommand,
kHandlerTypeFunction,
kHandlerTypeMethod,
};
// MW-2013-06-14: [[ ExternalsApiV5 ]] New type describing attributes of handlers.
typedef uint32_t HandlerAttributes;
enum
{
kHandlerAttributeIsJava = 1 << 0,
kHandlerAttributeIsTail = 1 << 1,
};
enum ParameterType
{
kParameterTypeIn,
kParameterTypeOut,
kParameterTypeInOut,
kParameterTypeRef,
};
bool InterfaceCreate(InterfaceRef& interface);
void InterfaceDestroy(InterfaceRef interface);
bool InterfaceBegin(InterfaceRef interface, Position where, NameRef name);
bool InterfaceDefineUse(InterfaceRef interface, Position where, NameRef use);
bool InterfaceDefineUseOnPlatform(InterfaceRef interface, Position where, NameRef type, NameRef platform);
bool InterfaceDefineHook(InterfaceRef interface, Position where, NameRef handler, NameRef target);
bool InterfaceBeginEnum(InterfaceRef interface, Position where, NameRef name);
bool InterfaceDefineEnumElement(InterfaceRef interface, Position where, StringRef element, ValueRef value);
bool InterfaceEndEnum(InterfaceRef interface);
// MW-2013-06-14: [[ ExternalsApiV5 ]] Added 'attrs' parameter to specify handler attributes.
bool InterfaceBeginHandler(InterfaceRef interface, Position where, HandlerType type, HandlerAttributes attrs, NameRef name);
// MERG-2013-06-14: [[ ExternalsApiV5 ]] New 'optional' parameter to specify parameter that is not-required nor defaulted.
bool InterfaceDefineHandlerParameter(InterfaceRef interface, Position where, ParameterType param_type, NameRef name, NameRef type, bool p_optional, ValueRef default_value);
bool InterfaceDefineHandlerReturn(InterfaceRef interface, Position where, NameRef type, bool indirect);
bool InterfaceDefineHandlerBinding(InterfaceRef interface, Position where, NameRef name);
bool InterfaceEndHandler(InterfaceRef interface);
bool InterfaceEnd(InterfaceRef interface);
bool InterfaceGenerate(InterfaceRef interface, const char *filename);
#endif