vedeu 0.6.28 → 0.6.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/README.md +1 -0
  4. data/docs/dsl.md +4 -4
  5. data/docs/keymaps.md +25 -0
  6. data/lib/vedeu/all.rb +1 -1
  7. data/lib/vedeu/borders/border.rb +1 -1
  8. data/lib/vedeu/borders/refresh.rb +1 -1
  9. data/lib/vedeu/common.rb +1 -1
  10. data/lib/vedeu/dsl/all.rb +0 -2
  11. data/lib/vedeu/dsl/presentation.rb +1 -1
  12. data/lib/vedeu/dsl/shared.rb +1 -1
  13. data/lib/vedeu/dsl/text.rb +1 -1
  14. data/lib/vedeu/dsl/view.rb +11 -13
  15. data/lib/vedeu/editor/cropper.rb +1 -1
  16. data/lib/vedeu/editor/document.rb +6 -8
  17. data/lib/vedeu/geometry/geometry.rb +6 -0
  18. data/lib/vedeu/geometry/position.rb +2 -0
  19. data/lib/vedeu/groups/group.rb +1 -1
  20. data/lib/vedeu/input/all.rb +1 -0
  21. data/lib/vedeu/{dsl/keymap.rb → input/dsl.rb} +6 -6
  22. data/lib/vedeu/interfaces/all.rb +12 -0
  23. data/lib/vedeu/{dsl/interface.rb → interfaces/dsl.rb} +10 -10
  24. data/lib/vedeu/{models → interfaces}/interface.rb +6 -6
  25. data/lib/vedeu/{null/interface.rb → interfaces/null.rb} +6 -6
  26. data/lib/vedeu/{models/interfaces.rb → interfaces/repository.rb} +10 -10
  27. data/lib/vedeu/logging/log.rb +18 -12
  28. data/lib/vedeu/models/focus.rb +1 -1
  29. data/lib/vedeu/models/toggleable.rb +1 -1
  30. data/lib/vedeu/models/views/all.rb +0 -2
  31. data/lib/vedeu/models/views/composition.rb +12 -7
  32. data/lib/vedeu/models/views/line.rb +1 -0
  33. data/lib/vedeu/models/views/stream.rb +1 -0
  34. data/lib/vedeu/null/all.rb +0 -1
  35. data/lib/vedeu/output/clear/interface.rb +1 -1
  36. data/lib/vedeu/output/output.rb +28 -10
  37. data/lib/vedeu/output/refresh/refresh.rb +1 -1
  38. data/lib/vedeu/output/renderers/all.rb +11 -2
  39. data/lib/vedeu/output/text.rb +9 -2
  40. data/lib/vedeu/repositories/model.rb +9 -7
  41. data/lib/vedeu/repositories/repositories.rb +7 -7
  42. data/lib/vedeu/runtime/main_loop.rb +2 -0
  43. data/lib/vedeu/templating/view_template.rb +1 -1
  44. data/lib/vedeu/terminal/buffer.rb +2 -0
  45. data/lib/vedeu/version.rb +1 -1
  46. data/test/lib/vedeu/borders/refresh_test.rb +1 -1
  47. data/test/lib/vedeu/dsl/presentation_test.rb +2 -2
  48. data/test/lib/vedeu/dsl/text_test.rb +2 -1
  49. data/test/lib/vedeu/editor/cropper_test.rb +1 -1
  50. data/test/lib/vedeu/editor/document_test.rb +1 -1
  51. data/test/lib/vedeu/geometry/geometry_test.rb +3 -0
  52. data/test/lib/vedeu/groups/group_test.rb +3 -3
  53. data/test/lib/vedeu/{dsl/keymap_test.rb → input/dsl_test.rb} +5 -5
  54. data/test/lib/vedeu/{dsl/interface_test.rb → interfaces/dsl_test.rb} +7 -7
  55. data/test/lib/vedeu/{models → interfaces}/interface_test.rb +3 -3
  56. data/test/lib/vedeu/{null/interface_test.rb → interfaces/null_test.rb} +5 -5
  57. data/test/lib/vedeu/{models/interfaces_test.rb → interfaces/repository_test.rb} +5 -5
  58. data/test/lib/vedeu/logging/log_test.rb +2 -2
  59. data/test/lib/vedeu/models/views/view_test.rb +1 -1
  60. data/test/lib/vedeu/output/clear/interface_test.rb +1 -1
  61. data/test/lib/vedeu/output/output_test.rb +5 -10
  62. data/test/lib/vedeu/output/presentation/presentation_test.rb +1 -1
  63. data/test/lib/vedeu/output/refresh/refresh_test.rb +1 -1
  64. data/test/lib/vedeu/output/renderers/all_test.rb +2 -0
  65. data/test/lib/vedeu/output/viewport_test.rb +1 -1
  66. data/test/lib/vedeu/terminal/buffer_test.rb +1 -1
  67. data/test/test_helper.rb +1 -0
  68. metadata +19 -20
  69. data/lib/vedeu/output/direct.rb +0 -64
  70. data/test/lib/vedeu/output/direct_test.rb +0 -76
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e78a39e26891252b15013c3ee2e5b3d9255a824
4
- data.tar.gz: 72ae82abfadbc68b4877b21379d086ddd552249d
3
+ metadata.gz: acc3caf904e10f4af35074e6b869c3ad65f96af2
4
+ data.tar.gz: fe00ef8a86cc1e6e4615361e9d57e30ed2f316fc
5
5
  SHA512:
