vedeu 0.5.13 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/bin/vedeu_drb_server +1 -0
  4. data/config/rubocop_enabled.yml +2 -2
  5. data/docs/events.md +2 -0
  6. data/docs/getting_started.md +1 -1
  7. data/examples/drb_app.rb +1 -0
  8. data/examples/editor_app.rb +76 -0
  9. data/lib/vedeu/all.rb +13 -7
  10. data/lib/vedeu/{bindings.rb → bindings/bindings.rb} +2 -0
  11. data/lib/vedeu/bindings/focus.rb +66 -0
  12. data/lib/vedeu/bindings/refresh.rb +77 -0
  13. data/lib/vedeu/bindings/system.rb +19 -88
  14. data/lib/vedeu/buffers/buffer.rb +8 -8
  15. data/lib/vedeu/configuration/api.rb +32 -11
  16. data/lib/vedeu/configuration/cli.rb +8 -0
  17. data/lib/vedeu/cursor/move.rb +1 -0
  18. data/lib/vedeu/distributed/templates/default_configuration.vedeu +1 -0
  19. data/lib/vedeu/{dsl.rb → dsl/dsl.rb} +0 -0
  20. data/lib/vedeu/exceptions.rb +1 -1
  21. data/lib/vedeu/geometry/position.rb +28 -0
  22. data/lib/vedeu/input/capture.rb +76 -0
  23. data/lib/vedeu/input/editor/all.rb +19 -0
  24. data/lib/vedeu/input/editor/cropper.rb +74 -0
  25. data/lib/vedeu/input/editor/document.rb +254 -0
  26. data/lib/vedeu/input/editor/documents.rb +18 -0
  27. data/lib/vedeu/input/editor/editor.rb +100 -0
  28. data/lib/vedeu/input/editor/line.rb +143 -0
  29. data/lib/vedeu/input/editor/lines.rb +199 -0
  30. data/lib/vedeu/input/editor/virtual_cursor.rb +167 -0
  31. data/lib/vedeu/input/input.rb +9 -93
  32. data/lib/vedeu/input/input_translator.rb +155 -0
  33. data/lib/vedeu/internal_api.rb +9 -0
  34. data/lib/vedeu/log/lockless_log_device.rb +1 -1
  35. data/lib/vedeu/models/escape.rb +7 -8
  36. data/lib/vedeu/output/direct.rb +59 -0
  37. data/lib/vedeu/output/renderers/terminal.rb +8 -0
  38. data/lib/vedeu/output/viewport.rb +2 -3
  39. data/lib/vedeu/{plugins.rb → plugins/plugins.rb} +0 -0
  40. data/lib/vedeu/refresh/refresh_cursor.rb +1 -0
  41. data/lib/vedeu/{repositories.rb → repositories/repositories.rb} +0 -0
  42. data/lib/vedeu/terminal/content.rb +88 -0
  43. data/lib/vedeu/terminal/mode.rb +79 -0
  44. data/lib/vedeu/{terminal.rb → terminal/terminal.rb} +9 -25
  45. data/lib/vedeu/version.rb +1 -1
  46. data/test/lib/vedeu/{bindings_test.rb → bindings/bindings_test.rb} +0 -0
  47. data/test/lib/vedeu/bindings/focus_test.rb +19 -0
  48. data/test/lib/vedeu/bindings/refresh_test.rb +19 -0
  49. data/test/lib/vedeu/bindings/system_test.rb +1 -6
  50. data/test/lib/vedeu/borders/render_border_test.rb +43 -10
  51. data/test/lib/vedeu/buffers/buffer_test.rb +18 -0
  52. data/test/lib/vedeu/buffers/virtual_buffer_test.rb +15 -0
  53. data/test/lib/vedeu/configuration/api_test.rb +18 -2
  54. data/test/lib/vedeu/configuration/cli_test.rb +5 -0
  55. data/test/lib/vedeu/cursor/move_test.rb +1 -1
  56. data/test/lib/vedeu/dsl/dsl_test.rb +8 -0
  57. data/test/lib/vedeu/dsl/shared_test.rb +12 -0
  58. data/test/lib/vedeu/{output → esc}/esc_test.rb +0 -0
  59. data/test/lib/vedeu/geometry/position_test.rb +56 -0
  60. data/test/lib/vedeu/input/capture_test.rb +63 -0
  61. data/test/lib/vedeu/input/editor/cropper_test.rb +82 -0
  62. data/test/lib/vedeu/input/editor/document_test.rb +190 -0
  63. data/test/lib/vedeu/input/editor/documents_test.rb +17 -0
  64. data/test/lib/vedeu/input/editor/editor_test.rb +170 -0
  65. data/test/lib/vedeu/input/editor/line_test.rb +333 -0
  66. data/test/lib/vedeu/input/editor/lines_test.rb +561 -0
  67. data/test/lib/vedeu/input/editor/virtual_cursor_test.rb +184 -0
  68. data/test/lib/vedeu/input/input_test.rb +20 -4
  69. data/test/lib/vedeu/input/input_translator_test.rb +32 -0
  70. data/test/lib/vedeu/internal_api_test.rb +1 -0
  71. data/test/lib/vedeu/models/escape_test.rb +6 -6
  72. data/test/lib/vedeu/models/views/view_test.rb +15 -2
  73. data/test/lib/vedeu/null/null_test.rb +8 -0
  74. data/test/lib/vedeu/output/direct_test.rb +70 -0
  75. data/test/lib/vedeu/{plugins_test.rb → plugins/plugins_test.rb} +0 -0
  76. data/test/lib/vedeu/{repositories_test.rb → repositories/repositories_test.rb} +0 -0
  77. data/test/lib/vedeu/terminal/content_test.rb +100 -0
  78. data/test/lib/vedeu/terminal/mode_test.rb +95 -0
  79. data/test/lib/vedeu/{terminal_test.rb → terminal/terminal_test.rb} +23 -23
  80. data/test/test_helper.rb +1 -0
  81. metadata +67 -20
  82. data/lib/vedeu/terminal_mode.rb +0 -59
  83. data/test/lib/vedeu/terminal_mode_test.rb +0 -72
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27a3b30fd311b0147e59815b8665b9b0cfd337d9
4
- data.tar.gz: 1dd71d249cb99304d00f7cb51a44345f73665b88
3
+ metadata.gz: 28c51799d818421857c42dfc95970d49794fa75f
4
+ data.tar.gz: dd35047e639be0064234964695a8b4f853ea4e54
5
5
  SHA512:
