Merge lp:~vthompson/ubuntu-terminal-app/testing-fix into lp:ubuntu-terminal-app
- testing-fix
- Merge into trunk
Proposed by
spookje
Status: | Needs review |
---|---|
Proposed branch: | lp:~vthompson/ubuntu-terminal-app/testing-fix |
Merge into: | lp:ubuntu-terminal-app |
Diff against target: |
24755 lines (+24263/-0) (has conflicts) 96 files modified
.bzrignore (+11/-0) README (+11/-0) assets/color-schemes/BlackOnLightYellow.schema (+42/-0) assets/color-schemes/BlackOnRandomLight.colorscheme (+104/-0) assets/color-schemes/BlackOnWhite.schema (+42/-0) assets/color-schemes/DarkPastels.colorscheme (+103/-0) assets/color-schemes/GreenOnBlack.colorscheme (+104/-0) assets/color-schemes/Linux.colorscheme (+100/-0) assets/color-schemes/WhiteOnBlack.schema (+42/-0) assets/color-schemes/historic/BlackOnLightColor.schema (+42/-0) assets/color-schemes/historic/DarkPicture.schema (+44/-0) assets/color-schemes/historic/Example.Schema (+47/-0) assets/color-schemes/historic/GreenOnBlack.schema (+42/-0) assets/color-schemes/historic/GreenTint.schema (+49/-0) assets/color-schemes/historic/GreenTint_MC.schema (+49/-0) assets/color-schemes/historic/LightPicture.schema (+44/-0) assets/color-schemes/historic/Linux.schema (+47/-0) assets/color-schemes/historic/README.Schema (+132/-0) assets/color-schemes/historic/README.default.Schema (+44/-0) assets/color-schemes/historic/Transparent.schema (+49/-0) assets/color-schemes/historic/Transparent_MC.schema (+51/-0) assets/color-schemes/historic/Transparent_darkbg.schema (+42/-0) assets/color-schemes/historic/Transparent_lightbg.schema (+51/-0) assets/color-schemes/historic/XTerm.schema (+46/-0) assets/color-schemes/historic/syscolor.schema (+44/-0) assets/color-schemes/historic/vim.schema (+40/-0) assets/kb-layouts/README (+72/-0) assets/kb-layouts/default.keytab (+169/-0) assets/kb-layouts/historic/vt100.keytab (+133/-0) assets/kb-layouts/historic/x11r5.keytab (+71/-0) assets/kb-layouts/linux.keytab (+164/-0) assets/kb-layouts/macbook.keytab (+175/-0) assets/kb-layouts/solaris.keytab (+108/-0) assets/kb-layouts/vt420pc.keytab (+168/-0) debian/changelog (+29/-0) debian/compat (+1/-0) debian/control (+40/-0) debian/copyright (+50/-0) debian/rules (+21/-0) debian/source/format (+1/-0) konsole-qml-plugin.pro (+97/-0) src/BlockArray.cpp (+377/-0) src/BlockArray.h (+126/-0) src/Character.h (+221/-0) src/CharacterColor.h (+294/-0) src/ColorScheme.cpp (+774/-0) src/ColorScheme.h (+342/-0) src/ColorTables.h (+55/-0) src/DefaultTranslatorText.h (+2/-0) src/Emulation.cpp (+458/-0) src/Emulation.h (+467/-0) src/ExtendedDefaultTranslator.h (+74/-0) src/Filter.cpp (+542/-0) src/Filter.h (+380/-0) src/History.cpp (+986/-0) src/History.h (+490/-0) src/KeyboardTranslator.cpp (+892/-0) src/KeyboardTranslator.h (+584/-0) src/LineFont.h (+21/-0) src/LineFont.src (+786/-0) src/Pty.cpp (+310/-0) src/Pty.h (+206/-0) src/Screen.cpp (+1360/-0) src/Screen.h (+672/-0) src/ScreenWindow.cpp (+292/-0) src/ScreenWindow.h (+257/-0) src/Session.cpp (+1064/-0) src/Session.h (+626/-0) src/ShellCommand.cpp (+167/-0) src/ShellCommand.h (+90/-0) src/TerminalCharacterDecoder.cpp (+251/-0) src/TerminalCharacterDecoder.h (+148/-0) src/TerminalDisplay.cpp (+2168/-0) src/TerminalDisplay.h (+715/-0) src/Vt102Emulation.cpp (+1221/-0) src/Vt102Emulation.h (+188/-0) src/default.keytab (+128/-0) src/konsole_wcwidth.cpp (+224/-0) src/konsole_wcwidth.h (+24/-0) src/kprocess.cpp (+412/-0) src/kprocess.h (+372/-0) src/kpty.cpp (+701/-0) src/kpty.h (+191/-0) src/kpty_p.h (+50/-0) src/kptydevice.cpp (+422/-0) src/kptydevice.h (+360/-0) src/kptyprocess.cpp (+129/-0) src/kptyprocess.h (+178/-0) src/ksession.cpp (+242/-0) src/ksession.h (+132/-0) src/plugin.cpp (+63/-0) src/plugin.h (+46/-0) src/plugins.qmltypes (+169/-0) src/qmldir (+3/-0) src/tools.cpp (+80/-0) src/tools.h (+10/-0) Conflict adding file .bzrignore. Moved existing file to .bzrignore.moved. Conflict adding file debian. Moved existing file to debian.moved. Conflict adding file src. Moved existing file to src.moved. |
To merge this branch: | bzr merge lp:~vthompson/ubuntu-terminal-app/testing-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Terminal Developers | Pending | ||
Review via email: mp+330470@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
- 14. By Victor Thompson
-
Initial fix for backspace and enter
- 13. By Dmitry Zagnoyko
-
Fixed text displaying bug (LP: #1182503). Fixes: https:/
/bugs.launchpad .net/bugs/ 1182503. Approved by Ubuntu Phone Apps Jenkins Bot, Michael Hall.
- 12. By Francis Ginther
-
Version bump.
Approved by Ubuntu Phone Apps Jenkins Bot, Michael Hall.
- 11. By Dmitry Zagnoyko
-
Added virtual key press events and fixed widget size properties. Fixes: https:/
/bugs.launchpad .net/bugs/ 1177155. Approved by Ubuntu Phone Apps Jenkins Bot, Michael Hall.
- 10. By Dmitry Zagnoyko
-
changed project structure.
Approved by Ubuntu Phone Apps Jenkins Bot, Michael Hall.
- 9. By Dmitry Zagnoyko
-
Fixed focus accept and VKB events
- 8. By Dmitry Zagnoyko
-
Added KSession signal for direct commands sending to terminal emu from qml
- 7. By Dmitry Zagnoyko
-
Added missing properties for KTerminal
- 6. By Dmitry Zagnoyko
-
Fixed issue with QtCreator
- 5. By Dmitry Zagnoyko
-
Object visibility scope fix: removed konsole namespace
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file '.bzrignore' | |||
2 | --- .bzrignore 1970-01-01 00:00:00 +0000 | |||
3 | +++ .bzrignore 2017-09-09 05:25:54 +0000 | |||
4 | @@ -0,0 +1,11 @@ | |||
5 | 1 | Makefile | ||
6 | 2 | src/*.so | ||
7 | 3 | *.pro.user | ||
8 | 4 | |||
9 | 5 | .moc/ | ||
10 | 6 | .obj/ | ||
11 | 7 | |||
12 | 8 | debian/files | ||
13 | 9 | debian/qtdeclarative5-konsole-qml-plugin/ | ||
14 | 10 | debian/*.debhelper.log | ||
15 | 11 | debian/*.substvars | ||
16 | 0 | \ No newline at end of file | 12 | \ No newline at end of file |
17 | 1 | 13 | ||
18 | === renamed file '.bzrignore' => '.bzrignore.moved' | |||
19 | === added file 'README' | |||
20 | --- README 1970-01-01 00:00:00 +0000 | |||
21 | +++ README 2017-09-09 05:25:54 +0000 | |||
22 | @@ -0,0 +1,11 @@ | |||
23 | 1 | this is a repository for shared C++ QML plugin, offering access to | ||
24 | 2 | terminal sessions. | ||
25 | 3 | |||
26 | 4 | if you want to add something, please ask the maintainer of this library first to | ||
27 | 5 | make sure it's a good fit | ||
28 | 6 | |||
29 | 7 | the current maintainer is: Dmitry Zagnoyko <hiroshidi@gmail.com> | ||
30 | 8 | |||
31 | 9 | current plugin consist: | ||
32 | 10 | - KTerminal: offers access to terminal session from qml | ||
33 | 11 | - KSessions: offers access to pty(s) from C++ layer | ||
34 | 0 | \ No newline at end of file | 12 | \ No newline at end of file |
35 | 1 | 13 | ||
36 | === added directory 'assets' | |||
37 | === added directory 'assets/color-schemes' | |||
38 | === added file 'assets/color-schemes/BlackOnLightYellow.schema' | |||
39 | --- assets/color-schemes/BlackOnLightYellow.schema 1970-01-01 00:00:00 +0000 | |||
40 | +++ assets/color-schemes/BlackOnLightYellow.schema 2017-09-09 05:25:54 +0000 | |||
41 | @@ -0,0 +1,42 @@ | |||
42 | 1 | # example scheme for konsole | ||
43 | 2 | |||
44 | 3 | # the title is to appear in the menu. | ||
45 | 4 | |||
46 | 5 | title Black on Light Yellow | ||
47 | 6 | |||
48 | 7 | # foreground colors | ||
49 | 8 | |||
50 | 9 | # note that the default background color is flagged | ||
51 | 10 | # to become transparent when an image is present. | ||
52 | 11 | |||
53 | 12 | # slot transparent bold | ||
54 | 13 | # | | | | ||
55 | 14 | # V V--color--V V V | ||
56 | 15 | |||
57 | 16 | color 0 0 0 0 0 0 # regular foreground color (Black) | ||
58 | 17 | color 1 255 255 221 1 0 # regular background color (Light Yellow) | ||
59 | 18 | |||
60 | 19 | color 2 0 0 0 0 0 # regular color 0 Black | ||
61 | 20 | color 3 178 24 24 0 0 # regular color 1 Red | ||
62 | 21 | color 4 24 178 24 0 0 # regular color 2 Green | ||
63 | 22 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
64 | 23 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
65 | 24 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
66 | 25 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
67 | 26 | color 9 178 178 178 0 0 # regular color 7 White | ||
68 | 27 | |||
69 | 28 | # intensive colors | ||
70 | 29 | |||
71 | 30 | # instead of changing the colors, we've flaged the text to become bold | ||
72 | 31 | |||
73 | 32 | color 10 0 0 0 0 1 # intensive foreground color | ||
74 | 33 | color 11 255 255 221 1 0 # intensive background color | ||
75 | 34 | |||
76 | 35 | color 12 104 104 104 0 0 # intensive color 0 | ||
77 | 36 | color 13 255 84 84 0 0 # intensive color 1 | ||
78 | 37 | color 14 84 255 84 0 0 # intensive color 2 | ||
79 | 38 | color 15 255 255 84 0 0 # intensive color 3 | ||
80 | 39 | color 16 84 84 255 0 0 # intensive color 4 | ||
81 | 40 | color 17 255 84 255 0 0 # intensive color 5 | ||
82 | 41 | color 18 84 255 255 0 0 # intensive color 6 | ||
83 | 42 | color 19 255 255 255 0 0 # intensive color 7 | ||
84 | 0 | 43 | ||
85 | === added file 'assets/color-schemes/BlackOnRandomLight.colorscheme' | |||
86 | --- assets/color-schemes/BlackOnRandomLight.colorscheme 1970-01-01 00:00:00 +0000 | |||
87 | +++ assets/color-schemes/BlackOnRandomLight.colorscheme 2017-09-09 05:25:54 +0000 | |||
88 | @@ -0,0 +1,104 @@ | |||
89 | 1 | [Background] | ||
90 | 2 | Bold=false | ||
91 | 3 | Color=247,247,214 | ||
92 | 4 | Transparency=true | ||
93 | 5 | MaxRandomHue=340 | ||
94 | 6 | |||
95 | 7 | [BackgroundIntense] | ||
96 | 8 | Bold=false | ||
97 | 9 | Color=255,255,221 | ||
98 | 10 | Transparency=true | ||
99 | 11 | |||
100 | 12 | [Color0] | ||
101 | 13 | Bold=false | ||
102 | 14 | Color=0,0,0 | ||
103 | 15 | Transparency=false | ||
104 | 16 | |||
105 | 17 | [Color0Intense] | ||
106 | 18 | Bold=false | ||
107 | 19 | Color=104,104,104 | ||
108 | 20 | Transparency=false | ||
109 | 21 | |||
110 | 22 | [Color1] | ||
111 | 23 | Bold=false | ||
112 | 24 | Color=178,24,24 | ||
113 | 25 | Transparency=false | ||
114 | 26 | |||
115 | 27 | [Color1Intense] | ||
116 | 28 | Bold=false | ||
117 | 29 | Color=255,84,84 | ||
118 | 30 | Transparency=false | ||
119 | 31 | |||
120 | 32 | [Color2] | ||
121 | 33 | Bold=false | ||
122 | 34 | Color=24,178,24 | ||
123 | 35 | Transparency=false | ||
124 | 36 | |||
125 | 37 | [Color2Intense] | ||
126 | 38 | Bold=false | ||
127 | 39 | Color=84,255,84 | ||
128 | 40 | Transparency=false | ||
129 | 41 | |||
130 | 42 | [Color3] | ||
131 | 43 | Bold=false | ||
132 | 44 | Color=178,104,24 | ||
133 | 45 | Transparency=false | ||
134 | 46 | |||
135 | 47 | [Color3Intense] | ||
136 | 48 | Bold=false | ||
137 | 49 | Color=255,255,84 | ||
138 | 50 | Transparency=false | ||
139 | 51 | |||
140 | 52 | [Color4] | ||
141 | 53 | Bold=false | ||
142 | 54 | Color=24,24,178 | ||
143 | 55 | Transparency=false | ||
144 | 56 | |||
145 | 57 | [Color4Intense] | ||
146 | 58 | Bold=false | ||
147 | 59 | Color=84,84,255 | ||
148 | 60 | Transparency=false | ||
149 | 61 | |||
150 | 62 | [Color5] | ||
151 | 63 | Bold=false | ||
152 | 64 | Color=178,24,178 | ||
153 | 65 | Transparency=false | ||
154 | 66 | |||
155 | 67 | [Color5Intense] | ||
156 | 68 | Bold=false | ||
157 | 69 | Color=255,84,255 | ||
158 | 70 | Transparency=false | ||
159 | 71 | |||
160 | 72 | [Color6] | ||
161 | 73 | Bold=false | ||
162 | 74 | Color=24,178,178 | ||
163 | 75 | Transparency=false | ||
164 | 76 | |||
165 | 77 | [Color6Intense] | ||
166 | 78 | Bold=false | ||
167 | 79 | Color=84,255,255 | ||
168 | 80 | Transparency=false | ||
169 | 81 | |||
170 | 82 | [Color7] | ||
171 | 83 | Bold=false | ||
172 | 84 | Color=178,178,178 | ||
173 | 85 | Transparency=false | ||
174 | 86 | |||
175 | 87 | [Color7Intense] | ||
176 | 88 | Bold=false | ||
177 | 89 | Color=255,255,255 | ||
178 | 90 | Transparency=false | ||
179 | 91 | |||
180 | 92 | [Foreground] | ||
181 | 93 | Bold=false | ||
182 | 94 | Color=0,0,0 | ||
183 | 95 | Transparency=false | ||
184 | 96 | |||
185 | 97 | [ForegroundIntense] | ||
186 | 98 | Bold=true | ||
187 | 99 | Color=0,0,0 | ||
188 | 100 | Transparency=false | ||
189 | 101 | |||
190 | 102 | [General] | ||
191 | 103 | Description=Black on Random Light | ||
192 | 104 | Opacity=1 | ||
193 | 0 | 105 | ||
194 | === added file 'assets/color-schemes/BlackOnWhite.schema' | |||
195 | --- assets/color-schemes/BlackOnWhite.schema 1970-01-01 00:00:00 +0000 | |||
196 | +++ assets/color-schemes/BlackOnWhite.schema 2017-09-09 05:25:54 +0000 | |||
197 | @@ -0,0 +1,42 @@ | |||
198 | 1 | # example scheme for konsole | ||
199 | 2 | |||
200 | 3 | # the title is to appear in the menu. | ||
201 | 4 | |||
202 | 5 | title Black on White | ||
203 | 6 | |||
204 | 7 | # foreground colors | ||
205 | 8 | |||
206 | 9 | # note that the default background color is flagged | ||
207 | 10 | # to become transparent when an image is present. | ||
208 | 11 | |||
209 | 12 | # slot transparent bold | ||
210 | 13 | # | | | | ||
211 | 14 | # V V--color--V V V | ||
212 | 15 | |||
213 | 16 | color 0 0 0 0 0 0 # regular foreground color (Black) | ||
214 | 17 | color 1 255 255 255 1 0 # regular background color (White) | ||
215 | 18 | |||
216 | 19 | color 2 0 0 0 0 0 # regular color 0 Black | ||
217 | 20 | color 3 178 24 24 0 0 # regular color 1 Red | ||
218 | 21 | color 4 24 178 24 0 0 # regular color 2 Green | ||
219 | 22 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
220 | 23 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
221 | 24 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
222 | 25 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
223 | 26 | color 9 178 178 178 0 0 # regular color 7 White | ||
224 | 27 | |||
225 | 28 | # intensive colors | ||
226 | 29 | |||
227 | 30 | # instead of changing the colors, we've flaged the text to become bold | ||
228 | 31 | |||
229 | 32 | color 10 0 0 0 0 1 # intensive foreground color | ||
230 | 33 | color 11 255 255 255 1 0 # intensive background color | ||
231 | 34 | |||
232 | 35 | color 12 104 104 104 0 0 # intensive color 0 | ||
233 | 36 | color 13 255 84 84 0 0 # intensive color 1 | ||
234 | 37 | color 14 84 255 84 0 0 # intensive color 2 | ||
235 | 38 | color 15 255 255 84 0 0 # intensive color 3 | ||
236 | 39 | color 16 84 84 255 0 0 # intensive color 4 | ||
237 | 40 | color 17 255 84 255 0 0 # intensive color 5 | ||
238 | 41 | color 18 84 255 255 0 0 # intensive color 6 | ||
239 | 42 | color 19 255 255 255 0 0 # intensive color 7 | ||
240 | 0 | 43 | ||
241 | === added file 'assets/color-schemes/DarkPastels.colorscheme' | |||
242 | --- assets/color-schemes/DarkPastels.colorscheme 1970-01-01 00:00:00 +0000 | |||
243 | +++ assets/color-schemes/DarkPastels.colorscheme 2017-09-09 05:25:54 +0000 | |||
244 | @@ -0,0 +1,103 @@ | |||
245 | 1 | [Background] | ||
246 | 2 | Bold=false | ||
247 | 3 | Color=44,44,44 | ||
248 | 4 | Transparency=false | ||
249 | 5 | |||
250 | 6 | [BackgroundIntense] | ||
251 | 7 | Bold=true | ||
252 | 8 | Color=44,44,44 | ||
253 | 9 | Transparency=false | ||
254 | 10 | |||
255 | 11 | [Color0] | ||
256 | 12 | Bold=false | ||
257 | 13 | Color=63,63,63 | ||
258 | 14 | Transparency=false | ||
259 | 15 | |||
260 | 16 | [Color0Intense] | ||
261 | 17 | Bold=true | ||
262 | 18 | Color=112,144,128 | ||
263 | 19 | Transparency=false | ||
264 | 20 | |||
265 | 21 | [Color1] | ||
266 | 22 | Bold=false | ||
267 | 23 | Color=112,80,80 | ||
268 | 24 | Transparency=false | ||
269 | 25 | |||
270 | 26 | [Color1Intense] | ||
271 | 27 | Bold=true | ||
272 | 28 | Color=220,163,163 | ||
273 | 29 | Transparency=false | ||
274 | 30 | |||
275 | 31 | [Color2] | ||
276 | 32 | Bold=false | ||
277 | 33 | Color=96,180,138 | ||
278 | 34 | Transparency=false | ||
279 | 35 | |||
280 | 36 | [Color2Intense] | ||
281 | 37 | Bold=true | ||
282 | 38 | Color=114,213,163 | ||
283 | 39 | Transparency=false | ||
284 | 40 | |||
285 | 41 | [Color3] | ||
286 | 42 | Bold=false | ||
287 | 43 | Color=223,175,143 | ||
288 | 44 | Transparency=false | ||
289 | 45 | |||
290 | 46 | [Color3Intense] | ||
291 | 47 | Bold=true | ||
292 | 48 | Color=240,223,175 | ||
293 | 49 | Transparency=false | ||
294 | 50 | |||
295 | 51 | [Color4] | ||
296 | 52 | Bold=false | ||
297 | 53 | Color=154,184,215 | ||
298 | 54 | Transparency=false | ||
299 | 55 | |||
300 | 56 | [Color4Intense] | ||
301 | 57 | Bold=true | ||
302 | 58 | Color=148,191,243 | ||
303 | 59 | Transparency=false | ||
304 | 60 | |||
305 | 61 | [Color5] | ||
306 | 62 | Bold=false | ||
307 | 63 | Color=220,140,195 | ||
308 | 64 | Transparency=false | ||
309 | 65 | |||
310 | 66 | [Color5Intense] | ||
311 | 67 | Bold=true | ||
312 | 68 | Color=236,147,211 | ||
313 | 69 | Transparency=false | ||
314 | 70 | |||
315 | 71 | [Color6] | ||
316 | 72 | Bold=false | ||
317 | 73 | Color=140,208,211 | ||
318 | 74 | Transparency=false | ||
319 | 75 | |||
320 | 76 | [Color6Intense] | ||
321 | 77 | Bold=true | ||
322 | 78 | Color=147,224,227 | ||
323 | 79 | Transparency=false | ||
324 | 80 | |||
325 | 81 | [Color7] | ||
326 | 82 | Bold=false | ||
327 | 83 | Color=220,220,204 | ||
328 | 84 | Transparency=false | ||
329 | 85 | |||
330 | 86 | [Color7Intense] | ||
331 | 87 | Bold=true | ||
332 | 88 | Color=255,255,255 | ||
333 | 89 | Transparency=false | ||
334 | 90 | |||
335 | 91 | [Foreground] | ||
336 | 92 | Bold=false | ||
337 | 93 | Color=220,220,204 | ||
338 | 94 | Transparency=false | ||
339 | 95 | |||
340 | 96 | [ForegroundIntense] | ||
341 | 97 | Bold=true | ||
342 | 98 | Color=220,220,204 | ||
343 | 99 | Transparency=false | ||
344 | 100 | |||
345 | 101 | [General] | ||
346 | 102 | Description=Dark Pastels | ||
347 | 103 | Opacity=1 | ||
348 | 0 | 104 | ||
349 | === added file 'assets/color-schemes/GreenOnBlack.colorscheme' | |||
350 | --- assets/color-schemes/GreenOnBlack.colorscheme 1970-01-01 00:00:00 +0000 | |||
351 | +++ assets/color-schemes/GreenOnBlack.colorscheme 2017-09-09 05:25:54 +0000 | |||
352 | @@ -0,0 +1,104 @@ | |||
353 | 1 | |||
354 | 2 | [Background] | ||
355 | 3 | Bold=false | ||
356 | 4 | Color=0,0,0 | ||
357 | 5 | Transparency=false | ||
358 | 6 | |||
359 | 7 | [BackgroundIntense] | ||
360 | 8 | Bold=false | ||
361 | 9 | Color=0,0,0 | ||
362 | 10 | Transparency=false | ||
363 | 11 | |||
364 | 12 | [Color0] | ||
365 | 13 | Bold=false | ||
366 | 14 | Color=0,0,0 | ||
367 | 15 | Transparency=false | ||
368 | 16 | |||
369 | 17 | [Color0Intense] | ||
370 | 18 | Bold=false | ||
371 | 19 | Color=104,104,104 | ||
372 | 20 | Transparency=false | ||
373 | 21 | |||
374 | 22 | [Color1] | ||
375 | 23 | Bold=false | ||
376 | 24 | Color=250,75,75 | ||
377 | 25 | Transparency=false | ||
378 | 26 | |||
379 | 27 | [Color1Intense] | ||
380 | 28 | Bold=false | ||
381 | 29 | Color=255,84,84 | ||
382 | 30 | Transparency=false | ||
383 | 31 | |||
384 | 32 | [Color2] | ||
385 | 33 | Bold=false | ||
386 | 34 | Color=24,178,24 | ||
387 | 35 | Transparency=false | ||
388 | 36 | |||
389 | 37 | [Color2Intense] | ||
390 | 38 | Bold=false | ||
391 | 39 | Color=84,255,84 | ||
392 | 40 | Transparency=false | ||
393 | 41 | |||
394 | 42 | [Color3] | ||
395 | 43 | Bold=false | ||
396 | 44 | Color=178,104,24 | ||
397 | 45 | Transparency=false | ||
398 | 46 | |||
399 | 47 | [Color3Intense] | ||
400 | 48 | Bold=false | ||
401 | 49 | Color=255,255,84 | ||
402 | 50 | Transparency=false | ||
403 | 51 | |||
404 | 52 | [Color4] | ||
405 | 53 | Bold=false | ||
406 | 54 | Color=92,167,251 | ||
407 | 55 | Transparency=false | ||
408 | 56 | |||
409 | 57 | [Color4Intense] | ||
410 | 58 | Bold=false | ||
411 | 59 | Color=84,84,255 | ||
412 | 60 | Transparency=false | ||
413 | 61 | |||
414 | 62 | [Color5] | ||
415 | 63 | Bold=false | ||
416 | 64 | Color=225,30,225 | ||
417 | 65 | Transparency=false | ||
418 | 66 | |||
419 | 67 | [Color5Intense] | ||
420 | 68 | Bold=false | ||
421 | 69 | Color=255,84,255 | ||
422 | 70 | Transparency=false | ||
423 | 71 | |||
424 | 72 | [Color6] | ||
425 | 73 | Bold=false | ||
426 | 74 | Color=24,178,178 | ||
427 | 75 | Transparency=false | ||
428 | 76 | |||
429 | 77 | [Color6Intense] | ||
430 | 78 | Bold=false | ||
431 | 79 | Color=84,255,255 | ||
432 | 80 | Transparency=false | ||
433 | 81 | |||
434 | 82 | [Color7] | ||
435 | 83 | Bold=false | ||
436 | 84 | Color=178,178,178 | ||
437 | 85 | Transparency=false | ||
438 | 86 | |||
439 | 87 | [Color7Intense] | ||
440 | 88 | Bold=false | ||
441 | 89 | Color=255,255,255 | ||
442 | 90 | Transparency=false | ||
443 | 91 | |||
444 | 92 | [Foreground] | ||
445 | 93 | Bold=false | ||
446 | 94 | Color=24,240,24 | ||
447 | 95 | Transparency=false | ||
448 | 96 | |||
449 | 97 | [ForegroundIntense] | ||
450 | 98 | Bold=true | ||
451 | 99 | Color=24,240,24 | ||
452 | 100 | Transparency=false | ||
453 | 101 | |||
454 | 102 | [General] | ||
455 | 103 | Description=Green on Black | ||
456 | 104 | Opacity=1 | ||
457 | 0 | 105 | ||
458 | === added file 'assets/color-schemes/Linux.colorscheme' | |||
459 | --- assets/color-schemes/Linux.colorscheme 1970-01-01 00:00:00 +0000 | |||
460 | +++ assets/color-schemes/Linux.colorscheme 2017-09-09 05:25:54 +0000 | |||
461 | @@ -0,0 +1,100 @@ | |||
462 | 1 | [Background] | ||
463 | 2 | Bold=false | ||
464 | 3 | Color=0,0,0 | ||
465 | 4 | |||
466 | 5 | [BackgroundIntense] | ||
467 | 6 | Bold=false | ||
468 | 7 | Color=104,104,104 | ||
469 | 8 | |||
470 | 9 | [Color0] | ||
471 | 10 | Bold=false | ||
472 | 11 | Color=0,0,0 | ||
473 | 12 | |||
474 | 13 | |||
475 | 14 | [Color0Intense] | ||
476 | 15 | Bold=false | ||
477 | 16 | Color=104,104,104 | ||
478 | 17 | |||
479 | 18 | |||
480 | 19 | [Color1] | ||
481 | 20 | Bold=false | ||
482 | 21 | Color=178,24,24 | ||
483 | 22 | |||
484 | 23 | |||
485 | 24 | [Color1Intense] | ||
486 | 25 | Bold=false | ||
487 | 26 | Color=255,84,84 | ||
488 | 27 | |||
489 | 28 | |||
490 | 29 | [Color2] | ||
491 | 30 | Bold=false | ||
492 | 31 | Color=24,178,24 | ||
493 | 32 | |||
494 | 33 | |||
495 | 34 | [Color2Intense] | ||
496 | 35 | Bold=false | ||
497 | 36 | Color=84,255,84 | ||
498 | 37 | |||
499 | 38 | |||
500 | 39 | [Color3] | ||
501 | 40 | Bold=false | ||
502 | 41 | Color=178,104,24 | ||
503 | 42 | |||
504 | 43 | |||
505 | 44 | [Color3Intense] | ||
506 | 45 | Bold=false | ||
507 | 46 | Color=255,255,84 | ||
508 | 47 | |||
509 | 48 | |||
510 | 49 | [Color4] | ||
511 | 50 | Bold=false | ||
512 | 51 | Color=24,24,178 | ||
513 | 52 | |||
514 | 53 | |||
515 | 54 | [Color4Intense] | ||
516 | 55 | Bold=false | ||
517 | 56 | Color=84,84,255 | ||
518 | 57 | |||
519 | 58 | |||
520 | 59 | [Color5] | ||
521 | 60 | Bold=false | ||
522 | 61 | Color=178,24,178 | ||
523 | 62 | |||
524 | 63 | |||
525 | 64 | [Color5Intense] | ||
526 | 65 | Bold=false | ||
527 | 66 | Color=255,84,255 | ||
528 | 67 | |||
529 | 68 | |||
530 | 69 | [Color6] | ||
531 | 70 | Bold=false | ||
532 | 71 | Color=24,178,178 | ||
533 | 72 | |||
534 | 73 | |||
535 | 74 | [Color6Intense] | ||
536 | 75 | Bold=false | ||
537 | 76 | Color=84,255,255 | ||
538 | 77 | |||
539 | 78 | |||
540 | 79 | [Color7] | ||
541 | 80 | Bold=false | ||
542 | 81 | Color=178,178,178 | ||
543 | 82 | |||
544 | 83 | |||
545 | 84 | [Color7Intense] | ||
546 | 85 | Bold=false | ||
547 | 86 | Color=255,255,255 | ||
548 | 87 | |||
549 | 88 | |||
550 | 89 | [Foreground] | ||
551 | 90 | Bold=false | ||
552 | 91 | Color=178,178,178 | ||
553 | 92 | |||
554 | 93 | |||
555 | 94 | [ForegroundIntense] | ||
556 | 95 | Bold=false | ||
557 | 96 | Color=255,255,255 | ||
558 | 97 | |||
559 | 98 | |||
560 | 99 | [General] | ||
561 | 100 | Description=Linux Colors | ||
562 | 0 | 101 | ||
563 | === added file 'assets/color-schemes/WhiteOnBlack.schema' | |||
564 | --- assets/color-schemes/WhiteOnBlack.schema 1970-01-01 00:00:00 +0000 | |||
565 | +++ assets/color-schemes/WhiteOnBlack.schema 2017-09-09 05:25:54 +0000 | |||
566 | @@ -0,0 +1,42 @@ | |||
567 | 1 | # example scheme for konsole | ||
568 | 2 | |||
569 | 3 | # the title is to appear in the menu. | ||
570 | 4 | |||
571 | 5 | title White on Black | ||
572 | 6 | |||
573 | 7 | # foreground colors | ||
574 | 8 | |||
575 | 9 | # note that the default background color is flagged | ||
576 | 10 | # to become transparent when an image is present. | ||
577 | 11 | |||
578 | 12 | # slot transparent bold | ||
579 | 13 | # | | | | ||
580 | 14 | # V V--color--V V V | ||
581 | 15 | |||
582 | 16 | color 0 255 255 255 0 0 # regular foreground color (White) | ||
583 | 17 | color 1 0 0 0 1 0 # regular background color (Black) | ||
584 | 18 | |||
585 | 19 | color 2 0 0 0 0 0 # regular color 0 Black | ||
586 | 20 | color 3 178 24 24 0 0 # regular color 1 Red | ||
587 | 21 | color 4 24 178 24 0 0 # regular color 2 Green | ||
588 | 22 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
589 | 23 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
590 | 24 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
591 | 25 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
592 | 26 | color 9 178 178 178 0 0 # regular color 7 White | ||
593 | 27 | |||
594 | 28 | # intensive colors | ||
595 | 29 | |||
596 | 30 | # instead of changing the colors, we've flaged the text to become bold | ||
597 | 31 | |||
598 | 32 | color 10 255 255 255 0 1 # intensive foreground color | ||
599 | 33 | color 11 0 0 0 1 0 # intensive background color | ||
600 | 34 | |||
601 | 35 | color 12 104 104 104 0 0 # intensive color 0 | ||
602 | 36 | color 13 255 84 84 0 0 # intensive color 1 | ||
603 | 37 | color 14 84 255 84 0 0 # intensive color 2 | ||
604 | 38 | color 15 255 255 84 0 0 # intensive color 3 | ||
605 | 39 | color 16 84 84 255 0 0 # intensive color 4 | ||
606 | 40 | color 17 255 84 255 0 0 # intensive color 5 | ||
607 | 41 | color 18 84 255 255 0 0 # intensive color 6 | ||
608 | 42 | color 19 255 255 255 0 0 # intensive color 7 | ||
609 | 0 | 43 | ||
610 | === added directory 'assets/color-schemes/historic' | |||
611 | === added file 'assets/color-schemes/historic/BlackOnLightColor.schema' | |||
612 | --- assets/color-schemes/historic/BlackOnLightColor.schema 1970-01-01 00:00:00 +0000 | |||
613 | +++ assets/color-schemes/historic/BlackOnLightColor.schema 2017-09-09 05:25:54 +0000 | |||
614 | @@ -0,0 +1,42 @@ | |||
615 | 1 | # example scheme for konsole | ||
616 | 2 | |||
617 | 3 | # the title is to appear in the menu. | ||
618 | 4 | |||
619 | 5 | title Black on Light Color | ||
620 | 6 | |||
621 | 7 | # foreground colors | ||
622 | 8 | |||
623 | 9 | # note that the default background color is flagged | ||
624 | 10 | # to become transparent when an image is present. | ||
625 | 11 | |||
626 | 12 | # slot transparent bold | ||
627 | 13 | # | | | | ||
628 | 14 | # V V--color--V V V | ||
629 | 15 | |||
630 | 16 | color 0 0 0 0 0 0 # regular foreground color (Black) | ||
631 | 17 | rcolor 1 30 255 1 0 # regular background color (Light Color) | ||
632 | 18 | |||
633 | 19 | color 2 0 0 0 0 0 # regular color 0 Black | ||
634 | 20 | color 3 178 24 24 0 0 # regular color 1 Red | ||
635 | 21 | color 4 24 178 24 0 0 # regular color 2 Green | ||
636 | 22 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
637 | 23 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
638 | 24 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
639 | 25 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
640 | 26 | color 9 178 178 178 0 0 # regular color 7 White | ||
641 | 27 | |||
642 | 28 | # intensive colors | ||
643 | 29 | |||
644 | 30 | # instead of changing the colors, we've flaged the text to become bold | ||
645 | 31 | |||
646 | 32 | color 10 0 0 0 0 1 # intensive foreground color | ||
647 | 33 | color 11 255 255 221 1 0 # intensive background color | ||
648 | 34 | |||
649 | 35 | color 12 104 104 104 0 0 # intensive color 0 | ||
650 | 36 | color 13 255 84 84 0 0 # intensive color 1 | ||
651 | 37 | color 14 84 255 84 0 0 # intensive color 2 | ||
652 | 38 | color 15 255 255 84 0 0 # intensive color 3 | ||
653 | 39 | color 16 84 84 255 0 0 # intensive color 4 | ||
654 | 40 | color 17 255 84 255 0 0 # intensive color 5 | ||
655 | 41 | color 18 84 255 255 0 0 # intensive color 6 | ||
656 | 42 | color 19 255 255 255 0 0 # intensive color 7 | ||
657 | 0 | 43 | ||
658 | === added file 'assets/color-schemes/historic/DarkPicture.schema' | |||
659 | --- assets/color-schemes/historic/DarkPicture.schema 1970-01-01 00:00:00 +0000 | |||
660 | +++ assets/color-schemes/historic/DarkPicture.schema 2017-09-09 05:25:54 +0000 | |||
661 | @@ -0,0 +1,44 @@ | |||
662 | 1 | # example scheme for konsole | ||
663 | 2 | |||
664 | 3 | # the title is to appear in the menu. | ||
665 | 4 | |||
666 | 5 | title Marble | ||
667 | 6 | |||
668 | 7 | image tile Blkmarble.jpg | ||
669 | 8 | |||
670 | 9 | # foreground colors | ||
671 | 10 | |||
672 | 11 | # note that the default background color is flagged | ||
673 | 12 | # to become transparent when an image is present. | ||
674 | 13 | |||
675 | 14 | # slot transparent bold | ||
676 | 15 | # | | | | ||
677 | 16 | # V V--color--V V V | ||
678 | 17 | |||
679 | 18 | color 0 255 255 255 0 0 # regular foreground color (White) | ||
680 | 19 | color 1 0 0 0 1 0 # regular background color (Black) | ||
681 | 20 | |||
682 | 21 | color 2 0 0 0 0 0 # regular color 0 Black | ||
683 | 22 | color 3 178 24 24 0 0 # regular color 1 Red | ||
684 | 23 | color 4 24 178 24 0 0 # regular color 2 Green | ||
685 | 24 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
686 | 25 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
687 | 26 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
688 | 27 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
689 | 28 | color 9 178 178 178 0 0 # regular color 7 White | ||
690 | 29 | |||
691 | 30 | # intensive colors | ||
692 | 31 | |||
693 | 32 | # instead of changing the colors, we've flaged the text to become bold | ||
694 | 33 | |||
695 | 34 | color 10 255 255 255 0 1 # intensive foreground color | ||
696 | 35 | color 11 0 0 0 1 0 # intensive background color | ||
697 | 36 | |||
698 | 37 | color 12 104 104 104 0 0 # intensive color 0 | ||
699 | 38 | color 13 255 84 84 0 0 # intensive color 1 | ||
700 | 39 | color 14 84 255 84 0 0 # intensive color 2 | ||
701 | 40 | color 15 255 255 84 0 0 # intensive color 3 | ||
702 | 41 | color 16 84 84 255 0 0 # intensive color 4 | ||
703 | 42 | color 17 255 84 255 0 0 # intensive color 5 | ||
704 | 43 | color 18 84 255 255 0 0 # intensive color 6 | ||
705 | 44 | color 19 255 255 255 0 0 # intensive color 7 | ||
706 | 0 | 45 | ||
707 | === added file 'assets/color-schemes/historic/Example.Schema' | |||
708 | --- assets/color-schemes/historic/Example.Schema 1970-01-01 00:00:00 +0000 | |||
709 | +++ assets/color-schemes/historic/Example.Schema 2017-09-09 05:25:54 +0000 | |||
710 | @@ -0,0 +1,47 @@ | |||
711 | 1 | # example scheme for konsole | ||
712 | 2 | |||
713 | 3 | # the title is to appear in the menu. | ||
714 | 4 | |||
715 | 5 | title Ugly 1 | ||
716 | 6 | |||
717 | 7 | # add a wallpaper, if you like. Second word one of { tile,center,full } | ||
718 | 8 | |||
719 | 9 | image tile /opt/kde/share/wallpapers/dancy_pants.jpg | ||
720 | 10 | |||
721 | 11 | |||
722 | 12 | # foreground colors | ||
723 | 13 | |||
724 | 14 | # note that the default background color is flagged | ||
725 | 15 | # to become transparent when an image is present. | ||
726 | 16 | |||
727 | 17 | # slot transparent bold | ||
728 | 18 | # | | | | ||
729 | 19 | # V V--color--V V V | ||
730 | 20 | |||
731 | 21 | color 0 0 0 0 0 0 # regular foreground color (Black) | ||
732 | 22 | color 1 255 255 255 1 0 # regular background color (White) | ||
733 | 23 | |||
734 | 24 | color 2 0 0 0 0 0 # regular color 0 Black | ||
735 | 25 | color 3 255 0 0 0 0 # regular color 1 Red | ||
736 | 26 | color 4 0 255 0 0 0 # regular color 2 Green | ||
737 | 27 | color 5 255 255 0 0 0 # regular color 3 Yellow | ||
738 | 28 | color 6 0 0 255 0 0 # regular color 4 Blue | ||
739 | 29 | color 7 255 0 255 0 0 # regular color 5 Magenta | ||
740 | 30 | color 8 0 255 255 0 0 # regular color 6 Cyan | ||
741 | 31 | color 9 255 255 255 0 0 # regular color 7 White | ||
742 | 32 | |||
743 | 33 | # intensive colors | ||
744 | 34 | |||
745 | 35 | # instead of changing the colors, we've flaged the text to become bold | ||
746 | 36 | |||
747 | 37 | color 10 0 0 0 0 1 # intensive foreground color | ||
748 | 38 | color 11 255 255 255 1 1 # intensive background color | ||
749 | 39 | |||
750 | 40 | color 12 0 0 0 0 1 # intensive color 0 | ||
751 | 41 | color 13 255 0 0 0 1 # intensive color 1 | ||
752 | 42 | color 14 0 255 0 0 1 # intensive color 2 | ||
753 | 43 | color 15 255 255 0 0 1 # intensive color 3 | ||
754 | 44 | color 16 0 0 255 0 1 # intensive color 4 | ||
755 | 45 | color 17 255 0 255 0 1 # intensive color 5 | ||
756 | 46 | color 18 0 255 255 0 1 # intensive color 6 | ||
757 | 47 | color 19 255 255 255 0 1 # intensive color 7 | ||
758 | 0 | 48 | ||
759 | === added file 'assets/color-schemes/historic/GreenOnBlack.schema' | |||
760 | --- assets/color-schemes/historic/GreenOnBlack.schema 1970-01-01 00:00:00 +0000 | |||
761 | +++ assets/color-schemes/historic/GreenOnBlack.schema 2017-09-09 05:25:54 +0000 | |||
762 | @@ -0,0 +1,42 @@ | |||
763 | 1 | # example scheme for konsole | ||
764 | 2 | |||
765 | 3 | # the title is to appear in the menu. | ||
766 | 4 | |||
767 | 5 | title Green on Black | ||
768 | 6 | |||
769 | 7 | # foreground colors | ||
770 | 8 | |||
771 | 9 | # note that the default background color is flagged | ||
772 | 10 | # to become transparent when an image is present. | ||
773 | 11 | |||
774 | 12 | # slot transparent bold | ||
775 | 13 | # | | | | ||
776 | 14 | # V V--color--V V V | ||
777 | 15 | |||
778 | 16 | color 0 24 240 24 0 0 # regular foreground color (Green) | ||
779 | 17 | color 1 0 0 0 1 0 # regular background color (Black) | ||
780 | 18 | |||
781 | 19 | color 2 0 0 0 0 0 # regular color 0 Black | ||
782 | 20 | color 3 178 24 24 0 0 # regular color 1 Red | ||
783 | 21 | color 4 24 178 24 0 0 # regular color 2 Green | ||
784 | 22 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
785 | 23 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
786 | 24 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
787 | 25 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
788 | 26 | color 9 178 178 178 0 0 # regular color 7 White | ||
789 | 27 | |||
790 | 28 | # intensive colors | ||
791 | 29 | |||
792 | 30 | # instead of changing the colors, we've flaged the text to become bold | ||
793 | 31 | |||
794 | 32 | color 10 24 240 24 0 1 # intensive foreground color | ||
795 | 33 | color 11 0 0 0 1 0 # intensive background color | ||
796 | 34 | |||
797 | 35 | color 12 104 104 104 0 0 # intensive color 0 | ||
798 | 36 | color 13 255 84 84 0 0 # intensive color 1 | ||
799 | 37 | color 14 84 255 84 0 0 # intensive color 2 | ||
800 | 38 | color 15 255 255 84 0 0 # intensive color 3 | ||
801 | 39 | color 16 84 84 255 0 0 # intensive color 4 | ||
802 | 40 | color 17 255 84 255 0 0 # intensive color 5 | ||
803 | 41 | color 18 84 255 255 0 0 # intensive color 6 | ||
804 | 42 | color 19 255 255 255 0 0 # intensive color 7 | ||
805 | 0 | 43 | ||
806 | === added file 'assets/color-schemes/historic/GreenTint.schema' | |||
807 | --- assets/color-schemes/historic/GreenTint.schema 1970-01-01 00:00:00 +0000 | |||
808 | +++ assets/color-schemes/historic/GreenTint.schema 2017-09-09 05:25:54 +0000 | |||
809 | @@ -0,0 +1,49 @@ | |||
810 | 1 | # linux color schema for konsole | ||
811 | 2 | |||
812 | 3 | title Green Tint | ||
813 | 4 | |||
814 | 5 | transparency 0.3 0 150 0 | ||
815 | 6 | |||
816 | 7 | # FIXME | ||
817 | 8 | # | ||
818 | 9 | # The flaw in this schema is that "blick" comes out on the | ||
819 | 10 | # Linux console as intensive background, really. | ||
820 | 11 | # Since this is not used in clients you'll hardly notice | ||
821 | 12 | # it in practice. | ||
822 | 13 | |||
823 | 14 | # foreground colors | ||
824 | 15 | |||
825 | 16 | # note that the default background color is flagged | ||
826 | 17 | # to become transparent when an image is present. | ||
827 | 18 | |||
828 | 19 | # slot transparent bold | ||
829 | 20 | # | red grn blu | | | ||
830 | 21 | # V V--color--V V V | ||
831 | 22 | |||
832 | 23 | color 0 178 178 178 0 0 # regular foreground color (White) | ||
833 | 24 | color 1 0 0 0 1 0 # regular background color (Black) | ||
834 | 25 | |||
835 | 26 | color 2 0 0 0 0 0 # regular color 0 Black | ||
836 | 27 | color 3 178 24 24 0 0 # regular color 1 Red | ||
837 | 28 | color 4 24 178 24 0 0 # regular color 2 Green | ||
838 | 29 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
839 | 30 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
840 | 31 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
841 | 32 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
842 | 33 | color 9 178 178 178 0 0 # regular color 7 White | ||
843 | 34 | |||
844 | 35 | # intensive colors | ||
845 | 36 | |||
846 | 37 | # instead of changing the colors, we've flaged the text to become bold | ||
847 | 38 | |||
848 | 39 | color 10 255 255 255 0 0 # intensive foreground color | ||
849 | 40 | color 11 104 104 104 1 0 # intensive background color | ||
850 | 41 | |||
851 | 42 | color 12 104 104 104 0 0 # intensive color 0 | ||
852 | 43 | color 13 255 84 84 0 0 # intensive color 1 | ||
853 | 44 | color 14 84 255 84 0 0 # intensive color 2 | ||
854 | 45 | color 15 255 255 84 0 0 # intensive color 3 | ||
855 | 46 | color 16 84 84 255 0 0 # intensive color 4 | ||
856 | 47 | color 17 255 84 255 0 0 # intensive color 5 | ||
857 | 48 | color 18 84 255 255 0 0 # intensive color 6 | ||
858 | 49 | color 19 255 255 255 0 0 # intensive color 7 | ||
859 | 0 | 50 | ||
860 | === added file 'assets/color-schemes/historic/GreenTint_MC.schema' | |||
861 | --- assets/color-schemes/historic/GreenTint_MC.schema 1970-01-01 00:00:00 +0000 | |||
862 | +++ assets/color-schemes/historic/GreenTint_MC.schema 2017-09-09 05:25:54 +0000 | |||
863 | @@ -0,0 +1,49 @@ | |||
864 | 1 | # linux color schema for konsole | ||
865 | 2 | |||
866 | 3 | title Green Tint with Transparent MC | ||
867 | 4 | |||
868 | 5 | transparency 0.3 0 150 0 | ||
869 | 6 | |||
870 | 7 | # FIXME | ||
871 | 8 | # | ||
872 | 9 | # The flaw in this schema is that "blick" comes out on the | ||
873 | 10 | # Linux console as intensive background, really. | ||
874 | 11 | # Since this is not used in clients you'll hardly notice | ||
875 | 12 | # it in practice. | ||
876 | 13 | |||
877 | 14 | # foreground colors | ||
878 | 15 | |||
879 | 16 | # note that the default background color is flagged | ||
880 | 17 | # to become transparent when an image is present. | ||
881 | 18 | |||
882 | 19 | # slot transparent bold | ||
883 | 20 | # | red grn blu | | | ||
884 | 21 | # V V--color--V V V | ||
885 | 22 | |||
886 | 23 | color 0 178 178 178 0 0 # regular foreground color (White) | ||
887 | 24 | color 1 0 0 0 1 0 # regular background color (Black) | ||
888 | 25 | |||
889 | 26 | color 2 0 0 0 0 0 # regular color 0 Black | ||
890 | 27 | color 3 178 24 24 0 0 # regular color 1 Red | ||
891 | 28 | color 4 24 178 24 0 0 # regular color 2 Green | ||
892 | 29 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
893 | 30 | color 6 0 0 0 1 0 # regular color 4 Blue | ||
894 | 31 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
895 | 32 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
896 | 33 | color 9 178 178 178 0 0 # regular color 7 White | ||
897 | 34 | |||
898 | 35 | # intensive colors | ||
899 | 36 | |||
900 | 37 | # instead of changing the colors, we've flaged the text to become bold | ||
901 | 38 | |||
902 | 39 | color 10 255 255 255 0 0 # intensive foreground color | ||
903 | 40 | color 11 104 104 104 1 0 # intensive background color | ||
904 | 41 | |||
905 | 42 | color 12 104 104 104 0 0 # intensive color 0 | ||
906 | 43 | color 13 255 84 84 0 0 # intensive color 1 | ||
907 | 44 | color 14 84 255 84 0 0 # intensive color 2 | ||
908 | 45 | color 15 255 255 84 0 0 # intensive color 3 | ||
909 | 46 | color 16 84 84 255 0 0 # intensive color 4 | ||
910 | 47 | color 17 255 84 255 0 0 # intensive color 5 | ||
911 | 48 | color 18 84 255 255 0 0 # intensive color 6 | ||
912 | 49 | color 19 255 255 255 0 0 # intensive color 7 | ||
913 | 0 | 50 | ||
914 | === added file 'assets/color-schemes/historic/LightPicture.schema' | |||
915 | --- assets/color-schemes/historic/LightPicture.schema 1970-01-01 00:00:00 +0000 | |||
916 | +++ assets/color-schemes/historic/LightPicture.schema 2017-09-09 05:25:54 +0000 | |||
917 | @@ -0,0 +1,44 @@ | |||
918 | 1 | # example scheme for konsole | ||
919 | 2 | |||
920 | 3 | # the title is to appear in the menu. | ||
921 | 4 | |||
922 | 5 | title Paper | ||
923 | 6 | |||
924 | 7 | image tile Paper01.jpg | ||
925 | 8 | |||
926 | 9 | # foreground colors | ||
927 | 10 | |||
928 | 11 | # note that the default background color is flagged | ||
929 | 12 | # to become transparent when an image is present. | ||
930 | 13 | |||
931 | 14 | # slot transparent bold | ||
932 | 15 | # | | | | ||
933 | 16 | # V V--color--V V V | ||
934 | 17 | |||
935 | 18 | color 0 0 0 0 0 0 # regular foreground color (Black) | ||
936 | 19 | color 1 255 255 255 1 0 # regular background color (White) | ||
937 | 20 | |||
938 | 21 | color 2 0 0 0 0 0 # regular color 0 Black | ||
939 | 22 | color 3 178 24 24 0 0 # regular color 1 Red | ||
940 | 23 | color 4 24 178 24 0 0 # regular color 2 Green | ||
941 | 24 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
942 | 25 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
943 | 26 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
944 | 27 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
945 | 28 | color 9 178 178 178 0 0 # regular color 7 White | ||
946 | 29 | |||
947 | 30 | # intensive colors | ||
948 | 31 | |||
949 | 32 | # instead of changing the colors, we've flaged the text to become bold | ||
950 | 33 | |||
951 | 34 | color 10 0 0 0 0 1 # intensive foreground color | ||
952 | 35 | color 11 255 255 255 1 0 # intensive background color | ||
953 | 36 | |||
954 | 37 | color 12 104 104 104 0 0 # intensive color 0 | ||
955 | 38 | color 13 255 84 84 0 0 # intensive color 1 | ||
956 | 39 | color 14 84 255 84 0 0 # intensive color 2 | ||
957 | 40 | color 15 255 255 84 0 0 # intensive color 3 | ||
958 | 41 | color 16 84 84 255 0 0 # intensive color 4 | ||
959 | 42 | color 17 255 84 255 0 0 # intensive color 5 | ||
960 | 43 | color 18 84 255 255 0 0 # intensive color 6 | ||
961 | 44 | color 19 255 255 255 0 0 # intensive color 7 | ||
962 | 0 | 45 | ||
963 | === added file 'assets/color-schemes/historic/Linux.schema' | |||
964 | --- assets/color-schemes/historic/Linux.schema 1970-01-01 00:00:00 +0000 | |||
965 | +++ assets/color-schemes/historic/Linux.schema 2017-09-09 05:25:54 +0000 | |||
966 | @@ -0,0 +1,47 @@ | |||
967 | 1 | # linux color schema for konsole | ||
968 | 2 | |||
969 | 3 | title Linux Colors | ||
970 | 4 | |||
971 | 5 | # FIXME | ||
972 | 6 | # | ||
973 | 7 | # The flaw in this schema is that "blick" comes out on the | ||
974 | 8 | # Linux console as intensive background, really. | ||
975 | 9 | # Since this is not used in clients you'll hardly notice | ||
976 | 10 | # it in practice. | ||
977 | 11 | |||
978 | 12 | # foreground colors | ||
979 | 13 | |||
980 | 14 | # note that the default background color is flagged | ||
981 | 15 | # to become transparent when an image is present. | ||
982 | 16 | |||
983 | 17 | # slot transparent bold | ||
984 | 18 | # | red grn blu | | | ||
985 | 19 | # V V--color--V V V | ||
986 | 20 | |||
987 | 21 | color 0 178 178 178 0 0 # regular foreground color (White) | ||
988 | 22 | color 1 0 0 0 1 0 # regular background color (Black) | ||
989 | 23 | |||
990 | 24 | color 2 0 0 0 0 0 # regular color 0 Black | ||
991 | 25 | color 3 178 24 24 0 0 # regular color 1 Red | ||
992 | 26 | color 4 24 178 24 0 0 # regular color 2 Green | ||
993 | 27 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
994 | 28 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
995 | 29 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
996 | 30 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
997 | 31 | color 9 178 178 178 0 0 # regular color 7 White | ||
998 | 32 | |||
999 | 33 | # intensive colors | ||
1000 | 34 | |||
1001 | 35 | # instead of changing the colors, we've flaged the text to become bold | ||
1002 | 36 | |||
1003 | 37 | color 10 255 255 255 0 0 # intensive foreground color | ||
1004 | 38 | color 11 104 104 104 1 0 # intensive background color | ||
1005 | 39 | |||
1006 | 40 | color 12 104 104 104 0 0 # intensive color 0 | ||
1007 | 41 | color 13 255 84 84 0 0 # intensive color 1 | ||
1008 | 42 | color 14 84 255 84 0 0 # intensive color 2 | ||
1009 | 43 | color 15 255 255 84 0 0 # intensive color 3 | ||
1010 | 44 | color 16 84 84 255 0 0 # intensive color 4 | ||
1011 | 45 | color 17 255 84 255 0 0 # intensive color 5 | ||
1012 | 46 | color 18 84 255 255 0 0 # intensive color 6 | ||
1013 | 47 | color 19 255 255 255 0 0 # intensive color 7 | ||
1014 | 0 | 48 | ||
1015 | === added file 'assets/color-schemes/historic/README.Schema' | |||
1016 | --- assets/color-schemes/historic/README.Schema 1970-01-01 00:00:00 +0000 | |||
1017 | +++ assets/color-schemes/historic/README.Schema 2017-09-09 05:25:54 +0000 | |||
1018 | @@ -0,0 +1,132 @@ | |||
1019 | 1 | [README.Schema] | ||
1020 | 2 | |||
1021 | 3 | The schemata offered in the Options/Schema menu are | ||
1022 | 4 | taken from from configurations files with a *.schema | ||
1023 | 5 | pattern either located in $KDEDIR/share/apps/konsole | ||
1024 | 6 | or ~/.kde/share/apps/konsole. | ||
1025 | 7 | |||
1026 | 8 | Schemata allow to configure the color set that konsole | ||
1027 | 9 | uses, together with some more information on rendition | ||
1028 | 10 | processing. | ||
1029 | 11 | |||
1030 | 12 | Syntax | ||
1031 | 13 | |||
1032 | 14 | File | ||
1033 | 15 | :: { [Line] ['#' Comment] '\n' } | ||
1034 | 16 | |||
1035 | 17 | Line | ||
1036 | 18 | :: "title" Title | ||
1037 | 19 | :: "image" Usage PathToPictureFile | ||
1038 | 20 | :: "transparency" Fade Red Green Blue | ||
1039 | 21 | :: "color" Slot Red Green Blue Transparent Bold | ||
1040 | 22 | :: "rcolor" Slot Saturation Value Transparent Bold | ||
1041 | 23 | :: "sysfg" Slot Transparent Bold | ||
1042 | 24 | :: "sysbg" Slot Transparent Bold | ||
1043 | 25 | |||
1044 | 26 | Meaning | ||
1045 | 27 | |||
1046 | 28 | - Title is the text to appear in the Option/Schema menu. | ||
1047 | 29 | It should be unique among all other schemata therefore. | ||
1048 | 30 | |||
1049 | 31 | - The "image" clause allows to place an image on the | ||
1050 | 32 | konsole's background. | ||
1051 | 33 | |||
1052 | 34 | - Usage can be either | ||
1053 | 35 | - "tile" - the image is tilewise replicated. | ||
1054 | 36 | - "center" - the image is centered. | ||
1055 | 37 | - "full" - the image is stretched to fit the window size. | ||
1056 | 38 | |||
1057 | 39 | - The Path of the picture can both be relative | ||
1058 | 40 | (to kde wallpapers) or absolute. | ||
1059 | 41 | |||
1060 | 42 | When a schema uses a background image (or transparency) | ||
1061 | 43 | one has to make at least one color slot transparent to | ||
1062 | 44 | achive any visible effect. Please read below about the | ||
1063 | 45 | "Transparent" field in color,sysbg,sysfg. | ||
1064 | 46 | |||
1065 | 47 | - The "transparency" clause picks and uses the background | ||
1066 | 48 | of the desktop as if it where an image together with | ||
1067 | 49 | a fade effect. This effect will fade the background | ||
1068 | 50 | to the specified color. | ||
1069 | 51 | |||
1070 | 52 | The "Fade" is a real value between 0 and 1, indicating | ||
1071 | 53 | the strength of the fade. A value of 0 will not change | ||
1072 | 54 | the image, a value of 1 will make it the fade color | ||
1073 | 55 | everywhere, and in between. This will make the "glas" | ||
1074 | 56 | of the window be of the color given in the clause and | ||
1075 | 57 | being more(1) or less(0) intransparent. | ||
1076 | 58 | |||
1077 | 59 | - The remaining clauses (color,sysbg,sysfg) are used | ||
1078 | 60 | to setup konsoles rendition system. | ||
1079 | 61 | |||
1080 | 62 | To this end, konsole offers 20 color slots. | ||
1081 | 63 | |||
1082 | 64 | Slot Meaning | ||
1083 | 65 | ----- -------------------------- | ||
1084 | 66 | 0 regular foreground color | ||
1085 | 67 | 1 regular background color | ||
1086 | 68 | 2-9 regular bgr color 0-7 | ||
1087 | 69 | 10 intensive foreground color | ||
1088 | 70 | 11 intensive background color | ||
1089 | 71 | 12-19 intensive bgr color 0-7 | ||
1090 | 72 | |||
1091 | 73 | The traditional meaning of the "bgr" color codes | ||
1092 | 74 | has a bitwise interpretation of an additive three | ||
1093 | 75 | primary color scheme inherited from early EGA | ||
1094 | 76 | color terminals. | ||
1095 | 77 | |||
1096 | 78 | Color Bits Colors | ||
1097 | 79 | ----- ---- ------- | ||
1098 | 80 | 0 000 Black | ||
1099 | 81 | 1 001 Red | ||
1100 | 82 | 2 010 Green | ||
1101 | 83 | 3 011 Yellow | ||
1102 | 84 | 4 100 Blue | ||
1103 | 85 | 5 101 Magenta | ||
1104 | 86 | 6 110 Cyan | ||
1105 | 87 | 7 111 White | ||
1106 | 88 | |||
1107 | 89 | One may or may not stick to this tradition. | ||
1108 | 90 | Konsole allows to assign colors freely to slots. | ||
1109 | 91 | |||
1110 | 92 | The slots fall apart into two groups, regular | ||
1111 | 93 | and intensive colors. The later are used when | ||
1112 | 94 | BOLD rendition is used by the client. | ||
1113 | 95 | |||
1114 | 96 | Each of the groups have a default fore- and | ||
1115 | 97 | background color and the said bgr colors. | ||
1116 | 98 | Normal terminal processing will simply use | ||
1117 | 99 | the default colors. | ||
1118 | 100 | |||
1119 | 101 | The color desired for a slot is indicated | ||
1120 | 102 | in the Red Green Blue fields of the color | ||
1121 | 103 | clause. Use the sysfg or the sysbg clause | ||
1122 | 104 | to indicate the default fore and background | ||
1123 | 105 | colors of the desktop. | ||
1124 | 106 | |||
1125 | 107 | To specify randomized color for a slot use | ||
1126 | 108 | the clause rcolor. The two parameters to it | ||
1127 | 109 | being Saturation - the amount of colour, | ||
1128 | 110 | and Value, the darkness of the colour. | ||
1129 | 111 | |||
1130 | 112 | To use transparency/images and to simulate | ||
1131 | 113 | the behavior of the xterm, one can supply | ||
1132 | 114 | two additional tags to each slot: | ||
1133 | 115 | - Transparent (0/1) meaning to show the | ||
1134 | 116 | background picture, if any. | ||
1135 | 117 | - Bold (0/1) to render characters bold. | ||
1136 | 118 | |||
1137 | 119 | |||
1138 | 120 | If you know about the escape codes, you might have | ||
1139 | 121 | noticed that intensive and bold rendition are sort | ||
1140 | 122 | of confused. This is inherited by the xterm which | ||
1141 | 123 | konsole is simulating. | ||
1142 | 124 | |||
1143 | 125 | One can use the colortest.sh script supplied | ||
1144 | 126 | with the konsole source distribution to test | ||
1145 | 127 | a schema. | ||
1146 | 128 | |||
1147 | 129 | The schema installed with konsole are more or | ||
1148 | 130 | less demonstrations and not really beauty, | ||
1149 | 131 | beside the Linux.schema, perhaps, which is | ||
1150 | 132 | made after the VGA colors. | ||
1151 | 0 | 133 | ||
1152 | === added file 'assets/color-schemes/historic/README.default.Schema' | |||
1153 | --- assets/color-schemes/historic/README.default.Schema 1970-01-01 00:00:00 +0000 | |||
1154 | +++ assets/color-schemes/historic/README.default.Schema 2017-09-09 05:25:54 +0000 | |||
1155 | @@ -0,0 +1,44 @@ | |||
1156 | 1 | # default scheme for konsole (only here for documentation purposes) | ||
1157 | 2 | |||
1158 | 3 | # the title is to appear in the menu. | ||
1159 | 4 | |||
1160 | 5 | title Konsole Defaults | ||
1161 | 6 | |||
1162 | 7 | # image tile /opt/kde/share/wallpapers/gray2.jpg | ||
1163 | 8 | |||
1164 | 9 | # foreground colors | ||
1165 | 10 | |||
1166 | 11 | # note that the default background color is flagged | ||
1167 | 12 | # to become transparent when an image is present. | ||
1168 | 13 | |||
1169 | 14 | # slot transparent bold | ||
1170 | 15 | # | | | | ||
1171 | 16 | # V V--color--V V V | ||
1172 | 17 | |||
1173 | 18 | color 0 0 0 0 0 0 # regular foreground color (Black) | ||
1174 | 19 | color 1 255 255 255 1 0 # regular background color (White) | ||
1175 | 20 | |||
1176 | 21 | color 2 0 0 0 0 0 # regular color 0 Black | ||
1177 | 22 | color 3 178 24 24 0 0 # regular color 1 Red | ||
1178 | 23 | color 4 24 178 24 0 0 # regular color 2 Green | ||
1179 | 24 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
1180 | 25 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
1181 | 26 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
1182 | 27 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
1183 | 28 | color 9 178 178 178 0 0 # regular color 7 White | ||
1184 | 29 | |||
1185 | 30 | # intensive colors | ||
1186 | 31 | |||
1187 | 32 | # instead of changing the colors, we've flaged the text to become bold | ||
1188 | 33 | |||
1189 | 34 | color 10 0 0 0 0 1 # intensive foreground color | ||
1190 | 35 | color 11 255 255 255 1 0 # intensive background color | ||
1191 | 36 | |||
1192 | 37 | color 12 104 104 104 0 0 # intensive color 0 | ||
1193 | 38 | color 13 255 84 84 0 0 # intensive color 1 | ||
1194 | 39 | color 14 84 255 84 0 0 # intensive color 2 | ||
1195 | 40 | color 15 255 255 84 0 0 # intensive color 3 | ||
1196 | 41 | color 16 84 84 255 0 0 # intensive color 4 | ||
1197 | 42 | color 17 255 84 255 0 0 # intensive color 5 | ||
1198 | 43 | color 18 84 255 255 0 0 # intensive color 6 | ||
1199 | 44 | color 19 255 255 255 0 0 # intensive color 7 | ||
1200 | 0 | 45 | ||
1201 | === added file 'assets/color-schemes/historic/Transparent.schema' | |||
1202 | --- assets/color-schemes/historic/Transparent.schema 1970-01-01 00:00:00 +0000 | |||
1203 | +++ assets/color-schemes/historic/Transparent.schema 2017-09-09 05:25:54 +0000 | |||
1204 | @@ -0,0 +1,49 @@ | |||
1205 | 1 | # linux color schema for konsole | ||
1206 | 2 | |||
1207 | 3 | title Transparent Konsole | ||
1208 | 4 | |||
1209 | 5 | transparency 0.35 0 0 0 | ||
1210 | 6 | |||
1211 | 7 | # FIXME | ||
1212 | 8 | # | ||
1213 | 9 | # The flaw in this schema is that "blick" comes out on the | ||
1214 | 10 | # Linux console as intensive background, really. | ||
1215 | 11 | # Since this is not used in clients you'll hardly notice | ||
1216 | 12 | # it in practice. | ||
1217 | 13 | |||
1218 | 14 | # foreground colors | ||
1219 | 15 | |||
1220 | 16 | # note that the default background color is flagged | ||
1221 | 17 | # to become transparent when an image is present. | ||
1222 | 18 | |||
1223 | 19 | # slot transparent bold | ||
1224 | 20 | # | red grn blu | | | ||
1225 | 21 | # V V--color--V V V | ||
1226 | 22 | |||
1227 | 23 | color 0 178 178 178 0 0 # regular foreground color (White) | ||
1228 | 24 | color 1 0 0 0 1 0 # regular background color (Black) | ||
1229 | 25 | |||
1230 | 26 | color 2 0 0 0 0 0 # regular color 0 Black | ||
1231 | 27 | color 3 178 24 24 0 0 # regular color 1 Red | ||
1232 | 28 | color 4 24 178 24 0 0 # regular color 2 Green | ||
1233 | 29 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
1234 | 30 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
1235 | 31 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
1236 | 32 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
1237 | 33 | color 9 178 178 178 0 0 # regular color 7 White | ||
1238 | 34 | |||
1239 | 35 | # intensive colors | ||
1240 | 36 | |||
1241 | 37 | # instead of changing the colors, we've flaged the text to become bold | ||
1242 | 38 | |||
1243 | 39 | color 10 255 255 255 0 0 # intensive foreground color | ||
1244 | 40 | color 11 104 104 104 1 0 # intensive background color | ||
1245 | 41 | |||
1246 | 42 | color 12 104 104 104 0 0 # intensive color 0 | ||
1247 | 43 | color 13 255 84 84 0 0 # intensive color 1 | ||
1248 | 44 | color 14 84 255 84 0 0 # intensive color 2 | ||
1249 | 45 | color 15 255 255 84 0 0 # intensive color 3 | ||
1250 | 46 | color 16 84 84 255 0 0 # intensive color 4 | ||
1251 | 47 | color 17 255 84 255 0 0 # intensive color 5 | ||
1252 | 48 | color 18 84 255 255 0 0 # intensive color 6 | ||
1253 | 49 | color 19 255 255 255 0 0 # intensive color 7 | ||
1254 | 0 | 50 | ||
1255 | === added file 'assets/color-schemes/historic/Transparent_MC.schema' | |||
1256 | --- assets/color-schemes/historic/Transparent_MC.schema 1970-01-01 00:00:00 +0000 | |||
1257 | +++ assets/color-schemes/historic/Transparent_MC.schema 2017-09-09 05:25:54 +0000 | |||
1258 | @@ -0,0 +1,51 @@ | |||
1259 | 1 | # linux color schema for konsole | ||
1260 | 2 | |||
1261 | 3 | title Transparent for MC | ||
1262 | 4 | |||
1263 | 5 | transparency 0.35 0 0 0 | ||
1264 | 6 | |||
1265 | 7 | # FIXME | ||
1266 | 8 | # | ||
1267 | 9 | # The flaw in this schema is that "blick" comes out on the | ||
1268 | 10 | # Linux console as intensive background, really. | ||
1269 | 11 | # Since this is not used in clients you'll hardly notice | ||
1270 | 12 | # it in practice. | ||
1271 | 13 | |||
1272 | 14 | # foreground colors | ||
1273 | 15 | |||
1274 | 16 | # note that the default background color is flagged | ||
1275 | 17 | # to become transparent when an image is present. | ||
1276 | 18 | |||
1277 | 19 | # slot transparent bold | ||
1278 | 20 | # | red grn blu | | | ||
1279 | 21 | # V V--color--V V V | ||
1280 | 22 | |||
1281 | 23 | color 0 178 178 178 0 0 # regular foreground color (White) | ||
1282 | 24 | color 1 0 0 0 1 0 # regular background color (Black) | ||
1283 | 25 | |||
1284 | 26 | color 2 0 0 0 0 0 # regular color 0 Black | ||
1285 | 27 | color 3 178 24 24 0 0 # regular color 1 Red | ||
1286 | 28 | color 4 24 178 24 0 0 # regular color 2 Green | ||
1287 | 29 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
1288 | 30 | #color 6 24 24 178 0 0 # regular color 4 Blue | ||
1289 | 31 | color 6 0 0 0 1 0 # regular color 4 Blue | ||
1290 | 32 | |||
1291 | 33 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
1292 | 34 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
1293 | 35 | color 9 178 178 178 0 0 # regular color 7 White | ||
1294 | 36 | |||
1295 | 37 | # intensive colors | ||
1296 | 38 | |||
1297 | 39 | # instead of changing the colors, we've flaged the text to become bold | ||
1298 | 40 | |||
1299 | 41 | color 10 255 255 255 0 0 # intensive foreground color | ||
1300 | 42 | color 11 104 104 104 1 0 # intensive background color | ||
1301 | 43 | |||
1302 | 44 | color 12 104 104 104 0 0 # intensive color 0 | ||
1303 | 45 | color 13 255 84 84 0 0 # intensive color 1 | ||
1304 | 46 | color 14 84 255 84 0 0 # intensive color 2 | ||
1305 | 47 | color 15 255 255 84 0 0 # intensive color 3 | ||
1306 | 48 | color 16 84 84 255 0 0 # intensive color 4 | ||
1307 | 49 | color 17 255 84 255 0 0 # intensive color 5 | ||
1308 | 50 | color 18 84 255 255 0 0 # intensive color 6 | ||
1309 | 51 | color 19 255 255 255 0 0 # intensive color 7 | ||
1310 | 0 | 52 | ||
1311 | === added file 'assets/color-schemes/historic/Transparent_darkbg.schema' | |||
1312 | --- assets/color-schemes/historic/Transparent_darkbg.schema 1970-01-01 00:00:00 +0000 | |||
1313 | +++ assets/color-schemes/historic/Transparent_darkbg.schema 2017-09-09 05:25:54 +0000 | |||
1314 | @@ -0,0 +1,42 @@ | |||
1315 | 1 | # linux color schema for konsole | ||
1316 | 2 | |||
1317 | 3 | title Transparent, Dark Background | ||
1318 | 4 | |||
1319 | 5 | transparency 0.75 0 0 0 | ||
1320 | 6 | |||
1321 | 7 | # foreground colors | ||
1322 | 8 | |||
1323 | 9 | # note that the default background color is flagged | ||
1324 | 10 | # to become transparent when an image is present. | ||
1325 | 11 | |||
1326 | 12 | # slot transparent bold | ||
1327 | 13 | # | red grn blu | | | ||
1328 | 14 | # V V--color--V V V | ||
1329 | 15 | |||
1330 | 16 | color 0 255 255 255 0 0 # regular foreground color (White) | ||
1331 | 17 | color 1 0 0 0 1 0 # regular background color (Black) | ||
1332 | 18 | |||
1333 | 19 | color 2 0 0 0 0 0 # regular color 0 Black | ||
1334 | 20 | color 3 178 24 24 0 0 # regular color 1 Red | ||
1335 | 21 | color 4 24 178 24 0 0 # regular color 2 Green | ||
1336 | 22 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
1337 | 23 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
1338 | 24 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
1339 | 25 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
1340 | 26 | color 9 178 178 178 0 0 # regular color 7 White | ||
1341 | 27 | |||
1342 | 28 | # intensive colors | ||
1343 | 29 | |||
1344 | 30 | # instead of changing the colors, we've flaged the text to become bold | ||
1345 | 31 | |||
1346 | 32 | color 10 255 255 255 0 0 # intensive foreground color | ||
1347 | 33 | color 11 104 104 104 1 0 # intensive background color | ||
1348 | 34 | |||
1349 | 35 | color 12 104 104 104 0 0 # intensive color 0 | ||
1350 | 36 | color 13 255 84 84 0 0 # intensive color 1 | ||
1351 | 37 | color 14 84 255 84 0 0 # intensive color 2 | ||
1352 | 38 | color 15 255 255 84 0 0 # intensive color 3 | ||
1353 | 39 | color 16 84 84 255 0 0 # intensive color 4 | ||
1354 | 40 | color 17 255 84 255 0 0 # intensive color 5 | ||
1355 | 41 | color 18 84 255 255 0 0 # intensive color 6 | ||
1356 | 42 | color 19 255 255 255 0 0 # intensive color 7 | ||
1357 | 0 | 43 | ||
1358 | === added file 'assets/color-schemes/historic/Transparent_lightbg.schema' | |||
1359 | --- assets/color-schemes/historic/Transparent_lightbg.schema 1970-01-01 00:00:00 +0000 | |||
1360 | +++ assets/color-schemes/historic/Transparent_lightbg.schema 2017-09-09 05:25:54 +0000 | |||
1361 | @@ -0,0 +1,51 @@ | |||
1362 | 1 | # linux color schema for konsole | ||
1363 | 2 | |||
1364 | 3 | title Transparent, Light Background | ||
1365 | 4 | |||
1366 | 5 | transparency 0.1 0 0 0 | ||
1367 | 6 | |||
1368 | 7 | # This is a schema for very light backgrounds. It makes some | ||
1369 | 8 | # hacks about the colors to make Midnight Commander transparent | ||
1370 | 9 | # and with suitable colors. | ||
1371 | 10 | |||
1372 | 11 | # foreground colors | ||
1373 | 12 | |||
1374 | 13 | # note that the default background color is flagged | ||
1375 | 14 | # to become transparent when an image is present. | ||
1376 | 15 | |||
1377 | 16 | # slot transparent bold | ||
1378 | 17 | # | red grn blu | | | ||
1379 | 18 | # V V--color--V V V | ||
1380 | 19 | |||
1381 | 20 | color 0 50 50 50 0 0 # regular foreground color (DarkGray) | ||
1382 | 21 | color 1 200 200 200 1 0 # regular background color (White) | ||
1383 | 22 | |||
1384 | 23 | # color 2 0 0 0 0 0 # regular color 0 Black | ||
1385 | 24 | color 2 200 200 200 1 0 # regular background color (White) | ||
1386 | 25 | color 3 178 24 24 0 0 # regular color 1 Red | ||
1387 | 26 | color 4 24 178 24 0 0 # regular color 2 Green | ||
1388 | 27 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
1389 | 28 | #color 6 24 24 178 0 0 # regular color 4 Blue | ||
1390 | 29 | color 6 0 0 0 1 0 # regular color 4 Blue | ||
1391 | 30 | # Blue is transparent, to make MC transparent | ||
1392 | 31 | |||
1393 | 32 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
1394 | 33 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
1395 | 34 | # color 9 178 178 178 0 0 # regular color 7 White | ||
1396 | 35 | color 9 50 50 50 0 0 # regular foreground color (DarkGray) | ||
1397 | 36 | |||
1398 | 37 | # intensive colors | ||
1399 | 38 | |||
1400 | 39 | # instead of changing the colors, we've flaged the text to become bold | ||
1401 | 40 | |||
1402 | 41 | color 10 0 0 0 0 0 # intensive foreground color | ||
1403 | 42 | color 11 255 255 255 1 0 # intensive background color | ||
1404 | 43 | |||
1405 | 44 | color 12 104 104 104 0 0 # intensive color 0 | ||
1406 | 45 | color 13 255 84 84 0 0 # intensive color 1 | ||
1407 | 46 | color 14 84 255 84 0 0 # intensive color 2 | ||
1408 | 47 | color 15 255 255 84 0 0 # intensive color 3 | ||
1409 | 48 | color 16 84 84 255 0 0 # intensive color 4 | ||
1410 | 49 | color 17 255 84 255 0 0 # intensive color 5 | ||
1411 | 50 | color 18 84 255 255 0 0 # intensive color 6 | ||
1412 | 51 | color 19 255 255 255 0 0 # intensive color 7 | ||
1413 | 0 | 52 | ||
1414 | === added file 'assets/color-schemes/historic/XTerm.schema' | |||
1415 | --- assets/color-schemes/historic/XTerm.schema 1970-01-01 00:00:00 +0000 | |||
1416 | +++ assets/color-schemes/historic/XTerm.schema 2017-09-09 05:25:54 +0000 | |||
1417 | @@ -0,0 +1,46 @@ | |||
1418 | 1 | # xterm color schema for konsole | ||
1419 | 2 | |||
1420 | 3 | # xterm colors can be configured (almost) like | ||
1421 | 4 | # konsole colors can. This is the uncustomized | ||
1422 | 5 | # xterm schema. | ||
1423 | 6 | # Please refere to your local xterm setup files | ||
1424 | 7 | # if this schema differs. | ||
1425 | 8 | |||
1426 | 9 | title XTerm Colors | ||
1427 | 10 | |||
1428 | 11 | # foreground colors ------------------------------- | ||
1429 | 12 | |||
1430 | 13 | # note that the default background color is flagged | ||
1431 | 14 | # to become transparent when an image is present. | ||
1432 | 15 | |||
1433 | 16 | # slot transparent bold | ||
1434 | 17 | # | red grn blu | | | ||
1435 | 18 | # V V--color--V V V | ||
1436 | 19 | |||
1437 | 20 | color 0 0 0 0 0 0 # regular foreground color (Black) | ||
1438 | 21 | color 1 255 255 255 1 0 # regular background color (White) | ||
1439 | 22 | |||
1440 | 23 | color 2 0 0 0 0 0 # regular color 0 Black | ||
1441 | 24 | color 3 205 0 0 0 0 # regular color 1 Red | ||
1442 | 25 | color 4 0 205 0 0 0 # regular color 2 Green | ||
1443 | 26 | color 5 205 205 0 0 0 # regular color 3 Yellow | ||
1444 | 27 | color 6 0 0 205 0 0 # regular color 4 Blue | ||
1445 | 28 | color 7 205 0 205 0 0 # regular color 5 Magenta | ||
1446 | 29 | color 8 0 205 205 0 0 # regular color 6 Cyan | ||
1447 | 30 | color 9 229 229 229 0 0 # regular color 7 White | ||
1448 | 31 | |||
1449 | 32 | # intensive colors ------------------------------------------- | ||
1450 | 33 | |||
1451 | 34 | # for some strange reason, intensive colors are bold, also. | ||
1452 | 35 | |||
1453 | 36 | color 10 77 77 77 0 1 # intensive foreground color | ||
1454 | 37 | color 11 255 255 255 1 1 # intensive background color | ||
1455 | 38 | |||
1456 | 39 | color 12 77 77 77 0 1 # intensive color 0 | ||
1457 | 40 | color 13 255 0 0 0 1 # intensive color 1 | ||
1458 | 41 | color 14 0 255 0 0 1 # intensive color 2 | ||
1459 | 42 | color 15 255 255 0 0 1 # intensive color 3 | ||
1460 | 43 | color 16 0 0 255 0 1 # intensive color 4 | ||
1461 | 44 | color 17 255 0 255 0 1 # intensive color 5 | ||
1462 | 45 | color 18 0 255 255 0 1 # intensive color 6 | ||
1463 | 46 | color 19 255 255 255 0 1 # intensive color 7 | ||
1464 | 0 | 47 | ||
1465 | === added file 'assets/color-schemes/historic/syscolor.schema' | |||
1466 | --- assets/color-schemes/historic/syscolor.schema 1970-01-01 00:00:00 +0000 | |||
1467 | +++ assets/color-schemes/historic/syscolor.schema 2017-09-09 05:25:54 +0000 | |||
1468 | @@ -0,0 +1,44 @@ | |||
1469 | 1 | # schema that uses system colors | ||
1470 | 2 | |||
1471 | 3 | # the title is to appear in the menu. | ||
1472 | 4 | |||
1473 | 5 | title System Colors | ||
1474 | 6 | |||
1475 | 7 | # image none | ||
1476 | 8 | |||
1477 | 9 | # foreground colors | ||
1478 | 10 | |||
1479 | 11 | # note that the default background color is flagged | ||
1480 | 12 | # to become transparent when an image is present. | ||
1481 | 13 | |||
1482 | 14 | # slot transparent bold | ||
1483 | 15 | # | | | | ||
1484 | 16 | # V V--color--V V V | ||
1485 | 17 | |||
1486 | 18 | sysfg 0 0 0 # regular foreground color (system) | ||
1487 | 19 | sysbg 1 1 0 # regular background color (system) | ||
1488 | 20 | |||
1489 | 21 | color 2 0 0 0 0 0 # regular color 0 Black | ||
1490 | 22 | color 3 178 24 24 0 0 # regular color 1 Red | ||
1491 | 23 | color 4 24 178 24 0 0 # regular color 2 Green | ||
1492 | 24 | color 5 178 104 24 0 0 # regular color 3 Yellow | ||
1493 | 25 | color 6 24 24 178 0 0 # regular color 4 Blue | ||
1494 | 26 | color 7 178 24 178 0 0 # regular color 5 Magenta | ||
1495 | 27 | color 8 24 178 178 0 0 # regular color 6 Cyan | ||
1496 | 28 | color 9 178 178 178 0 0 # regular color 7 White | ||
1497 | 29 | |||
1498 | 30 | # intensive colors | ||
1499 | 31 | |||
1500 | 32 | # instead of changing the colors, we've flaged the text to become bold | ||
1501 | 33 | |||
1502 | 34 | color 10 0 0 0 0 1 # intensive foreground color | ||
1503 | 35 | color 11 255 255 255 1 0 # intensive background color | ||
1504 | 36 | |||
1505 | 37 | color 12 104 104 104 0 0 # intensive color 0 | ||
1506 | 38 | color 13 255 84 84 0 0 # intensive color 1 | ||
1507 | 39 | color 14 84 255 84 0 0 # intensive color 2 | ||
1508 | 40 | color 15 255 255 84 0 0 # intensive color 3 | ||
1509 | 41 | color 16 84 84 255 0 0 # intensive color 4 | ||
1510 | 42 | color 17 255 84 255 0 0 # intensive color 5 | ||
1511 | 43 | color 18 84 255 255 0 0 # intensive color 6 | ||
1512 | 44 | color 19 255 255 255 0 0 # intensive color 7 | ||
1513 | 0 | 45 | ||
1514 | === added file 'assets/color-schemes/historic/vim.schema' | |||
1515 | --- assets/color-schemes/historic/vim.schema 1970-01-01 00:00:00 +0000 | |||
1516 | +++ assets/color-schemes/historic/vim.schema 2017-09-09 05:25:54 +0000 | |||
1517 | @@ -0,0 +1,40 @@ | |||
1518 | 1 | # VIM-recommended color schema for konsole | ||
1519 | 2 | |||
1520 | 3 | # VIM (VI improved) in "help xiterm" recommends these colors for xterm. | ||
1521 | 4 | |||
1522 | 5 | title VIM Colors | ||
1523 | 6 | |||
1524 | 7 | # foreground colors ------------------------------- | ||
1525 | 8 | |||
1526 | 9 | # note that the default background color is flagged | ||
1527 | 10 | # to become transparent when an image is present. | ||
1528 | 11 | |||
1529 | 12 | # slot transparent bold | ||
1530 | 13 | # | red grn blu | | | ||
1531 | 14 | # V V--color--V V V | ||
1532 | 15 | |||
1533 | 16 | color 0 0 0 0 0 0 # regular foreground color (Black) | ||
1534 | 17 | color 1 255 255 255 1 0 # regular background color (White) | ||
1535 | 18 | |||
1536 | 19 | color 2 0 0 0 0 0 # regular color 0 Black | ||
1537 | 20 | color 3 192 0 0 0 0 # regular color 1 Red | ||
1538 | 21 | color 4 0 128 0 0 0 # regular color 2 Green | ||
1539 | 22 | color 5 128 128 0 0 0 # regular color 3 Yellow | ||
1540 | 23 | color 6 0 0 192 0 0 # regular color 4 Blue | ||
1541 | 24 | color 7 192 0 192 0 0 # regular color 5 Magenta | ||
1542 | 25 | color 8 0 128 128 0 0 # regular color 6 Cyan | ||
1543 | 26 | color 9 192 192 192 0 0 # regular color 7 White | ||
1544 | 27 | |||
1545 | 28 | # intensive colors ------------------------------------------- | ||
1546 | 29 | |||
1547 | 30 | color 10 77 77 77 0 1 # intensive foreground color | ||
1548 | 31 | color 11 255 255 255 1 1 # intensive background color | ||
1549 | 32 | |||
1550 | 33 | color 12 128 128 128 0 0 # intensive color 0 | ||
1551 | 34 | color 13 255 96 96 0 0 # intensive color 1 | ||
1552 | 35 | color 14 0 255 0 0 0 # intensive color 2 | ||
1553 | 36 | color 15 255 255 0 0 0 # intensive color 3 | ||
1554 | 37 | color 16 128 128 255 0 0 # intensive color 4 | ||
1555 | 38 | color 17 255 64 255 0 0 # intensive color 5 | ||
1556 | 39 | color 18 0 255 255 0 0 # intensive color 6 | ||
1557 | 40 | color 19 255 255 255 0 0 # intensive color 7 | ||
1558 | 0 | 41 | ||
1559 | === added directory 'assets/kb-layouts' | |||
1560 | === added file 'assets/kb-layouts/README' | |||
1561 | --- assets/kb-layouts/README 1970-01-01 00:00:00 +0000 | |||
1562 | +++ assets/kb-layouts/README 2017-09-09 05:25:54 +0000 | |||
1563 | @@ -0,0 +1,72 @@ | |||
1564 | 1 | [README.KeyTab] | ||
1565 | 2 | |||
1566 | 3 | The keytabs offered in the Options/Keyboard menu are | ||
1567 | 4 | taken from from configurations files with a *.keytab | ||
1568 | 5 | pattern either located in $KDEDIR/share/apps/konsole | ||
1569 | 6 | or ~/.kde/share/apps/konsole. | ||
1570 | 7 | |||
1571 | 8 | Keytabs allow to configure the behavior of konsole | ||
1572 | 9 | on keyboard events, especially for functions keys. | ||
1573 | 10 | Please have a look into the README.keyboard file, too. | ||
1574 | 11 | |||
1575 | 12 | The syntax is that each entry has the form : | ||
1576 | 13 | |||
1577 | 14 | "key" Keyname { ("+"|"-") Modename } ":" (String|Operation) | ||
1578 | 15 | |||
1579 | 16 | Keynames are those defined in <qnamespace.h> with the | ||
1580 | 17 | "Qt::Key_" prefix removed. | ||
1581 | 18 | |||
1582 | 19 | Mode names are: | ||
1583 | 20 | |||
1584 | 21 | - Shift : Shift Key pressed | ||
1585 | 22 | - Alt : Alt Key pressed | ||
1586 | 23 | - Control : Control Key pressed | ||
1587 | 24 | |||
1588 | 25 | ( The VT100 emulation has modes that can affect the | ||
1589 | 26 | sequences emitted by certain keys. These modes are | ||
1590 | 27 | under control of the client program. | ||
1591 | 28 | |||
1592 | 29 | - Newline : effects Return and Enter key. | ||
1593 | 30 | - Application : effects Up and Down key. | ||
1594 | 31 | - Ansi : effects Up and Down key (This is for VT52, really). | ||
1595 | 32 | |||
1596 | 33 | Since sending a state to a program that has set the state | ||
1597 | 34 | itself is positivly wrong and obsolete design, better forget | ||
1598 | 35 | about this nasty detail. I may well remove this "feature" | ||
1599 | 36 | in a future clean up round. ) | ||
1600 | 37 | |||
1601 | 38 | A "+" preceeding a Modename means the Key is pressed. | ||
1602 | 39 | A "-" preceeding a Modename means the Key is not pressed. | ||
1603 | 40 | If no mode is given it means don't care. | ||
1604 | 41 | |||
1605 | 42 | Note that the combination of Key and Modes (set/reset) | ||
1606 | 43 | has to be unique. This means, that | ||
1607 | 44 | |||
1608 | 45 | key A + Shift : "A" | ||
1609 | 46 | key A : "a" | ||
1610 | 47 | |||
1611 | 48 | will not accept the small letter "a" rule as expected, | ||
1612 | 49 | one has to add a "- Shift" to the last clause. Use | ||
1613 | 50 | the stdout/stderr dianostics of konsole when modifying | ||
1614 | 51 | keytabs to find problems like this. | ||
1615 | 52 | |||
1616 | 53 | Operations are | ||
1617 | 54 | |||
1618 | 55 | - scrollUpLine : scroll up one line in the history log | ||
1619 | 56 | - scrollUpPage : scroll up one page in the history log | ||
1620 | 57 | - scrollDownLine : scroll down one line in the history log | ||
1621 | 58 | - scrollDownPage : scroll down one page in the history log | ||
1622 | 59 | - emitClipboard : "paste" the current clipboard | ||
1623 | 60 | - emitSelection : "paste" the current selection | ||
1624 | 61 | |||
1625 | 62 | Strings have the syntax of C strings, | ||
1626 | 63 | one may use the following escapes: | ||
1627 | 64 | |||
1628 | 65 | - \E - escape | ||
1629 | 66 | - \\ - backslash | ||
1630 | 67 | - \" - double quote | ||
1631 | 68 | - \t - tab | ||
1632 | 69 | - \r - return | ||
1633 | 70 | - \n - newline | ||
1634 | 71 | - \b - backspace | ||
1635 | 72 | - \xHH - where HH are two hex digits | ||
1636 | 0 | 73 | ||
1637 | === added file 'assets/kb-layouts/default.keytab' | |||
1638 | --- assets/kb-layouts/default.keytab 1970-01-01 00:00:00 +0000 | |||
1639 | +++ assets/kb-layouts/default.keytab 2017-09-09 05:25:54 +0000 | |||
1640 | @@ -0,0 +1,169 @@ | |||
1641 | 1 | # [README.default.Keytab] Default Keyboard Table | ||
1642 | 2 | # | ||
1643 | 3 | # To customize your keyboard, copy this file to something | ||
1644 | 4 | # ending with .keytab and change it to meet you needs. | ||
1645 | 5 | # Please read the README.KeyTab and the README.keyboard | ||
1646 | 6 | # in this case. | ||
1647 | 7 | # | ||
1648 | 8 | # -------------------------------------------------------------- | ||
1649 | 9 | |||
1650 | 10 | keyboard "Default (XFree 4)" | ||
1651 | 11 | |||
1652 | 12 | # -------------------------------------------------------------- | ||
1653 | 13 | # | ||
1654 | 14 | # Note that this particular table is a "risc" version made to | ||
1655 | 15 | # ease customization without bothering with obsolete details. | ||
1656 | 16 | # See VT100.keytab for the more hairy stuff. | ||
1657 | 17 | # | ||
1658 | 18 | # -------------------------------------------------------------- | ||
1659 | 19 | |||
1660 | 20 | # common keys | ||
1661 | 21 | |||
1662 | 22 | key Escape : "\E" | ||
1663 | 23 | |||
1664 | 24 | key Tab -Shift : "\t" | ||
1665 | 25 | key Tab +Shift+Ansi : "\E[Z" | ||
1666 | 26 | key Tab +Shift-Ansi : "\t" | ||
1667 | 27 | key Backtab +Ansi : "\E[Z" | ||
1668 | 28 | key Backtab -Ansi : "\t" | ||
1669 | 29 | |||
1670 | 30 | key Return-Shift-NewLine : "\r" | ||
1671 | 31 | key Return-Shift+NewLine : "\r\n" | ||
1672 | 32 | |||
1673 | 33 | key Return+Shift : "\EOM" | ||
1674 | 34 | |||
1675 | 35 | # Backspace and Delete codes are preserving CTRL-H. | ||
1676 | 36 | |||
1677 | 37 | key Backspace : "\x7f" | ||
1678 | 38 | |||
1679 | 39 | # Arrow keys in VT52 mode | ||
1680 | 40 | # shift up/down are reserved for scrolling. | ||
1681 | 41 | # shift left/right are reserved for switching between tabs (this is hardcoded). | ||
1682 | 42 | |||
1683 | 43 | key Up -Shift-Ansi : "\EA" | ||
1684 | 44 | key Down -Shift-Ansi : "\EB" | ||
1685 | 45 | key Right-Shift-Ansi : "\EC" | ||
1686 | 46 | key Left -Shift-Ansi : "\ED" | ||
1687 | 47 | |||
1688 | 48 | # Arrow keys in ANSI mode with Application - and Normal Cursor Mode) | ||
1689 | 49 | |||
1690 | 50 | key Up -Shift-AnyMod+Ansi+AppCuKeys : "\EOA" | ||
1691 | 51 | key Down -Shift-AnyMod+Ansi+AppCuKeys : "\EOB" | ||
1692 | 52 | key Right -Shift-AnyMod+Ansi+AppCuKeys : "\EOC" | ||
1693 | 53 | key Left -Shift-AnyMod+Ansi+AppCuKeys : "\EOD" | ||
1694 | 54 | |||
1695 | 55 | key Up -Shift-AnyMod+Ansi-AppCuKeys : "\E[A" | ||
1696 | 56 | key Down -Shift-AnyMod+Ansi-AppCuKeys : "\E[B" | ||
1697 | 57 | key Right -Shift-AnyMod+Ansi-AppCuKeys : "\E[C" | ||
1698 | 58 | key Left -Shift-AnyMod+Ansi-AppCuKeys : "\E[D" | ||
1699 | 59 | |||
1700 | 60 | key Up -Shift+AnyMod+Ansi : "\E[1;*A" | ||
1701 | 61 | key Down -Shift+AnyMod+Ansi : "\E[1;*B" | ||
1702 | 62 | key Right -Shift+AnyMod+Ansi : "\E[1;*C" | ||
1703 | 63 | key Left -Shift+AnyMod+Ansi : "\E[1;*D" | ||
1704 | 64 | |||
1705 | 65 | # Keypad keys with NumLock ON | ||
1706 | 66 | # (see "Numeric Keypad" section at http://www.nw.com/nw/WWW/products/wizcon/vt100.html ) | ||
1707 | 67 | # | ||
1708 | 68 | # Not enabled for now because it breaks the keypad in Vim. | ||
1709 | 69 | # | ||
1710 | 70 | #key 0 +KeyPad+AppKeyPad : "\EOp" | ||
1711 | 71 | #key 1 +KeyPad+AppKeyPad : "\EOq" | ||
1712 | 72 | #key 2 +KeyPad+AppKeyPad : "\EOr" | ||
1713 | 73 | #key 3 +KeyPad+AppKeyPad : "\EOs" | ||
1714 | 74 | #key 4 +KeyPad+AppKeyPad : "\EOt" | ||
1715 | 75 | #key 5 +KeyPad+AppKeyPad : "\EOu" | ||
1716 | 76 | #key 6 +KeyPad+AppKeyPad : "\EOv" | ||
1717 | 77 | #key 7 +KeyPad+AppKeyPad : "\EOw" | ||
1718 | 78 | #key 8 +KeyPad+AppKeyPad : "\EOx" | ||
1719 | 79 | #key 9 +KeyPad+AppKeyPad : "\EOy" | ||
1720 | 80 | #key + +KeyPad+AppKeyPad : "\EOl" | ||
1721 | 81 | #key - +KeyPad+AppKeyPad : "\EOm" | ||
1722 | 82 | #key . +KeyPad+AppKeyPad : "\EOn" | ||
1723 | 83 | #key * +KeyPad+AppKeyPad : "\EOM" | ||
1724 | 84 | #key Enter +KeyPad+AppKeyPad : "\r" | ||
1725 | 85 | |||
1726 | 86 | # Keypad keys with NumLock Off | ||
1727 | 87 | key Up -Shift+Ansi+AppCuKeys+KeyPad : "\EOA" | ||
1728 | 88 | key Down -Shift+Ansi+AppCuKeys+KeyPad : "\EOB" | ||
1729 | 89 | key Right -Shift+Ansi+AppCuKeys+KeyPad : "\EOC" | ||
1730 | 90 | key Left -Shift+Ansi+AppCuKeys+KeyPad : "\EOD" | ||
1731 | 91 | |||
1732 | 92 | key Up -Shift+Ansi-AppCuKeys+KeyPad : "\E[A" | ||
1733 | 93 | key Down -Shift+Ansi-AppCuKeys+KeyPad : "\E[B" | ||
1734 | 94 | key Right -Shift+Ansi-AppCuKeys+KeyPad : "\E[C" | ||
1735 | 95 | key Left -Shift+Ansi-AppCuKeys+KeyPad : "\E[D" | ||
1736 | 96 | |||
1737 | 97 | key Home +AppCuKeys+KeyPad : "\EOH" | ||
1738 | 98 | key End +AppCuKeys+KeyPad : "\EOF" | ||
1739 | 99 | key Home -AppCuKeys+KeyPad : "\E[H" | ||
1740 | 100 | key End -AppCuKeys+KeyPad : "\E[F" | ||
1741 | 101 | |||
1742 | 102 | key Insert +KeyPad : "\E[2~" | ||
1743 | 103 | key Delete +KeyPad : "\E[3~" | ||
1744 | 104 | key Prior -Shift+KeyPad : "\E[5~" | ||
1745 | 105 | key Next -Shift+KeyPad : "\E[6~" | ||
1746 | 106 | |||
1747 | 107 | # other grey PC keys | ||
1748 | 108 | |||
1749 | 109 | key Enter+NewLine : "\r\n" | ||
1750 | 110 | key Enter-NewLine : "\r" | ||
1751 | 111 | |||
1752 | 112 | key Home -AnyMod-AppCuKeys : "\E[H" | ||
1753 | 113 | key End -AnyMod-AppCuKeys : "\E[F" | ||
1754 | 114 | key Home -AnyMod+AppCuKeys : "\EOH" | ||
1755 | 115 | key End -AnyMod+AppCuKeys : "\EOF" | ||
1756 | 116 | key Home +AnyMod : "\E[1;*H" | ||
1757 | 117 | key End +AnyMod : "\E[1;*F" | ||
1758 | 118 | |||
1759 | 119 | key Insert -AnyMod : "\E[2~" | ||
1760 | 120 | key Delete -AnyMod : "\E[3~" | ||
1761 | 121 | key Insert +AnyMod : "\E[2;*~" | ||
1762 | 122 | key Delete +AnyMod : "\E[3;*~" | ||
1763 | 123 | |||
1764 | 124 | key Prior -Shift-AnyMod : "\E[5~" | ||
1765 | 125 | key Next -Shift-AnyMod : "\E[6~" | ||
1766 | 126 | key Prior -Shift+AnyMod : "\E[5;*~" | ||
1767 | 127 | key Next -Shift+AnyMod : "\E[6;*~" | ||
1768 | 128 | |||
1769 | 129 | # Function keys | ||
1770 | 130 | key F1 -AnyMod : "\EOP" | ||
1771 | 131 | key F2 -AnyMod : "\EOQ" | ||
1772 | 132 | key F3 -AnyMod : "\EOR" | ||
1773 | 133 | key F4 -AnyMod : "\EOS" | ||
1774 | 134 | key F5 -AnyMod : "\E[15~" | ||
1775 | 135 | key F6 -AnyMod : "\E[17~" | ||
1776 | 136 | key F7 -AnyMod : "\E[18~" | ||
1777 | 137 | key F8 -AnyMod : "\E[19~" | ||
1778 | 138 | key F9 -AnyMod : "\E[20~" | ||
1779 | 139 | key F10 -AnyMod : "\E[21~" | ||
1780 | 140 | key F11 -AnyMod : "\E[23~" | ||
1781 | 141 | key F12 -AnyMod : "\E[24~" | ||
1782 | 142 | |||
1783 | 143 | key F1 +AnyMod : "\EO*P" | ||
1784 | 144 | key F2 +AnyMod : "\EO*Q" | ||
1785 | 145 | key F3 +AnyMod : "\EO*R" | ||
1786 | 146 | key F4 +AnyMod : "\EO*S" | ||
1787 | 147 | key F5 +AnyMod : "\E[15;*~" | ||
1788 | 148 | key F6 +AnyMod : "\E[17;*~" | ||
1789 | 149 | key F7 +AnyMod : "\E[18;*~" | ||
1790 | 150 | key F8 +AnyMod : "\E[19;*~" | ||
1791 | 151 | key F9 +AnyMod : "\E[20;*~" | ||
1792 | 152 | key F10 +AnyMod : "\E[21;*~" | ||
1793 | 153 | key F11 +AnyMod : "\E[23;*~" | ||
1794 | 154 | key F12 +AnyMod : "\E[24;*~" | ||
1795 | 155 | |||
1796 | 156 | # Work around dead keys | ||
1797 | 157 | |||
1798 | 158 | key Space +Control : "\x00" | ||
1799 | 159 | |||
1800 | 160 | # Some keys are used by konsole to cause operations. | ||
1801 | 161 | # The scroll* operations refer to the history buffer. | ||
1802 | 162 | |||
1803 | 163 | key Up +Shift-AppScreen : scrollLineUp | ||
1804 | 164 | key Prior +Shift-AppScreen : scrollPageUp | ||
1805 | 165 | key Down +Shift-AppScreen : scrollLineDown | ||
1806 | 166 | key Next +Shift-AppScreen : scrollPageDown | ||
1807 | 167 | |||
1808 | 168 | key ScrollLock : scrollLock | ||
1809 | 169 | |||
1810 | 0 | 170 | ||
1811 | === added directory 'assets/kb-layouts/historic' | |||
1812 | === added file 'assets/kb-layouts/historic/vt100.keytab' | |||
1813 | --- assets/kb-layouts/historic/vt100.keytab 1970-01-01 00:00:00 +0000 | |||
1814 | +++ assets/kb-layouts/historic/vt100.keytab 2017-09-09 05:25:54 +0000 | |||
1815 | @@ -0,0 +1,133 @@ | |||
1816 | 1 | # [vt100.keytab] Konsole Keyboard Table (VT100 keys) | ||
1817 | 2 | # | ||
1818 | 3 | # -------------------------------------------------------------- | ||
1819 | 4 | |||
1820 | 5 | keyboard "vt100 (historical)" | ||
1821 | 6 | |||
1822 | 7 | # -------------------------------------------------------------- | ||
1823 | 8 | # | ||
1824 | 9 | # This configuration table allows to customize the | ||
1825 | 10 | # meaning of the keys. | ||
1826 | 11 | # | ||
1827 | 12 | # The syntax is that each entry has the form : | ||
1828 | 13 | # | ||
1829 | 14 | # "key" Keyname { ("+"|"-") Modename } ":" (String|Operation) | ||
1830 | 15 | # | ||
1831 | 16 | # Keynames are those defined in <qnamespace.h> with the | ||
1832 | 17 | # "Qt::Key_" removed. (We'd better insert the list here) | ||
1833 | 18 | # | ||
1834 | 19 | # Mode names are : | ||
1835 | 20 | # | ||
1836 | 21 | # - Shift | ||
1837 | 22 | # - Alt | ||
1838 | 23 | # - Control | ||
1839 | 24 | # | ||
1840 | 25 | # The VT100 emulation has two modes that can affect the | ||
1841 | 26 | # sequences emitted by certain keys. These modes are | ||
1842 | 27 | # under control of the client program. | ||
1843 | 28 | # | ||
1844 | 29 | # - Newline : effects Return and Enter key. | ||
1845 | 30 | # - Application : effects Up and Down key. | ||
1846 | 31 | # | ||
1847 | 32 | # - Ansi : effects Up and Down key (This is for VT52, really). | ||
1848 | 33 | # | ||
1849 | 34 | # Operations are | ||
1850 | 35 | # | ||
1851 | 36 | # - scrollUpLine | ||
1852 | 37 | # - scrollUpPage | ||
1853 | 38 | # - scrollDownLine | ||
1854 | 39 | # - scrollDownPage | ||
1855 | 40 | # | ||
1856 | 41 | # - emitSelection | ||
1857 | 42 | # | ||
1858 | 43 | # If the key is not found here, the text of the | ||
1859 | 44 | # key event as provided by QT is emitted, possibly | ||
1860 | 45 | # preceeded by ESC if the Alt key is pressed. | ||
1861 | 46 | # | ||
1862 | 47 | # -------------------------------------------------------------- | ||
1863 | 48 | |||
1864 | 49 | key Escape : "\E" | ||
1865 | 50 | key Tab : "\t" | ||
1866 | 51 | |||
1867 | 52 | # VT100 can add an extra \n after return. | ||
1868 | 53 | # The NewLine mode is set by an escape sequence. | ||
1869 | 54 | |||
1870 | 55 | key Return-NewLine : "\r" | ||
1871 | 56 | key Return+NewLine : "\r\n" | ||
1872 | 57 | |||
1873 | 58 | # Some desperately try to save the ^H. | ||
1874 | 59 | |||
1875 | 60 | key Backspace : "\x7f" | ||
1876 | 61 | key Delete : "\E[3~" | ||
1877 | 62 | |||
1878 | 63 | # These codes are for the VT52 mode of VT100 | ||
1879 | 64 | # The Ansi mode (i.e. VT100 mode) is set by | ||
1880 | 65 | # an escape sequence | ||
1881 | 66 | |||
1882 | 67 | key Up -Shift-Ansi : "\EA" | ||
1883 | 68 | key Down -Shift-Ansi : "\EB" | ||
1884 | 69 | key Right-Shift-Ansi : "\EC" | ||
1885 | 70 | key Left -Shift-Ansi : "\ED" | ||
1886 | 71 | |||
1887 | 72 | # VT100 emits a mode bit together | ||
1888 | 73 | # with the arrow keys.The AppCuKeys | ||
1889 | 74 | # mode is set by an escape sequence. | ||
1890 | 75 | |||
1891 | 76 | key Up -Shift+Ansi+AppCuKeys : "\EOA" | ||
1892 | 77 | key Down -Shift+Ansi+AppCuKeys : "\EOB" | ||
1893 | 78 | key Right-Shift+Ansi+AppCuKeys : "\EOC" | ||
1894 | 79 | key Left -Shift+Ansi+AppCuKeys : "\EOD" | ||
1895 | 80 | |||
1896 | 81 | key Up -Shift+Ansi-AppCuKeys : "\E[A" | ||
1897 | 82 | key Down -Shift+Ansi-AppCuKeys : "\E[B" | ||
1898 | 83 | key Right-Shift+Ansi-AppCuKeys : "\E[C" | ||
1899 | 84 | key Left -Shift+Ansi-AppCuKeys : "\E[D" | ||
1900 | 85 | |||
1901 | 86 | # function keys (FIXME: make pf1-pf4) | ||
1902 | 87 | |||
1903 | 88 | key F1 : "\E[11~" | ||
1904 | 89 | key F2 : "\E[12~" | ||
1905 | 90 | key F3 : "\E[13~" | ||
1906 | 91 | key F4 : "\E[14~" | ||
1907 | 92 | key F5 : "\E[15~" | ||
1908 | 93 | |||
1909 | 94 | key F6 : "\E[17~" | ||
1910 | 95 | key F7 : "\E[18~" | ||
1911 | 96 | key F8 : "\E[19~" | ||
1912 | 97 | key F9 : "\E[20~" | ||
1913 | 98 | key F10 : "\E[21~" | ||
1914 | 99 | key F11 : "\E[23~" | ||
1915 | 100 | key F12 : "\E[24~" | ||
1916 | 101 | |||
1917 | 102 | key Home : "\E[H" | ||
1918 | 103 | key End : "\E[F" | ||
1919 | 104 | |||
1920 | 105 | key Prior -Shift : "\E[5~" | ||
1921 | 106 | key Next -Shift : "\E[6~" | ||
1922 | 107 | key Insert-Shift : "\E[2~" | ||
1923 | 108 | |||
1924 | 109 | # Keypad-Enter. See comment on Return above. | ||
1925 | 110 | |||
1926 | 111 | key Enter+NewLine : "\r\n" | ||
1927 | 112 | key Enter-NewLine : "\r" | ||
1928 | 113 | |||
1929 | 114 | key Space +Control : "\x00" | ||
1930 | 115 | |||
1931 | 116 | # some of keys are used by konsole. | ||
1932 | 117 | |||
1933 | 118 | key Up +Shift : scrollLineUp | ||
1934 | 119 | key Prior +Shift : scrollPageUp | ||
1935 | 120 | key Down +Shift : scrollLineDown | ||
1936 | 121 | key Next +Shift : scrollPageDown | ||
1937 | 122 | |||
1938 | 123 | key ScrollLock : scrollLock | ||
1939 | 124 | |||
1940 | 125 | |||
1941 | 126 | #---------------------------------------------------------- | ||
1942 | 127 | |||
1943 | 128 | # keypad characters as offered by Qt | ||
1944 | 129 | # cannot be recognized as such. | ||
1945 | 130 | |||
1946 | 131 | #---------------------------------------------------------- | ||
1947 | 132 | |||
1948 | 133 | # Following other strings as emitted by konsole. | ||
1949 | 0 | 134 | ||
1950 | === added file 'assets/kb-layouts/historic/x11r5.keytab' | |||
1951 | --- assets/kb-layouts/historic/x11r5.keytab 1970-01-01 00:00:00 +0000 | |||
1952 | +++ assets/kb-layouts/historic/x11r5.keytab 2017-09-09 05:25:54 +0000 | |||
1953 | @@ -0,0 +1,71 @@ | |||
1954 | 1 | # [x11r5.Keytab] Keyboard Table for X11 R5 | ||
1955 | 2 | |||
1956 | 3 | keyboard "XTerm (XFree 3.x.x)" | ||
1957 | 4 | |||
1958 | 5 | # -------------------------------------------------------------- | ||
1959 | 6 | # | ||
1960 | 7 | # Note that this particular table is a "risc" version made to | ||
1961 | 8 | # ease customization without bothering with obsolete details. | ||
1962 | 9 | # See VT100.keytab for the more hairy stuff. | ||
1963 | 10 | # | ||
1964 | 11 | # -------------------------------------------------------------- | ||
1965 | 12 | |||
1966 | 13 | # common keys | ||
1967 | 14 | |||
1968 | 15 | key Escape : "\E" | ||
1969 | 16 | key Tab : "\t" | ||
1970 | 17 | |||
1971 | 18 | key Return : "\r" | ||
1972 | 19 | |||
1973 | 20 | # Backspace and Delete codes are preserving CTRL-H. | ||
1974 | 21 | |||
1975 | 22 | key Backspace : "\x7f" | ||
1976 | 23 | |||
1977 | 24 | # cursor keys | ||
1978 | 25 | |||
1979 | 26 | key Up -Shift : "\EOA" | ||
1980 | 27 | key Down -Shift : "\EOB" | ||
1981 | 28 | key Right -Shift : "\EOC" | ||
1982 | 29 | key Left -Shift : "\EOD" | ||
1983 | 30 | |||
1984 | 31 | # other grey PC keys | ||
1985 | 32 | |||
1986 | 33 | key Enter : "\r" | ||
1987 | 34 | |||
1988 | 35 | key Home : "\E[1~" | ||
1989 | 36 | key Insert-Shift : "\E[2~" | ||
1990 | 37 | key Delete : "\E[3~" | ||
1991 | 38 | key End : "\E[4~" | ||
1992 | 39 | key Prior -Shift : "\E[5~" | ||
1993 | 40 | key Next -Shift : "\E[6~" | ||
1994 | 41 | |||
1995 | 42 | # function keys | ||
1996 | 43 | |||
1997 | 44 | key F1 : "\E[11~" | ||
1998 | 45 | key F2 : "\E[12~" | ||
1999 | 46 | key F3 : "\E[13~" | ||
2000 | 47 | key F4 : "\E[14~" | ||
2001 | 48 | key F5 : "\E[15~" | ||
2002 | 49 | key F6 : "\E[17~" | ||
2003 | 50 | key F7 : "\E[18~" | ||
2004 | 51 | key F8 : "\E[19~" | ||
2005 | 52 | key F9 : "\E[20~" | ||
2006 | 53 | key F10 : "\E[21~" | ||
2007 | 54 | key F11 : "\E[23~" | ||
2008 | 55 | key F12 : "\E[24~" | ||
2009 | 56 | |||
2010 | 57 | # Work around dead keys | ||
2011 | 58 | |||
2012 | 59 | key Space +Control : "\x00" | ||
2013 | 60 | |||
2014 | 61 | # Some keys are used by konsole to cause operations. | ||
2015 | 62 | # The scroll* operations refer to the history buffer. | ||
2016 | 63 | |||
2017 | 64 | key Up +Shift : scrollLineUp | ||
2018 | 65 | key Prior +Shift : scrollPageUp | ||
2019 | 66 | key Down +Shift : scrollLineDown | ||
2020 | 67 | key Next +Shift : scrollPageDown | ||
2021 | 68 | |||
2022 | 69 | key ScrollLock : scrollLock | ||
2023 | 70 | |||
2024 | 71 | # keypad characters are not offered differently by Qt. | ||
2025 | 0 | 72 | ||
2026 | === added file 'assets/kb-layouts/linux.keytab' | |||
2027 | --- assets/kb-layouts/linux.keytab 1970-01-01 00:00:00 +0000 | |||
2028 | +++ assets/kb-layouts/linux.keytab 2017-09-09 05:25:54 +0000 | |||
2029 | @@ -0,0 +1,164 @@ | |||
2030 | 1 | # [linux.keytab] Konsole Keyboard Table (Linux console keys) | ||
2031 | 2 | # | ||
2032 | 3 | # -------------------------------------------------------------- | ||
2033 | 4 | |||
2034 | 5 | # NOT TESTED, MAY NEED SOME CLEANUPS | ||
2035 | 6 | keyboard "Linux console" | ||
2036 | 7 | |||
2037 | 8 | # -------------------------------------------------------------- | ||
2038 | 9 | # | ||
2039 | 10 | # This configuration table allows to customize the | ||
2040 | 11 | # meaning of the keys. | ||
2041 | 12 | # | ||
2042 | 13 | # The syntax is that each entry has the form : | ||
2043 | 14 | # | ||
2044 | 15 | # "key" Keyname { ("+"|"-") Modename } ":" (String|Operation) | ||
2045 | 16 | # | ||
2046 | 17 | # Keynames are those defined in <qnamespace.h> with the | ||
2047 | 18 | # "Qt::Key_" removed. (We'd better insert the list here) | ||
2048 | 19 | # | ||
2049 | 20 | # Mode names are : | ||
2050 | 21 | # | ||
2051 | 22 | # - Shift | ||
2052 | 23 | # - Alt | ||
2053 | 24 | # - Control | ||
2054 | 25 | # | ||
2055 | 26 | # The VT100 emulation has two modes that can affect the | ||
2056 | 27 | # sequences emitted by certain keys. These modes are | ||
2057 | 28 | # under control of the client program. | ||
2058 | 29 | # | ||
2059 | 30 | # - Newline : effects Return and Enter key. | ||
2060 | 31 | # - Application : effects Up and Down key. | ||
2061 | 32 | # | ||
2062 | 33 | # - Ansi : effects Up and Down key (This is for VT52, really). | ||
2063 | 34 | # | ||
2064 | 35 | # Operations are | ||
2065 | 36 | # | ||
2066 | 37 | # - scrollUpLine | ||
2067 | 38 | # - scrollUpPage | ||
2068 | 39 | # - scrollDownLine | ||
2069 | 40 | # - scrollDownPage | ||
2070 | 41 | # | ||
2071 | 42 | # - emitSelection | ||
2072 | 43 | # | ||
2073 | 44 | # If the key is not found here, the text of the | ||
2074 | 45 | # key event as provided by QT is emitted, possibly | ||
2075 | 46 | # preceeded by ESC if the Alt key is pressed. | ||
2076 | 47 | # | ||
2077 | 48 | # -------------------------------------------------------------- | ||
2078 | 49 | |||
2079 | 50 | key Escape : "\E" | ||
2080 | 51 | key Tab : "\t" | ||
2081 | 52 | |||
2082 | 53 | # VT100 can add an extra \n after return. | ||
2083 | 54 | # The NewLine mode is set by an escape sequence. | ||
2084 | 55 | |||
2085 | 56 | key Return-NewLine : "\r" | ||
2086 | 57 | key Return+NewLine : "\r\n" | ||
2087 | 58 | |||
2088 | 59 | # Some desperately try to save the ^H. | ||
2089 | 60 | |||
2090 | 61 | key Backspace : "\x7f" | ||
2091 | 62 | key Delete : "\E[3~" | ||
2092 | 63 | |||
2093 | 64 | # These codes are for the VT52 mode of VT100 | ||
2094 | 65 | # The Ansi mode (i.e. VT100 mode) is set by | ||
2095 | 66 | # an escape sequence | ||
2096 | 67 | |||
2097 | 68 | key Up -Shift-Ansi : "\EA" | ||
2098 | 69 | key Down -Shift-Ansi : "\EB" | ||
2099 | 70 | key Right-Shift-Ansi : "\EC" | ||
2100 | 71 | key Left -Shift-Ansi : "\ED" | ||
2101 | 72 | |||
2102 | 73 | # VT100 emits a mode bit together | ||
2103 | 74 | # with the arrow keys.The AppCuKeys | ||
2104 | 75 | # mode is set by an escape sequence. | ||
2105 | 76 | |||
2106 | 77 | key Up -Shift+Ansi+AppCuKeys : "\EOA" | ||
2107 | 78 | key Down -Shift+Ansi+AppCuKeys : "\EOB" | ||
2108 | 79 | key Right-Shift+Ansi+AppCuKeys : "\EOC" | ||
2109 | 80 | key Left -Shift+Ansi+AppCuKeys : "\EOD" | ||
2110 | 81 | |||
2111 | 82 | key Up -Shift+Ansi-AppCuKeys : "\E[A" | ||
2112 | 83 | key Down -Shift+Ansi-AppCuKeys : "\E[B" | ||
2113 | 84 | key Right-Shift+Ansi-AppCuKeys : "\E[C" | ||
2114 | 85 | key Left -Shift+Ansi-AppCuKeys : "\E[D" | ||
2115 | 86 | |||
2116 | 87 | # linux functions keys F1-F5 differ from xterm | ||
2117 | 88 | |||
2118 | 89 | key F1 : "\E[[A" | ||
2119 | 90 | key F2 : "\E[[B" | ||
2120 | 91 | key F3 : "\E[[C" | ||
2121 | 92 | key F4 : "\E[[D" | ||
2122 | 93 | key F5 : "\E[[E" | ||
2123 | 94 | |||
2124 | 95 | key F6 : "\E[17~" | ||
2125 | 96 | key F7 : "\E[18~" | ||
2126 | 97 | key F8 : "\E[19~" | ||
2127 | 98 | key F9 : "\E[20~" | ||
2128 | 99 | key F10 : "\E[21~" | ||
2129 | 100 | key F11 : "\E[23~" | ||
2130 | 101 | key F12 : "\E[24~" | ||
2131 | 102 | |||
2132 | 103 | key Home : "\E[1~" | ||
2133 | 104 | key End : "\E[4~" | ||
2134 | 105 | |||
2135 | 106 | key Prior -Shift : "\E[5~" | ||
2136 | 107 | key Next -Shift : "\E[6~" | ||
2137 | 108 | key Insert-Shift : "\E[2~" | ||
2138 | 109 | |||
2139 | 110 | # Keypad-Enter. See comment on Return above. | ||
2140 | 111 | |||
2141 | 112 | key Enter+NewLine : "\r\n" | ||
2142 | 113 | key Enter-NewLine : "\r" | ||
2143 | 114 | |||
2144 | 115 | key Space +Control : "\x00" | ||
2145 | 116 | |||
2146 | 117 | # linux term ctrl seq | ||
2147 | 118 | |||
2148 | 119 | key A +Control : "\x01" | ||
2149 | 120 | key B +Control : "\x02" | ||
2150 | 121 | key C +Control : "\x03" | ||
2151 | 122 | key D +Control : "\x04" | ||
2152 | 123 | key E +Control : "\x05" | ||
2153 | 124 | key F +Control : "\x06" | ||
2154 | 125 | key G +Control : "\x07" | ||
2155 | 126 | key H +Control : "\x08" | ||
2156 | 127 | key I +Control : "\x09" | ||
2157 | 128 | key J +Control : "\x0a" | ||
2158 | 129 | key K +Control : "\x0b" | ||
2159 | 130 | key L +Control : "\x0c" | ||
2160 | 131 | key M +Control : "\x0d" | ||
2161 | 132 | key N +Control : "\x0e" | ||
2162 | 133 | key O +Control : "\x0f" | ||
2163 | 134 | key P +Control : "\x10" | ||
2164 | 135 | key Q +Control : "\x11" | ||
2165 | 136 | key R +Control : "\x12" | ||
2166 | 137 | key S +Control : "\x13" | ||
2167 | 138 | key T +Control : "\x14" | ||
2168 | 139 | key U +Control : "\x15" | ||
2169 | 140 | key V +Control : "\x16" | ||
2170 | 141 | key W +Control : "\x17" | ||
2171 | 142 | key X +Control : "\x18" | ||
2172 | 143 | key Y +Control : "\x19" | ||
2173 | 144 | key Z +Control : "\x1a" | ||
2174 | 145 | |||
2175 | 146 | |||
2176 | 147 | |||
2177 | 148 | # some of keys are used by konsole. | ||
2178 | 149 | |||
2179 | 150 | key Up +Shift : scrollLineUp | ||
2180 | 151 | key Prior +Shift : scrollPageUp | ||
2181 | 152 | key Down +Shift : scrollLineDown | ||
2182 | 153 | key Next +Shift : scrollPageDown | ||
2183 | 154 | |||
2184 | 155 | key ScrollLock : scrollLock | ||
2185 | 156 | |||
2186 | 157 | #---------------------------------------------------------- | ||
2187 | 158 | |||
2188 | 159 | # keypad characters as offered by Qt | ||
2189 | 160 | # cannot be recognized as such. | ||
2190 | 161 | |||
2191 | 162 | #---------------------------------------------------------- | ||
2192 | 163 | |||
2193 | 164 | # Following other strings as emitted by konsole. | ||
2194 | 0 | 165 | ||
2195 | === added file 'assets/kb-layouts/macbook.keytab' | |||
2196 | --- assets/kb-layouts/macbook.keytab 1970-01-01 00:00:00 +0000 | |||
2197 | +++ assets/kb-layouts/macbook.keytab 2017-09-09 05:25:54 +0000 | |||
2198 | @@ -0,0 +1,175 @@ | |||
2199 | 1 | # [README.default.Keytab] Buildin Keyboard Table | ||
2200 | 2 | # | ||
2201 | 3 | # To customize your keyboard, copy this file to something | ||
2202 | 4 | # ending with .keytab and change it to meet you needs. | ||
2203 | 5 | # Please read the README.KeyTab and the README.keyboard | ||
2204 | 6 | # in this case. | ||
2205 | 7 | # | ||
2206 | 8 | # -------------------------------------------------------------- | ||
2207 | 9 | |||
2208 | 10 | keyboard "Default (XFree 4)" | ||
2209 | 11 | |||
2210 | 12 | # -------------------------------------------------------------- | ||
2211 | 13 | # | ||
2212 | 14 | # Note that this particular table is a "risc" version made to | ||
2213 | 15 | # ease customization without bothering with obsolete details. | ||
2214 | 16 | # See VT100.keytab for the more hairy stuff. | ||
2215 | 17 | # | ||
2216 | 18 | # -------------------------------------------------------------- | ||
2217 | 19 | |||
2218 | 20 | # common keys | ||
2219 | 21 | |||
2220 | 22 | key Escape : "\x1b" | ||
2221 | 23 | |||
2222 | 24 | #key Control : "^" | ||
2223 | 25 | |||
2224 | 26 | key Tab -Shift : "\t" | ||
2225 | 27 | key Tab +Shift+Ansi : "\E[Z" | ||
2226 | 28 | key Tab +Shift-Ansi : "\t" | ||
2227 | 29 | key Backtab +Ansi : "\E[Z" | ||
2228 | 30 | key Backtab -Ansi : "\t" | ||
2229 | 31 | |||
2230 | 32 | key Return-Shift-NewLine : "\r" | ||
2231 | 33 | key Return-Shift+NewLine : "\r\n" | ||
2232 | 34 | |||
2233 | 35 | key Return+Shift : "\EOM" | ||
2234 | 36 | |||
2235 | 37 | # Backspace and Delete codes are preserving CTRL-H. | ||
2236 | 38 | |||
2237 | 39 | key Backspace : "\x7f" | ||
2238 | 40 | |||
2239 | 41 | # Arrow keys in VT52 mode | ||
2240 | 42 | # shift up/down are reserved for scrolling. | ||
2241 | 43 | # shift left/right are reserved for switching between tabs (this is hardcoded). | ||
2242 | 44 | |||
2243 | 45 | |||
2244 | 46 | # Command + C | ||
2245 | 47 | # on mac - Control=Command, Meta=Ctrl | ||
2246 | 48 | # do not use Control+C for interrupt signal - it's used for "Copy to clipboard" | ||
2247 | 49 | #key Control +C : "\x03" | ||
2248 | 50 | key Meta +C: "\x03" | ||
2249 | 51 | |||
2250 | 52 | |||
2251 | 53 | # Arrow keys in ANSI mode with Application - and Normal Cursor Mode) | ||
2252 | 54 | |||
2253 | 55 | key Up -Shift+Ansi-AppCuKeys : "\E[A" | ||
2254 | 56 | key Down -Shift+Ansi-AppCuKeys : "\E[B" | ||
2255 | 57 | key Right-Shift+Ansi-AppCuKeys : "\E[C" | ||
2256 | 58 | key Left -Shift+Ansi-AppCuKeys : "\E[D" | ||
2257 | 59 | |||
2258 | 60 | key Up -Ansi : "\E[1;*A" | ||
2259 | 61 | key Down -Ansi : "\E[1;*B" | ||
2260 | 62 | key Right -Ansi : "\E[1;*C" | ||
2261 | 63 | key Left -Ansi : "\E[1;*D" | ||
2262 | 64 | |||
2263 | 65 | #key Up -Shift-Ansi : "\EA" | ||
2264 | 66 | #key Down -Shift-Ansi : "\EB" | ||
2265 | 67 | #key Right-Shift-Ansi : "\EC" | ||
2266 | 68 | #key Left -Shift-Ansi : "\ED" | ||
2267 | 69 | |||
2268 | 70 | #key Up -Shift-AnyMod+Ansi-AppCuKeys : "\E[A" | ||
2269 | 71 | #key Down -Shift-AnyMod+Ansi-AppCuKeys : "\E[B" | ||
2270 | 72 | #key Right -Shift-AnyMod+Ansi-AppCuKeys : "\E[C" | ||
2271 | 73 | #key Left -Shift-AnyMod+Ansi-AppCuKeys : "\E[D" | ||
2272 | 74 | |||
2273 | 75 | #key Up -Shift-AnyMod+Ansi-AppCuKeys : "\EOA" | ||
2274 | 76 | #key Down -Shift-AnyMod+Ansi-AppCuKeys : "\EOB" | ||
2275 | 77 | #key Right -Shift-AnyMod+Ansi-AppCuKeys : "\EOC" | ||
2276 | 78 | #key Left -Shift-AnyMod+Ansi-AppCuKeys : "\EOD" | ||
2277 | 79 | |||
2278 | 80 | #key Up -Shift-AnyMod+Ansi : "\E[1;*A" | ||
2279 | 81 | #key Down -Shift-AnyMod+Ansi : "\E[1;*B" | ||
2280 | 82 | #key Right -Shift-AnyMod+Ansi : "\E[1;*C" | ||
2281 | 83 | #key Left -Shift-AnyMod+Ansi : "\E[1;*D" | ||
2282 | 84 | |||
2283 | 85 | # other grey PC keys | ||
2284 | 86 | |||
2285 | 87 | key Enter+NewLine : "\r\n" | ||
2286 | 88 | key Enter-NewLine : "\r" | ||
2287 | 89 | |||
2288 | 90 | key Home -AnyMod -AppCuKeys : "\E[H" | ||
2289 | 91 | key End -AnyMod -AppCuKeys : "\E[F" | ||
2290 | 92 | key Home -AnyMod +AppCuKeys : "\EOH" | ||
2291 | 93 | key End -AnyMod +AppCuKeys : "\EOF" | ||
2292 | 94 | key Home +AnyMod : "\E[1;*H" | ||
2293 | 95 | key End +AnyMod : "\E[1;*F" | ||
2294 | 96 | |||
2295 | 97 | key Insert -AnyMod : "\E[2~" | ||
2296 | 98 | key Delete -AnyMod : "\E[3~" | ||
2297 | 99 | key Insert +AnyMod : "\E[2;*~" | ||
2298 | 100 | key Delete +AnyMod : "\E[3;*~" | ||
2299 | 101 | |||
2300 | 102 | key Prior -Shift-AnyMod : "\E[5~" | ||
2301 | 103 | key Next -Shift-AnyMod : "\E[6~" | ||
2302 | 104 | key Prior -Shift+AnyMod : "\E[5;*~" | ||
2303 | 105 | key Next -Shift+AnyMod : "\E[6;*~" | ||
2304 | 106 | |||
2305 | 107 | # Function keys | ||
2306 | 108 | #key F1 -AnyMod : "\EOP" | ||
2307 | 109 | #key F2 -AnyMod : "\EOQ" | ||
2308 | 110 | #key F3 -AnyMod : "\EOR" | ||
2309 | 111 | #key F4 -AnyMod : "\EOS" | ||
2310 | 112 | #define ALT_KP_0 "\033Op" | ||
2311 | 113 | #define ALT_KP_1 "\033Oq" | ||
2312 | 114 | #define ALT_KP_2 "\033Or" | ||
2313 | 115 | #define ALT_KP_3 "\033Os" | ||
2314 | 116 | #define ALT_KP_4 "\033Ot" | ||
2315 | 117 | #define ALT_KP_5 "\033Ou" | ||
2316 | 118 | #define ALT_KP_6 "\033Ov" | ||
2317 | 119 | #define ALT_KP_7 "\033Ow" | ||
2318 | 120 | #define ALT_KP_8 "\033Ox" | ||
2319 | 121 | #define ALT_KP_9 "\033Oy" | ||
2320 | 122 | |||
2321 | 123 | key F1 -AnyMod : "\EOP" | ||
2322 | 124 | key F2 -AnyMod : "\EOQ" | ||
2323 | 125 | key F3 -AnyMod : "\EOR" | ||
2324 | 126 | key F4 -AnyMod : "\EOS" | ||
2325 | 127 | key F5 -AnyMod : "\EOT" | ||
2326 | 128 | key F6 -AnyMod : "\EOU" | ||
2327 | 129 | key F7 -AnyMod : "\EOV" | ||
2328 | 130 | key F8 -AnyMod : "\EOW" | ||
2329 | 131 | key F9 -AnyMod : "\EOX" | ||
2330 | 132 | key F10 -AnyMod : "\EOY" | ||
2331 | 133 | |||
2332 | 134 | #key F5 -AnyMod : "\E[15~" | ||
2333 | 135 | #key F6 -AnyMod : "\E[17~" | ||
2334 | 136 | #key F7 -AnyMod : "\E[18~" | ||
2335 | 137 | #key F8 -AnyMod : "\E[19~" | ||
2336 | 138 | #key F9 -AnyMod : "\E[20~" | ||
2337 | 139 | #key F10 -AnyMod : "\E[21~" | ||
2338 | 140 | #key F11 -AnyMod : "\E[23~" | ||
2339 | 141 | #key F12 -AnyMod : "\E[24~" | ||
2340 | 142 | |||
2341 | 143 | #key F1 +AnyMod : "\EO*P" | ||
2342 | 144 | #key F2 +AnyMod : "\EO*Q" | ||
2343 | 145 | #key F3 +AnyMod : "\EO*R" | ||
2344 | 146 | #key F4 +AnyMod : "\EO*S" | ||
2345 | 147 | #key F5 +AnyMod : "\E[15;*~" | ||
2346 | 148 | #key F6 +AnyMod : "\E[17;*~" | ||
2347 | 149 | #key F7 +AnyMod : "\E[18;*~" | ||
2348 | 150 | #key F8 +AnyMod : "\E[19;*~" | ||
2349 | 151 | #key F9 +AnyMod : "\E[20;*~" | ||
2350 | 152 | #key F10 +AnyMod : "\E[21;*~" | ||
2351 | 153 | #key F11 +AnyMod : "\E[23;*~" | ||
2352 | 154 | #key F12 +AnyMod : "\E[24;*~" | ||
2353 | 155 | |||
2354 | 156 | # Work around dead keys | ||
2355 | 157 | |||
2356 | 158 | key Space +Control : "\x00" | ||
2357 | 159 | |||
2358 | 160 | # Some keys are used by konsole to cause operations. | ||
2359 | 161 | # The scroll* operations refer to the history buffer. | ||
2360 | 162 | |||
2361 | 163 | key Up +Shift-AppScreen : scrollLineUp | ||
2362 | 164 | key Prior +Shift-AppScreen : scrollPageUp | ||
2363 | 165 | key Down +Shift-AppScreen : scrollLineDown | ||
2364 | 166 | key Next +Shift-AppScreen : scrollPageDown | ||
2365 | 167 | |||
2366 | 168 | #key Up +Shift : scrollLineUp | ||
2367 | 169 | #key Prior +Shift : scrollPageUp | ||
2368 | 170 | #key Down +Shift : scrollLineDown | ||
2369 | 171 | #key Next +Shift : scrollPageDown | ||
2370 | 172 | |||
2371 | 173 | key ScrollLock : scrollLock | ||
2372 | 174 | |||
2373 | 175 | # keypad characters are not offered differently by Qt. | ||
2374 | 0 | 176 | ||
2375 | === added file 'assets/kb-layouts/solaris.keytab' | |||
2376 | --- assets/kb-layouts/solaris.keytab 1970-01-01 00:00:00 +0000 | |||
2377 | +++ assets/kb-layouts/solaris.keytab 2017-09-09 05:25:54 +0000 | |||
2378 | @@ -0,0 +1,108 @@ | |||
2379 | 1 | # [solaris.keytab] Konsole Keyboard Table | ||
2380 | 2 | # | ||
2381 | 3 | |||
2382 | 4 | keyboard "Solaris console" | ||
2383 | 5 | |||
2384 | 6 | # -------------------------------------------------------------- | ||
2385 | 7 | # | ||
2386 | 8 | # This configuration table allows to customize the | ||
2387 | 9 | # meaning of the keys. | ||
2388 | 10 | # | ||
2389 | 11 | # The syntax is that each entry has the form : | ||
2390 | 12 | # | ||
2391 | 13 | # "key" Keyname { ("+"|"-") Modename } ":" (String|Operation) | ||
2392 | 14 | # | ||
2393 | 15 | # Keynames are those defined in <qnamespace.h> with the | ||
2394 | 16 | # "Qt::Key_" removed. (We'd better insert the list here) | ||
2395 | 17 | # | ||
2396 | 18 | # Mode names are : | ||
2397 | 19 | # | ||
2398 | 20 | # - Shift | ||
2399 | 21 | # - Alt | ||
2400 | 22 | # - Control | ||
2401 | 23 | # | ||
2402 | 24 | # The VT100 emulation has two modes that can affect the | ||
2403 | 25 | # sequences emitted by certain keys. These modes are | ||
2404 | 26 | # under control of the client program. | ||
2405 | 27 | # | ||
2406 | 28 | # | ||
2407 | 29 | # - Newline : effects Return and Enter key. | ||
2408 | 30 | # - Application : effects Up and Down key. | ||
2409 | 31 | # | ||
2410 | 32 | # - Ansi : effects Up and Down key (This is for VT52, really). | ||
2411 | 33 | # | ||
2412 | 34 | # Operations are | ||
2413 | 35 | # | ||
2414 | 36 | # - scrollUpLine | ||
2415 | 37 | # - scrollUpPage | ||
2416 | 38 | # - scrollDownLine | ||
2417 | 39 | # - scrollDownPage | ||
2418 | 40 | # | ||
2419 | 41 | # - emitSelection | ||
2420 | 42 | # | ||
2421 | 43 | # If the key is not found here, the text of the | ||
2422 | 44 | # key event as provided by QT is emitted, possibly | ||
2423 | 45 | # preceeded by ESC if the Alt key is pressed. | ||
2424 | 46 | # | ||
2425 | 47 | # -------------------------------------------------------------- | ||
2426 | 48 | |||
2427 | 49 | key Escape : "\E" | ||
2428 | 50 | key Tab : "\t" | ||
2429 | 51 | |||
2430 | 52 | key Return-Alt : "\r" | ||
2431 | 53 | key Return+Alt : "\E\r" | ||
2432 | 54 | |||
2433 | 55 | # Backspace and Delete codes are preserving CTRL-H. | ||
2434 | 56 | |||
2435 | 57 | key Backspace : "\x08" | ||
2436 | 58 | #key Delete : "\x7F" | ||
2437 | 59 | |||
2438 | 60 | # cursor keys | ||
2439 | 61 | |||
2440 | 62 | key Up -Shift : "\EOA" | ||
2441 | 63 | key Down -Shift : "\EOB" | ||
2442 | 64 | key Right -Shift : "\EOC" | ||
2443 | 65 | key Left -Shift : "\EOD" | ||
2444 | 66 | |||
2445 | 67 | # other grey PC keys | ||
2446 | 68 | |||
2447 | 69 | key Enter : "\r" | ||
2448 | 70 | |||
2449 | 71 | key Home : "\E[1~" | ||
2450 | 72 | key Insert-Shift : "\E[2~" | ||
2451 | 73 | key Delete : "\E[3~" | ||
2452 | 74 | key End : "\E[4~" | ||
2453 | 75 | key Prior -Shift : "\E[5~" | ||
2454 | 76 | key Next -Shift : "\E[6~" | ||
2455 | 77 | |||
2456 | 78 | # function keys | ||
2457 | 79 | |||
2458 | 80 | key F1 : "\E[11~" | ||
2459 | 81 | key F2 : "\E[12~" | ||
2460 | 82 | key F3 : "\E[13~" | ||
2461 | 83 | key F4 : "\E[14~" | ||
2462 | 84 | key F5 : "\E[15~" | ||
2463 | 85 | key F6 : "\E[17~" | ||
2464 | 86 | key F7 : "\E[18~" | ||
2465 | 87 | key F8 : "\E[19~" | ||
2466 | 88 | key F9 : "\E[20~" | ||
2467 | 89 | key F10 : "\E[21~" | ||
2468 | 90 | key F11 : "\E[23~" | ||
2469 | 91 | key F12 : "\E[24~" | ||
2470 | 92 | |||
2471 | 93 | # Work around dead keys | ||
2472 | 94 | |||
2473 | 95 | key Space +Control : "\x00" | ||
2474 | 96 | |||
2475 | 97 | # Some keys are used by konsole to cause operations. | ||
2476 | 98 | # The scroll* operations refer to the history buffer. | ||
2477 | 99 | |||
2478 | 100 | #key Left +Shift : prevSession | ||
2479 | 101 | #key Right +Shift : nextSession | ||
2480 | 102 | key Up +Shift : scrollLineUp | ||
2481 | 103 | key Prior +Shift : scrollPageUp | ||
2482 | 104 | key Down +Shift : scrollLineDown | ||
2483 | 105 | key Next +Shift : scrollPageDown | ||
2484 | 106 | #key Insert+Shift : emitSelection | ||
2485 | 107 | |||
2486 | 108 | # keypad characters are not offered differently by Qt. | ||
2487 | 0 | 109 | ||
2488 | === added file 'assets/kb-layouts/vt420pc.keytab' | |||
2489 | --- assets/kb-layouts/vt420pc.keytab 1970-01-01 00:00:00 +0000 | |||
2490 | +++ assets/kb-layouts/vt420pc.keytab 2017-09-09 05:25:54 +0000 | |||
2491 | @@ -0,0 +1,168 @@ | |||
2492 | 1 | # | ||
2493 | 2 | # NOTE: This keyboard binding is not installed because it | ||
2494 | 3 | # apparently doesn't work with actual VT420 systems | ||
2495 | 4 | # (see BUG:170220) | ||
2496 | 5 | # | ||
2497 | 6 | # [vt420pc.keytab] Konsole Keyboard Table (VT420pc keys) | ||
2498 | 7 | # adapted by ferdinand gassauer f.gassauer@aon.at | ||
2499 | 8 | # Nov 2000 | ||
2500 | 9 | # | ||
2501 | 10 | ################################################################ | ||
2502 | 11 | # | ||
2503 | 12 | # The escape sequences emmited by the | ||
2504 | 13 | # keys Shift+F1 to Shift+F12 might not fit your needs | ||
2505 | 14 | # | ||
2506 | 15 | ################# IMPORTANT NOTICE ############################# | ||
2507 | 16 | # the key bindings (Kcontrol -> look and feel -> keybindgs) | ||
2508 | 17 | # overrule the settings in this file. The key bindings might be | ||
2509 | 18 | # changed by the user WITHOUT notification of the maintainer of | ||
2510 | 19 | # the keytab file. Konsole will not work as expected by | ||
2511 | 20 | # the maintainer of the keytab file. | ||
2512 | 21 | ################################################################ | ||
2513 | 22 | # | ||
2514 | 23 | # -------------------------------------------------------------- | ||
2515 | 24 | |||
2516 | 25 | keyboard "DEC VT420 Terminal" | ||
2517 | 26 | |||
2518 | 27 | # -------------------------------------------------------------- | ||
2519 | 28 | # | ||
2520 | 29 | # This configuration table allows to customize the | ||
2521 | 30 | # meaning of the keys. | ||
2522 | 31 | # | ||
2523 | 32 | # The syntax is that each entry has the form : | ||
2524 | 33 | # | ||
2525 | 34 | # "key" Keyname { ("+"|"-") Modename } ":" (String|Operation) | ||
2526 | 35 | # | ||
2527 | 36 | # Keynames are those defined in <qnamespace.h> with the | ||
2528 | 37 | # "Qt::Key_" removed. (We'd better insert the list here) | ||
2529 | 38 | # | ||
2530 | 39 | # Mode names are : | ||
2531 | 40 | # | ||
2532 | 41 | # - Shift | ||
2533 | 42 | # - Alt | ||
2534 | 43 | # - Control | ||
2535 | 44 | # | ||
2536 | 45 | # The VT100 emulation has two modes that can affect the | ||
2537 | 46 | # sequences emitted by certain keys. These modes are | ||
2538 | 47 | # under control of the client program. | ||
2539 | 48 | # | ||
2540 | 49 | # - Newline : effects Return and Enter key. | ||
2541 | 50 | # - Application : effects Up and Down key. | ||
2542 | 51 | # | ||
2543 | 52 | # - Ansi : effects Up and Down key (This is for VT52, really). | ||
2544 | 53 | # | ||
2545 | 54 | # Operations are | ||
2546 | 55 | # | ||
2547 | 56 | # - scrollUpLine | ||
2548 | 57 | # - scrollUpPage | ||
2549 | 58 | # - scrollDownLine | ||
2550 | 59 | # - scrollDownPage | ||
2551 | 60 | # | ||
2552 | 61 | # - emitSelection | ||
2553 | 62 | # | ||
2554 | 63 | # If the key is not found here, the text of the | ||
2555 | 64 | # key event as provided by QT is emitted, possibly | ||
2556 | 65 | # preceeded by ESC if the Alt key is pressed. | ||
2557 | 66 | # | ||
2558 | 67 | # -------------------------------------------------------------- | ||
2559 | 68 | |||
2560 | 69 | key Escape : "\E" | ||
2561 | 70 | key Tab : "\t" | ||
2562 | 71 | key Backtab: "\E[Z" | ||
2563 | 72 | |||
2564 | 73 | # VT100 can add an extra \n after return. | ||
2565 | 74 | # The NewLine mode is set by an escape sequence. | ||
2566 | 75 | |||
2567 | 76 | key Return-NewLine : "\r" | ||
2568 | 77 | key Return+NewLine : "\r\n" | ||
2569 | 78 | |||
2570 | 79 | # Some desperately try to save the ^H. | ||
2571 | 80 | # may be not everyone wants this | ||
2572 | 81 | |||
2573 | 82 | key Backspace : "\x08" # Control H | ||
2574 | 83 | key Delete : "\x7f" | ||
2575 | 84 | |||
2576 | 85 | # These codes are for the VT420pc | ||
2577 | 86 | # The Ansi mode (i.e. VT100 mode) is set by | ||
2578 | 87 | # an escape sequence | ||
2579 | 88 | |||
2580 | 89 | key Up -Shift-Ansi : "\EA" | ||
2581 | 90 | key Down -Shift-Ansi : "\EB" | ||
2582 | 91 | key Right-Shift-Ansi : "\EC" | ||
2583 | 92 | key Left -Shift-Ansi : "\ED" | ||
2584 | 93 | |||
2585 | 94 | # VT100 emits a mode bit together | ||
2586 | 95 | # with the arrow keys.The AppCuKeys | ||
2587 | 96 | # mode is set by an escape sequence. | ||
2588 | 97 | |||
2589 | 98 | key Up -Shift+Ansi+AppCuKeys : "\EOA" | ||
2590 | 99 | key Down -Shift+Ansi+AppCuKeys : "\EOB" | ||
2591 | 100 | key Right-Shift+Ansi+AppCuKeys : "\EOC" | ||
2592 | 101 | key Left -Shift+Ansi+AppCuKeys : "\EOD" | ||
2593 | 102 | |||
2594 | 103 | key Up -Shift+Ansi-AppCuKeys : "\E[A" | ||
2595 | 104 | key Down -Shift+Ansi-AppCuKeys : "\E[B" | ||
2596 | 105 | key Right-Shift+Ansi-AppCuKeys : "\E[C" | ||
2597 | 106 | key Left -Shift+Ansi-AppCuKeys : "\E[D" | ||
2598 | 107 | |||
2599 | 108 | # function keys | ||
2600 | 109 | |||
2601 | 110 | key F1 -Shift : "\E[11~" | ||
2602 | 111 | key F2 -Shift : "\E[12~" | ||
2603 | 112 | key F3 -Shift : "\E[13~" | ||
2604 | 113 | key F4 -Shift : "\E[14~" | ||
2605 | 114 | key F5 -Shift : "\E[15~" | ||
2606 | 115 | key F6 -Shift : "\E[17~" | ||
2607 | 116 | key F7 -Shift : "\E[18~" | ||
2608 | 117 | key F8 -Shift : "\E[19~" | ||
2609 | 118 | key F9 -Shift : "\E[20~" | ||
2610 | 119 | key F10-Shift : "\E[21~" | ||
2611 | 120 | key F11-Shift : "\E[23~" | ||
2612 | 121 | key F12-Shift : "\E[24~" | ||
2613 | 122 | # | ||
2614 | 123 | # Shift F1-F12 | ||
2615 | 124 | # | ||
2616 | 125 | key F1 +Shift : "\E[11;2~" | ||
2617 | 126 | key F2 +Shift : "\E[12;2~" | ||
2618 | 127 | key F3 +Shift : "\E[13;2~" | ||
2619 | 128 | key F4 +Shift : "\E[14;2~" | ||
2620 | 129 | key F5 +Shift : "\E[15;2~" | ||
2621 | 130 | key F6 +Shift : "\E[17;2~" | ||
2622 | 131 | key F7 +Shift : "\E[18;2~" | ||
2623 | 132 | key F8 +Shift : "\E[19;2~" | ||
2624 | 133 | key F9 +Shift : "\E[20;2~" | ||
2625 | 134 | key F10+Shift : "\E[21;2~" | ||
2626 | 135 | key F11+Shift : "\E[23;2~" | ||
2627 | 136 | key F12+Shift : "\E[24;2~" | ||
2628 | 137 | |||
2629 | 138 | key Home : "\E[H" | ||
2630 | 139 | key End : "\E[F" | ||
2631 | 140 | |||
2632 | 141 | key Prior -Shift : "\E[5~" | ||
2633 | 142 | key Next -Shift : "\E[6~" | ||
2634 | 143 | key Insert-Shift : "\E[2~" | ||
2635 | 144 | |||
2636 | 145 | # Keypad-Enter. See comment on Return above. | ||
2637 | 146 | |||
2638 | 147 | key Enter+NewLine : "\r\n" | ||
2639 | 148 | key Enter-NewLine : "\r" | ||
2640 | 149 | |||
2641 | 150 | key Space +Control : "\x00" | ||
2642 | 151 | |||
2643 | 152 | # some of keys are used by konsole. | ||
2644 | 153 | |||
2645 | 154 | key Up +Shift : scrollLineUp | ||
2646 | 155 | key Prior +Shift : scrollPageUp | ||
2647 | 156 | key Down +Shift : scrollLineDown | ||
2648 | 157 | key Next +Shift : scrollPageDown | ||
2649 | 158 | |||
2650 | 159 | key ScrollLock : scrollLock | ||
2651 | 160 | |||
2652 | 161 | #---------------------------------------------------------- | ||
2653 | 162 | |||
2654 | 163 | # keypad characters as offered by Qt | ||
2655 | 164 | # cannot be recognized as such. | ||
2656 | 165 | |||
2657 | 166 | #---------------------------------------------------------- | ||
2658 | 167 | |||
2659 | 168 | # Following other strings as emitted by konsole. | ||
2660 | 0 | 169 | ||
2661 | === added directory 'debian' | |||
2662 | === renamed directory 'debian' => 'debian.moved' | |||
2663 | === added file 'debian/changelog' | |||
2664 | --- debian/changelog 1970-01-01 00:00:00 +0000 | |||
2665 | +++ debian/changelog 2017-09-09 05:25:54 +0000 | |||
2666 | @@ -0,0 +1,29 @@ | |||
2667 | 1 | konsole-qml-plugin (0.1.2) raring; urgency=low | ||
2668 | 2 | |||
2669 | 3 | * Fixed text display bug (LP:#1182503) | ||
2670 | 4 | |||
2671 | 5 | -- Dmitry Zagnoyko <hiroshidi@gmail.com> Mon, 10 Jun 2013 09:49:02 +0300 | ||
2672 | 6 | |||
2673 | 7 | konsole-qml-plugin (0.1.1) raring; urgency=low | ||
2674 | 8 | |||
2675 | 9 | * Fixed issue with float values of widget size | ||
2676 | 10 | * Added virtual key event for qml KSession component | ||
2677 | 11 | |||
2678 | 12 | -- Dmitry Zagnoyko <hiroshidi@gmail.com> Mon, 06 May 2013 20:11:10 +0300 | ||
2679 | 13 | |||
2680 | 14 | konsole-qml-plugin (0.1.0ubuntu1~quantal1~test2) quantal; urgency=low | ||
2681 | 15 | |||
2682 | 16 | * Added qml properties for KTerminal | ||
2683 | 17 | * Fixed visibility sope: removed konsole namespace | ||
2684 | 18 | * Added qmltypes | ||
2685 | 19 | * Fixed qml plugin path | ||
2686 | 20 | * Added KSession class | ||
2687 | 21 | |||
2688 | 22 | -- Dmitry Zagnoyko <hiroshidi@gmail.com> Sat, 20 Apr 2013 21:44:26 +0300 | ||
2689 | 23 | |||
2690 | 24 | konsole-qml-plugin (0.1.0ubuntu1~quantal1~test1) quantal; urgency=low | ||
2691 | 25 | |||
2692 | 26 | * Initial release | ||
2693 | 27 | * Ported KDE Konsole | ||
2694 | 28 | |||
2695 | 29 | -- Dmitry Zagnoyko <hiroshidi@gmail.com> Fri, 19 Apr 2013 20:22:12 +0300 | ||
2696 | 0 | 30 | ||
2697 | === added file 'debian/compat' | |||
2698 | --- debian/compat 1970-01-01 00:00:00 +0000 | |||
2699 | +++ debian/compat 2017-09-09 05:25:54 +0000 | |||
2700 | @@ -0,0 +1,1 @@ | |||
2701 | 1 | 9 | ||
2702 | 0 | 2 | ||
2703 | === added file 'debian/control' | |||
2704 | --- debian/control 1970-01-01 00:00:00 +0000 | |||
2705 | +++ debian/control 2017-09-09 05:25:54 +0000 | |||
2706 | @@ -0,0 +1,40 @@ | |||
2707 | 1 | Source: konsole-qml-plugin | ||
2708 | 2 | Section: libs | ||
2709 | 3 | Priority: optional | ||
2710 | 4 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> | ||
2711 | 5 | Build-Depends: debhelper (>= 9.0.0), | ||
2712 | 6 | # libgl1-mesa-dev | libgl-dev, | ||
2713 | 7 | # libgles2-mesa-dev | ||
2714 | 8 | qtbase5-dev, | ||
2715 | 9 | qtdeclarative5-dev, | ||
2716 | 10 | qt5-default, | ||
2717 | 11 | Standards-Version: 3.9.4 | ||
2718 | 12 | Homepage: http://konsole.kde.org/ | ||
2719 | 13 | |||
2720 | 14 | Package: qtdeclarative5-konsole-qml-plugin | ||
2721 | 15 | Architecture: any | ||
2722 | 16 | Multi-Arch: same | ||
2723 | 17 | Pre-Depends: ${misc:Pre-Depends} | ||
2724 | 18 | Depends: ${misc:Depends}, ${shlibs:Depends}, | ||
2725 | 19 | Description: KDE Konsole QML plugin - qml terminal plugin | ||
2726 | 20 | Originaly, Konsole is a terminal emulator from KDE. This is ported | ||
2727 | 21 | version and do not require KDE. | ||
2728 | 22 | . | ||
2729 | 23 | This package contains the Konsole terminal emulator plugin | ||
2730 | 24 | for Qt Qml, which offers access to terminal by KTerminal and | ||
2731 | 25 | KSession elements. KTerminal is used for displaying information | ||
2732 | 26 | given by KSession. | ||
2733 | 27 | |||
2734 | 28 | |||
2735 | 29 | #Package: konsole-qml-plugin-dbg | ||
2736 | 30 | #Priority: extra | ||
2737 | 31 | #Architecture: any | ||
2738 | 32 | #Section: debug | ||
2739 | 33 | #Depends: ${misc:Depends} | ||
2740 | 34 | #Description: KDE Konsole QML plugin debugging symbols | ||
2741 | 35 | # Originaly, Konsole is a terminal emulator from KDE. This is ported | ||
2742 | 36 | # version without KDE tails and do not require KDE. | ||
2743 | 37 | # . | ||
2744 | 38 | # This package contains the debugging symbols for the KDE Konsole | ||
2745 | 39 | # QML plugin. | ||
2746 | 40 | |||
2747 | 0 | 41 | ||
2748 | === added file 'debian/copyright' | |||
2749 | --- debian/copyright 1970-01-01 00:00:00 +0000 | |||
2750 | +++ debian/copyright 2017-09-09 05:25:54 +0000 | |||
2751 | @@ -0,0 +1,50 @@ | |||
2752 | 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/3.0/ | ||
2753 | 2 | Upstream-Name: konsole-qml-plugin | ||
2754 | 3 | Source: | ||
2755 | 4 | |||
2756 | 5 | Files: * | ||
2757 | 6 | Copyright: 2013 Dmitry Zagnoyko <hiroshidi@gmail.com> | ||
2758 | 7 | 2008 e_k <e_k@users.sourceforge.net> | ||
2759 | 8 | 2006-2008 Robert Knight <robertknight@gmail.com> | ||
2760 | 9 | 2003-2007 Oswald Buddenhagen <ossi@kde.org> | ||
2761 | 10 | 2000 Stephan Kulow <coolo@kde.org> | ||
2762 | 11 | 1997-1998 Lars Doelle <lars.doelle@on-line.de> | ||
2763 | 12 | License: GPL-3 | ||
2764 | 13 | |||
2765 | 14 | Files: debian/* | ||
2766 | 15 | Copyright: 2013 Dmitry Zagnoyko <hiroshidi@gmail.com> | ||
2767 | 16 | License: LGPL-3 | ||
2768 | 17 | |||
2769 | 18 | License: GPL-3 | ||
2770 | 19 | This package is free software; you can redistribute it and/or | ||
2771 | 20 | modify it under the terms of the GNU General Public | ||
2772 | 21 | License as published by the Free Software Foundation; either | ||
2773 | 22 | version 3 of the License. | ||
2774 | 23 | . | ||
2775 | 24 | This package is distributed in the hope that it will be useful, | ||
2776 | 25 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2777 | 26 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
2778 | 27 | General Public License for more details. | ||
2779 | 28 | . | ||
2780 | 29 | You should have received a copy of the GNU General Public License | ||
2781 | 30 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2782 | 31 | . | ||
2783 | 32 | On Debian systems, the complete text of the GNU General | ||
2784 | 33 | Public License can be found in "/usr/share/common-licenses/GPL-3". | ||
2785 | 34 | |||
2786 | 35 | License: LGPL-3 | ||
2787 | 36 | This package is free software; you can redistribute it and/or | ||
2788 | 37 | modify it under the terms of the GNU Lesser General Public | ||
2789 | 38 | License as published by the Free Software Foundation; either | ||
2790 | 39 | version 3 of the License. | ||
2791 | 40 | . | ||
2792 | 41 | This package is distributed in the hope that it will be useful, | ||
2793 | 42 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2794 | 43 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
2795 | 44 | Lesser General Public License for more details. | ||
2796 | 45 | . | ||
2797 | 46 | You should have received a copy of the GNU General Public License | ||
2798 | 47 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2799 | 48 | . | ||
2800 | 49 | On Debian systems, the complete text of the GNU Lesser General | ||
2801 | 50 | Public License can be found in "/usr/share/common-licenses/LGPL-3". | ||
2802 | 0 | 51 | ||
2803 | === added file 'debian/rules' | |||
2804 | --- debian/rules 1970-01-01 00:00:00 +0000 | |||
2805 | +++ debian/rules 2017-09-09 05:25:54 +0000 | |||
2806 | @@ -0,0 +1,21 @@ | |||
2807 | 1 | #!/usr/bin/make -f | ||
2808 | 2 | |||
2809 | 3 | # Uncomment this to turn on verbose mode. | ||
2810 | 4 | #export DH_VERBOSE=1 | ||
2811 | 5 | |||
2812 | 6 | #export CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) | ||
2813 | 7 | #export CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) | ||
2814 | 8 | #export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed | ||
2815 | 9 | |||
2816 | 10 | override_dh_auto_configure: | ||
2817 | 11 | QT_SELECT=qt5 dh_auto_configure | ||
2818 | 12 | |||
2819 | 13 | %: | ||
2820 | 14 | dh $@ --list-missing --parallel | ||
2821 | 15 | # WARN: currently, no pakgage | ||
2822 | 16 | # --dbg-package=konsole-qml-plugin-dbg | ||
2823 | 17 | |||
2824 | 18 | |||
2825 | 19 | #override_dh_builddeb: | ||
2826 | 20 | # dh_builddeb -- -Zxz | ||
2827 | 21 | |||
2828 | 0 | 22 | ||
2829 | === added directory 'debian/source' | |||
2830 | === added file 'debian/source/format' | |||
2831 | --- debian/source/format 1970-01-01 00:00:00 +0000 | |||
2832 | +++ debian/source/format 2017-09-09 05:25:54 +0000 | |||
2833 | @@ -0,0 +1,1 @@ | |||
2834 | 1 | 3.0 (native) | ||
2835 | 0 | 2 | ||
2836 | === added file 'konsole-qml-plugin.pro' | |||
2837 | --- konsole-qml-plugin.pro 1970-01-01 00:00:00 +0000 | |||
2838 | +++ konsole-qml-plugin.pro 2017-09-09 05:25:54 +0000 | |||
2839 | @@ -0,0 +1,97 @@ | |||
2840 | 1 | ######################################### | ||
2841 | 2 | ## CONFIGS | ||
2842 | 3 | ######################################### | ||
2843 | 4 | |||
2844 | 5 | TEMPLATE = lib | ||
2845 | 6 | CONFIG += qt plugin hide_symbols | ||
2846 | 7 | QT += qml quick widgets | ||
2847 | 8 | |||
2848 | 9 | DEFINES += HAVE_POSIX_OPENPT HAVE_SYS_TIME_H HAVE_UPDWTMPX | ||
2849 | 10 | |||
2850 | 11 | #MANUALY DEFINED PLATFORM | ||
2851 | 12 | DEFINES += Q_WS_UBUNTU | ||
2852 | 13 | |||
2853 | 14 | TARGET = kdekonsole | ||
2854 | 15 | PLUGIN_IMPORT_PATH = org/kde/konsole | ||
2855 | 16 | PLUGIN_ASSETS = $$PWD/assets/* | ||
2856 | 17 | |||
2857 | 18 | ######################################### | ||
2858 | 19 | ## SOURCES | ||
2859 | 20 | ######################################### | ||
2860 | 21 | |||
2861 | 22 | SOURCES += \ | ||
2862 | 23 | $$PWD/src/plugin.cpp \ | ||
2863 | 24 | $$PWD/src/Pty.cpp \ | ||
2864 | 25 | $$PWD/src/kptyprocess.cpp \ | ||
2865 | 26 | $$PWD/src/kptydevice.cpp \ | ||
2866 | 27 | $$PWD/src/kpty.cpp \ | ||
2867 | 28 | $$PWD/src/kprocess.cpp \ | ||
2868 | 29 | $$PWD/src/ShellCommand.cpp \ | ||
2869 | 30 | $$PWD/src/Vt102Emulation.cpp \ | ||
2870 | 31 | $$PWD/src/tools.cpp \ | ||
2871 | 32 | $$PWD/src/Session.cpp \ | ||
2872 | 33 | $$PWD/src/Screen.cpp \ | ||
2873 | 34 | $$PWD/src/KeyboardTranslator.cpp \ | ||
2874 | 35 | $$PWD/src/Emulation.cpp \ | ||
2875 | 36 | $$PWD/src/History.cpp \ | ||
2876 | 37 | $$PWD/src/BlockArray.cpp \ | ||
2877 | 38 | $$PWD/src/TerminalCharacterDecoder.cpp \ | ||
2878 | 39 | $$PWD/src/konsole_wcwidth.cpp \ | ||
2879 | 40 | $$PWD/src/ScreenWindow.cpp \ | ||
2880 | 41 | $$PWD/src/Filter.cpp \ | ||
2881 | 42 | $$PWD/src/ColorScheme.cpp \ | ||
2882 | 43 | $$PWD/src/TerminalDisplay.cpp \ | ||
2883 | 44 | $$PWD/src/ksession.cpp | ||
2884 | 45 | |||
2885 | 46 | HEADERS += \ | ||
2886 | 47 | $$PWD/src/plugin.h \ | ||
2887 | 48 | $$PWD/src/Pty.h \ | ||
2888 | 49 | $$PWD/src/kptyprocess.h \ | ||
2889 | 50 | $$PWD/src/kptydevice.h \ | ||
2890 | 51 | $$PWD/src/kpty.h \ | ||
2891 | 52 | $$PWD/src/kpty_p.h \ | ||
2892 | 53 | $$PWD/src/kprocess.h \ | ||
2893 | 54 | $$PWD/src/ShellCommand.h \ | ||
2894 | 55 | $$PWD/src/Vt102Emulation.h \ | ||
2895 | 56 | $$PWD/src/tools.h \ | ||
2896 | 57 | $$PWD/src/Session.h \ | ||
2897 | 58 | $$PWD/src/Screen.h \ | ||
2898 | 59 | $$PWD/src/KeyboardTranslator.h \ | ||
2899 | 60 | $$PWD/src/Emulation.h \ | ||
2900 | 61 | $$PWD/src/Character.h \ | ||
2901 | 62 | $$PWD/src/History.h \ | ||
2902 | 63 | $$PWD/src/CharacterColor.h \ | ||
2903 | 64 | $$PWD/src/BlockArray.h \ | ||
2904 | 65 | $$PWD/src/TerminalCharacterDecoder.h \ | ||
2905 | 66 | $$PWD/src/konsole_wcwidth.h \ | ||
2906 | 67 | $$PWD/src/ScreenWindow.h \ | ||
2907 | 68 | $$PWD/src/DefaultTranslatorText.h \ | ||
2908 | 69 | $$PWD/src/LineFont.h \ | ||
2909 | 70 | $$PWD/src/Filter.h \ | ||
2910 | 71 | $$PWD/src/ExtendedDefaultTranslator.h \ | ||
2911 | 72 | $$PWD/src/ColorTables.h \ | ||
2912 | 73 | $$PWD/src/ColorScheme.h \ | ||
2913 | 74 | $$PWD/src/TerminalDisplay.h \ | ||
2914 | 75 | $$PWD/src/ksession.h | ||
2915 | 76 | |||
2916 | 77 | OTHER_FILES += \ | ||
2917 | 78 | $$PWD/src/qmldir \ | ||
2918 | 79 | $$PWD/src/plugins.qmltypes | ||
2919 | 80 | |||
2920 | 81 | MOC_DIR = $$PWD/.moc | ||
2921 | 82 | OBJECTS_DIR = $$PWD/.obj | ||
2922 | 83 | |||
2923 | 84 | ######################################### | ||
2924 | 85 | ## INTALLS | ||
2925 | 86 | ######################################### | ||
2926 | 87 | |||
2927 | 88 | target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH | ||
2928 | 89 | |||
2929 | 90 | assets.files += $$PLUGIN_ASSETS | ||
2930 | 91 | assets.path += $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH | ||
2931 | 92 | |||
2932 | 93 | qmldir.files += $$PWD/src/qmldir \ | ||
2933 | 94 | $$PWD/src/plugins.qmltypes | ||
2934 | 95 | qmldir.path += $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH | ||
2935 | 96 | |||
2936 | 97 | INSTALLS += target qmldir assets | ||
2937 | 0 | 98 | ||
2938 | === added directory 'src' | |||
2939 | === renamed directory 'src' => 'src.moved' | |||
2940 | === added file 'src/BlockArray.cpp' | |||
2941 | --- src/BlockArray.cpp 1970-01-01 00:00:00 +0000 | |||
2942 | +++ src/BlockArray.cpp 2017-09-09 05:25:54 +0000 | |||
2943 | @@ -0,0 +1,377 @@ | |||
2944 | 1 | /* | ||
2945 | 2 | This file is part of Konsole, an X terminal. | ||
2946 | 3 | Copyright (C) 2000 by Stephan Kulow <coolo@kde.org> | ||
2947 | 4 | |||
2948 | 5 | Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008 | ||
2949 | 6 | |||
2950 | 7 | This program is free software; you can redistribute it and/or modify | ||
2951 | 8 | it under the terms of the GNU General Public License as published by | ||
2952 | 9 | the Free Software Foundation; either version 2 of the License, or | ||
2953 | 10 | (at your option) any later version. | ||
2954 | 11 | |||
2955 | 12 | This program is distributed in the hope that it will be useful, | ||
2956 | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2957 | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2958 | 15 | GNU General Public License for more details. | ||
2959 | 16 | |||
2960 | 17 | You should have received a copy of the GNU General Public License | ||
2961 | 18 | along with this program; if not, write to the Free Software | ||
2962 | 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
2963 | 20 | 02110-1301 USA. | ||
2964 | 21 | |||
2965 | 22 | */ | ||
2966 | 23 | |||
2967 | 24 | // Own | ||
2968 | 25 | #include "BlockArray.h" | ||
2969 | 26 | |||
2970 | 27 | #include <QtCore> | ||
2971 | 28 | |||
2972 | 29 | // System | ||
2973 | 30 | #include <assert.h> | ||
2974 | 31 | #include <sys/mman.h> | ||
2975 | 32 | #include <sys/param.h> | ||
2976 | 33 | #include <unistd.h> | ||
2977 | 34 | #include <stdio.h> | ||
2978 | 35 | |||
2979 | 36 | |||
2980 | 37 | static int blocksize = 0; | ||
2981 | 38 | |||
2982 | 39 | BlockArray::BlockArray() | ||
2983 | 40 | : size(0), | ||
2984 | 41 | current(size_t(-1)), | ||
2985 | 42 | index(size_t(-1)), | ||
2986 | 43 | lastmap(0), | ||
2987 | 44 | lastmap_index(size_t(-1)), | ||
2988 | 45 | lastblock(0), ion(-1), | ||
2989 | 46 | length(0) | ||
2990 | 47 | { | ||
2991 | 48 | // lastmap_index = index = current = size_t(-1); | ||
2992 | 49 | if (blocksize == 0) { | ||
2993 | 50 | blocksize = ((sizeof(Block) / getpagesize()) + 1) * getpagesize(); | ||
2994 | 51 | } | ||
2995 | 52 | |||
2996 | 53 | } | ||
2997 | 54 | |||
2998 | 55 | BlockArray::~BlockArray() | ||
2999 | 56 | { | ||
3000 | 57 | setHistorySize(0); | ||
3001 | 58 | assert(!lastblock); | ||
3002 | 59 | } | ||
3003 | 60 | |||
3004 | 61 | size_t BlockArray::append(Block * block) | ||
3005 | 62 | { | ||
3006 | 63 | if (!size) { | ||
3007 | 64 | return size_t(-1); | ||
3008 | 65 | } | ||
3009 | 66 | |||
3010 | 67 | ++current; | ||
3011 | 68 | if (current >= size) { | ||
3012 | 69 | current = 0; | ||
3013 | 70 | } | ||
3014 | 71 | |||
3015 | 72 | int rc; | ||
3016 | 73 | rc = lseek(ion, current * blocksize, SEEK_SET); | ||
3017 | 74 | if (rc < 0) { | ||
3018 | 75 | perror("HistoryBuffer::add.seek"); | ||
3019 | 76 | setHistorySize(0); | ||
3020 | 77 | return size_t(-1); | ||
3021 | 78 | } | ||
3022 | 79 | rc = write(ion, block, blocksize); | ||
3023 | 80 | if (rc < 0) { | ||
3024 | 81 | perror("HistoryBuffer::add.write"); | ||
3025 | 82 | setHistorySize(0); | ||
3026 | 83 | return size_t(-1); | ||
3027 | 84 | } | ||
3028 | 85 | |||
3029 | 86 | length++; | ||
3030 | 87 | if (length > size) { | ||
3031 | 88 | length = size; | ||
3032 | 89 | } | ||
3033 | 90 | |||
3034 | 91 | ++index; | ||
3035 | 92 | |||
3036 | 93 | delete block; | ||
3037 | 94 | return current; | ||
3038 | 95 | } | ||
3039 | 96 | |||
3040 | 97 | size_t BlockArray::newBlock() | ||
3041 | 98 | { | ||
3042 | 99 | if (!size) { | ||
3043 | 100 | return size_t(-1); | ||
3044 | 101 | } | ||
3045 | 102 | append(lastblock); | ||
3046 | 103 | |||
3047 | 104 | lastblock = new Block(); | ||
3048 | 105 | return index + 1; | ||
3049 | 106 | } | ||
3050 | 107 | |||
3051 | 108 | Block * BlockArray::lastBlock() const | ||
3052 | 109 | { | ||
3053 | 110 | return lastblock; | ||
3054 | 111 | } | ||
3055 | 112 | |||
3056 | 113 | bool BlockArray::has(size_t i) const | ||
3057 | 114 | { | ||
3058 | 115 | if (i == index + 1) { | ||
3059 | 116 | return true; | ||
3060 | 117 | } | ||
3061 | 118 | |||
3062 | 119 | if (i > index) { | ||
3063 | 120 | return false; | ||
3064 | 121 | } | ||
3065 | 122 | if (index - i >= length) { | ||
3066 | 123 | return false; | ||
3067 | 124 | } | ||
3068 | 125 | return true; | ||
3069 | 126 | } | ||
3070 | 127 | |||
3071 | 128 | const Block * BlockArray::at(size_t i) | ||
3072 | 129 | { | ||
3073 | 130 | if (i == index + 1) { | ||
3074 | 131 | return lastblock; | ||
3075 | 132 | } | ||
3076 | 133 | |||
3077 | 134 | if (i == lastmap_index) { | ||
3078 | 135 | return lastmap; | ||
3079 | 136 | } | ||
3080 | 137 | |||
3081 | 138 | if (i > index) { | ||
3082 | 139 | qDebug() << "BlockArray::at() i > index\n"; | ||
3083 | 140 | return 0; | ||
3084 | 141 | } | ||
3085 | 142 | |||
3086 | 143 | // if (index - i >= length) { | ||
3087 | 144 | // kDebug(1211) << "BlockArray::at() index - i >= length\n"; | ||
3088 | 145 | // return 0; | ||
3089 | 146 | // } | ||
3090 | 147 | |||
3091 | 148 | size_t j = i; // (current - (index - i) + (index/size+1)*size) % size ; | ||
3092 | 149 | |||
3093 | 150 | assert(j < size); | ||
3094 | 151 | unmap(); | ||
3095 | 152 | |||
3096 | 153 | Block * block = (Block *)mmap(0, blocksize, PROT_READ, MAP_PRIVATE, ion, j * blocksize); | ||
3097 | 154 | |||
3098 | 155 | if (block == (Block *)-1) { | ||
3099 | 156 | perror("mmap"); | ||
3100 | 157 | return 0; | ||
3101 | 158 | } | ||
3102 | 159 | |||
3103 | 160 | lastmap = block; | ||
3104 | 161 | lastmap_index = i; | ||
3105 | 162 | |||
3106 | 163 | return block; | ||
3107 | 164 | } | ||
3108 | 165 | |||
3109 | 166 | void BlockArray::unmap() | ||
3110 | 167 | { | ||
3111 | 168 | if (lastmap) { | ||
3112 | 169 | int res = munmap((char *)lastmap, blocksize); | ||
3113 | 170 | if (res < 0) { | ||
3114 | 171 | perror("munmap"); | ||
3115 | 172 | } | ||
3116 | 173 | } | ||
3117 | 174 | lastmap = 0; | ||
3118 | 175 | lastmap_index = size_t(-1); | ||
3119 | 176 | } | ||
3120 | 177 | |||
3121 | 178 | bool BlockArray::setSize(size_t newsize) | ||
3122 | 179 | { | ||
3123 | 180 | return setHistorySize(newsize * 1024 / blocksize); | ||
3124 | 181 | } | ||
3125 | 182 | |||
3126 | 183 | bool BlockArray::setHistorySize(size_t newsize) | ||
3127 | 184 | { | ||
3128 | 185 | // kDebug(1211) << "setHistorySize " << size << " " << newsize; | ||
3129 | 186 | |||
3130 | 187 | if (size == newsize) { | ||
3131 | 188 | return false; | ||
3132 | 189 | } | ||
3133 | 190 | |||
3134 | 191 | unmap(); | ||
3135 | 192 | |||
3136 | 193 | if (!newsize) { | ||
3137 | 194 | delete lastblock; | ||
3138 | 195 | lastblock = 0; | ||
3139 | 196 | if (ion >= 0) { | ||
3140 | 197 | close(ion); | ||
3141 | 198 | } | ||
3142 | 199 | ion = -1; | ||
3143 | 200 | current = size_t(-1); | ||
3144 | 201 | return true; | ||
3145 | 202 | } | ||
3146 | 203 | |||
3147 | 204 | if (!size) { | ||
3148 | 205 | FILE * tmp = tmpfile(); | ||
3149 | 206 | if (!tmp) { | ||
3150 | 207 | perror("konsole: cannot open temp file.\n"); | ||
3151 | 208 | } else { | ||
3152 | 209 | ion = dup(fileno(tmp)); | ||
3153 | 210 | if (ion<0) { | ||
3154 | 211 | perror("konsole: cannot dup temp file.\n"); | ||
3155 | 212 | fclose(tmp); | ||
3156 | 213 | } | ||
3157 | 214 | } | ||
3158 | 215 | if (ion < 0) { | ||
3159 | 216 | return false; | ||
3160 | 217 | } | ||
3161 | 218 | |||
3162 | 219 | assert(!lastblock); | ||
3163 | 220 | |||
3164 | 221 | lastblock = new Block(); | ||
3165 | 222 | size = newsize; | ||
3166 | 223 | return false; | ||
3167 | 224 | } | ||
3168 | 225 | |||
3169 | 226 | if (newsize > size) { | ||
3170 | 227 | increaseBuffer(); | ||
3171 | 228 | size = newsize; | ||
3172 | 229 | return false; | ||
3173 | 230 | } else { | ||
3174 | 231 | decreaseBuffer(newsize); | ||
3175 | 232 | ftruncate(ion, length*blocksize); | ||
3176 | 233 | size = newsize; | ||
3177 | 234 | |||
3178 | 235 | return true; | ||
3179 | 236 | } | ||
3180 | 237 | } | ||
3181 | 238 | |||
3182 | 239 | void moveBlock(FILE * fion, int cursor, int newpos, char * buffer2) | ||
3183 | 240 | { | ||
3184 | 241 | int res = fseek(fion, cursor * blocksize, SEEK_SET); | ||
3185 | 242 | if (res) { | ||
3186 | 243 | perror("fseek"); | ||
3187 | 244 | } | ||
3188 | 245 | res = fread(buffer2, blocksize, 1, fion); | ||
3189 | 246 | if (res != 1) { | ||
3190 | 247 | perror("fread"); | ||
3191 | 248 | } | ||
3192 | 249 | |||
3193 | 250 | res = fseek(fion, newpos * blocksize, SEEK_SET); | ||
3194 | 251 | if (res) { | ||
3195 | 252 | perror("fseek"); | ||
3196 | 253 | } | ||
3197 | 254 | res = fwrite(buffer2, blocksize, 1, fion); | ||
3198 | 255 | if (res != 1) { | ||
3199 | 256 | perror("fwrite"); | ||
3200 | 257 | } | ||
3201 | 258 | // printf("moving block %d to %d\n", cursor, newpos); | ||
3202 | 259 | } | ||
3203 | 260 | |||
3204 | 261 | void BlockArray::decreaseBuffer(size_t newsize) | ||
3205 | 262 | { | ||
3206 | 263 | if (index < newsize) { // still fits in whole | ||
3207 | 264 | return; | ||
3208 | 265 | } | ||
3209 | 266 | |||
3210 | 267 | int offset = (current - (newsize - 1) + size) % size; | ||
3211 | 268 | |||
3212 | 269 | if (!offset) { | ||
3213 | 270 | return; | ||
3214 | 271 | } | ||
3215 | 272 | |||
3216 | 273 | // The Block constructor could do somthing in future... | ||
3217 | 274 | char * buffer1 = new char[blocksize]; | ||
3218 | 275 | |||
3219 | 276 | FILE * fion = fdopen(dup(ion), "w+b"); | ||
3220 | 277 | if (!fion) { | ||
3221 | 278 | delete [] buffer1; | ||
3222 | 279 | perror("fdopen/dup"); | ||
3223 | 280 | return; | ||
3224 | 281 | } | ||
3225 | 282 | |||
3226 | 283 | int firstblock; | ||
3227 | 284 | if (current <= newsize) { | ||
3228 | 285 | firstblock = current + 1; | ||
3229 | 286 | } else { | ||
3230 | 287 | firstblock = 0; | ||
3231 | 288 | } | ||
3232 | 289 | |||
3233 | 290 | size_t oldpos; | ||
3234 | 291 | for (size_t i = 0, cursor=firstblock; i < newsize; i++) { | ||
3235 | 292 | oldpos = (size + cursor + offset) % size; | ||
3236 | 293 | moveBlock(fion, oldpos, cursor, buffer1); | ||
3237 | 294 | if (oldpos < newsize) { | ||
3238 | 295 | cursor = oldpos; | ||
3239 | 296 | } else { | ||
3240 | 297 | cursor++; | ||
3241 | 298 | } | ||
3242 | 299 | } | ||
3243 | 300 | |||
3244 | 301 | current = newsize - 1; | ||
3245 | 302 | length = newsize; | ||
3246 | 303 | |||
3247 | 304 | delete [] buffer1; | ||
3248 | 305 | |||
3249 | 306 | fclose(fion); | ||
3250 | 307 | |||
3251 | 308 | } | ||
3252 | 309 | |||
3253 | 310 | void BlockArray::increaseBuffer() | ||
3254 | 311 | { | ||
3255 | 312 | if (index < size) { // not even wrapped once | ||
3256 | 313 | return; | ||
3257 | 314 | } | ||
3258 | 315 | |||
3259 | 316 | int offset = (current + size + 1) % size; | ||
3260 | 317 | if (!offset) { // no moving needed | ||
3261 | 318 | return; | ||
3262 | 319 | } | ||
3263 | 320 | |||
3264 | 321 | // The Block constructor could do somthing in future... | ||
3265 | 322 | char * buffer1 = new char[blocksize]; | ||
3266 | 323 | char * buffer2 = new char[blocksize]; | ||
3267 | 324 | |||
3268 | 325 | int runs = 1; | ||
3269 | 326 | int bpr = size; // blocks per run | ||
3270 | 327 | |||
3271 | 328 | if (size % offset == 0) { | ||
3272 | 329 | bpr = size / offset; | ||
3273 | 330 | runs = offset; | ||
3274 | 331 | } | ||
3275 | 332 | |||
3276 | 333 | FILE * fion = fdopen(dup(ion), "w+b"); | ||
3277 | 334 | if (!fion) { | ||
3278 | 335 | perror("fdopen/dup"); | ||
3279 | 336 | delete [] buffer1; | ||
3280 | 337 | delete [] buffer2; | ||
3281 | 338 | return; | ||
3282 | 339 | } | ||
3283 | 340 | |||
3284 | 341 | int res; | ||
3285 | 342 | for (int i = 0; i < runs; i++) { | ||
3286 | 343 | // free one block in chain | ||
3287 | 344 | int firstblock = (offset + i) % size; | ||
3288 | 345 | res = fseek(fion, firstblock * blocksize, SEEK_SET); | ||
3289 | 346 | if (res) { | ||
3290 | 347 | perror("fseek"); | ||
3291 | 348 | } | ||
3292 | 349 | res = fread(buffer1, blocksize, 1, fion); | ||
3293 | 350 | if (res != 1) { | ||
3294 | 351 | perror("fread"); | ||
3295 | 352 | } | ||
3296 | 353 | int newpos = 0; | ||
3297 | 354 | for (int j = 1, cursor=firstblock; j < bpr; j++) { | ||
3298 | 355 | cursor = (cursor + offset) % size; | ||
3299 | 356 | newpos = (cursor - offset + size) % size; | ||
3300 | 357 | moveBlock(fion, cursor, newpos, buffer2); | ||
3301 | 358 | } | ||
3302 | 359 | res = fseek(fion, i * blocksize, SEEK_SET); | ||
3303 | 360 | if (res) { | ||
3304 | 361 | perror("fseek"); | ||
3305 | 362 | } | ||
3306 | 363 | res = fwrite(buffer1, blocksize, 1, fion); | ||
3307 | 364 | if (res != 1) { | ||
3308 | 365 | perror("fwrite"); | ||
3309 | 366 | } | ||
3310 | 367 | } | ||
3311 | 368 | current = size - 1; | ||
3312 | 369 | length = size; | ||
3313 | 370 | |||
3314 | 371 | delete [] buffer1; | ||
3315 | 372 | delete [] buffer2; | ||
3316 | 373 | |||
3317 | 374 | fclose(fion); | ||
3318 | 375 | |||
3319 | 376 | } | ||
3320 | 377 | |||
3321 | 0 | 378 | ||
3322 | === added file 'src/BlockArray.h' | |||
3323 | --- src/BlockArray.h 1970-01-01 00:00:00 +0000 | |||
3324 | +++ src/BlockArray.h 2017-09-09 05:25:54 +0000 | |||
3325 | @@ -0,0 +1,126 @@ | |||
3326 | 1 | /* | ||
3327 | 2 | This file is part of Konsole, an X terminal. | ||
3328 | 3 | Copyright (C) 2000 by Stephan Kulow <coolo@kde.org> | ||
3329 | 4 | |||
3330 | 5 | Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008 | ||
3331 | 6 | |||
3332 | 7 | This program is free software; you can redistribute it and/or modify | ||
3333 | 8 | it under the terms of the GNU General Public License as published by | ||
3334 | 9 | the Free Software Foundation; either version 2 of the License, or | ||
3335 | 10 | (at your option) any later version. | ||
3336 | 11 | |||
3337 | 12 | This program is distributed in the hope that it will be useful, | ||
3338 | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3339 | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3340 | 15 | GNU General Public License for more details. | ||
3341 | 16 | |||
3342 | 17 | You should have received a copy of the GNU General Public License | ||
3343 | 18 | along with this program; if not, write to the Free Software | ||
3344 | 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
3345 | 20 | 02110-1301 USA. | ||
3346 | 21 | */ | ||
3347 | 22 | |||
3348 | 23 | #ifndef BLOCKARRAY_H | ||
3349 | 24 | #define BLOCKARRAY_H | ||
3350 | 25 | |||
3351 | 26 | #include <unistd.h> | ||
3352 | 27 | |||
3353 | 28 | //#error Do not use in KDE 2.1 | ||
3354 | 29 | |||
3355 | 30 | #define BlockSize (1 << 12) | ||
3356 | 31 | #define ENTRIES ((BlockSize - sizeof(size_t) ) / sizeof(unsigned char)) | ||
3357 | 32 | |||
3358 | 33 | struct Block { | ||
3359 | 34 | Block() { | ||
3360 | 35 | size = 0; | ||
3361 | 36 | } | ||
3362 | 37 | unsigned char data[ENTRIES]; | ||
3363 | 38 | size_t size; | ||
3364 | 39 | }; | ||
3365 | 40 | |||
3366 | 41 | // /////////////////////////////////////////////////////// | ||
3367 | 42 | |||
3368 | 43 | class BlockArray { | ||
3369 | 44 | public: | ||
3370 | 45 | /** | ||
3371 | 46 | * Creates a history file for holding | ||
3372 | 47 | * maximal size blocks. If more blocks | ||
3373 | 48 | * are requested, then it drops earlier | ||
3374 | 49 | * added ones. | ||
3375 | 50 | */ | ||
3376 | 51 | BlockArray(); | ||
3377 | 52 | |||
3378 | 53 | /// destructor | ||
3379 | 54 | ~BlockArray(); | ||
3380 | 55 | |||
3381 | 56 | /** | ||
3382 | 57 | * adds the Block at the end of history. | ||
3383 | 58 | * This may drop other blocks. | ||
3384 | 59 | * | ||
3385 | 60 | * The ownership on the block is transfered. | ||
3386 | 61 | * An unique index number is returned for accessing | ||
3387 | 62 | * it later (if not yet dropped then) | ||
3388 | 63 | * | ||
3389 | 64 | * Note, that the block may be dropped completely | ||
3390 | 65 | * if history is turned off. | ||
3391 | 66 | */ | ||
3392 | 67 | size_t append(Block * block); | ||
3393 | 68 | |||
3394 | 69 | /** | ||
3395 | 70 | * gets the block at the index. Function may return | ||
3396 | 71 | * 0 if the block isn't available any more. | ||
3397 | 72 | * | ||
3398 | 73 | * The returned block is strictly readonly as only | ||
3399 | 74 | * maped in memory - and will be invalid on the next | ||
3400 | 75 | * operation on this class. | ||
3401 | 76 | */ | ||
3402 | 77 | const Block * at(size_t index); | ||
3403 | 78 | |||
3404 | 79 | /** | ||
3405 | 80 | * reorders blocks as needed. If newsize is null, | ||
3406 | 81 | * the history is emptied completely. The indices | ||
3407 | 82 | * returned on append won't change their semantic, | ||
3408 | 83 | * but they may not be valid after this call. | ||
3409 | 84 | */ | ||
3410 | 85 | bool setHistorySize(size_t newsize); | ||
3411 | 86 | |||
3412 | 87 | size_t newBlock(); | ||
3413 | 88 | |||
3414 | 89 | Block * lastBlock() const; | ||
3415 | 90 | |||
3416 | 91 | /** | ||
3417 | 92 | * Convenient function to set the size in KBytes | ||
3418 | 93 | * instead of blocks | ||
3419 | 94 | */ | ||
3420 | 95 | bool setSize(size_t newsize); | ||
3421 | 96 | |||
3422 | 97 | size_t len() const { | ||
3423 | 98 | return length; | ||
3424 | 99 | } | ||
3425 | 100 | |||
3426 | 101 | bool has(size_t index) const; | ||
3427 | 102 | |||
3428 | 103 | size_t getCurrent() const { | ||
3429 | 104 | return current; | ||
3430 | 105 | } | ||
3431 | 106 | |||
3432 | 107 | private: | ||
3433 | 108 | void unmap(); | ||
3434 | 109 | void increaseBuffer(); | ||
3435 | 110 | void decreaseBuffer(size_t newsize); | ||
3436 | 111 | |||
3437 | 112 | size_t size; | ||
3438 | 113 | // current always shows to the last inserted block | ||
3439 | 114 | size_t current; | ||
3440 | 115 | size_t index; | ||
3441 | 116 | |||
3442 | 117 | Block * lastmap; | ||
3443 | 118 | size_t lastmap_index; | ||
3444 | 119 | Block * lastblock; | ||
3445 | 120 | |||
3446 | 121 | int ion; | ||
3447 | 122 | size_t length; | ||
3448 | 123 | |||
3449 | 124 | }; | ||
3450 | 125 | |||
3451 | 126 | #endif | ||
3452 | 0 | 127 | ||
3453 | === added file 'src/Character.h' | |||
3454 | --- src/Character.h 1970-01-01 00:00:00 +0000 | |||
3455 | +++ src/Character.h 2017-09-09 05:25:54 +0000 | |||
3456 | @@ -0,0 +1,221 @@ | |||
3457 | 1 | /* | ||
3458 | 2 | This file is part of Konsole, KDE's terminal. | ||
3459 | 3 | |||
3460 | 4 | Copyright 2007-2008 by Robert Knight <robertknight@gmail.com> | ||
3461 | 5 | Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de> | ||
3462 | 6 | |||
3463 | 7 | This program is free software; you can redistribute it and/or modify | ||
3464 | 8 | it under the terms of the GNU General Public License as published by | ||
3465 | 9 | the Free Software Foundation; either version 2 of the License, or | ||
3466 | 10 | (at your option) any later version. | ||
3467 | 11 | |||
3468 | 12 | This program is distributed in the hope that it will be useful, | ||
3469 | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3470 | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3471 | 15 | GNU General Public License for more details. | ||
3472 | 16 | |||
3473 | 17 | You should have received a copy of the GNU General Public License | ||
3474 | 18 | along with this program; if not, write to the Free Software | ||
3475 | 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
3476 | 20 | 02110-1301 USA. | ||
3477 | 21 | */ | ||
3478 | 22 | |||
3479 | 23 | #ifndef CHARACTER_H | ||
3480 | 24 | #define CHARACTER_H | ||
3481 | 25 | |||
3482 | 26 | // Qt | ||
3483 | 27 | #include <QtCore/QHash> | ||
3484 | 28 | |||
3485 | 29 | // Local | ||
3486 | 30 | #include "CharacterColor.h" | ||
3487 | 31 | |||
3488 | 32 | typedef unsigned char LineProperty; | ||
3489 | 33 | |||
3490 | 34 | static const int LINE_DEFAULT = 0; | ||
3491 | 35 | static const int LINE_WRAPPED = (1 << 0); | ||
3492 | 36 | static const int LINE_DOUBLEWIDTH = (1 << 1); | ||
3493 | 37 | static const int LINE_DOUBLEHEIGHT = (1 << 2); | ||
3494 | 38 | |||
3495 | 39 | #define DEFAULT_RENDITION 0 | ||
3496 | 40 | #define RE_BOLD (1 << 0) | ||
3497 | 41 | #define RE_BLINK (1 << 1) | ||
3498 | 42 | #define RE_UNDERLINE (1 << 2) | ||
3499 | 43 | #define RE_REVERSE (1 << 3) // Screen only | ||
3500 | 44 | #define RE_INTENSIVE (1 << 3) // Widget only | ||
3501 | 45 | #define RE_CURSOR (1 << 4) | ||
3502 | 46 | #define RE_EXTENDED_CHAR (1 << 5) | ||
3503 | 47 | |||
3504 | 48 | /** | ||
3505 | 49 | * A single character in the terminal which consists of a unicode character | ||
3506 | 50 | * value, foreground and background colors and a set of rendition attributes | ||
3507 | 51 | * which specify how it should be drawn. | ||
3508 | 52 | */ | ||
3509 | 53 | class Character | ||
3510 | 54 | { | ||
3511 | 55 | public: | ||
3512 | 56 | /** | ||
3513 | 57 | * Constructs a new character. | ||
3514 | 58 | * | ||
3515 | 59 | * @param _c The unicode character value of this character. | ||
3516 | 60 | * @param _f The foreground color used to draw the character. | ||
3517 | 61 | * @param _b The color used to draw the character's background. | ||
3518 | 62 | * @param _r A set of rendition flags which specify how this character is to be drawn. | ||
3519 | 63 | */ | ||
3520 | 64 | inline Character(quint16 _c = ' ', | ||
3521 | 65 | CharacterColor _f = CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_FORE_COLOR), | ||
3522 | 66 | CharacterColor _b = CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR), | ||
3523 | 67 | quint8 _r = DEFAULT_RENDITION) | ||
3524 | 68 | : character(_c), rendition(_r), foregroundColor(_f), backgroundColor(_b) {} | ||
3525 | 69 | |||
3526 | 70 | union | ||
3527 | 71 | { | ||
3528 | 72 | /** The unicode character value for this character. */ | ||
3529 | 73 | quint16 character; | ||
3530 | 74 | /** | ||
3531 | 75 | * Experimental addition which allows a single Character instance to contain more than | ||
3532 | 76 | * one unicode character. | ||
3533 | 77 | * | ||
3534 | 78 | * charSequence is a hash code which can be used to look up the unicode | ||
3535 | 79 | * character sequence in the ExtendedCharTable used to create the sequence. | ||
3536 | 80 | */ | ||
3537 | 81 | quint16 charSequence; | ||
3538 | 82 | }; | ||
3539 | 83 | |||
3540 | 84 | /** A combination of RENDITION flags which specify options for drawing the character. */ | ||
3541 | 85 | quint8 rendition; | ||
3542 | 86 | |||
3543 | 87 | /** The foreground color used to draw this character. */ | ||
3544 | 88 | CharacterColor foregroundColor; | ||
3545 | 89 | /** The color used to draw this character's background. */ | ||
3546 | 90 | CharacterColor backgroundColor; | ||
3547 | 91 | |||
3548 | 92 | /** | ||
3549 | 93 | * Returns true if this character has a transparent background when | ||
3550 | 94 | * it is drawn with the specified @p palette. | ||
3551 | 95 | */ | ||
3552 | 96 | bool isTransparent(const ColorEntry* palette) const; | ||
3553 | 97 | /** | ||
3554 | 98 | * Returns true if this character should always be drawn in bold when | ||
3555 | 99 | * it is drawn with the specified @p palette, independent of whether | ||
3556 | 100 | * or not the character has the RE_BOLD rendition flag. | ||
3557 | 101 | */ | ||
3558 | 102 | ColorEntry::FontWeight fontWeight(const ColorEntry* base) const; | ||
3559 | 103 | |||
3560 | 104 | /** | ||
3561 | 105 | * returns true if the format (color, rendition flag) of the compared characters is equal | ||
3562 | 106 | */ | ||
3563 | 107 | bool equalsFormat(const Character &other) const; | ||
3564 | 108 | |||
3565 | 109 | /** | ||
3566 | 110 | * Compares two characters and returns true if they have the same unicode character value, | ||
3567 | 111 | * rendition and colors. | ||
3568 | 112 | */ | ||
3569 | 113 | friend bool operator == (const Character& a, const Character& b); | ||
3570 | 114 | /** | ||
3571 | 115 | * Compares two characters and returns true if they have different unicode character values, | ||
3572 | 116 | * renditions or colors. | ||
3573 | 117 | */ | ||
3574 | 118 | friend bool operator != (const Character& a, const Character& b); | ||
3575 | 119 | }; | ||
3576 | 120 | |||
3577 | 121 | inline bool operator == (const Character& a, const Character& b) | ||
3578 | 122 | { | ||
3579 | 123 | return a.character == b.character && | ||
3580 | 124 | a.rendition == b.rendition && | ||
3581 | 125 | a.foregroundColor == b.foregroundColor && | ||
3582 | 126 | a.backgroundColor == b.backgroundColor; | ||
3583 | 127 | } | ||
3584 | 128 | |||
3585 | 129 | inline bool operator != (const Character& a, const Character& b) | ||
3586 | 130 | { | ||
3587 | 131 | return a.character != b.character || | ||
3588 | 132 | a.rendition != b.rendition || | ||
3589 | 133 | a.foregroundColor != b.foregroundColor || | ||
3590 | 134 | a.backgroundColor != b.backgroundColor; | ||
3591 | 135 | } | ||
3592 | 136 | |||
3593 | 137 | inline bool Character::isTransparent(const ColorEntry* base) const | ||
3594 | 138 | { | ||
3595 | 139 | return ((backgroundColor._colorSpace == COLOR_SPACE_DEFAULT) && | ||
3596 | 140 | base[backgroundColor._u+0+(backgroundColor._v?BASE_COLORS:0)].transparent) | ||
3597 | 141 | || ((backgroundColor._colorSpace == COLOR_SPACE_SYSTEM) && | ||
3598 | 142 | base[backgroundColor._u+2+(backgroundColor._v?BASE_COLORS:0)].transparent); | ||
3599 | 143 | } | ||
3600 | 144 | |||
3601 | 145 | inline bool Character::equalsFormat(const Character& other) const | ||
3602 | 146 | { | ||
3603 | 147 | return | ||
3604 | 148 | backgroundColor==other.backgroundColor && | ||
3605 | 149 | foregroundColor==other.foregroundColor && | ||
3606 | 150 | rendition==other.rendition; | ||
3607 | 151 | } | ||
3608 | 152 | |||
3609 | 153 | inline ColorEntry::FontWeight Character::fontWeight(const ColorEntry* base) const | ||
3610 | 154 | { | ||
3611 | 155 | if (backgroundColor._colorSpace == COLOR_SPACE_DEFAULT) | ||
3612 | 156 | return base[backgroundColor._u+0+(backgroundColor._v?BASE_COLORS:0)].fontWeight; | ||
3613 | 157 | else if (backgroundColor._colorSpace == COLOR_SPACE_SYSTEM) | ||
3614 | 158 | return base[backgroundColor._u+2+(backgroundColor._v?BASE_COLORS:0)].fontWeight; | ||
3615 | 159 | else | ||
3616 | 160 | return ColorEntry::UseCurrentFormat; | ||
3617 | 161 | } | ||
3618 | 162 | |||
3619 | 163 | extern unsigned short vt100_graphics[32]; | ||
3620 | 164 | |||
3621 | 165 | |||
3622 | 166 | /** | ||
3623 | 167 | * A table which stores sequences of unicode characters, referenced | ||
3624 | 168 | * by hash keys. The hash key itself is the same size as a unicode | ||
3625 | 169 | * character ( ushort ) so that it can occupy the same space in | ||
3626 | 170 | * a structure. | ||
3627 | 171 | */ | ||
3628 | 172 | class ExtendedCharTable | ||
3629 | 173 | { | ||
3630 | 174 | public: | ||
3631 | 175 | /** Constructs a new character table. */ | ||
3632 | 176 | ExtendedCharTable(); | ||
3633 | 177 | ~ExtendedCharTable(); | ||
3634 | 178 | |||
3635 | 179 | /** | ||
3636 | 180 | * Adds a sequences of unicode characters to the table and returns | ||
3637 | 181 | * a hash code which can be used later to look up the sequence | ||
3638 | 182 | * using lookupExtendedChar() | ||
3639 | 183 | * | ||
3640 | 184 | * If the same sequence already exists in the table, the hash | ||
3641 | 185 | * of the existing sequence will be returned. | ||
3642 | 186 | * | ||
3643 | 187 | * @param unicodePoints An array of unicode character points | ||
3644 | 188 | * @param length Length of @p unicodePoints | ||
3645 | 189 | */ | ||
3646 | 190 | ushort createExtendedChar(ushort* unicodePoints , ushort length); | ||
3647 | 191 | /** | ||
3648 | 192 | * Looks up and returns a pointer to a sequence of unicode characters | ||
3649 | 193 | * which was added to the table using createExtendedChar(). | ||
3650 | 194 | * | ||
3651 | 195 | * @param hash The hash key returned by createExtendedChar() | ||
3652 | 196 | * @param length This variable is set to the length of the | ||
3653 | 197 | * character sequence. | ||
3654 | 198 | * | ||
3655 | 199 | * @return A unicode character sequence of size @p length. | ||
3656 | 200 | */ | ||
3657 | 201 | ushort* lookupExtendedChar(ushort hash , ushort& length) const; | ||
3658 | 202 | |||
3659 | 203 | /** The global ExtendedCharTable instance. */ | ||
3660 | 204 | static ExtendedCharTable instance; | ||
3661 | 205 | private: | ||
3662 | 206 | // calculates the hash key of a sequence of unicode points of size 'length' | ||
3663 | 207 | ushort extendedCharHash(ushort* unicodePoints , ushort length) const; | ||
3664 | 208 | // tests whether the entry in the table specified by 'hash' matches the | ||
3665 | 209 | // character sequence 'unicodePoints' of size 'length' | ||
3666 | 210 | bool extendedCharMatch(ushort hash , ushort* unicodePoints , ushort length) const; | ||
3667 | 211 | // internal, maps hash keys to character sequence buffers. The first ushort | ||
3668 | 212 | // in each value is the length of the buffer, followed by the ushorts in the buffer | ||
3669 | 213 | // themselves. | ||
3670 | 214 | QHash<ushort,ushort*> extendedCharTable; | ||
3671 | 215 | }; | ||
3672 | 216 | |||
3673 | 217 | |||
3674 | 218 | Q_DECLARE_TYPEINFO(Character, Q_MOVABLE_TYPE); | ||
3675 | 219 | |||
3676 | 220 | #endif // CHARACTER_H | ||
3677 | 221 | |||
3678 | 0 | 222 | ||
3679 | === added file 'src/CharacterColor.h' | |||
3680 | --- src/CharacterColor.h 1970-01-01 00:00:00 +0000 | |||
3681 | +++ src/CharacterColor.h 2017-09-09 05:25:54 +0000 | |||
3682 | @@ -0,0 +1,294 @@ | |||
3683 | 1 | /* | ||
3684 | 2 | This file is part of Konsole, KDE's terminal. | ||
3685 | 3 | |||
3686 | 4 | Copyright 2007-2008 by Robert Knight <robertknight@gmail.com> | ||
3687 | 5 | Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de> | ||
3688 | 6 | |||
3689 | 7 | This program is free software; you can redistribute it and/or modify | ||
3690 | 8 | it under the terms of the GNU General Public License as published by | ||
3691 | 9 | the Free Software Foundation; either version 2 of the License, or | ||
3692 | 10 | (at your option) any later version. | ||
3693 | 11 | |||
3694 | 12 | This program is distributed in the hope that it will be useful, | ||
3695 | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3696 | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3697 | 15 | GNU General Public License for more details. | ||
3698 | 16 | |||
3699 | 17 | You should have received a copy of the GNU General Public License | ||
3700 | 18 | along with this program; if not, write to the Free Software | ||
3701 | 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
3702 | 20 | 02110-1301 USA. | ||
3703 | 21 | */ | ||
3704 | 22 | |||
3705 | 23 | #ifndef CHARACTERCOLOR_H | ||
3706 | 24 | #define CHARACTERCOLOR_H | ||
3707 | 25 | |||
3708 | 26 | // Qt | ||
3709 | 27 | #include <QtGui/QColor> | ||
3710 | 28 | |||
3711 | 29 | //#include <kdemacros.h> | ||
3712 | 30 | #define KDE_NO_EXPORT | ||
3713 | 31 | |||
3714 | 32 | /** | ||
3715 | 33 | * An entry in a terminal display's color palette. | ||
3716 | 34 | * | ||
3717 | 35 | * A color palette is an array of 16 ColorEntry instances which map | ||
3718 | 36 | * system color indexes (from 0 to 15) into actual colors. | ||
3719 | 37 | * | ||
3720 | 38 | * Each entry can be set as bold, in which case any text | ||
3721 | 39 | * drawn using the color should be drawn in bold. | ||
3722 | 40 | * | ||
3723 | 41 | * Each entry can also be transparent, in which case the terminal | ||
3724 | 42 | * display should avoid drawing the background for any characters | ||
3725 | 43 | * using the entry as a background. | ||
3726 | 44 | */ | ||
3727 | 45 | class ColorEntry | ||
3728 | 46 | { | ||
3729 | 47 | public: | ||
3730 | 48 | /** Specifies the weight to use when drawing text with this color. */ | ||
3731 | 49 | enum FontWeight | ||
3732 | 50 | { | ||
3733 | 51 | /** Always draw text in this color with a bold weight. */ | ||
3734 | 52 | Bold, | ||
3735 | 53 | /** Always draw text in this color with a normal weight. */ | ||
3736 | 54 | Normal, | ||
3737 | 55 | /** | ||
3738 | 56 | * Use the current font weight set by the terminal application. | ||
3739 | 57 | * This is the default behavior. | ||
3740 | 58 | */ | ||
3741 | 59 | UseCurrentFormat | ||
3742 | 60 | }; | ||
3743 | 61 | |||
3744 | 62 | /** | ||
3745 | 63 | * Constructs a new color palette entry. | ||
3746 | 64 | * | ||
3747 | 65 | * @param c The color value for this entry. | ||
3748 | 66 | * @param tr Specifies that the color should be transparent when used as a background color. | ||
3749 | 67 | * @param weight Specifies the font weight to use when drawing text with this color. | ||
3750 | 68 | */ | ||
3751 | 69 | ColorEntry(QColor c, bool tr, FontWeight weight = UseCurrentFormat) | ||
3752 | 70 | : color(c), transparent(tr), fontWeight(weight) {} | ||
3753 | 71 | |||
3754 | 72 | /** | ||
3755 | 73 | * Constructs a new color palette entry with an undefined color, and | ||
3756 | 74 | * with the transparent and bold flags set to false. | ||
3757 | 75 | */ | ||
3758 | 76 | ColorEntry() : transparent(false), fontWeight(UseCurrentFormat) {} | ||
3759 | 77 | |||
3760 | 78 | /** | ||
3761 | 79 | * Sets the color, transparency and boldness of this color to those of @p rhs. | ||
3762 | 80 | */ | ||
3763 | 81 | void operator=(const ColorEntry& rhs) | ||
3764 | 82 | { | ||
3765 | 83 | color = rhs.color; | ||
3766 | 84 | transparent = rhs.transparent; | ||
3767 | 85 | fontWeight = rhs.fontWeight; | ||
3768 | 86 | } | ||
3769 | 87 | |||
3770 | 88 | /** The color value of this entry for display. */ | ||
3771 | 89 | QColor color; | ||
3772 | 90 | |||
3773 | 91 | /** | ||
3774 | 92 | * If true character backgrounds using this color should be transparent. | ||
3775 | 93 | * This is not applicable when the color is used to render text. | ||
3776 | 94 | */ | ||
3777 | 95 | bool transparent; | ||
3778 | 96 | /** | ||
3779 | 97 | * Specifies the font weight to use when drawing text with this color. | ||
3780 | 98 | * This is not applicable when the color is used to draw a character's background. | ||
3781 | 99 | */ | ||
3782 | 100 | FontWeight fontWeight; | ||
3783 | 101 | }; | ||
3784 | 102 | |||
3785 | 103 | |||
3786 | 104 | // Attributed Character Representations /////////////////////////////// | ||
3787 | 105 | |||
3788 | 106 | // Colors | ||
3789 | 107 | |||
3790 | 108 | #define BASE_COLORS (2+8) | ||
3791 | 109 | #define INTENSITIES 2 | ||
3792 | 110 | #define TABLE_COLORS (INTENSITIES*BASE_COLORS) | ||
3793 | 111 | |||
3794 | 112 | #define DEFAULT_FORE_COLOR 0 | ||
3795 | 113 | #define DEFAULT_BACK_COLOR 1 | ||
3796 | 114 | |||
3797 | 115 | //a standard set of colors using black text on a white background. | ||
3798 | 116 | //defined in TerminalDisplay.cpp | ||
3799 | 117 | |||
3800 | 118 | extern const ColorEntry base_color_table[TABLE_COLORS] KDE_NO_EXPORT; | ||
3801 | 119 | |||
3802 | 120 | /* CharacterColor is a union of the various color spaces. | ||
3803 | 121 | |||
3804 | 122 | Assignment is as follows: | ||
3805 | 123 | |||
3806 | 124 | Type - Space - Values | ||
3807 | 125 | |||
3808 | 126 | 0 - Undefined - u: 0, v:0 w:0 | ||
3809 | 127 | 1 - Default - u: 0..1 v:intense w:0 | ||
3810 | 128 | 2 - System - u: 0..7 v:intense w:0 | ||
3811 | 129 | 3 - Index(256) - u: 16..255 v:0 w:0 | ||
3812 | 130 | 4 - RGB - u: 0..255 v:0..256 w:0..256 | ||
3813 | 131 | |||
3814 | 132 | Default colour space has two separate colours, namely | ||
3815 | 133 | default foreground and default background colour. | ||
3816 | 134 | */ | ||
3817 | 135 | |||
3818 | 136 | #define COLOR_SPACE_UNDEFINED 0 | ||
3819 | 137 | #define COLOR_SPACE_DEFAULT 1 | ||
3820 | 138 | #define COLOR_SPACE_SYSTEM 2 | ||
3821 | 139 | #define COLOR_SPACE_256 3 | ||
3822 | 140 | #define COLOR_SPACE_RGB 4 | ||
3823 | 141 | |||
3824 | 142 | /** | ||
3825 | 143 | * Describes the color of a single character in the terminal. | ||
3826 | 144 | */ | ||
3827 | 145 | class CharacterColor | ||
3828 | 146 | { | ||
3829 | 147 | friend class Character; | ||
3830 | 148 | |||
3831 | 149 | public: | ||
3832 | 150 | /** Constructs a new CharacterColor whoose color and color space are undefined. */ | ||
3833 | 151 | CharacterColor() | ||
3834 | 152 | : _colorSpace(COLOR_SPACE_UNDEFINED), | ||
3835 | 153 | _u(0), | ||
3836 | 154 | _v(0), | ||
3837 | 155 | _w(0) | ||
3838 | 156 | {} | ||
3839 | 157 | |||
3840 | 158 | /** | ||
3841 | 159 | * Constructs a new CharacterColor using the specified @p colorSpace and with | ||
3842 | 160 | * color value @p co | ||
3843 | 161 | * | ||
3844 | 162 | * The meaning of @p co depends on the @p colorSpace used. | ||
3845 | 163 | * | ||
3846 | 164 | * TODO : Document how @p co relates to @p colorSpace | ||
3847 | 165 | * | ||
3848 | 166 | * TODO : Add documentation about available color spaces. | ||
3849 | 167 | */ | ||
3850 | 168 | CharacterColor(quint8 colorSpace, int co) | ||
3851 | 169 | : _colorSpace(colorSpace), | ||
3852 | 170 | _u(0), | ||
3853 | 171 | _v(0), | ||
3854 | 172 | _w(0) | ||
3855 | 173 | { | ||
3856 | 174 | switch (colorSpace) | ||
3857 | 175 | { | ||
3858 | 176 | case COLOR_SPACE_DEFAULT: | ||
3859 | 177 | _u = co & 1; | ||
3860 | 178 | break; | ||
3861 | 179 | case COLOR_SPACE_SYSTEM: | ||
3862 | 180 | _u = co & 7; | ||
3863 | 181 | _v = (co >> 3) & 1; | ||
3864 | 182 | break; | ||
3865 | 183 | case COLOR_SPACE_256: | ||
3866 | 184 | _u = co & 255; | ||
3867 | 185 | break; | ||
3868 | 186 | case COLOR_SPACE_RGB: | ||
3869 | 187 | _u = co >> 16; | ||
3870 | 188 | _v = co >> 8; | ||
3871 | 189 | _w = co; | ||
3872 | 190 | break; | ||
3873 | 191 | default: | ||
3874 | 192 | _colorSpace = COLOR_SPACE_UNDEFINED; | ||
3875 | 193 | } | ||
3876 | 194 | } | ||
3877 | 195 | |||
3878 | 196 | /** | ||
3879 | 197 | * Returns true if this character color entry is valid. | ||
3880 | 198 | */ | ||
3881 | 199 | bool isValid() | ||
3882 | 200 | { | ||
3883 | 201 | return _colorSpace != COLOR_SPACE_UNDEFINED; | ||
3884 | 202 | } | ||
3885 | 203 | |||
3886 | 204 | /** | ||
3887 | 205 | * Toggles the value of this color between a normal system color and the corresponding intensive | ||
3888 | 206 | * system color. | ||
3889 | 207 | * | ||
3890 | 208 | * This is only applicable if the color is using the COLOR_SPACE_DEFAULT or COLOR_SPACE_SYSTEM | ||
3891 | 209 | * color spaces. | ||
3892 | 210 | */ | ||
3893 | 211 | void toggleIntensive(); | ||
3894 | 212 | |||
3895 | 213 | /** | ||
3896 | 214 | * Returns the color within the specified color @p palette | ||
3897 | 215 | * | ||
3898 | 216 | * The @p palette is only used if this color is one of the 16 system colors, otherwise | ||
3899 | 217 | * it is ignored. | ||
3900 | 218 | */ | ||
3901 | 219 | QColor color(const ColorEntry* palette) const; | ||
3902 | 220 | |||
3903 | 221 | /** | ||
3904 | 222 | * Compares two colors and returns true if they represent the same color value and | ||
3905 | 223 | * use the same color space. | ||
3906 | 224 | */ | ||
3907 | 225 | friend bool operator == (const CharacterColor& a, const CharacterColor& b); | ||
3908 | 226 | /** | ||
3909 | 227 | * Compares two colors and returns true if they represent different color values | ||
3910 | 228 | * or use different color spaces. | ||
3911 | 229 | */ | ||
3912 | 230 | friend bool operator != (const CharacterColor& a, const CharacterColor& b); | ||
3913 | 231 | |||
3914 | 232 | private: | ||
3915 | 233 | quint8 _colorSpace; | ||
3916 | 234 | |||
3917 | 235 | // bytes storing the character color | ||
3918 | 236 | quint8 _u; | ||
3919 | 237 | quint8 _v; | ||
3920 | 238 | quint8 _w; | ||
3921 | 239 | }; | ||
3922 | 240 | |||
3923 | 241 | inline bool operator == (const CharacterColor& a, const CharacterColor& b) | ||
3924 | 242 | { | ||
3925 | 243 | return a._colorSpace == b._colorSpace && | ||
3926 | 244 | a._u == b._u && | ||
3927 | 245 | a._v == b._v && | ||
3928 | 246 | a._w == b._w; | ||
3929 | 247 | } | ||
3930 | 248 | inline bool operator != (const CharacterColor& a, const CharacterColor& b) | ||
3931 | 249 | { | ||
3932 | 250 | return !operator==(a,b); | ||
3933 | 251 | } | ||
3934 | 252 | |||
3935 | 253 | inline const QColor color256(quint8 u, const ColorEntry* base) | ||
3936 | 254 | { | ||
3937 | 255 | // 0.. 16: system colors | ||
3938 | 256 | if (u < 8) return base[u+2 ].color; u -= 8; | ||
3939 | 257 | if (u < 8) return base[u+2+BASE_COLORS].color; u -= 8; | ||
3940 | 258 | |||
3941 | 259 | // 16..231: 6x6x6 rgb color cube | ||
3942 | 260 | if (u < 216) return QColor(((u/36)%6) ? (40*((u/36)%6)+55) : 0, | ||
3943 | 261 | ((u/ 6)%6) ? (40*((u/ 6)%6)+55) : 0, | ||
3944 | 262 | ((u/ 1)%6) ? (40*((u/ 1)%6)+55) : 0); u -= 216; | ||
3945 | 263 | |||
3946 | 264 | // 232..255: gray, leaving out black and white | ||
3947 | 265 | int gray = u*10+8; return QColor(gray,gray,gray); | ||
3948 | 266 | } | ||
3949 | 267 | |||
3950 | 268 | inline QColor CharacterColor::color(const ColorEntry* base) const | ||
3951 | 269 | { | ||
3952 | 270 | switch (_colorSpace) | ||
3953 | 271 | { | ||
3954 | 272 | case COLOR_SPACE_DEFAULT: return base[_u+0+(_v?BASE_COLORS:0)].color; | ||
3955 | 273 | case COLOR_SPACE_SYSTEM: return base[_u+2+(_v?BASE_COLORS:0)].color; | ||
3956 | 274 | case COLOR_SPACE_256: return color256(_u,base); | ||
3957 | 275 | case COLOR_SPACE_RGB: return QColor(_u,_v,_w); | ||
3958 | 276 | case COLOR_SPACE_UNDEFINED: return QColor(); | ||
3959 | 277 | } | ||
3960 | 278 | |||
3961 | 279 | Q_ASSERT(false); // invalid color space | ||
3962 | 280 | |||
3963 | 281 | return QColor(); | ||
3964 | 282 | } | ||
3965 | 283 | |||
3966 | 284 | inline void CharacterColor::toggleIntensive() | ||
3967 | 285 | { | ||
3968 | 286 | if (_colorSpace == COLOR_SPACE_SYSTEM || _colorSpace == COLOR_SPACE_DEFAULT) | ||
3969 | 287 | { | ||
3970 | 288 | _v = !_v; | ||
3971 | 289 | } | ||
3972 | 290 | } | ||
3973 | 291 | |||
3974 | 292 | |||
3975 | 293 | #endif // CHARACTERCOLOR_H | ||
3976 | 294 | |||
3977 | 0 | 295 | ||
3978 | === added file 'src/ColorScheme.cpp' | |||
3979 | --- src/ColorScheme.cpp 1970-01-01 00:00:00 +0000 | |||
3980 | +++ src/ColorScheme.cpp 2017-09-09 05:25:54 +0000 | |||
3981 | @@ -0,0 +1,774 @@ | |||
3982 | 1 | /* | ||
3983 | 2 | This source file is part of Konsole, a terminal emulator. | ||
3984 | 3 | |||
3985 | 4 | Copyright 2007-2008 by Robert Knight <robertknight@gmail.com> | ||
3986 | 5 | |||
3987 | 6 | This program is free software; you can redistribute it and/or modify | ||
3988 | 7 | it under the terms of the GNU General Public License as published by | ||
3989 | 8 | the Free Software Foundation; either version 2 of the License, or | ||
3990 | 9 | (at your option) any later version. | ||
3991 | 10 | |||
3992 | 11 | This program is distributed in the hope that it will be useful, | ||
3993 | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3994 | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3995 | 14 | GNU General Public License for more details. | ||
3996 | 15 | |||
3997 | 16 | You should have received a copy of the GNU General Public License | ||
3998 | 17 | along with this program; if not, write to the Free Software | ||
3999 | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
4000 | 19 | 02110-1301 USA. | ||
4001 | 20 | */ | ||
4002 | 21 | |||
4003 | 22 | // Own | ||
4004 | 23 | #include "ColorScheme.h" | ||
4005 | 24 | #include "tools.h" | ||
4006 | 25 | |||
4007 | 26 | // Qt | ||
4008 | 27 | #include <QtGui/QBrush> | ||
4009 | 28 | #include <QtCore/QFile> | ||
4010 | 29 | #include <QtCore/QFileInfo> | ||
4011 | 30 | #include <QtDebug> | ||
4012 | 31 | #include <QSettings> | ||
4013 | 32 | #include <QDir> | ||
4014 | 33 | |||
4015 | 34 | |||
4016 | 35 | // KDE | ||
4017 | 36 | //#include <KColorScheme> | ||
4018 | 37 | //#include <KConfig> | ||
4019 | 38 | //#include <KLocale> | ||
4020 | 39 | //#include <KDebug> | ||
4021 | 40 | //#include <KConfigGroup> | ||
4022 | 41 | //#include <KStandardDirs> | ||
4023 | 42 | |||
4024 | 43 | |||
4025 | 44 | const ColorEntry ColorScheme::defaultTable[TABLE_COLORS] = | ||
4026 | 45 | // The following are almost IBM standard color codes, with some slight | ||
4027 | 46 | // gamma correction for the dim colors to compensate for bright X screens. | ||
4028 | 47 | // It contains the 8 ansiterm/xterm colors in 2 intensities. | ||
4029 | 48 | { | ||
4030 | 49 | ColorEntry( QColor(0x00,0x00,0x00), 0), ColorEntry( | ||
4031 | 50 | QColor(0xFF,0xFF,0xFF), 1), // Dfore, Dback | ||
4032 | 51 | ColorEntry( QColor(0x00,0x00,0x00), 0), ColorEntry( | ||
4033 | 52 | QColor(0xB2,0x18,0x18), 0), // Black, Red | ||
4034 | 53 | ColorEntry( QColor(0x18,0xB2,0x18), 0), ColorEntry( | ||
4035 | 54 | QColor(0xB2,0x68,0x18), 0), // Green, Yellow | ||
4036 | 55 | ColorEntry( QColor(0x18,0x18,0xB2), 0), ColorEntry( | ||
4037 | 56 | QColor(0xB2,0x18,0xB2), 0), // Blue, Magenta | ||
4038 | 57 | ColorEntry( QColor(0x18,0xB2,0xB2), 0), ColorEntry( | ||
4039 | 58 | QColor(0xB2,0xB2,0xB2), 0), // Cyan, White | ||
4040 | 59 | // intensive | ||
4041 | 60 | ColorEntry( QColor(0x00,0x00,0x00), 0), ColorEntry( | ||
4042 | 61 | QColor(0xFF,0xFF,0xFF), 1), | ||
4043 | 62 | ColorEntry( QColor(0x68,0x68,0x68), 0), ColorEntry( | ||
4044 | 63 | QColor(0xFF,0x54,0x54), 0), | ||
4045 | 64 | ColorEntry( QColor(0x54,0xFF,0x54), 0), ColorEntry( | ||
4046 | 65 | QColor(0xFF,0xFF,0x54), 0), | ||
4047 | 66 | ColorEntry( QColor(0x54,0x54,0xFF), 0), ColorEntry( | ||
4048 | 67 | QColor(0xFF,0x54,0xFF), 0), | ||
4049 | 68 | ColorEntry( QColor(0x54,0xFF,0xFF), 0), ColorEntry( | ||
4050 | 69 | QColor(0xFF,0xFF,0xFF), 0) | ||
4051 | 70 | }; | ||
4052 | 71 | |||
4053 | 72 | const char* const ColorScheme::colorNames[TABLE_COLORS] = | ||
4054 | 73 | { | ||
4055 | 74 | "Foreground", | ||
4056 | 75 | "Background", | ||
4057 | 76 | "Color0", | ||
4058 | 77 | "Color1", | ||
4059 | 78 | "Color2", | ||
4060 | 79 | "Color3", | ||
4061 | 80 | "Color4", | ||
4062 | 81 | "Color5", | ||
4063 | 82 | "Color6", | ||
4064 | 83 | "Color7", | ||
4065 | 84 | "ForegroundIntense", | ||
4066 | 85 | "BackgroundIntense", | ||
4067 | 86 | "Color0Intense", | ||
4068 | 87 | "Color1Intense", | ||
4069 | 88 | "Color2Intense", | ||
4070 | 89 | "Color3Intense", | ||
4071 | 90 | "Color4Intense", | ||
4072 | 91 | "Color5Intense", | ||
4073 | 92 | "Color6Intense", | ||
4074 | 93 | "Color7Intense" | ||
4075 | 94 | }; | ||
4076 | 95 | // dummy silently comment out the tr_NOOP | ||
4077 | 96 | #define tr_NOOP | ||
4078 | 97 | const char* const ColorScheme::translatedColorNames[TABLE_COLORS] = | ||
4079 | 98 | { | ||
4080 | 99 | tr_NOOP("Foreground"), | ||
4081 | 100 | tr_NOOP("Background"), | ||
4082 | 101 | tr_NOOP("Color 1"), | ||
4083 | 102 | tr_NOOP("Color 2"), | ||
4084 | 103 | tr_NOOP("Color 3"), | ||
4085 | 104 | tr_NOOP("Color 4"), | ||
4086 | 105 | tr_NOOP("Color 5"), | ||
4087 | 106 | tr_NOOP("Color 6"), | ||
4088 | 107 | tr_NOOP("Color 7"), | ||
4089 | 108 | tr_NOOP("Color 8"), | ||
4090 | 109 | tr_NOOP("Foreground (Intense)"), | ||
4091 | 110 | tr_NOOP("Background (Intense)"), | ||
4092 | 111 | tr_NOOP("Color 1 (Intense)"), | ||
4093 | 112 | tr_NOOP("Color 2 (Intense)"), | ||
4094 | 113 | tr_NOOP("Color 3 (Intense)"), | ||
4095 | 114 | tr_NOOP("Color 4 (Intense)"), | ||
4096 | 115 | tr_NOOP("Color 5 (Intense)"), | ||
4097 | 116 | tr_NOOP("Color 6 (Intense)"), | ||
4098 | 117 | tr_NOOP("Color 7 (Intense)"), | ||
4099 | 118 | tr_NOOP("Color 8 (Intense)") | ||
4100 | 119 | }; | ||
4101 | 120 | |||
4102 | 121 | ColorScheme::ColorScheme() | ||
4103 | 122 | { | ||
4104 | 123 | _table = 0; | ||
4105 | 124 | _randomTable = 0; | ||
4106 | 125 | _opacity = 1.0; | ||
4107 | 126 | } | ||
4108 | 127 | ColorScheme::ColorScheme(const ColorScheme& other) | ||
4109 | 128 | : _opacity(other._opacity) | ||
4110 | 129 | ,_table(0) | ||
4111 | 130 | ,_randomTable(0) | ||
4112 | 131 | { | ||
4113 | 132 | setName(other.name()); | ||
4114 | 133 | setDescription(other.description()); | ||
4115 | 134 | |||
4116 | 135 | if ( other._table != 0 ) | ||
4117 | 136 | { | ||
4118 | 137 | for ( int i = 0 ; i < TABLE_COLORS ; i++ ) | ||
4119 | 138 | setColorTableEntry(i,other._table[i]); | ||
4120 | 139 | } | ||
4121 | 140 | |||
4122 | 141 | if ( other._randomTable != 0 ) | ||
4123 | 142 | { | ||
4124 | 143 | for ( int i = 0 ; i < TABLE_COLORS ; i++ ) | ||
4125 | 144 | { | ||
4126 | 145 | const RandomizationRange& range = other._randomTable[i]; | ||
4127 | 146 | setRandomizationRange(i,range.hue,range.saturation,range.value); | ||
4128 | 147 | } | ||
4129 | 148 | } | ||
4130 | 149 | } | ||
4131 | 150 | ColorScheme::~ColorScheme() | ||
4132 | 151 | { | ||
4133 | 152 | delete[] _table; | ||
4134 | 153 | delete[] _randomTable; | ||
4135 | 154 | } | ||
4136 | 155 | |||
4137 | 156 | void ColorScheme::setDescription(const QString& description) { _description = description; } | ||
4138 | 157 | QString ColorScheme::description() const { return _description; } | ||
4139 | 158 | |||
4140 | 159 | void ColorScheme::setName(const QString& name) { _name = name; } | ||
4141 | 160 | QString ColorScheme::name() const { return _name; } | ||
4142 | 161 | |||
4143 | 162 | void ColorScheme::setColorTableEntry(int index , const ColorEntry& entry) | ||
4144 | 163 | { | ||
4145 | 164 | Q_ASSERT( index >= 0 && index < TABLE_COLORS ); | ||
4146 | 165 | |||
4147 | 166 | if ( !_table ) | ||
4148 | 167 | { | ||
4149 | 168 | _table = new ColorEntry[TABLE_COLORS]; | ||
4150 | 169 | |||
4151 | 170 | for (int i=0;i<TABLE_COLORS;i++) | ||
4152 | 171 | _table[i] = defaultTable[i]; | ||
4153 | 172 | } | ||
4154 | 173 | |||
4155 | 174 | _table[index] = entry; | ||
4156 | 175 | } | ||
4157 | 176 | ColorEntry ColorScheme::colorEntry(int index , uint randomSeed) const | ||
4158 | 177 | { | ||
4159 | 178 | Q_ASSERT( index >= 0 && index < TABLE_COLORS ); | ||
4160 | 179 | |||
4161 | 180 | if ( randomSeed != 0 ) | ||
4162 | 181 | qsrand(randomSeed); | ||
4163 | 182 | |||
4164 | 183 | ColorEntry entry = colorTable()[index]; | ||
4165 | 184 | |||
4166 | 185 | if ( randomSeed != 0 && | ||
4167 | 186 | _randomTable != 0 && | ||
4168 | 187 | !_randomTable[index].isNull() ) | ||
4169 | 188 | { | ||
4170 | 189 | const RandomizationRange& range = _randomTable[index]; | ||
4171 | 190 | |||
4172 | 191 | |||
4173 | 192 | int hueDifference = range.hue ? (qrand() % range.hue) - range.hue/2 : 0; | ||
4174 | 193 | int saturationDifference = range.saturation ? (qrand() % range.saturation) - range.saturation/2 : 0; | ||
4175 | 194 | int valueDifference = range.value ? (qrand() % range.value) - range.value/2 : 0; | ||
4176 | 195 | |||
4177 | 196 | QColor& color = entry.color; | ||
4178 | 197 | |||
4179 | 198 | int newHue = qAbs( (color.hue() + hueDifference) % MAX_HUE ); | ||
4180 | 199 | int newValue = qMin( qAbs(color.value() + valueDifference) , 255 ); | ||
4181 | 200 | int newSaturation = qMin( qAbs(color.saturation() + saturationDifference) , 255 ); | ||
4182 | 201 | |||
4183 | 202 | color.setHsv(newHue,newSaturation,newValue); | ||
4184 | 203 | } | ||
4185 | 204 | |||
4186 | 205 | return entry; | ||
4187 | 206 | } | ||
4188 | 207 | void ColorScheme::getColorTable(ColorEntry* table , uint randomSeed) const | ||
4189 | 208 | { | ||
4190 | 209 | for ( int i = 0 ; i < TABLE_COLORS ; i++ ) | ||
4191 | 210 | table[i] = colorEntry(i,randomSeed); | ||
4192 | 211 | } | ||
4193 | 212 | bool ColorScheme::randomizedBackgroundColor() const | ||
4194 | 213 | { | ||
4195 | 214 | return _randomTable == 0 ? false : !_randomTable[1].isNull(); | ||
4196 | 215 | } | ||
4197 | 216 | void ColorScheme::setRandomizedBackgroundColor(bool randomize) | ||
4198 | 217 | { | ||
4199 | 218 | // the hue of the background colour is allowed to be randomly | ||
4200 | 219 | // adjusted as much as possible. | ||
4201 | 220 | // | ||
4202 | 221 | // the value and saturation are left alone to maintain read-ability | ||
4203 | 222 | if ( randomize ) | ||
4204 | 223 | { | ||
4205 | 224 | setRandomizationRange( 1 /* background color index */ , MAX_HUE , 255 , 0 ); | ||
4206 | 225 | } | ||
4207 | 226 | else | ||
4208 | 227 | { | ||
4209 | 228 | if ( _randomTable ) | ||
4210 | 229 | setRandomizationRange( 1 /* background color index */ , 0 , 0 , 0 ); | ||
4211 | 230 | } | ||
4212 | 231 | } | ||
4213 | 232 | |||
4214 | 233 | void ColorScheme::setRandomizationRange( int index , quint16 hue , quint8 saturation , | ||
4215 | 234 | quint8 value ) | ||
4216 | 235 | { | ||
4217 | 236 | Q_ASSERT( hue <= MAX_HUE ); | ||
4218 | 237 | Q_ASSERT( index >= 0 && index < TABLE_COLORS ); | ||
4219 | 238 | |||
4220 | 239 | if ( _randomTable == 0 ) | ||
4221 | 240 | _randomTable = new RandomizationRange[TABLE_COLORS]; | ||
4222 | 241 | |||
4223 | 242 | _randomTable[index].hue = hue; | ||
4224 | 243 | _randomTable[index].value = value; | ||
4225 | 244 | _randomTable[index].saturation = saturation; | ||
4226 | 245 | } | ||
4227 | 246 | |||
4228 | 247 | const ColorEntry* ColorScheme::colorTable() const | ||
4229 | 248 | { | ||
4230 | 249 | if ( _table ) | ||
4231 | 250 | return _table; | ||
4232 | 251 | else | ||
4233 | 252 | return defaultTable; | ||
4234 | 253 | } | ||
4235 | 254 | QColor ColorScheme::foregroundColor() const | ||
4236 | 255 | { | ||
4237 | 256 | return colorTable()[0].color; | ||
4238 | 257 | } | ||
4239 | 258 | QColor ColorScheme::backgroundColor() const | ||
4240 | 259 | { | ||
4241 | 260 | return colorTable()[1].color; | ||
4242 | 261 | } | ||
4243 | 262 | bool ColorScheme::hasDarkBackground() const | ||
4244 | 263 | { | ||
4245 | 264 | // value can range from 0 - 255, with larger values indicating higher brightness. | ||
4246 | 265 | // so 127 is in the middle, anything less is deemed 'dark' | ||
4247 | 266 | return backgroundColor().value() < 127; | ||
4248 | 267 | } | ||
4249 | 268 | void ColorScheme::setOpacity(qreal opacity) { _opacity = opacity; } | ||
4250 | 269 | qreal ColorScheme::opacity() const { return _opacity; } | ||
4251 | 270 | |||
4252 | 271 | void ColorScheme::read(const QString & fileName) | ||
4253 | 272 | { | ||
4254 | 273 | QSettings s(fileName, QSettings::IniFormat); | ||
4255 | 274 | s.beginGroup("General"); | ||
4256 | 275 | |||
4257 | 276 | _description = s.value("Description", QObject::tr("Un-named Color Scheme")).toString(); | ||
4258 | 277 | _opacity = s.value("Opacity",qreal(1.0)).toDouble(); | ||
4259 | 278 | s.endGroup(); | ||
4260 | 279 | |||
4261 | 280 | for (int i=0 ; i < TABLE_COLORS ; i++) | ||
4262 | 281 | { | ||
4263 | 282 | readColorEntry(&s, i); | ||
4264 | 283 | } | ||
4265 | 284 | } | ||
4266 | 285 | #if 0 | ||
4267 | 286 | // implemented upstream - user apps | ||
4268 | 287 | void ColorScheme::read(KConfig& config) | ||
4269 | 288 | { | ||
4270 | 289 | KConfigGroup configGroup = config.group("General"); | ||
4271 | 290 | |||
4272 | 291 | QString description = configGroup.readEntry("Description", QObject::tr("Un-named Color Scheme")); | ||
4273 | 292 | |||
4274 | 293 | _description = tr(description.toUtf8()); | ||
4275 | 294 | _opacity = configGroup.readEntry("Opacity",qreal(1.0)); | ||
4276 | 295 | |||
4277 | 296 | for (int i=0 ; i < TABLE_COLORS ; i++) | ||
4278 | 297 | { | ||
4279 | 298 | readColorEntry(config,i); | ||
4280 | 299 | } | ||
4281 | 300 | } | ||
4282 | 301 | void ColorScheme::write(KConfig& config) const | ||
4283 | 302 | { | ||
4284 | 303 | KConfigGroup configGroup = config.group("General"); | ||
4285 | 304 | |||
4286 | 305 | configGroup.writeEntry("Description",_description); | ||
4287 | 306 | configGroup.writeEntry("Opacity",_opacity); | ||
4288 | 307 | |||
4289 | 308 | for (int i=0 ; i < TABLE_COLORS ; i++) | ||
4290 | 309 | { | ||
4291 | 310 | RandomizationRange random = _randomTable != 0 ? _randomTable[i] : RandomizationRange(); | ||
4292 | 311 | writeColorEntry(config,colorNameForIndex(i),colorTable()[i],random); | ||
4293 | 312 | } | ||
4294 | 313 | } | ||
4295 | 314 | #endif | ||
4296 | 315 | |||
4297 | 316 | QString ColorScheme::colorNameForIndex(int index) | ||
4298 | 317 | { | ||
4299 | 318 | Q_ASSERT( index >= 0 && index < TABLE_COLORS ); | ||
4300 | 319 | |||
4301 | 320 | return QString(colorNames[index]); | ||
4302 | 321 | } | ||
4303 | 322 | QString ColorScheme::translatedColorNameForIndex(int index) | ||
4304 | 323 | { | ||
4305 | 324 | Q_ASSERT( index >= 0 && index < TABLE_COLORS ); | ||
4306 | 325 | |||
4307 | 326 | return translatedColorNames[index]; | ||
4308 | 327 | } | ||
4309 | 328 | |||
4310 | 329 | void ColorScheme::readColorEntry(QSettings * s , int index) | ||
4311 | 330 | { | ||
4312 | 331 | s->beginGroup(colorNameForIndex(index)); | ||
4313 | 332 | |||
4314 | 333 | ColorEntry entry; | ||
4315 | 334 | |||
4316 | 335 | QStringList rgbList = s->value("Color", QStringList()).toStringList(); | ||
4317 | 336 | if (rgbList.count() != 3) | ||
4318 | 337 | { | ||
4319 | 338 | Q_ASSERT(0); | ||
4320 | 339 | } | ||
4321 | 340 | int r, g, b; | ||
4322 | 341 | r = rgbList[0].toInt(); | ||
4323 | 342 | g = rgbList[1].toInt(); | ||
4324 | 343 | b = rgbList[2].toInt(); | ||
4325 | 344 | entry.color = QColor(r, g, b); | ||
4326 | 345 | |||
4327 | 346 | entry.transparent = s->value("Transparent",false).toBool(); | ||
4328 | 347 | |||
4329 | 348 | // Deprecated key from KDE 4.0 which set 'Bold' to true to force | ||
4330 | 349 | // a color to be bold or false to use the current format | ||
4331 | 350 | // | ||
4332 | 351 | // TODO - Add a new tri-state key which allows for bold, normal or | ||
4333 | 352 | // current format | ||
4334 | 353 | if (s->contains("Bold")) | ||
4335 | 354 | entry.fontWeight = s->value("Bold",false).toBool() ? ColorEntry::Bold : | ||
4336 | 355 | ColorEntry::UseCurrentFormat; | ||
4337 | 356 | |||
4338 | 357 | quint16 hue = s->value("MaxRandomHue",0).toInt(); | ||
4339 | 358 | quint8 value = s->value("MaxRandomValue",0).toInt(); | ||
4340 | 359 | quint8 saturation = s->value("MaxRandomSaturation",0).toInt(); | ||
4341 | 360 | |||
4342 | 361 | setColorTableEntry( index , entry ); | ||
4343 | 362 | |||
4344 | 363 | if ( hue != 0 || value != 0 || saturation != 0 ) | ||
4345 | 364 | setRandomizationRange( index , hue , saturation , value ); | ||
4346 | 365 | |||
4347 | 366 | s->endGroup(); | ||
4348 | 367 | } | ||
4349 | 368 | #if 0 | ||
4350 | 369 | // implemented upstream - user apps | ||
4351 | 370 | void ColorScheme::writeColorEntry(KConfig& config , const QString& colorName, const ColorEntry& entry , const RandomizationRange& random) const | ||
4352 | 371 | { | ||
4353 | 372 | KConfigGroup configGroup(&config,colorName); | ||
4354 | 373 | |||
4355 | 374 | configGroup.writeEntry("Color",entry.color); | ||
4356 | 375 | configGroup.writeEntry("Transparency",(bool)entry.transparent); | ||
4357 | 376 | if (entry.fontWeight != ColorEntry::UseCurrentFormat) | ||
4358 | 377 | { | ||
4359 | 378 | configGroup.writeEntry("Bold",entry.fontWeight == ColorEntry::Bold); | ||
4360 | 379 | } | ||
4361 | 380 | |||
4362 | 381 | // record randomization if this color has randomization or | ||
4363 | 382 | // if one of the keys already exists | ||
4364 | 383 | if ( !random.isNull() || configGroup.hasKey("MaxRandomHue") ) | ||
4365 | 384 | { | ||
4366 | 385 | configGroup.writeEntry("MaxRandomHue",(int)random.hue); | ||
4367 | 386 | configGroup.writeEntry("MaxRandomValue",(int)random.value); | ||
4368 | 387 | configGroup.writeEntry("MaxRandomSaturation",(int)random.saturation); | ||
4369 | 388 | } | ||
4370 | 389 | } | ||
4371 | 390 | #endif | ||
4372 | 391 | |||
4373 | 392 | // | ||
4374 | 393 | // Work In Progress - A color scheme for use on KDE setups for users | ||
4375 | 394 | // with visual disabilities which means that they may have trouble | ||
4376 | 395 | // reading text with the supplied color schemes. | ||
4377 | 396 | // | ||
4378 | 397 | // This color scheme uses only the 'safe' colors defined by the | ||
4379 | 398 | // KColorScheme class. | ||
4380 | 399 | // | ||
4381 | 400 | // A complication this introduces is that each color provided by | ||
4382 | 401 | // KColorScheme is defined as a 'background' or 'foreground' color. | ||
4383 | 402 | // Only foreground colors are allowed to be used to render text and | ||
4384 | 403 | // only background colors are allowed to be used for backgrounds. | ||
4385 | 404 | // | ||
4386 | 405 | // The ColorEntry and TerminalDisplay classes do not currently | ||
4387 | 406 | // support this restriction. | ||
4388 | 407 | // | ||
4389 | 408 | // Requirements: | ||
4390 | 409 | // - A color scheme which uses only colors from the KColorScheme class | ||
4391 | 410 | // - Ability to restrict which colors the TerminalDisplay widget | ||
4392 | 411 | // uses as foreground and background color | ||
4393 | 412 | // - Make use of KGlobalSettings::allowDefaultBackgroundImages() as | ||
4394 | 413 | // a hint to determine whether this accessible color scheme should | ||
4395 | 414 | // be used by default. | ||
4396 | 415 | // | ||
4397 | 416 | // | ||
4398 | 417 | // -- Robert Knight <robertknight@gmail.com> 21/07/2007 | ||
4399 | 418 | // | ||
4400 | 419 | AccessibleColorScheme::AccessibleColorScheme() | ||
4401 | 420 | : ColorScheme() | ||
4402 | 421 | { | ||
4403 | 422 | #if 0 | ||
4404 | 423 | // It's not finished in konsole and it breaks Qt4 compilation as well | ||
4405 | 424 | // basic attributes | ||
4406 | 425 | setName("accessible"); | ||
4407 | 426 | setDescription(QObject::tr("Accessible Color Scheme")); | ||
4408 | 427 | |||
4409 | 428 | // setup colors | ||
4410 | 429 | const int ColorRoleCount = 8; | ||
4411 | 430 | |||
4412 | 431 | const KColorScheme colorScheme(QPalette::Active); | ||
4413 | 432 | |||
4414 | 433 | QBrush colors[ColorRoleCount] = | ||
4415 | 434 | { | ||
4416 | 435 | colorScheme.foreground( colorScheme.NormalText ), | ||
4417 | 436 | colorScheme.background( colorScheme.NormalBackground ), | ||
4418 | 437 | |||
4419 | 438 | colorScheme.foreground( colorScheme.InactiveText ), | ||
4420 | 439 | colorScheme.foreground( colorScheme.ActiveText ), | ||
4421 | 440 | colorScheme.foreground( colorScheme.LinkText ), | ||
4422 | 441 | colorScheme.foreground( colorScheme.VisitedText ), | ||
4423 | 442 | colorScheme.foreground( colorScheme.NegativeText ), | ||
4424 | 443 | colorScheme.foreground( colorScheme.NeutralText ) | ||
4425 | 444 | }; | ||
4426 | 445 | |||
4427 | 446 | for ( int i = 0 ; i < TABLE_COLORS ; i++ ) | ||
4428 | 447 | { | ||
4429 | 448 | ColorEntry entry; | ||
4430 | 449 | entry.color = colors[ i % ColorRoleCount ].color(); | ||
4431 | 450 | |||
4432 | 451 | setColorTableEntry( i , entry ); | ||
4433 | 452 | } | ||
4434 | 453 | #endif | ||
4435 | 454 | } | ||
4436 | 455 | |||
4437 | 456 | KDE3ColorSchemeReader::KDE3ColorSchemeReader( QIODevice* device ) : | ||
4438 | 457 | _device(device) | ||
4439 | 458 | { | ||
4440 | 459 | } | ||
4441 | 460 | ColorScheme* KDE3ColorSchemeReader::read() | ||
4442 | 461 | { | ||
4443 | 462 | Q_ASSERT( _device->openMode() == QIODevice::ReadOnly || | ||
4444 | 463 | _device->openMode() == QIODevice::ReadWrite ); | ||
4445 | 464 | |||
4446 | 465 | ColorScheme* scheme = new ColorScheme(); | ||
4447 | 466 | |||
4448 | 467 | QRegExp comment("#.*$"); | ||
4449 | 468 | while ( !_device->atEnd() ) | ||
4450 | 469 | { | ||
4451 | 470 | QString line(_device->readLine()); | ||
4452 | 471 | line.remove(comment); | ||
4453 | 472 | line = line.simplified(); | ||
4454 | 473 | |||
4455 | 474 | if ( line.isEmpty() ) | ||
4456 | 475 | continue; | ||
4457 | 476 | |||
4458 | 477 | if ( line.startsWith(QLatin1String("color")) ) | ||
4459 | 478 | { | ||
4460 | 479 | if (!readColorLine(line,scheme)) | ||
4461 | 480 | qDebug() << "Failed to read KDE 3 color scheme line" << line; | ||
4462 | 481 | } | ||
4463 | 482 | else if ( line.startsWith(QLatin1String("title")) ) | ||
4464 | 483 | { | ||
4465 | 484 | if (!readTitleLine(line,scheme)) | ||
4466 | 485 | qDebug() << "Failed to read KDE 3 color scheme title line" << line; | ||
4467 | 486 | } | ||
4468 | 487 | else | ||
4469 | 488 | { | ||
4470 | 489 | qDebug() << "KDE 3 color scheme contains an unsupported feature, '" << | ||
4471 | 490 | line << "'"; | ||
4472 | 491 | } | ||
4473 | 492 | } | ||
4474 | 493 | |||
4475 | 494 | return scheme; | ||
4476 | 495 | } | ||
4477 | 496 | bool KDE3ColorSchemeReader::readColorLine(const QString& line,ColorScheme* scheme) | ||
4478 | 497 | { | ||
4479 | 498 | QStringList list = line.split(QChar(' ')); | ||
4480 | 499 | |||
4481 | 500 | if (list.count() != 7) | ||
4482 | 501 | return false; | ||
4483 | 502 | if (list.first() != "color") | ||
4484 | 503 | return false; | ||
4485 | 504 | |||
4486 | 505 | int index = list[1].toInt(); | ||
4487 | 506 | int red = list[2].toInt(); | ||
4488 | 507 | int green = list[3].toInt(); | ||
4489 | 508 | int blue = list[4].toInt(); | ||
4490 | 509 | int transparent = list[5].toInt(); | ||
4491 | 510 | int bold = list[6].toInt(); | ||
4492 | 511 | |||
4493 | 512 | const int MAX_COLOR_VALUE = 255; | ||
4494 | 513 | |||
4495 | 514 | if( (index < 0 || index >= TABLE_COLORS ) | ||
4496 | 515 | || (red < 0 || red > MAX_COLOR_VALUE ) | ||
4497 | 516 | || (blue < 0 || blue > MAX_COLOR_VALUE ) | ||
4498 | 517 | || (green < 0 || green > MAX_COLOR_VALUE ) | ||
4499 | 518 | || (transparent != 0 && transparent != 1 ) | ||
4500 | 519 | || (bold != 0 && bold != 1) ) | ||
4501 | 520 | return false; | ||
4502 | 521 | |||
4503 | 522 | ColorEntry entry; | ||
4504 | 523 | entry.color = QColor(red,green,blue); | ||
4505 | 524 | entry.transparent = ( transparent != 0 ); | ||
4506 | 525 | entry.fontWeight = ( bold != 0 ) ? ColorEntry::Bold : ColorEntry::UseCurrentFormat; | ||
4507 | 526 | |||
4508 | 527 | scheme->setColorTableEntry(index,entry); | ||
4509 | 528 | return true; | ||
4510 | 529 | } | ||
4511 | 530 | bool KDE3ColorSchemeReader::readTitleLine(const QString& line,ColorScheme* scheme) | ||
4512 | 531 | { | ||
4513 | 532 | if( !line.startsWith(QLatin1String("title")) ) | ||
4514 | 533 | return false; | ||
4515 | 534 | |||
4516 | 535 | int spacePos = line.indexOf(' '); | ||
4517 | 536 | if( spacePos == -1 ) | ||
4518 | 537 | return false; | ||
4519 | 538 | |||
4520 | 539 | QString description = line.mid(spacePos+1); | ||
4521 | 540 | |||
4522 | 541 | scheme->setDescription(description.toUtf8()); | ||
4523 | 542 | return true; | ||
4524 | 543 | } | ||
4525 | 544 | ColorSchemeManager::ColorSchemeManager() | ||
4526 | 545 | : _haveLoadedAll(false) | ||
4527 | 546 | { | ||
4528 | 547 | } | ||
4529 | 548 | ColorSchemeManager::~ColorSchemeManager() | ||
4530 | 549 | { | ||
4531 | 550 | QHashIterator<QString,const ColorScheme*> iter(_colorSchemes); | ||
4532 | 551 | while (iter.hasNext()) | ||
4533 | 552 | { | ||
4534 | 553 | iter.next(); | ||
4535 | 554 | delete iter.value(); | ||
4536 | 555 | } | ||
4537 | 556 | } | ||
4538 | 557 | void ColorSchemeManager::loadAllColorSchemes() | ||
4539 | 558 | { | ||
4540 | 559 | qDebug() << "loadAllColorSchemes"; | ||
4541 | 560 | int success = 0; | ||
4542 | 561 | int failed = 0; | ||
4543 | 562 | |||
4544 | 563 | QList<QString> nativeColorSchemes = listColorSchemes(); | ||
4545 | 564 | |||
4546 | 565 | QListIterator<QString> nativeIter(nativeColorSchemes); | ||
4547 | 566 | while ( nativeIter.hasNext() ) | ||
4548 | 567 | { | ||
4549 | 568 | if ( loadColorScheme( nativeIter.next() ) ) | ||
4550 | 569 | success++; | ||
4551 | 570 | else | ||
4552 | 571 | failed++; | ||
4553 | 572 | } | ||
4554 | 573 | |||
4555 | 574 | QList<QString> kde3ColorSchemes = listKDE3ColorSchemes(); | ||
4556 | 575 | QListIterator<QString> kde3Iter(kde3ColorSchemes); | ||
4557 | 576 | while ( kde3Iter.hasNext() ) | ||
4558 | 577 | { | ||
4559 | 578 | if ( loadKDE3ColorScheme( kde3Iter.next() ) ) | ||
4560 | 579 | success++; | ||
4561 | 580 | else | ||
4562 | 581 | failed++; | ||
4563 | 582 | } | ||
4564 | 583 | |||
4565 | 584 | if ( failed > 0 ) | ||
4566 | 585 | qDebug() << "failed to load " << failed << " color schemes."; | ||
4567 | 586 | |||
4568 | 587 | _haveLoadedAll = true; | ||
4569 | 588 | } | ||
4570 | 589 | QList<const ColorScheme*> ColorSchemeManager::allColorSchemes() | ||
4571 | 590 | { | ||
4572 | 591 | if ( !_haveLoadedAll ) | ||
4573 | 592 | { | ||
4574 | 593 | loadAllColorSchemes(); | ||
4575 | 594 | } | ||
4576 | 595 | |||
4577 | 596 | return _colorSchemes.values(); | ||
4578 | 597 | } | ||
4579 | 598 | bool ColorSchemeManager::loadKDE3ColorScheme(const QString& filePath) | ||
4580 | 599 | { | ||
4581 | 600 | QFile file(filePath); | ||
4582 | 601 | if (!filePath.endsWith(QLatin1String(".schema")) || !file.open(QIODevice::ReadOnly)) | ||
4583 | 602 | return false; | ||
4584 | 603 | |||
4585 | 604 | KDE3ColorSchemeReader reader(&file); | ||
4586 | 605 | ColorScheme* scheme = reader.read(); | ||
4587 | 606 | scheme->setName(QFileInfo(file).baseName()); | ||
4588 | 607 | file.close(); | ||
4589 | 608 | |||
4590 | 609 | if (scheme->name().isEmpty()) | ||
4591 | 610 | { | ||
4592 | 611 | qDebug() << "color scheme name is not valid."; | ||
4593 | 612 | delete scheme; | ||
4594 | 613 | return false; | ||
4595 | 614 | } | ||
4596 | 615 | |||
4597 | 616 | QFileInfo info(filePath); | ||
4598 | 617 | |||
4599 | 618 | if ( !_colorSchemes.contains(info.baseName()) ) | ||
4600 | 619 | _colorSchemes.insert(scheme->name(),scheme); | ||
4601 | 620 | else | ||
4602 | 621 | { | ||
4603 | 622 | qDebug() << "color scheme with name" << scheme->name() << "has already been" << | ||
4604 | 623 | "found, ignoring."; | ||
4605 | 624 | delete scheme; | ||
4606 | 625 | } | ||
4607 | 626 | |||
4608 | 627 | return true; | ||
4609 | 628 | } | ||
4610 | 629 | #if 0 | ||
4611 | 630 | void ColorSchemeManager::addColorScheme(ColorScheme* scheme) | ||
4612 | 631 | { | ||
4613 | 632 | _colorSchemes.insert(scheme->name(),scheme); | ||
4614 | 633 | |||
4615 | 634 | // save changes to disk | ||
4616 | 635 | QString path = KGlobal::dirs()->saveLocation("data","konsole/") + scheme->name() + ".colorscheme"; | ||
4617 | 636 | KConfig config(path , KConfig::NoGlobals); | ||
4618 | 637 | |||
4619 | 638 | scheme->write(config); | ||
4620 | 639 | } | ||
4621 | 640 | #endif | ||
4622 | 641 | bool ColorSchemeManager::loadColorScheme(const QString& filePath) | ||
4623 | 642 | { | ||
4624 | 643 | if ( !filePath.endsWith(QLatin1String(".colorscheme")) || !QFile::exists(filePath) ) | ||
4625 | 644 | return false; | ||
4626 | 645 | |||
4627 | 646 | QFileInfo info(filePath); | ||
4628 | 647 | |||
4629 | 648 | ColorScheme* scheme = new ColorScheme(); | ||
4630 | 649 | scheme->setName(info.baseName()); | ||
4631 | 650 | scheme->read(filePath); | ||
4632 | 651 | |||
4633 | 652 | if (scheme->name().isEmpty()) | ||
4634 | 653 | { | ||
4635 | 654 | qDebug() << "Color scheme in" << filePath << "does not have a valid name and was not loaded."; | ||
4636 | 655 | delete scheme; | ||
4637 | 656 | return false; | ||
4638 | 657 | } | ||
4639 | 658 | |||
4640 | 659 | if ( !_colorSchemes.contains(info.baseName()) ) | ||
4641 | 660 | { | ||
4642 | 661 | _colorSchemes.insert(scheme->name(),scheme); | ||
4643 | 662 | } | ||
4644 | 663 | else | ||
4645 | 664 | { | ||
4646 | 665 | qDebug() << "color scheme with name" << scheme->name() << "has already been" << | ||
4647 | 666 | "found, ignoring."; | ||
4648 | 667 | |||
4649 | 668 | delete scheme; | ||
4650 | 669 | } | ||
4651 | 670 | |||
4652 | 671 | return true; | ||
4653 | 672 | } | ||
4654 | 673 | QList<QString> ColorSchemeManager::listKDE3ColorSchemes() | ||
4655 | 674 | { | ||
4656 | 675 | QString dname(get_color_schemes_dir()); | ||
4657 | 676 | QDir dir(dname); | ||
4658 | 677 | QStringList filters; | ||
4659 | 678 | filters << "*.schema"; | ||
4660 | 679 | dir.setNameFilters(filters); | ||
4661 | 680 | QStringList list = dir.entryList(filters); | ||
4662 | 681 | QStringList ret; | ||
4663 | 682 | foreach(QString i, list) | ||
4664 | 683 | ret << dname + "/" + i; | ||
4665 | 684 | return ret; | ||
4666 | 685 | //return KGlobal::dirs()->findAllResources("data", | ||
4667 | 686 | // "konsole/*.schema", | ||
4668 | 687 | // KStandardDirs::NoDuplicates); | ||
4669 | 688 | // | ||
4670 | 689 | } | ||
4671 | 690 | QList<QString> ColorSchemeManager::listColorSchemes() | ||
4672 | 691 | { | ||
4673 | 692 | QString dname(get_color_schemes_dir()); | ||
4674 | 693 | QDir dir(dname); | ||
4675 | 694 | QStringList filters; | ||
4676 | 695 | filters << "*.colorscheme"; | ||
4677 | 696 | dir.setNameFilters(filters); | ||
4678 | 697 | QStringList list = dir.entryList(filters); | ||
4679 | 698 | QStringList ret; | ||
4680 | 699 | foreach(QString i, list) | ||
4681 | 700 | ret << dname + "/" + i; | ||
4682 | 701 | return ret; | ||
4683 | 702 | // return KGlobal::dirs()->findAllResources("data", | ||
4684 | 703 | // "konsole/*.colorscheme", | ||
4685 | 704 | // KStandardDirs::NoDuplicates); | ||
4686 | 705 | } | ||
4687 | 706 | const ColorScheme ColorSchemeManager::_defaultColorScheme; | ||
4688 | 707 | const ColorScheme* ColorSchemeManager::defaultColorScheme() const | ||
4689 | 708 | { | ||
4690 | 709 | return &_defaultColorScheme; | ||
4691 | 710 | } | ||
4692 | 711 | bool ColorSchemeManager::deleteColorScheme(const QString& name) | ||
4693 | 712 | { | ||
4694 | 713 | Q_ASSERT( _colorSchemes.contains(name) ); | ||
4695 | 714 | |||
4696 | 715 | // lookup the path and delete | ||
4697 | 716 | QString path = findColorSchemePath(name); | ||
4698 | 717 | if ( QFile::remove(path) ) | ||
4699 | 718 | { | ||
4700 | 719 | _colorSchemes.remove(name); | ||
4701 | 720 | return true; | ||
4702 | 721 | } | ||
4703 | 722 | else | ||
4704 | 723 | { | ||
4705 | 724 | qDebug() << "Failed to remove color scheme -" << path; | ||
4706 | 725 | return false; | ||
4707 | 726 | } | ||
4708 | 727 | } | ||
4709 | 728 | QString ColorSchemeManager::findColorSchemePath(const QString& name) const | ||
4710 | 729 | { | ||
4711 | 730 | // QString path = KStandardDirs::locate("data","konsole/"+name+".colorscheme"); | ||
4712 | 731 | QString path(get_color_schemes_dir() + "/"+ name + ".colorscheme"); | ||
4713 | 732 | if ( !path.isEmpty() ) | ||
4714 | 733 | return path; | ||
4715 | 734 | |||
4716 | 735 | //path = KStandardDirs::locate("data","konsole/"+name+".schema"); | ||
4717 | 736 | path = get_color_schemes_dir() + "/"+ name + ".schema"; | ||
4718 | 737 | |||
4719 | 738 | return path; | ||
4720 | 739 | } | ||
4721 | 740 | const ColorScheme* ColorSchemeManager::findColorScheme(const QString& name) | ||
4722 | 741 | { | ||
4723 | 742 | if ( name.isEmpty() ) | ||
4724 | 743 | return defaultColorScheme(); | ||
4725 | 744 | |||
4726 | 745 | if ( _colorSchemes.contains(name) ) | ||
4727 | 746 | return _colorSchemes[name]; | ||
4728 | 747 | else | ||
4729 | 748 | { | ||
4730 | 749 | // look for this color scheme | ||
4731 | 750 | QString path = findColorSchemePath(name); | ||
4732 | 751 | if ( !path.isEmpty() && loadColorScheme(path) ) | ||
4733 | 752 | { | ||
4734 | 753 | return findColorScheme(name); | ||
4735 | 754 | } | ||
4736 | 755 | else | ||
4737 | 756 | { | ||
4738 | 757 | if (!path.isEmpty() && loadKDE3ColorScheme(path)) | ||
4739 | 758 | return findColorScheme(name); | ||
4740 | 759 | } | ||
4741 | 760 | |||
4742 | 761 | qDebug() << "Could not find color scheme - " << name; | ||
4743 | 762 | |||
4744 | 763 | return 0; | ||
4745 | 764 | } | ||
4746 | 765 | } | ||
4747 | 766 | |||
4748 | 767 | ColorSchemeManager* ColorSchemeManager::theColorSchemeManager = 0; | ||
4749 | 768 | //K_GLOBAL_STATIC( ColorSchemeManager , theColorSchemeManager ) | ||
4750 | 769 | ColorSchemeManager* ColorSchemeManager::instance() | ||
4751 | 770 | { | ||
4752 | 771 | if (! theColorSchemeManager) | ||
4753 | 772 | theColorSchemeManager = new ColorSchemeManager(); | ||
4754 | 773 | return theColorSchemeManager; | ||
4755 | 774 | } | ||
4756 | 0 | 775 | ||
4757 | === added file 'src/ColorScheme.h' | |||
4758 | --- src/ColorScheme.h 1970-01-01 00:00:00 +0000 | |||
4759 | +++ src/ColorScheme.h 2017-09-09 05:25:54 +0000 | |||
4760 | @@ -0,0 +1,342 @@ | |||
4761 | 1 | /* | ||
4762 | 2 | This source file is part of Konsole, a terminal emulator. | ||
4763 | 3 | |||
4764 | 4 | Copyright 2007-2008 by Robert Knight <robertknight@gmail.com> | ||
4765 | 5 | |||
4766 | 6 | This program is free software; you can redistribute it and/or modify | ||
4767 | 7 | it under the terms of the GNU General Public License as published by | ||
4768 | 8 | the Free Software Foundation; either version 2 of the License, or | ||
4769 | 9 | (at your option) any later version. | ||
4770 | 10 | |||
4771 | 11 | This program is distributed in the hope that it will be useful, | ||
4772 | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4773 | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4774 | 14 | GNU General Public License for more details. | ||
4775 | 15 | |||
4776 | 16 | You should have received a copy of the GNU General Public License | ||
4777 | 17 | along with this program; if not, write to the Free Software | ||
4778 | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
4779 | 19 | 02110-1301 USA. | ||
4780 | 20 | */ | ||
4781 | 21 | |||
4782 | 22 | #ifndef COLORSCHEME_H | ||
4783 | 23 | #define COLORSCHEME_H | ||
4784 | 24 | |||
4785 | 25 | // Qt | ||
4786 | 26 | #include <QtCore/QHash> | ||
4787 | 27 | #include <QtCore/QList> | ||
4788 | 28 | #include <QtCore/QMetaType> | ||
4789 | 29 | #include <QtCore/QIODevice> | ||
4790 | 30 | #include <QtCore/QSet> | ||
4791 | 31 | #include <QSettings> | ||
4792 | 32 | |||
4793 | 33 | // Konsole | ||
4794 | 34 | #include "CharacterColor.h" | ||
4795 | 35 | |||
4796 | 36 | class QIODevice; | ||
4797 | 37 | //class KConfig; | ||
4798 | 38 | |||
4799 | 39 | |||
4800 | 40 | /** | ||
4801 | 41 | * Represents a color scheme for a terminal display. | ||
4802 | 42 | * | ||
4803 | 43 | * The color scheme includes the palette of colors used to draw the text and character backgrounds | ||
4804 | 44 | * in the display and the opacity level of the display background. | ||
4805 | 45 | */ | ||
4806 | 46 | class ColorScheme | ||
4807 | 47 | { | ||
4808 | 48 | public: | ||
4809 | 49 | /** | ||
4810 | 50 | * Constructs a new color scheme which is initialised to the default color set | ||
4811 | 51 | * for Konsole. | ||
4812 | 52 | */ | ||
4813 | 53 | ColorScheme(); | ||
4814 | 54 | ColorScheme(const ColorScheme& other); | ||
4815 | 55 | ~ColorScheme(); | ||
4816 | 56 | |||
4817 | 57 | /** Sets the descriptive name of the color scheme. */ | ||
4818 | 58 | void setDescription(const QString& description); | ||
4819 | 59 | /** Returns the descriptive name of the color scheme. */ | ||
4820 | 60 | QString description() const; | ||
4821 | 61 | |||
4822 | 62 | /** Sets the name of the color scheme */ | ||
4823 | 63 | void setName(const QString& name); | ||
4824 | 64 | /** Returns the name of the color scheme */ | ||
4825 | 65 | QString name() const; | ||
4826 | 66 | |||
4827 | 67 | #if 0 | ||
4828 | 68 | // Implemented upstream - in user apps | ||
4829 | 69 | /** Reads the color scheme from the specified configuration source */ | ||
4830 | 70 | void read(KConfig& config); | ||
4831 | 71 | /** Writes the color scheme to the specified configuration source */ | ||
4832 | 72 | void write(KConfig& config) const; | ||
4833 | 73 | #endif | ||
4834 | 74 | void read(const QString & filename); | ||
4835 | 75 | |||
4836 | 76 | /** Sets a single entry within the color palette. */ | ||
4837 | 77 | void setColorTableEntry(int index , const ColorEntry& entry); | ||
4838 | 78 | |||
4839 | 79 | /** | ||
4840 | 80 | * Copies the color entries which form the palette for this color scheme | ||
4841 | 81 | * into @p table. @p table should be an array with TABLE_COLORS entries. | ||
4842 | 82 | * | ||
4843 | 83 | * @param table Array into which the color entries for this color scheme | ||
4844 | 84 | * are copied. | ||
4845 | 85 | * @param randomSeed Color schemes may allow certain colors in their | ||
4846 | 86 | * palette to be randomized. The seed is used to pick the random color. | ||
4847 | 87 | */ | ||
4848 | 88 | void getColorTable(ColorEntry* table, uint randomSeed = 0) const; | ||
4849 | 89 | |||
4850 | 90 | /** | ||
4851 | 91 | * Retrieves a single color entry from the table. | ||
4852 | 92 | * | ||
4853 | 93 | * See getColorTable() | ||
4854 | 94 | */ | ||
4855 | 95 | ColorEntry colorEntry(int index , uint randomSeed = 0) const; | ||
4856 | 96 | |||
4857 | 97 | /** | ||
4858 | 98 | * Convenience method. Returns the | ||
4859 | 99 | * foreground color for this scheme, | ||
4860 | 100 | * this is the primary color used to draw the | ||
4861 | 101 | * text in this scheme. | ||
4862 | 102 | */ | ||
4863 | 103 | QColor foregroundColor() const; | ||
4864 | 104 | /** | ||
4865 | 105 | * Convenience method. Returns the background color for | ||
4866 | 106 | * this scheme, this is the primary color used to | ||
4867 | 107 | * draw the terminal background in this scheme. | ||
4868 | 108 | */ | ||
4869 | 109 | QColor backgroundColor() const; | ||
4870 | 110 | |||
4871 | 111 | /** | ||
4872 | 112 | * Returns true if this color scheme has a dark background. | ||
4873 | 113 | * The background color is said to be dark if it has a value of less than 127 | ||
4874 | 114 | * in the HSV color space. | ||
4875 | 115 | */ | ||
4876 | 116 | bool hasDarkBackground() const; | ||
4877 | 117 | |||
4878 | 118 | /** | ||
4879 | 119 | * Sets the opacity level of the display background. @p opacity ranges | ||
4880 | 120 | * between 0 (completely transparent background) and 1 (completely | ||
4881 | 121 | * opaque background). | ||
4882 | 122 | * | ||
4883 | 123 | * Defaults to 1. | ||
4884 | 124 | * | ||
4885 | 125 | * TODO: More documentation | ||
4886 | 126 | */ | ||
4887 | 127 | void setOpacity(qreal opacity); | ||
4888 | 128 | /** | ||
4889 | 129 | * Returns the opacity level for this color scheme, see setOpacity() | ||
4890 | 130 | * TODO: More documentation | ||
4891 | 131 | */ | ||
4892 | 132 | qreal opacity() const; | ||
4893 | 133 | |||
4894 | 134 | /** | ||
4895 | 135 | * Enables randomization of the background color. This will cause | ||
4896 | 136 | * the palette returned by getColorTable() and colorEntry() to | ||
4897 | 137 | * be adjusted depending on the value of the random seed argument | ||
4898 | 138 | * to them. | ||
4899 | 139 | */ | ||
4900 | 140 | void setRandomizedBackgroundColor(bool randomize); | ||
4901 | 141 | |||
4902 | 142 | /** Returns true if the background color is randomized. */ | ||
4903 | 143 | bool randomizedBackgroundColor() const; | ||
4904 | 144 | |||
4905 | 145 | static QString colorNameForIndex(int index); | ||
4906 | 146 | static QString translatedColorNameForIndex(int index); | ||
4907 | 147 | |||
4908 | 148 | private: | ||
4909 | 149 | // specifies how much a particular color can be randomized by | ||
4910 | 150 | class RandomizationRange | ||
4911 | 151 | { | ||
4912 | 152 | public: | ||
4913 | 153 | RandomizationRange() : hue(0) , saturation(0) , value(0) {} | ||
4914 | 154 | |||
4915 | 155 | bool isNull() const | ||
4916 | 156 | { | ||
4917 | 157 | return ( hue == 0 && saturation == 0 && value == 0 ); | ||
4918 | 158 | } | ||
4919 | 159 | |||
4920 | 160 | quint16 hue; | ||
4921 | 161 | quint8 saturation; | ||
4922 | 162 | quint8 value; | ||
4923 | 163 | }; | ||
4924 | 164 | |||
4925 | 165 | // returns the active color table. if none has been set specifically, | ||
4926 | 166 | // this is the default color table. | ||
4927 | 167 | const ColorEntry* colorTable() const; | ||
4928 | 168 | |||
4929 | 169 | #if 0 | ||
4930 | 170 | // implemented upstream - user apps | ||
4931 | 171 | // reads a single colour entry from a KConfig source | ||
4932 | 172 | // and sets the palette entry at 'index' to the entry read. | ||
4933 | 173 | void readColorEntry(KConfig& config , int index); | ||
4934 | 174 | // writes a single colour entry to a KConfig source | ||
4935 | 175 | void writeColorEntry(KConfig& config , const QString& colorName, const ColorEntry& entry,const RandomizationRange& range) const; | ||
4936 | 176 | #endif | ||
4937 | 177 | void readColorEntry(QSettings *s, int index); | ||
4938 | 178 | |||
4939 | 179 | // sets the amount of randomization allowed for a particular color | ||
4940 | 180 | // in the palette. creates the randomization table if | ||
4941 | 181 | // it does not already exist | ||
4942 | 182 | void setRandomizationRange( int index , quint16 hue , quint8 saturation , quint8 value ); | ||
4943 | 183 | |||
4944 | 184 | QString _description; | ||
4945 | 185 | QString _name; | ||
4946 | 186 | qreal _opacity; | ||
4947 | 187 | ColorEntry* _table; // pointer to custom color table or 0 if the default | ||
4948 | 188 | // color scheme is being used | ||
4949 | 189 | |||
4950 | 190 | |||
4951 | 191 | static const quint16 MAX_HUE = 340; | ||
4952 | 192 | |||
4953 | 193 | RandomizationRange* _randomTable; // pointer to randomization table or 0 | ||
4954 | 194 | // if no colors in the color scheme support | ||
4955 | 195 | // randomization | ||
4956 | 196 | |||
4957 | 197 | static const char* const colorNames[TABLE_COLORS]; | ||
4958 | 198 | static const char* const translatedColorNames[TABLE_COLORS]; | ||
4959 | 199 | |||
4960 | 200 | static const ColorEntry defaultTable[]; // table of default color entries | ||
4961 | 201 | }; | ||
4962 | 202 | |||
4963 | 203 | /** | ||
4964 | 204 | * A color scheme which uses colors from the standard KDE color palette. | ||
4965 | 205 | * | ||
4966 | 206 | * This is designed primarily for the benefit of users who are using specially | ||
4967 | 207 | * designed colors. | ||
4968 | 208 | * | ||
4969 | 209 | * TODO Implement and make it the default on systems with specialized KDE | ||
4970 | 210 | * color schemes. | ||
4971 | 211 | */ | ||
4972 | 212 | class AccessibleColorScheme : public ColorScheme | ||
4973 | 213 | { | ||
4974 | 214 | public: | ||
4975 | 215 | AccessibleColorScheme(); | ||
4976 | 216 | }; | ||
4977 | 217 | |||
4978 | 218 | /** | ||
4979 | 219 | * Reads a color scheme stored in the .schema format used in the KDE 3 incarnation | ||
4980 | 220 | * of Konsole | ||
4981 | 221 | * | ||
4982 | 222 | * Only the basic essentials ( title and color palette entries ) are currently | ||
4983 | 223 | * supported. Additional options such as background image and background | ||
4984 | 224 | * blend colors are ignored. | ||
4985 | 225 | */ | ||
4986 | 226 | class KDE3ColorSchemeReader | ||
4987 | 227 | { | ||
4988 | 228 | public: | ||
4989 | 229 | /** | ||
4990 | 230 | * Constructs a new reader which reads from the specified device. | ||
4991 | 231 | * The device should be open in read-only mode. | ||
4992 | 232 | */ | ||
4993 | 233 | KDE3ColorSchemeReader( QIODevice* device ); | ||
4994 | 234 | |||
4995 | 235 | /** | ||
4996 | 236 | * Reads and parses the contents of the .schema file from the input | ||
4997 | 237 | * device and returns the ColorScheme defined within it. | ||
4998 | 238 | * | ||
4999 | 239 | * Returns a null pointer if an error occurs whilst parsing | ||
5000 | 240 | * the contents of the file. |
The diff has been truncated for viewing.