arcadia 0.1.2.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +9 -9
- data/arcadia.rb +770 -770
- data/base/a-contracts-work.rb +219 -0
- data/base/a-contracts.rb +322 -307
- data/base/a-utils.rb +993 -993
- data/conf/arcadia.conf +203 -203
- data/conf/arcadia.res.rb +1325 -1285
- data/ext/ae-complete-code/ae-complete-code.rb +80 -80
- data/ext/ae-doc-code/ae-doc-code.rb +288 -289
- data/ext/ae-editor/ae-editor.conf +105 -101
- data/ext/ae-editor/ae-editor.rb +2287 -2229
- data/ext/ae-event-log/ae-event-log.conf +5 -5
- data/ext/ae-file-history/ae-file-history.rb +2 -2
- data/ext/ae-flag/ae-flag.conf +6 -0
- data/ext/ae-flag/ae-flag.rb +12 -0
- data/ext/ae-inspector/ae-inspector.conf +7 -7
- data/ext/ae-output-event/ae-output-event.conf +15 -15
- data/ext/ae-palette/ae-palette.conf +7 -7
- data/ext/ae-ruby-debug/ae-ruby-debug.conf +20 -0
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +1329 -0
- data/ext/ae-shell/ae-shell.conf +11 -11
- data/ext/ae-shell/ae-shell.rb +50 -51
- metadata +28 -5
- data/ext/ae-shell/ae-shell.rb~~ +0 -49
@@ -0,0 +1,219 @@
|
|
1
|
+
#the caller must call the action then the contract must exec
|
2
|
+
#the time sequence before, do, after
|
3
|
+
#
|
4
|
+
#es.
|
5
|
+
#
|
6
|
+
#def event(_event)
|
7
|
+
# do_before_event(_event)
|
8
|
+
# do_event(_event)
|
9
|
+
# do_after_event(_event)
|
10
|
+
#end
|
11
|
+
|
12
|
+
# event composition
|
13
|
+
#
|
14
|
+
# [_<TIME>]_<VERBO>_<TARGET>_
|
15
|
+
#
|
16
|
+
# es. _BEFORE_OPEN_FILE_
|
17
|
+
# _OPEN_FILE_
|
18
|
+
# _AFTER_OPEN_FILE_
|
19
|
+
#
|
20
|
+
#
|
21
|
+
#
|
22
|
+
# class Contract
|
23
|
+
# def raise_event(_event_signature, _tobj, *args)
|
24
|
+
# _event = _raise_event(_event_forge(_BEFORE+_event_signature, _tobj),*args)
|
25
|
+
# if _event.continue_query
|
26
|
+
# _event = _raise_event(_event_forge(_event_signature, _tobj),*args)
|
27
|
+
# if _event...
|
28
|
+
# _raise_event(_event_forge(_AFTER+_event_signature, _tobj),*args)
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# sequence
|
34
|
+
# _BEFORE='BEFORE'
|
35
|
+
# _AFTER='AFTER'
|
36
|
+
#
|
37
|
+
# verbos
|
38
|
+
# _OPEN='OPEN'
|
39
|
+
# _CLOSE='CLOSE'
|
40
|
+
# _SAVE='SAVE'
|
41
|
+
# _SAVEAS='SAVEAS'
|
42
|
+
# _SHOW='SHOW'
|
43
|
+
# _BUILD='BUILD'
|
44
|
+
# _SET='SET'
|
45
|
+
# _UNSET='UNSET'
|
46
|
+
# _GET='GET'
|
47
|
+
# _COMPLETE='COMPLETE'
|
48
|
+
# _DOCUMENT='DOCUMENT'
|
49
|
+
# _START='START'
|
50
|
+
# _STOP='STOP'
|
51
|
+
# _CREATE='CREATE'
|
52
|
+
# _DESTROY='DESTROY'
|
53
|
+
#
|
54
|
+
# target
|
55
|
+
# _FILE_='FILE'
|
56
|
+
# verbos=[OPEN,CLOSE,SAVE,SAVEAS]
|
57
|
+
# detail=[filename,line]
|
58
|
+
# _EXTENSION_='EXTENSION'
|
59
|
+
# _BREAKPOINT_='BREAKPOINT'
|
60
|
+
# _DIALOG_='DIALOG'
|
61
|
+
# _BUFFER_='BUFFER'
|
62
|
+
# _CODE_='CODE'
|
63
|
+
# _DEBUGGER_='DEBUGGER'
|
64
|
+
#
|
65
|
+
#
|
66
|
+
# event
|
67
|
+
# _OPEN_FILE_ = _OPEN<<_FILE_
|
68
|
+
# CLOSE+FILE
|
69
|
+
#
|
70
|
+
# transfert_detail
|
71
|
+
# _FILE_
|
72
|
+
# filename
|
73
|
+
# line
|
74
|
+
# _EXTENSION_
|
75
|
+
# name
|
76
|
+
# _BREAKPOINT_
|
77
|
+
# filename
|
78
|
+
# line
|
79
|
+
# _DIALOG_
|
80
|
+
# type=[search,generic]
|
81
|
+
# _BUFFER_
|
82
|
+
# title
|
83
|
+
# _CODE_
|
84
|
+
# filename
|
85
|
+
# row
|
86
|
+
# column
|
87
|
+
#
|
88
|
+
#
|
89
|
+
# EXTENSION
|
90
|
+
# name
|
91
|
+
#
|
92
|
+
# FileContract
|
93
|
+
#
|
94
|
+
# ExtensionContract
|
95
|
+
#
|
96
|
+
#
|
97
|
+
# ##### raise_event(_OPEN_FILE_, file=>_file)
|
98
|
+
# ##### or raise_event(_OPEN, _FILE_, file=>_file)
|
99
|
+
# ##### or open_file(file=>_file)
|
100
|
+
|
101
|
+
module Sequence
|
102
|
+
BEFORE='BEFORE'
|
103
|
+
AFTER='AFTER'
|
104
|
+
end
|
105
|
+
|
106
|
+
module Action
|
107
|
+
OPEN='OPEN'
|
108
|
+
CLOSE='CLOSE'
|
109
|
+
SAVE='SAVE'
|
110
|
+
SAVEAS='SAVEAS'
|
111
|
+
SHOW='SHOW'
|
112
|
+
BUILD='BUILD'
|
113
|
+
SET='SET'
|
114
|
+
UNSET='UNSET'
|
115
|
+
GET='GET'
|
116
|
+
COMPLETE='COMPLETE'
|
117
|
+
DOCUMENT='DOCUMENT'
|
118
|
+
START='START'
|
119
|
+
STOP='STOP'
|
120
|
+
CREATE='CREATE'
|
121
|
+
DESTROY='DESTROY'
|
122
|
+
end
|
123
|
+
|
124
|
+
module Target
|
125
|
+
FILE='FILE'
|
126
|
+
EXTENSION='EXTENSION'
|
127
|
+
BREAKPOINT='BREAKPOINT'
|
128
|
+
DIALOG='DIALOG'
|
129
|
+
BUFFER='BUFFER'
|
130
|
+
CODE='CODE'
|
131
|
+
DEBUGGER='DEBUGGER'
|
132
|
+
end
|
133
|
+
|
134
|
+
|
135
|
+
# module Event
|
136
|
+
# include Verbos
|
137
|
+
# include Target
|
138
|
+
# _OPEN_FILE_ = _OPEN<<_FILE
|
139
|
+
# end
|
140
|
+
|
141
|
+
class ArcadiaContract
|
142
|
+
include Sequence
|
143
|
+
include Action
|
144
|
+
include Target
|
145
|
+
|
146
|
+
class TObj
|
147
|
+
attr_reader :sender
|
148
|
+
attr_accessor :caused_by
|
149
|
+
attr_accessor :channel
|
150
|
+
DEFAULT_CHANNEL='0'
|
151
|
+
def initialize(_sender, _args=nil)
|
152
|
+
@sender=_sender
|
153
|
+
@channel = DEFAULT_CHANNEL
|
154
|
+
if _args
|
155
|
+
_args.each do |key, value|
|
156
|
+
self.send(key+'=', value)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
|
163
|
+
def ArcadiaContract::signature(_verbos,_target)
|
164
|
+
_verbos<<'_'<<_target
|
165
|
+
end
|
166
|
+
def ArcadiaContract::after_signature(_sig)
|
167
|
+
signature(AFTER,_sig)
|
168
|
+
end
|
169
|
+
def ArcadiaContract::before_signature(_sig)
|
170
|
+
signature(BEFORE,_sig)
|
171
|
+
end
|
172
|
+
def ArcadiaContract::add_action(_action, _target)
|
173
|
+
_s = signature(_action,_target)
|
174
|
+
_bs = before_signature(_s)
|
175
|
+
_as = after_signature(_s)
|
176
|
+
class_eval(%Q[
|
177
|
+
#{_s}='#{_s}'
|
178
|
+
#{_bs}='#{_bs}'
|
179
|
+
#{_as}='#{_as}'
|
180
|
+
])
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
class << ArcadiaContract
|
185
|
+
include Sequence
|
186
|
+
include Action
|
187
|
+
include Target
|
188
|
+
end
|
189
|
+
|
190
|
+
class FileContract < ArcadiaContract
|
191
|
+
add_action OPEN,FILE
|
192
|
+
add_action CLOSE,FILE
|
193
|
+
add_action SAVE,FILE
|
194
|
+
class TFileObj < TObj
|
195
|
+
attr_accessor :file, :line, :col, :title, :text, :candidates, :xdoc, :ydoc, :doc_entry,:doc
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
class CodeContract < ArcadiaContract
|
200
|
+
add_action COMPLETE,CODE
|
201
|
+
add_action DOCUMENT,CODE
|
202
|
+
class TCodeObj < TObj
|
203
|
+
# attr_accessor_output :file, :line, :col, , :xdoc, :ydoc, :doc_entry
|
204
|
+
# attr_accessor_input :candidates,:doc
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# def do_file_event(_event)
|
209
|
+
# case _event.signature
|
210
|
+
## when FileContract::BEFORE_OPEN_FILE
|
211
|
+
# when ArcadiaContract::before_signature(FileContract::OPEN_FILE)
|
212
|
+
# when FileContract::OPEN
|
213
|
+
# when
|
214
|
+
# end
|
215
|
+
# end
|
216
|
+
|
217
|
+
p FileContract::AFTER_OPEN_FILE
|
218
|
+
p FileContract::BEFORE_OPEN_FILE
|
219
|
+
#p CodeContract::OPEN_FILE
|
data/base/a-contracts.rb
CHANGED
@@ -1,307 +1,322 @@
|
|
1
|
-
#
|
2
|
-
# a-contracts.rb - Arcadia Ruby ide
|
3
|
-
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
-
#
|
5
|
-
|
6
|
-
# Catalog of all contracts used by extensions. This astraction guarantees
|
7
|
-
# the separation of ext
|
8
|
-
# contract must extend AeContract
|
9
|
-
|
10
|
-
require "base/a-ext"
|
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
|
-
def
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
def
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
def
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
def
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
def
|
98
|
-
|
99
|
-
end
|
100
|
-
|
101
|
-
def
|
102
|
-
|
103
|
-
end
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
def
|
111
|
-
raise_action(
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
def
|
123
|
-
|
124
|
-
end
|
125
|
-
|
126
|
-
def
|
127
|
-
|
128
|
-
end
|
129
|
-
|
130
|
-
def
|
131
|
-
|
132
|
-
end
|
133
|
-
|
134
|
-
def
|
135
|
-
|
136
|
-
end
|
137
|
-
|
138
|
-
def
|
139
|
-
|
140
|
-
end
|
141
|
-
|
142
|
-
def
|
143
|
-
|
144
|
-
end
|
145
|
-
|
146
|
-
def
|
147
|
-
|
148
|
-
end
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
)
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
end
|
199
|
-
end
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
end
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
end
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
end
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
def
|
289
|
-
raise_action(
|
290
|
-
end
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
end
|
1
|
+
#
|
2
|
+
# a-contracts.rb - Arcadia Ruby ide
|
3
|
+
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
+
#
|
5
|
+
|
6
|
+
# Catalog of all contracts used by extensions. This astraction guarantees
|
7
|
+
# the separation of ext
|
8
|
+
# contract must extend AeContract
|
9
|
+
|
10
|
+
require "base/a-ext"
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
#---------------- contracts ----------------------
|
16
|
+
class MainContract < ArcadiaContract
|
17
|
+
class TMainObj < TObj
|
18
|
+
attr_accessor :obj, :domain, :extension
|
19
|
+
end
|
20
|
+
|
21
|
+
EXTENSION_BEFORE_BUILD = "EXTENSION_BEFORE_BUILD"
|
22
|
+
EXTENSION_BUILD = "EXTENSION_BUILD"
|
23
|
+
EXTENSION_AFTER_BUILD = "EXTENSION_AFTER_BUILD"
|
24
|
+
EXTENSION_FINALIZE = "EXTENSION_FINALIZE"
|
25
|
+
CONTRACT_RETRIVE = "CONTRACT_RETRIVE"
|
26
|
+
RAISE_EXTENSION = "RAISE_EXTENSION"
|
27
|
+
EVENT_HANDLED = "EVENT_HANDLED"
|
28
|
+
|
29
|
+
|
30
|
+
def event_handled(_sender, *args)
|
31
|
+
raise_event(EVENT_HANDLED, TMainObj.new(_sender, *args))
|
32
|
+
end
|
33
|
+
|
34
|
+
def extension_before_build(_sender, *args)
|
35
|
+
raise_event(EXTENSION_BEFORE_BUILD, TMainObj.new(_sender, *args))
|
36
|
+
end
|
37
|
+
|
38
|
+
def extension_build(_sender, *args)
|
39
|
+
raise_event(EXTENSION_BUILD, TMainObj.new(_sender, *args))
|
40
|
+
end
|
41
|
+
|
42
|
+
def extension_after_build(_sender, *args)
|
43
|
+
raise_event(EXTENSION_AFTER_BUILD, TMainObj.new(_sender, *args))
|
44
|
+
end
|
45
|
+
|
46
|
+
def raise_extension(_sender, *args)
|
47
|
+
raise_event(RAISE_EXTENSION, TMainObj.new(_sender, *args))
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
class EditorContract < ArcadiaContract
|
54
|
+
class TEditorObj < TObj
|
55
|
+
attr_accessor :file, :line, :col, :title, :text, :candidates, :xdoc, :ydoc, :doc_entry,:doc
|
56
|
+
end
|
57
|
+
OPEN_FILE = "OPEN_FILE"
|
58
|
+
CLOSE_FILE = "CLOSE_FILE"
|
59
|
+
SHOW_SEARCH_DIALOG = "SHOW_SEARCH_DIALOG"
|
60
|
+
SHOW_GOTO_LINE_DIALOG = "SHOW_GOTO_LINE_DIALOG"
|
61
|
+
SAVE_FILE = "SAVE_FILE"
|
62
|
+
SAVE_AS_FILE = "SAVE_AS_FILE"
|
63
|
+
SAVE_FILE_RAISED = "SAVE_FILE_RAISED"
|
64
|
+
SAVE_AS_FILE_RAISED = "SAVE_AS_FILE_RAISED"
|
65
|
+
OPEN_TEXT = "OPEN_TEXT"
|
66
|
+
COMPLETE_CODE = "COMPLETE_CODE"
|
67
|
+
DOC_CODE = "DOC_CODE"
|
68
|
+
BUILD_DOC_TREE = "BUILD_DOC_TREE"
|
69
|
+
|
70
|
+
#AFTER_CREATE = "AFTER_CREATE"
|
71
|
+
BREAKPOINT_AFTER_CREATE = "BREAKPOINT_AFTER_CREATE"
|
72
|
+
BREAKPOINT_AFTER_DELETE = "BREAKPOINT_AFTER_DELETE"
|
73
|
+
BREAKPOINTS_AFTER_CREATE = "BREAKPOINTS_AFTER_CREATE"
|
74
|
+
BREAKPOINTS_AFTER_DELETE = "BREAKPOINTS_AFTER_DELETE"
|
75
|
+
FILE_AFTER_OPEN = "FILE_AFTER_OPEN"
|
76
|
+
FILE_AFTER_CLOSE = "FILE_AFTER_CLOSE"
|
77
|
+
FILE_AFTER_SAVE = "FILE_AFTER_SAVE"
|
78
|
+
FILE_AFTER_CREATE = "FILE_AFTER_CREATE"
|
79
|
+
BUFFER_AFTER_RAISE = "BUFFER_AFTER_RAISE"
|
80
|
+
EVAL_EXPRESSION = "EVAL_EXPRESSION"
|
81
|
+
def open_file(_sender, *args)
|
82
|
+
raise_action(OPEN_FILE, TEditorObj.new(_sender, *args))
|
83
|
+
end
|
84
|
+
|
85
|
+
def close_file(_sender, *args)
|
86
|
+
raise_action(CLOSE_FILE, TEditorObj.new(_sender, *args))
|
87
|
+
end
|
88
|
+
|
89
|
+
def save_file(_sender, *args)
|
90
|
+
raise_action(SAVE_FILE, TEditorObj.new(_sender, *args))
|
91
|
+
end
|
92
|
+
|
93
|
+
def save_file_raised(_sender, *args)
|
94
|
+
raise_action(SAVE_FILE_RAISED, TEditorObj.new(_sender, *args))
|
95
|
+
end
|
96
|
+
|
97
|
+
def save_as_file(_sender, *args)
|
98
|
+
raise_action(SAVE_AS_FILE, TEditorObj.new(_sender, *args))
|
99
|
+
end
|
100
|
+
|
101
|
+
def save_as_file_raised(_sender, *args)
|
102
|
+
raise_action(SAVE_AS_FILE_RAISED, TEditorObj.new(_sender, *args))
|
103
|
+
end
|
104
|
+
|
105
|
+
def show_search_dialog(_sender, *args)
|
106
|
+
raise_action(SHOW_SEARCH_DIALOG, TEditorObj.new(_sender, *args))
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
def show_goto_line_dialog(_sender, *args)
|
111
|
+
raise_action(SHOW_GOTO_LINE_DIALOG, TEditorObj.new(_sender, *args))
|
112
|
+
end
|
113
|
+
|
114
|
+
def open_text(_sender, *args)
|
115
|
+
raise_action(OPEN_TEXT, TEditorObj.new(_sender, *args))
|
116
|
+
end
|
117
|
+
|
118
|
+
def complete_code(_sender, *args)
|
119
|
+
raise_action(COMPLETE_CODE, TEditorObj.new(_sender, *args))
|
120
|
+
end
|
121
|
+
|
122
|
+
def doc_code(_sender, *args)
|
123
|
+
raise_action(DOC_CODE, TEditorObj.new(_sender, *args))
|
124
|
+
end
|
125
|
+
|
126
|
+
def build_doc_tree(_sender, *args)
|
127
|
+
raise_action(BUILD_DOC_TREE, TEditorObj.new(_sender, *args))
|
128
|
+
end
|
129
|
+
|
130
|
+
def file_opened(_sender, *args)
|
131
|
+
raise_event(FILE_AFTER_OPEN, TEditorObj.new(_sender, *args))
|
132
|
+
end
|
133
|
+
|
134
|
+
def file_saved(_sender, *args)
|
135
|
+
raise_event(FILE_AFTER_SAVE, TEditorObj.new(_sender, *args))
|
136
|
+
end
|
137
|
+
|
138
|
+
def file_created(_sender, *args)
|
139
|
+
raise_event(FILE_AFTER_CREATE, TEditorObj.new(_sender, *args))
|
140
|
+
end
|
141
|
+
|
142
|
+
def buffer_raised(_sender, *args)
|
143
|
+
raise_event(BUFFER_AFTER_RAISE, TEditorObj.new(_sender, *args))
|
144
|
+
end
|
145
|
+
|
146
|
+
def file_closed(_sender, *args)
|
147
|
+
raise_event(FILE_AFTER_CLOSE, TEditorObj.new(_sender, *args))
|
148
|
+
end
|
149
|
+
|
150
|
+
def breakpoint_created(_sender, *args)
|
151
|
+
raise_event(BREAKPOINT_AFTER_CREATE, TEditorObj.new(_sender, *args))
|
152
|
+
end
|
153
|
+
|
154
|
+
def breakpoint_deleted(_sender, *args)
|
155
|
+
raise_event(BREAKPOINT_AFTER_DELETE, TEditorObj.new(_sender, *args))
|
156
|
+
end
|
157
|
+
|
158
|
+
def eval_expression(_sender, *args)
|
159
|
+
raise_action(EVAL_EXPRESSION, TEditorObj.new(_sender, *args))
|
160
|
+
end
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
# def breakpoints_created(_array_of_tobj=nil)
|
165
|
+
# raise_event(BREAKPOINTS_AFTER_CREATE, _array_of_tobj)
|
166
|
+
# end
|
167
|
+
# def breakpoints_deleted(_array_of_tobj=nil)
|
168
|
+
# raise_event(BREAKPOINTS_AFTER_DELETE, _array_of_tobj)
|
169
|
+
# end
|
170
|
+
|
171
|
+
end
|
172
|
+
|
173
|
+
class MsgContract < ArcadiaContract
|
174
|
+
TYPE_SIMPLE = "TYPE_SIMPLE"
|
175
|
+
TYPE_DEBUG = "TYPE_DEBUG"
|
176
|
+
TYPE_ERROR = "TYPE_ERROR"
|
177
|
+
SObj = Struct.new("MsgState"
|
178
|
+
)
|
179
|
+
class TMsgObj < TObj
|
180
|
+
attr_accessor :type, :text
|
181
|
+
end
|
182
|
+
|
183
|
+
EVENT_EXT_MSG_OUT = "EVENT_EXT_MSG_OUT"
|
184
|
+
def out(_sender, *args)
|
185
|
+
raise_event(EVENT_EXT_MSG_OUT, TMsgObj.new(_sender, *args))
|
186
|
+
end
|
187
|
+
|
188
|
+
def out_simple(_sender, _msg, _channel=nil)
|
189
|
+
self.out(_sender, 'type'=>TYPE_SIMPLE, 'text'=>_msg, 'channel'=>_channel)
|
190
|
+
end
|
191
|
+
|
192
|
+
def out_debug(_sender, _msg, _channel=nil)
|
193
|
+
self.out(_sender, 'type'=>TYPE_DEBUG, 'text'=>_msg, 'channel'=>_channel)
|
194
|
+
end
|
195
|
+
|
196
|
+
def out_error(_sender, _msg, _channel=nil)
|
197
|
+
self.out(_sender, 'type'=>TYPE_ERROR, 'text'=>_msg, 'channel'=>_channel)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
class ShellContract < ArcadiaContract
|
202
|
+
SObj = Struct.new("ShellState"
|
203
|
+
)
|
204
|
+
class TShellObj < TObj
|
205
|
+
attr_accessor :file
|
206
|
+
end
|
207
|
+
|
208
|
+
def run(_sender, *args)
|
209
|
+
end
|
210
|
+
|
211
|
+
def debug(_sender, *args)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
|
216
|
+
class DebugContract < ArcadiaContract
|
217
|
+
SObj = Struct.new("DebugState"
|
218
|
+
)
|
219
|
+
class TDebugObj < TObj
|
220
|
+
attr_accessor :file, :line, :error_text, :error_class,:callers, :variables
|
221
|
+
end
|
222
|
+
|
223
|
+
DEBUG_BEGIN="DEBUG_BEGIN"
|
224
|
+
DEBUG_END="DEBUG_END"
|
225
|
+
DEBUG_STEP="DEBUG_STEP"
|
226
|
+
|
227
|
+
def debug_begin(_sender, *args)
|
228
|
+
raise_event(DEBUG_BEGIN, TDebugObj.new(_sender, *args))
|
229
|
+
end
|
230
|
+
def debug_end(_sender, *args)
|
231
|
+
raise_event(DEBUG_END, TDebugObj.new(_sender, *args))
|
232
|
+
end
|
233
|
+
def debug_step(_sender, *args)
|
234
|
+
raise_event(DEBUG_STEP, TDebugObj.new(_sender, *args))
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
class InspectorContract < ArcadiaContract
|
239
|
+
SObj = Struct.new("InspectorActionState"
|
240
|
+
)
|
241
|
+
class TInspectorObj < TObj
|
242
|
+
attr_accessor :wrapper, :requires, :property_family,:property_name,:property_value
|
243
|
+
end
|
244
|
+
|
245
|
+
SELECT_WRAPPER = "SELECT_WRAPPER"
|
246
|
+
#ACTIVATE_WRAPPER = "ACTIVATE_WRAPPER"
|
247
|
+
DELETE_WRAPPER = "DELETE_WRAPPER"
|
248
|
+
ADD_REQUIRE = "ADD_REQUIRE"
|
249
|
+
REGISTER_WRAPPER = "REGISTER_WRAPPER"
|
250
|
+
# UPDATE_PROPERTY = "UPDATE_PROPERTY"
|
251
|
+
DELETE_INSPECTOR = "DELETE_INSPECTOR"
|
252
|
+
RAISE_LAST_WIDGET = "RAISE_LAST_WIDGET"
|
253
|
+
RAISE_ACTIVE_TOPLEVEL = "RAISE_ACTIVE_TOPLEVEL"
|
254
|
+
|
255
|
+
def delete_wrapper(_sender, *args)
|
256
|
+
raise_action(DELETE_WRAPPER, TInspectorObj.new(_sender, *args))
|
257
|
+
end
|
258
|
+
|
259
|
+
def raise_last_widget(_sender, *args)
|
260
|
+
raise_action(RAISE_LAST_WIDGET, TInspectorObj.new(_sender, *args))
|
261
|
+
end
|
262
|
+
|
263
|
+
def raise_active_toplevel(_sender, *args)
|
264
|
+
raise_action(RAISE_ACTIVE_TOPLEVEL, TInspectorObj.new(_sender, *args))
|
265
|
+
end
|
266
|
+
|
267
|
+
def select(_sender, *args)
|
268
|
+
raise_action(SELECT_WRAPPER, TInspectorObj.new(_sender, *args))
|
269
|
+
end
|
270
|
+
|
271
|
+
def add_require(_sender, *args)
|
272
|
+
raise_action(ADD_REQUIRE, TInspectorObj.new(_sender, *args))
|
273
|
+
end
|
274
|
+
|
275
|
+
def register(_sender, *args)
|
276
|
+
raise_action(REGISTER_WRAPPER, TInspectorObj.new(_sender, *args))
|
277
|
+
end
|
278
|
+
|
279
|
+
def delete_inspector(_sender, *args)
|
280
|
+
raise_action(DELETE_INSPECTOR, TInspectorObj.new(_sender, *args))
|
281
|
+
end
|
282
|
+
|
283
|
+
publish_action :raise_active_object
|
284
|
+
end
|
285
|
+
|
286
|
+
class PublishContract < ArcadiaContract
|
287
|
+
ADD_COMAND_ACTOR = "ADD_COMAND_ACTOR"
|
288
|
+
def add_command_actor(_sender, *args)
|
289
|
+
raise_action(ADD_COMAND_ACTOR, TObj.new(_sender, *args))
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
class WrapperContract < ArcadiaContract
|
296
|
+
class TWrapperObj < TObj
|
297
|
+
attr_accessor :wrapper, :property_name, :property_family, :property_old_value, :property_new_value
|
298
|
+
end
|
299
|
+
WRAPPER_AFTER_CREATE="WRAPPER_AFTER_CREATE"
|
300
|
+
PROPERTY_AFTER_UPDATE="PROPERTY_AFTER_UPDATE"
|
301
|
+
UPDATE_PROPERTY="UPDATE_PROPERTY"
|
302
|
+
def update_property(_sender, *args)
|
303
|
+
raise_action(UPDATE_PROPERTY, TWrapperObj.new(_sender, *args))
|
304
|
+
end
|
305
|
+
def property_updated(_sender, *args)
|
306
|
+
raise_event(PROPERTY_AFTER_UPDATE, TWrapperObj.new(_sender, *args))
|
307
|
+
end
|
308
|
+
def wrapper_created(_sender, *args)
|
309
|
+
raise_event(WRAPPER_AFTER_CREATE, TWrapperObj.new(_sender, *args))
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
class PaletteContract < ArcadiaContract
|
314
|
+
class TPaletteObj < TObj
|
315
|
+
attr_accessor :parent, :x, :y
|
316
|
+
end
|
317
|
+
MAKE_SELECTED_WRAPPER = "MAKE_SELECTED_WRAPPER"
|
318
|
+
def make_selected(_sender, *args)
|
319
|
+
raise_action(MAKE_SELECTED_WRAPPER, TPaletteObj.new(_sender, *args))
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|