6
- metadata.gz: 06071e418374792ba1b007ececa0d47b04e8ef53290a821b1e8fe99283cac3e872f09c667a911a0f6f54e3c01490bacbfbcae47180b373244a678967f0d5c6c4
7
- data.tar.gz: 09d5fe864aff632e25baf9b1ff0a0b0215e6e5ba5c5874fac7e4950ed4293b7410fc25229b54e31340d00c484e3a5e325f47ed69720d3190034fc38f1c00dc0f
6
+ metadata.gz: f0c354b58c059144923e853c58d3a3b5d5ac31b194f51362cb876c9182fa2fde1003781963b1b3fc69e17e36e830af7f4c6ad6f053b67003289345eed811c9d3
7
+ data.tar.gz: 2c618148a9cf0f395c110ba0b4e9d1aa845966f1c9d2d1d771860bb27f808b24502e66550aac3c6fdf9e677bb3ed653a5d3d50c0b0259e73564d3192e5164a4f
data/.yardopts CHANGED
@@ -13,6 +13,7 @@ docs/geometry.md
13
13
  docs/getting_started.md
14
14
  docs/group.md
15
15
  docs/interfaces.md
16
+ docs/keymaps.md
16
17
  docs/object_graph.md
17
18
  docs/view.md
18
19
  docs/events/application.md