6
- metadata.gz: 245b56f9f631573bad0ca75880c56b4f72b3bee92068ca49d67a94bf4435cd78d4111c747c57b55ec77bb9d1ee3f09790f24ee9e7738a744cee92c152ed7db44
7
- data.tar.gz: 0a9b9d0bf6ada6f16396c56f6a683e5f104bddab17632f5a85c76765bb176e7b5053fc0f91e55a31ca2adbd7919a64e9056c4cb4850b0fc8e6f848fd0e5dc482
6
+ metadata.gz: ae7a0e4eca0ba65eb6e285681147f9938fba540bda076c10c09a47bcd8fae0eee253508f335540bd049be3ad85885974103332012ca4c878e526669fd0337fb8
7
+ data.tar.gz: 93cb36006d06bdf9acfd10fca1c527bdfb9cbd12eb5d73ee4feae73bb51a33e49bc5fdbd8a34d13a64ef905adac9493605711ba21072f9220750d588fd953ce0
data/.rubocop.yml CHANGED
@@ -96,6 +96,9 @@ Style/Next:
96
96
  - skip_modifier_ifs
97
97
  - always
98
98
 
99
+ Style/SpaceAroundOperators:
100
+ Enabled: false
101
+
99
102
  Style/SpaceAroundEqualsInParameterDefault:
100
103
  EnforcedStyle: space
101
104
 
