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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d8e95a7608c18620329eb247fd9dc9049609b03
|
4
|
+
data.tar.gz: 17184d93c7f354a0a8fda4669f49a9a118d4a8da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4a866ae01faf6cff714482e53b58bc142efc775b6ce71dd50948a0dfe730cece1a066113e0ed1c146515239a5c73c9ba440cc65696cb42d54a79e13b6637dfd
|
7
|
+
data.tar.gz: 63369ed9af5b248f7137eb478ba82de72620dde0612b6bbd13231caa4cec28191534eb74c5d23f4a973fc2080c4fc0c34a68dc0cecfa0047460feb5e2b777f27
|
data/bin/vedeu
CHANGED
@@ -3,9 +3,6 @@
|
|
3
3
|
lib_dir = File.dirname(__FILE__) + '/../lib'
|
4
4
|
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
5
5
|
|
6
|
-
-> { its -> { a } }
|
7
|
-
trap('INT') { exit! }
|
8
|
-
|
9
6
|
puts ''
|
10
7
|
puts 'Vedeu is a Ruby gem. This executable serves for a future in which ' \
|
11
8
|
'Vedeu can generate a starting point for your terminal-based GUI ' \
|
data/examples/borders_app.rb
CHANGED
data/examples/colours_app.rb
CHANGED
data/examples/cursor_app.rb
CHANGED
data/examples/focus_app.rb
CHANGED
data/examples/geometry_app.rb
CHANGED
data/examples/lines_app.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
Here's a simple example that will be displayed in the main interface of the application.
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
lib_dir = File.dirname(__FILE__) + '/../../lib'
|
4
|
+
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
5
|
+
|
6
|
+
require 'vedeu'
|
7
|
+
|
8
|
+
class VedeuViewTemplateApp
|
9
|
+
include Vedeu
|
10
|
+
|
11
|
+
configure do
|
12
|
+
colour_mode 16777216
|
13
|
+
debug!
|
14
|
+
log '/tmp/vedeu_view_templates_app.log'
|
15
|
+
end
|
16
|
+
|
17
|
+
bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
|
18
|
+
|
19
|
+
interface 'default' do
|
20
|
+
colour foreground: '#ff0000', background: '#000000'
|
21
|
+
cursor!
|
22
|
+
end
|
23
|
+
|
24
|
+
interface 'prune' do
|
25
|
+
colour foreground: '#00ff00', background: '#000000'
|
26
|
+
cursor!
|
27
|
+
end
|
28
|
+
|
29
|
+
interface 'wrap' do
|
30
|
+
colour foreground: '#0000ff', background: '#000000'
|
31
|
+
cursor!
|
32
|
+
end
|
33
|
+
|
34
|
+
keymap('_global_') do
|
35
|
+
key(:up, 'k') { Vedeu.trigger(:_cursor_up_) }
|
36
|
+
key(:right, 'l') { Vedeu.trigger(:_cursor_right_) }
|
37
|
+
key(:down, 'j') { Vedeu.trigger(:_cursor_down_) }
|
38
|
+
key(:left, 'h') { Vedeu.trigger(:_cursor_left_) }
|
39
|
+
end
|
40
|
+
|
41
|
+
border('default') do
|
42
|
+
colour foreground: '#aadd00', background: '#000000'
|
43
|
+
end
|
44
|
+
border('prune') do
|
45
|
+
colour foreground: '#aadd00', background: '#000000'
|
46
|
+
end
|
47
|
+
border('wrap') do
|
48
|
+
colour foreground: '#aadd00', background: '#000000'
|
49
|
+
end
|
50
|
+
|
51
|
+
geometry('prune') do
|
52
|
+
centred!
|
53
|
+
height 6
|
54
|
+
width 25
|
55
|
+
end
|
56
|
+
|
57
|
+
geometry 'default' do
|
58
|
+
height 6
|
59
|
+
width 25
|
60
|
+
x Vedeu.use('prune').left
|
61
|
+
y Vedeu.use('prune').north(7)
|
62
|
+
end
|
63
|
+
|
64
|
+
geometry 'wrap' do
|
65
|
+
height 6
|
66
|
+
width 25
|
67
|
+
x Vedeu.use('prune').left
|
68
|
+
y Vedeu.use('prune').south(1)
|
69
|
+
end
|
70
|
+
|
71
|
+
renders do
|
72
|
+
template_for('default', (File.dirname(__FILE__) + '/template.erb'), nil)
|
73
|
+
template_for('prune', (File.dirname(__FILE__) + '/template.erb'), nil, { mode: :prune, width: 22 })
|
74
|
+
template_for('wrap', (File.dirname(__FILE__) + '/template.erb'), nil, { mode: :wrap, width: 25 })
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.start(argv = ARGV)
|
78
|
+
Vedeu::Launcher.execute!(argv)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
VedeuViewTemplateApp.start(ARGV)
|
data/lib/vedeu/all.rb
CHANGED
data/lib/vedeu/application.rb
CHANGED
@@ -51,8 +51,8 @@ module Vedeu
|
|
51
51
|
def start
|
52
52
|
Vedeu.trigger(:_drb_start_)
|
53
53
|
|
54
|
-
output = Terminal.open do
|
55
|
-
Terminal.set_cursor_mode
|
54
|
+
output = Vedeu::Terminal.open do
|
55
|
+
Vedeu::Terminal.set_cursor_mode
|
56
56
|
|
57
57
|
Vedeu.trigger(:_initialize_)
|
58
58
|
|
@@ -66,6 +66,7 @@ module Vedeu
|
|
66
66
|
|
67
67
|
private
|
68
68
|
|
69
|
+
# @!attribute [r] configuration
|
69
70
|
# @return [Configuration]
|
70
71
|
attr_reader :configuration
|
71
72
|
|
@@ -93,7 +94,7 @@ module Vedeu
|
|
93
94
|
# @return [void]
|
94
95
|
def main_sequence
|
95
96
|
if configuration.interactive?
|
96
|
-
Input.capture(Terminal)
|
97
|
+
Vedeu::Input.capture(Terminal)
|
97
98
|
|
98
99
|
else
|
99
100
|
Vedeu.trigger(:_standalone_)
|
@@ -107,14 +108,14 @@ module Vedeu
|
|
107
108
|
#
|
108
109
|
# @return [void]
|
109
110
|
def run_many
|
110
|
-
MainLoop.start! { yield }
|
111
|
+
Vedeu::MainLoop.start! { yield }
|
111
112
|
|
112
113
|
rescue ModeSwitch
|
113
|
-
Terminal.switch_mode!
|
114
|
+
Vedeu::Terminal.switch_mode!
|
114
115
|
|
115
116
|
Vedeu.trigger(:_drb_restart_)
|
116
117
|
|
117
|
-
Application.restart(configuration)
|
118
|
+
Vedeu::Application.restart(configuration)
|
118
119
|
|
119
120
|
end
|
120
121
|
|
data/lib/vedeu/bindings.rb
CHANGED
@@ -80,30 +80,30 @@ module Vedeu
|
|
80
80
|
Vedeu.bind(:_cursor_hide_) do |name|
|
81
81
|
named = name ? Vedeu.cursors.by_name(name) : Vedeu.cursor
|
82
82
|
|
83
|
-
ToggleCursor.hide(named)
|
83
|
+
Vedeu::ToggleCursor.hide(named)
|
84
84
|
end
|
85
85
|
|
86
86
|
# Show the cursor of the named interface or interface currently in focus.
|
87
87
|
Vedeu.bind(:_cursor_show_) do |name|
|
88
88
|
named = name ? Vedeu.cursors.by_name(name) : Vedeu.cursor
|
89
89
|
|
90
|
-
ToggleCursor.show(named)
|
90
|
+
Vedeu::ToggleCursor.show(named)
|
91
91
|
end
|
92
92
|
|
93
93
|
# @see {Vedeu::MoveCursor}
|
94
|
-
Vedeu.bind(:_cursor_down_) { |name| MoveCursor.by_name(:down, name) }
|
94
|
+
Vedeu.bind(:_cursor_down_) { |name| Vedeu::MoveCursor.by_name(:down, name) }
|
95
95
|
|
96
96
|
# @see {Vedeu::MoveCursor}
|
97
|
-
Vedeu.bind(:_cursor_left_) { |name| MoveCursor.by_name(:left, name) }
|
97
|
+
Vedeu.bind(:_cursor_left_) { |name| Vedeu::MoveCursor.by_name(:left, name) }
|
98
98
|
|
99
99
|
# @see {Vedeu::MoveCursor}
|
100
|
-
Vedeu.bind(:_cursor_right_) { |name| MoveCursor.by_name(:right, name) }
|
100
|
+
Vedeu.bind(:_cursor_right_) { |name| Vedeu::MoveCursor.by_name(:right, name) }
|
101
101
|
|
102
102
|
# @see {Vedeu::MoveCursor}
|
103
|
-
Vedeu.bind(:_cursor_up_) { |name| MoveCursor.by_name(:up, name) }
|
103
|
+
Vedeu.bind(:_cursor_up_) { |name| Vedeu::MoveCursor.by_name(:up, name) }
|
104
104
|
|
105
105
|
# @see {Vedeu::MoveCursor}
|
106
|
-
Vedeu.bind(:_cursor_origin_) { |name| MoveCursor.by_name(:origin, name) }
|
106
|
+
Vedeu.bind(:_cursor_origin_) { |name| Vedeu::MoveCursor.by_name(:origin, name) }
|
107
107
|
|
108
108
|
# @see {Vedeu::MoveCursor}
|
109
109
|
Vedeu.bind(:_cursor_reset_) { |name| Vedeu.trigger(:_cursor_origin_, name) }
|
@@ -161,7 +161,7 @@ module Vedeu
|
|
161
161
|
# if given.
|
162
162
|
Vedeu.bind(:_clear_) do |name|
|
163
163
|
if name && Vedeu.interfaces.registered?(name)
|
164
|
-
Vedeu::
|
164
|
+
Vedeu::Clear.clear(Vedeu.interfaces.find(name))
|
165
165
|
|
166
166
|
else
|
167
167
|
Vedeu::Terminal.virtual.clear if Vedeu::Configuration.drb?
|
data/lib/vedeu/buffers/buffer.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'vedeu/
|
1
|
+
require 'vedeu/repositories/model'
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
@@ -16,10 +16,20 @@ module Vedeu
|
|
16
16
|
|
17
17
|
include Vedeu::Model
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
# @!attribute [rw] back
|
20
|
+
# @return [Interface]
|
21
|
+
attr_accessor :back
|
22
22
|
|
23
|
+
# @!attribute [rw] front
|
24
|
+
# @return [Interface]
|
25
|
+
attr_accessor :front
|
26
|
+
|
27
|
+
# @!attribute [rw] previous
|
28
|
+
# @return [Interface]
|
29
|
+
attr_accessor :previous
|
30
|
+
|
31
|
+
# @!attribute [r] name
|
32
|
+
# @return [String]
|
23
33
|
attr_reader :name
|
24
34
|
|
25
35
|
# Return a new instance of Buffer.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'vedeu/repositories/
|
1
|
+
require 'vedeu/repositories/all'
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
@@ -48,7 +48,7 @@ module Vedeu
|
|
48
48
|
Vedeu.buffers.find(name).add(self)
|
49
49
|
|
50
50
|
else
|
51
|
-
Buffer.new(name, self).store
|
51
|
+
Vedeu::Buffer.new(name, self).store
|
52
52
|
|
53
53
|
end
|
54
54
|
|
@@ -124,7 +124,13 @@ module Vedeu
|
|
124
124
|
|
125
125
|
private
|
126
126
|
|
127
|
-
|
127
|
+
# @!attribute [r] args
|
128
|
+
# @return [Array<String>]
|
129
|
+
attr_reader :args
|
130
|
+
|
131
|
+
# @!attribute [r] options
|
132
|
+
# @return [Hash]
|
133
|
+
attr_reader :options
|
128
134
|
|
129
135
|
end # CLI
|
130
136
|
|
@@ -214,6 +214,8 @@ module Vedeu
|
|
214
214
|
|
215
215
|
end # Configuration eigenclass
|
216
216
|
|
217
|
+
# @!attribute [r] options
|
218
|
+
# @return [Hash]
|
217
219
|
attr_reader :options
|
218
220
|
|
219
221
|
# Create a new singleton instance of Configuration.
|
@@ -237,7 +239,7 @@ module Vedeu
|
|
237
239
|
|
238
240
|
@options.merge!(Config::CLI.configure(args)) if args.any?
|
239
241
|
|
240
|
-
Configuration
|
242
|
+
Vedeu::Configuration
|
241
243
|
end
|
242
244
|
|
243
245
|
# Reset the configuration to the default values.
|
@@ -268,7 +270,7 @@ module Vedeu
|
|
268
270
|
stdin: nil,
|
269
271
|
stdout: nil,
|
270
272
|
stderr: nil,
|
271
|
-
system_keys: Configuration.default_system_keys,
|
273
|
+
system_keys: Vedeu::Configuration.default_system_keys,
|
272
274
|
terminal_mode: :raw,
|
273
275
|
trace: false,
|
274
276
|
}
|
data/lib/vedeu/cursor/all.rb
CHANGED
data/lib/vedeu/cursor/cursor.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'vedeu/cursor/all'
|
2
|
-
require 'vedeu/models/model'
|
3
2
|
require 'vedeu/geometry/position'
|
4
3
|
require 'vedeu/support/visible'
|
5
4
|
|
@@ -16,7 +15,33 @@ module Vedeu
|
|
16
15
|
|
17
16
|
include Vedeu::Model
|
18
17
|
|
19
|
-
|
18
|
+
# @!attribute [r] attributes
|
19
|
+
# @return [Hash]
|
20
|
+
attr_reader :attributes
|
21
|
+
|
22
|
+
# @!attribute [r] name
|
23
|
+
# @return [String]
|
24
|
+
attr_reader :name
|
25
|
+
|
26
|
+
# @!attribute [r] ox
|
27
|
+
# @return [Fixnum]
|
28
|
+
attr_reader :ox
|
29
|
+
|
30
|
+
# @!attribute [r] oy
|
31
|
+
# @return [Fixnum]
|
32
|
+
attr_reader :oy
|
33
|
+
|
34
|
+
# @!attribute [r] state
|
35
|
+
# @return [Boolean|Symbol]
|
36
|
+
attr_reader :state
|
37
|
+
|
38
|
+
# @!attribute [r] x
|
39
|
+
# @return [Fixnum]
|
40
|
+
attr_reader :x
|
41
|
+
|
42
|
+
# @!attribute [r] y
|
43
|
+
# @return [Fixnum]
|
44
|
+
attr_reader :y
|
20
45
|
|
21
46
|
# Returns a new instance of Cursor.
|
22
47
|
#
|
@@ -70,6 +95,8 @@ module Vedeu
|
|
70
95
|
|
71
96
|
private
|
72
97
|
|
98
|
+
# @!attribute [r] position
|
99
|
+
# @return [Vedeu::Position]
|
73
100
|
attr_reader :position
|
74
101
|
|
75
102
|
# The default values for a new instance of this class.
|
@@ -74,14 +74,14 @@ module Vedeu
|
|
74
74
|
if name
|
75
75
|
cursor = Vedeu.cursors.by_name(name)
|
76
76
|
interface = Vedeu.interfaces.find(name)
|
77
|
-
new_cursor = MoveCursor.send(direction, cursor, interface)
|
78
|
-
Refresh.by_name(name)
|
77
|
+
new_cursor = Vedeu::MoveCursor.send(direction, cursor, interface)
|
78
|
+
Vedeu::Refresh.by_name(name)
|
79
79
|
|
80
80
|
else
|
81
81
|
cursor = Vedeu.cursor
|
82
82
|
interface = Vedeu.interfaces.current
|
83
|
-
new_cursor = MoveCursor.send(direction, cursor, interface)
|
84
|
-
Refresh.by_focus
|
83
|
+
new_cursor = Vedeu::MoveCursor.send(direction, cursor, interface)
|
84
|
+
Vedeu::Refresh.by_focus
|
85
85
|
|
86
86
|
end
|
87
87
|
new_cursor
|
@@ -140,12 +140,26 @@ module Vedeu
|
|
140
140
|
#
|
141
141
|
# @return [Cursor]
|
142
142
|
def move
|
143
|
-
Cursor.new(cursor.attributes.merge!(moved_attributes)).store
|
143
|
+
Vedeu::Cursor.new(cursor.attributes.merge!(moved_attributes)).store
|
144
144
|
end
|
145
145
|
|
146
146
|
private
|
147
147
|
|
148
|
-
|
148
|
+
# @!attribute [r] cursor
|
149
|
+
# @return [Vedeu::Cursor]
|
150
|
+
attr_reader :cursor
|
151
|
+
|
152
|
+
# @!attribute [r] dx
|
153
|
+
# @return [Fixnum]
|
154
|
+
attr_reader :dx
|
155
|
+
|
156
|
+
# @!attribute [r] dy
|
157
|
+
# @return [Fixnum]
|
158
|
+
attr_reader :dy
|
159
|
+
|
160
|
+
# @!attribute [r] interface
|
161
|
+
# @return [Vedeu::Interface]
|
162
|
+
attr_reader :interface
|
149
163
|
|
150
164
|
# @return [Hash]
|
151
165
|
def moved_attributes
|
@@ -97,7 +97,7 @@ module Vedeu
|
|
97
97
|
|
98
98
|
Vedeu.trigger(:_exit_)
|
99
99
|
|
100
|
-
Terminal.restore_screen
|
100
|
+
Vedeu::Terminal.restore_screen
|
101
101
|
end
|
102
102
|
|
103
103
|
# @return [Vedeu::Distributed::Server]
|
@@ -161,6 +161,8 @@ module Vedeu
|
|
161
161
|
|
162
162
|
private
|
163
163
|
|
164
|
+
# @!attribute [r] configuration
|
165
|
+
# @return [Configuration]
|
164
166
|
attr_reader :configuration
|
165
167
|
|
166
168
|
# @return [Boolean]
|
@@ -44,7 +44,12 @@ module Vedeu
|
|
44
44
|
|
45
45
|
private
|
46
46
|
|
47
|
-
|
47
|
+
# @!attribute [r] application
|
48
|
+
# @return [Vedeu::TestApplication]
|
49
|
+
attr_reader :application
|
50
|
+
|
51
|
+
# @!attribute [rw] pid
|
52
|
+
# @return [Fixnum]
|
48
53
|
attr_accessor :pid
|
49
54
|
|
50
55
|
# @return [String]
|
@@ -16,14 +16,37 @@ module Vedeu
|
|
16
16
|
#
|
17
17
|
class TestApplication
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
# @!attribute [rw] borders
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :borders
|
22
|
+
|
23
|
+
# @!attribute [rw] configuration
|
24
|
+
# @return [String]
|
25
|
+
attr_accessor :configuration
|
26
|
+
|
27
|
+
# @!attribute [rw] events
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :events
|
30
|
+
|
31
|
+
# @!attribute [rw] geometries
|
32
|
+
# @return [String]
|
33
|
+
attr_accessor :geometries
|
34
|
+
|
35
|
+
# @!attribute [rw] interfaces
|
36
|
+
# @return [String]
|
37
|
+
attr_accessor :interfaces
|
38
|
+
|
39
|
+
# @!attribute [rw] keymaps
|
40
|
+
# @return [String]
|
41
|
+
attr_accessor :keymaps
|
42
|
+
|
43
|
+
# @!attribute [rw] menus
|
44
|
+
# @return [String]
|
45
|
+
attr_accessor :menus
|
46
|
+
|
47
|
+
# @!attribute [rw] views
|
48
|
+
# @return [String]
|
49
|
+
attr_accessor :views
|
27
50
|
|
28
51
|
# @param attributes [Hash]
|
29
52
|
# @param block [Proc]
|
@@ -55,7 +78,7 @@ module Vedeu
|
|
55
78
|
def build(&block)
|
56
79
|
self.instance_eval(&block) if block_given?
|
57
80
|
|
58
|
-
Template.parse(self, template)
|
81
|
+
Vedeu::Template.parse(self, template)
|
59
82
|
end
|
60
83
|
|
61
84
|
# @return [String]
|
@@ -7,7 +7,13 @@ module Vedeu
|
|
7
7
|
#
|
8
8
|
class Uri
|
9
9
|
|
10
|
-
|
10
|
+
# @!attribute [r] host
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :host
|
13
|
+
|
14
|
+
# @!attribute [r] port
|
15
|
+
# @return [Fixnum|String]
|
16
|
+
attr_reader :port
|
11
17
|
|
12
18
|
# @param host [String] Hostname or IP address.
|
13
19
|
# @param port [Fixnum|String]
|