vedeu 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/docs/dsl.md +3 -3
  3. data/examples/borders_app.rb +2 -0
  4. data/examples/colours_app.rb +2 -0
  5. data/examples/configuration_app.rb +2 -0
  6. data/examples/drb_app.rb +2 -0
  7. data/examples/focus_app.rb +2 -0
  8. data/examples/hello_world.rb +2 -0
  9. data/examples/material_colours_app.rb +2 -0
  10. data/lib/vedeu.rb +2 -0
  11. data/lib/vedeu/all.rb +4 -13
  12. data/lib/vedeu/api.rb +7 -6
  13. data/lib/vedeu/borders/border.rb +1 -1
  14. data/lib/vedeu/borders/render_border.rb +18 -18
  15. data/lib/vedeu/buffers/buffer.rb +18 -28
  16. data/lib/vedeu/colours/colour.rb +1 -1
  17. data/lib/vedeu/colours/colour_translator.rb +1 -1
  18. data/lib/vedeu/cursor/cursor.rb +9 -6
  19. data/lib/vedeu/dsl/border.rb +1 -1
  20. data/lib/vedeu/dsl/composition.rb +5 -5
  21. data/lib/vedeu/dsl/geometry.rb +1 -1
  22. data/lib/vedeu/dsl/group.rb +1 -1
  23. data/lib/vedeu/dsl/interface.rb +69 -93
  24. data/lib/vedeu/dsl/keymap.rb +1 -1
  25. data/lib/vedeu/dsl/line.rb +11 -11
  26. data/lib/vedeu/dsl/shared.rb +81 -0
  27. data/lib/vedeu/dsl/stream.rb +3 -3
  28. data/lib/vedeu/dsl/view.rb +76 -64
  29. data/lib/vedeu/models/escape.rb +1 -1
  30. data/lib/vedeu/models/interface.rb +3 -57
  31. data/lib/vedeu/models/menu.rb +1 -1
  32. data/lib/vedeu/models/views/all.rb +22 -0
  33. data/lib/vedeu/models/views/char.rb +175 -0
  34. data/lib/vedeu/models/views/chars.rb +13 -0
  35. data/lib/vedeu/models/views/composition.rb +73 -0
  36. data/lib/vedeu/models/views/line.rb +111 -0
  37. data/lib/vedeu/models/views/lines.rb +13 -0
  38. data/lib/vedeu/models/views/stream.rb +122 -0
  39. data/lib/vedeu/models/views/streams.rb +13 -0
  40. data/lib/vedeu/models/views/view.rb +157 -0
  41. data/lib/vedeu/models/views/view_collection.rb +13 -0
  42. data/lib/vedeu/null/view.rb +67 -0
  43. data/lib/vedeu/output/clear/named_interface.rb +4 -4
  44. data/lib/vedeu/output/compressor.rb +6 -6
  45. data/lib/vedeu/output/html_char.rb +6 -6
  46. data/lib/vedeu/output/output.rb +3 -3
  47. data/lib/vedeu/output/presentation.rb +1 -1
  48. data/lib/vedeu/output/renderers/escape_sequence.rb +1 -1
  49. data/lib/vedeu/output/renderers/file.rb +1 -1
  50. data/lib/vedeu/output/renderers/html.rb +3 -3
  51. data/lib/vedeu/output/renderers/json.rb +4 -4
  52. data/lib/vedeu/output/renderers/null.rb +1 -1
  53. data/lib/vedeu/output/renderers/terminal.rb +5 -5
  54. data/lib/vedeu/output/renderers/text.rb +3 -3
  55. data/lib/vedeu/output/style.rb +1 -1
  56. data/lib/vedeu/output/text.rb +20 -15
  57. data/lib/vedeu/output/viewport.rb +16 -23
  58. data/lib/vedeu/output/virtual_buffer.rb +9 -8
  59. data/lib/vedeu/output/virtual_terminal.rb +11 -11
  60. data/lib/vedeu/output/wordwrap.rb +5 -5
  61. data/lib/vedeu/runtime/application.rb +1 -1
  62. data/lib/vedeu/runtime/main_loop.rb +1 -1
  63. data/lib/vedeu/templating/helpers.rb +11 -10
  64. data/lib/vedeu/templating/template.rb +1 -1
  65. data/lib/vedeu/templating/view_template.rb +6 -6
  66. data/lib/vedeu/version.rb +1 -2
  67. data/test/lib/vedeu/api_test.rb +30 -30
  68. data/test/lib/vedeu/buffers/buffer_test.rb +5 -139
  69. data/test/lib/vedeu/colours/colour_translator_test.rb +3 -3
  70. data/test/lib/vedeu/configuration/api_test.rb +3 -3
  71. data/test/lib/vedeu/cursor/refresh_cursor_test.rb +1 -1
  72. data/test/lib/vedeu/dsl/composition_test.rb +7 -7
  73. data/test/lib/vedeu/dsl/group_test.rb +2 -2
  74. data/test/lib/vedeu/dsl/interface_test.rb +31 -21
  75. data/test/lib/vedeu/dsl/keymap_test.rb +4 -4
  76. data/test/lib/vedeu/dsl/line_test.rb +8 -8
  77. data/test/lib/vedeu/dsl/stream_test.rb +4 -4
  78. data/test/lib/vedeu/dsl/text_test.rb +11 -11
  79. data/test/lib/vedeu/dsl/view_test.rb +24 -29
  80. data/test/lib/vedeu/geometry/grid_test.rb +4 -4
  81. data/test/lib/vedeu/input/key_test.rb +1 -1
  82. data/test/lib/vedeu/internal_api_test.rb +18 -18
  83. data/test/lib/vedeu/models/focus_test.rb +54 -54
  84. data/test/lib/vedeu/models/interface_test.rb +11 -105
  85. data/test/lib/vedeu/models/menu_test.rb +1 -1
  86. data/test/lib/vedeu/models/views/char_test.rb +257 -0
  87. data/test/lib/vedeu/models/views/chars_test.rb +22 -0
  88. data/test/lib/vedeu/models/views/composition_test.rb +61 -0
  89. data/test/lib/vedeu/models/views/line_test.rb +189 -0
  90. data/test/lib/vedeu/models/views/lines_test.rb +22 -0
  91. data/test/lib/vedeu/models/views/stream_test.rb +138 -0
  92. data/test/lib/vedeu/models/views/streams_test.rb +22 -0
  93. data/test/lib/vedeu/models/views/view_test.rb +40 -0
  94. data/test/lib/vedeu/null/view_test.rb +12 -0
  95. data/test/lib/vedeu/output/clear/named_interface_test.rb +4 -4
  96. data/test/lib/vedeu/output/compressor_test.rb +28 -28
  97. data/test/lib/vedeu/output/html_char_test.rb +2 -2
  98. data/test/lib/vedeu/output/presentation_test.rb +10 -14
  99. data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +20 -4
  100. data/test/lib/vedeu/output/renderers/html_test.rb +4 -4
  101. data/test/lib/vedeu/output/renderers/json_test.rb +3 -3
  102. data/test/lib/vedeu/output/text_test.rb +10 -10
  103. data/test/lib/vedeu/output/viewport_test.rb +21 -23
  104. data/test/lib/vedeu/output/virtual_buffer_test.rb +1 -1
  105. data/test/lib/vedeu/output/virtual_terminal_test.rb +1 -1
  106. data/test/lib/vedeu/output/wordwrap_test.rb +9 -9
  107. data/test/lib/vedeu/repositories/repository_test.rb +2 -2
  108. data/test/lib/vedeu/templating/helpers_test.rb +6 -39
  109. data/test/lib/vedeu/templating/template_test.rb +2 -2
  110. data/test/lib/vedeu/templating/view_template_test.rb +91 -91
  111. data/test/lib/vedeu/terminal_test.rb +1 -1
  112. metadata +33 -27
  113. data/lib/vedeu/buffers/display_buffer.rb +0 -39
  114. data/lib/vedeu/models/char.rb +0 -170
  115. data/lib/vedeu/models/chars.rb +0 -9
  116. data/lib/vedeu/models/composition.rb +0 -66
  117. data/lib/vedeu/models/line.rb +0 -112
  118. data/lib/vedeu/models/lines.rb +0 -9
  119. data/lib/vedeu/models/stream.rb +0 -122
  120. data/lib/vedeu/models/streams.rb +0 -9
  121. data/test/lib/vedeu/buffers/display_buffer_test.rb +0 -61
  122. data/test/lib/vedeu/models/char_test.rb +0 -253
  123. data/test/lib/vedeu/models/chars_test.rb +0 -18
  124. data/test/lib/vedeu/models/composition_test.rb +0 -57
  125. data/test/lib/vedeu/models/line_test.rb +0 -189
  126. data/test/lib/vedeu/models/lines_test.rb +0 -18
  127. data/test/lib/vedeu/models/stream_test.rb +0 -141
  128. 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: e8cbfce4cf0a82bd72ea2ca4db302211611f3c58
