arcadia 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/README +69 -77
  2. data/arcadia.rb +1097 -770
  3. data/base/a-commons.rb +480 -0
  4. data/base/a-contracts.rb +207 -322
  5. data/base/{a-utils.rb → a-tkcommons.rb} +933 -993
  6. data/conf/arcadia.conf +130 -203
  7. data/conf/arcadia.res.rb +1332 -1325
  8. data/ext/ae-action-dispatcher/ae-action-dispatcher.conf +6 -0
  9. data/ext/ae-action-dispatcher/ae-action-dispatcher.rb +22 -0
  10. data/ext/ae-complete-code/ae-complete-code.conf +2 -2
  11. data/ext/ae-complete-code/ae-complete-code.rb +82 -80
  12. data/ext/ae-doc-code/ae-doc-code.conf +2 -2
  13. data/ext/ae-doc-code/ae-doc-code.rb +114 -111
  14. data/ext/ae-editor/ae-editor.conf +110 -105
  15. data/ext/ae-editor/ae-editor.rb +2501 -2287
  16. data/ext/ae-editor/langs/conf.lang +15 -0
  17. data/ext/ae-editor/langs/lang.lang.bind +1 -0
  18. data/ext/ae-editor/langs/rb.lang +67 -0
  19. data/ext/ae-editor/langs/rbw.lang.bind +1 -0
  20. data/ext/ae-event-log/ae-event-log.rb +45 -52
  21. data/ext/ae-file-history/ae-file-history.conf +4 -4
  22. data/ext/ae-file-history/ae-file-history.rb +298 -286
  23. data/ext/ae-flag/ae-flag.conf +6 -6
  24. data/ext/ae-flag/ae-flag.rb +12 -12
  25. data/ext/ae-inspector/ae-inspector.conf +3 -3
  26. data/ext/ae-inspector/ae-inspector.rb +2 -2
  27. data/ext/ae-output-event/ae-output-event.conf +15 -15
  28. data/ext/ae-output/ae-output.conf +5 -3
  29. data/ext/ae-output/ae-output.rb +62 -33
  30. data/ext/ae-palette/ae-palette.conf +3 -3
  31. data/ext/ae-palette/ae-palette.rb +265 -306
  32. data/ext/ae-rad/ae-rad-inspector.rb +1534 -0
  33. data/{base/a-libs.rb → ext/ae-rad/ae-rad-libs.rb} +1118 -846
  34. data/ext/ae-rad/ae-rad-palette.rb +273 -0
  35. data/ext/ae-rad/ae-rad.conf +71 -0
  36. data/ext/ae-rad/ae-rad.rb +56 -0
  37. data/{lib → ext/ae-rad/lib}/tk/al-tk.rb +21 -110
  38. data/{lib → ext/ae-rad/lib}/tk/al-tk.res.rb +0 -0
  39. data/{lib → ext/ae-rad/lib}/tk/al-tkarcadia.rb +26 -26
  40. data/{lib → ext/ae-rad/lib}/tk/al-tkcustom.rb +70 -70
  41. data/{lib → ext/ae-rad/lib}/tkext/al-bwidget.rb +194 -194
  42. data/{lib → ext/ae-rad/lib}/tkext/al-iwidgets.rb +25 -25
  43. data/{lib → ext/ae-rad/lib}/tkext/al-tile.rb +173 -173
  44. data/{lib → ext/ae-rad/lib}/tkext/al-tktable.rb +0 -0
  45. data/ext/ae-ruby-debug/ae-ruby-debug.conf +7 -4
  46. data/ext/ae-ruby-debug/ae-ruby-debug.rb +278 -142
  47. data/ext/ae-search-in-files/ae-search-in-files.conf +15 -0
  48. data/ext/ae-search-in-files/ae-search-in-files.rb +284 -0
  49. data/ext/ae-shell/ae-shell.rb +88 -8
  50. data/ext/ae-shell/sh.rb +7 -0
  51. metadata +93 -79
  52. data/base/a-contracts-work.rb +0 -219
  53. data/base/a-ext.rb +0 -280
  54. data/ext/ae-debug/ae-debug.conf +0 -7
  55. data/ext/ae-debug/ae-debug.rb +0 -601
  56. data/ext/ae-debug/debug1.57.rb +0 -998