data/README.md CHANGED
@@ -55,6 +55,7 @@ here is some documentation for the various aspects of Vedeu:
55
55
  - [Geometry](http://rubydoc.info/gems/vedeu/file/docs/geometry.md)
56
56
  - [Borders](http://rubydoc.info/gems/vedeu/file/docs/border.md)
57
57
  - [Cursors](http://rubydoc.info/gems/vedeu/file/docs/cursor.md)
58
+ - [Keymaps](http://rubydoc.info/gems/vedeu/file/docs/keymaps.md)
58
59
  - [Events](http://rubydoc.info/gems/vedeu/file/docs/events.md)
59
60
  - [Configuration](http://rubydoc.info/gems/vedeu/file/docs/configuration.md)
60
61
  - [Getting Started](http://rubydoc.info/gems/vedeu/file/docs/getting_started.md)
data/docs/dsl.md CHANGED
@@ -129,9 +129,9 @@ end
129
129
 
130
130
  ## Keymaps
131
131
 
132
- {include:Vedeu::DSL::Keymap}
133
- {include:Vedeu::DSL::Keymap.keymap}
134
- {include:Vedeu::DSL::Keymap#name}
132
+ {include:Vedeu::Keymaps::DSL}
133
+ {include:Vedeu::Keymaps::DSL.keymap}
134
+ {include:Vedeu::Keymaps::DSL#name}
135
135
 
136
136
  ## Menus
137
137
 
@@ -143,7 +143,7 @@ end
143
143
  ## Views
144
144
 
145
145
  {include:Vedeu::DSL::View}
146
- {include:Vedeu::DSL::Interface.interface}
146
+ {include:Vedeu::Interfaces::DSL.interface}
147
147
 
148
148
  ### Immediate rendering
149
149
 
data/docs/keymaps.md ADDED
@@ -0,0 +1,25 @@
1
+ # @title Vedeu Keymaps
2
+ # Vedeu Keymaps
3
+
4
+ Keymaps define the keypresses applicable to an interface or view. A
5
+ keymap sharing the same name as an interface will only operate if that
6
+ interface is currently in focus.
7
+
8
+ Alongside this functioanlity, there is a global keymap '_global_'
9
+ which will respond to keypresses regardless of which interface is in
10
+ focus. The global keymap is useful for mapping the key to exit the
11
+ application for example.
12
+
13
+ - It has a name. This name associates it with an
14
+ {file:docs/interface.md Interface}.
15
+ - A key registered with a keymap can call a method or trigger an
16
+ event, or either, in multitude.
17
+ - Keymaps only affect the interface/view with the same name.
18
+ - The same key can be registered with mulitple keymaps and perform
19
+ different actions dependent on which interface is currently in
20
+ focus.
21
+ - Some keys on the keymap are stored as strings, whilst others are
22
+ symbols; representations of the keys pressed.
23
+
24
+ You can find out which keys Vedeu recognises here:
25
+ {Vedeu::Input::Translator}.
data/lib/vedeu/all.rb CHANGED
@@ -15,7 +15,6 @@ require 'vedeu/repositories/all'
15
15
 
16
16
  require 'vedeu/models/toggleable'
17
17
 
18
- require 'vedeu/output/direct'
19
18
  require 'vedeu/output/clear/all'
20
19
  require 'vedeu/output/compressor'
21
20
  require 'vedeu/output/text'
@@ -42,6 +41,7 @@ require 'vedeu/events/all'
42
41
  require 'vedeu/geometry/all'
43
42
  require 'vedeu/groups/all'
44
43
  require 'vedeu/input/all'
44
+ require 'vedeu/interfaces/all'
45
45
  require 'vedeu/menus/all'
46
46
  require 'vedeu/templating/all'
47
47
 
@@ -86,7 +86,7 @@ module Vedeu
86
86
  attr_reader :name
87
87
 
88
88
  # @!attribute [r] parent
89
- # @return [Vedeu::Models::Interface|NilClass]
89
+ # @return [Vedeu::Interfaces::Interface|NilClass]
90
90
  attr_reader :parent
91
91
 
92
92
  # @!attribute [r] enabled
@@ -174,7 +174,7 @@ module Vedeu
174
174
 
175
175
  # The parent of a border is always an interface.
176
176
  #
177
- # @return [Vedeu::Models::Interface]
177
+ # @return [Vedeu::Interfaces::Interface]
178
178
  def interface
179
179
  @interface ||= Vedeu.interfaces.by_name(name)
180
180
  end
data/lib/vedeu/common.rb CHANGED
@@ -16,7 +16,7 @@ module Vedeu
16
16
  # Removes the module part from the expression in the string.
17
17
  #
18
18
  # @example
19
- # demodulize('Vedeu::DSL::Interface') # => "Interface"
19
+ # demodulize('Vedeu::SomeModule::SomeClass') # => "SomeClass"
20
20
  #
21
21
  # @param klass [Class|String]
22
22
  # @return [String]
data/lib/vedeu/dsl/all.rb CHANGED
@@ -13,9 +13,7 @@ require 'vedeu/dsl/shared'
13
13
  require 'vedeu/dsl/use'
14
14
  require 'vedeu/dsl/presentation'
15
15
  require 'vedeu/dsl/composition'
16
- require 'vedeu/dsl/keymap'
17
16
  require 'vedeu/dsl/text'
18
- require 'vedeu/dsl/interface'
19
17
  require 'vedeu/dsl/line'
20
18
  require 'vedeu/dsl/stream'
21
19
  require 'vedeu/dsl/view'
@@ -3,7 +3,7 @@ module Vedeu
3
3
  module DSL
4
4
 
5
5
  # Provides colour and style helpers for use in the
6
- # {Vedeu::DSL::Interface}, {Vedeu::DSL::Line} and
6
+ # {Vedeu::Interfaces::DSL}, {Vedeu::DSL::Line} and
7
7
  # {Vedeu::DSL::Stream} classes.
8
8
  #
9
9
  module Presentation
@@ -3,7 +3,7 @@ module Vedeu
3
3
  module DSL
4
4
 
5
5
  # Provides behaviour to be shared between both
6
- # {Vedeu::DSL::Interface} and {Vedeu::DSL::View} objects.
6
+ # {Vedeu::Interfaces::DSL} and {Vedeu::DSL::View} objects.
7
7
  #
8
8
  module Shared
9
9
 
@@ -64,7 +64,7 @@ module Vedeu
64
64
  # string is shorter than the specified width.
65
65
  # @return [String]
66
66
  def text(value = '', options = {})
67
- options.merge!(anchor: __callee__, model: model)
67
+ options.merge!(anchor: __callee__, model: model, client: client)
68
68
 
69
69
  Vedeu::Output::Text.add(value, options)
70
70
  end
@@ -10,7 +10,7 @@ module Vedeu
10
10
  # Both of these approaches require that you have defined an
11
11
  # interface (or 'visible area') first. You can find out how to
12
12
  # define an interface with Vedeu below or in
13
- # {Vedeu::DSL::Interface}. The examples in 'Immediate Render' and
13
+ # {Vedeu::Interfaces::DSL}. The examples in 'Immediate Render' and
14
14
  # 'Deferred View' use these interface definitions: (Note: should
15
15
  # you use these examples, ensure your terminal is at least 70
16
16
  # characters in width and 5 lines in height.)
@@ -136,7 +136,9 @@ module Vedeu
136
136
  def renders(&block)
137
137
  fail Vedeu::Error::RequiresBlock unless block_given?
138
138
 
139
- store(:store_immediate, &block)
139
+ client = eval('self', block.binding)
140
+
141
+ store(:store_immediate, client, &block)
140
142
  end
141
143
  alias_method :render, :renders
142
144
 
@@ -181,19 +183,13 @@ module Vedeu
181
183
  def views(&block)
182
184
  fail Vedeu::Error::RequiresBlock unless block_given?
183
185
 
184
- store(:store_deferred, &block)
186
+ client = eval('self', block.binding)
187
+
188
+ store(:store_deferred, client, &block)
185
189
  end
186
190
 
187
191
  private
188
192
 
189
- # Returns the client object which called the DSL method.
190
- #
191
- # @param block [Proc]
192
- # @return [Object]
193
- def client(&block)
194
- eval('self', block.binding)
195
- end
196
-
197
193
  # Creates a new Vedeu::Views::Composition which may contain
198
194
  # one or more views (Vedeu::Views::View objects).
199
195
  #
@@ -210,10 +206,12 @@ module Vedeu
210
206
  # @param method [Symbol] An instruction; `:store_immediate` or
211
207
  # `:store_deferred` which determines whether the view will
212
208
  # be shown immediately or later respectively.
209
+ # @param client [Object] The client class which called the DSL
210
+ # object.
213
211
  # @param block [Proc]
214
212
  # @return [Array]
215
- def store(method, &block)
216
- composition(client(&block), &block).views.map do |view|
213
+ def store(method, client, &block)
214
+ composition(client, &block).views.map do |view|
217
215
  view.public_send(method)
218
216
  end
219
217
  end
@@ -87,7 +87,7 @@ module Vedeu
87
87
  @lines[oy...(oy + height)] || []
88
88
  end
89
89
 
90
- # @return [Vedeu::Models::Interface]
90
+ # @return [Vedeu::Interfaces::Interface]
91
91
  def interface
92
92
  @interface ||= Vedeu.interfaces.by_name(name)
93
93
  end
@@ -178,14 +178,14 @@ module Vedeu
178
178
  #
179
179
  # @return [Vedeu::Editor::Document]
180
180
  def up
181
- if x > line(y - 1).size
182
- cursor.up
181
+ return self if y - 1 < 0
183
182
 
183
+ cursor.up
184
+
185
+ if x > line(y).size
184
186
  eol
185
187
 
186
188
  else
187
- cursor.up
188
-
189
189
  refresh
190
190
 
191
191
  end
@@ -197,14 +197,12 @@ module Vedeu
197
197
  def down
198
198
  return self if y + 1 >= lines.size
199
199
 
200
- if x > line(y + 1).size
201
- cursor.down
200
+ cursor.down
202
201
 
202
+ if x > line(y).size
203
203
  eol
204
204
 
205
205
  else
206
- cursor.down
207
-
208
206
  refresh
209
207
 
210
208
  end
@@ -72,6 +72,10 @@ module Vedeu
72
72
  # @return [Fixnum]
73
73
  attr_writer :yn
74
74
 
75
+ # @!attribute [rw] client
76
+ # @return [Object]
77
+ attr_accessor :client
78
+
75
79
  # @param (see #initialize)
76
80
  # @return (see #initialize)
77
81
  def self.store(attributes)
@@ -194,6 +198,7 @@ module Vedeu
194
198
  store do
195
199
  Vedeu.trigger(:_clear_)
196
200
  Vedeu.trigger(:_refresh_)
201
+ Vedeu.trigger(:_refresh_view_, name)
197
202
  end
198
203
  end
199
204
 
@@ -283,6 +288,7 @@ module Vedeu
283
288
  # @return [Hash]
284
289
  def defaults
285
290
  {
291
+ client: nil,
286
292
  centred: nil,
287
293
  height: nil,
288
294
  maximised: false,
@@ -47,6 +47,8 @@ module Vedeu
47
47
  def initialize(y = 1, x = 1)
48
48
  @y = (y.nil? || y < 1) ? 1 : y
49
49
  @x = (x.nil? || x < 1) ? 1 : x
50
+
51
+ freeze
50
52
  end
51
53
 
52
54
  # Converts a position into an index for the terminal. An index
@@ -162,7 +162,7 @@ module Vedeu
162
162
 
163
163
  # Return the interfaces for all members of the group.
164
164
  #
165
- # @return [Array<Vedeu::Models::Interface]
165
+ # @return [Array<Vedeu::Interfaces::Interface]
166
166
  def interfaces
167
167
  members.map { |name| Vedeu.interfaces.by_name(name) }
168
168
  end
@@ -10,6 +10,7 @@ module Vedeu
10
10
  end # Vedeu
11
11
 
12
12
  require 'vedeu/input/capture'
13
+ require 'vedeu/input/dsl'
13
14
  require 'vedeu/input/key'
14
15
  require 'vedeu/input/keymap'
15
16
  require 'vedeu/input/keymaps'
@@ -1,13 +1,13 @@
1
1
  module Vedeu
2
2
 
3
- module DSL
3
+ module Keymaps
4
4
 
5
5
  # You can define keymaps by name which matches a defined
6
6
  # interface. When that interface is in focus, keys pressed as part
7
7
  # of this definition will affect that interface. This allows you
8
8
  # to form context driven behaviour for your application.
9
9
  #
10
- class Keymap
10
+ class DSL
11
11
 
12
12
  include Vedeu::Common
13
13
  include Vedeu::DSL
@@ -110,12 +110,12 @@ module Vedeu
110
110
  end
111
111
  alias_method :name=, :name
112
112
 
113
- end # Keymap
113
+ end # DSL
114
114
 
115
- end # DSL
115
+ end # Keymaps
116
116
 
117
117
  # @!method keymap
118
- # @see Vedeu::DSL::Keymap.keymap
119
- def_delegators Vedeu::DSL::Keymap, :keymap
118
+ # @see Vedeu::Keymaps::DSL.keymap
119
+ def_delegators Vedeu::Keymaps::DSL, :keymap
120
120
 
121
121
  end # Vedeu
@@ -0,0 +1,12 @@
1
+ module Vedeu
2
+
3
+ module Interfaces
4
+
5
+ end # Interfaces
6
+
7
+ end # Vedeu
8
+
9
+ require 'vedeu/interfaces/interface'
10
+ require 'vedeu/interfaces/dsl'
11
+ require 'vedeu/interfaces/null'
12
+ require 'vedeu/interfaces/repository'
@@ -1,10 +1,10 @@
1
1
  module Vedeu
2
2
 
3
- module DSL
3
+ module Interfaces
4
4
 
5
5
  # DSL for creating interfaces.
6
6
  #
7
- class Interface
7
+ class DSL
8
8
 
9
9
  include Vedeu::Common
10
10
  include Vedeu::DSL
@@ -32,7 +32,7 @@ module Vedeu
32
32
  # @param block [Proc] A set of attributes which define the
33
33
  # features of the interface.
34
34
  # @raise [Vedeu::Error::RequiresBlock]
35
- # @return [Vedeu::Models::Interface]
35
+ # @return [Vedeu::Interfaces::Interface]
36
36
  # @todo More documentation required.
37
37
  def interface(name, &block)
38
38
  fail Vedeu::Error::RequiresBlock unless block_given?
@@ -45,7 +45,7 @@ module Vedeu
45
45
 
46
46
  attributes = { client: client(&block), name: name }
47
47
 
48
- Vedeu::Models::Interface.build(attributes, &block).store
48
+ Vedeu::Interfaces::Interface.build(attributes, &block).store
49
49
  end
50
50
 
51
51
  private
@@ -193,7 +193,7 @@ module Vedeu
193
193
 
194
194
  # @param name [String|Symbol] The name of the interface to which
195
195
  # this keymap should belong.
196
- # @see Vedeu::DSL::Keymap.keymap
196
+ # @see Vedeu::Keymaps::DSL.keymap
197
197
  def keymap(name = model.name, &block)
198
198
  Vedeu.keymap(name, &block)
199
199
  end
@@ -252,7 +252,7 @@ module Vedeu
252
252
  #
253
253
  # @param name [String|Symbol] The name of the interface model
254
254
  # you wish to use a value from.
255
- # @return [Vedeu::Models::Interface]
255
+ # @return [Vedeu::Interfaces::Interface]
256
256
  def use(name)
257
257
  model.repository.by_name(name)
258
258
  end
@@ -312,12 +312,12 @@ module Vedeu
312
312
  alias_method :z_index, :zindex
313
313
  alias_method :z, :zindex
314
314
 
315
- end # Interface
315
+ end # DSL
316
316
 
317
- end # DSL
317
+ end # Interfaces
318
318
 
319
319
  # @!method interface
320
- # @see Vedeu::DSL::Interface.interface
321
- def_delegators Vedeu::DSL::Interface, :interface
320
+ # @see Vedeu::Interfaces::DSL.interface
321
+ def_delegators Vedeu::Interfaces::DSL, :interface
322
322
 
323
323
  end # Vedeu
@@ -1,6 +1,6 @@
1
1
  module Vedeu
2
2
 
3
- module Models
3
+ module Interfaces
4
4
 
5
5
  # An Interface represents a portion of the terminal defined by
6
6
  # {Vedeu::Geometry::Geometry}.
@@ -39,7 +39,7 @@ module Vedeu
39
39
  # @return [Fixnum]
40
40
  attr_accessor :zindex
41
41
 
42
- # Return a new instance of Vedeu::Models::Interface.
42
+ # Return a new instance of Vedeu::Interfaces::Interface.
43
43
  #
44
44
  # @param attributes [Hash]
45
45
  # @option attributes client [Vedeu::Client]
@@ -48,11 +48,11 @@ module Vedeu
48
48
  # @option attributes group [String]
49
49
  # @option attributes name [String|Symbol]
50
50
  # @option attributes parent [Vedeu::Views::Composition]
51
- # @option attributes repository [Vedeu::Models::Interfaces]
51
+ # @option attributes repository [Vedeu::Interfaces::Repository]
52
52
  # @option attributes style [Vedeu::Presentation::Style]
53
53
  # @option attributes visible [Boolean]
54
54
  # @option attributes zindex [Fixnum]
55
- # @return [Vedeu::Models::Interface]
55
+ # @return [Vedeu::Interfaces::Interface]
56
56
  def initialize(attributes = {})
57
57
  @attributes = defaults.merge!(attributes)
58
58
 
@@ -123,7 +123,7 @@ module Vedeu
123
123
 
124
124
  end # Interface
125
125
 
126
- end # Models
126
+ end # Interfaces
127
127
 
128
128
  # @!method hide_interface
129
129
  # @see Vedeu::Toggleable::ClassMethods#hide
@@ -131,7 +131,7 @@ module Vedeu
131
131
  # @see Vedeu::Toggleable::ClassMethods#show
132
132
  # @!method toggle_interface
133
133
  # @see Vedeu::Toggleable::ClassMethods#toggle
134
- def_delegators Vedeu::Models::Interface, :hide_interface, :show_interface,
134
+ def_delegators Vedeu::Interfaces::Interface, :hide_interface, :show_interface,
135
135
  :toggle_interface
136
136
 
137
137
  end # Vedeu
@@ -1,10 +1,10 @@
1
1
  module Vedeu
2
2
 
3
- module Null
3
+ module Interfaces
4
4
 
5
5
  # Provides a non-existent model to swallow messages.
6
6
  #
7
- class Interface < Vedeu::Null::Generic
7
+ class Null < Vedeu::Null::Generic
8
8
 
9
9
  include Vedeu::Presentation
10
10
 
@@ -12,19 +12,19 @@ module Vedeu
12
12
  # @return [String]
13
13
  attr_reader :attributes
14
14
 
15
- # Returns a new instance of Vedeu::Null::Interface.
15
+ # Returns a new instance of Vedeu::Interfaces::Null.
16
16
  #
17
17
  # @param attributes [Hash<Symbol => void>]
18
18
  # @option attributes name [String|Symbol]
19
- # @return [Vedeu::Null::Interface]
19
+ # @return [Vedeu::Interfaces::Null]
20
20
  def initialize(attributes = {})
21
21
  @attributes = attributes
22
22
  @name = @attributes[:name]
23
23
  @visible = false
24
24
  end
25
25
 
26
- end # Interface
26
+ end # Null
27
27
 
28
- end # Null
28
+ end # Interfaces
29
29
 
30
30
  end # Vedeu
@@ -1,23 +1,23 @@
1
1
  module Vedeu
2
2
 
3
- module Models
3
+ module Interfaces
4
4
 
5
5
  # Allows the storing of interfaces and views.
6
6
  #
7
- class Interfaces < Vedeu::Repositories::Repository
7
+ class Repository < Vedeu::Repositories::Repository
8
8
 
9
9
  singleton_class.send(:alias_method, :interfaces, :repository)
10
10
 
11
- null Vedeu::Null::Interface
12
- real Vedeu::Models::Interface
11
+ null Vedeu::Interfaces::Null
12
+ real Vedeu::Interfaces::Interface
13
13
 
14
14
  # Returns the interfaces in zindex order.
15
15
  #
16
16
  # @example
17
17
  # Vedeu.interfaces.zindexed
18
18
  #
19
- # @return [Array<Vedeu::Models::Interface>]
20
- # @see Vedeu::DSL::Interface#zindex
19
+ # @return [Array<Vedeu::Interfaces::Interface>]
20
+ # @see Vedeu::Interfaces::DSL#zindex
21
21
  def zindexed
22
22
  all.sort_by(&:zindex)
23
23
  end
@@ -26,11 +26,11 @@ module Vedeu
26
26
 
27
27
  class Interface
28
28
 
29
- repo Vedeu::Models::Interfaces.repository
29
+ repo Vedeu::Interfaces::Repository.repository
30
30
 
31
31
  end # Interface
32
32
 
33
- end # Models
33
+ end # Interfaces
34
34
 
35
35
  # Manipulate the repository of interfaces.
36
36
  #
@@ -38,7 +38,7 @@ module Vedeu
38
38
  # Vedeu.interfaces
39
39
  #
40
40
  # @!method interfaces
41
- # @return [Vedeu::Models::Interfaces]
42
- def_delegators Vedeu::Models::Interfaces, :interfaces
41
+ # @return [Vedeu::Interfaces::Repository]
42
+ def_delegators Vedeu::Interfaces::Repository, :interfaces
43
43
 
44
44
  end # Vedeu
@@ -138,21 +138,27 @@ module Vedeu
138
138
  # @return [Hash<Symbol => Array<Symbol>>]
139
139
  def message_types
140
140
  {
141
- config: [:light_yellow, :yellow],
142
- create: [:light_green, :green],
143
- debug: [:light_red, :red],
141
+ create: [:light_cyan, :cyan],
142
+ store: [:light_cyan, :cyan],
143
+ update: [:light_cyan, :cyan],
144
+ reset: [:light_cyan, :cyan],
145
+
146
+ event: [:light_magenta, :magenta],
147
+
148
+ timer: [:light_yellow, :yellow],
149
+
150
+ info: [:white, :default],
151
+ test: [:white, :default],
152
+ debug: [:white, :default],
153
+
154
+ input: [:light_red, :red],
155
+ output: [:light_red, :red],
144
156
  error: [:light_red, :red],
157
+
158
+ config: [:light_blue, :blue],
159
+ dsl: [:light_blue, :blue],
145
160
  editor: [:light_blue, :blue],
146
161
  drb: [:light_blue, :blue],
147
- event: [:light_magenta, :magenta],
148
- info: [:white, :default],
149
- input: [:light_red, :red],
150
- output: [:light_green, :green],
151
- reset: [:light_cyan, :cyan],
152
- store: [:light_cyan, :cyan],
153
- test: [:light_white, :white],
154
- timer: [:light_yellow, :yellow],
155
- update: [:light_cyan, :cyan],
156
162
  }
157
163
  end
158
164
 
@@ -10,7 +10,7 @@ module Vedeu
10
10
  # - Interfaces are added to the collection in the order they are
11
11
  # defined.
12
12
  # - If the interface definition contains `focus!`,
13
- # (see Vedeu::DSL::Interface#focus!) then that interface is
13
+ # (see Vedeu::Interfaces::DSL#focus!) then that interface is
14
14
  # prepended to the list.
15
15
  # - If the `Vedeu.focus_by_name 'some_interface'` declaration is
16
16
  # used, then the list pointer (`current`) is set to the
@@ -4,7 +4,7 @@ module Vedeu
4
4
  # toggled between being shown and hidden.
5
5
  #
6
6
  # Currently using this are: {Vedeu::Cursors::Cursor},
7
- # {Vedeu::Groups::Group} and {Vedeu::Models::Interface}.
7
+ # {Vedeu::Groups::Group} and {Vedeu::Interfaces::Interface}.
8
8
  #
9
9
  module Toggleable
10
10
 
@@ -12,7 +12,5 @@ require 'vedeu/models/views/char'
12
12
  require 'vedeu/models/views/html_char'
13
13
  require 'vedeu/models/views/stream'
14
14
  require 'vedeu/models/views/line'
15
- require 'vedeu/models/interface'
16
- require 'vedeu/models/interfaces'
17
15
  require 'vedeu/models/views/view'
18
16
  require 'vedeu/models/views/composition'