vedeu 0.4.45 → 0.4.46
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/Guardfile +1 -1
- data/docs/dsl.md +4 -4
- data/docs/events/drb.md +49 -0
- data/docs/events/main.md +109 -0
- data/docs/events/menus.md +72 -0
- data/docs/events/movement.md +105 -0
- data/docs/events/visibility.md +61 -0
- data/docs/events.md +13 -0
- data/lib/vedeu/api.rb +23 -0
- data/lib/vedeu/application/controller.rb +1 -0
- data/lib/vedeu/application.rb +25 -20
- data/lib/vedeu/bindings/bindings.rb +2 -41
- data/lib/vedeu/bindings/drb.rb +2 -11
- data/lib/vedeu/bindings/menus.rb +1 -19
- data/lib/vedeu/bindings/movement.rb +6 -18
- data/lib/vedeu/bindings/visibility.rb +5 -26
- data/lib/vedeu/configuration/configuration.rb +1 -1
- data/lib/vedeu/distributed/server.rb +15 -0
- data/lib/vedeu/dsl/presentation.rb +13 -7
- data/lib/vedeu/dsl/view.rb +1 -1
- data/lib/vedeu/events/event.rb +1 -1
- data/lib/vedeu/main_loop.rb +1 -1
- data/lib/vedeu/models/interface.rb +3 -0
- data/lib/vedeu/null/interface.rb +11 -0
- data/lib/vedeu/output/clear.rb +3 -1
- data/lib/vedeu/repositories/repositories/borders.rb +7 -3
- data/lib/vedeu/repositories/repositories/buffers.rb +7 -3
- data/lib/vedeu/repositories/repositories/cursors.rb +3 -2
- data/lib/vedeu/repositories/repositories/events.rb +3 -2
- data/lib/vedeu/repositories/repositories/geometries.rb +6 -2
- data/lib/vedeu/repositories/repositories/groups.rb +2 -1
- data/lib/vedeu/repositories/repositories/interfaces.rb +6 -2
- data/lib/vedeu/repositories/repositories/keymaps.rb +2 -1
- data/lib/vedeu/repositories/repositories/menus.rb +2 -1
- data/lib/vedeu/support/log.rb +1 -1
- data/lib/vedeu/support/timer.rb +1 -1
- data/lib/vedeu/support/visibility.rb +31 -3
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/bindings/bindings_test.rb +0 -3
- data/test/lib/vedeu/bindings/movement_test.rb +1 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +9 -17
- data/test/lib/vedeu/null/interface_test.rb +6 -0
- data/test/lib/vedeu/repositories/repositories/borders_test.rb +5 -1
- data/test/lib/vedeu/repositories/repositories/buffers_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/cursors_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/events_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/geometries_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/groups_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/interfaces_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/menus_test.rb +2 -0
- data/test/lib/vedeu/support/visibility_test.rb +14 -8
- data/test/test_helper.rb +12 -6
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea321b7c3e36486983857a9d6ceeeecb333a17fd
|
4
|
+
data.tar.gz: 5e52ca03e9336ced28a58cc062d680f2dab4b0fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1097844c65d4242aa77ac45844005483b2a9f425a2e0a7469371c89126882a386c8cf708b96c42a8046762366249530aedbb19a7056132c0129f6ef824be583
|
7
|
+
data.tar.gz: 83dc5668eacf4c40b1384345ba34ef0ac2845be750be21d94b7480666239eeda748e619e767139d967e1506ec425f34b8e7a0840d3e52e07b330539a9b5cca05
|
data/.yardopts
CHANGED
data/Guardfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
guard :minitest, all_after_pass: true,
|
2
2
|
focus_on_failed: true,
|
3
|
-
env: { '
|
3
|
+
env: { 'NO_SIMPLECOV' => true } do
|
4
4
|
watch(%r{^test/(.*)_test\.rb})
|
5
5
|
watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
|
6
6
|
watch(%r{^test/test_helper\.rb}) { 'test' }
|
data/docs/dsl.md
CHANGED
@@ -86,7 +86,7 @@ Geometry allows the configuration of the position and size of an interface.
|
|
86
86
|
|
87
87
|
Here is an example of declarations for a `geometry` block:
|
88
88
|
|
89
|
-
|
89
|
+
```ruby
|
90
90
|
interface 'main' do
|
91
91
|
geometry do
|
92
92
|
height 5 # Sets the height of the view to 5
|
@@ -104,7 +104,7 @@ available in the terminal will be used. `x` and `y` both default to 0.
|
|
104
104
|
|
105
105
|
You can also make a geometry declaration dependent on another view:
|
106
106
|
|
107
|
-
|
107
|
+
```ruby
|
108
108
|
interface 'other_panel' do
|
109
109
|
# other code ...
|
110
110
|
end
|
@@ -140,9 +140,9 @@ You can define keymaps by name which matches a defined interface. When that
|
|
140
140
|
|
141
141
|
### Menus
|
142
142
|
|
143
|
-
|
143
|
+
`@todo` Documentation coming soon!
|
144
144
|
|
145
145
|
### Views
|
146
146
|
|
147
|
-
|
147
|
+
@todo Documentation coming soon!
|
148
148
|
|
data/docs/events/drb.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# @title DRB Events
|
2
|
+
|
3
|
+
## DRB Events
|
4
|
+
|
5
|
+
### Start DRB Server
|
6
|
+
|
7
|
+
Vedeu.trigger(:_drb_start_)
|
8
|
+
|
9
|
+
Use the DRb server to request the client application to start.
|
10
|
+
|
11
|
+
|
12
|
+
### Restart DRB Server
|
13
|
+
|
14
|
+
Vedeu.trigger(:_drb_restart_)
|
15
|
+
|
16
|
+
Use the DRb server to request the client application to restart.
|
17
|
+
|
18
|
+
|
19
|
+
### Stop DRB Server
|
20
|
+
|
21
|
+
Vedeu.trigger(:_drb_stop_)
|
22
|
+
|
23
|
+
Use the DRb server to request the client application to stop.
|
24
|
+
|
25
|
+
|
26
|
+
### DRB Status
|
27
|
+
|
28
|
+
Vedeu.trigger(:_drb_status_)
|
29
|
+
|
30
|
+
Use the DRb server to request the status of the client application.
|
31
|
+
|
32
|
+
|
33
|
+
### Store Output of DRB Server
|
34
|
+
|
35
|
+
Vedeu.trigger(:_drb_store_output_, data)
|
36
|
+
|
37
|
+
Triggering this event with 'data' will push data into the running application's virtual buffer.
|
38
|
+
|
39
|
+
|
40
|
+
### Retrieve Output of DRB Server
|
41
|
+
|
42
|
+
Vedeu.trigger(:_drb_retrieve_output_)
|
43
|
+
|
44
|
+
|
45
|
+
### Send Input to DRB Server
|
46
|
+
|
47
|
+
Vedeu.trigger(:_drb_input_, data, type)
|
48
|
+
|
49
|
+
Triggering this event will send input to the running application as long as it has the DRb server running.
|
data/docs/events/main.md
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
# @title Main Events
|
2
|
+
|
3
|
+
## Main Events
|
4
|
+
|
5
|
+
### Exiting Vedeu
|
6
|
+
|
7
|
+
`Vedeu.trigger(:_exit_)`
|
8
|
+
|
9
|
+
When triggered, Vedeu will trigger a `:cleanup` event which you can define (to save files, etc) and attempt to exit. Also available as: `Vedeu.exit`.
|
10
|
+
|
11
|
+
|
12
|
+
### Pressing a key
|
13
|
+
|
14
|
+
`Vedeu.trigger(:_keypress_, key)`
|
15
|
+
|
16
|
+
Will cause the triggering of the `:key` event; which you should define to 'do things'. If the `escape` key is pressed, then `key` is triggered with the argument `:escape`, also an internal event `_mode_switch_` is triggered. Vedeu recognises most key presses and some 'extended' keypress (eg. Ctrl+J), a list of
|
17
|
+
the supported keypresses can be found here: {Vedeu::Input#specials} and {Vedeu::Input#f_keys}.
|
18
|
+
|
19
|
+
|
20
|
+
### Sending a command
|
21
|
+
|
22
|
+
`Vedeu.trigger(:_command_)`
|
23
|
+
|
24
|
+
Will cause the triggering of the `:command` event; which you should define to 'do things'.
|
25
|
+
|
26
|
+
|
27
|
+
### Logging to the log file
|
28
|
+
|
29
|
+
`Vedeu.trigger(:_log_, message)`
|
30
|
+
|
31
|
+
When triggered with a message will cause Vedeu to log the message if logging is enabled in the configuration.
|
32
|
+
|
33
|
+
|
34
|
+
### Focussing an interface by name
|
35
|
+
|
36
|
+
`Vedeu.trigger(:_focus_by_name_, name)`
|
37
|
+
|
38
|
+
When triggered with an interface name will focus that interface and restore the cursor position and visibility.
|
39
|
+
|
40
|
+
|
41
|
+
### Focussing the next visible interface
|
42
|
+
|
43
|
+
`Vedeu.trigger(:_focus_next_)`
|
44
|
+
|
45
|
+
When triggered will focus the next interface and restore the cursor position and visibility.
|
46
|
+
|
47
|
+
|
48
|
+
### Focussing the previous visible interface
|
49
|
+
|
50
|
+
`Vedeu.trigger(:_focus_prev_)`
|
51
|
+
|
52
|
+
When triggered will focus the previous interface and restore the cursor position and visibility.
|
53
|
+
|
54
|
+
|
55
|
+
### Clearing the terminal
|
56
|
+
|
57
|
+
`Vedeu.trigger(:_clear_)`
|
58
|
+
|
59
|
+
Clears the whole terminal space, or the named interface area to be cleared if given. Also available as: `Vedeu.clear_by_name(name)`.
|
60
|
+
|
61
|
+
|
62
|
+
### Refreshing all interfaces
|
63
|
+
|
64
|
+
`Vedeu.trigger(:_refresh_)`
|
65
|
+
|
66
|
+
Will cause all interfaces to refresh. Note: Hidden interfaces will be still refreshed in memory but not shown.
|
67
|
+
|
68
|
+
|
69
|
+
### Refresing an interface by name
|
70
|
+
|
71
|
+
`Vedeu.trigger(:_refresh_, name)`
|
72
|
+
|
73
|
+
Will cause the named interface to refresh. Note: Hidden interfaces will be still refreshed in memory but not shown.
|
74
|
+
|
75
|
+
|
76
|
+
### Refreshing the cursor
|
77
|
+
|
78
|
+
`Vedeu.trigger(:_refresh_cursor_, name)`
|
79
|
+
|
80
|
+
Will cause the named cursor to refresh, or the cursor of the interface which is currently in focus.
|
81
|
+
|
82
|
+
|
83
|
+
### Refreshing a group of interfaces
|
84
|
+
|
85
|
+
`Vedeu.trigger(:_refresh_group_, name)`
|
86
|
+
|
87
|
+
Will cause all interfaces in the named group to refresh.
|
88
|
+
|
89
|
+
|
90
|
+
### Clearing a group
|
91
|
+
|
92
|
+
`Vedeu.trigger(:_clear_group_, name)`
|
93
|
+
|
94
|
+
Clears the spaces occupied by the interfaces belonging to the named group. Also available as: `Vedeu.clear_by_group(name)`
|
95
|
+
|
96
|
+
|
97
|
+
### Maximising an interface
|
98
|
+
|
99
|
+
`Vedeu.trigger(:_maximise_, name)`
|
100
|
+
|
101
|
+
See also: {Vedeu::Geometry#maximise}
|
102
|
+
|
103
|
+
|
104
|
+
### Unmaximising an interface
|
105
|
+
|
106
|
+
`Vedeu.trigger(:_unmaximise_, name)`
|
107
|
+
|
108
|
+
See also: {Vedeu::Geometry#unmaximise}
|
109
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# @title Menu Events
|
2
|
+
|
3
|
+
## Menu Events
|
4
|
+
|
5
|
+
### Bottom Item
|
6
|
+
|
7
|
+
Vedeu.trigger(:_menu_bottom_, name)
|
8
|
+
|
9
|
+
Makes the last menu item the current menu item.
|
10
|
+
|
11
|
+
|
12
|
+
### Current Item
|
13
|
+
|
14
|
+
Vedeu.trigger(:_menu_current_, name)
|
15
|
+
|
16
|
+
Returns the current menu item.
|
17
|
+
|
18
|
+
|
19
|
+
### Deselect All
|
20
|
+
|
21
|
+
Vedeu.trigger(:_menu_deselect_, name)
|
22
|
+
|
23
|
+
Deselects all menu items.
|
24
|
+
|
25
|
+
|
26
|
+
### All Items
|
27
|
+
|
28
|
+
Vedeu.trigger(:_menu_items_, name)
|
29
|
+
|
30
|
+
Returns all the menu items with respective `current` or `selected` boolean indicators.
|
31
|
+
|
32
|
+
|
33
|
+
### Next Item
|
34
|
+
|
35
|
+
Vedeu.trigger(:_menu_next_, name)
|
36
|
+
|
37
|
+
Makes the next menu item the current menu item, until it reaches the last item.
|
38
|
+
|
39
|
+
|
40
|
+
### Previous Item
|
41
|
+
|
42
|
+
Vedeu.trigger(:_menu_prev_, name)
|
43
|
+
|
44
|
+
Makes the previous menu item the current menu item, until it reaches the first item.
|
45
|
+
|
46
|
+
|
47
|
+
### Selected Item
|
48
|
+
|
49
|
+
Vedeu.trigger(:_menu_selected_, name)
|
50
|
+
|
51
|
+
Returns the selected menu item.
|
52
|
+
|
53
|
+
|
54
|
+
### Select Current Item
|
55
|
+
|
56
|
+
Vedeu.trigger(:_menu_select_, name)
|
57
|
+
|
58
|
+
Makes the current menu item also the selected menu item.
|
59
|
+
|
60
|
+
|
61
|
+
### Top Item
|
62
|
+
|
63
|
+
Vedeu.trigger(:_menu_top_, name)
|
64
|
+
|
65
|
+
Makes the first menu item the current menu item.
|
66
|
+
|
67
|
+
|
68
|
+
### View from ...
|
69
|
+
|
70
|
+
Vedeu.trigger(:_menu_view_, name)
|
71
|
+
|
72
|
+
Returns a subset of the menu items; starting at the current item to the last item.
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# @title Movement Events
|
2
|
+
|
3
|
+
## Movement Events
|
4
|
+
|
5
|
+
### Moving the cursor
|
6
|
+
|
7
|
+
We can move the cursor by name using the events listed below:
|
8
|
+
|
9
|
+
#### Moving the cursor down
|
10
|
+
|
11
|
+
Vedeu.trigger(:_cursor_down_, name)
|
12
|
+
|
13
|
+
See also: {Vedeu::Move}
|
14
|
+
|
15
|
+
|
16
|
+
#### Moving the cursor left
|
17
|
+
|
18
|
+
Vedeu.trigger(:_cursor_left_, name)
|
19
|
+
|
20
|
+
See also: {Vedeu::Move}
|
21
|
+
|
22
|
+
|
23
|
+
#### Resetting the position of the cursor
|
24
|
+
|
25
|
+
Vedeu.trigger(:_cursor_origin_, name)
|
26
|
+
Vedeu.trigger(:_cursor_reset_, name)
|
27
|
+
|
28
|
+
This event moves the cursor to the interface origin; the top left corner of the named interface. See also: {Vedeu::Move}
|
29
|
+
|
30
|
+
|
31
|
+
#### Fetching the position of the cursor
|
32
|
+
|
33
|
+
Vedeu.trigger(:_cursor_position_, name)
|
34
|
+
|
35
|
+
When triggered will return the current position of the cursor. See also: {Vedeu::Move}
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
#### Moving the cursor to an arbitrary position
|
40
|
+
|
41
|
+
Vedeu.trigger(:_cursor_reposition_, name, y, x)
|
42
|
+
|
43
|
+
Moves the cursor to a relative position inside the interface. See also: {Vedeu::Move}
|
44
|
+
|
45
|
+
|
46
|
+
#### Moving the cursor right
|
47
|
+
|
48
|
+
Vedeu.trigger(:_cursor_right_, name)
|
49
|
+
|
50
|
+
See also: {Vedeu::Move}
|
51
|
+
|
52
|
+
|
53
|
+
#### Moving the cursor up
|
54
|
+
|
55
|
+
Vedeu.trigger(:_cursor_up_, name)
|
56
|
+
|
57
|
+
See also: {Vedeu::Move}
|
58
|
+
|
59
|
+
|
60
|
+
### Moving the interface
|
61
|
+
|
62
|
+
We can move an interface by altering its geometry. This is performed using the events listed below:
|
63
|
+
|
64
|
+
### Moving the interface down
|
65
|
+
|
66
|
+
Vedeu.trigger(:_geometry_down_, name)
|
67
|
+
|
68
|
+
See also: {Vedeu::Move}
|
69
|
+
|
70
|
+
|
71
|
+
### Moving the interface left
|
72
|
+
|
73
|
+
Vedeu.trigger(:_geometry_left_, name)
|
74
|
+
|
75
|
+
See also: {Vedeu::Move}
|
76
|
+
|
77
|
+
|
78
|
+
### Moving the interface right
|
79
|
+
|
80
|
+
Vedeu.trigger(:_geometry_right_, name)
|
81
|
+
|
82
|
+
See also: {Vedeu::Move}
|
83
|
+
|
84
|
+
|
85
|
+
### Moving the interface up
|
86
|
+
|
87
|
+
Vedeu.trigger(:_geometry_up_, name)
|
88
|
+
|
89
|
+
See also: {Vedeu::Move}
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
### Showing an interface
|
95
|
+
|
96
|
+
Vedeu.trigger(:_show_interface_, name)
|
97
|
+
|
98
|
+
See: {Vedeu::Buffer#show}
|
99
|
+
|
100
|
+
|
101
|
+
### Toggling an interface
|
102
|
+
|
103
|
+
Vedeu.trigger(:_toggle_interface_, name)
|
104
|
+
|
105
|
+
See: {Vedeu::Buffer#toggle}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# @title Visibility Events
|
2
|
+
|
3
|
+
## Visibility Events
|
4
|
+
|
5
|
+
### Hiding the cursor
|
6
|
+
|
7
|
+
Vedeu.trigger(:_hide_cursor_, name)
|
8
|
+
Vedeu.trigger(:_cursor_hide_, name)
|
9
|
+
|
10
|
+
Hide the cursor of the named interface or if a name is not given, the interface currently in focus. Also available as:
|
11
|
+
|
12
|
+
Vedeu.hide_cursor(name)
|
13
|
+
|
14
|
+
|
15
|
+
### Showing the cursor
|
16
|
+
|
17
|
+
Vedeu.trigger(:_show_cursor_, name)
|
18
|
+
Vedeu.trigger(:_cursor_show_, name)
|
19
|
+
|
20
|
+
Show the cursor of the named interface or if a name is not given, the interface currently in focus. Also available as:
|
21
|
+
|
22
|
+
Vedeu.show_cursor(name)
|
23
|
+
|
24
|
+
|
25
|
+
### Hiding a group
|
26
|
+
|
27
|
+
Vedeu.trigger(:_hide_group_, group_name)
|
28
|
+
|
29
|
+
Will hide all of the interfaces belonging to the named group. Useful for
|
30
|
+
hiding part of that which is currently displaying in the terminal.
|
31
|
+
|
32
|
+
This may be rarely used, since the action of showing a group
|
33
|
+
will effectively clear the terminal and show the new group.
|
34
|
+
|
35
|
+
|
36
|
+
### Showing a group
|
37
|
+
|
38
|
+
Vedeu.trigger(:_show_group_, group_name)
|
39
|
+
|
40
|
+
Will clear the terminal and then show all of the interfaces belonging to the named group.
|
41
|
+
|
42
|
+
|
43
|
+
### Hiding an interface
|
44
|
+
|
45
|
+
Vedeu.trigger(:_hide_interface_, name)
|
46
|
+
|
47
|
+
See: {Vedeu::Buffer#hide}
|
48
|
+
|
49
|
+
|
50
|
+
### Showing an interface
|
51
|
+
|
52
|
+
Vedeu.trigger(:_show_interface_, name)
|
53
|
+
|
54
|
+
See: {Vedeu::Buffer#show}
|
55
|
+
|
56
|
+
|
57
|
+
### Toggling an interface
|
58
|
+
|
59
|
+
Vedeu.trigger(:_toggle_interface_, name)
|
60
|
+
|
61
|
+
See: {Vedeu::Buffer#toggle}
|
data/docs/events.md
ADDED
data/lib/vedeu/api.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
require 'vedeu/support/common'
|
2
2
|
require 'vedeu/support/terminal'
|
3
3
|
require 'vedeu/support/timer'
|
4
|
+
require 'vedeu/support/visibility'
|
4
5
|
require 'vedeu/output/renderers/all'
|
5
6
|
require 'vedeu/events/all'
|
6
7
|
require 'vedeu/models/all'
|
7
8
|
require 'vedeu/input/all'
|
8
9
|
require 'vedeu/dsl/all'
|
10
|
+
require 'vedeu/application'
|
11
|
+
require 'vedeu/output/clear'
|
9
12
|
|
10
13
|
module Vedeu
|
11
14
|
|
@@ -230,6 +233,26 @@ module Vedeu
|
|
230
233
|
# @see Vedeu::Trigger.trigger
|
231
234
|
def_delegators Vedeu::Trigger, :trigger
|
232
235
|
|
236
|
+
# @!method exit
|
237
|
+
# @see Vedeu::Application.stop
|
238
|
+
def_delegators Vedeu::Application, :exit
|
239
|
+
|
240
|
+
# @!method clear_by_name
|
241
|
+
# @see Vedeu::Clear.by_name
|
242
|
+
def_delegators Vedeu::Clear, :clear_by_name
|
243
|
+
|
244
|
+
# @!method clear_by_group
|
245
|
+
# @see Vedeu::Clear.by_group
|
246
|
+
def_delegators Vedeu::Clear, :clear_by_group
|
247
|
+
|
248
|
+
# @!method hide_cursor
|
249
|
+
# @see Vedeu::Visibility.hide_cursor
|
250
|
+
def_delegators Vedeu::Visibility, :hide_cursor
|
251
|
+
|
252
|
+
# @!method show_cursor
|
253
|
+
# @see Vedeu::Visibility.show_cursor
|
254
|
+
def_delegators Vedeu::Visibility, :show_cursor
|
255
|
+
|
233
256
|
end # API
|
234
257
|
|
235
258
|
extend API
|
data/lib/vedeu/application.rb
CHANGED
@@ -5,29 +5,34 @@ module Vedeu
|
|
5
5
|
# @api private
|
6
6
|
class Application
|
7
7
|
|
8
|
-
|
9
|
-
def self.start(configuration)
|
10
|
-
new(configuration).start
|
11
|
-
end
|
8
|
+
class << self
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
# @param (see #initialize)
|
11
|
+
def start(configuration)
|
12
|
+
new(configuration).start
|
13
|
+
end
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# encouraged to use this event to close any open buffers, save files,
|
23
|
-
# empty trash, etc.
|
24
|
-
#
|
25
|
-
# @return [void]
|
26
|
-
def self.stop
|
27
|
-
Vedeu.trigger(:_cleanup_)
|
15
|
+
# @param (see #initialize)
|
16
|
+
def restart(configuration)
|
17
|
+
new(configuration).start
|
18
|
+
end
|
28
19
|
|
29
|
-
|
30
|
-
|
20
|
+
# Stops the application!
|
21
|
+
# - The `:_cleanup_` event is triggered, which in turn triggers the client
|
22
|
+
# event `:cleanup`; the client application may treat this event as Vedeu
|
23
|
+
# signalling that it is about to terminate. Client applications are
|
24
|
+
# encouraged to use this event to close any open buffers, save files,
|
25
|
+
# empty trash, etc.
|
26
|
+
#
|
27
|
+
# @return [void]
|
28
|
+
def stop
|
29
|
+
Vedeu.trigger(:_cleanup_)
|
30
|
+
|
31
|
+
Vedeu::MainLoop.stop!
|
32
|
+
end
|
33
|
+
alias_method :exit, :stop
|
34
|
+
|
35
|
+
end # Eigenclass
|
31
36
|
|
32
37
|
# :nocov:
|
33
38
|
# Returns a new instance of Vedeu::Application.
|
@@ -14,6 +14,7 @@ module Vedeu
|
|
14
14
|
# underscore, it's probably used by Vedeu internally.
|
15
15
|
#
|
16
16
|
# @api public
|
17
|
+
# {include:file:docs/events/main.md}
|
17
18
|
module Bindings
|
18
19
|
|
19
20
|
include Vedeu::Bindings::DRB
|
@@ -29,8 +30,7 @@ module Vedeu
|
|
29
30
|
Vedeu.trigger(:cleanup)
|
30
31
|
end
|
31
32
|
|
32
|
-
|
33
|
-
# (to save files, etc) and attempt to exit.
|
33
|
+
|
34
34
|
Vedeu.bind(:_exit_) { Vedeu::Application.stop }
|
35
35
|
|
36
36
|
# Vedeu triggers this event when it is ready to enter the main loop. Client
|
@@ -39,18 +39,8 @@ module Vedeu
|
|
39
39
|
# this event, the :_refresh_ event is also triggered automatically.
|
40
40
|
Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
|
41
41
|
|
42
|
-
# Will cause the triggering of the `:key` event; which
|
43
|
-
# you should define to 'do things'. If the `escape` key is pressed, then
|
44
|
-
# `key` is triggered with the argument `:escape`, also an internal event
|
45
|
-
# `_mode_switch_` is triggered.
|
46
42
|
Vedeu.bind(:_keypress_) { |key| Vedeu.keypress(key) }
|
47
|
-
|
48
|
-
# Will cause the triggering of the `:command` event; which you should define
|
49
|
-
# to 'do things'.
|
50
43
|
Vedeu.bind(:_command_) { |command| Vedeu.trigger(:command, command) }
|
51
|
-
|
52
|
-
# When triggered with a message will cause Vedeu to log the message if
|
53
|
-
# logging is enabled in the configuration.
|
54
44
|
Vedeu.bind(:_log_) { |msg| Vedeu.log(type: :debug, message: msg) }
|
55
45
|
|
56
46
|
# When triggered (after the user presses `escape`), Vedeu switches from a
|
@@ -63,49 +53,20 @@ module Vedeu
|
|
63
53
|
# events. Please see those events for their behaviour.
|
64
54
|
Vedeu.bind(:_resize_, delay: 0.15) { Vedeu.resize }
|
65
55
|
|
66
|
-
# When triggered will return the current position of the cursor.
|
67
|
-
Vedeu.bind(:_cursor_position_) do |name|
|
68
|
-
Vedeu.cursors.by_name(name).position
|
69
|
-
end
|
70
|
-
|
71
|
-
# When triggered with an interface name will focus that interface and
|
72
|
-
# restore the cursor position and visibility.
|
73
56
|
Vedeu.bind(:_focus_by_name_) { |name| Vedeu.focus_by_name(name) }
|
74
|
-
|
75
|
-
# When triggered will focus the next interface and restore the cursor
|
76
|
-
# position and visibility.
|
77
57
|
Vedeu.bind(:_focus_next_) { Vedeu.focus_next }
|
78
|
-
|
79
|
-
# When triggered will focus the previous interface and restore the cursor
|
80
|
-
# position and visibility.
|
81
58
|
Vedeu.bind(:_focus_prev_) { Vedeu.focus_previous }
|
82
|
-
|
83
|
-
# Clears the whole terminal space, or the named interface area to be cleared
|
84
|
-
# if given.
|
85
59
|
Vedeu.bind(:_clear_) { |name| Vedeu::Clear.by_name(name) }
|
86
60
|
|
87
|
-
# Will cause all interfaces to refresh, or the named interface if given.
|
88
|
-
#
|
89
|
-
# @note
|
90
|
-
# Hidden interfaces will be still refreshed in memory but not shown.
|
91
61
|
Vedeu.bind(:_refresh_) do |name|
|
92
62
|
name ? Vedeu::Refresh.by_name(name) : Vedeu::Refresh.all
|
93
63
|
end
|
94
64
|
|
95
|
-
# Will cause the named cursor to refresh, or the cursor of the interface
|
96
|
-
# which is currently in focus.
|
97
65
|
Vedeu.bind(:_refresh_cursor_) { |name| Vedeu::RefreshCursor.render(name) }
|
98
|
-
|
99
|
-
# Will cause all interfaces in the named group to refresh.
|
100
66
|
Vedeu.bind(:_refresh_group_) { |name| Vedeu::Refresh.by_group(name) }
|
101
|
-
|
102
|
-
# Clears the spaces occupied by the interfaces belonging to the named group.
|
103
67
|
Vedeu.bind(:_clear_group_) { |name| Vedeu::Clear.by_group(name) }
|
104
|
-
|
105
|
-
# @see Vedeu::Geometry#maximise
|
106
68
|
Vedeu.bind(:_maximise_) { |name| Vedeu.geometries.by_name(name).maximise }
|
107
69
|
|
108
|
-
# @see Vedeu::Geometry#unmaximise
|
109
70
|
Vedeu.bind(:_unmaximise_) do |name|
|
110
71
|
Vedeu.geometries.by_name(name).unmaximise
|
111
72
|
end
|