reterm 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/designer/src/ComponentParams.rb +89 -42
- data/designer/src/ComponentsList.rb +26 -25
- data/designer/src/CreatedList.rb +9 -0
- data/designer/src/Designer.rb +23 -1
- data/designer/src/ToggleArea.rb +20 -3
- data/designer/src/about.rb +35 -0
- data/designer/src/component_factory.rb +18 -0
- data/designer/src/component_map.rb +7 -0
- data/designer/src/file_chooser.rb +25 -0
- data/designer/src/glade/Designer.glade +1 -19
- data/designer/src/images/{slist.png → scroll_list.png} +0 -0
- data/lib/reterm.rb +10 -1
- data/lib/reterm/color_pair.rb +166 -10
- data/lib/reterm/component.rb +89 -2
- data/lib/reterm/components.rb +16 -1
- data/lib/reterm/components/alphalist.rb +45 -0
- data/lib/reterm/components/ascii_text.rb +14 -1
- data/lib/reterm/components/asciimator.rb +1 -0
- data/lib/reterm/components/button.rb +35 -5
- data/lib/reterm/components/button_box.rb +108 -0
- data/lib/reterm/components/close_button.rb +22 -0
- data/lib/reterm/components/cmd_output.rb +69 -0
- data/lib/reterm/components/dial.rb +11 -2
- data/lib/reterm/components/dialog.rb +41 -1
- data/lib/reterm/components/drop_down_menu.rb +140 -0
- data/lib/reterm/components/entry.rb +42 -14
- data/lib/reterm/components/histogram.rb +55 -0
- data/lib/reterm/components/hslider.rb +9 -0
- data/lib/reterm/components/image.rb +9 -0
- data/lib/reterm/components/isometric.rb +38 -0
- data/lib/reterm/components/label.rb +20 -3
- data/lib/reterm/components/matrix.rb +9 -0
- data/lib/reterm/components/multi_line_entry.rb +54 -0
- data/lib/reterm/components/password_entry.rb +15 -0
- data/lib/reterm/components/radio.rb +10 -0
- data/lib/reterm/components/revealing_label.rb +126 -0
- data/lib/reterm/components/rocker.rb +21 -11
- data/lib/reterm/components/scroll_list.rb +96 -0
- data/lib/reterm/components/scrolling_area.rb +50 -0
- data/lib/reterm/components/select_list.rb +67 -0
- data/lib/reterm/components/splash.rb +85 -0
- data/lib/reterm/components/template.rb +12 -1
- data/lib/reterm/components/treeview.rb +1 -0
- data/lib/reterm/components/vslider.rb +11 -2
- data/lib/reterm/components/youtube.rb +20 -0
- data/lib/reterm/config.rb +22 -0
- data/lib/reterm/init.rb +131 -6
- data/lib/reterm/layout.rb +147 -11
- data/lib/reterm/layouts.rb +1 -0
- data/lib/reterm/layouts/grid.rb +69 -0
- data/lib/reterm/layouts/horizontal.rb +25 -4
- data/lib/reterm/layouts/vertical.rb +26 -5
- data/lib/reterm/loader.rb +2 -2
- data/lib/reterm/mixins/button_helpers.rb +7 -0
- data/lib/reterm/mixins/cdk_component.rb +66 -2
- data/lib/reterm/mixins/common_controls.rb +15 -0
- data/lib/reterm/mixins/common_keys.rb +20 -0
- data/lib/reterm/mixins/component_input.rb +62 -14
- data/lib/reterm/mixins/event_dispatcher.rb +2 -0
- data/lib/reterm/mixins/item_helpers.rb +8 -0
- data/lib/reterm/mixins/key_bindings.rb +23 -0
- data/lib/reterm/mixins/log_helpers.rb +13 -0
- data/lib/reterm/mixins/mouse_input.rb +58 -0
- data/lib/reterm/mixins/nav_controls.rb +33 -0
- data/lib/reterm/mixins/nav_input.rb +161 -69
- data/lib/reterm/terminal.rb +6 -2
- data/lib/reterm/util.rb +121 -0
- data/lib/reterm/version.rb +1 -1
- data/lib/reterm/window.rb +295 -29
- metadata +33 -17
- data/designer/src/images/orig/Check.png +0 -0
- data/designer/src/images/orig/ascii_text.png +0 -0
- data/designer/src/images/orig/button.png +0 -0
- data/designer/src/images/orig/dial.png +0 -0
- data/designer/src/images/orig/entry.png +0 -0
- data/designer/src/images/orig/hslider.png +0 -0
- data/designer/src/images/orig/label.png +0 -0
- data/designer/src/images/orig/matrix.png +0 -0
- data/designer/src/images/orig/radio.png +0 -0
- data/designer/src/images/orig/rocker.png +0 -0
- data/designer/src/images/orig/slist.png +0 -0
- data/designer/src/images/orig/vslider.png +0 -0
- data/lib/reterm/components/slist.rb +0 -32
- data/lib/reterm/menu.rb +0 -81
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reterm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mo Morsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-terminfo
|
@@ -54,9 +54,11 @@ files:
|
|
54
54
|
- designer/src/CreatedList.rb
|
55
55
|
- designer/src/Designer.rb
|
56
56
|
- designer/src/ToggleArea.rb
|
57
|
+
- designer/src/about.rb
|
57
58
|
- designer/src/common.rb
|
58
59
|
- designer/src/component_factory.rb
|
59
60
|
- designer/src/component_map.rb
|
61
|
+
- designer/src/file_chooser.rb
|
60
62
|
- designer/src/glade/ComponentParams.glade
|
61
63
|
- designer/src/glade/Designer.glade
|
62
64
|
- designer/src/images/add.png
|
@@ -69,55 +71,69 @@ files:
|
|
69
71
|
- designer/src/images/hslider.png
|
70
72
|
- designer/src/images/label.png
|
71
73
|
- designer/src/images/matrix.png
|
72
|
-
- designer/src/images/orig/Check.png
|
73
|
-
- designer/src/images/orig/ascii_text.png
|
74
|
-
- designer/src/images/orig/button.png
|
75
|
-
- designer/src/images/orig/dial.png
|
76
|
-
- designer/src/images/orig/entry.png
|
77
|
-
- designer/src/images/orig/hslider.png
|
78
|
-
- designer/src/images/orig/label.png
|
79
|
-
- designer/src/images/orig/matrix.png
|
80
|
-
- designer/src/images/orig/radio.png
|
81
|
-
- designer/src/images/orig/rocker.png
|
82
|
-
- designer/src/images/orig/slist.png
|
83
|
-
- designer/src/images/orig/vslider.png
|
84
74
|
- designer/src/images/radio.png
|
85
75
|
- designer/src/images/remove.png
|
86
76
|
- designer/src/images/rocker.png
|
87
|
-
- designer/src/images/
|
77
|
+
- designer/src/images/scroll_list.png
|
88
78
|
- designer/src/images/vslider.png
|
89
79
|
- lib/reterm.rb
|
90
80
|
- lib/reterm/color_pair.rb
|
91
81
|
- lib/reterm/component.rb
|
92
82
|
- lib/reterm/components.rb
|
83
|
+
- lib/reterm/components/alphalist.rb
|
93
84
|
- lib/reterm/components/ascii_text.rb
|
85
|
+
- lib/reterm/components/asciimator.rb
|
94
86
|
- lib/reterm/components/button.rb
|
87
|
+
- lib/reterm/components/button_box.rb
|
88
|
+
- lib/reterm/components/close_button.rb
|
89
|
+
- lib/reterm/components/cmd_output.rb
|
95
90
|
- lib/reterm/components/dial.rb
|
96
91
|
- lib/reterm/components/dialog.rb
|
92
|
+
- lib/reterm/components/drop_down_menu.rb
|
97
93
|
- lib/reterm/components/entry.rb
|
94
|
+
- lib/reterm/components/histogram.rb
|
98
95
|
- lib/reterm/components/hslider.rb
|
99
96
|
- lib/reterm/components/image.rb
|
97
|
+
- lib/reterm/components/isometric.rb
|
100
98
|
- lib/reterm/components/label.rb
|
101
99
|
- lib/reterm/components/matrix.rb
|
100
|
+
- lib/reterm/components/multi_line_entry.rb
|
101
|
+
- lib/reterm/components/password_entry.rb
|
102
102
|
- lib/reterm/components/radio.rb
|
103
|
+
- lib/reterm/components/revealing_label.rb
|
103
104
|
- lib/reterm/components/rocker.rb
|
104
|
-
- lib/reterm/components/
|
105
|
+
- lib/reterm/components/scroll_list.rb
|
106
|
+
- lib/reterm/components/scrolling_area.rb
|
107
|
+
- lib/reterm/components/select_list.rb
|
108
|
+
- lib/reterm/components/splash.rb
|
105
109
|
- lib/reterm/components/template.rb
|
110
|
+
- lib/reterm/components/treeview.rb
|
106
111
|
- lib/reterm/components/vslider.rb
|
112
|
+
- lib/reterm/components/youtube.rb
|
113
|
+
- lib/reterm/config.rb
|
107
114
|
- lib/reterm/init.rb
|
108
115
|
- lib/reterm/layout.rb
|
109
116
|
- lib/reterm/layouts.rb
|
117
|
+
- lib/reterm/layouts/grid.rb
|
110
118
|
- lib/reterm/layouts/horizontal.rb
|
111
119
|
- lib/reterm/layouts/vertical.rb
|
112
120
|
- lib/reterm/loader.rb
|
113
|
-
- lib/reterm/
|
121
|
+
- lib/reterm/mixins/button_helpers.rb
|
114
122
|
- lib/reterm/mixins/cdk_component.rb
|
123
|
+
- lib/reterm/mixins/common_controls.rb
|
124
|
+
- lib/reterm/mixins/common_keys.rb
|
115
125
|
- lib/reterm/mixins/component_input.rb
|
116
126
|
- lib/reterm/mixins/event_dispatcher.rb
|
127
|
+
- lib/reterm/mixins/item_helpers.rb
|
128
|
+
- lib/reterm/mixins/key_bindings.rb
|
129
|
+
- lib/reterm/mixins/log_helpers.rb
|
130
|
+
- lib/reterm/mixins/mouse_input.rb
|
131
|
+
- lib/reterm/mixins/nav_controls.rb
|
117
132
|
- lib/reterm/mixins/nav_input.rb
|
118
133
|
- lib/reterm/panel.rb
|
119
134
|
- lib/reterm/resize.rb
|
120
135
|
- lib/reterm/terminal.rb
|
136
|
+
- lib/reterm/util.rb
|
121
137
|
- lib/reterm/version.rb
|
122
138
|
- lib/reterm/window.rb
|
123
139
|
homepage: http://github.com/movitto/reterm
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module RETerm
|
2
|
-
module Components
|
3
|
-
# Scrolling List CDK Component
|
4
|
-
class SList < Component
|
5
|
-
include CDKComponent
|
6
|
-
|
7
|
-
# Initialize the SList component
|
8
|
-
#
|
9
|
-
# @param [Hash] args list params
|
10
|
-
# @option args [String] :title title of list
|
11
|
-
# @option args [Array<String>] :items items to
|
12
|
-
# populate list with
|
13
|
-
def initialize(args={})
|
14
|
-
@title = args[:title] || ""
|
15
|
-
@items = args[:items] || []
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def _component
|
21
|
-
CDK::SCROLL.new(window.cdk_scr, # cdkscreen,
|
22
|
-
2, 1, CDK::RIGHT, # xplace, yplace, scroll pos
|
23
|
-
window.rows - 2, # widget height
|
24
|
-
window.cols - 2, # widget width
|
25
|
-
@title, @items, @items.size, # title and items
|
26
|
-
false, # prefix numbers
|
27
|
-
Ncurses::A_REVERSE, # highlight
|
28
|
-
true, false) # box, shadow
|
29
|
-
end
|
30
|
-
end # SList
|
31
|
-
end # module Components
|
32
|
-
end # module RETerm
|
data/lib/reterm/menu.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
module RETerm
|
2
|
-
# Graphical menu rendered on screen
|
3
|
-
#
|
4
|
-
# TODO: look into working this into std component/activation subsystem
|
5
|
-
class Menu
|
6
|
-
include EventDispatcher
|
7
|
-
|
8
|
-
attr_accessor :window
|
9
|
-
|
10
|
-
# Menus should be instantiated with a hash of label/value
|
11
|
-
# pairs to assign to menu
|
12
|
-
def initialize(items={})
|
13
|
-
@items = items
|
14
|
-
@menu = Ncurses::Menu.new_menu(items.collect { |k,v|
|
15
|
-
Ncurses::Menu.new_item(k.to_s, v.to_s)
|
16
|
-
})
|
17
|
-
|
18
|
-
@menu.menu_opts_off(Ncurses::Menu::O_SHOWDESC)
|
19
|
-
end
|
20
|
-
|
21
|
-
# Return number of rows in menu
|
22
|
-
def rows
|
23
|
-
@items.size
|
24
|
-
end
|
25
|
-
|
26
|
-
# Return number of cols in menu
|
27
|
-
def cols
|
28
|
-
@cols ||= @items.keys.max { |k| k.size }.size + 3
|
29
|
-
end
|
30
|
-
|
31
|
-
# Attach menu to specified window
|
32
|
-
def attach_to(win)
|
33
|
-
@menu.set_menu_win(win.win)
|
34
|
-
win.component = self
|
35
|
-
|
36
|
-
@child_win = win.create_child :rows => rows,
|
37
|
-
:cols => cols,
|
38
|
-
:x => 1, :y => 1
|
39
|
-
@menu.set_menu_sub(@child_win.win)
|
40
|
-
@menu.post_menu
|
41
|
-
|
42
|
-
self
|
43
|
-
end
|
44
|
-
|
45
|
-
# Destroy menu subsystem
|
46
|
-
def detach
|
47
|
-
@menu.unpost_menu
|
48
|
-
end
|
49
|
-
|
50
|
-
def finalize!
|
51
|
-
end
|
52
|
-
|
53
|
-
# Static map of menu drivers to internal representations.
|
54
|
-
#
|
55
|
-
# XXX defined here (as opposed to a const) since these
|
56
|
-
# consts won't be available until after init_scr
|
57
|
-
def driver_map
|
58
|
-
@driver_map ||= {
|
59
|
-
:left => Ncurses::Menu::REQ_LEFT_ITEM,
|
60
|
-
:right => Ncurses::Menu::REQ_RIGHT_ITEM,
|
61
|
-
:up => Ncurses::Menu::REQ_UP_ITEM,
|
62
|
-
:down => Ncurses::Menu::REQ_DOWN_ITEM,
|
63
|
-
:scr_up_line => Ncurses::Menu::REQ_SCR_ULINE,
|
64
|
-
:scr_down_line => Ncurses::Menu::REQ_SCR_DLINE,
|
65
|
-
:scr_down_page => Ncurses::Menu::REQ_SCR_DPAGE,
|
66
|
-
:scr_up_page => Ncurses::Menu::REQ_SCR_UPAGE,
|
67
|
-
:first => Ncurses::Menu::REQ_FIRST_ITEM,
|
68
|
-
:last => Ncurses::Menu::REQ_LAST_ITEM,
|
69
|
-
:next => Ncurses::Menu::REQ_NEXT_ITEM,
|
70
|
-
:prev => Ncurses::Menu::REQ_PREV_ITEM,
|
71
|
-
:toggle => Ncurses::Menu::REQ_TOGGLE_ITEM
|
72
|
-
}
|
73
|
-
end
|
74
|
-
|
75
|
-
# Drive menu from input
|
76
|
-
def drive(i)
|
77
|
-
i = driver_map[i] if i.is_a?(Symbol)
|
78
|
-
Ncurses::Menu.menu_driver(@menu, i)
|
79
|
-
end
|
80
|
-
end # class Menu
|
81
|
-
end # module RETerm
|