vedeu 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/vedeu +0 -3
- data/examples/borders_app.rb +0 -3
- data/examples/colours_app.rb +0 -3
- data/examples/configuration_app.rb +0 -3
- data/examples/cursor_app.rb +0 -3
- data/examples/focus_app.rb +0 -3
- data/examples/geometry_app.rb +0 -3
- data/examples/lines_app.rb +0 -3
- data/examples/view_templates_app/template.erb +1 -0
- data/examples/view_templates_app/view_templates_app.rb +82 -0
- data/lib/vedeu/all.rb +0 -1
- data/lib/vedeu/application.rb +7 -6
- data/lib/vedeu/bindings.rb +8 -8
- data/lib/vedeu/buffers/buffer.rb +14 -4
- data/lib/vedeu/buffers/display_buffer.rb +2 -2
- data/lib/vedeu/configuration/cli.rb +7 -1
- data/lib/vedeu/configuration/configuration.rb +4 -2
- data/lib/vedeu/cursor/all.rb +1 -1
- data/lib/vedeu/cursor/cursor.rb +29 -2
- data/lib/vedeu/cursor/move_cursor.rb +20 -6
- data/lib/vedeu/cursor/toggle_cursor.rb +2 -0
- data/lib/vedeu/distributed/client.rb +2 -0
- data/lib/vedeu/distributed/server.rb +3 -1
- data/lib/vedeu/distributed/subprocess.rb +6 -1
- data/lib/vedeu/distributed/test_application.rb +32 -9
- data/lib/vedeu/distributed/uri.rb +7 -1
- data/lib/vedeu/dsl/components/border.rb +2 -0
- data/lib/vedeu/dsl/components/geometry.rb +2 -0
- data/lib/vedeu/dsl/components/keymap.rb +2 -0
- data/lib/vedeu/dsl/components/menu.rb +3 -1
- data/lib/vedeu/dsl/composition.rb +31 -2
- data/lib/vedeu/dsl/group.rb +2 -0
- data/lib/vedeu/dsl/interface.rb +3 -1
- data/lib/vedeu/dsl/line.rb +2 -0
- data/lib/vedeu/dsl/shared/style.rb +1 -1
- data/lib/vedeu/dsl/shared/text.rb +1 -2
- data/lib/vedeu/dsl/stream.rb +2 -0
- data/lib/vedeu/dsl/view.rb +1 -1
- data/lib/vedeu/events/all.rb +1 -1
- data/lib/vedeu/events/event.rb +26 -10
- data/lib/vedeu/events/trigger.rb +11 -3
- data/lib/vedeu/geometry/all.rb +2 -0
- data/lib/vedeu/geometry/bounding_area.rb +7 -2
- data/lib/vedeu/geometry/content_geometry.rb +2 -0
- data/lib/vedeu/geometry/coordinate.rb +15 -6
- data/lib/vedeu/geometry/grid.rb +3 -1
- data/lib/vedeu/geometry/index_position.rb +77 -0
- data/lib/vedeu/geometry/limit.rb +15 -1
- data/lib/vedeu/geometry/position.rb +7 -2
- data/lib/vedeu/{output → geometry}/position_index.rb +12 -2
- data/lib/vedeu/geometry/position_validator.rb +9 -1
- data/lib/vedeu/input/all.rb +0 -1
- data/lib/vedeu/input/input.rb +2 -0
- data/lib/vedeu/input/keymap.rb +5 -3
- data/lib/vedeu/input/mapper.rb +7 -1
- data/lib/vedeu/launcher.rb +1 -1
- data/lib/vedeu/models/all.rb +6 -3
- data/lib/vedeu/models/char.rb +157 -0
- data/lib/vedeu/models/{view/composition.rb → composition.rb} +1 -4
- data/lib/vedeu/models/geometry.rb +36 -12
- data/lib/vedeu/models/group.rb +7 -3
- data/lib/vedeu/models/{view/interface.rb → interface.rb} +26 -10
- data/lib/vedeu/models/{view/line.rb → line.rb} +8 -4
- data/lib/vedeu/models/menu.rb +11 -3
- data/lib/vedeu/models/{view/stream.rb → stream.rb} +9 -4
- data/lib/vedeu/output/all.rb +3 -2
- data/lib/vedeu/output/background.rb +2 -2
- data/lib/vedeu/output/border.rb +65 -22
- data/lib/vedeu/output/char_builder.rb +36 -0
- data/lib/vedeu/output/clear.rb +62 -0
- data/lib/vedeu/output/colour.rb +15 -7
- data/lib/vedeu/output/compositor.rb +3 -1
- data/lib/vedeu/output/esc.rb +2 -2
- data/lib/vedeu/output/foreground.rb +2 -2
- data/lib/vedeu/output/html_char.rb +2 -0
- data/lib/vedeu/output/html_renderer.rb +6 -3
- data/lib/vedeu/output/output.rb +20 -92
- data/lib/vedeu/output/presentation.rb +21 -21
- data/lib/vedeu/output/renderer.rb +2 -0
- data/lib/vedeu/output/style.rb +4 -2
- data/lib/vedeu/output/text.rb +7 -1
- data/lib/vedeu/output/translator.rb +4 -2
- data/lib/vedeu/output/viewport.rb +4 -2
- data/lib/vedeu/output/virtual_buffer.rb +11 -1
- data/lib/vedeu/output/virtual_terminal.rb +34 -11
- data/lib/vedeu/output/wordwrap.rb +31 -20
- data/lib/vedeu/repositories/all.rb +3 -0
- data/lib/vedeu/repositories/collection.rb +83 -0
- data/lib/vedeu/repositories/collections.rb +35 -0
- data/lib/vedeu/{models → repositories}/model.rb +2 -0
- data/lib/vedeu/repositories/repository.rb +7 -1
- data/lib/vedeu/support/log.rb +1 -1
- data/lib/vedeu/support/sentence.rb +7 -1
- data/lib/vedeu/support/template.rb +14 -2
- data/lib/vedeu/support/terminal.rb +6 -6
- data/lib/vedeu/support/trace.rb +4 -4
- data/lib/vedeu/support/visible.rb +4 -4
- data/test/lib/vedeu/dsl/composition_test.rb +23 -0
- data/test/lib/vedeu/geometry/index_position_test.rb +121 -0
- data/test/lib/vedeu/{output → geometry}/position_index_test.rb +6 -0
- data/test/lib/vedeu/input/keymap_test.rb +2 -2
- data/test/lib/vedeu/models/{view/char_test.rb → char_test.rb} +31 -15
- data/test/lib/vedeu/models/{view/composition_test.rb → composition_test.rb} +0 -0
- data/test/lib/vedeu/models/{view/interface_test.rb → interface_test.rb} +0 -0
- data/test/lib/vedeu/models/line_test.rb +156 -0
- data/test/lib/vedeu/models/{view/stream_test.rb → stream_test.rb} +1 -16
- data/test/lib/vedeu/output/char_builder_test.rb +50 -0
- data/test/lib/vedeu/output/clear_test.rb +26 -0
- data/test/lib/vedeu/output/compositor_test.rb +0 -10
- data/test/lib/vedeu/output/html_renderer_test.rb +8 -3
- data/test/lib/vedeu/output/output_test.rb +0 -39
- data/test/lib/vedeu/output/viewport_test.rb +10 -66
- data/test/lib/vedeu/output/virtual_buffer_test.rb +18 -2
- data/test/lib/vedeu/output/virtual_terminal_test.rb +3 -14
- data/test/lib/vedeu/output/wordwrap_test.rb +8 -15
- data/test/lib/vedeu/repositories/collection_test.rb +108 -0
- data/test/lib/vedeu/repositories/collections_test.rb +71 -0
- data/test/lib/vedeu/{models → repositories}/model_test.rb +0 -0
- data/test/lib/vedeu/support/template_test.rb +21 -1
- data/test/support/helpers/model_test_class.rb +1 -1
- data/test/test_helper.rb +0 -1
- data/vedeu.gemspec +1 -1
- metadata +40 -44
- data/lib/vedeu/events/events.rb +0 -10
- data/lib/vedeu/input/keys.rb +0 -10
- data/lib/vedeu/models/collection.rb +0 -81
- data/lib/vedeu/models/view/all.rb +0 -12
- data/lib/vedeu/models/view/char.rb +0 -99
- data/lib/vedeu/models/view/chars.rb +0 -10
- data/lib/vedeu/models/view/interfaces.rb +0 -10
- data/lib/vedeu/models/view/lines.rb +0 -10
- data/lib/vedeu/models/view/streams.rb +0 -10
- data/lib/vedeu/output/index_position.rb +0 -35
- data/test/lib/vedeu/models/collection_test.rb +0 -112
- data/test/lib/vedeu/models/view/chars_test.rb +0 -16
- data/test/lib/vedeu/models/view/interfaces_test.rb +0 -16
- data/test/lib/vedeu/models/view/line_test.rb +0 -214
- data/test/lib/vedeu/models/view/lines_test.rb +0 -16
- data/test/lib/vedeu/models/view/streams_test.rb +0 -16
- data/test/lib/vedeu/output/index_position_test.rb +0 -64
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'vedeu/models/
|
1
|
+
require 'vedeu/models/interface'
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
@@ -38,7 +38,7 @@ module Vedeu
|
|
38
38
|
# ...
|
39
39
|
#
|
40
40
|
# @raise [InvalidSyntax] The required block was not given.
|
41
|
-
# @return [Vedeu::
|
41
|
+
# @return [Vedeu::Interfaces<Vedeu::Interface>]
|
42
42
|
def view(name = '', &block)
|
43
43
|
fail InvalidSyntax, 'block not given' unless block_given?
|
44
44
|
|
@@ -47,11 +47,40 @@ module Vedeu
|
|
47
47
|
model.add(new_model)
|
48
48
|
end
|
49
49
|
|
50
|
+
# Load content from an ERb template.
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
# Vedeu.renders do
|
54
|
+
# template_for('my_interface',
|
55
|
+
# '/path/to/template.erb',
|
56
|
+
# @some_object, options)
|
57
|
+
#
|
58
|
+
# @todo More documentation required.
|
59
|
+
#
|
60
|
+
# @param name [String] The name of interface for which this template's
|
61
|
+
# content belongs to.
|
62
|
+
# @param filename [String] The filename (including path) to the template
|
63
|
+
# to be used.
|
64
|
+
# @param object [Object] The object for which the values of template's
|
65
|
+
# variables can be obtained.
|
66
|
+
# @param options [Hash] See {Vedeu::Wordwrap}
|
67
|
+
# @return [Vedeu::Interfaces<Vedeu::Interface>]
|
68
|
+
def template_for(name, filename, object = nil, options = {})
|
69
|
+
content = Vedeu::Template.parse(object, filename)
|
70
|
+
lines = Vedeu::Wordwrap.for(content, options)
|
71
|
+
|
72
|
+
new_model = model.member.build(new_attributes(name).merge!({ lines: lines }))
|
73
|
+
|
74
|
+
model.add(new_model)
|
75
|
+
end
|
76
|
+
|
50
77
|
private
|
51
78
|
|
79
|
+
# @!attribute [r] client
|
52
80
|
# @return [Object]
|
53
81
|
attr_reader :client
|
54
82
|
|
83
|
+
# @!attribute [r] model
|
55
84
|
# @return [Composition]
|
56
85
|
attr_reader :model
|
57
86
|
|
data/lib/vedeu/dsl/group.rb
CHANGED
data/lib/vedeu/dsl/interface.rb
CHANGED
@@ -2,7 +2,7 @@ require 'vedeu/cursor/cursor'
|
|
2
2
|
require 'vedeu/models/focus'
|
3
3
|
require 'vedeu/models/geometry'
|
4
4
|
require 'vedeu/models/group'
|
5
|
-
require 'vedeu/models/
|
5
|
+
require 'vedeu/models/line'
|
6
6
|
require 'vedeu/output/border'
|
7
7
|
require 'vedeu/support/common'
|
8
8
|
|
@@ -209,9 +209,11 @@ module Vedeu
|
|
209
209
|
|
210
210
|
private
|
211
211
|
|
212
|
+
# @!attribute [r] client
|
212
213
|
# @return [Object]
|
213
214
|
attr_reader :client
|
214
215
|
|
216
|
+
# @!attribute [r] model
|
215
217
|
# @return [Interface]
|
216
218
|
attr_reader :model
|
217
219
|
|
data/lib/vedeu/dsl/line.rb
CHANGED
data/lib/vedeu/dsl/stream.rb
CHANGED
data/lib/vedeu/dsl/view.rb
CHANGED
data/lib/vedeu/events/all.rb
CHANGED
data/lib/vedeu/events/event.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
require 'vedeu/
|
2
|
-
require 'vedeu/repositories/repository'
|
1
|
+
require 'vedeu/repositories/all'
|
3
2
|
require 'vedeu/events/trigger'
|
4
3
|
|
5
4
|
module Vedeu
|
@@ -82,7 +81,7 @@ module Vedeu
|
|
82
81
|
#
|
83
82
|
# @return [TrueClass]
|
84
83
|
def bind(name, options = {}, &block)
|
85
|
-
Vedeu.log(type: :event, message: "Binding: '#{name}'")
|
84
|
+
Vedeu.log(type: :event, message: "Binding: '#{name.inspect}'")
|
86
85
|
|
87
86
|
new(name, options, block).bind
|
88
87
|
end
|
@@ -96,7 +95,7 @@ module Vedeu
|
|
96
95
|
def unbind(name)
|
97
96
|
return false unless Vedeu.events.registered?(name)
|
98
97
|
|
99
|
-
Vedeu.log(type: :event, message: "Unbinding: '#{name}")
|
98
|
+
Vedeu.log(type: :event, message: "Unbinding: '#{name.inspect}'")
|
100
99
|
|
101
100
|
Vedeu.events.remove(name)
|
102
101
|
true
|
@@ -156,12 +155,29 @@ module Vedeu
|
|
156
155
|
|
157
156
|
private
|
158
157
|
|
159
|
-
|
160
|
-
|
158
|
+
# @!attribute [r] closure
|
159
|
+
# @return [String]
|
160
|
+
attr_reader :closure
|
161
|
+
|
162
|
+
# @!attribute [r] name
|
163
|
+
# @return [String]
|
164
|
+
attr_reader :name
|
165
|
+
|
166
|
+
# @!attribute [rw] deadline
|
167
|
+
# @return [String]
|
168
|
+
attr_accessor :deadline
|
169
|
+
|
170
|
+
# @!attribute [rw] executed_at
|
171
|
+
# @return [String]
|
172
|
+
attr_accessor :executed_at
|
173
|
+
|
174
|
+
# @!attribute [rw] now
|
175
|
+
# @return [String]
|
176
|
+
attr_accessor :now
|
161
177
|
|
162
178
|
# Execute the code stored in the event closure.
|
163
179
|
#
|
164
|
-
# @param args []
|
180
|
+
# @param args [void]
|
165
181
|
# @return [void]
|
166
182
|
def execute(*args)
|
167
183
|
reset_deadline
|
@@ -170,7 +186,7 @@ module Vedeu
|
|
170
186
|
|
171
187
|
reset_time
|
172
188
|
|
173
|
-
Vedeu.log(type: :event, message: "Triggering: '#{name}'")
|
189
|
+
Vedeu.log(type: :event, message: "Triggering: '#{name.inspect}'")
|
174
190
|
|
175
191
|
closure.call(*args)
|
176
192
|
end
|
@@ -192,7 +208,7 @@ module Vedeu
|
|
192
208
|
def throttle_expired?
|
193
209
|
return true if elapsed_time > delay
|
194
210
|
|
195
|
-
Vedeu.log(type: :event, message: "Throttling: '#{name}'")
|
211
|
+
Vedeu.log(type: :event, message: "Throttling: '#{name.inspect}'")
|
196
212
|
|
197
213
|
false
|
198
214
|
end
|
@@ -216,7 +232,7 @@ module Vedeu
|
|
216
232
|
def debounce_expired?
|
217
233
|
return true if set_executed > deadline
|
218
234
|
|
219
|
-
Vedeu.log(type: :event, message: "Debouncing: '#{name}'")
|
235
|
+
Vedeu.log(type: :event, message: "Debouncing: '#{name.inspect}'")
|
220
236
|
|
221
237
|
false
|
222
238
|
end
|
data/lib/vedeu/events/trigger.rb
CHANGED
@@ -40,9 +40,17 @@ module Vedeu
|
|
40
40
|
|
41
41
|
private
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
# @!attribute [r] name
|
44
|
+
# @return [Symbol]
|
45
|
+
attr_reader :name
|
46
|
+
|
47
|
+
# @!attribute [r] args
|
48
|
+
# @return [Array]
|
49
|
+
attr_reader :args
|
50
|
+
|
51
|
+
# @!attribute [r]
|
52
|
+
# @return [Vedeu::Repository]
|
53
|
+
attr_reader :repository
|
46
54
|
|
47
55
|
# @return [Array<void>|void]
|
48
56
|
def results
|
data/lib/vedeu/geometry/all.rb
CHANGED
@@ -2,7 +2,9 @@ require 'vedeu/geometry/bounding_area'
|
|
2
2
|
require 'vedeu/geometry/content_geometry'
|
3
3
|
require 'vedeu/geometry/coordinate'
|
4
4
|
require 'vedeu/geometry/grid'
|
5
|
+
require 'vedeu/geometry/index_position'
|
5
6
|
require 'vedeu/geometry/limit'
|
7
|
+
require 'vedeu/geometry/position_index'
|
6
8
|
require 'vedeu/geometry/position'
|
7
9
|
require 'vedeu/geometry/position_validator'
|
8
10
|
|
@@ -5,8 +5,13 @@ module Vedeu
|
|
5
5
|
#
|
6
6
|
class BoundingArea
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
# @!attribute [r] height
|
9
|
+
# @return [Fixnum]
|
10
|
+
attr_reader :height
|
11
|
+
|
12
|
+
# @!attribute [r] width
|
13
|
+
# @return [Fixnum]
|
14
|
+
attr_reader :width
|
10
15
|
|
11
16
|
# Returns an instance of BoundingArea.
|
12
17
|
#
|
@@ -4,10 +4,21 @@ module Vedeu
|
|
4
4
|
#
|
5
5
|
class Coordinate
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
# @!attribute [r] height
|
8
|
+
# @return [Fixnum]
|
9
|
+
attr_reader :height
|
10
|
+
|
11
|
+
# @!attribute [r] width
|
12
|
+
# @return [Fixnum]
|
13
|
+
attr_reader :width
|
14
|
+
|
15
|
+
# @!attribute [r] x
|
16
|
+
# @return [Fixnum]
|
17
|
+
attr_reader :x
|
18
|
+
|
19
|
+
# @!attribute [r] y
|
20
|
+
# @return [Fixnum]
|
21
|
+
attr_reader :y
|
11
22
|
|
12
23
|
# @param height [Fixnum]
|
13
24
|
# @param width [Fixnum]
|
@@ -157,8 +168,6 @@ module Vedeu
|
|
157
168
|
|
158
169
|
private
|
159
170
|
|
160
|
-
attr_reader :height, :width
|
161
|
-
|
162
171
|
# Returns the maximum y index for an area.
|
163
172
|
#
|
164
173
|
# @example
|
data/lib/vedeu/geometry/grid.rb
CHANGED
@@ -50,6 +50,8 @@ module Vedeu
|
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
|
+
# @!attribute [r] value
|
54
|
+
# @return [Fixnum]
|
53
55
|
attr_reader :value
|
54
56
|
|
55
57
|
# Returns the width of a single column in characters.
|
@@ -61,7 +63,7 @@ module Vedeu
|
|
61
63
|
|
62
64
|
# @return [Fixnum]
|
63
65
|
def actual
|
64
|
-
Terminal.width
|
66
|
+
Vedeu::Terminal.width
|
65
67
|
end
|
66
68
|
|
67
69
|
# @return [Boolean]
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
# Converts an index into a position for the terminal.
|
4
|
+
#
|
5
|
+
# When the optional offset `oy` and `ox` params are given, the they are used
|
6
|
+
# for the starting position.
|
7
|
+
#
|
8
|
+
class IndexPosition
|
9
|
+
|
10
|
+
# @param iy [Fixnum]
|
11
|
+
# @param ix [Fixnum]
|
12
|
+
# @param oy [Fixnum]
|
13
|
+
# @param ox [Fixnum]
|
14
|
+
# @return [Array]
|
15
|
+
def self.[](iy, ix, oy = 1, ox = 1)
|
16
|
+
new(iy, ix, oy, ox).[]
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param iy [Fixnum]
|
20
|
+
# @param ix [Fixnum]
|
21
|
+
# @param oy [Fixnum]
|
22
|
+
# @param ox [Fixnum]
|
23
|
+
# @return [Vedeu::IndexPosition]
|
24
|
+
def initialize(iy, ix, oy = 1, ox = 1)
|
25
|
+
@iy = iy
|
26
|
+
@ix = ix
|
27
|
+
@oy = oy
|
28
|
+
@ox = ox
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [Array]
|
32
|
+
def []
|
33
|
+
[y, x]
|
34
|
+
end
|
35
|
+
|
36
|
+
# @return [Vedeu::Position]
|
37
|
+
def to_position
|
38
|
+
Vedeu::Position.new(y, x)
|
39
|
+
end
|
40
|
+
|
41
|
+
# @return [Fixnum]
|
42
|
+
def y
|
43
|
+
(iy <= 0) ? oy : (iy + oy)
|
44
|
+
end
|
45
|
+
alias_method :first, :y
|
46
|
+
|
47
|
+
# @return [Fixnum]
|
48
|
+
def x
|
49
|
+
(ix <= 0) ? ox : (ix + ox)
|
50
|
+
end
|
51
|
+
alias_method :last, :x
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
# @return [Fixnum]
|
56
|
+
def iy
|
57
|
+
@_iy ||= (@iy <= 0) ? 0 : @iy
|
58
|
+
end
|
59
|
+
|
60
|
+
# @return [Fixnum]
|
61
|
+
def ix
|
62
|
+
@_ix ||= (@ix <= 0) ? 0 : @ix
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [Fixnum]
|
66
|
+
def oy
|
67
|
+
@_oy ||= (@oy <= 1) ? 1 : @oy
|
68
|
+
end
|
69
|
+
|
70
|
+
# @return [Fixnum]
|
71
|
+
def ox
|
72
|
+
@_ox ||= (@ox <= 1) ? 1 : @ox
|
73
|
+
end
|
74
|
+
|
75
|
+
end # IndexPosition
|
76
|
+
|
77
|
+
end # Vedeu
|
data/lib/vedeu/geometry/limit.rb
CHANGED
@@ -35,7 +35,21 @@ module Vedeu
|
|
35
35
|
|
36
36
|
private
|
37
37
|
|
38
|
-
|
38
|
+
# @!attribute [r] v
|
39
|
+
# @return [Fixnum]
|
40
|
+
attr_reader :v
|
41
|
+
|
42
|
+
# @!attribute [r] vn
|
43
|
+
# @return [Fixnum]
|
44
|
+
attr_reader :vn
|
45
|
+
|
46
|
+
# @!attribute [r] min
|
47
|
+
# @return [Fixnum]
|
48
|
+
attr_reader :min
|
49
|
+
|
50
|
+
# @!attribute [r] max
|
51
|
+
# @return [Fixnum]
|
52
|
+
attr_reader :max
|
39
53
|
|
40
54
|
end # Limit
|
41
55
|
|
@@ -4,8 +4,13 @@ module Vedeu
|
|
4
4
|
#
|
5
5
|
class PositionIndex
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
# @!attribute [r] y
|
8
|
+
# @return [Fixnum]
|
9
|
+
attr_reader :y
|
10
|
+
|
11
|
+
# @!attribute [r] x
|
12
|
+
# @return [Fixnum]
|
13
|
+
attr_reader :x
|
9
14
|
|
10
15
|
alias_method :first, :y
|
11
16
|
alias_method :last, :x
|
@@ -30,6 +35,11 @@ module Vedeu
|
|
30
35
|
[y, x]
|
31
36
|
end
|
32
37
|
|
38
|
+
# @return [Vedeu::Position]
|
39
|
+
def to_position
|
40
|
+
Vedeu::Position.new(y, x)
|
41
|
+
end
|
42
|
+
|
33
43
|
end # PositionIndex
|
34
44
|
|
35
45
|
end # Vedeu
|
@@ -32,7 +32,13 @@ module Vedeu
|
|
32
32
|
:top,
|
33
33
|
:bottom
|
34
34
|
|
35
|
-
|
35
|
+
# @!attribute [rw] x
|
36
|
+
# @return [Fixnum]
|
37
|
+
attr_accessor :x
|
38
|
+
|
39
|
+
# @!attribute [rw] x
|
40
|
+
# @return [Fixnum]
|
41
|
+
attr_accessor :y
|
36
42
|
|
37
43
|
# @param interface [Interface]
|
38
44
|
# @param x [Fixnum]
|
@@ -63,6 +69,8 @@ module Vedeu
|
|
63
69
|
|
64
70
|
private
|
65
71
|
|
72
|
+
# @!attribute [r] interface
|
73
|
+
# @return [Vedeu::Interface]
|
66
74
|
attr_reader :interface
|
67
75
|
|
68
76
|
# Validate the x and y coordinates are within the dimensions of the
|
data/lib/vedeu/input/all.rb
CHANGED
data/lib/vedeu/input/input.rb
CHANGED
data/lib/vedeu/input/keymap.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'vedeu/exceptions'
|
2
|
-
require 'vedeu/
|
2
|
+
require 'vedeu/repositories/all'
|
3
3
|
require 'vedeu/dsl/components/all'
|
4
|
+
require 'vedeu/input/key'
|
4
5
|
|
5
6
|
module Vedeu
|
6
7
|
|
@@ -13,12 +14,13 @@ module Vedeu
|
|
13
14
|
collection Vedeu::Keys
|
14
15
|
member Vedeu::Key
|
15
16
|
|
17
|
+
# @!attribute [rw] name
|
18
|
+
# @return [String]
|
16
19
|
attr_accessor :name
|
17
20
|
|
18
21
|
# @param attributes [Hash]
|
19
22
|
# @option attributes name [String] The name of the keymap.
|
20
|
-
# @option attributes keys [Vedeu::
|
21
|
-
# keys.
|
23
|
+
# @option attributes keys [Vedeu::Keys|Array] A collection of keys.
|
22
24
|
# @option attributes repository [Vedeu::Repository] This model's storage.
|
23
25
|
# @return [Vedeu::Keymap]
|
24
26
|
def initialize(attributes = {})
|
data/lib/vedeu/input/mapper.rb
CHANGED
@@ -63,7 +63,13 @@ module Vedeu
|
|
63
63
|
|
64
64
|
private
|
65
65
|
|
66
|
-
|
66
|
+
# @!attribute [r] key
|
67
|
+
# @return [String|Symbol]
|
68
|
+
attr_reader :key
|
69
|
+
|
70
|
+
# @!attribute [r] repository
|
71
|
+
# @return [Vedeu::Repository]
|
72
|
+
attr_reader :repository
|
67
73
|
|
68
74
|
# Is the key a global key?
|
69
75
|
#
|
data/lib/vedeu/launcher.rb
CHANGED
data/lib/vedeu/models/all.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
-
require 'vedeu/
|
1
|
+
require 'vedeu/repositories/all'
|
2
2
|
|
3
|
-
require 'vedeu/models/
|
3
|
+
require 'vedeu/models/char'
|
4
|
+
require 'vedeu/models/stream'
|
5
|
+
require 'vedeu/models/line'
|
6
|
+
require 'vedeu/models/interface'
|
7
|
+
require 'vedeu/models/composition'
|
4
8
|
|
5
9
|
require 'vedeu/models/focus'
|
6
10
|
require 'vedeu/models/geometry'
|
7
11
|
require 'vedeu/models/group'
|
8
12
|
require 'vedeu/models/menu'
|
9
|
-
require 'vedeu/models/model'
|
10
13
|
|
11
14
|
module Vedeu
|
12
15
|
end # Vedeu
|