data/base/a-contracts.rb CHANGED
@@ -1,322 +1,207 @@
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
-
1
+ #
2
+ # a-contracts.rb - Arcadia Ruby ide
3
+ # by Antonio Galeone <antonio-galeone@rubyforge.org>
4
+ #
5
+
6
+ # Catalog of events used by arcadia obj.
7
+ # Obj must comunicate through raise/catch event
8
+ # in order to guarantees decoupling
9
+
10
+ # +------------------------------------------+
11
+ # Arcadia Event
12
+ # +------------------------------------------+
13
+
14
+ class ArcadiaEvent < Event
15
+ end
16
+
17
+ class QuitEvent < ArcadiaEvent
18
+ end
19
+
20
+ # +------------------------------------------+
21
+ # Extention Event (raised only by Arcadia)
22
+ # do not raise!
23
+ # +------------------------------------------+
24
+
25
+ class BuildEvent < ArcadiaEvent
26
+ attr_accessor :name
27
+ end
28
+
29
+ class ExitQueryEvent < ArcadiaEvent
30
+ attr_accessor :can_exit
31
+ end
32
+
33
+ class FinalizeEvent < ArcadiaEvent
34
+ end
35
+
36
+ # +---------------------------------------------+
37
+ # Buffer event
38
+ # +---------------------------------------------+
39
+
40
+ class BufferEvent < ArcadiaEvent # Abstract
41
+ attr_accessor :file, :title, :text, :row, :col
42
+ # if file==nil && title==nil buffer=current buffer
43
+ end
44
+
45
+ class NewBufferEvent < BufferEvent
46
+ end
47
+
48
+ class OpenBufferEvent < BufferEvent
49
+ end
50
+
51
+ class CloseBufferEvent < BufferEvent
52
+ end
53
+
54
+ class SaveBufferEvent < BufferEvent
55
+ end
56
+
57
+ class SaveAsBufferEvent < SaveBufferEvent
58
+ attr_accessor :new_file
59
+ end
60
+
61
+ class GoToLineBufferEvent < BufferEvent
62
+ attr_accessor :line
63
+ end
64
+
65
+ class SearchBufferEvent < BufferEvent
66
+ class Result < Result
67
+ attr_accessor :row, :col
68
+ end
69
+ attr_accessor :what
70
+ end
71
+
72
+ class CompleteCodeEvent < BufferEvent
73
+ class Result < Result
74
+ attr_accessor :candidates
75
+ end
76
+ end
77
+
78
+ class DocCodeEvent < BufferEvent
79
+ class Result < Result
80
+ attr_accessor :doc, :title
81
+ end
82
+ attr_accessor :xdoc, :ydoc, :doc_entry
83
+ end
84
+
85
+ class BufferRaisedEvent < BufferEvent
86
+ end
87
+
88
+ # +---------------------------------------------+
89
+ # Debug event
90
+ # +---------------------------------------------+
91
+
92
+ class DebugEvent < ArcadiaEvent
93
+ attr_accessor :file, :row
94
+ end
95
+
96
+ class SetBreakpointEvent < DebugEvent
97
+ end
98
+
99
+ class UnsetBreakpointEvent < DebugEvent
100
+ end
101
+
102
+ class EvalExpressionEvent < DebugEvent
103
+ attr_accessor :expression
104
+ end
105
+
106
+ class StartDebugEvent < DebugEvent
107
+ end
108
+
109
+ class StopDebugEvent < DebugEvent
110
+ end
111
+
112
+ class StepDebugEvent < DebugEvent
113
+ class Result < Result
114
+ attr_accessor :file, :row
115
+ end
116
+ # step_over, step_into, step_out, resume, where, quit
117
+ attr_accessor :command
118
+ end
119
+
120
+ class DebugStepInfoEvent < DebugEvent
121
+ attr_accessor :file, :row
122
+ end
123
+
124
+ # +---------------------------------------------+
125
+ # Message event (raised only by Arcadia)
126
+ # to raise use:
127
+ # Arcadia.new_msg
128
+ # Arcadia.new_debug_msg
129
+ # Arcadia.new_error_msg
130
+ # +---------------------------------------------+
131
+
132
+ class MsgEvent < ArcadiaEvent
133
+ attr_accessor :msg
134
+ end
135
+
136
+ class DebugMsgEvent < MsgEvent
137
+ end
138
+
139
+ class ErrorMsgEvent < MsgEvent
140
+ end
141
+
142
+ # +---------------------------------------------+
143
+ # Other event
144
+ # +---------------------------------------------+
145
+
146
+ class SearchInFilesEvent < ArcadiaEvent
147
+ class Result < SearchBufferEvent::Result
148
+ attr_accessor :file
149
+ end
150
+ attr_accessor :what, :files_filter, :dir
151
+ end
152
+
153
+ class SystemExecEvent < ArcadiaEvent
154
+ class Result < Result
155
+ attr_accessor :std_output, :std_error
156
+ end
157
+ attr_accessor :command
158
+ end
159
+
160
+ class RunRubyFileEvent < ArcadiaEvent
161
+ class Result < Result
162
+ attr_accessor :output
163
+ end
164
+ attr_accessor :file
165
+ end
166
+
167
+ # +---------------------------------------------+
168
+ # Dialog event (raised only by Arcadia)
169
+ # to raise use:
170
+ # Arcadia.ok
171
+ # Arcadia.ok_cancel
172
+ # Arcadia.yes_no_cancel
173
+ # Arcadia.abort_retry_ignore
174
+ # +---------------------------------------------+
175
+
176
+ # default actions_pattern = 'OK'
177
+ class DialogEvent < ArcadiaEvent
178
+ TYPE_PATTERNS = ['ok', 'yes_no', 'ok_cancel', 'yes_no_cancel', 'abort_retry_ignore']
179
+ class Result < Result
180
+ attr_accessor :value
181
+ end
182
+ attr_accessor :title, :msg, :type
183
+ end
184
+
185
+ class QuestionDialogEvent < DialogEvent
186
+ end
187
+
188
+ class InfoDialogEvent < DialogEvent
189
+ end
190
+
191
+ class WarningDialogEvent < DialogEvent
192
+ end
193
+
194
+ class ErrorDialogEvent < DialogEvent
195
+ end
196
+
197
+
198
+ # +---------------------------------------------+
199
+ # Action event
200
+ # +---------------------------------------------+
201
+
202
+ class ActionEvent < ArcadiaEvent
203
+ attr_accessor :receiver
204
+ attr_accessor :action
205
+ attr_accessor :action_args
206
+ end
207
+