@@ -180,3 +183,6 @@ Lint/DefEndAlignment:
180
183
  - start_of_line
181
184
  - def
182
185
 
186
+ Lint/Eval:
187
+ Description: 'The use of eval represents a serious security risk.'
188
+ Enabled: false
data/bin/vedeu_drb_server CHANGED
@@ -20,6 +20,7 @@ class VedeuTestApplication
20
20
 
21
21
  # terminal_mode :raw
22
22
  # cooked!
23
+ # fake!
23
24
  # raw!
24
25
 
25
26
  # run_once!
@@ -609,7 +609,7 @@ Style/SpaceAroundEqualsInParameterDefault:
609
609
  Style/SpaceAroundOperators:
610
610
  Description: 'Use a single space around operators.'
611
611
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
612
- Enabled: true
612
+ Enabled: false
613
613
 
614
614
  Style/SpaceBeforeModifierKeyword:
615
615
  Description: 'Put a space before the modifier keyword.'
@@ -858,7 +858,7 @@ Lint/EnsureReturn:
858
858
 
859
859
  Lint/Eval:
860
860
  Description: 'The use of eval represents a serious security risk.'
861
- Enabled: true
861
+ Enabled: false
862
862
 
863
863
  Lint/HandleExceptions:
864
864
  Description: "Don't suppress exception."
data/docs/events.md CHANGED
@@ -7,6 +7,8 @@ See {Vedeu::Bindings::Application}
7
7
 
8
8
  ## System Events
9
9
 
10
+ See {Vedeu::Bindings::Focus}
11
+ See {Vedeu::Bindings::Refresh}
10
12
  See {Vedeu::Bindings::System}
11
13
 
12
14
  ## DRB Events
@@ -94,7 +94,7 @@ in focus. By default the global keymap contains a few simple definitions:
94
94
 
95
95
  - **`<esc>`**
96
96
 
97
- **Mode Switch**. Toggle between cooked and raw terminal modes.
97
+ **Mode Switch**. Toggle between cooked, fake and raw terminal modes.
98
98
 
99
99
  - **`<tab>`**
100
100
 
data/examples/drb_app.rb CHANGED
@@ -27,6 +27,7 @@ class VedeuTestApplication
27
27
 
28
28
  # terminal_mode :raw
29
29
  # cooked!
30
+ # fake!
30
31
  # raw!
31
32
 
32
33
  # run_once!
@@ -0,0 +1,76 @@
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
+ # An example application to demonstrate colours, cursor and interface movement,
9
+ # maximising/unmaximising of interfaces and toggling of cursors and interfaces.
10
+ #
11
+ # If you have cloned this repository from GitHub, you can run this example:
12
+ #
13
+ # ./examples/material_colours_app.rb
14
+ #
15
+ # Running this application once, and immediately exiting produces the diagram
16
+ # at `./examples/material_colours_app_20150721.svg`. Hopefully this will help
17
+ # you to understand how parts of Vedeu work together. Questions are always
18
+ # welcome at `https://github.com/gavinlaking/vedeu/issues`
19
+ #
20
+ class VedeuEditorApp
21
+
22
+ Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
23
+
24
+ # Be aware that running an application with debugging enabled will affect
25
+ # performance.
26
+ Vedeu.configure do
27
+ # debug!
28
+ fake!
29
+ log '/tmp/vedeu_editor_app.log'
30
+ # renderers Vedeu::Renderers::File.new
31
+ end
32
+
33
+ Vedeu.interface 'main_interface' do
34
+ border 'main_interface' do
35
+ colour foreground: '#ffffff', background: :default
36
+ title 'Editor'
37
+ caption('Ctrl+C = Quit')
38
+ end
39
+ colour foreground: '#ffffff', background: :default
40
+ cursor!
41
+ geometry 'main_interface' do
42
+ x columns(1)
43
+ xn columns(11)
44
+ y rows(1)
45
+ yn rows(1) + 4
46
+ end
47
+ zindex 1
48
+ end
49
+
50
+ Vedeu.keymap('_global_') do
51
+ key(:up) { Vedeu.trigger(:_cursor_up_) }
52
+ key(:right) { Vedeu.trigger(:_cursor_right_) }
53
+ key(:down) { Vedeu.trigger(:_cursor_down_) }
54
+ key(:left) { Vedeu.trigger(:_cursor_left_) }
55
+
56
+ key('q') { Vedeu.trigger(:_exit_) }
57
+ key(:escape) { Vedeu.trigger(:_mode_switch_) }
58
+ key(:shift_tab) { Vedeu.trigger(:_focus_prev_) }
59
+ key(:tab) { Vedeu.trigger(:_focus_next_) }
60
+ end
61
+
62
+ Vedeu.renders do
63
+ view 'main_interface' do
64
+ line { line '' }
65
+ end
66
+ end
67
+
68
+ Vedeu.focus_by_name 'main_interface'
69
+
70
+ def self.start(argv = ARGV)
71
+ Vedeu::Launcher.execute!(argv)
72
+ end
73
+
74
+ end # VedeuEditorApp
75
+
76
+ VedeuEditorApp.start(ARGV)
data/lib/vedeu/all.rb CHANGED
@@ -9,14 +9,16 @@ require 'vedeu/log/debug'
9
9
  require 'vedeu/log/timer'
