/
QCMonoPlugIn.h
94 lines (71 loc) · 2.39 KB
/
QCMonoPlugIn.h
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//
// QCMonoPlugIn.h
// QCMono
//
// Created by Caleb Cannon on 10/19/10.
// Copyright (c) 2010 Caleb Cannon. All rights reserved.
//
#import <Quartz/Quartz.h>
#include <mono/jit/jit.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/mono-config.h>
#include <mono/metadata/mono-debug.h>
#include <mono/utils/mono-logger.h>
extern void mono_mkbundle_init();
// Tags used for popup menu items / compiler names in the editor view
@interface QCMonoPlugIn : QCPlugIn
{
NSString *scriptSourceCode;
NSData *monoImageData;
MonoAssembly *monoAssembly;
MonoMethod *monoInvocationMethod;
MonoClass *monoScriptClass;
MonoObject *monoScriptObject;
MonoImage *monoImage;
MonoDomain *monoScriptDomain;
uint32_t monoObjectGCHandle;
NSTimer *compileTimer;
// The descriptions arrays are used to hold details about the ports
// created to hold the script input and output values. This allows
// us to track which ports should be modified after a recompile
// so we do not break connections unnecessarily
NSArray *inputPortDescriptions;
NSArray *outputPortDescriptions;
NSString *consoleText;
BOOL compiling;
BOOL compilerError;
BOOL compilerWarning;
BOOL compilerOK;
BOOL shouldCompile;
NSInteger selectedCompilerIndex;
}
@property (nonatomic, assign) NSInteger selectedCompilerIndex;
@property (nonatomic, readonly) NSArray *compilerNames;
@property (nonatomic, retain) NSString *consoleText;
@property (nonatomic, retain) NSString *scriptSourceCode;
@property (nonatomic, retain) NSData *monoImageData;
@property (nonatomic, retain) NSAttributedString *attributedScriptSourceCode;
// Flags used by the UI to indicate compiler status
@property (nonatomic, assign) BOOL compiling;
@property (nonatomic, assign) BOOL compilerError;
@property (nonatomic, assign) BOOL compilerWarning;
@property (nonatomic, assign) BOOL compilerOK;
// Private method declared here to prevent compiler warnings
- (id) patch;
- (NSDictionary *)compilerInfo;
- (NSArray *)compilerNames;
- (void) synchPorts;
- (void) synchInputPorts;
- (void) synchOutputPorts;
- (BOOL) loadMonoImageData;
- (void) cleanupMono;
- (BOOL) compileAndLoadMonoScript;
- (void) createInputPortsForScriptFields;
@end
// Declare some private QC methods in QCPatch to prevent compiler warnings
@interface NSObject (QCPatchPrivate)
- (id) patch;
- (void) setNeedsExecution;
- (NSArray *) customInputPorts;
- (NSArray *) customOutputPorts;
@end