arcadia 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +69 -77
- data/arcadia.rb +1097 -770
- data/base/a-commons.rb +480 -0
- data/base/a-contracts.rb +207 -322
- data/base/{a-utils.rb → a-tkcommons.rb} +933 -993
- data/conf/arcadia.conf +130 -203
- data/conf/arcadia.res.rb +1332 -1325
- data/ext/ae-action-dispatcher/ae-action-dispatcher.conf +6 -0
- data/ext/ae-action-dispatcher/ae-action-dispatcher.rb +22 -0
- data/ext/ae-complete-code/ae-complete-code.conf +2 -2
- data/ext/ae-complete-code/ae-complete-code.rb +82 -80
- data/ext/ae-doc-code/ae-doc-code.conf +2 -2
- data/ext/ae-doc-code/ae-doc-code.rb +114 -111
- data/ext/ae-editor/ae-editor.conf +110 -105
- data/ext/ae-editor/ae-editor.rb +2501 -2287
- data/ext/ae-editor/langs/conf.lang +15 -0
- data/ext/ae-editor/langs/lang.lang.bind +1 -0
- data/ext/ae-editor/langs/rb.lang +67 -0
- data/ext/ae-editor/langs/rbw.lang.bind +1 -0
- data/ext/ae-event-log/ae-event-log.rb +45 -52
- data/ext/ae-file-history/ae-file-history.conf +4 -4
- data/ext/ae-file-history/ae-file-history.rb +298 -286
- data/ext/ae-flag/ae-flag.conf +6 -6
- data/ext/ae-flag/ae-flag.rb +12 -12
- data/ext/ae-inspector/ae-inspector.conf +3 -3
- data/ext/ae-inspector/ae-inspector.rb +2 -2
- data/ext/ae-output-event/ae-output-event.conf +15 -15
- data/ext/ae-output/ae-output.conf +5 -3
- data/ext/ae-output/ae-output.rb +62 -33
- data/ext/ae-palette/ae-palette.conf +3 -3
- data/ext/ae-palette/ae-palette.rb +265 -306
- data/ext/ae-rad/ae-rad-inspector.rb +1534 -0
- data/{base/a-libs.rb → ext/ae-rad/ae-rad-libs.rb} +1118 -846
- data/ext/ae-rad/ae-rad-palette.rb +273 -0
- data/ext/ae-rad/ae-rad.conf +71 -0
- data/ext/ae-rad/ae-rad.rb +56 -0
- data/{lib → ext/ae-rad/lib}/tk/al-tk.rb +21 -110
- data/{lib → ext/ae-rad/lib}/tk/al-tk.res.rb +0 -0
- data/{lib → ext/ae-rad/lib}/tk/al-tkarcadia.rb +26 -26
- data/{lib → ext/ae-rad/lib}/tk/al-tkcustom.rb +70 -70
- data/{lib → ext/ae-rad/lib}/tkext/al-bwidget.rb +194 -194
- data/{lib → ext/ae-rad/lib}/tkext/al-iwidgets.rb +25 -25
- data/{lib → ext/ae-rad/lib}/tkext/al-tile.rb +173 -173
- data/{lib → ext/ae-rad/lib}/tkext/al-tktable.rb +0 -0
- data/ext/ae-ruby-debug/ae-ruby-debug.conf +7 -4
- data/ext/ae-ruby-debug/ae-ruby-debug.rb +278 -142
- data/ext/ae-search-in-files/ae-search-in-files.conf +15 -0
- data/ext/ae-search-in-files/ae-search-in-files.rb +284 -0
- data/ext/ae-shell/ae-shell.rb +88 -8
- data/ext/ae-shell/sh.rb +7 -0
- metadata +93 -79
- data/base/a-contracts-work.rb +0 -219
- data/base/a-ext.rb +0 -280
- data/ext/ae-debug/ae-debug.conf +0 -7
- data/ext/ae-debug/ae-debug.rb +0 -601
- data/ext/ae-debug/debug1.57.rb +0 -998
data/base/a-contracts-work.rb
DELETED
@@ -1,219 +0,0 @@
|
|
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-ext.rb
DELETED
@@ -1,280 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# a-ext.rb - Arcadia Ruby ide
|
3
|
-
# by Antonio Galeone <antonio-galeone@rubyforge.org>
|
4
|
-
#
|
5
|
-
|
6
|
-
require "observer"
|
7
|
-
require 'singleton'
|
8
|
-
|
9
|
-
class ArcadiaExt
|
10
|
-
attr_reader :arcadia
|
11
|
-
|
12
|
-
def initialize(_arcadia, _name=nil)
|
13
|
-
@arcadia = _arcadia
|
14
|
-
@name = _name
|
15
|
-
unless self.respond_to? :build
|
16
|
-
raise NoMethodError, "ArcadiaExt needs to respond to `:build'"
|
17
|
-
end
|
18
|
-
unless self.respond_to? :before_build
|
19
|
-
raise NoMethodError, "ArcadiaExt needs to respond to `:before_build'"
|
20
|
-
end
|
21
|
-
unless self.respond_to? :after_build
|
22
|
-
raise NoMethodError, "ArcadiaExt needs to respond to `:after_build'"
|
23
|
-
end
|
24
|
-
if self.respond_to? :arcadia_update
|
25
|
-
ObserverCallback.new(@arcadia.main_contract, self, :arcadia_update)
|
26
|
-
end
|
27
|
-
ObjectSpace.define_finalizer(self, self.method(:finalize).to_proc)
|
28
|
-
end
|
29
|
-
|
30
|
-
def before_build
|
31
|
-
#must be implemented in child
|
32
|
-
end
|
33
|
-
|
34
|
-
def build
|
35
|
-
#must be implemented in child
|
36
|
-
end
|
37
|
-
|
38
|
-
def after_build
|
39
|
-
#must be implemented in child
|
40
|
-
end
|
41
|
-
|
42
|
-
def frame
|
43
|
-
if @frame == nil
|
44
|
-
@frame = @arcadia.layout.register_panel(@arcadia['conf'][@name+'.frame'],@name, @arcadia['conf'][@name+'.label'])
|
45
|
-
end
|
46
|
-
return @frame
|
47
|
-
end
|
48
|
-
|
49
|
-
def frame_free
|
50
|
-
@arcadia.layout.unregister_panel(@arcadia['conf'][@name+'.frame'],@name)
|
51
|
-
@frame = nil
|
52
|
-
end
|
53
|
-
|
54
|
-
def conf(_property)
|
55
|
-
@arcadia['conf'][@name+'.'+_property]
|
56
|
-
end
|
57
|
-
# def arcadia_update(_sender, _event)
|
58
|
-
#must be implemented to activate
|
59
|
-
# end
|
60
|
-
|
61
|
-
def can_exit_query
|
62
|
-
return true
|
63
|
-
end
|
64
|
-
|
65
|
-
def finalize
|
66
|
-
#may be extendeded in child
|
67
|
-
end
|
68
|
-
|
69
|
-
def verbose
|
70
|
-
'??????'
|
71
|
-
end
|
72
|
-
|
73
|
-
end
|
74
|
-
|
75
|
-
|
76
|
-
class ObserverCallback
|
77
|
-
def initialize(_publisher, _subscriber, _method_update_to_call=:update)
|
78
|
-
@publisher = _publisher
|
79
|
-
@subscriber = _subscriber
|
80
|
-
@method=_method_update_to_call
|
81
|
-
@publisher.add_observer(self)
|
82
|
-
end
|
83
|
-
def update(*args)
|
84
|
-
@subscriber.send(@method,*args)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
class ObserverCallbackContract < ObserverCallback
|
89
|
-
def initialize(_publisher, _subscriber, _method_update_to_call=:update, _channel=nil)
|
90
|
-
super(_publisher, _subscriber, _method_update_to_call)
|
91
|
-
@channel = _channel
|
92
|
-
@channel_conf = @subscriber.conf(@publisher.class.to_s+'.channel') if @subscriber.respond_to?(:conf)
|
93
|
-
end
|
94
|
-
|
95
|
-
def filter(_event)
|
96
|
-
@channel_conf != nil && @channel_conf != _event.channel
|
97
|
-
end
|
98
|
-
|
99
|
-
def update(_event, *args)
|
100
|
-
super(_event, *args) if !filter(_event)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
|
105
|
-
class ObserverCallbackContractThread < ObserverCallbackContract
|
106
|
-
def update(*args)
|
107
|
-
Thread.new do
|
108
|
-
super(*args)
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
|
115
|
-
# The contract define the interface beetwhen extension
|
116
|
-
# in particulare define method than raise event to observers client
|
117
|
-
# and a way to retreive state from client
|
118
|
-
|
119
|
-
class ArcadiaContract
|
120
|
-
include Observable
|
121
|
-
include Singleton
|
122
|
-
class ContractEvent
|
123
|
-
attr_reader :contract
|
124
|
-
attr_reader :signature
|
125
|
-
attr_reader :context
|
126
|
-
attr_reader :channel
|
127
|
-
attr_reader :time
|
128
|
-
attr_writer :action
|
129
|
-
|
130
|
-
SIGNATURE = "NOT_DEFINED"
|
131
|
-
def initialize(_contract, _signature=SIGNATURE, _context=nil)
|
132
|
-
@contract = _contract
|
133
|
-
@signature = _signature
|
134
|
-
@context = _context
|
135
|
-
_context.channel != nil ?@channel=_context.channel: @channel='0'
|
136
|
-
@time = Time.new
|
137
|
-
@action = false
|
138
|
-
end
|
139
|
-
|
140
|
-
def handled(_from)
|
141
|
-
MainContract.instance.event_handled(_from,'caused_by'=>self)
|
142
|
-
end
|
143
|
-
|
144
|
-
def is_action?
|
145
|
-
@action
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
class TObj
|
150
|
-
attr_reader :sender
|
151
|
-
attr_accessor :caused_by
|
152
|
-
attr_accessor :channel
|
153
|
-
DEFAULT_CHANNEL='0'
|
154
|
-
def initialize(_sender, _args=nil)
|
155
|
-
@sender=_sender
|
156
|
-
@channel = DEFAULT_CHANNEL
|
157
|
-
if _args
|
158
|
-
_args.each do |key, value|
|
159
|
-
self.send(key+'=', value)
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
end
|
164
|
-
|
165
|
-
# properties.each do |prop|
|
166
|
-
# define_method(prop) {
|
167
|
-
# instance_variable_get("@#{prop}")
|
168
|
-
# }
|
169
|
-
# define_method("#{prop}=") do |value|
|
170
|
-
# instance_variable_set("@#{prop}", value)
|
171
|
-
# end
|
172
|
-
# end
|
173
|
-
|
174
|
-
# define_method(prop)
|
175
|
-
# attr_reader prop.to_sym # prop by itself also worked for me
|
176
|
-
# # code snip ? setter method
|
177
|
-
# end
|
178
|
-
|
179
|
-
|
180
|
-
# def TObj.property(*properties)
|
181
|
-
# properties.each { |property|
|
182
|
-
# class_eval(%Q[
|
183
|
-
# def #{property}
|
184
|
-
# @#{property}
|
185
|
-
# end
|
186
|
-
#
|
187
|
-
# def #{property}=(value)
|
188
|
-
# @#{property} = value
|
189
|
-
# end
|
190
|
-
# ])
|
191
|
-
# }
|
192
|
-
# end
|
193
|
-
end
|
194
|
-
|
195
|
-
class EventInfo
|
196
|
-
attr_reader :method
|
197
|
-
attr_reader :label
|
198
|
-
attr_reader :icon
|
199
|
-
def initialize(_method)
|
200
|
-
@method = @method
|
201
|
-
end
|
202
|
-
end
|
203
|
-
|
204
|
-
SObj = Struct.new("GenericState",
|
205
|
-
:caller
|
206
|
-
)
|
207
|
-
|
208
|
-
def _event_forge(_event_signature, _tobj)
|
209
|
-
ContractEvent.new(self, _event_signature, _tobj)
|
210
|
-
end
|
211
|
-
private :_event_forge
|
212
|
-
|
213
|
-
|
214
|
-
def raise_event(_event_signature, _tobj, *args)
|
215
|
-
_raise_event(_event_forge(_event_signature, _tobj),*args)
|
216
|
-
end
|
217
|
-
|
218
|
-
def _raise_event(_event, *args)
|
219
|
-
changed
|
220
|
-
notify_observers(_event, *args)
|
221
|
-
if self.class != ArcadiaContract
|
222
|
-
self.class.superclass.instance._raise_event(_event, *args)
|
223
|
-
end
|
224
|
-
end
|
225
|
-
#protected :_raise_event
|
226
|
-
|
227
|
-
def raise_action(_event_signature, _tobj, *args)
|
228
|
-
_raise_action(_event_forge(_event_signature, _tobj),*args)
|
229
|
-
end
|
230
|
-
|
231
|
-
def _raise_action(_event, *args)
|
232
|
-
_event.action = true
|
233
|
-
_raise_event(_event, *args)
|
234
|
-
end
|
235
|
-
private :_raise_action
|
236
|
-
|
237
|
-
def ArcadiaContract.publish_action(_method)
|
238
|
-
_info = EventInfo.new(_method)
|
239
|
-
@@actions = Array.new if !defined?(@@actions)
|
240
|
-
@@actions << _info
|
241
|
-
end
|
242
|
-
|
243
|
-
end
|
244
|
-
|
245
|
-
class ArcadiaContractListener
|
246
|
-
def initialize(_subscriber, _class, _method, _channel=nil)
|
247
|
-
@subscriber = _subscriber
|
248
|
-
@class = _class
|
249
|
-
@method = _method
|
250
|
-
@channel = _channel
|
251
|
-
create_callback(_class.instance)
|
252
|
-
end
|
253
|
-
|
254
|
-
def create_callback(_contract)
|
255
|
-
ObserverCallbackContract.new(_contract, @subscriber, @method, @channel)
|
256
|
-
end
|
257
|
-
|
258
|
-
end
|
259
|
-
|
260
|
-
class ArcadiaContractListenerThread < ArcadiaContractListener
|
261
|
-
|
262
|
-
def create_callback(_contract)
|
263
|
-
#Thread.new do super(_contract, _subscriber, _method) end
|
264
|
-
ObserverCallbackContractThread.new(_contract, @subscriber, @method, @channel)
|
265
|
-
end
|
266
|
-
|
267
|
-
end
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
#class AeContractListener
|
273
|
-
# def initialize(_arcadia)
|
274
|
-
#
|
275
|
-
# end
|
276
|
-
# def listen_on(_aeclip_name, _method_update_to_call=:update)
|
277
|
-
# end
|
278
|
-
# def update(_tobj)
|
279
|
-
# end
|
280
|
-
#end
|