10
10
  require 'vedeu/runtime/traps'
11
11
  require 'vedeu/common'
12
- require 'vedeu/terminal_mode'
13
12
  require 'vedeu/runtime/router'
14
13
 
15
14
  require 'vedeu/configuration/cli'
16
15
  require 'vedeu/configuration/api'
17
16
  require 'vedeu/configuration/configuration'
18
17
 
19
- require 'vedeu/terminal'
18
+ require 'vedeu/terminal/mode'
19
+ require 'vedeu/terminal/terminal'
20
+ require 'vedeu/terminal/content'
21
+
20
22
  require 'vedeu/runtime/main_loop'
21
23
  require 'vedeu/runtime/flags'
22
24
  require 'vedeu/runtime/application'
@@ -26,7 +28,7 @@ require 'vedeu/models/toggleable'
26
28
  require 'vedeu/repositories/collection'
27
29
  require 'vedeu/input/keys'
28
30
  require 'vedeu/events/event_collection'
29
- require 'vedeu/repositories'
31
+ require 'vedeu/repositories/repositories'
30
32
 
31
33
  require 'vedeu/repositories/model'
32
34
  require 'vedeu/repositories/store'
@@ -123,7 +125,7 @@ require 'vedeu/distributed/client'
123
125
  require 'vedeu/distributed/subprocess'
124
126
  require 'vedeu/distributed/test_application'
125
127
 
126
- require 'vedeu/dsl'
128
+ require 'vedeu/dsl/dsl'
127
129
  require 'vedeu/dsl/shared'
128
130
  require 'vedeu/dsl/use'
129
131
  require 'vedeu/dsl/presentation'
@@ -139,16 +141,19 @@ require 'vedeu/dsl/menu'
139
141
  require 'vedeu/dsl/stream'
140
142
  require 'vedeu/dsl/view'
141
143
 
144
+ require 'vedeu/input/input_translator'
142
145
  require 'vedeu/input/mapper'
143
146
  require 'vedeu/input/key'
144
147
  require 'vedeu/input/input'
145
148
  require 'vedeu/input/keymap'
146
149
  require 'vedeu/input/keymaps'
150
+ require 'vedeu/input/editor/all'
147
151
 
148
152
  require 'vedeu/borders/render_border'
149
153
  require 'vedeu/borders/border'
150
154
  require 'vedeu/borders/borders'
151
155
 
156
+ require 'vedeu/output/direct'
152
157
  require 'vedeu/output/clear/named_group'
153
158
  require 'vedeu/output/clear/named_interface'
154
159
  require 'vedeu/output/presentation'
