vedeu 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +9 -0
- data/README.md +1 -1
- data/docs/api.md +60 -67
- data/docs/configuration.md +8 -5
- data/docs/events.md +31 -15
- data/docs/events/application.md +12 -0
- data/docs/events/document.md +57 -0
- data/docs/events/drb.md +43 -0
- data/docs/events/focus.md +24 -0
- data/docs/events/menu.md +57 -0
- data/docs/events/movement.md +57 -0
- data/docs/events/refresh.md +25 -0
- data/docs/events/system.md +90 -0
- data/docs/events/visibility.md +68 -0
- data/lib/vedeu.rb +2 -2
- data/lib/vedeu/all.rb +3 -2
- data/lib/vedeu/api.rb +18 -18
- data/lib/vedeu/application/controller.rb +1 -1
- data/lib/vedeu/application/helper.rb +1 -1
- data/lib/vedeu/application/view.rb +1 -1
- data/lib/vedeu/bindings/application.rb +1 -12
- data/lib/vedeu/bindings/bindings.rb +3 -1
- data/lib/vedeu/bindings/document.rb +9 -62
- data/lib/vedeu/bindings/drb.rb +12 -56
- data/lib/vedeu/bindings/focus.rb +3 -28
- data/lib/vedeu/bindings/menus.rb +10 -66
- data/lib/vedeu/bindings/movement.rb +4 -69
- data/lib/vedeu/bindings/refresh.rb +3 -33
- data/lib/vedeu/bindings/system.rb +14 -100
- data/lib/vedeu/bindings/visibility.rb +20 -71
- data/lib/vedeu/borders/all.rb +4 -3
- data/lib/vedeu/borders/border.rb +39 -33
- data/lib/vedeu/borders/dsl.rb +40 -33
- data/lib/vedeu/borders/null.rb +2 -2
- data/lib/vedeu/borders/render.rb +29 -24
- data/lib/vedeu/borders/repository.rb +2 -2
- data/lib/vedeu/buffers/all.rb +8 -7
- data/lib/vedeu/buffers/buffer.rb +47 -39
- data/lib/vedeu/buffers/null.rb +2 -2
- data/lib/vedeu/buffers/refresh.rb +4 -3
- data/lib/vedeu/buffers/virtual_buffer.rb +122 -118
- data/lib/vedeu/buffers/virtual_buffers.rb +62 -56
- data/lib/vedeu/colours/background.rb +2 -1
- data/lib/vedeu/colours/colour.rb +21 -19
- data/lib/vedeu/colours/foreground.rb +2 -1
- data/lib/vedeu/colours/repository.rb +6 -5
- data/lib/vedeu/colours/translator.rb +39 -35
- data/lib/vedeu/configuration/api.rb +59 -51
- data/lib/vedeu/configuration/cli.rb +9 -7
- data/lib/vedeu/configuration/configuration.rb +41 -32
- data/lib/vedeu/cursors/cursor.rb +1 -1
- data/lib/vedeu/cursors/refresh.rb +20 -16
- data/lib/vedeu/distributed/server.rb +8 -6
- data/lib/vedeu/distributed/subprocess.rb +90 -86
- data/lib/vedeu/distributed/uri.rb +4 -3
- data/lib/vedeu/dsl/composition.rb +2 -2
- data/lib/vedeu/dsl/group.rb +4 -4
- data/lib/vedeu/dsl/interface.rb +5 -5
- data/lib/vedeu/dsl/presentation.rb +2 -2
- data/lib/vedeu/dsl/text.rb +1 -1
- data/lib/vedeu/editor/cropper.rb +4 -4
- data/lib/vedeu/editor/cursor.rb +6 -4
- data/lib/vedeu/editor/document.rb +20 -18
- data/lib/vedeu/editor/editor.rb +2 -2
- data/lib/vedeu/editor/line.rb +10 -5
- data/lib/vedeu/editor/lines.rb +2 -2
- data/lib/vedeu/internal_api.rb +4 -4
- data/lib/vedeu/models/focus.rb +197 -191
- data/lib/vedeu/models/group.rb +171 -159
- data/lib/vedeu/models/groups.rb +14 -10
- data/lib/vedeu/models/interface.rb +116 -110
- data/lib/vedeu/models/interfaces.rb +24 -20
- data/lib/vedeu/models/toggleable.rb +4 -4
- data/lib/vedeu/models/views/char.rb +1 -1
- data/lib/vedeu/models/views/composition.rb +1 -1
- data/lib/vedeu/models/views/line.rb +1 -1
- data/lib/vedeu/models/views/stream.rb +1 -1
- data/lib/vedeu/models/views/view.rb +1 -1
- data/lib/vedeu/null/interface.rb +1 -1
- data/lib/vedeu/null/view.rb +1 -1
- data/lib/vedeu/output/clear/named_interface.rb +1 -1
- data/lib/vedeu/output/compressor.rb +78 -73
- data/lib/vedeu/output/direct.rb +61 -57
- data/lib/vedeu/output/output.rb +34 -29
- data/lib/vedeu/output/{presentation.rb → presentation/presentation.rb} +2 -1
- data/lib/vedeu/output/presentation/style.rb +64 -18
- data/lib/vedeu/output/presentation/styles.rb +39 -0
- data/lib/vedeu/output/renderers/html.rb +2 -2
- data/lib/vedeu/output/renderers/json.rb +2 -1
- data/lib/vedeu/output/renderers/terminal.rb +3 -3
- data/lib/vedeu/output/renderers/text.rb +3 -3
- data/lib/vedeu/output/text.rb +186 -180
- data/lib/vedeu/output/wordwrap.rb +142 -138
- data/lib/vedeu/refresh/refresh.rb +2 -2
- data/lib/vedeu/templating/helpers.rb +11 -6
- data/lib/vedeu/templating/view_template.rb +1 -1
- data/lib/vedeu/terminal/terminal.rb +2 -2
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/borders/render_test.rb +1 -1
- data/test/lib/vedeu/buffers/buffer_test.rb +16 -14
- data/test/lib/vedeu/buffers/virtual_buffer_test.rb +105 -101
- data/test/lib/vedeu/buffers/virtual_buffers_test.rb +43 -39
- data/test/lib/vedeu/colours/colour_test.rb +4 -4
- data/test/lib/vedeu/cursors/cursor_test.rb +2 -2
- data/test/lib/vedeu/cursors/repository_test.rb +3 -3
- data/test/lib/vedeu/distributed/subprocess_test.rb +33 -29
- data/test/lib/vedeu/dsl/group_test.rb +3 -3
- data/test/lib/vedeu/dsl/interface_test.rb +6 -5
- data/test/lib/vedeu/dsl/line_test.rb +4 -2
- data/test/lib/vedeu/dsl/presentation_test.rb +2 -2
- data/test/lib/vedeu/dsl/text_test.rb +8 -8
- data/test/lib/vedeu/editor/document_test.rb +10 -6
- data/test/lib/vedeu/input/keymap_test.rb +1 -10
- data/test/lib/vedeu/models/focus_test.rb +177 -170
- data/test/lib/vedeu/models/group_test.rb +99 -95
- data/test/lib/vedeu/models/groups_test.rb +13 -9
- data/test/lib/vedeu/models/interface_test.rb +93 -87
- data/test/lib/vedeu/models/interfaces_test.rb +24 -20
- data/test/lib/vedeu/models/views/char_test.rb +2 -2
- data/test/lib/vedeu/models/views/line_test.rb +11 -7
- data/test/lib/vedeu/models/views/stream_test.rb +1 -1
- data/test/lib/vedeu/models/views/view_test.rb +1 -1
- data/test/lib/vedeu/output/clear/named_group_test.rb +1 -1
- data/test/lib/vedeu/output/clear/named_interface_test.rb +3 -1
- data/test/lib/vedeu/output/compressor_test.rb +126 -122
- data/test/lib/vedeu/output/direct_test.rb +49 -43
- data/test/lib/vedeu/output/output_test.rb +35 -31
- data/test/lib/vedeu/output/{presentation_test.rb → presentation/presentation_test.rb} +11 -7
- data/test/lib/vedeu/output/presentation/style_test.rb +88 -48
- data/test/lib/vedeu/output/presentation/styles_test.rb +84 -0
- data/test/lib/vedeu/output/text_test.rb +109 -105
- data/test/lib/vedeu/output/viewport_test.rb +3 -1
- data/test/lib/vedeu/output/wordwrap_test.rb +209 -205
- data/test/lib/vedeu/refresh/refresh_test.rb +3 -1
- data/test/lib/vedeu/templating/helpers_test.rb +6 -6
- data/test/lib/vedeu/templating/view_template_test.rb +1 -1
- metadata +17 -8
- data/lib/vedeu/output/style.rb +0 -76
- data/test/lib/vedeu/output/style_test.rb +0 -120
data/lib/vedeu/bindings/drb.rb
CHANGED
@@ -4,7 +4,6 @@ module Vedeu
|
|
4
4
|
|
5
5
|
# System events relating to the DRb server implementation.
|
6
6
|
#
|
7
|
-
# :nocov:
|
8
7
|
module DRB
|
9
8
|
|
10
9
|
extend self
|
@@ -25,14 +24,7 @@ module Vedeu
|
|
25
24
|
|
26
25
|
private
|
27
26
|
|
28
|
-
#
|
29
|
-
# application as long as it has the DRb server running.
|
30
|
-
#
|
31
|
-
# @example
|
32
|
-
# Vedeu.trigger(:_drb_input_, data, type)
|
33
|
-
#
|
34
|
-
# @return [TrueClass]
|
35
|
-
# @see Vedeu::Distributed::Server#input
|
27
|
+
# See {file:docs/events/drb.md#\_drb_input_}
|
36
28
|
def drb_input!
|
37
29
|
Vedeu.bind(:_drb_input_) do |data, type|
|
38
30
|
Vedeu.log(type: :drb, message: "Sending input (#{type})")
|
@@ -45,78 +37,42 @@ module Vedeu
|
|
45
37
|
end
|
46
38
|
end
|
47
39
|
|
48
|
-
#
|
49
|
-
# Vedeu.trigger(:_drb_retrieve_output_)
|
50
|
-
#
|
51
|
-
# @todo This event queries Vedeu. Events should only be
|
52
|
-
# commands.
|
53
|
-
#
|
54
|
-
# @return [TrueClass]
|
40
|
+
# See {file:docs/events/drb.md#\_drb_retrieve_output_}
|
55
41
|
def drb_retrieve_output!
|
56
|
-
Vedeu.bind(:_drb_retrieve_output_)
|
42
|
+
Vedeu.bind(:_drb_retrieve_output_) do
|
43
|
+
Vedeu::Buffers::VirtualBuffers.retrieve
|
44
|
+
end
|
57
45
|
end
|
58
46
|
|
59
|
-
#
|
60
|
-
# running application's virtual buffer.
|
61
|
-
#
|
62
|
-
# @example
|
63
|
-
# Vedeu.trigger(:_drb_store_output_, data)
|
64
|
-
#
|
65
|
-
# @return [TrueClass]
|
47
|
+
# See {file:docs/events/drb.md#\_drb_store_output_}
|
66
48
|
def drb_store_output!
|
67
49
|
Vedeu.bind(:_drb_store_output_) do |data|
|
68
|
-
Vedeu::VirtualBuffers
|
50
|
+
Vedeu::Buffers::VirtualBuffers
|
51
|
+
.store(Vedeu::Buffers::VirtualBuffer.output(data))
|
69
52
|
end
|
70
53
|
end
|
71
54
|
|
72
|
-
#
|
73
|
-
# restart.
|
74
|
-
#
|
75
|
-
# @example
|
76
|
-
# Vedeu.trigger(:_drb_restart_)
|
77
|
-
# Vedeu.drb_restart
|
78
|
-
#
|
79
|
-
# @return [TrueClass]
|
55
|
+
# See {file:docs/events/drb.md#\_drb_restart_}
|
80
56
|
def drb_restart!
|
81
57
|
Vedeu.bind(:_drb_restart_) { Vedeu::Distributed::Server.restart }
|
82
58
|
end
|
83
59
|
|
84
|
-
#
|
85
|
-
#
|
86
|
-
# @example
|
87
|
-
# Vedeu.trigger(:_drb_start_)
|
88
|
-
# Vedeu.drb_start
|
89
|
-
#
|
90
|
-
# @return [TrueClass]
|
60
|
+
# See {file:docs/events/drb.md#\_drb_start_}
|
91
61
|
def drb_start!
|
92
62
|
Vedeu.bind(:_drb_start_) { Vedeu::Distributed::Server.start }
|
93
63
|
end
|
94
64
|
|
95
|
-
#
|
96
|
-
# application.
|
97
|
-
#
|
98
|
-
# @example
|
99
|
-
# Vedeu.trigger(:_drb_status_)
|
100
|
-
# Vedeu.drb_status
|
101
|
-
#
|
102
|
-
# @return [TrueClass]
|
65
|
+
# See {file:docs/events/drb.md#\_drb_status_}
|
103
66
|
def drb_status!
|
104
67
|
Vedeu.bind(:_drb_status_) { Vedeu::Distributed::Server.status }
|
105
68
|
end
|
106
69
|
|
107
|
-
#
|
108
|
-
#
|
109
|
-
# @example
|
110
|
-
# Vedeu.trigger(:_drb_stop_)
|
111
|
-
# Vedeu.drb_stop
|
112
|
-
#
|
113
|
-
# @return [TrueClass]
|
70
|
+
# See {file:docs/events/drb.md#\_drb_stop_}
|
114
71
|
def drb_stop!
|
115
72
|
Vedeu.bind(:_drb_stop_) { Vedeu::Distributed::Server.stop }
|
116
73
|
end
|
117
74
|
|
118
75
|
end # DRB
|
119
|
-
# :nocov:
|
120
76
|
|
121
77
|
end # Bindings
|
122
78
|
|
data/lib/vedeu/bindings/focus.rb
CHANGED
@@ -2,11 +2,6 @@ module Vedeu
|
|
2
2
|
|
3
3
|
module Bindings
|
4
4
|
|
5
|
-
# Creates system events which when called provide a variety of
|
6
|
-
# core functions and behaviours. They are soft-namespaced using
|
7
|
-
# underscores.
|
8
|
-
#
|
9
|
-
# :nocov:
|
10
5
|
module Focus
|
11
6
|
|
12
7
|
extend self
|
@@ -23,42 +18,22 @@ module Vedeu
|
|
23
18
|
|
24
19
|
private
|
25
20
|
|
26
|
-
#
|
27
|
-
# interface and restore the cursor position and visibility.
|
28
|
-
#
|
29
|
-
# @example
|
30
|
-
# Vedeu.trigger(:_focus_by_name_, name)
|
31
|
-
#
|
32
|
-
# @return [TrueClass]
|
21
|
+
# See {file:docs/events/focus.md#\_focus_by_name_}
|
33
22
|
def focus_by_name!
|
34
23
|
Vedeu.bind(:_focus_by_name_) { |name| Vedeu.focus_by_name(name) }
|
35
24
|
end
|
36
25
|
|
37
|
-
#
|
38
|
-
# cursor position and visibility.
|
39
|
-
#
|
40
|
-
# @example
|
41
|
-
# Vedeu.trigger(:_focus_next_)
|
42
|
-
#
|
43
|
-
# @return [TrueClass]
|
26
|
+
# See {file:docs/events/focus.md#\_focus_next_}
|
44
27
|
def focus_next!
|
45
28
|
Vedeu.bind(:_focus_next_) { Vedeu.focus_next }
|
46
29
|
end
|
47
30
|
|
48
|
-
#
|
49
|
-
# the cursor position and visibility.
|
50
|
-
#
|
51
|
-
# @example
|
52
|
-
# Vedeu.trigger(:_focus_prev_)
|
53
|
-
# Vedeu.focus_previous
|
54
|
-
#
|
55
|
-
# @return [TrueClass]
|
31
|
+
# See {file:docs/events/focus.md#\_focus_prev_}
|
56
32
|
def focus_prev!
|
57
33
|
Vedeu.bind(:_focus_prev_) { Vedeu.focus_previous }
|
58
34
|
end
|
59
35
|
|
60
36
|
end # Focus
|
61
|
-
# :nocov:
|
62
37
|
|
63
38
|
end # Bindings
|
64
39
|
|
data/lib/vedeu/bindings/menus.rb
CHANGED
@@ -5,7 +5,6 @@ module Vedeu
|
|
5
5
|
# Each of the Bindings::Menus events require a target menu name as
|
6
6
|
# an argument.
|
7
7
|
#
|
8
|
-
# :nocov:
|
9
8
|
module Menus
|
10
9
|
|
11
10
|
extend self
|
@@ -29,122 +28,67 @@ module Vedeu
|
|
29
28
|
|
30
29
|
private
|
31
30
|
|
32
|
-
#
|
33
|
-
#
|
34
|
-
# @example
|
35
|
-
# Vedeu.trigger(:_menu_bottom_, name)
|
36
|
-
#
|
37
|
-
# @return [TrueClass]
|
31
|
+
# See {file:docs/events/menu.md#\_menu_bottom_}
|
38
32
|
def menu_bottom!
|
39
33
|
Vedeu.bind(:_menu_bottom_) do |name|
|
40
34
|
Vedeu.menus.by_name(name).bottom_item
|
41
35
|
end
|
42
36
|
end
|
43
37
|
|
44
|
-
#
|
45
|
-
#
|
46
|
-
# @example
|
47
|
-
# Vedeu.trigger(:_menu_current_, name)
|
48
|
-
#
|
49
|
-
# @return [TrueClass]
|
38
|
+
# See {file:docs/events/menu.md#\_menu_current_}
|
50
39
|
def menu_current!
|
51
40
|
Vedeu.bind(:_menu_current_) do |name|
|
52
41
|
Vedeu.menus.by_name(name).current_item
|
53
42
|
end
|
54
43
|
end
|
55
44
|
|
56
|
-
#
|
57
|
-
#
|
58
|
-
# @example
|
59
|
-
# Vedeu.trigger(:_menu_deselect_, name)
|
60
|
-
#
|
61
|
-
# @return [TrueClass]
|
45
|
+
# See {file:docs/events/menu.md#\_menu_deselect_}
|
62
46
|
def menu_deselect!
|
63
47
|
Vedeu.bind(:_menu_deselect_) do |name|
|
64
48
|
Vedeu.menus.by_name(name).deselect_item
|
65
49
|
end
|
66
50
|
end
|
67
51
|
|
68
|
-
#
|
69
|
-
# `selected` boolean indicators.
|
70
|
-
#
|
71
|
-
# @example
|
72
|
-
# Vedeu.trigger(:_menu_items_, name)
|
73
|
-
#
|
74
|
-
# @return [TrueClass]
|
52
|
+
# See {file:docs/events/menu.md#\_menu_items_}
|
75
53
|
def menu_items!
|
76
54
|
Vedeu.bind(:_menu_items_) { |name| Vedeu.menus.by_name(name).items }
|
77
55
|
end
|
78
56
|
|
79
|
-
#
|
80
|
-
# reaches the last item.
|
81
|
-
#
|
82
|
-
# @example
|
83
|
-
# Vedeu.trigger(:_menu_next_, name)
|
84
|
-
#
|
85
|
-
# @return [TrueClass]
|
57
|
+
# See {file:docs/events/menu.md#\_menu_next_}
|
86
58
|
def menu_next!
|
87
59
|
Vedeu.bind(:_menu_next_) { |name| Vedeu.menus.by_name(name).next_item }
|
88
60
|
end
|
89
61
|
|
90
|
-
#
|
91
|
-
# reaches the first item.
|
92
|
-
#
|
93
|
-
# @example
|
94
|
-
# Vedeu.trigger(:_menu_prev_, name)
|
95
|
-
#
|
96
|
-
# @return [TrueClass]
|
62
|
+
# See {file:docs/events/menu.md#\_menu_prev_}
|
97
63
|
def menu_prev!
|
98
64
|
Vedeu.bind(:_menu_prev_) { |name| Vedeu.menus.by_name(name).prev_item }
|
99
65
|
end
|
100
66
|
|
101
|
-
#
|
102
|
-
#
|
103
|
-
# @example
|
104
|
-
# Vedeu.trigger(:_menu_selected_, name)
|
105
|
-
#
|
106
|
-
# @return [TrueClass]
|
67
|
+
# See {file:docs/events/menu.md#\_menu_selected_}
|
107
68
|
def menu_selected!
|
108
69
|
Vedeu.bind(:_menu_selected_) do |name|
|
109
70
|
Vedeu.menus.by_name(name).selected_item
|
110
71
|
end
|
111
72
|
end
|
112
73
|
|
113
|
-
#
|
114
|
-
#
|
115
|
-
# @example
|
116
|
-
# Vedeu.trigger(:_menu_select_, name)
|
117
|
-
#
|
118
|
-
# @return [TrueClass]
|
74
|
+
# See {file:docs/events/menu.md#\_menu_select_}
|
119
75
|
def menu_select!
|
120
76
|
Vedeu.bind(:_menu_select_) do |name|
|
121
77
|
Vedeu.menus.by_name(name).select_item
|
122
78
|
end
|
123
79
|
end
|
124
80
|
|
125
|
-
#
|
126
|
-
#
|
127
|
-
# @example
|
128
|
-
# Vedeu.trigger(:_menu_top_, name)
|
129
|
-
#
|
130
|
-
# @return [TrueClass]
|
81
|
+
# See {file:docs/events/menu.md#\_menu_top_}
|
131
82
|
def menu_top!
|
132
83
|
Vedeu.bind(:_menu_top_) { |name| Vedeu.menus.by_name(name).top_item }
|
133
84
|
end
|
134
85
|
|
135
|
-
#
|
136
|
-
# item to the last item.
|
137
|
-
#
|
138
|
-
# @example
|
139
|
-
# Vedeu.trigger(:_menu_view_, name)
|
140
|
-
#
|
141
|
-
# @return [TrueClass]
|
86
|
+
# See {file:docs/events/menu.md#\_menu_view_}
|
142
87
|
def menu_view!
|
143
88
|
Vedeu.bind(:_menu_view_) { |name| Vedeu.menus.by_name(name).view }
|
144
89
|
end
|
145
90
|
|
146
91
|
end # Menus
|
147
|
-
# :nocov:
|
148
92
|
|
149
93
|
end # Bindings
|
150
94
|
|
@@ -4,7 +4,6 @@ module Vedeu
|
|
4
4
|
|
5
5
|
# System events relating to movement of cursors or interfaces.
|
6
6
|
#
|
7
|
-
# :nocov:
|
8
7
|
module Movement
|
9
8
|
|
10
9
|
extend self
|
@@ -22,47 +21,7 @@ module Vedeu
|
|
22
21
|
|
23
22
|
private
|
24
23
|
|
25
|
-
#
|
26
|
-
#
|
27
|
-
# @example
|
28
|
-
# Vedeu.trigger(:_cursor_down_)
|
29
|
-
#
|
30
|
-
# Vedeu.trigger(:_cursor_left_)
|
31
|
-
# # When a name is not given, the cursor in the interface
|
32
|
-
# # which is currently in focus should move to the left.
|
33
|
-
#
|
34
|
-
# Vedeu.trigger(:_cursor_left_, 'my_interface')
|
35
|
-
# # When a name is given, the cursor instance belonging to
|
36
|
-
# # this interface moves to the left.
|
37
|
-
#
|
38
|
-
# Vedeu.trigger(:_cursor_right_)
|
39
|
-
# Vedeu.trigger(:_cursor_up_)
|
40
|
-
#
|
41
|
-
# Vedeu.trigger(:_cursor_origin_) # /or/
|
42
|
-
# Vedeu.trigger(:_cursor_origin_, 'my_interface')
|
43
|
-
# # Moves the cursor to the top left of the named or current
|
44
|
-
# # interface in focus.
|
45
|
-
#
|
46
|
-
# Vedeu.trigger(:_view_down_, 'my_interface')
|
47
|
-
# Vedeu.trigger(:_view_left_, 'my_interface')
|
48
|
-
# Vedeu.trigger(:_view_right_, 'my_interface')
|
49
|
-
# Vedeu.trigger(:_view_up_, 'my_interface')
|
50
|
-
#
|
51
|
-
# Each of the :_view_* events has an alias, :_geometry_*
|
52
|
-
#
|
53
|
-
# @note
|
54
|
-
# The cursor or view may not be visible, but it will still
|
55
|
-
# move if requested.
|
56
|
-
# The cursor will not exceed the border or boundary of the
|
57
|
-
# interface, or boundary of the visible terminal.
|
58
|
-
# The cursor will move freely within the bounds of the
|
59
|
-
# interface, irrespective of content.
|
60
|
-
# The view will not exceed the boundary of the visible
|
61
|
-
# terminal.
|
62
|
-
# The view will move freely within the bounds of the
|
63
|
-
# interface, irrespective of content.
|
64
|
-
#
|
65
|
-
# @return [TrueClass]
|
24
|
+
# See {file:docs/events/movement.md#\_cursor_up_down_left_right_}
|
66
25
|
def directional!
|
67
26
|
[:down, :left, :right, :up].each do |direction|
|
68
27
|
Vedeu.bind("_cursor_#{direction}_".to_sym) do |name|
|
@@ -85,15 +44,7 @@ module Vedeu
|
|
85
44
|
end
|
86
45
|
end
|
87
46
|
|
88
|
-
#
|
89
|
-
# left corner of the named interface.
|
90
|
-
#
|
91
|
-
# @example
|
92
|
-
# Vedeu.trigger(:_cursor_origin_, name)
|
93
|
-
# Vedeu.trigger(:_cursor_reset_, name)
|
94
|
-
#
|
95
|
-
# @return [TrueClass]
|
96
|
-
# @see Vedeu::Move
|
47
|
+
# See {file:docs/events/movement.md#\_cursor_origin_}
|
97
48
|
def cursor_origin!
|
98
49
|
Vedeu.bind(:_cursor_origin_) do |name|
|
99
50
|
Vedeu.cursors.by_name(name).move_origin
|
@@ -102,29 +53,14 @@ module Vedeu
|
|
102
53
|
Vedeu.bind_alias(:_cursor_reset_, :_cursor_origin_)
|
103
54
|
end
|
104
55
|
|
105
|
-
#
|
106
|
-
#
|
107
|
-
# @example
|
108
|
-
# Vedeu.trigger(:_cursor_position_, name)
|
109
|
-
#
|
110
|
-
# @todo This event queries Vedeu. Events should only be
|
111
|
-
# commands.
|
112
|
-
#
|
113
|
-
# @return [TrueClass]
|
114
|
-
# @see Vedeu::Move
|
56
|
+
# See {file:docs/events/movement.md#\_cursor_position_}
|
115
57
|
def cursor_position!
|
116
58
|
Vedeu.bind(:_cursor_position_) do |name|
|
117
59
|
Vedeu.cursors.by_name(name).position
|
118
60
|
end
|
119
61
|
end
|
120
62
|
|
121
|
-
#
|
122
|
-
#
|
123
|
-
# @example
|
124
|
-
# Vedeu.trigger(:_cursor_reposition_, name, y, x)
|
125
|
-
#
|
126
|
-
# @return [TrueClass]
|
127
|
-
# @see Vedeu::Move
|
63
|
+
# See {file:docs/events/movement.md#\_cursor_reposition_}
|
128
64
|
def cursor_reposition!
|
129
65
|
Vedeu.bind(:_cursor_reposition_) do |name, y, x|
|
130
66
|
Vedeu.cursors.by_name(name).reposition(y, x)
|
@@ -136,7 +72,6 @@ module Vedeu
|
|
136
72
|
end
|
137
73
|
|
138
74
|
end # Movement
|
139
|
-
# :nocov:
|
140
75
|
|
141
76
|
end # Bindings
|
142
77
|
|
@@ -2,11 +2,6 @@ module Vedeu
|
|
2
2
|
|
3
3
|
module Bindings
|
4
4
|
|
5
|
-
# Creates system events which when called provide a variety of
|
6
|
-
# core functions and behaviours. They are soft-namespaced using
|
7
|
-
# underscores.
|
8
|
-
#
|
9
|
-
# :nocov:
|
10
5
|
module Refresh
|
11
6
|
|
12
7
|
extend self
|
@@ -23,45 +18,21 @@ module Vedeu
|
|
23
18
|
|
24
19
|
private
|
25
20
|
|
26
|
-
#
|
27
|
-
#
|
28
|
-
# @note
|
29
|
-
# The interfaces will be refreshed in z-index order, meaning
|
30
|
-
# that interfaces with a lower z-index will be drawn first.
|
31
|
-
# This means overlapping interfaces will be drawn as
|
32
|
-
# specified. Hidden interfaces will be still refreshed in
|
33
|
-
# memory but not shown.
|
34
|
-
#
|
35
|
-
# @example
|
36
|
-
# Vedeu.trigger(:_refresh_)
|
37
|
-
# Vedeu.trigger(:_refresh_, name)
|
38
|
-
#
|
39
|
-
# @return [TrueClass]
|
21
|
+
# See {file:docs/events/refresh.md#\_refresh_}
|
40
22
|
def refresh!
|
41
23
|
Vedeu.bind(:_refresh_) do |name|
|
42
24
|
name ? Vedeu::Buffers::Refresh.by_name(name) : Vedeu::Refresh.all
|
43
25
|
end
|
44
26
|
end
|
45
27
|
|
46
|
-
#
|
47
|
-
# interface which is currently in focus.
|
48
|
-
#
|
49
|
-
# @example
|
50
|
-
# Vedeu.trigger(:_refresh_cursor_, name)
|
51
|
-
#
|
52
|
-
# @return [TrueClass]
|
28
|
+
# See {file:docs/events/refresh.md#\_refresh_cursor_}
|
53
29
|
def refresh_cursor!
|
54
30
|
Vedeu.bind(:_refresh_cursor_) do |name|
|
55
31
|
Vedeu::Cursors::Refresh.by_name(name)
|
56
32
|
end
|
57
33
|
end
|
58
34
|
|
59
|
-
#
|
60
|
-
#
|
61
|
-
# @example
|
62
|
-
# Vedeu.trigger(:_refresh_group_, name)
|
63
|
-
#
|
64
|
-
# @return [TrueClass]
|
35
|
+
# See {file:docs/events/refresh.md#\_refresh_group_}
|
65
36
|
def refresh_group!
|
66
37
|
Vedeu.bind(:_refresh_group_) do |name|
|
67
38
|
Vedeu::RefreshGroup.by_name(name)
|
@@ -69,7 +40,6 @@ module Vedeu
|
|
69
40
|
end
|
70
41
|
|
71
42
|
end # Refresh
|
72
|
-
# :nocov:
|
73
43
|
|
74
44
|
end # Bindings
|
75
45
|
|