vedeu 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/docs/borders.md +1 -5
  3. data/docs/cursors.md +23 -92
  4. data/docs/events/application.md +1 -8
  5. data/docs/events/by_name/cleanup.md +7 -0
  6. data/docs/events/by_name/clear.md +2 -0
  7. data/docs/events/by_name/clear_group.md +6 -0
  8. data/docs/events/by_name/clear_view.md +5 -0
  9. data/docs/events/by_name/clear_view_content.md +5 -0
  10. data/docs/events/by_name/command.md +19 -0
  11. data/docs/events/by_name/cursor_bottom.md +7 -0
  12. data/docs/events/by_name/cursor_down.md +4 -0
  13. data/docs/events/by_name/cursor_left.md +6 -0
  14. data/docs/events/by_name/cursor_origin.md +6 -0
  15. data/docs/events/by_name/cursor_position.md +10 -0
  16. data/docs/events/by_name/cursor_reposition.md +4 -0
  17. data/docs/events/by_name/cursor_right.md +4 -0
  18. data/docs/events/by_name/cursor_top.md +7 -0
  19. data/docs/events/by_name/cursor_up.md +6 -0
  20. data/docs/events/by_name/drb_input.md +7 -0
  21. data/docs/events/by_name/drb_restart.md +5 -0
  22. data/docs/events/by_name/drb_retrieve_output.md +2 -0
  23. data/docs/events/by_name/drb_start.md +5 -0
  24. data/docs/events/by_name/drb_status.md +5 -0
  25. data/docs/events/by_name/drb_stop.md +5 -0
  26. data/docs/events/by_name/drb_store_output.md +2 -0
  27. data/docs/events/by_name/editor.md +9 -0
  28. data/docs/events/by_name/editor_delete_character.md +5 -0
  29. data/docs/events/by_name/editor_delete_line.md +5 -0
  30. data/docs/events/by_name/editor_down.md +5 -0
  31. data/docs/events/by_name/editor_execute.md +3 -0
  32. data/docs/events/by_name/editor_insert_character.md +7 -0
  33. data/docs/events/by_name/editor_insert_line.md +5 -0
  34. data/docs/events/by_name/editor_left.md +5 -0
  35. data/docs/events/by_name/editor_right.md +5 -0
  36. data/docs/events/by_name/editor_up.md +5 -0
  37. data/docs/events/by_name/exit.md +6 -0
  38. data/docs/events/by_name/focus_by_name.md +6 -0
  39. data/docs/events/by_name/focus_next.md +6 -0
  40. data/docs/events/by_name/focus_prev.md +6 -0
  41. data/docs/events/by_name/goto.md +8 -0
  42. data/docs/events/by_name/hide_cursor.md +10 -0
  43. data/docs/events/by_name/hide_group.md +5 -0
  44. data/docs/events/by_name/hide_interface.md +5 -0
  45. data/docs/events/by_name/initialize.md +6 -0
  46. data/docs/events/by_name/keypress.md +40 -0
  47. data/docs/events/by_name/log.md +7 -0
  48. data/docs/events/by_name/maximise.md +6 -0
  49. data/docs/events/by_name/menu_bottom.md +4 -0
  50. data/docs/events/by_name/menu_current.md +4 -0
  51. data/docs/events/by_name/menu_deselect.md +4 -0
  52. data/docs/events/by_name/menu_items.md +5 -0
  53. data/docs/events/by_name/menu_next.md +5 -0
  54. data/docs/events/by_name/menu_prev.md +5 -0
  55. data/docs/events/by_name/menu_select.md +4 -0
  56. data/docs/events/by_name/menu_selected.md +4 -0
  57. data/docs/events/by_name/menu_top.md +4 -0
  58. data/docs/events/by_name/menu_view.md +5 -0
  59. data/docs/events/by_name/mode_switch.md +7 -0
  60. data/docs/events/by_name/movement_refresh.md +19 -0
  61. data/docs/events/by_name/refresh.md +9 -0
  62. data/docs/events/by_name/refresh_border.md +5 -0
  63. data/docs/events/by_name/refresh_cursor.md +5 -0
  64. data/docs/events/by_name/refresh_group.md +4 -0
  65. data/docs/events/by_name/refresh_view.md +4 -0
  66. data/docs/events/by_name/refresh_view_content.md +4 -0
  67. data/docs/events/by_name/resize.md +5 -0
  68. data/docs/events/by_name/show_cursor.md +10 -0
  69. data/docs/events/by_name/show_group.md +5 -0
  70. data/docs/events/by_name/show_interface.md +5 -0
  71. data/docs/events/by_name/toggle_cursor.md +9 -0
  72. data/docs/events/by_name/toggle_group.md +5 -0
  73. data/docs/events/by_name/toggle_interface.md +5 -0
  74. data/docs/events/by_name/unmaximise.md +6 -0
  75. data/docs/events/document.md +9 -45
  76. data/docs/events/drb.md +7 -31
  77. data/docs/events/focus.md +3 -18
  78. data/docs/events/menu.md +10 -44
  79. data/docs/events/refresh.md +6 -25
  80. data/docs/events/system.md +8 -101
  81. data/docs/events/view.md +4 -36
  82. data/docs/events/visibility.md +10 -48
  83. data/lib/vedeu/borders/border.rb +117 -37
  84. data/lib/vedeu/borders/refresh.rb +29 -113
  85. data/lib/vedeu/borders/repository.rb +0 -5
  86. data/lib/vedeu/buffers/buffer.rb +13 -17
  87. data/lib/vedeu/buffers/refresh.rb +4 -4
  88. data/lib/vedeu/cursors/refresh.rb +2 -7
  89. data/lib/vedeu/groups/clear.rb +3 -1
  90. data/lib/vedeu/groups/refresh.rb +2 -2
  91. data/lib/vedeu/interfaces/clear.rb +2 -2
  92. data/lib/vedeu/output/refresh.rb +2 -2
  93. data/lib/vedeu/repositories/model.rb +2 -6
  94. data/lib/vedeu/repositories/repository.rb +17 -6
  95. data/lib/vedeu/runtime/flags.rb +2 -0
  96. data/lib/vedeu/version.rb +1 -1
  97. data/test/lib/vedeu/borders/border_test.rb +128 -12
  98. data/test/lib/vedeu/cursors/dsl_test.rb +13 -0
  99. metadata +72 -2