@@ -168,10 +173,11 @@ require 'vedeu/bindings/application'
168
173
  require 'vedeu/bindings/drb'
169
174
  require 'vedeu/bindings/menus'
170
175
  require 'vedeu/bindings/movement'
176
+ require 'vedeu/bindings/focus'
177
+ require 'vedeu/bindings/refresh'
171
178
  require 'vedeu/bindings/system'
172
179
  require 'vedeu/bindings/visibility'
180
+ require 'vedeu/bindings/bindings'
173
181
 
174
- require 'vedeu/bindings'
175
-
176
- require 'vedeu/plugins'
182
+ require 'vedeu/plugins/plugins'
177
183
  require 'vedeu/plugins/plugin'
@@ -22,6 +22,8 @@ module Vedeu
22
22
  Vedeu::Bindings::Movement.setup!
23
23
  Vedeu::Bindings::Menus.setup!
24
24
  Vedeu::Bindings::DRB.setup!
25
+ Vedeu::Bindings::Focus.setup!
26
+ Vedeu::Bindings::Refresh.setup!
25
27
  Vedeu::Bindings::System.setup!
26
28
 
27
29
  true
@@ -0,0 +1,66 @@
1
+ module Vedeu
2
+
3
+ module Bindings
4
+
5
+ # Creates system events which when called provide a variety of core
6
+ # functions and behaviours. They are soft-namespaced using underscores.
7
+ #
8
+ # @note
9
+ # Unbinding any of these events is likely to cause problems, so I would
10
+ # advise leaving them alone. A safe rule: when the name starts with an
11
+ # underscore, it's probably used by Vedeu internally.
12
+ #
13
+ # :nocov:
14
+ module Focus
15
+
16
+ extend self
17
+
18
+ # Setup events relating to running Vedeu. This method is called by Vedeu.
19
+ #
20
+ # @return [TrueClass]
21
+ def setup!
22
+ focus_by_name!
23
+ focus_next!
24
+ focus_prev!
25
+ end
26
+
27
+ private
28
+
29
+ # When triggered with an interface name will focus that interface and
30
+ # restore the cursor position and visibility.
31
+ #
32
+ # @example
33
+ # Vedeu.trigger(:_focus_by_name_, name)
34
+ #
35
+ # @return [TrueClass]
36
+ def focus_by_name!
37
+ Vedeu.bind(:_focus_by_name_) { |name| Vedeu.focus_by_name(name) }
38
+ end
39
+
40
+ # When triggered will focus the next interface and restore the cursor
41
+ # position and visibility.
42
+ #
43
+ # @example
44
+ # Vedeu.trigger(:_focus_next_)
45
+ #
46
+ # @return [TrueClass]
47
+ def focus_next!
48
+ Vedeu.bind(:_focus_next_) { Vedeu.focus_next }
49
+ end
50
+
51
+ # When triggered will focus the previous interface and restore the cursor
52
+ # position and visibility.
53
+ #
54
+ # @example
55
+ # Vedeu.trigger(:_focus_prev_)
56
+ #
57
+ # @return [TrueClass]
58
+ def focus_prev!
59
+ Vedeu.bind(:_focus_prev_) { Vedeu.focus_previous }
60
+ end
61
+
62
+ end # Focus
63
+
64
+ end # Bindings
65
+
66
+ end # Vedeu
@@ -0,0 +1,77 @@
1
+ module Vedeu
2
+
3
+ module Bindings
4
+
5
+ # Creates system events which when called provide a variety of core
6
+ # functions and behaviours. They are soft-namespaced using underscores.
7
+ #
8
+ # @note
9
+ # Unbinding any of these events is likely to cause problems, so I would
10
+ # advise leaving them alone. A safe rule: when the name starts with an
11
+ # underscore, it's probably used by Vedeu internally.
12
+ #
13
+ # :nocov:
14
+ module Refresh
15
+
16
+ extend self
17
+
18
+ # Setup events relating to running Vedeu. This method is called by Vedeu.
19
+ #
20
+ # @return [TrueClass]
21
+ def setup!
22
+ refresh!
23
+ refresh_cursor!
24
+ refresh_group!
25
+ end
26
+
27
+ private
28
+
29
+ # Refreshes all registered interfaces or the named interface.
30
+ #
31
+ # @note
32
+ # The interfaces will be refreshed in z-index order, meaning that
33
+ # interfaces with a lower z-index will be drawn first. This means
34
+ # overlapping interfaces will be drawn as specified.
35
+ # Hidden interfaces will be still refreshed in memory but not shown.
36
+ #
37
+ # @example
38
+ # Vedeu.trigger(:_refresh_)
39
+ # Vedeu.trigger(:_refresh_, name)
40
+ #
41
+ # @return [TrueClass]
42
+ def refresh!
43
+ Vedeu.bind(:_refresh_) do |name|
44
+ name ? Vedeu::RefreshBuffer.by_name(name) : Vedeu::Refresh.all
45
+ end
46
+ end
47
+
48
+ # Will cause the named cursor to refresh, or the cursor of the interface
49
+ # which is currently in focus.
50
+ #
51
+ # @example
52
+ # Vedeu.trigger(:_refresh_cursor_, name)
53
+ #
54
+ # @return [TrueClass]
55
+ def refresh_cursor!
56
+ Vedeu.bind(:_refresh_cursor_) do |name|
57
+ Vedeu::RefreshCursor.by_name(name)
58
+ end
59
+ end
60
+
61
+ # Will cause all interfaces in the named group to refresh.
62
+ #
63
+ # @example
64
+ # Vedeu.trigger(:_refresh_group_, name)
65
+ #
66
+ # @return [TrueClass]
67
+ def refresh_group!
68
+ Vedeu.bind(:_refresh_group_) do |name|
69
+ Vedeu::RefreshGroup.by_name(name)
70
+ end
71
+ end
72
+
73
+ end # Refresh
74
+
75
+ end # Bindings
76
+
77
+ end # Vedeu
@@ -22,18 +22,13 @@ module Vedeu
22
22
  cleanup!
