glimmer-cs-gladiator 0.8.0 → 0.8.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/LICENSE.txt +20 -20
- data/README.md +9 -7
- data/VERSION +1 -1
- data/bin/gladiator +34 -34
- data/bin/gladiator-setup +80 -80
- data/bin/glimmer-cs-gladiator +22 -22
- data/glimmer-cs-gladiator.gemspec +8 -7
- data/lib/glimmer-cs-gladiator.rb +30 -30
- data/lib/glimmer-cs-gladiator/launch.rb +6 -6
- data/lib/models/glimmer/gladiator/command.rb +112 -112
- data/lib/models/glimmer/gladiator/file.rb +662 -662
- data/lib/views/glimmer/gladiator.rb +93 -72
- data/lib/views/glimmer/gladiator/file_explorer_tree.rb +244 -244
- data/lib/views/glimmer/gladiator/file_lookup_list.rb +64 -64
- data/lib/views/glimmer/gladiator/gladiator_menu_bar.rb +2 -2
- data/lib/views/glimmer/gladiator/progress_shell.rb +31 -31
- data/lib/views/glimmer/gladiator/text_editor.rb +11 -10
- metadata +5 -4
@@ -1,64 +1,64 @@
|
|
1
|
-
# Copyright (c) 2020-2021 Andy Maleh
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
# a copy of this software and associated documentation files (the
|
5
|
-
# "Software"), to deal in the Software without restriction, including
|
6
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
# the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be
|
12
|
-
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
22
|
-
module Glimmer
|
23
|
-
class Gladiator
|
24
|
-
class FileLookupList
|
25
|
-
include Glimmer::UI::CustomWidget
|
26
|
-
|
27
|
-
options :gladiator, :foreground_color
|
28
|
-
|
29
|
-
body {
|
30
|
-
list(:border, :h_scroll, :v_scroll) {
|
31
|
-
selection bind(project_dir, :filtered_path)
|
32
|
-
# visible bind(project_dir, 'filter') {|f| pd swt_widget&.get_shell&.get_data('proxy'); swt_widget&.get_shell&.get_data('proxy')&.pack_same_size; !!f}
|
33
|
-
foreground foreground_color
|
34
|
-
on_mouse_up {
|
35
|
-
project_dir.selected_child_path = swt_widget.getSelection.first
|
36
|
-
}
|
37
|
-
on_key_pressed { |key_event|
|
38
|
-
if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr)
|
39
|
-
project_dir.selected_child_path = swt_widget.getSelection.first
|
40
|
-
current_text_editor&.text_widget&.setFocus
|
41
|
-
end
|
42
|
-
}
|
43
|
-
drag_source(DND::DROP_COPY) {
|
44
|
-
transfer :text
|
45
|
-
on_drag_set_data { |event|
|
46
|
-
Gladiator.drag = true
|
47
|
-
list = event.widget.getControl
|
48
|
-
event.data = list.getSelection.first
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
def project_dir
|
55
|
-
gladiator.project_dir
|
56
|
-
end
|
57
|
-
|
58
|
-
def current_text_editor
|
59
|
-
gladiator.current_text_editor
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
1
|
+
# Copyright (c) 2020-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
module Glimmer
|
23
|
+
class Gladiator
|
24
|
+
class FileLookupList
|
25
|
+
include Glimmer::UI::CustomWidget
|
26
|
+
|
27
|
+
options :gladiator, :foreground_color
|
28
|
+
|
29
|
+
body {
|
30
|
+
list(:border, :h_scroll, :v_scroll) {
|
31
|
+
selection bind(project_dir, :filtered_path)
|
32
|
+
# visible bind(project_dir, 'filter') {|f| pd swt_widget&.get_shell&.get_data('proxy'); swt_widget&.get_shell&.get_data('proxy')&.pack_same_size; !!f}
|
33
|
+
foreground foreground_color
|
34
|
+
on_mouse_up {
|
35
|
+
project_dir.selected_child_path = swt_widget.getSelection.first
|
36
|
+
}
|
37
|
+
on_key_pressed { |key_event|
|
38
|
+
if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr)
|
39
|
+
project_dir.selected_child_path = swt_widget.getSelection.first
|
40
|
+
current_text_editor&.text_widget&.setFocus
|
41
|
+
end
|
42
|
+
}
|
43
|
+
drag_source(DND::DROP_COPY) {
|
44
|
+
transfer :text
|
45
|
+
on_drag_set_data { |event|
|
46
|
+
Gladiator.drag = true
|
47
|
+
list = event.widget.getControl
|
48
|
+
event.data = list.getSelection.first
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
def project_dir
|
55
|
+
gladiator.project_dir
|
56
|
+
end
|
57
|
+
|
58
|
+
def current_text_editor
|
59
|
+
gladiator.current_text_editor
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -111,12 +111,12 @@ module Glimmer
|
|
111
111
|
}
|
112
112
|
menu_item(:check) {
|
113
113
|
text '&Maximize Editor'
|
114
|
-
accelerator COMMAND_KEY,
|
114
|
+
accelerator COMMAND_KEY, CONTROL_KEY, :m
|
115
115
|
selection bind(gladiator, :maximized_editor)
|
116
116
|
}
|
117
117
|
menu_item {
|
118
118
|
text '&Reset All'
|
119
|
-
accelerator COMMAND_KEY,
|
119
|
+
accelerator COMMAND_KEY, CONTROL_KEY, :r
|
120
120
|
on_widget_selected {
|
121
121
|
gladiator.maximized_editor = false
|
122
122
|
gladiator.file_area_and_editor_area_sash_form.weights = [1, 5]
|
@@ -1,31 +1,31 @@
|
|
1
|
-
module Glimmer
|
2
|
-
class Gladiator
|
3
|
-
class ProgressShell
|
4
|
-
include Glimmer::UI::CustomShell
|
5
|
-
|
6
|
-
option :gladiator
|
7
|
-
option :progress_text, default: 'Work In Progress'
|
8
|
-
|
9
|
-
body {
|
10
|
-
shell(gladiator.body_root, :title) {
|
11
|
-
fill_layout(:vertical) {
|
12
|
-
margin_width 15
|
13
|
-
margin_height 15
|
14
|
-
spacing 5
|
15
|
-
}
|
16
|
-
|
17
|
-
text 'Gladiator'
|
18
|
-
|
19
|
-
gladiator_menu_bar(gladiator: gladiator, editing: true)
|
20
|
-
|
21
|
-
label(:center) {
|
22
|
-
text progress_text
|
23
|
-
font height: 20
|
24
|
-
}
|
25
|
-
# @progress_bar = progress_bar(:horizontal, :indeterminate)
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
1
|
+
module Glimmer
|
2
|
+
class Gladiator
|
3
|
+
class ProgressShell
|
4
|
+
include Glimmer::UI::CustomShell
|
5
|
+
|
6
|
+
option :gladiator
|
7
|
+
option :progress_text, default: 'Work In Progress'
|
8
|
+
|
9
|
+
body {
|
10
|
+
shell(gladiator.body_root, :title) {
|
11
|
+
fill_layout(:vertical) {
|
12
|
+
margin_width 15
|
13
|
+
margin_height 15
|
14
|
+
spacing 5
|
15
|
+
}
|
16
|
+
|
17
|
+
text 'Gladiator'
|
18
|
+
|
19
|
+
gladiator_menu_bar(gladiator: gladiator, editing: true)
|
20
|
+
|
21
|
+
label(:center) {
|
22
|
+
text progress_text
|
23
|
+
font height: 20
|
24
|
+
}
|
25
|
+
# @progress_bar = progress_bar(:horizontal, :indeterminate)
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -122,6 +122,7 @@ module Glimmer
|
|
122
122
|
selection_count bind(self, 'file.selection_count')
|
123
123
|
caret_position bind(self, 'file.caret_position')
|
124
124
|
top_pixel bind(self, 'file.top_pixel')
|
125
|
+
# key_binding swt(:ctrl, :home), ST::TEXT_START # This seems to make the caret disappear on Windows so disabling for now and relying on key event instead
|
125
126
|
on_focus_lost {
|
126
127
|
file&.write_dirty_content
|
127
128
|
}
|
@@ -132,11 +133,17 @@ module Glimmer
|
|
132
133
|
key_event.doit = !Command.undo(file)
|
133
134
|
elsif key_event.stateMask == swt(COMMAND_KEY) && extract_char(key_event) == 'a'
|
134
135
|
key_event.widget.selectAll
|
135
|
-
elsif
|
136
|
-
|
136
|
+
elsif (OS.mac? && key_event.keyCode == swt(:home)) || (!OS.mac? && Glimmer::SWT::SWTProxy.include?(key_event.stateMask, :ctrl) && key_event.keyCode == swt(:home))
|
137
|
+
file.home
|
138
|
+
key_event.doit = false
|
139
|
+
elsif (OS.mac? && key_event.keyCode == swt(:home)) || (!OS.mac? && Glimmer::SWT::SWTProxy.include?(key_event.stateMask, :ctrl) && key_event.keyCode == swt(:end))
|
140
|
+
file.end
|
141
|
+
key_event.doit = false
|
142
|
+
elsif (OS.mac? && key_event.stateMask == swt(:ctrl) && extract_char(key_event) == 'a') || (!OS.mac? && key_event.keyCode == swt(:home))
|
143
|
+
file.start_of_line
|
137
144
|
key_event.doit = false
|
138
|
-
elsif
|
139
|
-
|
145
|
+
elsif (OS.mac? && key_event.stateMask == swt(:ctrl) && extract_char(key_event) == 'e') || (!OS.mac? && key_event.keyCode == swt(:end))
|
146
|
+
file.end_of_line
|
140
147
|
key_event.doit = false
|
141
148
|
elsif key_event.stateMask == swt(COMMAND_KEY) && extract_char(key_event) == '/'
|
142
149
|
Command.do(file, :comment_line!)
|
@@ -165,12 +172,6 @@ module Glimmer
|
|
165
172
|
elsif key_event.keyCode == swt(:page_down)
|
166
173
|
file.page_down
|
167
174
|
key_event.doit = false
|
168
|
-
elsif key_event.keyCode == swt(:home)
|
169
|
-
file.home
|
170
|
-
key_event.doit = false
|
171
|
-
elsif key_event.keyCode == swt(:end)
|
172
|
-
file.end
|
173
|
-
key_event.doit = false
|
174
175
|
elsif key_event.stateMask == swt(COMMAND_KEY) && key_event.keyCode == swt(:arrow_up)
|
175
176
|
Command.do(file, :move_up!)
|
176
177
|
key_event.doit = false
|
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-cs-gladiator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 4.18.3
|
18
|
+
version: 4.18.4.3
|
19
19
|
- - "<"
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 5.0.0.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 4.18.3
|
29
|
+
version: 4.18.4.3
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 5.0.0.0
|
@@ -127,6 +127,7 @@ executables:
|
|
127
127
|
- gladiator-setup
|
128
128
|
extensions: []
|
129
129
|
extra_rdoc_files:
|
130
|
+
- CHANGELOG.md
|
130
131
|
- LICENSE.txt
|
131
132
|
- README.md
|
132
133
|
files:
|