4
- data.tar.gz: 5d77ffbb1325cd04c79c6173aad0805acb53fc8c
3
+ metadata.gz: b010b9db3a29aed26083a27acd4d7843e0ba8a86
4
+ data.tar.gz: f5487a4cdfe1bcd1339bdc8f8eedd96f9f96e768
5
5
  SHA512:
6
- metadata.gz: 0d35ab6387b6ad9b8999444d82f5c7ec622d63b98eceda8706a3f4cfd669756618335a31f05868fb681ba97dbc6d2f2ebeb562c6eb7eba8b1064284f49da051d
7
- data.tar.gz: bf839e0f88b3390edf7f995025223df62b7b6f6eb921c42974dbed6d5923be597bf0ce230c3451598fd84d4305ae8f90ebf718784618b8108cb0c4338fdcb341
6
+ metadata.gz: 419e080ddd2be42371edea189cbb56bf8ef02b8ba1b928aaa1a47790e4cf0da4b7ebfc82a09658cf0cc30a5af04b883f68051ad65a34a1f4070345821ca4fe97
7
+ data.tar.gz: c226c7c8af7ddcaa58f83abbb20372d8578843a4ecb246d932c48e8f80c037ad23302a0d563740b3f23ae03546dbe69518b5f0030ed7c00e983bfd7503e4133a
@@ -142,15 +142,15 @@ end
142
142
  ## Views