23
23
  clear!
24
24
  command!
25
+ editor!
25
26
  exit!
26
- focus_next!
27
- focus_prev!
28
- focus_by_name!
29
27
  initialize!
30
28
  keypress!
31
29
  log!
32
30
  maximise!
33
31
  mode_switch!
34
- refresh!
35
- refresh_cursor!
36
- refresh_group!
37
32
  resize!
38
33
  unmaximise!
39
34
  end
@@ -87,49 +82,29 @@ module Vedeu
87
82
  Vedeu.bind(:_command_) { |command| Vedeu.trigger(:command, command) }
88
83
  end
89
84
 
90
- # When triggered, Vedeu will trigger a `:cleanup` event which you can
91
- # define (to save files, etc) and attempt to exit.
92
- #
93
- # @example
94
- # Vedeu.trigger(:_exit_)
95
- # Vedeu.exit
96
- #
97
- # @return [TrueClass]
98
- def exit!
99
- Vedeu.bind(:_exit_) { Vedeu::Application.stop }
100
- end
101
-
102
- # When triggered with an interface name will focus that interface and
103
- # restore the cursor position and visibility.
85
+ # This event is called by {Vedeu::Input#capture}. When invoked, the
86
+ # key will be passed to the editor for currently focussed view.
104
87
  #
105
88
  # @example
106
- # Vedeu.trigger(:_focus_by_name_, name)
89
+ # Vedeu.trigger(:_editor_, key)
107
90
  #
108
91
  # @return [TrueClass]