@@ -0,0 +1,5 @@
1
+ ### `:_editor_up_`
2
+ This event attempts to move the virtual cursor up by one line
3
+ in the named document.
4
+
5
+ Vedeu.trigger(:_editor_up_, name)
@@ -0,0 +1,6 @@
1
+ ### `:_exit_`
2
+ When triggered, Vedeu will trigger a `:cleanup` event which you can
3
+ define (to save files, etc) and attempt to exit.
4
+
5
+ Vedeu.trigger(:_exit_)
6
+ Vedeu.exit
@@ -0,0 +1,6 @@
1
+ ### `:_focus_by_name_`
2
+ When triggered with an interface name will focus that interface and
3
+ restore the cursor position and visibility.
4
+
5
+ Vedeu.trigger(:_focus_by_name_, name) # or
6
+ Vedeu.focus_by_name(name)
@@ -0,0 +1,6 @@
1
+ ### `:_focus_next_`
2
+ When triggered will focus the next visible interface and restore the
3
+ cursor position and visibility.
4
+
5
+ Vedeu.trigger(:_focus_next_) # or
6
+ Vedeu.focus_next
@@ -0,0 +1,6 @@
1
+ ### `:_focus_prev_`
2
+ When triggered will focus the previous visible interface and restore
3
+ the cursor position and visibility.
4
+
5
+ Vedeu.trigger(:_focus_prev_) # or
6
+ Vedeu.focus_previous
@@ -0,0 +1,8 @@
1
+ ### `:_goto_`
2
+ Call a client application controller's action with parameters.
3
+
4
+ Vedeu.trigger(:_goto_,
5
+ :your_controller,
6
+ :some_action,
7
+ { id: 7 })
8
+ Vedeu.goto(:your_controller, :some_action, { id: 7 })
@@ -0,0 +1,10 @@
1
+ ### Vedeu.hide_cursor / `:_hide_cursor_`
2
+ Hide the cursor.
3
+
4
+ Vedeu.trigger(:_hide_cursor_, name)
5
+ Vedeu.trigger(:_hide_cursor_, Vedeu.focus)
6
+ Vedeu.trigger(:_cursor_hide_, name)
7
+ Vedeu.trigger(:_cursor_hide_, Vedeu.focus)
8
+
9
+ Vedeu.hide_cursor(name)
10
+ Vedeu.hide_cursor(Vedeu.focus)
@@ -0,0 +1,5 @@
1
+ ### `:_hide_group_`
2
+ Hiding a group of interfaces.
3
+
4
+ Vedeu.trigger(:_hide_group_, name)
5
+ Vedeu.hide_group(name)
@@ -0,0 +1,5 @@
1
+ ### `:_hide_interface_`
2
+ Hide an interface by name.
3
+
4
+ Vedeu.trigger(:_hide_interface_, name)
5
+ Vedeu.hide_interface(name)
@@ -0,0 +1,6 @@
1
+ ### `:_initialize_`
2
+ Vedeu triggers this event when it is ready to enter the main loop.
3
+ Client applications can listen for this event and perform some
4
+ action(s), like render the first screen, interface or make a sound.
5
+
6
+ Vedeu.trigger(:_initialize_)
@@ -0,0 +1,40 @@
1
+ ### `:_keypress_`
2
+ This event is used by Vedeu internally, though you can bind to it if
3
+ you wish. It is preferred for you to bind to `:key` though.
4
+
5
+ When the name is given:
6
+
7
+ - The given key is passed to the named keymap. If the keymap is
8
+ registered, and the key has an associated action assigned, then
9
+ the action will be called/triggered.
10
+ - If the keymap is not registered, the key will be passed to the
11
+ global keymap to be actioned, or ignored if the global keymap does
12
+ not have an action assigned for the key pressed.
13
+
14
+ When the name is not given:
15
+
16
+ - The given key is passed to the named keymap associated with the
17
+ interface/view currently in focus. If the key has an associated
18
+ action assigned, then the action will be called or triggered,
19
+ otherwise, the key is (as above) passed to the global keymap to be
20
+ processed.
21
+
22
+ It is also to be noted, that a `:key` event will be triggered
23
+ irrespective of the conditions above, you can bind to this event
24
+ separately to 'do things'.
25
+
26
+ Vedeu.bind(:key) do
27
+ # ... your code here ...
28
+ end
29
+
30
+ Alternatively, you can access keypresses entered using the following
31
+ API methods: (See {Vedeu::Input::Store} for more details).
32
+
33
+ Vedeu.all_keypresses
34
+
35
+ Vedeu.last_keypress
36
+
37
+ A list of supported keypresses can be found here:
38
+ {Vedeu::Input::Capture}.
39
+
40
+ Vedeu.trigger(:_keypress_, key, optional_name)
@@ -0,0 +1,7 @@
1
+ ### `:_log_`
2
+ When triggered with a message will cause Vedeu to log the message if
3
+ logging is enabled in the configuration.
4
+
5
+ Note: 'message' is a String.
6
+
7
+ Vedeu.trigger(:_log_, message)
@@ -0,0 +1,6 @@
1
+ ### `:_maximise_`
2
+ Maximising an interface.
3
+
4
+ Vedeu.trigger(:_maximise_, name)
5
+
6
+ See {Vedeu::Geometries::Geometry#maximise}
@@ -0,0 +1,4 @@
1
+ ### `:_menu_bottom_`
2
+ Makes the last menu item the current menu item.
3
+
4
+ Vedeu.trigger(:_menu_bottom_, name)
@@ -0,0 +1,4 @@
1
+ ### `:_menu_current_`
2
+ Returns the current menu item.
3
+
4
+ Vedeu.trigger(:_menu_current_, name)
@@ -0,0 +1,4 @@
1
+ ### `:_menu_deselect_`
2
+ Deselects all menu items.
3
+
4
+ Vedeu.trigger(:_menu_deselect_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_menu_items_`
2
+ Returns all the menu items with respective `current` or `selected`
3
+ boolean indicators.
4
+
5
+ Vedeu.trigger(:_menu_items_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_menu_next_`
2
+ Makes the next menu item the current menu item, until it reaches the
3
+ last item.
4
+
5
+ Vedeu.trigger(:_menu_next_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_menu_prev_`
2
+ Makes the previous menu item the current menu item, until it reaches
3
+ the first item.
4
+
5
+ Vedeu.trigger(:_menu_prev_, name)
@@ -0,0 +1,4 @@
1
+ ### `:_menu_select_`
2
+ Makes the current menu item also the selected menu item.
3
+
4
+ Vedeu.trigger(:_menu_select_, name)
@@ -0,0 +1,4 @@
1
+ ### `:_menu_selected_`
2
+ Returns the selected menu item.
3
+
4
+ Vedeu.trigger(:_menu_selected_, name)
@@ -0,0 +1,4 @@
1
+ ### `:_menu_top_`
2
+ Makes the first menu item the current menu item.
3
+
4
+ Vedeu.trigger(:_menu_top_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_menu_view_`
2
+ Returns a subset of the menu items; starting at the current item to
3
+ the last item.
4
+
5
+ Vedeu.trigger(:_menu_view_, name)
@@ -0,0 +1,7 @@
1
+ ### `:_mode_switch_`
2
+ When triggered, Vedeu switches between modes of the terminal. The idea
3
+ here being that the raw mode is for single keypress actions, whilst
4
+ fake and cooked modes allow the user to enter more elaborate commands-
5
+ such as commands with arguments.
6
+
7
+ Vedeu.trigger(:_mode_switch_, mode)
@@ -0,0 +1,19 @@
1
+ ### `:_movement_refresh_`
2
+ When triggered, triggers additional events which aid the updating of
3
+ the output. Used when moving an interface/view.
4
+
5
+ Vedeu.trigger(:_movement_refresh_, name)
6
+
7
+ At this time, triggering this event will:
8
+
9
+ - Clear the entire terminal (assuming at least one renderer is the
10
+ default (Vedeu::Renderer::Terminal)). This action is performed when
11
+ moving an interface/view so that there are no 'artefacts' left
12
+ behind.
13
+ - Refresh the entire terminal (as above). This means all visible
14
+ interfaces are re-rendered. This action is performed to ensure other
15
+ views currently visible are rendered in their current position.
16
+ - Clears the named view. This action removes the named view from the
17
+ terminal (or output).
18
+ - Refreshes the named view. This action adds the named view to the
19
+ terminal (or output); in the new position.
@@ -0,0 +1,9 @@
1
+ ### `:_refresh_`
2
+ Refreshes all registered interfaces.
3
+
4
+ The interfaces will be refreshed in z-index order, meaning that
5
+ interfaces with a lower z-index will be drawn first. This means
6
+ overlapping interfaces will be drawn as specified. Hidden interfaces
7
+ will be still refreshed in memory but not shown.
8
+
9
+ Vedeu.trigger(:_refresh_)
@@ -0,0 +1,5 @@
1
+ ### `:_refresh_border_`
2
+ This event refreshes the border of the named view, unless the view
3
+ does not have a border, or the border is not enabled.
4
+
5
+ Vedeu.trigger(:_refresh_border_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_refresh_cursor_`
2
+ Will cause the named cursor to refresh, or the cursor of the interface
3
+ which is currently in focus.
4
+
5
+ Vedeu.trigger(:_refresh_cursor_, name)
@@ -0,0 +1,4 @@
1
+ ### `:_refresh_group_`
2
+ Will cause all interfaces in the named group to refresh.
3
+
4
+ Vedeu.trigger(:_refresh_group_, name)
@@ -0,0 +1,4 @@
1
+ ### `:_refresh_view_`
2
+ Will cause the named view to refresh.
3
+
4
+ Vedeu.trigger(:_refresh_view_, name)
@@ -0,0 +1,4 @@
1
+ ### `:_refresh_view_content_`
2
+ Will cause only the content of the named view to refresh.
3
+
4
+ Vedeu.trigger(:_refresh_view_content_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_resize_`
2
+ When triggered will cause Vedeu to trigger the `:_clear_` and
3
+ `:_refresh_` events. Please see those events for their behaviour.
4
+
5
+ Vedeu.trigger(:_resize_)
@@ -0,0 +1,10 @@
1
+ ### Vedeu.show_cursor / `:_show_cursor_`
2
+ Show the cursor.
3
+
4
+ Vedeu.trigger(:_show_cursor_, name)
5
+ Vedeu.trigger(:_show_cursor_, Vedeu.focus)
6
+ Vedeu.trigger(:_cursor_show_, name)
7
+ Vedeu.trigger(:_cursor_show_, Vedeu.focus)
8
+
9
+ Vedeu.show_cursor(name)
10
+ Vedeu.show_cursor(Vedeu.focus)
@@ -0,0 +1,5 @@
1
+ ### `:_show_group_`
2
+ Showing a group of interfaces.
3
+
4
+ Vedeu.trigger(:_show_group_, name)
5
+ Vedeu.show_group(name)
@@ -0,0 +1,5 @@
1
+ ### `:_show_interface_`
2
+ Show an interface by name.
3
+
4
+ Vedeu.trigger(:_show_interface_, name)
5
+ Vedeu.show_interface(name)
@@ -0,0 +1,9 @@
1
+ ### Vedeu.toggle_cursor / `:_toggle_cursor_`
2
+ Toggle the visibility of the cursor. If hidden, then show. If shown,
3
+ then hide.
4
+
5
+ Vedeu.trigger(:_toggle_cursor_, name)
6
+ Vedeu.trigger(:_toggle_cursor_, Vedeu.focus)
7
+
8
+ Vedeu.toggle_cursor(name)
9
+ Vedeu.toggle_cursor(Vedeu.focus)
@@ -0,0 +1,5 @@
1
+ ### `:_toggle_group_`
2
+ Toggling a group of interfaces.
3
+
4
+ Vedeu.trigger(:_toggle_group_, name)
5
+ Vedeu.toggle_group(name)
@@ -0,0 +1,5 @@
1
+ ### `:_toggle_interface_`
2
+ Toggling an interface.
3
+
4
+ Vedeu.trigger(:_toggle_interface_, name)
5
+ Vedeu.toggle_interface(name)
@@ -0,0 +1,6 @@
1
+ ### `:_unmaximise_`
2
+ Unmaximising an interface.
3
+
4
+ Vedeu.trigger(:_unmaximise_, name)
5
+
6
+ See {Vedeu::Geometries::Geometry#unmaximise}
@@ -4,56 +4,20 @@
4
4
 
5
5
  Note: 'name' is a Symbol unless mentioned otherwise.
6
6
 
7
- ### `:_editor_execute_`
7
+ {include:file:docs/events/by_name/editor_execute.md}
8
8
 
9
- Vedeu.trigger(:_editor_execute_, name)
9
+ {include:file:docs/events/by_name/editor_delete_character.md}
10
10
 
11
- ### `:_editor_delete_character_`
12
- This event attempts to delete the character in the named
13
- document at the current virtual cursor position.
11
+ {include:file:docs/events/by_name/editor_delete_line.md}
14
12
 
15
- Vedeu.trigger(:_editor_delete_character_, name)
13
+ {include:file:docs/events/by_name/editor_down.md}
16
14
 
17
- ### `:_editor_delete_line_`
18
- This event attempts to delete the line in the named document
19
- at the current virtual cursor position.
15
+ {include:file:docs/events/by_name/editor_insert_character.md}
20
16
 
21
- Vedeu.trigger(:_editor_delete_line_, name)
17
+ {include:file:docs/events/by_name/editor_insert_line.md}
22
18
 
23
- ### `:_editor_down_`
24
- This event attempts to move the virtual cursor down by one
25
- line in the named document.
19
+ {include:file:docs/events/by_name/editor_left.md}
26
20
 
27
- Vedeu.trigger(:_editor_down_, name)
21
+ {include:file:docs/events/by_name/editor_right.md}
28
22
 
29
- ### `:_editor_insert_character_`
30
- This event attempts to insert the given character in the named
31
- document at the current virtual cursor position.
32
-
33
- Note: 'character' is a string.
34
-
35
- Vedeu.trigger(:_editor_insert_character_, name, character)
36
-
37
- ### `:_editor_insert_line_`
38
- This event attempts to insert a new line in the named document
39
- at the current virtual cursor position.
40
-
41
- Vedeu.trigger(:_editor_insert_line_, name)
42
-
43
- ### `:_editor_left_`
44
- This event attempts to move the virtual cursor left by one
45
- character in the named document.
46
-
47
- Vedeu.trigger(:_editor_left_, name)
48
-
49
- ### `:_editor_right_`
50
- This event attempts to move the virtual cursor right by one
51
- character in the named document.
52
-
53
- Vedeu.trigger(:_editor_right_, name)
54
-
55
- ### `:_editor_up_`
56
- This event attempts to move the virtual cursor up by one line
57
- in the named document.
58
-
59
- Vedeu.trigger(:_editor_up_, name)
23
+ {include:file:docs/events/by_name/editor_up.md}
data/docs/events/drb.md CHANGED
@@ -2,40 +2,16 @@
2
2
 
3
3
  ## DRB Events
4
4
 
5
- ### `:_drb_input_`
6
- Triggering this event will send input to the running application as
7
- long as it has the DRb server running.
5
+ {include:file:docs/events/by_name/drb_input.md}
8
6
 
9
- Note: See {Vedeu::Distributed::Server#input} for parameter details.
7
+ {include:file:docs/events/by_name/drb_retrieve_output.md}
10
8
 
11
- Vedeu.trigger(:_drb_input_, data, type)
9
+ {include:file:docs/events/by_name/drb_store_output.md}
12
10
 
13
- ### `:_drb_retrieve_output_`
14
- See {Vedeu::Buffers::Terminal#output}
11
+ {include:file:docs/events/by_name/drb_restart.md}
15
12
 
16
- ### `:_drb_store_output_`
17
- See {Vedeu::Buffers::Terminal#write}
13
+ {include:file:docs/events/by_name/drb_start.md}
18
14
 
19
- ### `:_drb_restart_`
20
- Use the DRb server to request the client application to restart.
15
+ {include:file:docs/events/by_name/drb_status.md}
21
16
 
22
- Vedeu.trigger(:_drb_restart_)
23
- Vedeu.drb_restart
24
-
25
- ### `:_drb_start_`
26
- Use the DRb server to request the client application to start.
27
-
28
- Vedeu.trigger(:_drb_start_)
29
- Vedeu.drb_start
30
-
31
- ### `:_drb_status_`
32
- Use the DRb server to request the status of the client application.
33
-
34
- Vedeu.trigger(:_drb_status_)
35
- Vedeu.drb_status
36
-
37
- ### `:_drb_stop_`
38
- Use the DRb server to request the client application to stop.
39
-
40
- Vedeu.trigger(:_drb_stop_)
41
- Vedeu.drb_stop
17
+ {include:file:docs/events/by_name/drb_stop.md}