143
143
 
144
144
  {include:Vedeu::DSL::View}
145
- {include:Vedeu::DSL::View.interface}
145
+ {include:Vedeu::DSL::Interface.interface}
146
146
 
147
147
  ### Immediate rendering
148
148
 
149
- {include:Vedeu::DSL::View.render}
149
+ {include:Vedeu::DSL::View.renders}
150
150
 
151
151
  ### Deferred rendering
152
152
 
153
- {include:Vedeu::DSL::View.view}
153
+ {include:Vedeu::DSL::View.views}
154
154
 
155
155
  ### Specifying view content
156
156
 
@@ -13,6 +13,8 @@ require 'vedeu'
13
13
  #
14
14
  class VedeuBordersApp
15
15
 
16
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
17
+
16
18
  # Be aware that running an application with debugging enabled will affect
17
19
  # performance.
18
20
  Vedeu.configure do
@@ -13,6 +13,8 @@ require 'vedeu'
13
13
  #
14
14
  class VedeuColoursApp
15
15
 
16
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
17
+
16
18
  # Be aware that running an application with debugging enabled will affect
17
19
  # performance.
18
20
  Vedeu.configure do
@@ -22,6 +22,8 @@ require 'vedeu'
22
22
  #
23
23
  class VedeuConfigurationApp
24
24
 
25
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
26
+
25
27
  Vedeu.configure do
26
28
  # debug!
27
29
  log '/tmp/vedeu_configuration_app.log'
@@ -12,6 +12,8 @@ require 'vedeu'
12
12
  #
13
13
  class VedeuTestApplication
14
14
 
15
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
16
+
15
17
  # Be aware that running an application with debugging enabled will affect
16
18
  # performance.
17
19
  Vedeu.configure do
@@ -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
@@ -16,6 +16,8 @@ require 'vedeu'
16
16
  #
17
17
  class HelloWorldApp
18
18
 
19
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
20
+
19
21
  Vedeu.configure do
20
22
  # debug!
21
23
  log '/tmp/vedeu_hello_world.log'
@@ -19,6 +19,8 @@ require 'vedeu'
19
19
  #
20
20
  class VedeuMaterialColoursApp
21
21
 
22
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
23
+
22
24
  # Be aware that running an application with debugging enabled will affect
23
25
  # performance.
24
26
  Vedeu.configure do
@@ -1,6 +1,8 @@
1
1
  $LIB_DIR = File.dirname(__FILE__) + '/../lib'
2
2
  $LOAD_PATH.unshift($LIB_DIR) unless $LOAD_PATH.include?($LIB_DIR)
3
3
 
4
+ require 'bundler/setup'
5
+
4
6
  require 'base64'
5
7
  require 'date'
6
8
  require 'drb'
@@ -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'
@@ -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
- # @!method view
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) { }
@@ -153,7 +153,7 @@ module Vedeu
153
153
  (by..byn).size
154
154
  end
155
155
 
156
- # @return [Array<Array<Vedeu::Char>>]
156
+ # @return [Array<Array<Vedeu::Views::Char>>]
157
157
  def render
158
158
  Vedeu::RenderBorder.with(self)
159
159
  end
@@ -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
- parent: interface,
82
- colour: colour,
83
- style: style,
84
- position: [iy, ix],
85
- border: type)
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
 
@@ -19,21 +19,21 @@ module Vedeu
19
19
  # on next refresh.
20
20
  #
21
21
  # @!attribute [rw] back
22
- # @return [Vedeu::Interface]
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::Interface]
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::Interface]
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::Interface]
49
- # @option attributes front [Vedeu::Interface]
50
- # @option attributes previous [Vedeu::Interface]
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::Interface]
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
- # Triggering the ':_hide_group_' event to which this named interface belongs
109
- # will also hide the interface.
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) if Vedeu.ready?
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) if Vedeu.ready?
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
- # Triggering the ':_show_group_' event to which this named interface belongs
142
- # will also show the interface.
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) if Vedeu.ready?
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
@@ -83,7 +83,7 @@ module Vedeu
83
83
 
84
84
  # An object is equal when its values are the same.
85
85
  #
86
- # @param other [Vedeu::Char]
86
+ # @param other [Vedeu::Views::Char]
87
87
  # @return [Boolean]
88
88
  def eql?(other)
89
89
  self.class == other.class && background == other.background &&
@@ -52,7 +52,7 @@ module Vedeu
52
52
 
53
53
  # An object is equal when its values are the same.
54
54
  #
55
- # @param other [Vedeu::Char]
55
+ # @param other [Vedeu::Views::Char]
56
56
  # @return [Boolean]
57
57
  def eql?(other)
58
58
  self.class == other.class && colour == other.colour
@@ -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
- Vedeu::Output.render(visibility) if Vedeu.ready?
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
- Vedeu::Output.render(visibility) if Vedeu.ready?
130
+ render
128
131
  end
129
132
 
130
133
  # @return [Fixnum] The column/character coordinate.