109
- def focus_by_name!
110
- Vedeu.bind(:_focus_by_name_) { |name| Vedeu.focus_by_name(name) }
111
- end
112
-
113
- # When triggered will focus the next interface and restore the cursor
114
- # position and visibility.
115
- #
116
- # @example
117
- # Vedeu.trigger(:_focus_next_)
118
- #
119
- # @return [TrueClass]
120
- def focus_next!
121
- Vedeu.bind(:_focus_next_) { Vedeu.focus_next }
92
+ def editor!
93
+ Vedeu.bind(:_editor_) do |key|
94
+ Vedeu::Editor::Editor.keypress(name: Vedeu.focus, input: key)
95
+ end
122
96
  end
123
97
 
124
- # When triggered will focus the previous interface and restore the cursor
125
- # position and visibility.
98
+ # When triggered, Vedeu will trigger a `:cleanup` event which you can
99
+ # define (to save files, etc) and attempt to exit.
126
100
  #
127
101
  # @example
128
- # Vedeu.trigger(:_focus_prev_)
102
+ # Vedeu.trigger(:_exit_)
103
+ # Vedeu.exit
129
104
  #
130
105
  # @return [TrueClass]
131
- def focus_prev!
132
- Vedeu.bind(:_focus_prev_) { Vedeu.focus_previous }
106
+ def exit!
107
+ Vedeu.bind(:_exit_) { Vedeu::Application.stop }
133
108
  end
134
109
 
135
110
  # Vedeu triggers this event when it is ready to enter the main loop.
@@ -183,11 +158,11 @@ module Vedeu
183
158
  end
184
159
  end
185
160
 
186
- # When triggered (after the user presses `escape`), Vedeu switches from a
187
- # "raw mode" terminal to a "cooked mode" terminal. The idea here being
188
- # that the raw mode is for single keypress actions, whilst cooked mode
189
- # allows the user to enter more elaborate commands- such as commands with
190
- # arguments.
161
+ # When triggered (by default, after the user presses `escape`), Vedeu
162
+ # switches between modes of the terminal. The idea here being
163
+ # that the raw mode is for single keypress actions, whilst fake and cooked
164
+ # modes allow the user to enter more elaborate commands- such as commands
165
+ # with arguments.
191
166
  #
192
167
  # @example
193
168
  # Vedeu.trigger(:_mode_switch_)
@@ -197,50 +172,6 @@ module Vedeu
197
172
  Vedeu.bind(:_mode_switch_) { fail Vedeu::ModeSwitch }
198
173
  end
199
174
 
200
- # Refreshes all registered interfaces or the named interface.
201
- #
202
- # @note
203
- # The interfaces will be refreshed in z-index order, meaning that
204
- # interfaces with a lower z-index will be drawn first. This means
205
- # overlapping interfaces will be drawn as specified.
206
- # Hidden interfaces will be still refreshed in memory but not shown.
207
- #
208
- # @example
209
- # Vedeu.trigger(:_refresh_)
210
- # Vedeu.trigger(:_refresh_, name)
211
- #
212
- # @return [TrueClass]
213
- def refresh!
214
- Vedeu.bind(:_refresh_) do |name|
215
- name ? Vedeu::RefreshBuffer.by_name(name) : Vedeu::Refresh.all
216
- end
217
- end
218
-
219
- # Will cause the named cursor to refresh, or the cursor of the interface
220
- # which is currently in focus.
221
- #
222
- # @example
223
- # Vedeu.trigger(:_refresh_cursor_, name)
224
- #
225
- # @return [TrueClass]
226
- def refresh_cursor!
227
- Vedeu.bind(:_refresh_cursor_) do |name|
228
- Vedeu::RefreshCursor.by_name(name)
229
- end
230
- end
231
-
232
- # Will cause all interfaces in the named group to refresh.
233
- #
234
- # @example
235
- # Vedeu.trigger(:_refresh_group_, name)
236
- #
237
- # @return [TrueClass]
238
- def refresh_group!
239
- Vedeu.bind(:_refresh_group_) do |name|
240
- Vedeu::RefreshGroup.by_name(name)
241
- end
242
- end
243
-
244
175
  # When triggered will cause Vedeu to trigger the `:_clear_` and
245
176
  # `:_refresh_` events. Please see those events for their behaviour.
246
177
  #