vedeu 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/dsl.md +3 -3
- data/examples/borders_app.rb +2 -0
- data/examples/colours_app.rb +2 -0
- data/examples/configuration_app.rb +2 -0
- data/examples/drb_app.rb +2 -0
- data/examples/focus_app.rb +2 -0
- data/examples/hello_world.rb +2 -0
- data/examples/material_colours_app.rb +2 -0
- data/lib/vedeu.rb +2 -0
- data/lib/vedeu/all.rb +4 -13
- data/lib/vedeu/api.rb +7 -6
- data/lib/vedeu/borders/border.rb +1 -1
- data/lib/vedeu/borders/render_border.rb +18 -18
- data/lib/vedeu/buffers/buffer.rb +18 -28
- data/lib/vedeu/colours/colour.rb +1 -1
- data/lib/vedeu/colours/colour_translator.rb +1 -1
- data/lib/vedeu/cursor/cursor.rb +9 -6
- data/lib/vedeu/dsl/border.rb +1 -1
- data/lib/vedeu/dsl/composition.rb +5 -5
- data/lib/vedeu/dsl/geometry.rb +1 -1
- data/lib/vedeu/dsl/group.rb +1 -1
- data/lib/vedeu/dsl/interface.rb +69 -93
- data/lib/vedeu/dsl/keymap.rb +1 -1
- data/lib/vedeu/dsl/line.rb +11 -11
- data/lib/vedeu/dsl/shared.rb +81 -0
- data/lib/vedeu/dsl/stream.rb +3 -3
- data/lib/vedeu/dsl/view.rb +76 -64
- data/lib/vedeu/models/escape.rb +1 -1
- data/lib/vedeu/models/interface.rb +3 -57
- data/lib/vedeu/models/menu.rb +1 -1
- data/lib/vedeu/models/views/all.rb +22 -0
- data/lib/vedeu/models/views/char.rb +175 -0
- data/lib/vedeu/models/views/chars.rb +13 -0
- data/lib/vedeu/models/views/composition.rb +73 -0
- data/lib/vedeu/models/views/line.rb +111 -0
- data/lib/vedeu/models/views/lines.rb +13 -0
- data/lib/vedeu/models/views/stream.rb +122 -0
- data/lib/vedeu/models/views/streams.rb +13 -0
- data/lib/vedeu/models/views/view.rb +157 -0
- data/lib/vedeu/models/views/view_collection.rb +13 -0
- data/lib/vedeu/null/view.rb +67 -0
- data/lib/vedeu/output/clear/named_interface.rb +4 -4
- data/lib/vedeu/output/compressor.rb +6 -6
- data/lib/vedeu/output/html_char.rb +6 -6
- data/lib/vedeu/output/output.rb +3 -3
- data/lib/vedeu/output/presentation.rb +1 -1
- data/lib/vedeu/output/renderers/escape_sequence.rb +1 -1
- data/lib/vedeu/output/renderers/file.rb +1 -1
- data/lib/vedeu/output/renderers/html.rb +3 -3
- data/lib/vedeu/output/renderers/json.rb +4 -4
- data/lib/vedeu/output/renderers/null.rb +1 -1
- data/lib/vedeu/output/renderers/terminal.rb +5 -5
- data/lib/vedeu/output/renderers/text.rb +3 -3
- data/lib/vedeu/output/style.rb +1 -1
- data/lib/vedeu/output/text.rb +20 -15
- data/lib/vedeu/output/viewport.rb +16 -23
- data/lib/vedeu/output/virtual_buffer.rb +9 -8
- data/lib/vedeu/output/virtual_terminal.rb +11 -11
- data/lib/vedeu/output/wordwrap.rb +5 -5
- data/lib/vedeu/runtime/application.rb +1 -1
- data/lib/vedeu/runtime/main_loop.rb +1 -1
- data/lib/vedeu/templating/helpers.rb +11 -10
- data/lib/vedeu/templating/template.rb +1 -1
- data/lib/vedeu/templating/view_template.rb +6 -6
- data/lib/vedeu/version.rb +1 -2
- data/test/lib/vedeu/api_test.rb +30 -30
- data/test/lib/vedeu/buffers/buffer_test.rb +5 -139
- data/test/lib/vedeu/colours/colour_translator_test.rb +3 -3
- data/test/lib/vedeu/configuration/api_test.rb +3 -3
- data/test/lib/vedeu/cursor/refresh_cursor_test.rb +1 -1
- data/test/lib/vedeu/dsl/composition_test.rb +7 -7
- data/test/lib/vedeu/dsl/group_test.rb +2 -2
- data/test/lib/vedeu/dsl/interface_test.rb +31 -21
- data/test/lib/vedeu/dsl/keymap_test.rb +4 -4
- data/test/lib/vedeu/dsl/line_test.rb +8 -8
- data/test/lib/vedeu/dsl/stream_test.rb +4 -4
- data/test/lib/vedeu/dsl/text_test.rb +11 -11
- data/test/lib/vedeu/dsl/view_test.rb +24 -29
- data/test/lib/vedeu/geometry/grid_test.rb +4 -4
- data/test/lib/vedeu/input/key_test.rb +1 -1
- data/test/lib/vedeu/internal_api_test.rb +18 -18
- data/test/lib/vedeu/models/focus_test.rb +54 -54
- data/test/lib/vedeu/models/interface_test.rb +11 -105
- data/test/lib/vedeu/models/menu_test.rb +1 -1
- data/test/lib/vedeu/models/views/char_test.rb +257 -0
- data/test/lib/vedeu/models/views/chars_test.rb +22 -0
- data/test/lib/vedeu/models/views/composition_test.rb +61 -0
- data/test/lib/vedeu/models/views/line_test.rb +189 -0
- data/test/lib/vedeu/models/views/lines_test.rb +22 -0
- data/test/lib/vedeu/models/views/stream_test.rb +138 -0
- data/test/lib/vedeu/models/views/streams_test.rb +22 -0
- data/test/lib/vedeu/models/views/view_test.rb +40 -0
- data/test/lib/vedeu/null/view_test.rb +12 -0
- data/test/lib/vedeu/output/clear/named_interface_test.rb +4 -4
- data/test/lib/vedeu/output/compressor_test.rb +28 -28
- data/test/lib/vedeu/output/html_char_test.rb +2 -2
- data/test/lib/vedeu/output/presentation_test.rb +10 -14
- data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +20 -4
- data/test/lib/vedeu/output/renderers/html_test.rb +4 -4
- data/test/lib/vedeu/output/renderers/json_test.rb +3 -3
- data/test/lib/vedeu/output/text_test.rb +10 -10
- data/test/lib/vedeu/output/viewport_test.rb +21 -23
- data/test/lib/vedeu/output/virtual_buffer_test.rb +1 -1
- data/test/lib/vedeu/output/virtual_terminal_test.rb +1 -1
- data/test/lib/vedeu/output/wordwrap_test.rb +9 -9
- data/test/lib/vedeu/repositories/repository_test.rb +2 -2
- data/test/lib/vedeu/templating/helpers_test.rb +6 -39
- data/test/lib/vedeu/templating/template_test.rb +2 -2
- data/test/lib/vedeu/templating/view_template_test.rb +91 -91
- data/test/lib/vedeu/terminal_test.rb +1 -1
- metadata +33 -27
- data/lib/vedeu/buffers/display_buffer.rb +0 -39
- data/lib/vedeu/models/char.rb +0 -170
- data/lib/vedeu/models/chars.rb +0 -9
- data/lib/vedeu/models/composition.rb +0 -66
- data/lib/vedeu/models/line.rb +0 -112
- data/lib/vedeu/models/lines.rb +0 -9
- data/lib/vedeu/models/stream.rb +0 -122
- data/lib/vedeu/models/streams.rb +0 -9
- data/test/lib/vedeu/buffers/display_buffer_test.rb +0 -61
- data/test/lib/vedeu/models/char_test.rb +0 -253
- data/test/lib/vedeu/models/chars_test.rb +0 -18
- data/test/lib/vedeu/models/composition_test.rb +0 -57
- data/test/lib/vedeu/models/line_test.rb +0 -189
- data/test/lib/vedeu/models/lines_test.rb +0 -18
- data/test/lib/vedeu/models/stream_test.rb +0 -141
- data/test/lib/vedeu/models/streams_test.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b010b9db3a29aed26083a27acd4d7843e0ba8a86
|
4
|
+
data.tar.gz: f5487a4cdfe1bcd1339bdc8f8eedd96f9f96e768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 419e080ddd2be42371edea189cbb56bf8ef02b8ba1b928aaa1a47790e4cf0da4b7ebfc82a09658cf0cc30a5af04b883f68051ad65a34a1f4070345821ca4fe97
|
7
|
+
data.tar.gz: c226c7c8af7ddcaa58f83abbb20372d8578843a4ecb246d932c48e8f80c037ad23302a0d563740b3f23ae03546dbe69518b5f0030ed7c00e983bfd7503e4133a
|
data/docs/dsl.md
CHANGED
@@ -142,15 +142,15 @@ end
|
|
142
142
|
## Views
|
143
143
|
|
144
144
|
{include:Vedeu::DSL::View}
|
145
|
-
{include:Vedeu::DSL::
|
145
|
+
{include:Vedeu::DSL::Interface.interface}
|
146
146
|
|
147
147
|
### Immediate rendering
|
148
148
|
|
149
|
-
{include:Vedeu::DSL::View.
|
149
|
+
{include:Vedeu::DSL::View.renders}
|
150
150
|
|
151
151
|
### Deferred rendering
|
152
152
|
|
153
|
-
{include:Vedeu::DSL::View.
|
153
|
+
{include:Vedeu::DSL::View.views}
|
154
154
|
|
155
155
|
### Specifying view content
|
156
156
|
|
data/examples/borders_app.rb
CHANGED
data/examples/colours_app.rb
CHANGED
data/examples/drb_app.rb
CHANGED
data/examples/focus_app.rb
CHANGED
@@ -20,6 +20,8 @@ require 'vedeu'
|
|
20
20
|
# Use 'space' to change focus, 'q' to exit.
|
21
21
|
class VedeuFocusApp
|
22
22
|
|
23
|
+
Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
|
24
|
+
|
23
25
|
# Be aware that running an application with debugging enabled will affect
|
24
26
|
# performance.
|
25
27
|
Vedeu.configure do
|
data/examples/hello_world.rb
CHANGED
data/lib/vedeu.rb
CHANGED
data/lib/vedeu/all.rb
CHANGED
@@ -38,6 +38,7 @@ require 'vedeu/null/generic'
|
|
38
38
|
require 'vedeu/null/geometry'
|
39
39
|
require 'vedeu/null/interface'
|
40
40
|
require 'vedeu/null/menu'
|
41
|
+
require 'vedeu/null/view'
|
41
42
|
|
42
43
|
require 'vedeu/geometry/area'
|
43
44
|
require 'vedeu/geometry/coordinate'
|
@@ -60,8 +61,6 @@ require 'vedeu/colours/colour'
|
|
60
61
|
require 'vedeu/buffers/buffer'
|
61
62
|
require 'vedeu/buffers/buffers'
|
62
63
|
|
63
|
-
require 'vedeu/buffers/display_buffer'
|
64
|
-
|
65
64
|
require 'vedeu/cursor/cursor'
|
66
65
|
require 'vedeu/cursor/cursors'
|
67
66
|
require 'vedeu/cursor/move'
|
@@ -83,22 +82,13 @@ require 'vedeu/events/trigger'
|
|
83
82
|
require 'vedeu/events/events'
|
84
83
|
require 'vedeu/events/event'
|
85
84
|
|
85
|
+
require 'vedeu/models/views/all'
|
86
|
+
|
86
87
|
require 'vedeu/models/cell'
|
87
|
-
require 'vedeu/models/char'
|
88
|
-
require 'vedeu/models/chars'
|
89
88
|
require 'vedeu/models/escape'
|
90
|
-
require 'vedeu/models/stream'
|
91
|
-
require 'vedeu/models/streams'
|
92
|
-
require 'vedeu/models/lines'
|
93
|
-
require 'vedeu/models/line'
|
94
|
-
require 'vedeu/models/interface'
|
95
|
-
require 'vedeu/models/interfaces'
|
96
|
-
require 'vedeu/models/interface_collection'
|
97
|
-
require 'vedeu/models/composition'
|
98
89
|
require 'vedeu/models/focus'
|
99
90
|
require 'vedeu/models/group'
|
100
91
|
require 'vedeu/models/groups'
|
101
|
-
|
102
92
|
require 'vedeu/models/menu'
|
103
93
|
require 'vedeu/models/menus'
|
104
94
|
|
@@ -130,6 +120,7 @@ require 'vedeu/distributed/subprocess'
|
|
130
120
|
require 'vedeu/distributed/test_application'
|
131
121
|
|
132
122
|
require 'vedeu/dsl'
|
123
|
+
require 'vedeu/dsl/shared'
|
133
124
|
require 'vedeu/dsl/use'
|
134
125
|
require 'vedeu/dsl/presentation'
|
135
126
|
require 'vedeu/dsl/border'
|
data/lib/vedeu/api.rb
CHANGED
@@ -86,22 +86,23 @@ module Vedeu
|
|
86
86
|
|
87
87
|
# @example
|
88
88
|
# Vedeu.interface
|
89
|
+
#
|
90
|
+
# @!method interface
|
91
|
+
# @see Vedeu::DSL::Interface.interface
|
92
|
+
def_delegators Vedeu::DSL::Interface, :interface
|
93
|
+
|
94
|
+
# @example
|
89
95
|
# Vedeu.renders
|
90
96
|
# Vedeu.render
|
91
97
|
# Vedeu.views
|
92
98
|
#
|
93
|
-
# @!method interface
|
94
|
-
# @see Vedeu::DSL::View.interface
|
95
99
|
# @!method render
|
96
100
|
# @see Vedeu::DSL::View.render
|
97
101
|
# @!method renders
|
98
102
|
# @see Vedeu::DSL::View.renders
|
99
103
|
# @!method views
|
100
104
|
# @see Vedeu::DSL::View.views
|
101
|
-
|
102
|
-
# @see Vedeu::DSL::View.view
|
103
|
-
def_delegators Vedeu::DSL::View, :interface, :renders, :render, :views,
|
104
|
-
:view
|
105
|
+
def_delegators Vedeu::DSL::View, :renders, :render, :views
|
105
106
|
|
106
107
|
# @example
|
107
108
|
# Vedeu.bind(name) { }
|
data/lib/vedeu/borders/border.rb
CHANGED
@@ -36,7 +36,7 @@ module Vedeu
|
|
36
36
|
:y,
|
37
37
|
:yn
|
38
38
|
|
39
|
-
# @return [Array<Array<Vedeu::Char>>]
|
39
|
+
# @return [Array<Array<Vedeu::Views::Char>>]
|
40
40
|
# @see Vedeu::RenderBorder#initialize
|
41
41
|
def self.with(border)
|
42
42
|
new(border).render
|
@@ -50,7 +50,7 @@ module Vedeu
|
|
50
50
|
@border = border
|
51
51
|
end
|
52
52
|
|
53
|
-
# @return [Array<Array<Vedeu::Char>>]
|
53
|
+
# @return [Array<Array<Vedeu::Views::Char>>]
|
54
54
|
def render
|
55
55
|
return [] unless enabled?
|
56
56
|
|
@@ -75,42 +75,42 @@ module Vedeu
|
|
75
75
|
# @param type [Symbol|NilClass]
|
76
76
|
# @param iy [Fixnum]
|
77
77
|
# @param ix [Fixnum]
|
78
|
-
# @return [Vedeu::Char]
|
78
|
+
# @return [Vedeu::Views::Char]
|
79
79
|
def build(value, type = :border, iy = 0, ix = 0)
|
80
|
-
Vedeu::Char.new(value: value,
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
80
|
+
Vedeu::Views::Char.new(value: value,
|
81
|
+
parent: interface,
|
82
|
+
colour: colour,
|
83
|
+
style: style,
|
84
|
+
position: [iy, ix],
|
85
|
+
border: type)
|
86
86
|
end
|
87
87
|
|
88
|
-
# @return [Vedeu::Char]
|
88
|
+
# @return [Vedeu::Views::Char]
|
89
89
|
def build_bottom_left
|
90
90
|
build(bottom_left, :bottom_left, yn, x) if left?
|
91
91
|
end
|
92
92
|
|
93
|
-
# @return [Vedeu::Char]
|
93
|
+
# @return [Vedeu::Views::Char]
|
94
94
|
def build_bottom_right
|
95
95
|
build(bottom_right, :bottom_right, yn, xn) if right?
|
96
96
|
end
|
97
97
|
|
98
|
-
# @return [Array<Vedeu::Char>]
|
98
|
+
# @return [Array<Vedeu::Views::Char>]
|
99
99
|
def build_top
|
100
100
|
build_horizontal(:bottom_horizontal, y)
|
101
101
|
end
|
102
102
|
|
103
|
-
# @return [Array<Vedeu::Char>]
|
103
|
+
# @return [Array<Vedeu::Views::Char>]
|
104
104
|
def build_bottom
|
105
105
|
build_horizontal(:bottom_horizontal, yn)
|
106
106
|
end
|
107
107
|
|
108
|
-
# @return [Vedeu::Char]
|
108
|
+
# @return [Vedeu::Views::Char]
|
109
109
|
def build_top_left
|
110
110
|
build(top_left, :top_left, y, x) if left?
|
111
111
|
end
|
112
112
|
|
113
|
-
# @return [Vedeu::Char]
|
113
|
+
# @return [Vedeu::Views::Char]
|
114
114
|
def build_top_right
|
115
115
|
build(top_right, :top_right, y, xn) if right?
|
116
116
|
end
|
@@ -131,7 +131,7 @@ module Vedeu
|
|
131
131
|
|
132
132
|
# @param position [Symbol] Either :top_horizontal, or :bottom_horizontal.
|
133
133
|
# @param y_coordinate [Fixnum] The value of either y or yn.
|
134
|
-
# @return [Array<Vedeu::Char>]
|
134
|
+
# @return [Array<Vedeu::Views::Char>]
|
135
135
|
def build_horizontal(position, y_coordinate)
|
136
136
|
Array.new(width) do |ix|
|
137
137
|
build(horizontal, position, y_coordinate, (bx + ix))
|
@@ -181,9 +181,9 @@ module Vedeu
|
|
181
181
|
end
|
182
182
|
|
183
183
|
# From the second element of {#title_characters} remove the border from each
|
184
|
-
# {#build_horizontal} Vedeu::Char, and add the title character.
|
184
|
+
# {#build_horizontal} Vedeu::Views::Char, and add the title character.
|
185
185
|
#
|
186
|
-
# @return [Array<Vedeu::Char>]
|
186
|
+
# @return [Array<Vedeu::Views::Char>]
|
187
187
|
def titlebar
|
188
188
|
return build_top unless title? && title_fits?
|
189
189
|
|
data/lib/vedeu/buffers/buffer.rb
CHANGED
@@ -19,21 +19,21 @@ module Vedeu
|
|
19
19
|
# on next refresh.
|
20
20
|
#
|
21
21
|
# @!attribute [rw] back
|
22
|
-
# @return [Vedeu::
|
22
|
+
# @return [Vedeu::Views::View]
|
23
23
|
attr_accessor :back
|
24
24
|
|
25
25
|
# The currently displayed buffer, contains the content which was last
|
26
26
|
# output.
|
27
27
|
#
|
28
28
|
# @!attribute [rw] front
|
29
|
-
# @return [Vedeu::
|
29
|
+
# @return [Vedeu::Views::View]
|
30
30
|
attr_accessor :front
|
31
31
|
|
32
32
|
# The previous buffer which was displayed; contains the content that was
|
33
33
|
# shown before 'front'.
|
34
34
|
#
|
35
35
|
# @!attribute [rw] previous
|
36
|
-
# @return [Vedeu::
|
36
|
+
# @return [Vedeu::Views::View]
|
37
37
|
attr_accessor :previous
|
38
38
|
|
39
39
|
# @!attribute [r] name
|
@@ -45,9 +45,9 @@ module Vedeu
|
|
45
45
|
#
|
46
46
|
# @option attributes name [String] The name of the interface for which the
|
47
47
|
# buffer belongs.
|
48
|
-
# @option attributes back [Vedeu::
|
49
|
-
# @option attributes front [Vedeu::
|
50
|
-
# @option attributes previous [Vedeu::
|
48
|
+
# @option attributes back [Vedeu::Views::View]
|
49
|
+
# @option attributes front [Vedeu::Views::View]
|
50
|
+
# @option attributes previous [Vedeu::Views::View]
|
51
51
|
# @option attributes repository [Vedeu::Buffers]
|
52
52
|
# @return [Vedeu::Buffer]
|
53
53
|
def initialize(attributes = {})
|
@@ -59,7 +59,7 @@ module Vedeu
|
|
59
59
|
# Add the content to the back buffer, then update the repository.
|
60
60
|
# Returns boolean indicating that the repository was updated.
|
61
61
|
#
|
62
|
-
# @param content [Vedeu::
|
62
|
+
# @param content [Vedeu::Views::View]
|
63
63
|
# @return [Boolean]
|
64
64
|
def add(content)
|
65
65
|
@back = content
|
@@ -104,13 +104,13 @@ module Vedeu
|
|
104
104
|
#
|
105
105
|
# Will hide the named interface. If the interface is currently visible, it
|
106
106
|
# will be cleared- rendered blank. To show the interface, the
|
107
|
-
# ':_show_interface_' event should be triggered.
|
108
|
-
#
|
109
|
-
#
|
107
|
+
# ':_show_interface_' event should be triggered. Triggering the
|
108
|
+
# ':_hide_group_' event to which this named interface belongs will also hide
|
109
|
+
# the interface.
|
110
110
|
#
|
111
111
|
# @return [void]
|
112
112
|
def hide
|
113
|
-
Vedeu::Output.render(clear_buffer)
|
113
|
+
Vedeu::Output.render(clear_buffer)
|
114
114
|
end
|
115
115
|
|
116
116
|
# Return the content for this buffer.
|
@@ -124,9 +124,9 @@ module Vedeu
|
|
124
124
|
# 'previous' buffer.
|
125
125
|
# - If the 'previous' buffer is empty, return an empty collection.
|
126
126
|
#
|
127
|
-
# @return [Array<Array<Array<Vedeu::Char>>>]
|
127
|
+
# @return [Array<Array<Array<Vedeu::Views::Char>>>]
|
128
128
|
def render
|
129
|
-
Vedeu::Output.render(buffer)
|
129
|
+
Vedeu::Output.render(buffer)
|
130
130
|
end
|
131
131
|
|
132
132
|
# Show this buffer.
|
@@ -137,20 +137,20 @@ module Vedeu
|
|
137
137
|
#
|
138
138
|
# Will show the named interface. If the interface is currently invisible, it
|
139
139
|
# will be shown- rendered with its latest content. To hide the interface,
|
140
|
-
# the ':_hide_interface_' event should be triggered.
|
141
|
-
#
|
142
|
-
#
|
140
|
+
# the ':_hide_interface_' event should be triggered. Triggering the
|
141
|
+
# ':_show_group_' event to which this named interface belongs will also show
|
142
|
+
# the interface.
|
143
143
|
#
|
144
144
|
# @return [void]
|
145
145
|
def show
|
146
|
-
Vedeu::Output.render(buffer)
|
146
|
+
Vedeu::Output.render(buffer)
|
147
147
|
end
|
148
148
|
|
149
149
|
private
|
150
150
|
|
151
151
|
# Retrieve the latest content from the buffer.
|
152
152
|
#
|
153
|
-
# @return [Array<Array<Array<Vedeu::Char>>>]
|
153
|
+
# @return [Array<Array<Array<Vedeu::Views::Char>>>]
|
154
154
|
def buffer
|
155
155
|
swap if back?
|
156
156
|
|
@@ -160,9 +160,6 @@ module Vedeu
|
|
160
160
|
elsif previous?
|
161
161
|
[previous.render]
|
162
162
|
|
163
|
-
elsif interface.visible?
|
164
|
-
[interface.render]
|
165
|
-
|
166
163
|
else
|
167
164
|
[]
|
168
165
|
|
@@ -204,13 +201,6 @@ module Vedeu
|
|
204
201
|
true
|
205
202
|
end
|
206
203
|
|
207
|
-
# Retrieve the interface by name.
|
208
|
-
#
|
209
|
-
# @return [Vedeu::Interface]
|
210
|
-
def interface
|
211
|
-
Vedeu.interfaces.by_name(name)
|
212
|
-
end
|
213
|
-
|
214
204
|
end # Buffer
|
215
205
|
|
216
206
|
end # Vedeu
|
data/lib/vedeu/colours/colour.rb
CHANGED
data/lib/vedeu/cursor/cursor.rb
CHANGED
@@ -57,10 +57,6 @@ module Vedeu
|
|
57
57
|
#
|
58
58
|
# @return [Vedeu::Cursor]
|
59
59
|
def initialize(attributes = {})
|
60
|
-
# @todo Hack because Repository#by_name creates Cursor objects with just a
|
61
|
-
# name. Intend to remove this.
|
62
|
-
attributes = { name: attributes } if attributes.is_a?(String)
|
63
|
-
|
64
60
|
@attributes = defaults.merge!(attributes)
|
65
61
|
|
66
62
|
@attributes.each { |key, value| instance_variable_set("@#{key}", value) }
|
@@ -78,6 +74,13 @@ module Vedeu
|
|
78
74
|
"oy:#{oy})>"
|
79
75
|
end
|
80
76
|
|
77
|
+
# Renders the cursor.
|
78
|
+
#
|
79
|
+
# @return [void]
|
80
|
+
def render
|
81
|
+
Vedeu::Output.render(visibility)
|
82
|
+
end
|
83
|
+
|
81
84
|
# Returns an escape sequence to position the cursor and set its visibility.
|
82
85
|
# When passed a block, will position the cursor, yield and return the
|
83
86
|
# original position.
|
@@ -104,7 +107,7 @@ module Vedeu
|
|
104
107
|
def hide
|
105
108
|
super
|
106
109
|
|
107
|
-
|
110
|
+
render
|
108
111
|
end
|
109
112
|
|
110
113
|
# Return the position of this cursor.
|
@@ -124,7 +127,7 @@ module Vedeu
|
|
124
127
|
def show
|
125
128
|
super
|
126
129
|
|
127
|
-
|
130
|
+
render
|
128
131
|
end
|
129
132
|
|
130
133
|
# @return [Fixnum] The column/character coordinate.
|