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