107 Commits

Author SHA1 Message Date
Filippo Scognamiglio
a24cbbcc93 Burnin is now subtractive. Better looking and more predictable. 2015-01-06 01:35:35 +01:00
Filippo Scognamiglio
17b70b47ce Fix OSX keys issues. 2015-01-05 22:35:07 +01:00
Filippo Scognamiglio
295912fbb3 Reduce minimum quality and allower finer tuning of performance settings. 2015-01-05 22:08:06 +01:00
Filippo Scognamiglio
859adf966a Use IBeamCursor instead of normal arrow. 2015-01-05 22:01:14 +01:00
Filippo Scognamiglio
cf404f980d Use already available shaderEffectSource and improve bloom look at low quality by limiting minimum radius. 2015-01-05 21:47:42 +01:00
Filippo Scognamiglio
6979abe96a Merge pull request #198 from Swordfish90/fix-color-dialog-2
Fix bad behaving color dialog on some platforms.
2015-01-02 22:16:33 +01:00
Filippo Scognamiglio
c685cbd640 Merge pull request #197 from Swordfish90/add-pixelated-fonts
Add pixelated fonts and use them as default
2015-01-02 22:15:11 +01:00
Filippo Scognamiglio
4934d78cea Fix font names and default profiles. 2015-01-02 21:46:59 +01:00
Filippo Scognamiglio
c6716e1b1a Fix: texture quality and burnin sliders now have effect on image quality when low res fornts are used. 2015-01-02 12:09:25 +01:00
Filippo Scognamiglio
cc1d77ea32 Fix: font names and order. Added compatible scanlines and pixels fonts. 2014-12-31 16:40:30 +01:00
Filippo Scognamiglio
3e7ac0d87d Optimize burn-in effect when low res font is used. We can actually use a much lower-res accumulator too. 2014-12-31 14:36:53 +01:00
Filippo Scognamiglio
a6952251de Make the upscaled fonts really upscaled. (Faster expecially at high resolutions). 2014-12-31 13:46:03 +01:00
Filippo Scognamiglio
d10bf29493 Fix bad behaving color dialog on some platforms. 2014-12-30 10:25:33 +01:00
Filippo Scognamiglio
a63135045e Bump terminal version and prepare for release. 2014-12-26 23:41:03 +01:00
Filippo Scognamiglio
bc441116e2 Enable terminal smoothing when rasterization is not used. 2014-12-26 23:16:31 +01:00
Filippo Scognamiglio
025ef61de1 Allow profiles with the same name. 2014-12-26 19:57:03 +01:00
Filippo Scognamiglio
e4c7ffe201 Fix: various small improvements. 2014-12-26 19:47:11 +01:00
Filippo Scognamiglio
0264fbebcd Small adjustments in the settings dialog. 2014-12-26 17:51:10 +01:00
Filippo Scognamiglio
7dd61c89fc Fix: osx shortcuts. 2014-12-26 17:36:03 +01:00
Filippo Scognamiglio
a62645f0b7 Improve profiles management, redesign a bit the settings window. 2014-12-26 17:19:34 +01:00
Filippo Scognamiglio
88079a3ee4 Improvement: initial implementation of profiles json IO. 2014-12-26 02:54:38 +01:00
Filippo Scognamiglio
c7fbe591ba Improvement: port profile selector to TableView. 2014-12-26 02:28:51 +01:00
Filippo Scognamiglio
b1139a3911 Fix: tiny tiny fixes. 2014-12-26 00:44:32 +01:00
Filippo Scognamiglio
f03fa29836 Improvement: index frames by name and not position. 2014-12-26 00:00:35 +01:00
Filippo Scognamiglio
04a6365349 Fix: font was not updated when profile changed. 2014-12-24 15:41:08 +01:00
Filippo Scognamiglio
4d3c16fabc Refactoting: change names in settings, and using camelCase for settings name. 2014-12-23 18:13:34 +01:00
Filippo Scognamiglio
9d5896b62c Improvement: allow arguments to be passed to the process launched with the terminal. 2014-12-23 17:07:10 +01:00
Filippo Scognamiglio
23a1033787 Refactor: different platforms contextual menus. 2014-12-23 14:02:46 +01:00
Filippo Scognamiglio
c35cb6cf45 Fix: horizontal sync should not go outside screen boundaries. 2014-12-23 13:58:22 +01:00
Filippo Scognamiglio
0935dda00b Fix: Make osx copy and paste shortcuts consistent with the system. 2014-12-23 02:34:58 +01:00
Filippo Scognamiglio
1119f774f9 Many many new fonts. Sripped out resource file of what was useless. 2014-12-23 02:12:59 +01:00
Filippo Scognamiglio
7dcf98c395 Refactoring: port non visual components from Item to QtObject. 2014-12-23 00:49:33 +01:00
Filippo Scognamiglio
e5174fdb08 Workaround: workaround the margin in the menubar. 2014-12-23 00:35:02 +01:00
Filippo Scognamiglio
0594668387 Fix: clamp frame to black when outside texture boundaries. 2014-12-23 00:16:03 +01:00
Filippo Scognamiglio
dc8061a0a4 Fix: disable antialiasing when rasterization is enabled. 2014-12-22 23:07:08 +01:00
Filippo Scognamiglio
6c1c17445a Fix: fix OSX context menu issues. Split the context menus into two different components. 2014-12-22 21:44:45 +01:00
Filippo Scognamiglio
56d366116a Fix: Windows flags and raise behaviour. Also fix OSX quit issues. 2014-12-22 20:50:17 +01:00
Filippo Scognamiglio
1ed4d271c7 Fix: Issue between texture quality and the new frame. 2014-12-22 02:34:58 +01:00
Filippo Scognamiglio
bd1098f373 Fix: sql had issues under OSX. 2014-12-22 02:00:45 +01:00
Filippo Scognamiglio
8ed9a33bcd Fix: send application quit event when qml engine is closed. 2014-12-21 16:32:55 +01:00
Filippo Scognamiglio
17f37b48e7 Fix: autologin the shell under OSX. 2014-12-21 16:19:23 +01:00
Filippo Scognamiglio
5ea8bec0cf Merge pull request #189 from robatron/patch-2
README updates
2014-12-20 18:57:31 +01:00
Filippo Scognamiglio
2f94fa4e2f Merge pull request #190 from Swordfish90/unstable
New improved and faster frame effect.
2014-12-20 18:56:32 +01:00
Filippo Scognamiglio
6832b32741 Fix: screen curvature is now consistent across all screen sizes. Close #176. 2014-12-20 18:46:20 +01:00
Filippo Scognamiglio
c06b3db71e Fix: missing scrollbar margins caused some clamping on the texture border. 2014-12-20 18:46:20 +01:00
Filippo Scognamiglio
ebbaec762d Refactoring: avoid manually defined bindings in font changed handler. 2014-12-20 18:46:20 +01:00
Filippo Scognamiglio
ebc2246901 Fix: issue when changing rasterization. Small cleanups. 2014-12-20 18:46:20 +01:00
Filippo Scognamiglio
df76d83d4b Improved frames. They are now faster, better looking, and more customizable. Also added a workaround for segementation faults when changing them. 2014-12-20 18:46:05 +01:00
Rob McGuire-Dale
7b15677426 Enable shell syntax highlighting, specify pre-reqs 2014-12-18 21:17:47 -08:00
Filippo Scognamiglio
297201a75f Merge pull request #187 from Swordfish90/refactoring
Optimised and configurable motion blur effect. Other various fixes.
2014-12-16 01:50:40 +01:00
Filippo Scognamiglio
0c0cdfdee1 Fix: update profiles to reflect new changes. 2014-12-16 01:36:35 +01:00
Filippo Scognamiglio
579194dd35 Fix: using font names instaed of indexes in settings. 2014-12-16 01:22:46 +01:00
Filippo Scognamiglio
fa59bb06b1 Fix: Add static noise when horizontal distortion is activated. 2014-12-15 22:24:57 +01:00
Filippo Scognamiglio
38d4c5dd52 Fix: Improve a bit and fix visual issues with bloom. 2014-12-15 22:18:22 +01:00
Filippo Scognamiglio
ce5658a205 Fix: tweak blur values. 2014-12-15 22:03:09 +01:00
Filippo Scognamiglio
f9e68a6854 Fix: change workaround used to hide the menubar. This works with Qt 5.4 2014-12-15 11:56:40 +01:00
Filippo Scognamiglio
f4bd4fe69b Fix: bump plugin which fixes install issues with qmake. 2014-12-15 11:21:30 +01:00
Filippo Scognamiglio
26d5c56cd0 Optimizations: motion blur is better, and quality is now customizable. Default value is 50%. which is again a good compromise. 2014-12-15 02:35:13 +01:00
Filippo Scognamiglio
9fc73468a2 Merge pull request #184 from Swordfish90/refactoring
Many many fixes and optimizations. Texture scaling now dramatically improve performances, various shader optimizations, improved static noise and horizontal distortion and more...
2014-12-14 21:27:41 +01:00
Filippo Scognamiglio
37317136ed Fix: Bloom radius needed a dependency on window scaling. 2014-12-14 21:17:40 +01:00
Filippo Scognamiglio
4ce7b0cadf Removed scanline quality settings. Was quite useless and confusing. 2014-12-14 19:13:19 +01:00
Filippo Scognamiglio
29e8592582 Optimization: Allow finer bloom quality settings. Also set default value to 50%, good compromise between speed and quality. 2014-12-14 18:53:37 +01:00
Filippo Scognamiglio
a088c2455e Fix: Window scaling was counted two times for bloom. 2014-12-14 17:01:40 +01:00
Filippo Scognamiglio
dab16fb80a Fix: oops... Removed something that was actually useful. 2014-12-14 12:02:40 +01:00
Filippo Scognamiglio
c9f918784c Move scanlines computations in main shader. This reduces GPU memory consumption, may improve performace and increases scanlines quality. 2014-12-14 10:32:43 +01:00
Filippo Scognamiglio
2876076cea Improvement: redesigned horizontal distortion effect. 2014-12-14 09:44:23 +01:00
Filippo Scognamiglio
08c53160a4 Merge pull request #183 from tgerczei/master
Update README.md
2014-12-13 21:21:00 +01:00
Filippo Scognamiglio
6cabacbcc0 Optimization: new texture based way to draw the noise. It looks better. There is also a wiser use of textures which brings big performance improvements. 2014-12-13 16:53:45 +01:00
tgerczei
d3d153b9c0 Update README.md
layman syntax correction
2014-12-13 08:16:36 +01:00
Filippo Scognamiglio
b9afcec3cf Improve static noise by using pregenerated image instead of the shader we used before. 2014-12-13 01:44:26 +01:00
Filippo Scognamiglio
fd73afb66b Refactor: move some out of place functions. 2014-12-12 21:31:19 +01:00
Filippo Scognamiglio
64fb980ae4 Fix: improve profile and settings printing and disable it by default. 2014-12-12 21:10:53 +01:00
Filippo Scognamiglio
c58f85c6ac Fix: cursor was chopped when linespacing was used. 2014-12-12 02:20:11 +01:00
Filippo Scognamiglio
94131a24ad Improvement: all fonts now have a custom default width, this allows to have more uniform sizes across fonts and different rasterizations. Small tweaks in font sizes. 2014-12-12 01:38:32 +01:00
Filippo Scognamiglio
30cc2a5e9c Refactor: texture scaling is now slightly better organized. 2014-12-12 00:59:23 +01:00
Filippo Scognamiglio
6eb3e814fe Fix: remove unused font. 2014-12-12 00:46:34 +01:00
Filippo Scognamiglio
e029978937 Bump plugin version. Fix: terminal plugin was not installed. 2014-12-12 00:36:32 +01:00
Filippo Scognamiglio
85d637e62e Fix: undefined reference after refactoring. 2014-12-11 13:50:52 +01:00
Filippo Scognamiglio
dbdd7f3705 Fix: dialog sizes and positioning. 2014-12-11 12:35:31 +01:00
Filippo Scognamiglio
7b7eba1c7c Refactoring: rename shadersettings in appSettings. 2014-12-11 12:08:15 +01:00
Filippo Scognamiglio
0daf33c36f Refactor: simplify main terminal. 2014-12-11 11:31:23 +01:00
Filippo Scognamiglio
68a8d7d212 Refactor: extract all the other effects from main terminal. 2014-12-11 10:40:14 +01:00
Filippo Scognamiglio
9f943aa2d0 Refactor: extract noise and rasterization from terminal object. 2014-12-11 10:07:53 +01:00
Filippo Scognamiglio
6b9a2ed5d2 Refactor main and terminal container. 2014-12-11 01:48:30 +01:00
Filippo Scognamiglio
dcb332b06f Use scale transformation instead of shadereffectsource. Faster when reducing quality. 2014-12-11 01:20:51 +01:00
Filippo Scognamiglio
b9f2cc4300 Force shadereffect source visibility to off. Bump qmltermwidget plugin version. 2014-12-11 00:52:09 +01:00
Filippo Scognamiglio
48716f1c0e Merge pull request #182 from tgerczei/master
Adding Gentoo install instructions.
2014-12-04 03:32:48 +01:00
tgerczei
33c8c28899 Update README.md 2014-12-03 14:06:48 +01:00
tgerczei
eb5968bdd2 Update README.md
Added instructions for Gentoo
2014-12-03 13:47:37 +01:00
Filippo Scognamiglio
16768cf10c Merge pull request #173 from Swordfish90/newnewplugin
Move to new plugin. Fixes, performace optimizations and a new scrollbar added in the transition.
2014-11-13 00:24:00 +01:00
Filippo Scognamiglio
789828e8b8 Bump plugin version. 2014-11-13 00:16:20 +01:00
Filippo Scognamiglio
4b57ee4e64 Removed old plugin. We'll miss you pal. 2014-11-12 23:28:55 +01:00
Filippo Scognamiglio
b61c03630d Update README.md 2014-11-12 23:27:38 +01:00
Filippo Scognamiglio
b3a4b7158e Added scrollbar. 2014-11-12 23:14:48 +01:00
Filippo Scognamiglio
28bb2e2adf Set default effects fps to 24 (the terminal is now updated at full speed). 2014-11-11 15:19:03 +01:00
Filippo Scognamiglio
c575385ba3 Update plugin version. 2014-11-11 15:08:21 +01:00
Filippo Scognamiglio
45ef5ee000 Added lightly smoothed black frame around the screen. 2014-11-11 14:51:24 +01:00
Filippo Scognamiglio
5552bea525 Moving time manager in ShaderTerminal since it is only used there. 2014-11-09 15:20:05 +01:00
Filippo Scognamiglio
4f22704922 Using new plugin. This is ported by me from qtermwidget (konsole). Removing manual management of the signals to rely more on Qt implementations. 2014-11-09 01:38:22 +01:00
Filippo Scognamiglio
e0660a699b Merge pull request #170 from inzanity/master
Use window title from session. Fixes #167
2014-11-03 06:01:15 -05:00
Santtu Lakkala
4b5827cb3e Use window title from session. Fixes #167 2014-10-27 09:28:27 +02:00
Filippo Scognamiglio
08ade0eb6f Fix regression: copy and paste were not working anymore. 2014-10-13 22:53:26 +02:00
Filippo Scognamiglio
e4f89f0486 Add missing command in osx build function. 2014-10-13 14:45:34 +02:00
Filippo Scognamiglio
b2709aef6f Merge pull request #161 from jekader/debian-packaging
add missing dependencies to Debian manifest
2014-10-13 13:39:56 +02:00
Jeka Der
3bf385b317 added missing Debian dependencies 2014-10-12 18:14:33 +02:00
Filippo Scognamiglio
bebfdfa267 Merge pull request #158 from KAMiKAZOW/patch-2
Fix typo in cool-retro-term.spec
2014-10-12 11:06:58 +02:00
KAMiKAZOW
e3e7d12ff8 Update cool-retro-term.spec
Fix typo
2014-10-12 05:16:22 +02:00
156 changed files with 1805 additions and 26189 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "qmltermwidget"]
path = qmltermwidget
url = https://github.com/Swordfish90/qmltermwidget

View File

@@ -4,7 +4,7 @@
cool-retro-term is a terminal emulator which mimics the look and feel of the old cathode tube screens.
It has been designed to be eye-candy, customizable, and reasonably lightweight.
It uses the Konsole engine which is powerful and mature.
It uses the QML port of qtermwidget (Konsole) developed by me: https://github.com/Swordfish90/qmltermwidget
This terminal emulator requires Qt 5.2 or higher to run.
@@ -22,6 +22,15 @@ Arch users can install this [package](https://aur.archlinux.org/packages/cool-re
yaourt -S aur/cool-retro-term-git
Gentoo users can install from a 3rd-party repository preferably via layman:
# USE="subversion git" emerge app-portage/layman
# wget --no-check-certificate https://www.gerczei.eu/files/gerczei.xml -O /etc/layman/overlays/gerczei.xml
# layman -f -a qt -a gerczei
# ACCEPT_KEYWORDS="~*" emerge x11-terms/cool-retro-term::gerczei
A word of warning: USE flags and keywords are to be added to portage's configuration files and every emerge operation should be executed with '-p' (short option for --pretend) appended to the command line first as per best practice!
##Build instructions (Linux)
##Dependencies
@@ -82,7 +91,7 @@ Once you installed all dependencies (Qt is installed and in your path) you need
```bash
# Get it from GitHub
git clone https://github.com/Swordfish90/cool-retro-term.git
git clone --recursive https://github.com/Swordfish90/cool-retro-term.git
# Build it
cd cool-retro-term
@@ -96,14 +105,21 @@ qmake && make
##Build instructions (OSX)
brew install qt5
git clone https://github.com/Swordfish90/cool-retro-term.git
export CPPFLAGS="-I/usr/local/opt/qt5/include"
export LDFLAGS="-L/usr/local/opt/qt5/lib"
export PATH=/usr/local/opt/qt5/bin:$PATH
cd cool-retro-term
qmake && make
open cool-retro-term.app
1. Install [Xcode](https://developer.apple.com/xcode/) and agree to the licence agreement
2. Enter the following commands into the terminal:
```sh
brew install qt5
git clone --recursive https://github.com/Swordfish90/cool-retro-term.git
export CPPFLAGS="-I/usr/local/opt/qt5/include"
export LDFLAGS="-L/usr/local/opt/qt5/lib"
export PATH=/usr/local/opt/qt5/bin:$PATH
cd cool-retro-term
qmake && make
mkdir cool-retro-term.app/Contents/PlugIns
cp -r qmltermwidget/QMLTermWidget cool-retro-term.app/Contents/PlugIns
open cool-retro-term.app
```
##Donations
I made this project in my spare time because I love what I'm doing. If you are enjoying it and you want to buy me a beer click [here](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=flscogna%40gmail%2ecom&lc=IT&item_name=Filippo%20Scognamiglio&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) .

View File

@@ -1,8 +1,13 @@
QT += qml quick widgets
QT += qml quick widgets sql
TARGET = cool-retro-term
DESTDIR = $$OUT_PWD/../
SOURCES = main.cpp
HEADERS += \
fileio.h
SOURCES = main.cpp \
fileio.cpp
macx:ICON = icons/crt.icns

37
app/fileio.cpp Normal file
View File

@@ -0,0 +1,37 @@
#include "fileio.h"
FileIO::FileIO()
{
}
bool FileIO::write(const QString& sourceUrl, const QString& data) {
if (sourceUrl.isEmpty())
return false;
QUrl url(sourceUrl);
QFile file(url.toLocalFile());
if (!file.open(QFile::WriteOnly | QFile::Truncate))
return false;
QTextStream out(&file);
out << data;
file.close();
return true;
}
QString FileIO::read(const QString& sourceUrl) {
if (sourceUrl.isEmpty())
return "";
QUrl url(sourceUrl);
QFile file(url.toLocalFile());
if (!file.open(QFile::ReadOnly))
return "";
QTextStream in(&file);
QString result = in.readAll();
file.close();
return result;
}

21
app/fileio.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef FILEIO_H
#define FILEIO_H
#include <QObject>
#include <QFile>
#include <QTextStream>
#include <QUrl>
class FileIO : public QObject
{
Q_OBJECT
public:
FileIO();
public slots:
bool write(const QString& sourceUrl, const QString& data);
QString read(const QString& sourceUrl);
};
#endif // FILEIO_H

View File

@@ -9,41 +9,73 @@
#include <QDebug>
#include <stdlib.h>
#include <fileio.h>
QString getNamedArgument(QStringList args, QString name) {
QString getNamedArgument(QStringList args, QString name, QString defaultName)
{
int index = args.indexOf(name);
return (index != -1) ? args[index + 1] : QString("");
return (index != -1) ? args[index + 1] : QString(defaultName);
}
QString getNamedArgument(QStringList args, QString name)
{
return getNamedArgument(args, name, "");
}
int main(int argc, char *argv[])
{
// Some environmental variable are necessary on certain platforms.
// This disables QT appmenu under Ubuntu, which is not working with QML apps.
setenv("QT_QPA_PLATFORMTHEME", "", 1);
#if defined(Q_OS_MAC)
// This allows UTF-8 characters usage in OSX.
setenv("LC_CTYPE", "UTF-8", 1);
#endif
QApplication app(argc, argv);
QQmlApplicationEngine engine;
FileIO fileIO;
// Manage command line arguments from the cpp side
QStringList args = app.arguments();
if (args.contains("-h") || args.contains("--help")) {
qDebug() << "Usage: " + args.at(0) + " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]";
qDebug() << " --default-settings Run cool-retro-term with the default settings";
qDebug() << " --workdir <dir> Change working directory to 'dir'";
qDebug() << " --program <prog> Run the 'prog' in the new terminal.";
qDebug() << " --fullscreen Run cool-retro-term in fullscreen.";
qDebug() << " -p|--profile <prof> Run cool-retro-term with the given profile.";
qDebug() << " -h|--help Print this help.";
qDebug() << " --default-settings Run cool-retro-term with the default settings";
qDebug() << " --workdir <dir> Change working directory to 'dir'";
qDebug() << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option.";
qDebug() << " --fullscreen Run cool-retro-term in fullscreen.";
qDebug() << " -p|--profile <prof> Run cool-retro-term with the given profile.";
qDebug() << " -h|--help Print this help.";
qDebug() << " --verbose Print additional informations such as profiles and settings.";
return 0;
}
engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir"));
engine.rootContext()->setContextProperty("shellProgram", getNamedArgument(args, "--program"));
// Manage default command
QStringList cmdList;
if (args.contains("-e")) {
cmdList << args.mid(args.indexOf("-e") + 1);
}
QVariant command(cmdList.empty() ? QVariant() : cmdList[0]);
QVariant commandArgs(cmdList.size() <= 1 ? QVariant() : QVariant(cmdList.mid(1)));
engine.rootContext()->setContextProperty("defaultCmd", command);
engine.rootContext()->setContextProperty("defaultCmdArgs", commandArgs);
engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir", "$HOME"));
engine.rootContext()->setContextProperty("fileIO", &fileIO);
// Manage import paths for Linux and OSX.
QStringList importPathList = engine.importPathList();
importPathList.prepend(QCoreApplication::applicationDirPath() + "/imports/");
importPathList.prepend(QCoreApplication::applicationDirPath() + "/qmltermwidget");
importPathList.prepend(QCoreApplication::applicationDirPath() + "/../PlugIns");
importPathList.prepend(QCoreApplication::applicationDirPath() + "/../../../qmltermwidget");
engine.setImportPathList(importPathList);
engine.load(QUrl("qrc:/main.qml"));
// Quit the application when the engine closes.
QObject::connect((QObject*) &engine, SIGNAL(quit()), (QObject*) &app, SLOT(quit()));
return app.exec();
}

View File

@@ -6,8 +6,10 @@ import QtQuick.Window 2.0
Window{
id: dialogwindow
title: qsTr("About")
width: 450
height: 300
width: 600
height: 400
modality: Qt.ApplicationModal
ColumnLayout{
anchors.fill: parent
@@ -64,20 +66,18 @@ Window{
ColumnLayout{
anchors.fill: parent
spacing: 10
Item{
Layout.fillHeight: true
Image{
Layout.fillWidth: true
Image{
anchors.fill: parent
fillMode: Image.PreserveAspectFit
source: "images/crt256.png"
smooth: true
}
Layout.fillHeight: true
anchors.horizontalCenter: parent.horizontalCenter
fillMode: Image.PreserveAspectFit
source: "images/crt256.png"
smooth: true
}
Text{
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: shadersettings.version + "\n" +
text: appSettings.version + "\n" +
qsTr("Author: ") + "Filippo Scognamiglio\n" +
qsTr("Email: ") + "flscogna@gmail.com\n" +
qsTr("Source: ") + "https://github.com/Swordfish90/cool-retro-term\n"

View File

@@ -20,10 +20,10 @@
import QtQuick 2.2
import "utils.js" as Utils
Item{
property string version: "0.9"
QtObject{
property string version: "1.0.0 RC1"
// GENERAL SETTINGS ///////////////////////////////////////////////////
@@ -31,55 +31,44 @@ Item{
property bool showMenubar: true
property real windowOpacity: 1.0
property real ambient_light: 0.2
property real ambientLight: 0.2
property real contrast: 0.85
property real brightness: 0.5
property bool show_terminal_size: true
property bool showTerminalSize: true
property real windowScaling: 1.0
property real window_scaling: 1.0
onWindow_scalingChanged: handleFontChanged();
property real fps: 24
property bool verbose: false
property real fps: 0
function mix(c1, c2, alpha){
return Qt.rgba(c1.r * alpha + c2.r * (1-alpha),
c1.g * alpha + c2.g * (1-alpha),
c1.b * alpha + c2.b * (1-alpha),
c1.a * alpha + c2.a * (1-alpha))
}
function strToColor(s){
var r = parseInt(s.substring(1,3), 16) / 256;
var g = parseInt(s.substring(3,5), 16) / 256;
var b = parseInt(s.substring(5,7), 16) / 256;
return Qt.rgba(r, g, b, 1.0);
}
onWindowScalingChanged: handleFontChanged();
// PROFILE SETTINGS ///////////////////////////////////////////////////////
property string _background_color: "#000000"
property string _font_color: "#ff8100"
property string saturated_color: mix(strToColor("#FFFFFF"), strToColor(_font_color), saturation_color * 0.5)
property color font_color: mix(strToColor(saturated_color), strToColor(_background_color), 0.7 + (contrast * 0.3))
property color background_color: mix(strToColor(_background_color), strToColor(saturated_color), 0.7 + (contrast * 0.3))
property string _backgroundColor: "#000000"
property string _fontColor: "#ff8100"
property string saturatedColor: Utils.mix(Utils.strToColor("#FFFFFF"), Utils.strToColor(_fontColor), saturationColor * 0.5)
property color fontColor: Utils.mix(Utils.strToColor(saturatedColor), Utils.strToColor(_backgroundColor), 0.7 + (contrast * 0.3))
property color backgroundColor: Utils.mix(Utils.strToColor(_backgroundColor), Utils.strToColor(saturatedColor), 0.7 + (contrast * 0.3))
property real noise_strength: 0.1
property real screen_distortion: 0.1
property real glowing_line_strength: 0.2
property real motion_blur: 0.40
property real bloom_strength: 0.65
property real staticNoise: 0.1
property real screenCurvature: 0.1
property real glowingLine: 0.2
property real burnIn: 0.40
property real bloom: 0.65
property real bloom_quality: 1.0
property real bloomQuality: 0.5
property real burnInQuality: 0.5
property real chroma_color: 0.0
property real saturation_color: 0.0
property real chromaColor: 0.0
property real saturationColor: 0.0
property real jitter: 0.18
property real horizontal_sincronization: 0.08
property real brightness_flickering: 0.1
property real horizontalSync: 0.08
property real flickering: 0.1
property real rgb_shift: 0.0
property real rbgShift: 0.0
readonly property int no_rasterization: 0
readonly property int scanline_rasterization: 1
@@ -87,28 +76,19 @@ Item{
property int rasterization: no_rasterization
property int scanline_quality: 3
onScanline_qualityChanged: handleFontChanged();
ListModel{
id: framelist
ListElement{text: "No frame"; source: "./frames/NoFrame.qml"; reflections: false}
ListElement{text: "Simple white frame"; source: "./frames/WhiteSimpleFrame.qml"; reflections: true}
ListElement{text: "Rough black frame"; source: "./frames/BlackRoughFrame.qml"; reflections: true}
}
property string frame_source: frames_list.get(frames_index).source
property int frames_index: 1
property var frames_list: framelist
// FONTS //////////////////////////////////////////////////////////////////
signal terminalFontChanged(string fontSource, int pixelSize, int lineSpacing, real screenScaling)
property real fontScaling: 1.0
property real fontWidth: 1.0
Loader{
id: fontManager
property bool lowResolutionFont: false
property var fontNames: ["HERMIT", "COMMODORE_PET", "COMMODORE_PET"]
property var fontlist: fontManager.item.fontlist
signal terminalFontChanged(string fontSource, int pixelSize, int lineSpacing, real screenScaling, real fontWidth)
property Loader fontManager: Loader{
states: [
State { when: rasterization == no_rasterization
PropertyChanges {target: fontManager; source: "Fonts.qml" } },
@@ -121,8 +101,16 @@ Item{
onLoaded: handleFontChanged()
}
property real fontScaling: 1.0
onFontScalingChanged: handleFontChanged();
onFontWidthChanged: handleFontChanged();
function getIndexByName(name) {
for (var i = 0; i < fontlist.count; i++) {
if (name === fontlist.get(i).name)
return i;
}
return 0; // If the font is not available default to 0.
}
function incrementScaling(){
fontScaling = Math.min(fontScaling + 0.05, 2.50);
@@ -134,78 +122,125 @@ Item{
handleFontChanged();
}
property real fontWidth: 1.0
onFontWidthChanged: handleFontChanged();
property var fontIndexes: [0,0,0]
property var fontlist: fontManager.item.fontlist
function handleFontChanged(){
if(!fontManager.item) return;
fontManager.item.selectedFontIndex = fontIndexes[rasterization];
fontManager.item.scaling = fontScaling * window_scaling;
if (!fontManager.item) return;
var index = getIndexByName(fontNames[rasterization]);
if (index === undefined) return;
fontManager.item.selectedFontIndex = index;
fontManager.item.scaling = fontScaling * windowScaling;
var fontSource = fontManager.item.source;
var pixelSize = fontManager.item.pixelSize;
var lineSpacing = fontManager.item.lineSpacing;
var screenScaling = fontManager.item.screenScaling;
var fontWidth = fontManager.item.defaultFontWidth * appSettings.fontWidth;
terminalFontChanged(fontSource, pixelSize, lineSpacing, screenScaling);
lowResolutionFont = fontManager.item.lowResolutionFont;
terminalFontChanged(fontSource, pixelSize, lineSpacing, screenScaling, fontWidth);
}
// FRAMES /////////////////////////////////////////////////////////////////
property bool _frameReflections: true
property bool reflectionsAllowed: framelist.get(frames_index).reflections
property ListModel framesList: ListModel{
ListElement{
name: "NO_FRAME"
text: "No frame"
source: ""
reflections: false
}
ListElement{
name: "SIMPLE_WHITE_FRAME"
text: "Simple white frame"
source: "./frames/WhiteSimpleFrame.qml"
reflections: true
}
ListElement{
name: "ROUGH_BLACK_FRAME"
text: "Rough black frame"
source: "./frames/BlackRoughFrame.qml"
reflections: true
}
}
function getFrameIndexByName(name) {
for (var i = 0; i < framesList.count; i++) {
if (name === framesList.get(i).name)
return i;
}
return 0; // If the frame is not available default to 0.
}
property string frameSource: "./frames/WhiteSimpleFrame.qml"
property string frameName: "SIMPLE_WHITE_FRAME"
property bool _frameReflections: false
property bool reflectionsAllowed: true
property bool frameReflections: _frameReflections && reflectionsAllowed
property alias profiles_list: profileslist
property int profiles_index: 0
onFrameNameChanged: {
var index = getFrameIndexByName(frameName);
frameSource = framesList.get(index).source;
reflectionsAllowed = framesList.get(index).reflections;
}
// DB STORAGE /////////////////////////////////////////////////////////////
Storage{id: storage}
property Storage storage: Storage{ }
function stringify(obj) {
var replacer = function(key, val) {
return val.toFixed ? Number(val.toFixed(4)) : val;
}
return JSON.stringify(obj, replacer, 2);
}
function composeSettingsString(){
var settings = {
fps: fps,
window_scaling: window_scaling,
show_terminal_size: show_terminal_size,
windowScaling: windowScaling,
showTerminalSize: showTerminalSize,
fontScaling: fontScaling,
fontIndexes: fontIndexes,
fontNames: fontNames,
frameReflections: _frameReflections,
showMenubar: showMenubar,
scanline_quality: scanline_quality,
bloom_quality: bloom_quality
bloomQuality: bloomQuality,
burnInQuality: burnInQuality
}
return JSON.stringify(settings);
return stringify(settings);
}
function composeProfileString(){
function composeProfileObject(){
var settings = {
background_color: _background_color,
font_color: _font_color,
brightness_flickering: brightness_flickering,
horizontal_sincronization: horizontal_sincronization,
noise_strength: noise_strength,
chroma_color: chroma_color,
saturation_color: saturation_color,
screen_distortion: screen_distortion,
glowing_line_strength: glowing_line_strength,
frames_index: frames_index,
motion_blur: motion_blur,
bloom_strength: bloom_strength,
backgroundColor: _backgroundColor,
fontColor: _fontColor,
flickering: flickering,
horizontalSync: horizontalSync,
staticNoise: staticNoise,
chromaColor: chromaColor,
saturationColor: saturationColor,
screenCurvature: screenCurvature,
glowingLine: glowingLine,
frameName: frameName,
burnIn: burnIn,
bloom: bloom,
rasterization: rasterization,
jitter: jitter,
rgb_shift: rgb_shift,
rbgShift: rbgShift,
brightness: brightness,
contrast: contrast,
ambient_light: ambient_light,
ambientLight: ambientLight,
windowOpacity: windowOpacity,
fontIndex: fontIndexes[rasterization],
fontName: fontNames[rasterization],
fontWidth: fontWidth
}
return JSON.stringify(settings);
return settings;
}
function composeProfileString() {
return stringify(composeProfileObject());
}
function loadSettings(){
@@ -218,7 +253,8 @@ Item{
loadSettingsString(settingsString);
loadProfileString(profileString);
console.log("Loading settings: " + settingsString + profileString);
if (verbose)
console.log("Loading settings: " + settingsString + profileString);
}
function storeSettings(){
@@ -228,61 +264,65 @@ Item{
storage.setSetting("_CURRENT_SETTINGS", settingsString);
storage.setSetting("_CURRENT_PROFILE", profileString);
console.log("Storing settings: " + settingsString);
console.log("Storing profile: " + profileString);
if (verbose) {
console.log("Storing settings: " + settingsString);
console.log("Storing profile: " + profileString);
}
}
function loadSettingsString(settingsString){
var settings = JSON.parse(settingsString);
show_terminal_size = settings.show_terminal_size !== undefined ? settings.show_terminal_size : show_terminal_size
showTerminalSize = settings.showTerminalSize !== undefined ? settings.showTerminalSize : showTerminalSize
fps = settings.fps !== undefined ? settings.fps: fps
window_scaling = settings.window_scaling !== undefined ? settings.window_scaling : window_scaling
windowScaling = settings.windowScaling !== undefined ? settings.windowScaling : windowScaling
fontIndexes = settings.fontIndexes !== undefined ? settings.fontIndexes : fontIndexes
fontNames = settings.fontNames !== undefined ? settings.fontNames : fontNames
fontScaling = settings.fontScaling !== undefined ? settings.fontScaling : fontScaling
_frameReflections = settings.frameReflections !== undefined ? settings.frameReflections : _frameReflections;
showMenubar = settings.showMenubar !== undefined ? settings.showMenubar : showMenubar;
scanline_quality = settings.scanline_quality !== undefined ? settings.scanline_quality : scanline_quality;
bloom_quality = settings.bloom_quality !== undefined ? settings.bloom_quality : bloom_quality;
bloomQuality = settings.bloomQuality !== undefined ? settings.bloomQuality : bloomQuality;
burnInQuality = settings.burnInQuality !== undefined ? settings.burnInQuality : burnInQuality;
}
function loadProfileString(profileString){
var settings = JSON.parse(profileString);
_background_color = settings.background_color !== undefined ? settings.background_color : _background_color;
_font_color = settings.font_color !== undefined ? settings.font_color : _font_color;
_backgroundColor = settings.backgroundColor !== undefined ? settings.backgroundColor : _backgroundColor;
_fontColor = settings.fontColor !== undefined ? settings.fontColor : _fontColor;
horizontal_sincronization = settings.horizontal_sincronization !== undefined ? settings.horizontal_sincronization : horizontal_sincronization
brightness_flickering = settings.brightness_flickering !== undefined ? settings.brightness_flickering : brightness_flickering;
noise_strength = settings.noise_strength !== undefined ? settings.noise_strength : noise_strength;
chroma_color = settings.chroma_color !== undefined ? settings.chroma_color : chroma_color;
saturation_color = settings.saturation_color !== undefined ? settings.saturation_color : saturation_color;
screen_distortion = settings.screen_distortion !== undefined ? settings.screen_distortion : screen_distortion;
glowing_line_strength = settings.glowing_line_strength !== undefined ? settings.glowing_line_strength : glowing_line_strength;
horizontalSync = settings.horizontalSync !== undefined ? settings.horizontalSync : horizontalSync
flickering = settings.flickering !== undefined ? settings.flickering : flickering;
staticNoise = settings.staticNoise !== undefined ? settings.staticNoise : staticNoise;
chromaColor = settings.chromaColor !== undefined ? settings.chromaColor : chromaColor;
saturationColor = settings.saturationColor !== undefined ? settings.saturationColor : saturationColor;
screenCurvature = settings.screenCurvature !== undefined ? settings.screenCurvature : screenCurvature;
glowingLine = settings.glowingLine !== undefined ? settings.glowingLine : glowingLine;
motion_blur = settings.motion_blur !== undefined ? settings.motion_blur : motion_blur
bloom_strength = settings.bloom_strength !== undefined ? settings.bloom_strength : bloom_strength
burnIn = settings.burnIn !== undefined ? settings.burnIn : burnIn
bloom = settings.bloom !== undefined ? settings.bloom : bloom
frames_index = settings.frames_index !== undefined ? settings.frames_index : frames_index;
frameName = settings.frameName !== undefined ? settings.frameName : frameName;
rasterization = settings.rasterization !== undefined ? settings.rasterization : rasterization;
jitter = settings.jitter !== undefined ? settings.jitter : jitter;
rgb_shift = settings.rgb_shift !== undefined ? settings.rgb_shift : rgb_shift;
rbgShift = settings.rbgShift !== undefined ? settings.rbgShift : rbgShift;
ambient_light = settings.ambient_light !== undefined ? settings.ambient_light : ambient_light;
ambientLight = settings.ambientLight !== undefined ? settings.ambientLight : ambientLight;
contrast = settings.contrast !== undefined ? settings.contrast : contrast;
brightness = settings.brightness !== undefined ? settings.brightness : brightness;
windowOpacity = settings.windowOpacity !== undefined ? settings.windowOpacity : windowOpacity;
fontIndexes[rasterization] = settings.fontIndex !== undefined ? settings.fontIndex : fontIndexes[rasterization];
fontNames[rasterization] = settings.fontName !== undefined ? settings.fontName : fontNames[rasterization];
fontWidth = settings.fontWidth !== undefined ? settings.fontWidth : fontWidth;
handleFontChanged();
}
function storeCustomProfiles(){
@@ -299,89 +339,86 @@ Item{
var customProfiles = JSON.parse(customProfilesString);
for (var i=0; i<customProfiles.length; i++) {
var profile = customProfiles[i];
console.log("Loading custom profile: " + JSON.stringify(profile));
profiles_list.append(profile);
if (verbose)
console.log("Loading custom profile: " + stringify(profile));
profilesList.append(profile);
}
}
function composeCustomProfilesString(){
var customProfiles = []
for(var i=0; i<profileslist.count; i++){
var profile = profileslist.get(i);
for(var i=0; i<profilesList.count; i++){
var profile = profilesList.get(i);
if(profile.builtin) continue;
customProfiles.push({text: profile.text, obj_string: profile.obj_string, builtin: false})
}
return JSON.stringify(customProfiles);
}
function loadCurrentProfile(){
loadProfile(profiles_index);
return stringify(customProfiles);
}
function loadProfile(index){
var profile = profileslist.get(index);
var profile = profilesList.get(index);
loadProfileString(profile.obj_string);
}
function addNewCustomProfile(name){
var profileString = composeProfileString();
profileslist.append({text: name, obj_string: profileString, builtin: false});
function appendCustomProfile(name, profileString) {
profilesList.append({text: name, obj_string: profileString, builtin: false});
}
// PROFILES ///////////////////////////////////////////////////////////////
ListModel{
id: profileslist
property ListModel profilesList: ListModel{
ListElement{
text: "Default Amber"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.65,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.4,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.16,"backgroundColor":"#000000","bloom":0.65,"brightness":0.5,"flickering":0.1,"contrast":0.85,"fontName":"TERMINUS_SCALED","fontColor":"#ff8100","frameName":"SIMPLE_WHITE_FRAME","glowingLine":0.2,"horizontalSync":0.16,"jitter":0.18,"burnIn":0.4,"staticNoise":0.1,"rasterization":0,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true
}
ListElement{
text: "Default Green"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.45,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.16,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.1,"contrast":0.85,"fontName":"TERMINUS_SCALED","fontColor":"#0ccc68","frameName":"SIMPLE_WHITE_FRAME","glowingLine":0.2,"horizontalSync":0.16,"jitter":0.18,"burnIn":0.45,"staticNoise":0.1,"rasterization":0,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true
}
ListElement{
text: "Default Scanlines"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#00ff5b","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.07,"jitter":0.11,"motion_blur":0.4,"noise_strength":0.05,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.16,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.1,"contrast":0.85,"fontName":"COMMODORE_PET","fontColor":"#00ff5b","frameName":"SIMPLE_WHITE_FRAME","glowingLine":0.2,"horizontalSync":0.14,"jitter":0.11,"burnIn":0.4,"staticNoise":0.05,"rasterization":1,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true
}
ListElement{
text: "Default Pixelated"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.1,"jitter":0,"motion_blur":0.45,"noise_strength":0.14,"rasterization":2,"screen_distortion":0.05,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.16,"backgroundColor":"#000000","bloom":0,"brightness":0.5,"flickering":0.2,"contrast":0.85,"fontName":"COMMODORE_PET","fontColor":"#ffffff","frameName":"ROUGH_BLACK_FRAME","glowingLine":0.2,"horizontalSync":0.2,"jitter":0,"burnIn":0.45,"staticNoise":0.19,"rasterization":2,"screenCurvature":0.05,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true
}
ListElement{
text: "Apple ]["
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.5,"brightness":0.5,"brightness_flickering":0.2,"contrast":0.85,"fontIndex":2,"font_color":"#2fff91","frames_index":1,"glowing_line_strength":0.22,"horizontal_sincronization":0.08,"jitter":0.1,"motion_blur":0.65,"noise_strength":0.08,"rasterization":1,"screen_distortion":0.18,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.16,"backgroundColor":"#000000","bloom":0.5,"brightness":0.5,"flickering":0.2,"contrast":0.85,"fontName":"APPLE_II","fontColor":"#2fff91","frameName":"SIMPLE_WHITE_FRAME","glowingLine":0.22,"horizontalSync":0.16,"jitter":0.1,"burnIn":0.65,"staticNoise":0.08,"rasterization":1,"screenCurvature":0.18,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true
}
ListElement{
text: "Vintage"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.54,"contrast":0.85,"fontIndex":0,"font_color":"#00ff3e","frames_index":2,"glowing_line_strength":0.3,"horizontal_sincronization":0.2,"jitter":0.4,"motion_blur":0.75,"noise_strength":0.2,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.5,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.9,"contrast":0.80,"fontName":"COMMODORE_PET","fontColor":"#00ff3e","frameName":"ROUGH_BLACK_FRAME","glowingLine":0.3,"horizontalSync":0.42,"jitter":0.4,"burnIn":0.75,"staticNoise":0.2,"rasterization":1,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true
}
ListElement{
text: "IBM Dos"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.07,"contrast":0.85,"fontIndex":7,"font_color":"#ffffff","frames_index":1,"glowing_line_strength":0.13,"horizontal_sincronization":0,"jitter":0.08,"motion_blur":0.3,"noise_strength":0.03,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":1,"saturation_color":0,"rgb_shift":0.5,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.16,"backgroundColor":"#000000","bloom":0.4,"brightness":0.5,"flickering":0.07,"contrast":0.85,"fontName":"IBM_DOS","fontColor":"#ffffff","frameName":"SIMPLE_WHITE_FRAME","glowingLine":0.13,"horizontalSync":0,"jitter":0.16,"burnIn":0.3,"staticNoise":0.03,"rasterization":0,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":1,"saturationColor":0,"rbgShift":0.35,"fontWidth":1.0}'
builtin: true
}
ListElement{
text: "IBM 3278"
obj_string: '{"ambient_light":0.1,"background_color":"#000000","bloom_strength":0.15,"brightness":0.5,"brightness_flickering":0,"contrast":0.95,"fontIndex":8,"font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0,"horizontal_sincronization":0,"jitter":0,"motion_blur":0.6,"noise_strength":0,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.1,"backgroundColor":"#000000","bloom":0.15,"brightness":0.5,"flickering":0,"contrast":0.85,"fontName":"IBM_3278","fontColor":"#0ccc68","frameName":"SIMPLE_WHITE_FRAME","glowingLine":0,"horizontalSync":0,"jitter":0,"burnIn":0.6,"staticNoise":0,"rasterization":0,"screenCurvature":0.1,"windowOpacity":1,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true
}
ListElement{
text: "Transparent Green"
obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4549689440993788,"brightness":0.5,"brightness_flickering":0.20341614906832298,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":0,"glowing_line_strength":0.15993788819875776,"horizontal_sincronization":0.05045871559633028,"jitter":0.20341614906832298,"motion_blur":0.24999999999999997,"noise_strength":0.20031055900621117,"rasterization":0,"screen_distortion":0.05045871559633028,"windowOpacity":0.5956221198156681,"chroma_color":0,"saturation_color":0,"rgb_shift":0,"fontWidth":1.0}'
obj_string: '{"ambientLight":0.2,"backgroundColor":"#000000","bloom":0.45,"brightness":0.5,"flickering":0.20,"contrast":0.85,"fontName":"TERMINUS_SCALED","fontColor":"#0ccc68","frameName":"NO_FRAME","glowingLine":0.16,"horizontalSync":0.1,"jitter":0.20,"burnIn":0.25,"staticNoise":0.20,"rasterization":0,"screenCurvature":0.05,"windowOpacity":0.60,"chromaColor":0,"saturationColor":0,"rbgShift":0,"fontWidth":1.0}'
builtin: true
}
}
function getProfileIndexByName(name) {
for (var i = 0; i < profileslist.count; i++) {
if(profileslist.get(i).text === name)
for (var i = 0; i < profilesList.count; i++) {
if(profilesList.get(i).text === name)
return i;
}
return -1;
@@ -390,6 +427,9 @@ Item{
Component.onCompleted: {
// Manage the arguments from the QML side.
var args = Qt.application.arguments;
if (args.indexOf("--verbose") !== -1) {
verbose = true;
}
if (args.indexOf("--default-settings") === -1) {
loadSettings();
}

View File

@@ -31,12 +31,12 @@ MenuBar {
title: qsTr("Profiles")
visible: defaultMenuBar.visible
Instantiator{
model: shadersettings.profiles_list
model: appSettings.profilesList
delegate: MenuItem {
text: model.text
onTriggered: {
shadersettings.loadProfileString(obj_string);
shadersettings.handleFontChanged();
appSettings.loadProfileString(obj_string);
appSettings.handleFontChanged();
}
}
onObjectAdded: profilesMenu.insertItem(index, object)

View File

@@ -22,8 +22,10 @@ import QtQuick 2.2
import QtQuick.Dialogs 1.1
Item {
id: rootItem
signal colorSelected (color color)
property color button_color
property color color
property string name
ColorDialog {
@@ -33,13 +35,13 @@ Item {
visible: false
//This is a workaround to a Qt 5.2 bug.
onCurrentColorChanged: colorDialog.color = colorDialog.currentColor;
onAccepted: colorSelected(color)
onColorChanged: if (Qt.platform.os !== "osx") colorSelected(color)
onAccepted: if (Qt.platform.os === "osx") colorSelected(color)
}
Rectangle{
anchors.fill: parent
radius: 10
color: button_color
color: rootItem.color
border.color: "black"
Glossy {}
Rectangle {
@@ -52,7 +54,7 @@ Item {
Text{
anchors.centerIn: parent
z: parent.z + 1
text: name + ": " + button_color
text: name + ": " + rootItem.color
}
}
MouseArea{

View File

@@ -20,45 +20,80 @@
import QtQuick 2.2
Item{
QtObject{
property int selectedFontIndex
property real scaling
property alias fontlist: fontlist
property var _font: fontlist.get(selectedFontIndex)
property var source: _font.source
property int pixelSize: _font.pixelSize
property int lineSpacing: _font.lineSpacing
property real screenScaling: scaling * _font.baseScaling
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
property bool lowResolutionFont: true
ListModel{
id: fontlist
property ListModel fontlist: ListModel{
ListElement{
name: "COMMODORE_PET"
text: "Commodore PET (1977)"
source: "fonts/1977-commodore-pet/COMMODORE_PET.ttf"
lineSpacing: 2
pixelSize: 8
baseScaling: 4.0
fontWidth: 0.8
}
ListElement{
name: "PROGGY_TINY"
text: "Proggy Tiny (Modern)"
source: "fonts/modern-proggy-tiny/ProggyTiny.ttf"
lineSpacing: 1
pixelSize: 16
baseScaling: 4.0
fontWidth: 0.9
}
ListElement{
name: "TERMINUS_SCALED"
text: "Terminus (Modern)"
source: "fonts/modern-terminus/TerminusTTF-4.38.2.ttf"
lineSpacing: 1
pixelSize: 12
baseScaling: 3.0
fontWidth: 1.0
}
ListElement{
name: "PRO_FONT_SCALED"
text: "Pro Font (Modern)"
source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf"
lineSpacing: 1
pixelSize: 12
baseScaling: 3.0
fontWidth: 1.0
}
ListElement{
name: "APPLE_II"
text: "Apple ][ (1977)"
source: "fonts/1977-apple2/PrintChar21.ttf"
lineSpacing: 2
pixelSize: 8
baseScaling: 4.0
fontWidth: 0.9
}
ListElement{
name: "ATARI_400"
text: "Atari 400-800 (1979)"
source: "fonts/1979-atari-400-800/ATARI400800_original.TTF"
lineSpacing: 3
pixelSize: 8
baseScaling: 4.0
fontWidth: 0.8
}
ListElement{
name: "COMMODORE_64"
text: "Commodore 64 (1982)"
source: "fonts/1982-commodore64/C64_User_Mono_v1.0-STYLE.ttf"
source: "fonts/1982-commodore64/C64_Pro_Mono_v1.0-STYLE.ttf"
lineSpacing: 3
pixelSize: 8
baseScaling: 4.0
fontWidth: 0.8
}
}
}

View File

@@ -20,45 +20,80 @@
import QtQuick 2.2
Item{
QtObject{
property int selectedFontIndex
property real scaling
property alias fontlist: fontlist
property var _font: fontlist.get(selectedFontIndex)
property var source: _font.source
property int pixelSize: _font.pixelSize
property int lineSpacing: _font.lineSpacing
property real screenScaling: scaling * _font.baseScaling
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
property bool lowResolutionFont: true
ListModel{
id: fontlist
property ListModel fontlist: ListModel{
ListElement{
name: "COMMODORE_PET"
text: "Commodore PET (1977)"
source: "fonts/1977-commodore-pet/COMMODORE_PET.ttf"
lineSpacing: 2
pixelSize: 8
baseScaling: 4.0
fontWidth: 0.7
}
ListElement{
name: "PROGGY_TINY"
text: "Proggy Tiny (Modern)"
source: "fonts/modern-proggy-tiny/ProggyTiny.ttf"
lineSpacing: 1
pixelSize: 16
baseScaling: 4.0
fontWidth: 0.9
}
ListElement{
name: "TERMINUS_SCALED"
text: "Terminus (Modern)"
source: "fonts/modern-terminus/TerminusTTF-4.38.2.ttf"
lineSpacing: 1
pixelSize: 12
baseScaling: 3.0
fontWidth: 1.0
}
ListElement{
name: "PRO_FONT_SCALED"
text: "Pro Font (Modern)"
source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf"
lineSpacing: 1
pixelSize: 12
baseScaling: 3.0
fontWidth: 1.0
}
ListElement{
name: "APPLE_II"
text: "Apple ][ (1977)"
source: "fonts/1977-apple2/PrintChar21.ttf"
lineSpacing: 2
pixelSize: 8
baseScaling: 4.0
fontWidth: 0.8
}
ListElement{
name: "ATARI_400"
text: "Atari 400-800 (1979)"
source: "fonts/1979-atari-400-800/ATARI400800_original.TTF"
lineSpacing: 3
pixelSize: 8
baseScaling: 4.0
fontWidth: 0.7
}
ListElement{
name: "COMMODORE_64"
text: "Commodore 64 (1982)"
source: "fonts/1982-commodore64/C64_User_Mono_v1.0-STYLE.ttf"
source: "fonts/1982-commodore64/C64_Pro_Mono_v1.0-STYLE.ttf"
lineSpacing: 3
pixelSize: 8
baseScaling: 4.0
fontWidth: 0.7
}
}
}

View File

@@ -20,73 +20,188 @@
import QtQuick 2.2
Item{
QtObject{
property int selectedFontIndex
property real scaling
property alias fontlist: fontlist
property var source: fontlist.get(selectedFontIndex).source
property var _font: fontlist.get(selectedFontIndex)
property int pixelSize: _font.pixelSize * scaling
property int lineSpacing: pixelSize * _font.lineSpacing
property real screenScaling: 1.0
property bool lowResolutionFont: _font.lowResolutionFont
//In this configuration lineSpacing is proportional to pixelSize.
property int pixelSize: lowResolutionFont
? _font.pixelSize
: _font.pixelSize * scaling
ListModel{
id: fontlist
property int lineSpacing: lowResolutionFont
? _font.lineSpacing
: pixelSize * _font.lineSpacing
property real screenScaling: lowResolutionFont
? _font.baseScaling * scaling
: 1.0
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
// There are two kind of fonts: low resolution and high resolution.
// Low resolution font sets the lowResolutionFont property to true.
// They are rendered at a fixed pixel size and the texture is upscaled
// to fill the screen (they are much faster to render).
// High resolution fonts are instead drawn on a texture which has the
// size of the screen, and the scaling directly controls their pixels size.
// Those are slower to render but are not pixelated.
property ListModel fontlist: ListModel{
ListElement{
name: "TERMINUS_SCALED"
text: "Terminus (Modern)"
source: "fonts/modern-terminus/TerminusTTF-Bold-4.38.2.ttf"
lineSpacing: 0.2
pixelSize: 35
source: "fonts/modern-terminus/TerminusTTF-4.38.2.ttf"
lineSpacing: 1
pixelSize: 12
baseScaling: 3.0
fontWidth: 1.0
lowResolutionFont: true
}
ListElement{
name: "PRO_FONT_SCALED"
text: "Pro Font (Modern)"
source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf"
lineSpacing: 1
pixelSize: 12
baseScaling: 3.0
fontWidth: 1.0
lowResolutionFont: true
}
ListElement{
name: "COMMODORE_PET_SCALED"
text: "Commodore PET (1977)"
source: "fonts/1977-commodore-pet/COMMODORE_PET.ttf"
lineSpacing: 0.2
pixelSize: 24
lineSpacing: 2
pixelSize: 8
baseScaling: 3.5
fontWidth: 0.7
lowResolutionFont: true
}
ListElement{
text: "Commodore PET 2Y (1977)"
source: "fonts/1977-commodore-pet/COMMODORE_PET_2y.ttf"
lineSpacing: 0.2
pixelSize: 32
name: "PROGGY_TINY_SCALED"
text: "Proggy Tiny (Modern)"
source: "fonts/modern-proggy-tiny/ProggyTiny.ttf"
lineSpacing: 1
pixelSize: 16
baseScaling: 3.0
fontWidth: 0.9
lowResolutionFont: true
}
ListElement{
name: "APPLE_II_SCALED"
text: "Apple ][ (1977)"
source: "fonts/1977-apple2/PrintChar21.ttf"
lineSpacing: 0.2
pixelSize: 24
lineSpacing: 2
pixelSize: 8
baseScaling: 3.5
fontWidth: 0.8
lowResolutionFont: true
}
ListElement{
name: "ATARI_400_SCALED"
text: "Atari 400-800 (1979)"
source: "fonts/1979-atari-400-800/ATARI400800_original.TTF"
lineSpacing: 0.3
pixelSize: 24
lineSpacing: 3
pixelSize: 8
baseScaling: 3.5
fontWidth: 0.7
lowResolutionFont: true
}
ListElement{
name: "COMMODORE_64_SCALED"
text: "Commodore 64 (1982)"
source: "fonts/1982-commodore64/C64_User_Mono_v1.0-STYLE.ttf"
lineSpacing: 0.3
pixelSize: 24
source: "fonts/1982-commodore64/C64_Pro_Mono_v1.0-STYLE.ttf"
lineSpacing: 3
pixelSize: 8
baseScaling: 3.5
fontWidth: 0.7
lowResolutionFont: true
}
ListElement{
name: "ATARI_ST_SCALED"
text: "Atari ST (1985)"
source: "fonts/1985-atari-st/AtariST8x16SystemFont.ttf"
lineSpacing: 0.2
pixelSize: 32
lineSpacing: 3
pixelSize: 16
baseScaling: 2.0
fontWidth: 1.0
lowResolutionFont: true
}
ListElement{
name: "IBM_DOS"
text: "IBM DOS (1985)"
source: "fonts/1985-ibm-pc-vga/Perfect DOS VGA 437.ttf"
lineSpacing: 0.2
pixelSize: 32
source: "fonts/1985-ibm-pc-vga/Perfect DOS VGA 437 Win.ttf"
lineSpacing: 3
pixelSize: 16
baseScaling: 2.0
fontWidth: 1.0
lowResolutionFont: true
}
ListElement{
text: "IBM 3278 (1971)"
name: "HERMIT"
text: "HD: Hermit (Modern)"
source: "fonts/modern-hermit/Hermit-medium.otf"
lineSpacing: 0.05
pixelSize: 28
fontWidth: 1.0
lowResolutionFont: false
}
ListElement{
name: "TERMINUS"
text: "HD: Terminus (Modern)"
source: "fonts/modern-terminus/TerminusTTF-4.38.2.ttf"
lineSpacing: 0.1
pixelSize: 35
fontWidth: 1.0
lowResolutionFont: false
}
ListElement{
name: "PRO_FONT"
text: "HD: Pro Font (Modern)"
source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf"
lineSpacing: 0.1
pixelSize: 35
fontWidth: 1.0
lowResolutionFont: false
}
ListElement{
name: "ENVY_CODE_R"
text: "HD: Envy Code R (Modern)"
source: "fonts/modern-envy-code-r/Envy Code R.ttf"
lineSpacing: 0.1
pixelSize: 30
fontWidth: 1.0
lowResolutionFont: false
}
ListElement{
name: "MONACO"
text: "HD: Monaco (Modern)"
source: "fonts/modern-monaco/monaco.ttf"
lineSpacing: 0.1
pixelSize: 30
fontWidth: 1.0
lowResolutionFont: false
}
ListElement{
name: "INCONSOLATA"
text: "HD: Inconsolata (Modern)"
source: "fonts/modern-inconsolata/Inconsolata.otf"
lineSpacing: 0.1
pixelSize: 35
fontWidth: 1.0
lowResolutionFont: false
}
ListElement{
name: "IBM_3278"
text: "HD: IBM 3278 (1971)"
source: "fonts/1971-ibm-3278/3270Medium.ttf"
lineSpacing: 0.2
pixelSize: 32
fontWidth: 1.0
lowResolutionFont: false
}
}
}

View File

@@ -31,6 +31,7 @@ Window{
modality: Qt.ApplicationModal
title: qsTr("Save new profile")
property alias profileName: namefield.text
signal nameSelected(string name)
MessageDialog {
@@ -45,15 +46,9 @@ Window{
}
function validateName(name){
var profile_list = shadersettings.profiles_list;
var profile_list = appSettings.profilesList;
if (name === "")
return 1;
for (var i = 0; i < profile_list.count; i++){
if(profile_list.get(i).text === name)
return 2;
}
return 0;
}
@@ -82,9 +77,6 @@ Window{
case 1:
errorDialog.showError(qsTr("The name you inserted is empty. Please choose a different one."));
break;
case 2:
errorDialog.showError(qsTr("The name you inserted already exists. Please choose a different one."));
break;
default:
nameSelected(name);
close();

View File

@@ -19,67 +19,53 @@
*******************************************************************************/
import QtQuick 2.2
import QtGraphicalEffects 1.0
import QtQuick.Controls 1.1
import org.crt.konsole 0.1
import QMLTermWidget 1.0
import "utils.js" as Utils
Item{
id: terminalContainer
//Frame displacement properties. This makes the terminal the same size of the texture.
property real dtop: frame.item.displacementTop
property real dleft:frame.item.displacementLeft
property real dright: frame.item.displacementRight
property real dbottom: frame.item.displacementBottom
anchors.leftMargin: dleft
anchors.rightMargin: dright
anchors.topMargin: dtop
anchors.bottomMargin: dbottom
property variant theSource: mBlur !== 0 ? blurredSourceLoader.item : kterminalSource
property variant bloomSource: bloomSourceLoader.item
property variant rasterizationSource: rasterizationEffectSource
property variant staticNoiseSource: staticNoiseSource
property size virtualResolution: Qt.size(kterminal.width, kterminal.height)
property alias mainTerminal: kterminal
property ShaderEffectSource mainSource: kterminalSource
property ShaderEffectSource blurredSource: blurredSourceLoader.item
property real fontWidth: 1.0
property real screenScaling: 1.0
property real scaleTexture: 1.0
property alias title: ksession.title
property alias kterminal: kterminal
signal sizeChanged
onWidthChanged: sizeChanged()
onHeightChanged: sizeChanged()
anchors.leftMargin: frame.displacementLeft * appSettings.windowScaling
anchors.rightMargin: frame.displacementRight * appSettings.windowScaling
anchors.topMargin: frame.displacementTop * appSettings.windowScaling
anchors.bottomMargin: frame.displacementBottom * appSettings.windowScaling
//The blur effect has to take into account the framerate
property int fps: shadersettings.fps !== 0 ? shadersettings.fps : 60
property real fpsAttenuation: Math.sqrt(60 / fps)
property real mBlur: shadersettings.motion_blur
property real motionBlurCoefficient: (_maxBlurCoefficient * mBlur + _minBlurCoefficient * (1 - mBlur))
property real _minBlurCoefficient: 0.70
property real _maxBlurCoefficient: 0.90
property real mBloom: shadersettings.bloom_strength
property int mScanlines: shadersettings.rasterization
onMScanlinesChanged: restartBlurredSource()
property real mBlur: Math.sqrt(appSettings.burnIn)
property real motionBlurCoefficient: Utils.lint(_minBlurCoefficient, _maxBlurCoefficient, mBlur)
property real _minBlurCoefficient: 0.2
property real _maxBlurCoefficient: 0.02
property size terminalSize: kterminal.terminalSize
property size paintedTextSize
property size fontMetrics: kterminal.fontMetrics
onMBlurChanged: restartBlurredSource()
function restartBlurredSource(){
if(!blurredSourceLoader.item) return;
blurredSourceLoader.item.restartBlurSource();
// Manage copy and paste
Connections{
target: copyAction
onTriggered: kterminal.copyClipboard();
}
function pasteClipboard(){
kterminal.pasteClipboard();
}
function copyClipboard(){
kterminal.copyClipboard();
Connections{
target: pasteAction
onTriggered: kterminal.pasteClipboard()
}
//When settings are updated sources need to be redrawn.
Connections{
target: shadersettings
target: appSettings
onFontScalingChanged: terminalContainer.updateSources();
onFontWidthChanged: terminalContainer.updateSources();
}
@@ -90,57 +76,69 @@ Item{
}
function updateSources() {
kterminal.update();
kterminal.updateImage();
}
KTerminal {
QMLTermWidget {
id: kterminal
width: parent.width
height: parent.height
width: Math.floor(parent.width / (screenScaling * fontWidth))
height: Math.floor(parent.height / screenScaling)
colorScheme: "cool-retro-term"
smooth: false
smooth: !appSettings.lowResolutionFont
enableBold: false
fullCursorHeight: true
session: KSession {
session: QMLTermSession {
id: ksession
kbScheme: "xterm"
onFinished: {
Qt.quit()
}
}
FontLoader{ id: fontLoader }
Text{id: fontMetrics; text: "B"; visible: false}
QMLTermScrollbar {
id: kterminalScrollbar
terminal: kterminal
anchors.margins: width * 0.5
width: terminal.fontMetrics.width * 0.75
Rectangle {
anchors.fill: parent
anchors.topMargin: 1
anchors.bottomMargin: 1
color: "white"
radius: width * 0.25
opacity: 0.7
}
}
function handleFontChange(fontSource, pixelSize, lineSpacing, screenScaling){
FontLoader{ id: fontLoader }
function handleFontChange(fontSource, pixelSize, lineSpacing, screenScaling, fontWidth){
fontLoader.source = fontSource;
kterminal.antialiasText = !appSettings.lowResolutionFont;
font.pixelSize = pixelSize;
font.family = fontLoader.name;
var fontWidth = 1.0 / shadersettings.fontWidth;
terminalContainer.fontWidth = fontWidth;
terminalContainer.screenScaling = screenScaling;
scaleTexture = Math.max(1.0, Math.floor(screenScaling * appSettings.windowScaling));
width = Qt.binding(function() {return Math.floor(fontWidth * terminalContainer.width / screenScaling);});
height = Qt.binding(function() {return Math.floor(terminalContainer.height / screenScaling);});
var scaleTexture = Math.max(Math.round(screenScaling / shadersettings.scanline_quality), 1.0);
kterminalSource.textureSize = Qt.binding(function () {
return Qt.size(kterminal.width * scaleTexture, kterminal.height * scaleTexture);
});
setLineSpacing(lineSpacing);
update();
restartBlurredSource();
kterminal.lineSpacing = lineSpacing;
}
Component.onCompleted: {
shadersettings.terminalFontChanged.connect(handleFontChange);
appSettings.terminalFontChanged.connect(handleFontChange);
// Retrieve the variable set in main.cpp if arguments are passed.
if (shellProgram)
ksession.setShellProgram(shellProgram);
if (defaultCmd) {
ksession.setShellProgram(defaultCmd);
ksession.setArgs(defaultCmdArgs);
} else if (!defaultCmd && Qt.platform.os === "osx") {
// OSX Requires the following default parameters for auto login.
ksession.setArgs(["-i", "-l"]);
}
if (workdir)
ksession.initialWorkingDirectory = workdir;
@@ -148,49 +146,64 @@ Item{
forceActiveFocus();
}
}
Menu{
id: contextmenu
MenuItem{action: copyAction}
MenuItem{action: pasteAction}
MenuSeparator{visible: Qt.platform.os !== "osx"}
MenuItem{action: fullscreenAction; visible: Qt.platform.os !== "osx"}
MenuItem{action: showMenubarAction; visible: Qt.platform.os !== "osx"}
MenuSeparator{visible: !shadersettings.showMenubar}
CRTMainMenuBar{visible: !shadersettings.showMenubar}
Component {
id: linuxContextMenu
Menu{
id: contextmenu
MenuItem{action: copyAction}
MenuItem{action: pasteAction}
MenuSeparator{}
MenuItem{action: fullscreenAction}
MenuItem{action: showMenubarAction}
MenuSeparator{visible: !appSettings.showMenubar}
CRTMainMenuBar{visible: !appSettings.showMenubar}
}
}
Component {
id: osxContextMenu
Menu{
id: contextmenu
MenuItem{action: copyAction}
MenuItem{action: pasteAction}
}
}
Loader {
id: menuLoader
sourceComponent: (Qt.platform.os === "osx" ? osxContextMenu : linuxContextMenu)
}
property alias contextmenu: menuLoader.item
MouseArea{
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
// This is incredibly ugly. All this file should be reorganized.
width: (parent.width + dleft + dright) / shadersettings.window_scaling - dleft -dright
height: (parent.height + dtop + dbottom) / shadersettings.window_scaling - dtop - dbottom
anchors.fill: parent
cursorShape: Qt.IBeamCursor
onWheel:{
if(wheel.modifiers & Qt.ControlModifier){
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
} else {
var coord = correctDistortion(wheel.x, wheel.y);
var lines = wheel.angleDelta.y > 0 ? -1 : 1;
kterminal.scrollWheelEvent(coord, lines);
kterminal.simulateWheel(coord.x, coord.y, wheel.buttons, wheel.modifiers, wheel.angleDelta);
}
}
onDoubleClicked: {
var coord = correctDistortion(mouse.x, mouse.y);
kterminal.mouseDoubleClickEvent(coord, mouse.button, mouse.modifiers);
kterminal.simulateMouseDoubleClick(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
}
onPressed: {
if((!kterminal.usesMouse || mouse.modifiers & Qt.ShiftModifier) && mouse.button == Qt.RightButton) {
if((!kterminal.terminalUsesMouse || mouse.modifiers & Qt.ShiftModifier) && mouse.button == Qt.RightButton) {
contextmenu.popup();
} else {
var coord = correctDistortion(mouse.x, mouse.y);
kterminal.mousePressEvent(coord, mouse.button, mouse.modifiers)
kterminal.simulateMousePress(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers)
}
}
onReleased: {
var coord = correctDistortion(mouse.x, mouse.y);
kterminal.mouseReleaseEvent(coord, mouse.button, mouse.modifiers);
kterminal.simulateMouseRelease(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
}
onPositionChanged: {
var coord = correctDistortion(mouse.x, mouse.y);
kterminal.mouseMoveEvent(coord, mouse.button, mouse.buttons, mouse.modifiers);
kterminal.simulateMouseMove(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
}
function correctDistortion(x, y){
@@ -198,7 +211,7 @@ Item{
y = y / height;
var cc = Qt.size(0.5 - x, 0.5 - y);
var distortion = (cc.height * cc.height + cc.width * cc.width) * shadersettings.screen_distortion;
var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screenCurvature;
return Qt.point((x - cc.width * (1+distortion) * distortion) * kterminal.width,
(y - cc.height * (1+distortion) * distortion) * kterminal.height)
@@ -209,17 +222,8 @@ Item{
sourceItem: kterminal
hideSource: true
wrapMode: ShaderEffectSource.ClampToEdge
live: false
signal sourceUpdate
Connections{
target: kterminal
onUpdatedImage:{
kterminalSource.scheduleUpdate();
kterminalSource.sourceUpdate();
}
}
visible: false
textureSize: Qt.size(kterminal.width * scaleTexture, kterminal.height * scaleTexture);
}
Loader{
id: blurredSourceLoader
@@ -230,54 +234,68 @@ Item{
id: _blurredSourceEffect
sourceItem: blurredTerminalLoader.item
recursive: true
live: false
live: true
hideSource: true
wrapMode: kterminalSource.wrapMode
visible: false
function restartBlurSource(){
livetimer.restart();
}
Timer{
id: livetimer
// The interval assumes 60 fps. This is the time needed burnout a white pixel.
// We multiply 1.1 to have a little bit of margin over the theoretical value.
// This solution is not extremely clean, but it's probably the best to avoid measuring fps.
interval: (1 / motionBlurCoefficient) * 60 * 1.1
running: true
onRunningChanged: {
running ?
timeBinding.target = timeManager :
timeBinding.target = null
}
onTriggered: _blurredSourceEffect.live = false;
}
Connections{
id: timeBinding
target: timeManager
onTimeChanged: {
_blurredSourceEffect.scheduleUpdate();
}
}
Connections{
target: kterminalSource
onSourceUpdate:{
target: kterminal
onImagePainted:{
_blurredSourceEffect.live = true;
livetimer.restart();
}
}
// Restart blurred source settings change.
Connections{
target: shadersettings
onScanline_qualityChanged: restartBlurredSource();
target: appSettings
onBurnInChanged: _blurredSourceEffect.restartBlurSource();
onTerminalFontChanged: _blurredSourceEffect.restartBlurSource();
onRasterizationChanged: _blurredSourceEffect.restartBlurSource();
onBurnInQualityChanged: _blurredSourceEffect.restartBlurSource();
}
Connections {
target: kterminalScrollbar
onOpacityChanged: _blurredSourceEffect.restartBlurSource();
}
}
}
Loader{
id: blurredTerminalLoader
width: kterminalSource.textureSize.width
height: kterminalSource.textureSize.height
property int burnInScaling: scaleTexture * appSettings.burnInQuality
width: appSettings.lowResolutionFont
? kterminal.width * Math.max(1, burnInScaling)
: kterminal.width * scaleTexture * appSettings.burnInQuality
height: appSettings.lowResolutionFont
? kterminal.height * Math.max(1, burnInScaling)
: kterminal.height * scaleTexture * appSettings.burnInQuality
active: mBlur !== 0
asynchronous: true
sourceComponent: ShaderEffect {
property variant txt_source: kterminalSource
property variant blurredSource: blurredSourceLoader.item
property real blurCoefficient: (1.0 - motionBlurCoefficient) * fpsAttenuation
property real blurCoefficient: motionBlurCoefficient
blending: false
@@ -296,149 +314,14 @@ Item{
"void main() {" +
"vec2 coords = qt_TexCoord0;" +
"vec3 color = texture2D(txt_source, coords).rgb * 256.0;" +
"vec3 origColor = texture2D(txt_source, coords).rgb;" +
"vec3 blur_color = texture2D(blurredSource, coords).rgb - vec3(blurCoefficient);" +
"vec3 color = min(origColor + blur_color, max(origColor, blur_color));" +
"vec3 blur_color = texture2D(blurredSource, coords).rgb * 256.0;" +
"blur_color = blur_color - blur_color * blurCoefficient;" +
"color = step(vec3(1.0), color) * color + step(color, vec3(1.0)) * blur_color;" +
"gl_FragColor = vec4(floor(color) / 256.0, 1.0);" +
"gl_FragColor = vec4(color, rgb2grey(color - origColor));" +
"}"
onStatusChanged: if (log) console.log(log) //Print warning messages
}
}
///////////////////////////////////////////////////////////////////////////
// EFFECTS //////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// BLOOM ////////////////////////////////////////////////////////////////
Loader{
property real scaling: shadersettings.bloom_quality * shadersettings.window_scaling
id: bloomEffectLoader
active: mBloom != 0
asynchronous: true
width: parent.width * scaling
height: parent.height * scaling
sourceComponent: FastBlur{
radius: 48 * scaling
source: kterminal
transparentBorder: true
}
}
Loader{
id: bloomSourceLoader
active: mBloom != 0
asynchronous: true
sourceComponent: ShaderEffectSource{
id: _bloomEffectSource
sourceItem: bloomEffectLoader.item
hideSource: true
live: false
smooth: true
Connections{
target: kterminalSource
onSourceUpdate: _bloomEffectSource.scheduleUpdate();
}
}
}
// NOISE ////////////////////////////////////////////////////////////////
ShaderEffect {
id: staticNoiseEffect
anchors.fill: parent
property real element_size: shadersettings.rasterization == shadersettings.no_rasterization ? 2 : 1
property size virtual_resolution: Qt.size(kterminal.width / element_size, kterminal.height / element_size)
blending: false
fragmentShader:
"uniform lowp float qt_Opacity;
varying highp vec2 qt_TexCoord0;
uniform highp vec2 virtual_resolution;" +
"highp float noise(vec2 co)
{
highp float a = 12.9898;
highp float b = 78.233;
highp float c = 43758.5453;
highp float dt= dot(co.xy ,vec2(a,b));
highp float sn= mod(dt,3.14);
return fract(sin(sn) * c);
}
vec2 sw(vec2 p) {return vec2( floor(p.x) , floor(p.y) );}
vec2 se(vec2 p) {return vec2( ceil(p.x) , floor(p.y) );}
vec2 nw(vec2 p) {return vec2( floor(p.x) , ceil(p.y) );}
vec2 ne(vec2 p) {return vec2( ceil(p.x) , ceil(p.y) );}
float smoothNoise(vec2 p) {
vec2 inter = smoothstep(0., 1., fract(p));
float s = mix(noise(sw(p)), noise(se(p)), inter.x);
float n = mix(noise(nw(p)), noise(ne(p)), inter.x);
return mix(s, n, inter.y);
}" +
"void main() {" +
"gl_FragColor.a = smoothNoise(qt_TexCoord0 * virtual_resolution);" +
"}"
onStatusChanged: if (log) console.log(log) //Print warning messages
}
ShaderEffectSource{
id: staticNoiseSource
sourceItem: staticNoiseEffect
textureSize: Qt.size(parent.width, parent.height)
wrapMode: ShaderEffectSource.Repeat
smooth: true
hideSource: true
}
// RASTERIZATION //////////////////////////////////////////////////////////
ShaderEffect {
id: rasterizationEffect
width: parent.width
height: parent.height
property size virtual_resolution: Qt.size(kterminal.width, kterminal.height)
blending: false
fragmentShader:
"uniform lowp float qt_Opacity;" +
"varying highp vec2 qt_TexCoord0;
uniform highp vec2 virtual_resolution;
highp float getScanlineIntensity(vec2 coords) {
highp float result = 1.0;" +
(mScanlines != shadersettings.no_rasterization ?
"result *= abs(sin(coords.y * virtual_resolution.y * "+Math.PI+"));" : "") +
(mScanlines == shadersettings.pixel_rasterization ?
"result *= abs(sin(coords.x * virtual_resolution.x * "+Math.PI+"));" : "") + "
return result;
}" +
"void main() {" +
"highp float color = getScanlineIntensity(qt_TexCoord0);" +
"float distance = length(vec2(0.5) - qt_TexCoord0);" +
"color = mix(color, 0.0, 1.2 * distance * distance);" +
"gl_FragColor.a = color;" +
"}"
onStatusChanged: if (log) console.log(log) //Print warning messages
}
ShaderEffectSource{
id: rasterizationEffectSource
sourceItem: rasterizationEffect
hideSource: true
smooth: true
wrapMode: ShaderEffectSource.Repeat
}
}

View File

@@ -28,57 +28,58 @@ Tab{
anchors.fill: parent
ColumnLayout{
anchors.fill: parent
spacing: 2
CheckableSlider{
name: qsTr("Bloom")
onNewValue: shadersettings.bloom_strength = newValue
value: shadersettings.bloom_strength
onNewValue: appSettings.bloom = newValue
value: appSettings.bloom
}
CheckableSlider{
name: qsTr("Motion Blur")
onNewValue: shadersettings.motion_blur = newValue
value: shadersettings.motion_blur
name: qsTr("BurnIn")
onNewValue: appSettings.burnIn = newValue
value: appSettings.burnIn
}
CheckableSlider{
name: qsTr("Noise")
onNewValue: shadersettings.noise_strength = newValue
value: shadersettings.noise_strength
name: qsTr("Static Noise")
onNewValue: appSettings.staticNoise = newValue
value: appSettings.staticNoise
}
CheckableSlider{
name: qsTr("Jitter")
onNewValue: shadersettings.jitter = newValue
value: shadersettings.jitter
onNewValue: appSettings.jitter = newValue
value: appSettings.jitter
}
CheckableSlider{
name: qsTr("Glow")
onNewValue: shadersettings.glowing_line_strength = newValue;
value: shadersettings.glowing_line_strength
name: qsTr("Glow Line")
onNewValue: appSettings.glowingLine = newValue;
value: appSettings.glowingLine
}
CheckableSlider{
name: qsTr("Screen distortion")
onNewValue: shadersettings.screen_distortion = newValue;
value: shadersettings.screen_distortion;
name: qsTr("Screen Curvature")
onNewValue: appSettings.screenCurvature = newValue;
value: appSettings.screenCurvature;
}
CheckableSlider{
name: qsTr("Ambient light")
onNewValue: shadersettings.ambient_light = newValue;
value: shadersettings.ambient_light
enabled: shadersettings.frames_index !== 0
name: qsTr("Ambient Light")
onNewValue: appSettings.ambientLight = newValue;
value: appSettings.ambientLight
enabled: appSettings.framesIndex !== 0
}
CheckableSlider{
name: qsTr("Brightness flickering")
onNewValue: shadersettings.brightness_flickering = newValue;
value: shadersettings.brightness_flickering;
name: qsTr("Flickering")
onNewValue: appSettings.flickering = newValue;
value: appSettings.flickering;
}
CheckableSlider{
name: qsTr("Horizontal flickering")
onNewValue: shadersettings.horizontal_sincronization = newValue;
value: shadersettings.horizontal_sincronization;
name: qsTr("Horizontal Sync")
onNewValue: appSettings.horizontalSync = newValue;
value: appSettings.horizontalSync;
}
CheckableSlider{
name: qsTr("RGB shift")
onNewValue: shadersettings.rgb_shift = newValue;
value: shadersettings.rgb_shift;
enabled: shadersettings.chroma_color !== 0
name: qsTr("RGB Shift")
onNewValue: appSettings.rbgShift = newValue;
value: appSettings.rbgShift;
enabled: appSettings.chromaColor !== 0
}
}
}

View File

@@ -21,88 +21,180 @@
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
Tab{
ColumnLayout{
anchors.fill: parent
GroupBox{
anchors {left: parent.left; right: parent.right}
Layout.fillWidth: true
Layout.fillHeight: true
title: qsTr("Profile")
ColumnLayout{
RowLayout {
anchors.fill: parent
ComboBox{
id: profilesbox
TableView {
id: profilesView
Layout.fillWidth: true
model: shadersettings.profiles_list
currentIndex: shadersettings.profiles_index
anchors { top: parent.top; bottom: parent.bottom; }
model: appSettings.profilesList
headerVisible: false
TableViewColumn {
title: qsTr("Profile")
role: "text"
width: parent.width * 0.5
}
onActivated: {
appSettings.loadProfile(row);
}
}
RowLayout{
Layout.fillWidth: true
ColumnLayout {
anchors { top: parent.top; bottom: parent.bottom }
Layout.fillWidth: false
Button{
Layout.fillWidth: true
text: qsTr("New")
onClicked: {
insertname.profileName = "";
insertname.show()
}
}
Button{
Layout.fillWidth: true
property alias currentIndex: profilesView.currentRow
enabled: currentIndex >= 0
text: qsTr("Load")
onClicked: {
shadersettings.profiles_index = profilesbox.currentIndex
shadersettings.loadCurrentProfile();
shadersettings.handleFontChanged();
var index = profilesView.currentRow;
if (index >= 0)
appSettings.loadProfile(index);
}
}
Button{
Layout.fillWidth: true
text: qsTr("Save New Profile")
onClicked: insertname.show()
}
Button{
Layout.fillWidth: true
text: qsTr("Remove Selected")
enabled: !shadersettings.profiles_list.get(profilesbox.currentIndex).builtin
text: qsTr("Remove")
property alias currentIndex: profilesView.currentRow
enabled: currentIndex >= 0 && !appSettings.profilesList.get(currentIndex).builtin
onClicked: {
shadersettings.profiles_list.remove(profilesbox.currentIndex)
profilesbox.currentIndex = profilesbox.currentIndex - 1
appSettings.profilesList.remove(currentIndex);
profilesView.selection.clear();
// TODO This is a very ugly workaround. The view didn't update on Qt 5.3.2.
profilesView.model = 0;
profilesView.model = appSettings.profilesList;
}
}
Item {
// Spacing
Layout.fillHeight: true
}
Button{
Layout.fillWidth: true
text: qsTr("Import")
onClicked: {
fileDialog.selectExisting = true;
fileDialog.callBack = function (url) {loadFile(url);};
fileDialog.open();
}
function loadFile(url) {
try {
if (appSettings.verbose)
console.log("Loading file: " + url);
var profileObject = JSON.parse(fileIO.read(url));
var name = profileObject.name;
if (!name)
throw "Profile doesn't have a name";
delete profileObject.name;
appSettings.appendCustomProfile(name, JSON.stringify(profileObject));
} catch (err) {
console.log(err);
messageDialog.text = qsTr("There has been an error reading the file.")
messageDialog.open();
}
}
}
Button{
property alias currentIndex: profilesView.currentRow
Layout.fillWidth: true
text: qsTr("Export")
enabled: currentIndex >= 0 && !appSettings.profilesList.get(currentIndex).builtin
onClicked: {
fileDialog.selectExisting = false;
fileDialog.callBack = function (url) {storeFile(url);};
fileDialog.open();
}
function storeFile(url) {
try {
var urlString = url.toString();
// Fix the extension if it's missing.
var extension = urlString.substring(urlString.length - 5, urlString.length);
var urlTail = (extension === ".json" ? "" : ".json");
url += urlTail;
if (true)
console.log("Storing file: " + url);
var profileObject = appSettings.profilesList.get(currentIndex);
var profileSettings = JSON.parse(profileObject.obj_string);
profileSettings["name"] = profileObject.text;
var result = fileIO.write(url, JSON.stringify(profileSettings, undefined, 2));
if (!result)
throw "The file could not be written.";
} catch (err) {
console.log(err);
messageDialog.text = qsTr("There has been an error storing the file.")
messageDialog.open();
}
}
}
}
InsertNameDialog{
id: insertname
onNameSelected: shadersettings.addNewCustomProfile(name)
}
}
}
GroupBox{
title: qsTr("Lights")
Layout.fillWidth: true
GridLayout{
anchors.fill: parent
columns: 2
Text{ text: qsTr("Brightness") }
SimpleSlider{
onValueChanged: shadersettings.brightness = value
value: shadersettings.brightness
}
Text{ text: qsTr("Contrast") }
SimpleSlider{
onValueChanged: shadersettings.contrast = value
value: shadersettings.contrast
}
Text{ text: qsTr("Opacity") }
SimpleSlider{
onValueChanged: shadersettings.windowOpacity = value
value: shadersettings.windowOpacity
}
// DIALOGS ////////////////////////////////////////////////////////////////
InsertNameDialog{
id: insertname
onNameSelected: {
appSettings.appendCustomProfile(name, appSettings.composeProfileString());
}
}
GroupBox{
title: qsTr("Frame")
Layout.fillWidth: true
RowLayout{
anchors.fill: parent
ComboBox{
id: framescombobox
Layout.fillWidth: true
model: shadersettings.frames_list
currentIndex: shadersettings.frames_index
onCurrentIndexChanged: shadersettings.frames_index = currentIndex
}
MessageDialog {
id: messageDialog
title: qsTr("File Error")
onAccepted: {
messageDialog.close();
}
}
Loader {
property var callBack
property bool selectExisting: false
id: fileDialog
sourceComponent: FileDialog{
nameFilters: ["Json files (*.json)"]
selectMultiple: false
selectFolder: false
selectExisting: fileDialog.selectExisting
onAccepted: callBack(fileUrl);
}
onSelectExistingChanged: reload()
function open() {
item.open();
}
function reload() {
active = false;
active = true;
}
}
}

View File

@@ -36,9 +36,9 @@ Tab{
columns: 3
CheckBox{
property int fps: checked ? slider.value : 0
onFpsChanged: shadersettings.fps = fps
checked: shadersettings.fps !== 0
text: qsTr("Limit FPS")
onFpsChanged: appSettings.fps = fps
checked: appSettings.fps !== 0
text: qsTr("Effects FPS")
}
Slider{
id: slider
@@ -46,63 +46,26 @@ Tab{
stepSize: 1
maximumValue: 60
minimumValue: 1
enabled: shadersettings.fps !== 0
value: shadersettings.fps !== 0 ? shadersettings.fps : 60
enabled: appSettings.fps !== 0
value: appSettings.fps !== 0 ? appSettings.fps : 60
}
Text{text: slider.value}
Text{text: qsTr("Texture Quality")}
Slider{
Layout.fillWidth: true
id: txtslider
onValueChanged: shadersettings.window_scaling = value;
value: shadersettings.window_scaling
stepSize: 0.10
Component.onCompleted: minimumValue = 0.3 //Without this value gets set to 0.5
onValueChanged: if (enabled) appSettings.windowScaling = value;
stepSize: 0.05
enabled: false
Component.onCompleted: {
minimumValue = 0.25 //Without this value gets set to 0.5
value = appSettings.windowScaling;
enabled = true;
}
}
Text{text: Math.round(txtslider.value * 100) + "%"}
}
}
GroupBox{
title: qsTr("Rasterization")
Layout.fillWidth: true
anchors.left: parent.left
anchors.right: parent.right
GridLayout{
id: scanlineQualityContainer
anchors.fill: parent
columns: 3
property alias valsIndex: scanlineQualitySlider.value
property var vals: [4,3,2]
property var valsStrings: [
qsTr("Low"),
qsTr("Medium"),
qsTr("High")
]
onValsIndexChanged: shadersettings.scanline_quality = vals[valsIndex];
Text{text: qsTr("Scanlines Quality")}
Slider{
id: scanlineQualitySlider
Layout.fillWidth: true
onValueChanged: parent.valsIndex = value;
stepSize: 1
Component.onCompleted: {
minimumValue = 0;
maximumValue = 2;
value = parent.vals.indexOf(shadersettings.scanline_quality);
}
Connections{
target: shadersettings
onScanline_qualityChanged:
scanlineQualityContainer.valsIndex = scanlineQualityContainer.vals.indexOf(shadersettings.scanline_quality);
}
}
Text{
text: parent.valsStrings[parent.valsIndex];
}
}
}
GroupBox{
title: qsTr("Bloom")
Layout.fillWidth: true
@@ -111,37 +74,46 @@ Tab{
GridLayout{
id: bloomQualityContainer
anchors.fill: parent
columns: 3
property alias valsIndex: bloomQualitySlider.value
property var vals: [0.25, 0.50, 1.00]
property var valsStrings: [
qsTr("Low"),
qsTr("Medium"),
qsTr("High")
]
onValsIndexChanged: shadersettings.bloom_quality = vals[valsIndex];
Text{text: qsTr("Bloom Quality")}
Slider{
id: bloomQualitySlider
Layout.fillWidth: true
onValueChanged: parent.valsIndex = value;
stepSize: 1
id: bloomSlider
onValueChanged: if (enabled) appSettings.bloomQuality = value;
stepSize: 0.05
enabled: false
Component.onCompleted: {
minimumValue = 0;
maximumValue = 2;
value = parent.vals.indexOf(shadersettings.bloom_quality);
}
Connections{
target: shadersettings
onBloom_qualityChanged:
bloomQualityContainer.valsIndex = bloomQualityContainer.vals.indexOf(shadersettings.bloom_quality);
minimumValue = 0.25
value = appSettings.bloomQuality;
enabled = true;
}
}
Text{
text: parent.valsStrings[parent.valsIndex];
Text{text: Math.round(bloomSlider.value * 100) + "%"}
}
}
GroupBox{
title: qsTr("BurnIn")
Layout.fillWidth: true
anchors.left: parent.left
anchors.right: parent.right
GridLayout{
id: blurQualityContainer
anchors.fill: parent
Text{text: qsTr("BurnIn Quality")}
Slider{
Layout.fillWidth: true
id: burnInSlider
onValueChanged: if (enabled) appSettings.burnInQuality = value;
stepSize: 0.05
enabled: false
Component.onCompleted: {
minimumValue = 0.25
value = appSettings.burnInQuality;
enabled = true;
}
}
Text{text: Math.round(burnInSlider.value * 100) + "%"}
}
}
GroupBox{
@@ -150,9 +122,9 @@ Tab{
anchors.left: parent.left
anchors.right: parent.right
CheckBox{
checked: shadersettings._frameReflections
checked: appSettings._frameReflections
text: qsTr("Frame Reflections")
onCheckedChanged: shadersettings._frameReflections = checked
onCheckedChanged: appSettings._frameReflections = checked
}
}
}

View File

@@ -0,0 +1,94 @@
/*******************************************************************************
* Copyright (c) 2013 "Filippo Scognamiglio"
* https://github.com/Swordfish90/cool-retro-term
*
* This file is part of cool-retro-term.
*
* cool-retro-term is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
Tab{
ColumnLayout{
anchors.fill: parent
GroupBox{
title: qsTr("Rasterization Mode")
Layout.fillWidth: true
ComboBox {
id: rasterizationBox
property string selectedElement: model[currentIndex]
anchors.fill: parent
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
currentIndex: appSettings.rasterization
onCurrentIndexChanged: {
appSettings.rasterization = currentIndex
}
}
}
GroupBox{
title: qsTr("Lights")
Layout.fillWidth: true
GridLayout{
anchors.fill: parent
columns: 2
Text{ text: qsTr("Brightness") }
SimpleSlider{
onValueChanged: appSettings.brightness = value
value: appSettings.brightness
}
Text{ text: qsTr("Contrast") }
SimpleSlider{
onValueChanged: appSettings.contrast = value
value: appSettings.contrast
}
Text{ text: qsTr("Opacity") }
SimpleSlider{
onValueChanged: appSettings.windowOpacity = value
value: appSettings.windowOpacity
}
}
}
GroupBox{
title: qsTr("Frame")
Layout.fillWidth: true
RowLayout{
anchors.fill: parent
ComboBox{
id: framescombobox
Layout.fillWidth: true
model: appSettings.framesList
currentIndex: appSettings.framesIndex
onActivated: {
appSettings.frameName = appSettings.framesList.get(index).name;
}
function updateIndex(){
var name = appSettings.frameName;
var index = appSettings.getFrameIndexByName(name);
if (index !== undefined)
currentIndex = index;
}
Component.onCompleted: updateIndex();
Connections {
target: appSettings
onFrameNameChanged: framescombobox.updateIndex();
}
}
}
}
}
}

View File

@@ -26,23 +26,9 @@ Tab{
ColumnLayout{
anchors.fill: parent
GroupBox{
title: qsTr("Rasterization Mode")
Layout.fillWidth: true
ComboBox {
id: rasterizationBox
property string selectedElement: model[currentIndex]
anchors.fill: parent
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
currentIndex: shadersettings.rasterization
onCurrentIndexChanged: {
shadersettings.rasterization = currentIndex
fontChanger.updateIndex();
}
}
}
GroupBox{
title: qsTr("Font") + " (" + rasterizationBox.selectedElement + ")"
Layout.fillWidth: true
property var rasterization: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")][appSettings.rasterization]
title: qsTr("Font" + "(" + rasterization + ")")
anchors { left: parent.left; right: parent.right }
GridLayout{
anchors.fill: parent
columns: 2
@@ -50,15 +36,23 @@ Tab{
ComboBox{
id: fontChanger
Layout.fillWidth: true
model: shadersettings.fontlist
currentIndex: updateIndex()
model: appSettings.fontlist
onActivated: {
shadersettings.fontIndexes[shadersettings.rasterization] = index;
shadersettings.handleFontChanged();
var name = appSettings.fontlist.get(index).name;
appSettings.fontNames[appSettings.rasterization] = name;
appSettings.handleFontChanged();
}
function updateIndex(){
currentIndex = shadersettings.fontIndexes[shadersettings.rasterization];
var name = appSettings.fontNames[appSettings.rasterization];
var index = appSettings.getIndexByName(name);
if (index !== undefined)
currentIndex = index;
}
Connections{
target: appSettings
onTerminalFontChanged: fontChanger.updateIndex();
}
Component.onCompleted: updateIndex();
}
Text{ text: qsTr("Scaling") }
RowLayout{
@@ -66,18 +60,18 @@ Tab{
Slider{
Layout.fillWidth: true
id: fontScalingChanger
onValueChanged: if(enabled) shadersettings.fontScaling = value
onValueChanged: if(enabled) appSettings.fontScaling = value
stepSize: 0.05
enabled: false // Another trick to fix initial bad behavior.
Component.onCompleted: {
minimumValue = 0.5;
maximumValue = 2.5;
value = shadersettings.fontScaling;
value = appSettings.fontScaling;
enabled = true;
}
Connections{
target: shadersettings
onFontScalingChanged: fontScalingChanger.value = shadersettings.fontScaling;
target: appSettings
onFontScalingChanged: fontScalingChanger.value = appSettings.fontScaling;
}
}
Text{
@@ -90,10 +84,14 @@ Tab{
Slider{
Layout.fillWidth: true
id: widthChanger
onValueChanged: shadersettings.fontWidth = value;
value: shadersettings.fontWidth
onValueChanged: appSettings.fontWidth = value;
value: appSettings.fontWidth
stepSize: 0.05
Component.onCompleted: minimumValue = 0.5 //Without this value gets set to 0.5
Component.onCompleted: {
// This is needed to avoid unnecessary chnaged events.
minimumValue = 0.5;
maximumValue = 1.5;
}
}
Text{
text: Math.round(widthChanger.value * 100) + "%"
@@ -103,38 +101,38 @@ Tab{
}
GroupBox{
title: qsTr("Colors")
Layout.fillWidth: true
anchors { left: parent.left; right: parent.right }
ColumnLayout{
anchors.fill: parent
ColumnLayout{
Layout.fillWidth: true
CheckableSlider{
name: qsTr("Chroma Color")
onNewValue: appSettings.chromaColor = newValue
value: appSettings.chromaColor
}
CheckableSlider{
name: qsTr("Saturation Color")
onNewValue: appSettings.saturationColor = newValue
value: appSettings.saturationColor
enabled: appSettings.chromaColor !== 0
}
}
RowLayout{
Layout.fillWidth: true
ColorButton{
name: qsTr("Font")
height: 50
Layout.fillWidth: true
onColorSelected: shadersettings._font_color = color;
button_color: shadersettings._font_color
onColorSelected: appSettings._fontColor = color;
color: appSettings._fontColor
}
ColorButton{
name: qsTr("Background")
height: 50
Layout.fillWidth: true
onColorSelected: shadersettings._background_color = color;
button_color: shadersettings._background_color
}
}
ColumnLayout{
Layout.fillWidth: true
CheckableSlider{
name: qsTr("Chroma Color")
onNewValue: shadersettings.chroma_color = newValue
value: shadersettings.chroma_color
}
CheckableSlider{
name: qsTr("Saturation Color")
onNewValue: shadersettings.saturation_color = newValue
value: shadersettings.saturation_color
enabled: shadersettings.chroma_color !== 0
onColorSelected: appSettings._backgroundColor = color;
color: appSettings._backgroundColor
}
}
}

View File

@@ -27,8 +27,8 @@ import QtQuick.Dialogs 1.1
Window {
id: settings_window
title: qsTr("Settings")
width: 640
height: 440
width: 580
height: 400
property int tabmargins: 15
@@ -42,6 +42,12 @@ Window {
anchors.fill: parent
anchors.margins: tabmargins
}
SettingsScreenTab{
id: screenTab
title: qsTr("Screen")
anchors.fill: parent
anchors.margins: tabmargins
}
SettingsTerminalTab{
id: terminalTab
title: qsTr("Terminal")

View File

@@ -21,40 +21,54 @@
import QtQuick 2.2
import QtGraphicalEffects 1.0
ShaderEffect {
property color font_color: shadersettings.font_color
property color background_color: shadersettings.background_color
property variant source: terminal.theSource
property variant bloomSource: terminal.bloomSource
property variant rasterizationSource: terminal.rasterizationSource
property variant noiseSource: terminal.staticNoiseSource
property real bloom_strength: shadersettings.bloom_strength * 2.5
property ShaderEffectSource source
property ShaderEffectSource blurredSource
property ShaderEffectSource bloomSource
property real jitter: shadersettings.jitter * 0.007
property real liveBlur: blurredSource && blurredSource.live ? 1.0 : 0.0
property real noise_strength: shadersettings.noise_strength
property real screen_distorsion: shadersettings.screen_distortion
property real glowing_line_strength: shadersettings.glowing_line_strength
property color fontColor: appSettings.fontColor
property color backgroundColor: appSettings.backgroundColor
property real bloom: appSettings.bloom * 2.5
property real chroma_color: shadersettings.chroma_color;
property real burnIn: appSettings.burnIn
property real rgb_shift: shadersettings.rgb_shift * 0.2
property real jitter: appSettings.jitter * 0.007
property real staticNoise: appSettings.staticNoise
property size scaleNoiseSize: Qt.size((width) / (noiseTexture.width * appSettings.windowScaling * appSettings.fontScaling),
(height) / (noiseTexture.height * appSettings.windowScaling * appSettings.fontScaling))
property real brightness_flickering: shadersettings.brightness_flickering
property real horizontal_sincronization: shadersettings.horizontal_sincronization
property real screenCurvature: appSettings.screenCurvature
property real glowingLine: appSettings.glowingLine
property bool frameReflections: shadersettings.frameReflections
property real chromaColor: appSettings.chromaColor;
property real disp_top: (frame.item.displacementTop * shadersettings.window_scaling) / height
property real disp_bottom: (frame.item.displacementBottom * shadersettings.window_scaling) / height
property real disp_left: (frame.item.displacementLeft * shadersettings.window_scaling) / width
property real disp_right: (frame.item.displacementRight * shadersettings.window_scaling) / width
property real rbgShift: appSettings.rbgShift * 0.2
property real screen_brightness: shadersettings.brightness * 1.5 + 0.5
property real flickering: appSettings.flickering
property real horizontalSync: appSettings.horizontalSync * 0.5
property real time: timeManager.time
property variant randomFunctionSource: randfuncsource
property bool frameReflections: appSettings.frameReflections
property real disp_top: (frame.displacementTop * appSettings.windowScaling) / height
property real disp_bottom: (frame.displacementBottom * appSettings.windowScaling) / height
property real disp_left: (frame.displacementLeft * appSettings.windowScaling) / width
property real disp_right: (frame.displacementRight * appSettings.windowScaling) / width
property real screen_brightness: appSettings.brightness * 1.5 + 0.5
property real dispX
property real dispY
property size virtual_resolution
TimeManager{
id: timeManager
enableTimer: terminalWindow.visible
}
property alias time: timeManager.time
property ShaderEffectSource noiseSource: noiseShaderSource
// If something goes wrong activate the fallback version of the shader.
property bool fallBack: false
@@ -63,20 +77,19 @@ ShaderEffect {
//Smooth random texture used for flickering effect.
Image{
id: randtexture
source: "frames/images/randfunction.png"
id: noiseTexture
source: "images/allNoise512.png"
width: 512
height: 512
sourceSize.width: 512
sourceSize.height: 256
fillMode: Image.TileVertically
fillMode: Image.Tile
visible: false
}
ShaderEffectSource{
id: randfuncsource
sourceItem: randtexture
live: false
hideSource: true
id: noiseShaderSource
sourceItem: noiseTexture
wrapMode: ShaderEffectSource.Repeat
visible: false
smooth: true
}
//Print the number with a reasonable precision for the shader.
@@ -99,27 +112,33 @@ ShaderEffect {
varying highp vec2 qt_TexCoord0;" +
(!fallBack ? "
uniform sampler2D randomFunctionSource;" : "") +
uniform sampler2D noiseSource;" : "") +
(!fallBack && brightness_flickering !== 0.0 ?"
(!fallBack && flickering !== 0.0 ?"
varying lowp float brightness;
uniform lowp float brightness_flickering;" : "") +
(!fallBack && horizontal_sincronization !== 0.0 ?"
varying lowp float horizontal_distortion;
uniform lowp float horizontal_sincronization;" : "") +
uniform lowp float flickering;" : "") +
(!fallBack && horizontalSync !== 0.0 ?"
uniform lowp float horizontalSync;
varying lowp float distortionScale;
varying lowp float distortionFreq;" : "") +
"
void main() {
qt_TexCoord0.x = (qt_MultiTexCoord0.x - disp_left) / (1.0 - disp_left - disp_right);
qt_TexCoord0.y = (qt_MultiTexCoord0.y - disp_top) / (1.0 - disp_top - disp_bottom);
vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" +
(!fallBack && brightness_flickering !== 0.0 ? "
brightness = 1.0 + (texture2D(randomFunctionSource, coords).g - 0.5) * brightness_flickering;"
: "") +
(!fallBack && horizontal_sincronization !== 0.0 ? "
float randval = 1.5 * texture2D(randomFunctionSource,(vec2(1.0) -coords) * 0.5).g;
float negsinc = 1.0 - 0.6 * horizontal_sincronization;" + "
horizontal_distortion = step(negsinc, randval) * (randval - negsinc) * 0.3*horizontal_sincronization;"
(!fallBack && (flickering !== 0.0 || horizontalSync !== 0.0) ?
"vec4 initialNoiseTexel = texture2D(noiseSource, coords);"
: "") +
(!fallBack && flickering !== 0.0 ? "
brightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;"
: "") +
(!fallBack && horizontalSync !== 0.0 ? "
float randval = horizontalSync - initialNoiseTexel.r;
distortionScale = step(0.0, randval) * randval * horizontalSync;
distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
: "") +
"gl_Position = qt_Matrix * qt_Vertex;
@@ -131,46 +150,65 @@ ShaderEffect {
uniform highp float time;
varying highp vec2 qt_TexCoord0;
uniform highp vec4 font_color;
uniform highp vec4 background_color;
uniform highp sampler2D rasterizationSource;
uniform lowp float screen_brightness;" +
uniform highp vec4 fontColor;
uniform highp vec4 backgroundColor;
uniform lowp float screen_brightness;
(bloom_strength !== 0 ? "
uniform highp vec2 virtual_resolution;
uniform highp float dispX;
uniform highp float dispY;" +
(bloom !== 0 ? "
uniform highp sampler2D bloomSource;
uniform lowp float bloom_strength;" : "") +
(noise_strength !== 0 ? "
uniform highp float noise_strength;" : "") +
(noise_strength !== 0 || jitter !== 0 || rgb_shift ? "
uniform lowp sampler2D noiseSource;" : "") +
(screen_distorsion !== 0 ? "
uniform highp float screen_distorsion;" : "") +
(glowing_line_strength !== 0 ? "
uniform highp float glowing_line_strength;" : "") +
(chroma_color !== 0 ? "
uniform lowp float chroma_color;" : "") +
uniform lowp float bloom;" : "") +
(burnIn !== 0 ? "
uniform sampler2D blurredSource;
uniform lowp float liveBlur;" : "") +
(staticNoise !== 0 ? "
uniform highp float staticNoise;" : "") +
(((staticNoise !== 0 || jitter !== 0 || rbgShift)
||(fallBack && (flickering || horizontalSync))) ? "
uniform lowp sampler2D noiseSource;
uniform highp vec2 scaleNoiseSize;" : "") +
(screenCurvature !== 0 ? "
uniform highp float screenCurvature;" : "") +
(glowingLine !== 0 ? "
uniform highp float glowingLine;" : "") +
(chromaColor !== 0 ? "
uniform lowp float chromaColor;" : "") +
(jitter !== 0 ? "
uniform lowp float jitter;" : "") +
(rgb_shift !== 0 ? "
uniform lowp float rgb_shift;" : "") +
(rbgShift !== 0 ? "
uniform lowp float rbgShift;" : "") +
(fallBack && (brightness_flickering || horizontal_sincronization) ? "
uniform lowp sampler2D randomFunctionSource;" : "") +
(fallBack && horizontal_sincronization !== 0 ? "
uniform lowp float horizontal_sincronization;" : "") +
(fallBack && brightness_flickering !== 0.0 ?"
uniform lowp float brightness_flickering;" : "") +
(!fallBack && brightness_flickering !== 0 ? "
varying lowp float brightness;" : "") +
(!fallBack && horizontal_sincronization !== 0 ? "
varying lowp float horizontal_distortion;" : "") +
(fallBack && horizontalSync !== 0 ? "
uniform lowp float horizontalSync;" : "") +
(fallBack && flickering !== 0.0 ?"
uniform lowp float flickering;" : "") +
(!fallBack && flickering !== 0 ? "
varying lowp float brightness;"
: "") +
(!fallBack && horizontalSync !== 0 ? "
varying lowp float distortionScale;
varying lowp float distortionFreq;" : "") +
(glowing_line_strength !== 0 ? "
(glowingLine !== 0 ? "
float randomPass(vec2 coords){
return fract(smoothstep(-0.2, 0.0, coords.y - 3.0 * fract(time * 0.0001))) * glowing_line_strength;
return fract(smoothstep(-0.2, 0.0, coords.y - 3.0 * fract(time * 0.0001))) * glowingLine;
}" : "") +
"float rgb2grey(vec3 v){
"highp float getScanlineIntensity(vec2 coords) {
highp float result = 1.0;" +
(appSettings.rasterization != appSettings.no_rasterization ?
"result *= abs(sin(coords.y * virtual_resolution.y * "+Math.PI+"));" : "") +
(appSettings.rasterization == appSettings.pixel_rasterization ?
"result *= abs(sin(coords.x * virtual_resolution.x * "+Math.PI+"));" : "") + "
return result;
}
float rgb2grey(vec3 v){
return dot(v, vec3(0.21, 0.72, 0.04));
}" +
@@ -178,87 +216,97 @@ ShaderEffect {
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
"float distance = length(cc);" +
//FallBack if there are problem
(fallBack && (brightness_flickering || horizontal_sincronization) ? "
vec2 randCoords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" : "") +
(fallBack && brightness_flickering !== 0.0 ? "
float brightness = 1.0 + (texture2D(randomFunctionSource, randCoords).g - 0.5) * brightness_flickering;"
: "") +
(fallBack && horizontal_sincronization !== 0.0 ? "
float randval = 1.5 * texture2D(randomFunctionSource,(vec2(1.0) - randCoords) * 0.5).g;
float negsinc = 1.0 - 0.6 * horizontal_sincronization;" + "
float horizontal_distortion = step(negsinc, randval) * (randval - negsinc) * 0.3*horizontal_sincronization;"
//FallBack if there are problems
(fallBack && (flickering !== 0.0 || horizontalSync !== 0.0) ?
"vec2 initialCoords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));
vec4 initialNoiseTexel = texture2D(noiseSource, initialCoords);"
: "") +
(fallBack && flickering !== 0.0 ? "
float brightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;"
: "") +
(fallBack && horizontalSync !== 0.0 ? "
float randval = horizontalSync - initialNoiseTexel.r;
float distortionScale = step(0.0, randval) * randval * horizontalSync;
float distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
: "") +
(noise_strength ? "
float noise = noise_strength;" : "") +
(staticNoise ? "
float noise = staticNoise;" : "") +
(screen_distorsion !== 0 ? "
float distortion = dot(cc, cc) * screen_distorsion;
vec2 coords = (qt_TexCoord0 - cc * (1.0 + distortion) * distortion);"
(screenCurvature !== 0 ? "
float distortion = dot(cc, cc) * screenCurvature;
vec2 staticCoords = (qt_TexCoord0 - cc * (1.0 + distortion) * distortion);"
:"
vec2 coords = qt_TexCoord0;") +
vec2 staticCoords = qt_TexCoord0;") +
(horizontal_sincronization !== 0 ? "
float h_distortion = 0.5 * sin(time*0.001 + coords.y*10.0*fract(time/10.0));
h_distortion += 0.5 * cos(time*0.04 + 0.03 + coords.y*50.0*fract(time/10.0 + 0.4));
coords.x = coords.x + h_distortion * horizontal_distortion;" +
(noise_strength ? "
noise += horizontal_distortion;" : "")
"vec2 coords = staticCoords;" +
(horizontalSync !== 0 ? "
float dst = sin((coords.y + time * 0.001) * distortionFreq);
coords.x += dst * distortionScale;" +
(staticNoise ? "
noise += distortionScale * 7.0;" : "")
: "") +
(jitter !== 0 || staticNoise !== 0 ?
"vec4 noiseTexel = texture2D(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));"
: "") +
(jitter !== 0 ? "
vec2 offset = vec2(texture2D(noiseSource, coords + fract(time / 57.0)).a,
texture2D(noiseSource, coords + fract(time / 251.0)).a) - 0.5;
vec2 offset = vec2(noiseTexel.b, noiseTexel.a) - vec2(0.5);
vec2 txt_coords = coords + offset * jitter;"
: "vec2 txt_coords = coords;") +
"float color = 0.0;" +
(noise_strength !== 0 ? "
float noiseVal = texture2D(noiseSource, qt_TexCoord0 + vec2(fract(time / 51.0), fract(time / 237.0))).a;
(staticNoise !== 0 ? "
float noiseVal = noiseTexel.a;
color += noiseVal * noise * (1.0 - distance * 1.3);" : "") +
(glowing_line_strength !== 0 ? "
color += randomPass(coords) * glowing_line_strength;" : "") +
(glowingLine !== 0 ? "
color += randomPass(coords) * glowingLine;" : "") +
"vec3 txt_color = texture2D(source, txt_coords).rgb;" +
"vec3 txt_color = texture2D(source, txt_coords).rgb;
float greyscale_color = rgb2grey(txt_color) + color;" +
(burnIn !== 0 ? "
vec4 txt_blur = liveBlur * texture2D(blurredSource, txt_coords);
txt_color = txt_color + txt_blur.rgb * txt_blur.a;"
: "") +
(chroma_color !== 0 ?
(rgb_shift !== 0 ? "
"float greyscale_color = rgb2grey(txt_color) + color;" +
(chromaColor !== 0 ?
(rbgShift !== 0 ? "
float rgb_noise = abs(texture2D(noiseSource, vec2(fract(time/(1024.0 * 256.0)), fract(time/(1024.0*1024.0)))).a - 0.5);
float rcolor = texture2D(source, txt_coords + vec2(0.1, 0.0) * rgb_shift * rgb_noise).r;
float bcolor = texture2D(source, txt_coords - vec2(0.1, 0.0) * rgb_shift * rgb_noise).b;
float rcolor = texture2D(source, txt_coords + vec2(0.1, 0.0) * rbgShift * rgb_noise).r;
float bcolor = texture2D(source, txt_coords - vec2(0.1, 0.0) * rbgShift * rgb_noise).b;
txt_color.r = rcolor;
txt_color.b = bcolor;
greyscale_color = 0.33 * (rcolor + bcolor);" : "") +
"vec3 mixedColor = mix(font_color.rgb, txt_color * font_color.rgb, chroma_color);
vec3 finalBackColor = mix(background_color.rgb, mixedColor, greyscale_color);
vec3 finalColor = mix(finalBackColor, font_color.rgb, color).rgb;"
"vec3 mixedColor = mix(fontColor.rgb, txt_color * fontColor.rgb, chromaColor);
vec3 finalBackColor = mix(backgroundColor.rgb, mixedColor, greyscale_color);
vec3 finalColor = mix(finalBackColor, fontColor.rgb, color).rgb;"
:
"vec3 finalColor = mix(background_color.rgb, font_color.rgb, greyscale_color);") +
"vec3 finalColor = mix(backgroundColor.rgb, fontColor.rgb, greyscale_color);") +
"finalColor *= texture2D(rasterizationSource, coords).a;" +
"finalColor *= getScanlineIntensity(coords);" +
(bloom_strength !== 0 ?
(bloom !== 0 ?
"vec4 bloomFullColor = texture2D(bloomSource, coords);
vec3 bloomColor = bloomFullColor.rgb;
vec2 minBound = step(vec2(0.0), coords);
vec2 maxBound = step(coords, vec2(1.0));
float bloomAlpha = bloomFullColor.a * minBound.x * minBound.y * maxBound.x * maxBound.y;" +
(chroma_color !== 0 ?
"bloomColor = font_color.rgb * mix(vec3(rgb2grey(bloomColor)), bloomColor, chroma_color);"
float bloomAlpha = bloomFullColor.a;" +
(chromaColor !== 0 ?
"bloomColor = fontColor.rgb * mix(vec3(rgb2grey(bloomColor)), bloomColor, chromaColor);"
:
"bloomColor = font_color.rgb * rgb2grey(bloomColor);") +
"finalColor += bloomColor * bloom_strength * bloomAlpha;"
"bloomColor = fontColor.rgb * rgb2grey(bloomColor);") +
"finalColor += bloomColor * bloom * bloomAlpha;"
: "") +
(brightness_flickering !== 0 ? "
"finalColor *= smoothstep(-dispX, 0.0, staticCoords.x) - smoothstep(1.0, 1.0 + dispX, staticCoords.x);
finalColor *= smoothstep(-dispY, 0.0, staticCoords.y) - smoothstep(1.0, 1.0 + dispY, staticCoords.y);" +
(flickering !== 0 ? "
finalColor *= brightness;" : "") +
"gl_FragColor = vec4(finalColor * screen_brightness, qt_Opacity);" +

View File

@@ -21,11 +21,11 @@
import QtQuick 2.2
import QtQuick.LocalStorage 2.0
Item {
QtObject {
property bool initialized: false
function getDatabase() {
return LocalStorage.openDatabaseSync("coololdterm", "1.0", "StorageDatabase", 100000);
return LocalStorage.openDatabaseSync("coolretroterm", "1.0", "StorageDatabase", 100000);
}
function initialize() {

View File

@@ -1,55 +1,132 @@
import QtQuick 2.2
import QtGraphicalEffects 1.0
Item{
Item{
id: scalableContent
width: parent.width * shadersettings.window_scaling
height: parent.height * shadersettings.window_scaling
import "utils.js" as Utils
Loader{
id: frame
anchors.fill: parent
z: 2.1
source: shadersettings.frame_source
}
PreprocessedTerminal{
id: terminal
anchors.fill: parent
}
ShaderTerminal{
id: shadercontainer
anchors.fill: parent
opacity: shadersettings.windowOpacity * 0.3 + 0.7
z: 1.9
}
ShaderTerminal{
property alias title: terminal.title
property alias terminalSize: terminal.terminalSize
id: mainShader
opacity: appSettings.windowOpacity * 0.3 + 0.7
blending: false
source: terminal.mainSource
blurredSource: terminal.blurredSource
dispX: (12 / width) * appSettings.windowScaling
dispY: (12 / height) * appSettings.windowScaling
virtual_resolution: terminal.virtualResolution
Loader{
id: frame
anchors.fill: parent
property real displacementLeft: item ? item.displacementLeft : 0
property real displacementTop: item ? item.displacementTop : 0
property real displacementRight: item ? item.displacementRight : 0
property real displacementBottom: item ? item.displacementBottom : 0
asynchronous: true
visible: status === Loader.Ready
z: 2.1
source: appSettings.frameSource
}
// This is used to render the texture to a lower resolution then scale it up.
PreprocessedTerminal{
id: terminal
anchors.fill: parent
}
// EFFECTS ////////////////////////////////////////////////////////////////
Loader{
id: scalableContentSource
active: shadersettings.window_scaling < 1
id: bloomEffectLoader
active: appSettings.bloom
asynchronous: true
width: parent.width * appSettings.bloomQuality
height: parent.height * appSettings.bloomQuality
sourceComponent: FastBlur{
radius: Utils.lint(16, 48, appSettings.bloomQuality * appSettings.windowScaling);
source: terminal.mainSource
transparentBorder: true
}
}
Loader{
id: bloomSourceLoader
active: appSettings.bloom !== 0
asynchronous: true
sourceComponent: ShaderEffectSource{
sourceItem: scalableContent
id: _bloomEffectSource
sourceItem: bloomEffectLoader.item
hideSource: true
smooth: true
}
}
Loader{
active: shadersettings.window_scaling < 1
anchors.fill: parent
sourceComponent: ShaderEffect{
property var source: scalableContentSource.item
visible: false
}
}
// Terminal size overlay. Shown when terminal size changes.
Loader{
id: sizeoverlayloader
z: 3
anchors.centerIn: parent
active: shadersettings.show_terminal_size
sourceComponent: SizeOverlay{
terminalSize: terminal.terminalSize
}
}
bloomSource: bloomSourceLoader.item
// This shader might be useful in the future. Since we used it only for a couple
// of calculations is probably best to move those in the main shader. If in the future
// we need to store another fullScreen channel this might be handy.
// ShaderEffect {
// id: rasterizationEffect
// width: parent.width
// height: parent.height
// property real outColor: 0.0
// property real dispX: (5 / width) * appSettings.windowScaling
// property real dispY: (5 / height) * appSettings.windowScaling
// property size virtual_resolution: terminal.virtualResolution
// blending: false
// fragmentShader:
// "uniform lowp float qt_Opacity;" +
// "varying highp vec2 qt_TexCoord0;
// uniform highp vec2 virtual_resolution;
// uniform highp float dispX;
// uniform highp float dispY;
// uniform mediump float outColor;
// highp float getScanlineIntensity(vec2 coords) {
// highp float result = 1.0;" +
// (appSettings.rasterization != appSettings.no_rasterization ?
// "result *= abs(sin(coords.y * virtual_resolution.y * "+Math.PI+"));" : "") +
// (appSettings.rasterization == appSettings.pixel_rasterization ?
// "result *= abs(sin(coords.x * virtual_resolution.x * "+Math.PI+"));" : "") + "
// return result;
// }" +
// "void main() {" +
// "highp float color = getScanlineIntensity(qt_TexCoord0);" +
// "float distance = length(vec2(0.5) - qt_TexCoord0);" +
// "color = mix(color, 0.0, 1.2 * distance * distance);" +
// "color *= outColor + smoothstep(0.00, dispX, qt_TexCoord0.x) * (1.0 - outColor);" +
// "color *= outColor + smoothstep(0.00, dispY, qt_TexCoord0.y) * (1.0 - outColor);" +
// "color *= outColor + (1.0 - smoothstep(1.00 - dispX, 1.00, qt_TexCoord0.x)) * (1.0 - outColor);" +
// "color *= outColor + (1.0 - smoothstep(1.00 - dispY, 1.00, qt_TexCoord0.y)) * (1.0 - outColor);" +
// "gl_FragColor.a = color;" +
// "}"
// onStatusChanged: if (log) console.log(log) //Print warning messages
// }
// rasterizationSource: ShaderEffectSource{
// id: rasterizationEffectSource
// sourceItem: rasterizationEffect
// hideSource: true
// smooth: true
// wrapMode: ShaderEffectSource.ClampToEdge
// visible: false
// }
}

View File

@@ -27,13 +27,13 @@ Timer{
NumberAnimation on time {
from: 0
to: 100000
running: shadersettings.fps === 0 && enableTimer
running: appSettings.fps === 0 && enableTimer
duration: 100000
loops: Animation.Infinite
}
onTriggered: time += interval
running: shadersettings.fps !== 0 && enableTimer
interval: Math.round(1000 / shadersettings.fps)
running: appSettings.fps !== 0 && enableTimer
interval: Math.round(1000 / appSettings.fps)
repeat: true
}

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,16 @@
Envy Code R (coding font) preview #7.2
======================================
Envy Code R is a fully-scalable monospaced font designed for programming and command prompts.
There are three variants including in the archive - Regular, Bold and Italic. A large number of additional symbols outside the ASCII range and provided which covers most of the Windows/ISO 1252 codepage, MacOS Roman and a number of other Central European pages.
This archive also contains a folder named 'Visual Studio Italics-as-bold' which contains the Regular and Italic fonts again with an alternate name of 'Envy Code R VS' and with the Italic variant set to identify itself as bold. This allows you to utilise italics within Visual Studio's syntax highlighter by choosing bold everywhere you want italics - great for comments or strings!
If you wish to use Envy Code R as a font for your Windows Command Prompt run the included .reg registry file and reboot, then choose Properties from the Command Prompt to set it.
Please send feedback to damien@envytech.co.uk and be sure to visit http://damieng.com/fonts/envy-code-r for updates and more information.
[)amien
Damien Guard, May 2008.
Copyright <20> 2006-2008 Envy Technologies Ltd. Free to use but redistribution prohibited.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,94 @@
Copyright (c) 2013, Pablo Caro <me AT pcaro DOT es> - http://pcaro.es/
with Reserved Font Name Hermit.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

View File

@@ -0,0 +1,13 @@
monaco.ttf
==========
The original monaco.ttf improved: add some special characters (which are from "DejaVu Sans Mono")
In my work environment, I need connect to Linux system from Windows system remotely using SecureCRT or Putty, and edit files using VIM tools. So I need one beautiful font in SecureCRT / Putty.
In windows system, there are some original fonts are beautiful, for example "Consolas", but they can't support some special characters, for example: ▸, ↪, ⌴. Because they are original fonts in my Windows, I don't want to modify them.
I get "Monaco" from web. It is tiny and beautiful. But it also can't support those special characters.
So I add the characters by myself and share it.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
dopustz:-480

View File

@@ -0,0 +1,22 @@
ProFont
MIT License
Copyright (c) 2014 Carl Osterwald, Stephen C. Gilardi, Andrew Welch
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,31 @@
WHAT IS THIS?
This is ProFont TrueType, converted to Windows TrueType format
by Mike Smith, with some tweaks added by "ardu".
Modifications include:
- A Euro character
- Missing characters from the Latin 1 code page
- Full support for CodePage 850. These are mostly the famous
block/box characters you know from DOS. Very useful if you use
Mightnight Commander through PuTTY.
- Fixed metrics so that point size of 9 works correctly. Until now
you had to select 7 to obtain the native point size of 9.
- Added some quick&dirty hinting for point size of 9. Most characters
now match closely the look of the bitmap version.
Don't expect it to look good on anything else than Windows...
To get the full original Distribution, other ProFont builds
and more information
go to <http://tobiasjung.name/profont/>
DISCLAIMER
See LICENSE file
Tobias Jung
January 2014
profont@tobiasjung.name

View File

@@ -0,0 +1,7 @@
Copyright (c) 2004, 2005 Tristan Grimmer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Binary file not shown.

View File

@@ -14,12 +14,11 @@ TerminalFrame{
imageSource: "../images/black-frame.png"
normalsSource: "../images/black-frame-normals.png"
distortionCoefficient: 1.9
displacementLeft: 80.0
displacementTop: 65.0
displacementRight: 80.0
displacementBottom: 65.0
shaderString: "FrameShader.qml"
staticDiffuseComponent: 1.0
dinamycDiffuseComponent: 0.6
}

View File

@@ -1,19 +0,0 @@
import QtQuick 2.2
import "utils"
TerminalFrame{
id: frame
z: 2.1
anchors.fill: parent
addedWidth: 0
addedHeight: 0
borderLeft: 0
borderRight: 0
borderTop: 0
borderBottom: 0
displacementLeft: 0
displacementTop: 0
displacementRight: 0
displacementBottom: 0
}

View File

@@ -14,12 +14,11 @@ TerminalFrame{
imageSource: "../images/screen-frame.png"
normalsSource: "../images/screen-frame-normals.png"
distortionCoefficient: 1.5
displacementLeft: 55
displacementTop: 50
displacementRight: 55
displacementBottom: 50
shaderString: "FrameShader.qml"
staticDiffuseComponent: 1.0
dinamycDiffuseComponent: 0.6
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 KiB

After

Width:  |  Height:  |  Size: 498 KiB

View File

@@ -1,102 +0,0 @@
import QtQuick 2.2
import QtGraphicalEffects 1.0
ShaderEffect{
property variant source: framesource
property variant normals: framesourcenormals
property real screen_distorsion: shadersettings.screen_distortion * framecontainer.distortionCoefficient
property real ambient_light: shadersettings.ambient_light
property color font_color: shadersettings.font_color
property color background_color: shadersettings.background_color
property real brightness: shadersettings.brightness * 1.5 + 0.5
property bool frameReflections: shadersettings.frameReflections
property variant lightSource: reflectionEffectSourceLoader.item
property real chroma_color: shadersettings.chroma_color
Loader{
id: reflectionEffectLoader
width: parent.width * 0.33
height: parent.height * 0.33
active: frameReflections
sourceComponent: FastBlur{
id: frameReflectionEffect
radius: 128
source: terminal.kterminal
smooth: false
}
}
Loader{
id: reflectionEffectSourceLoader
active: frameReflections
sourceComponent: ShaderEffectSource{
id: frameReflectionSource
sourceItem: reflectionEffectLoader.item
hideSource: true
smooth: true
}
}
blending: true
fragmentShader: "
uniform sampler2D source;
uniform sampler2D normals;
uniform highp float screen_distorsion;
uniform highp float ambient_light;
uniform highp float qt_Opacity;
uniform lowp float chroma_color;" +
(frameReflections ?
"uniform sampler2D lightSource;" : "") + "
uniform vec4 font_color;
uniform vec4 background_color;
varying lowp float brightness;
varying highp vec2 qt_TexCoord0;
vec2 distortCoordinates(vec2 coords){
vec2 cc = coords - vec2(0.5);
float dist = dot(cc, cc) * screen_distorsion;
return (coords + cc * (1.0 + dist) * dist);
}
float rgb2grey(vec3 v){
return dot(v, vec3(0.21, 0.72, 0.04));
}
void main(){
vec2 coords = distortCoordinates(qt_TexCoord0);
vec4 txt_color = texture2D(source, coords);
vec4 txt_normal = texture2D(normals, coords);
vec3 normal = normalize(txt_normal.rgb * 2.0 - 1.0);
vec3 light_direction = normalize(vec3(0.5, 0.5, 0.0) - vec3(qt_TexCoord0, 0.0));
float dotProd = dot(normal, light_direction);" +
(frameReflections ? "
vec3 realLightColor = texture2D(lightSource, coords).rgb;
float screenLight = rgb2grey(realLightColor);
float clampedDotProd = clamp(dotProd, 0.05, 1.0);
float diffuseReflection = clamp(screenLight * 1.5 * clampedDotProd, 0.0, 0.35);
float reflectionAlpha = mix(1.0, 0.90, dotProd);
vec3 lightColor = mix(font_color.rgb * screenLight, font_color.rgb * realLightColor, chroma_color);"
: "
float diffuseReflection = 0.0;
float reflectionAlpha = 1.0;
vec3 lightColor = font_color.rgb;") + "
vec3 back_color = background_color.rgb * (0.2 + 0.5 * dotProd);
vec3 front_color = lightColor * (0.05 + diffuseReflection);
vec4 dark_color = vec4((back_color + front_color) * txt_normal.a, txt_normal.a * reflectionAlpha);
gl_FragColor = mix(dark_color, txt_color, ambient_light);
}"
onStatusChanged: if (log) console.log(log) //Print warning messages
}

View File

@@ -1,23 +0,0 @@
import QtQuick 2.2
ShaderEffect{
property variant source: framesource
property real screen_distorsion: shadersettings.screen_distortion
fragmentShader: "
uniform sampler2D source;
uniform highp float screen_distorsion;
varying highp vec2 qt_TexCoord0;
vec2 distortCoordinates(vec2 coords){
vec2 cc = coords - vec2(0.5);
float dist = dot(cc, cc) * screen_distorsion;
return (coords + cc * (1.0 + dist) * dist);
}
void main(){
vec2 coords = distortCoordinates(qt_TexCoord0);
float inside = texture2D(source, coords).a;
gl_FragColor = vec4(vec3(0.0), inside);
}"
}

View File

@@ -1,9 +1,12 @@
import QtQuick 2.2
import QtGraphicalEffects 1.0
import "../../utils.js" as Utils
Item{
id: framecontainer
property int textureWidth: terminalWindow.width
property int textureHeight: terminalWindow.height
property int textureWidth: terminalContainer.width / appSettings.windowScaling
property int textureHeight: terminalContainer.height / appSettings.windowScaling
property int addedWidth
property int addedHeight
@@ -21,7 +24,9 @@ Item{
property real displacementRight
property real displacementBottom
property real distortionCoefficient
// Material coefficients
property real staticDiffuseComponent: 0.7
property real dinamycDiffuseComponent: 1.0
BorderImage{
id: frameimage
@@ -56,17 +61,151 @@ Item{
sourceItem: frameimage
hideSource: true
textureSize: Qt.size(parent.width, parent.height)
sourceRect: Qt.rect(-1, -1, frameimage.width + 2, frameimage.height + 2)
visible: false
}
ShaderEffectSource{
id: framesourcenormals
sourceItem: framenormals
hideSource: true
textureSize: Qt.size(parent.width, parent.height)
sourceRect: Qt.rect(-1, -1, framenormals.width + 2, framenormals.height + 2)
visible: false
}
// REFLECTIONS ////////////////////////////////////////////////////////////
Loader{
id: reflectionEffectLoader
width: parent.width * 0.33
height: parent.height * 0.33
active: appSettings.frameReflections
sourceComponent: FastBlur{
id: frameReflectionEffect
radius: 128
source: terminal.mainSource
smooth: false
}
}
Loader{
id: reflectionEffectSourceLoader
active: appSettings.frameReflections
sourceComponent: ShaderEffectSource{
id: frameReflectionSource
sourceItem: reflectionEffectLoader.item
hideSource: true
smooth: true
visible: false
}
}
// This texture represent the static light component.
ShaderEffect {
id: staticLight
property alias source: framesource
property alias normals: framesourcenormals
property real screenCurvature: appSettings.screenCurvature
property size curvature_coefficients: Qt.size(width / mainShader.width, height / mainShader.height)
property real ambientLight: appSettings.ambientLight * 0.9 + 0.1
property color fontColor: appSettings.fontColor
property color backgroundColor: appSettings.backgroundColor
property color reflectionColor: Utils.mix(fontColor, backgroundColor, 0.2)
property real diffuseComponent: staticDiffuseComponent
anchors.centerIn: parent
width: parent.width + (addedWidth / textureWidth) * parent.width
height: parent.height + (addedHeight / textureHeight) * parent.height
source: shaderString
blending: true
fragmentShader: "
uniform highp sampler2D normals;
uniform highp sampler2D source;
uniform lowp float screenCurvature;
uniform highp vec2 curvature_coefficients;
uniform lowp float ambientLight;
uniform highp float qt_Opacity;
uniform lowp vec4 reflectionColor;
uniform lowp float diffuseComponent;
varying highp vec2 qt_TexCoord0;
vec2 distortCoordinates(vec2 coords){
vec2 cc = (coords - vec2(0.5)) * curvature_coefficients;
float dist = dot(cc, cc) * screenCurvature;
return (coords + cc * (1.0 + dist) * dist);
}
float rgb2grey(vec3 v){
return dot(v, vec3(0.21, 0.72, 0.04));
}
void main(){
vec2 coords = distortCoordinates(qt_TexCoord0);
vec4 txtColor = texture2D(source, coords);
vec4 txtNormal = texture2D(normals, coords);
vec3 normal = normalize(txtNormal.rgb * 2.0 - 1.0);
vec2 lightDirection = normalize(vec2(0.5, 0.5) - coords);
float dotProd = dot(normal, vec3(lightDirection, 0.0)) * diffuseComponent * txtNormal.a;
vec3 darkColor = dotProd * reflectionColor.rgb;
gl_FragColor = vec4(mix(darkColor, txtColor.rgb, ambientLight), dotProd);
}
"
onStatusChanged: if (log) console.log(log) //Print warning messages
}
ShaderEffectSource {
id: staticLightSource
sourceItem: staticLight
hideSource: true
anchors.fill: staticLight
live: true
}
Loader{
id: dynamicLightLoader
anchors.fill: staticLight
active: appSettings.frameReflections
sourceComponent: ShaderEffect {
property ShaderEffectSource lightMask: staticLightSource
property ShaderEffectSource reflectionSource: reflectionEffectSourceLoader.item
property real diffuseComponent: dinamycDiffuseComponent
property real chromaColor: appSettings.chromaColor
property color fontColor: appSettings.fontColor
visible: true
blending: true
fragmentShader: "
uniform sampler2D lightMask;
uniform sampler2D reflectionSource;
uniform lowp float diffuseComponent;
uniform lowp float chromaColor;
uniform highp vec4 fontColor;
uniform highp float qt_Opacity;
varying highp vec2 qt_TexCoord0;
float rgb2grey(vec3 v){
return dot(v, vec3(0.21, 0.72, 0.04));
}
void main() {
float alpha = texture2D(lightMask, qt_TexCoord0).a * diffuseComponent;
vec3 reflectionColor = texture2D(reflectionSource, qt_TexCoord0).rgb;
vec3 color = fontColor.rgb * rgb2grey(reflectionColor);" +
(chromaColor !== 0 ?
"color = mix(color, fontColor.rgb * reflectionColor, chromaColor);"
: "") +
"gl_FragColor = vec4(color, 1.0) * alpha;
}
"
onStatusChanged: if (log) console.log(log) //Print warning messages
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 KiB

View File

@@ -33,16 +33,18 @@ ApplicationWindow{
visible: true
property bool fullscreen: shadersettings.fullscreen
property bool fullscreen: appSettings.fullscreen
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
//Workaround: if menubar is assigned ugly margins are visible.
menuBar: Qt.platform.os === "osx"
? defaultMenuBar
: shadersettings.showMenubar ? defaultMenuBar : null
//Workaround: Without __contentItem a ugly thin border is visible.
menuBar: CRTMainMenuBar{
id: mainMenu
visible: (Qt.platform.os === "osx" || appSettings.showMenubar)
__contentItem.visible: mainMenu.visible
}
color: "#00000000"
title: qsTr("cool-retro-term")
title: terminalContainer.title || qsTr("cool-retro-term")
Action {
id: showMenubarAction
@@ -50,72 +52,77 @@ ApplicationWindow{
enabled: Qt.platform.os !== "osx"
shortcut: "Ctrl+Shift+M"
checkable: true
checked: shadersettings.showMenubar
onTriggered: shadersettings.showMenubar = !shadersettings.showMenubar
checked: appSettings.showMenubar
onTriggered: appSettings.showMenubar = !appSettings.showMenubar
}
Action {
id: fullscreenAction
text: qsTr("Fullscreen")
enabled: Qt.platform.os !== "osx"
shortcut: "Alt+F11"
onTriggered: shadersettings.fullscreen = !shadersettings.fullscreen;
onTriggered: appSettings.fullscreen = !appSettings.fullscreen;
checkable: true
checked: shadersettings.fullscreen
checked: appSettings.fullscreen
}
Action {
id: quitAction
text: qsTr("Quit")
shortcut: "Ctrl+Shift+Q"
onTriggered: terminalWindow.close();
onTriggered: Qt.quit();
}
Action{
id: showsettingsAction
text: qsTr("Settings")
onTriggered: settingswindow.show();
onTriggered: {
settingswindow.show();
settingswindow.requestActivate();
settingswindow.raise();
}
}
Action{
id: copyAction
text: qsTr("Copy")
shortcut: "Ctrl+Shift+C"
onTriggered: terminal.copyClipboard()
shortcut: Qt.platform.os === "osx" ? StandardKey.Copy : "Ctrl+Shift+C"
}
Action{
id: pasteAction
text: qsTr("Paste")
shortcut: "Ctrl+Shift+V"
onTriggered: terminal.pasteClipboard()
shortcut: Qt.platform.os === "osx" ? StandardKey.Paste : "Ctrl+Shift+V"
}
Action{
id: zoomIn
text: qsTr("Zoom In")
shortcut: "Ctrl++"
onTriggered: shadersettings.incrementScaling();
onTriggered: appSettings.incrementScaling();
}
Action{
id: zoomOut
text: qsTr("Zoom Out")
shortcut: "Ctrl+-"
onTriggered: shadersettings.decrementScaling();
onTriggered: appSettings.decrementScaling();
}
Action{
id: showAboutAction
text: qsTr("About")
onTriggered: {
aboutDialog.show();
aboutDialog.requestActivate();
aboutDialog.raise();
}
}
CRTMainMenuBar{
id: defaultMenuBar
}
ApplicationSettings{
id: shadersettings
}
TimeManager{
id: timeManager
enableTimer: terminalWindow.visible
id: appSettings
}
TerminalContainer{
anchors.fill: parent
id: terminalContainer
y: appSettings.showMenubar ? 0 : -2 // Workaroud to hide the margin in the menubar.
width: parent.width * appSettings.windowScaling
height: (parent.height + Math.abs(y)) * appSettings.windowScaling
transform: Scale {
xScale: 1 / appSettings.windowScaling
yScale: 1 / appSettings.windowScaling
}
}
SettingsWindow{
id: settingswindow
@@ -125,5 +132,19 @@ ApplicationWindow{
id: aboutDialog
visible: false
}
Component.onCompleted: shadersettings.handleFontChanged();
Loader{
anchors.centerIn: parent
active: appSettings.showTerminalSize
sourceComponent: SizeOverlay{
z: 3
terminalSize: terminalContainer.terminalSize
}
}
Component.onCompleted: appSettings.handleFontChanged();
onClosing: {
// OSX Since we are currently supporting only one window
// quit the application when it is closed.
if (Qt.platform.os === "osx")
Qt.quit()
}
}

View File

@@ -1,17 +1,13 @@
<RCC>
<qresource prefix="/">
<file>frames/BlackRoughFrame.qml</file>
<file>frames/NoFrame.qml</file>
<file>frames/images/black-frame.png</file>
<file>frames/images/screen-frame-normals.png</file>
<file>frames/images/black-frame-normals.png</file>
<file>frames/images/screen-frame.png</file>
<file>frames/images/black-frame-original.png</file>
<file>frames/images/randfunction.png</file>
<file>frames/images/screen-frame-original.png</file>
<file>frames/WhiteSimpleFrame.qml</file>
<file>frames/utils/FrameShader.qml</file>
<file>frames/utils/NoFrameShader.qml</file>
<file>frames/utils/TerminalFrame.qml</file>
<file>SizeOverlay.qml</file>
<file>ShaderTerminal.qml</file>
@@ -32,40 +28,27 @@
<file>main.qml</file>
<file>SettingsTerminalTab.qml</file>
<file>FontScanlines.qml</file>
<file>fonts/1982-commodore64/C64_Pro_v1.0-STYLE.ttf</file>
<file>fonts/1982-commodore64/license.txt</file>
<file>fonts/1982-commodore64/C64_Pro_Mono_v1.0-STYLE.ttf</file>
<file>fonts/1982-commodore64/C64_Elite_Mono_v1.0-STYLE.ttf</file>
<file>fonts/1982-commodore64/C64_User_Mono_v1.0-STYLE.ttf</file>
<file>fonts/1982-commodore64/C64_User_v1.0-STYLE.ttf</file>
<file>fonts/1977-apple2/FreeLicense.txt</file>
<file>fonts/1977-apple2/PRNumber3.ttf</file>
<file>fonts/1977-apple2/PrintChar21.ttf</file>
<file>fonts/1971-ibm-3278/README.md</file>
<file>fonts/1971-ibm-3278/LICENSE.txt</file>
<file>fonts/1971-ibm-3278/3270Medium.ttf</file>
<file>fonts/1985-atari-st/AtariST8x16SystemFont.ttf</file>
<file>fonts/modern-terminus/TerminusTTF-Bold-4.38.2.ttf</file>
<file>fonts/modern-terminus/TerminusTTF-4.38.2.ttf</file>
<file>fonts/1977-commodore-pet/FreeLicense.txt</file>
<file>fonts/1977-commodore-pet/COMMODORE_PET_128_2y.ttf</file>
<file>fonts/1977-commodore-pet/COMMODORE_PET.ttf</file>
<file>fonts/1977-commodore-pet/COMMODORE_PET_64_2y.ttf</file>
<file>fonts/1977-commodore-pet/COMMODORE_PET_2y.ttf</file>
<file>fonts/1977-commodore-pet/COMMODORE_PET_64.ttf</file>
<file>fonts/1977-commodore-pet/COMMODORE_PET_128.ttf</file>
<file>fonts/1977-commodore-pet/COMMODORE_PET_2x.ttf</file>
<file>fonts/1979-atari-400-800/ReadMe.rtf</file>
<file>fonts/1979-atari-400-800/ATARI400800_original.TTF</file>
<file>fonts/1979-atari-400-800/ATARI400800_squared.TTF</file>
<file>fonts/1979-atari-400-800/ATARI400800_rounded.TTF</file>
<file>fonts/1985-ibm-pc-vga/Perfect DOS VGA 437 Win.ttf</file>
<file>fonts/1985-ibm-pc-vga/Perfect DOS VGA 437.ttf</file>
<file>fonts/1985-ibm-pc-vga/dos437.txt</file>
<file>Storage.qml</file>
<file>CRTMainMenuBar.qml</file>
<file>SettingsPerformanceTab.qml</file>
<file>TerminalContainer.qml</file>
<file>images/crt256.png</file>
<file>utils.js</file>
<file>images/allNoise512.png</file>
<file>fonts/modern-proggy-tiny/ProggyTiny.ttf</file>
<file>fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf</file>
<file>fonts/modern-monaco/monaco.ttf</file>
<file>fonts/modern-hermit/Hermit-medium.otf</file>
<file>fonts/modern-envy-code-r/Envy Code R.ttf</file>
<file>fonts/modern-inconsolata/Inconsolata.otf</file>
<file>SettingsScreenTab.qml</file>
</qresource>
</RCC>

17
app/qml/utils.js Normal file
View File

@@ -0,0 +1,17 @@
.pragma library
function lint(a, b, t) {
return (1 - t) * a + (t) * b;
}
function mix(c1, c2, alpha){
return Qt.rgba(c1.r * alpha + c2.r * (1-alpha),
c1.g * alpha + c2.g * (1-alpha),
c1.b * alpha + c2.b * (1-alpha),
c1.a * alpha + c2.a * (1-alpha))
}
function strToColor(s){
var r = parseInt(s.substring(1,3), 16) / 256;
var g = parseInt(s.substring(3,5), 16) / 256;
var b = parseInt(s.substring(5,7), 16) / 256;
return Qt.rgba(r, g, b, 1.0);
}

View File

@@ -1,7 +1,9 @@
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += qmltermwidget
SUBDIRS += app
SUBDIRS += konsole-qml-plugin
desktop.files += cool-retro-term.desktop
desktop.path += /usr/share/applications

View File

@@ -1,15 +0,0 @@
this is a repository for shared C++ QML plugin, offering access to
terminal sessions.
if you want to add something, please ask the maintainer of this library first to
make sure it's a good fit
the current maintainer is: Dmitry Zagnoyko <hiroshidi@gmail.com>
current plugin consist:
- KTerminal: offers access to terminal session from qml
- KSessions: offers access to pty(s) from C++ layer
Branched from:
https://code.launchpad.net/~ubuntu-terminal-dev/ubuntu-terminal-app/plugin
At revision 14

View File

@@ -1,42 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title Black on Light Yellow
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 0 0 0 0 0 # regular foreground color (Black)
color 1 255 255 221 1 0 # regular background color (Light Yellow)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 0 0 0 0 1 # intensive foreground color
color 11 255 255 221 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,104 +0,0 @@
[Background]
Bold=false
Color=247,247,214
Transparency=true
MaxRandomHue=340
[BackgroundIntense]
Bold=false
Color=255,255,221
Transparency=true
[Color0]
Bold=false
Color=0,0,0
Transparency=false
[Color0Intense]
Bold=false
Color=104,104,104
Transparency=false
[Color1]
Bold=false
Color=178,24,24
Transparency=false
[Color1Intense]
Bold=false
Color=255,84,84
Transparency=false
[Color2]
Bold=false
Color=24,178,24
Transparency=false
[Color2Intense]
Bold=false
Color=84,255,84
Transparency=false
[Color3]
Bold=false
Color=178,104,24
Transparency=false
[Color3Intense]
Bold=false
Color=255,255,84
Transparency=false
[Color4]
Bold=false
Color=24,24,178
Transparency=false
[Color4Intense]
Bold=false
Color=84,84,255
Transparency=false
[Color5]
Bold=false
Color=178,24,178
Transparency=false
[Color5Intense]
Bold=false
Color=255,84,255
Transparency=false
[Color6]
Bold=false
Color=24,178,178
Transparency=false
[Color6Intense]
Bold=false
Color=84,255,255
Transparency=false
[Color7]
Bold=false
Color=178,178,178
Transparency=false
[Color7Intense]
Bold=false
Color=255,255,255
Transparency=false
[Foreground]
Bold=false
Color=0,0,0
Transparency=false
[ForegroundIntense]
Bold=true
Color=0,0,0
Transparency=false
[General]
Description=Black on Random Light
Opacity=1

View File

@@ -1,42 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title Black on White
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 0 0 0 0 0 # regular foreground color (Black)
color 1 255 255 255 1 0 # regular background color (White)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 0 0 0 0 1 # intensive foreground color
color 11 255 255 255 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,103 +0,0 @@
[Background]
Bold=false
Color=44,44,44
Transparency=false
[BackgroundIntense]
Bold=true
Color=44,44,44
Transparency=false
[Color0]
Bold=false
Color=63,63,63
Transparency=false
[Color0Intense]
Bold=true
Color=112,144,128
Transparency=false
[Color1]
Bold=false
Color=112,80,80
Transparency=false
[Color1Intense]
Bold=true
Color=220,163,163
Transparency=false
[Color2]
Bold=false
Color=96,180,138
Transparency=false
[Color2Intense]
Bold=true
Color=114,213,163
Transparency=false
[Color3]
Bold=false
Color=223,175,143
Transparency=false
[Color3Intense]
Bold=true
Color=240,223,175
Transparency=false
[Color4]
Bold=false
Color=154,184,215
Transparency=false
[Color4Intense]
Bold=true
Color=148,191,243
Transparency=false
[Color5]
Bold=false
Color=220,140,195
Transparency=false
[Color5Intense]
Bold=true
Color=236,147,211
Transparency=false
[Color6]
Bold=false
Color=140,208,211
Transparency=false
[Color6Intense]
Bold=true
Color=147,224,227
Transparency=false
[Color7]
Bold=false
Color=220,220,204
Transparency=false
[Color7Intense]
Bold=true
Color=255,255,255
Transparency=false
[Foreground]
Bold=false
Color=220,220,204
Transparency=false
[ForegroundIntense]
Bold=true
Color=220,220,204
Transparency=false
[General]
Description=Dark Pastels
Opacity=1

View File

@@ -1,104 +0,0 @@
[Background]
Bold=false
Color=0,0,0
Transparency=false
[BackgroundIntense]
Bold=false
Color=0,0,0
Transparency=false
[Color0]
Bold=false
Color=0,0,0
Transparency=false
[Color0Intense]
Bold=false
Color=104,104,104
Transparency=false
[Color1]
Bold=false
Color=250,75,75
Transparency=false
[Color1Intense]
Bold=false
Color=255,84,84
Transparency=false
[Color2]
Bold=false
Color=24,178,24
Transparency=false
[Color2Intense]
Bold=false
Color=84,255,84
Transparency=false
[Color3]
Bold=false
Color=178,104,24
Transparency=false
[Color3Intense]
Bold=false
Color=255,255,84
Transparency=false
[Color4]
Bold=false
Color=92,167,251
Transparency=false
[Color4Intense]
Bold=false
Color=84,84,255
Transparency=false
[Color5]
Bold=false
Color=225,30,225
Transparency=false
[Color5Intense]
Bold=false
Color=255,84,255
Transparency=false
[Color6]
Bold=false
Color=24,178,178
Transparency=false
[Color6Intense]
Bold=false
Color=84,255,255
Transparency=false
[Color7]
Bold=false
Color=178,178,178
Transparency=false
[Color7Intense]
Bold=false
Color=255,255,255
Transparency=false
[Foreground]
Bold=false
Color=24,240,24
Transparency=false
[ForegroundIntense]
Bold=true
Color=24,240,24
Transparency=false
[General]
Description=Green on Black
Opacity=1

View File

@@ -1,100 +0,0 @@
[Background]
Bold=false
Color=0,0,0
[BackgroundIntense]
Bold=false
Color=104,104,104
[Color0]
Bold=false
Color=0,0,0
[Color0Intense]
Bold=false
Color=104,104,104
[Color1]
Bold=false
Color=178,24,24
[Color1Intense]
Bold=false
Color=255,84,84
[Color2]
Bold=false
Color=24,178,24
[Color2Intense]
Bold=false
Color=84,255,84
[Color3]
Bold=false
Color=178,104,24
[Color3Intense]
Bold=false
Color=255,255,84
[Color4]
Bold=false
Color=24,24,178
[Color4Intense]
Bold=false
Color=84,84,255
[Color5]
Bold=false
Color=178,24,178
[Color5Intense]
Bold=false
Color=255,84,255
[Color6]
Bold=false
Color=24,178,178
[Color6Intense]
Bold=false
Color=84,255,255
[Color7]
Bold=false
Color=178,178,178
[Color7Intense]
Bold=false
Color=255,255,255
[Foreground]
Bold=false
Color=178,178,178
[ForegroundIntense]
Bold=false
Color=255,255,255
[General]
Description=Linux Colors

View File

@@ -1,42 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title White on Black
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 255 255 255 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 1 # intensive foreground color
color 11 0 0 0 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,31 +0,0 @@
import sys
__, inpath, outpath = sys.argv
def interpolate(color, minim):
return minim + (color / 255) * (255 - minim)
def rgb2grey(r, g, b):
return round(0.21 * r + 0.72 * g + 0.07 * b)
infile = open(inpath, "r")
outfile = open(outpath, "w")
lines = infile.readlines()
def process_line(line):
if not line.startswith("color"): return line
chunks = [l for l in line.split(" ") if l]
color = rgb2grey(int(chunks[2]), int(chunks[3]), int(chunks[4]))
if color != 0:
color = int(interpolate(color, 5))
chunks[2] = str(color)
chunks[3] = str(color)
chunks[4] = str(color)
return ' '.join(chunks)
for l in (process_line(l) for l in lines):
outfile.write(l + '\n')
infile.close()
outfile.close()

View File

@@ -1,85 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title White on Black
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 255 255 255 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 255 43 43 0 0 # regular color 1 Red
color 4 28 172 120 0 0 # regular color 2 Green
color 5 248 213 104 0 0 # regular color 3 Yellow
color 6 43 108 196 0 0 # regular color 4 Blue
color 7 255 29 206 0 0 # regular color 5 Magenta
color 8 24 167 181 0 0 # regular color 6 Cyan
color 9 179 179 179 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 1 # intensive foreground color
color 11 0 0 0 1 0 # intensive background color
color 12 106 106 106 0 0 # intensive color 0
color 13 253 94 83 0 0 # intensive color 1
color 14 168 228 160 0 0 # intensive color 2
color 15 254 254 34 0 0 # intensive color 3
color 16 154 206 235 0 0 # intensive color 4
color 17 252 116 253 0 0 # intensive color 5
color 18 236 234 190 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,42 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title Black on Light Color
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 0 0 0 0 0 # regular foreground color (Black)
rcolor 1 30 255 1 0 # regular background color (Light Color)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 0 0 0 0 1 # intensive foreground color
color 11 255 255 221 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,44 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title Marble
image tile Blkmarble.jpg
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 255 255 255 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 1 # intensive foreground color
color 11 0 0 0 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,47 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title Ugly 1
# add a wallpaper, if you like. Second word one of { tile,center,full }
image tile /opt/kde/share/wallpapers/dancy_pants.jpg
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 0 0 0 0 0 # regular foreground color (Black)
color 1 255 255 255 1 0 # regular background color (White)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 255 0 0 0 0 # regular color 1 Red
color 4 0 255 0 0 0 # regular color 2 Green
color 5 255 255 0 0 0 # regular color 3 Yellow
color 6 0 0 255 0 0 # regular color 4 Blue
color 7 255 0 255 0 0 # regular color 5 Magenta
color 8 0 255 255 0 0 # regular color 6 Cyan
color 9 255 255 255 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 0 0 0 0 1 # intensive foreground color
color 11 255 255 255 1 1 # intensive background color
color 12 0 0 0 0 1 # intensive color 0
color 13 255 0 0 0 1 # intensive color 1
color 14 0 255 0 0 1 # intensive color 2
color 15 255 255 0 0 1 # intensive color 3
color 16 0 0 255 0 1 # intensive color 4
color 17 255 0 255 0 1 # intensive color 5
color 18 0 255 255 0 1 # intensive color 6
color 19 255 255 255 0 1 # intensive color 7

View File

@@ -1,42 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title Green on Black
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 24 240 24 0 0 # regular foreground color (Green)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 24 240 24 0 1 # intensive foreground color
color 11 0 0 0 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,49 +0,0 @@
# linux color schema for konsole
title Green Tint
transparency 0.3 0 150 0
# FIXME
#
# The flaw in this schema is that "blick" comes out on the
# Linux console as intensive background, really.
# Since this is not used in clients you'll hardly notice
# it in practice.
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 178 178 178 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 0 # intensive foreground color
color 11 104 104 104 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,49 +0,0 @@
# linux color schema for konsole
title Green Tint with Transparent MC
transparency 0.3 0 150 0
# FIXME
#
# The flaw in this schema is that "blick" comes out on the
# Linux console as intensive background, really.
# Since this is not used in clients you'll hardly notice
# it in practice.
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 178 178 178 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 0 0 0 1 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 0 # intensive foreground color
color 11 104 104 104 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,44 +0,0 @@
# example scheme for konsole
# the title is to appear in the menu.
title Paper
image tile Paper01.jpg
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 0 0 0 0 0 # regular foreground color (Black)
color 1 255 255 255 1 0 # regular background color (White)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 0 0 0 0 1 # intensive foreground color
color 11 255 255 255 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,47 +0,0 @@
# linux color schema for konsole
title Linux Colors
# FIXME
#
# The flaw in this schema is that "blick" comes out on the
# Linux console as intensive background, really.
# Since this is not used in clients you'll hardly notice
# it in practice.
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 178 178 178 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 0 # intensive foreground color
color 11 104 104 104 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,132 +0,0 @@
[README.Schema]
The schemata offered in the Options/Schema menu are
taken from from configurations files with a *.schema
pattern either located in $KDEDIR/share/apps/konsole
or ~/.kde/share/apps/konsole.
Schemata allow to configure the color set that konsole
uses, together with some more information on rendition
processing.
Syntax
File
:: { [Line] ['#' Comment] '\n' }
Line
:: "title" Title
:: "image" Usage PathToPictureFile
:: "transparency" Fade Red Green Blue
:: "color" Slot Red Green Blue Transparent Bold
:: "rcolor" Slot Saturation Value Transparent Bold
:: "sysfg" Slot Transparent Bold
:: "sysbg" Slot Transparent Bold
Meaning
- Title is the text to appear in the Option/Schema menu.
It should be unique among all other schemata therefore.
- The "image" clause allows to place an image on the
konsole's background.
- Usage can be either
- "tile" - the image is tilewise replicated.
- "center" - the image is centered.
- "full" - the image is stretched to fit the window size.
- The Path of the picture can both be relative
(to kde wallpapers) or absolute.
When a schema uses a background image (or transparency)
one has to make at least one color slot transparent to
achive any visible effect. Please read below about the
"Transparent" field in color,sysbg,sysfg.
- The "transparency" clause picks and uses the background
of the desktop as if it where an image together with
a fade effect. This effect will fade the background
to the specified color.
The "Fade" is a real value between 0 and 1, indicating
the strength of the fade. A value of 0 will not change
the image, a value of 1 will make it the fade color
everywhere, and in between. This will make the "glas"
of the window be of the color given in the clause and
being more(1) or less(0) intransparent.
- The remaining clauses (color,sysbg,sysfg) are used
to setup konsoles rendition system.
To this end, konsole offers 20 color slots.
Slot Meaning
----- --------------------------
0 regular foreground color
1 regular background color
2-9 regular bgr color 0-7
10 intensive foreground color
11 intensive background color
12-19 intensive bgr color 0-7
The traditional meaning of the "bgr" color codes
has a bitwise interpretation of an additive three
primary color scheme inherited from early EGA
color terminals.
Color Bits Colors
----- ---- -------
0 000 Black
1 001 Red
2 010 Green
3 011 Yellow
4 100 Blue
5 101 Magenta
6 110 Cyan
7 111 White
One may or may not stick to this tradition.
Konsole allows to assign colors freely to slots.
The slots fall apart into two groups, regular
and intensive colors. The later are used when
BOLD rendition is used by the client.
Each of the groups have a default fore- and
background color and the said bgr colors.
Normal terminal processing will simply use
the default colors.
The color desired for a slot is indicated
in the Red Green Blue fields of the color
clause. Use the sysfg or the sysbg clause
to indicate the default fore and background
colors of the desktop.
To specify randomized color for a slot use
the clause rcolor. The two parameters to it
being Saturation - the amount of colour,
and Value, the darkness of the colour.
To use transparency/images and to simulate
the behavior of the xterm, one can supply
two additional tags to each slot:
- Transparent (0/1) meaning to show the
background picture, if any.
- Bold (0/1) to render characters bold.
If you know about the escape codes, you might have
noticed that intensive and bold rendition are sort
of confused. This is inherited by the xterm which
konsole is simulating.
One can use the colortest.sh script supplied
with the konsole source distribution to test
a schema.
The schema installed with konsole are more or
less demonstrations and not really beauty,
beside the Linux.schema, perhaps, which is
made after the VGA colors.

View File

@@ -1,44 +0,0 @@
# default scheme for konsole (only here for documentation purposes)
# the title is to appear in the menu.
title Konsole Defaults
# image tile /opt/kde/share/wallpapers/gray2.jpg
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
color 0 0 0 0 0 0 # regular foreground color (Black)
color 1 255 255 255 1 0 # regular background color (White)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 0 0 0 0 1 # intensive foreground color
color 11 255 255 255 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,49 +0,0 @@
# linux color schema for konsole
title Transparent Konsole
transparency 0.35 0 0 0
# FIXME
#
# The flaw in this schema is that "blick" comes out on the
# Linux console as intensive background, really.
# Since this is not used in clients you'll hardly notice
# it in practice.
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 178 178 178 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 0 # intensive foreground color
color 11 104 104 104 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,51 +0,0 @@
# linux color schema for konsole
title Transparent for MC
transparency 0.35 0 0 0
# FIXME
#
# The flaw in this schema is that "blick" comes out on the
# Linux console as intensive background, really.
# Since this is not used in clients you'll hardly notice
# it in practice.
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 178 178 178 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
#color 6 24 24 178 0 0 # regular color 4 Blue
color 6 0 0 0 1 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 0 # intensive foreground color
color 11 104 104 104 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,42 +0,0 @@
# linux color schema for konsole
title Transparent, Dark Background
transparency 0.75 0 0 0
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 255 255 255 0 0 # regular foreground color (White)
color 1 0 0 0 1 0 # regular background color (Black)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 255 255 255 0 0 # intensive foreground color
color 11 104 104 104 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,51 +0,0 @@
# linux color schema for konsole
title Transparent, Light Background
transparency 0.1 0 0 0
# This is a schema for very light backgrounds. It makes some
# hacks about the colors to make Midnight Commander transparent
# and with suitable colors.
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 50 50 50 0 0 # regular foreground color (DarkGray)
color 1 200 200 200 1 0 # regular background color (White)
# color 2 0 0 0 0 0 # regular color 0 Black
color 2 200 200 200 1 0 # regular background color (White)
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
#color 6 24 24 178 0 0 # regular color 4 Blue
color 6 0 0 0 1 0 # regular color 4 Blue
# Blue is transparent, to make MC transparent
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
# color 9 178 178 178 0 0 # regular color 7 White
color 9 50 50 50 0 0 # regular foreground color (DarkGray)
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 0 0 0 0 0 # intensive foreground color
color 11 255 255 255 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,46 +0,0 @@
# xterm color schema for konsole
# xterm colors can be configured (almost) like
# konsole colors can. This is the uncustomized
# xterm schema.
# Please refere to your local xterm setup files
# if this schema differs.
title XTerm Colors
# foreground colors -------------------------------
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 0 0 0 0 0 # regular foreground color (Black)
color 1 255 255 255 1 0 # regular background color (White)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 205 0 0 0 0 # regular color 1 Red
color 4 0 205 0 0 0 # regular color 2 Green
color 5 205 205 0 0 0 # regular color 3 Yellow
color 6 0 0 205 0 0 # regular color 4 Blue
color 7 205 0 205 0 0 # regular color 5 Magenta
color 8 0 205 205 0 0 # regular color 6 Cyan
color 9 229 229 229 0 0 # regular color 7 White
# intensive colors -------------------------------------------
# for some strange reason, intensive colors are bold, also.
color 10 77 77 77 0 1 # intensive foreground color
color 11 255 255 255 1 1 # intensive background color
color 12 77 77 77 0 1 # intensive color 0
color 13 255 0 0 0 1 # intensive color 1
color 14 0 255 0 0 1 # intensive color 2
color 15 255 255 0 0 1 # intensive color 3
color 16 0 0 255 0 1 # intensive color 4
color 17 255 0 255 0 1 # intensive color 5
color 18 0 255 255 0 1 # intensive color 6
color 19 255 255 255 0 1 # intensive color 7

View File

@@ -1,44 +0,0 @@
# schema that uses system colors
# the title is to appear in the menu.
title System Colors
# image none
# foreground colors
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | | |
# V V--color--V V V
sysfg 0 0 0 # regular foreground color (system)
sysbg 1 1 0 # regular background color (system)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
color 4 24 178 24 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
color 7 178 24 178 0 0 # regular color 5 Magenta
color 8 24 178 178 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
# instead of changing the colors, we've flaged the text to become bold
color 10 0 0 0 0 1 # intensive foreground color
color 11 255 255 255 1 0 # intensive background color
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
color 14 84 255 84 0 0 # intensive color 2
color 15 255 255 84 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
color 17 255 84 255 0 0 # intensive color 5
color 18 84 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,40 +0,0 @@
# VIM-recommended color schema for konsole
# VIM (VI improved) in "help xiterm" recommends these colors for xterm.
title VIM Colors
# foreground colors -------------------------------
# note that the default background color is flagged
# to become transparent when an image is present.
# slot transparent bold
# | red grn blu | |
# V V--color--V V V
color 0 0 0 0 0 0 # regular foreground color (Black)
color 1 255 255 255 1 0 # regular background color (White)
color 2 0 0 0 0 0 # regular color 0 Black
color 3 192 0 0 0 0 # regular color 1 Red
color 4 0 128 0 0 0 # regular color 2 Green
color 5 128 128 0 0 0 # regular color 3 Yellow
color 6 0 0 192 0 0 # regular color 4 Blue
color 7 192 0 192 0 0 # regular color 5 Magenta
color 8 0 128 128 0 0 # regular color 6 Cyan
color 9 192 192 192 0 0 # regular color 7 White
# intensive colors -------------------------------------------
color 10 77 77 77 0 1 # intensive foreground color
color 11 255 255 255 1 1 # intensive background color
color 12 128 128 128 0 0 # intensive color 0
color 13 255 96 96 0 0 # intensive color 1
color 14 0 255 0 0 0 # intensive color 2
color 15 255 255 0 0 0 # intensive color 3
color 16 128 128 255 0 0 # intensive color 4
color 17 255 64 255 0 0 # intensive color 5
color 18 0 255 255 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

View File

@@ -1,72 +0,0 @@
[README.KeyTab]
The keytabs offered in the Options/Keyboard menu are
taken from from configurations files with a *.keytab
pattern either located in $KDEDIR/share/apps/konsole
or ~/.kde/share/apps/konsole.
Keytabs allow to configure the behavior of konsole
on keyboard events, especially for functions keys.
Please have a look into the README.keyboard file, too.
The syntax is that each entry has the form :
"key" Keyname { ("+"|"-") Modename } ":" (String|Operation)
Keynames are those defined in <qnamespace.h> with the
"Qt::Key_" prefix removed.
Mode names are:
- Shift : Shift Key pressed
- Alt : Alt Key pressed
- Control : Control Key pressed
( The VT100 emulation has modes that can affect the
sequences emitted by certain keys. These modes are
under control of the client program.
- Newline : effects Return and Enter key.
- Application : effects Up and Down key.
- Ansi : effects Up and Down key (This is for VT52, really).
Since sending a state to a program that has set the state
itself is positivly wrong and obsolete design, better forget
about this nasty detail. I may well remove this "feature"
in a future clean up round. )
A "+" preceeding a Modename means the Key is pressed.
A "-" preceeding a Modename means the Key is not pressed.
If no mode is given it means don't care.
Note that the combination of Key and Modes (set/reset)
has to be unique. This means, that
key A + Shift : "A"
key A : "a"
will not accept the small letter "a" rule as expected,
one has to add a "- Shift" to the last clause. Use
the stdout/stderr dianostics of konsole when modifying
keytabs to find problems like this.
Operations are
- scrollUpLine : scroll up one line in the history log
- scrollUpPage : scroll up one page in the history log
- scrollDownLine : scroll down one line in the history log
- scrollDownPage : scroll down one page in the history log
- emitClipboard : "paste" the current clipboard
- emitSelection : "paste" the current selection
Strings have the syntax of C strings,
one may use the following escapes:
- \E - escape
- \\ - backslash
- \" - double quote
- \t - tab
- \r - return
- \n - newline
- \b - backspace
- \xHH - where HH are two hex digits

View File

@@ -1,169 +0,0 @@
# [README.default.Keytab] Default Keyboard Table
#
# To customize your keyboard, copy this file to something
# ending with .keytab and change it to meet you needs.
# Please read the README.KeyTab and the README.keyboard
# in this case.
#
# --------------------------------------------------------------
keyboard "Default (XFree 4)"
# --------------------------------------------------------------
#
# Note that this particular table is a "risc" version made to
# ease customization without bothering with obsolete details.
# See VT100.keytab for the more hairy stuff.
#
# --------------------------------------------------------------
# common keys
key Escape : "\E"
key Tab -Shift : "\t"
key Tab +Shift+Ansi : "\E[Z"
key Tab +Shift-Ansi : "\t"
key Backtab +Ansi : "\E[Z"
key Backtab -Ansi : "\t"
key Return-Shift-NewLine : "\r"
key Return-Shift+NewLine : "\r\n"
key Return+Shift : "\EOM"
# Backspace and Delete codes are preserving CTRL-H.
key Backspace : "\x7f"
# Arrow keys in VT52 mode
# shift up/down are reserved for scrolling.
# shift left/right are reserved for switching between tabs (this is hardcoded).
key Up -Shift-Ansi : "\EA"
key Down -Shift-Ansi : "\EB"
key Right-Shift-Ansi : "\EC"
key Left -Shift-Ansi : "\ED"
# Arrow keys in ANSI mode with Application - and Normal Cursor Mode)
key Up -Shift-AnyMod+Ansi+AppCuKeys : "\EOA"
key Down -Shift-AnyMod+Ansi+AppCuKeys : "\EOB"
key Right -Shift-AnyMod+Ansi+AppCuKeys : "\EOC"
key Left -Shift-AnyMod+Ansi+AppCuKeys : "\EOD"
key Up -Shift-AnyMod+Ansi-AppCuKeys : "\E[A"
key Down -Shift-AnyMod+Ansi-AppCuKeys : "\E[B"
key Right -Shift-AnyMod+Ansi-AppCuKeys : "\E[C"
key Left -Shift-AnyMod+Ansi-AppCuKeys : "\E[D"
key Up -Shift+AnyMod+Ansi : "\E[1;*A"
key Down -Shift+AnyMod+Ansi : "\E[1;*B"
key Right -Shift+AnyMod+Ansi : "\E[1;*C"
key Left -Shift+AnyMod+Ansi : "\E[1;*D"
# Keypad keys with NumLock ON
# (see "Numeric Keypad" section at http://www.nw.com/nw/WWW/products/wizcon/vt100.html )
#
# Not enabled for now because it breaks the keypad in Vim.
#
#key 0 +KeyPad+AppKeyPad : "\EOp"
#key 1 +KeyPad+AppKeyPad : "\EOq"
#key 2 +KeyPad+AppKeyPad : "\EOr"
#key 3 +KeyPad+AppKeyPad : "\EOs"
#key 4 +KeyPad+AppKeyPad : "\EOt"
#key 5 +KeyPad+AppKeyPad : "\EOu"
#key 6 +KeyPad+AppKeyPad : "\EOv"
#key 7 +KeyPad+AppKeyPad : "\EOw"
#key 8 +KeyPad+AppKeyPad : "\EOx"
#key 9 +KeyPad+AppKeyPad : "\EOy"
#key + +KeyPad+AppKeyPad : "\EOl"
#key - +KeyPad+AppKeyPad : "\EOm"
#key . +KeyPad+AppKeyPad : "\EOn"
#key * +KeyPad+AppKeyPad : "\EOM"
#key Enter +KeyPad+AppKeyPad : "\r"
# Keypad keys with NumLock Off
key Up -Shift+Ansi+AppCuKeys+KeyPad : "\EOA"
key Down -Shift+Ansi+AppCuKeys+KeyPad : "\EOB"
key Right -Shift+Ansi+AppCuKeys+KeyPad : "\EOC"
key Left -Shift+Ansi+AppCuKeys+KeyPad : "\EOD"
key Up -Shift+Ansi-AppCuKeys+KeyPad : "\E[A"
key Down -Shift+Ansi-AppCuKeys+KeyPad : "\E[B"
key Right -Shift+Ansi-AppCuKeys+KeyPad : "\E[C"
key Left -Shift+Ansi-AppCuKeys+KeyPad : "\E[D"
key Home +AppCuKeys+KeyPad : "\EOH"
key End +AppCuKeys+KeyPad : "\EOF"
key Home -AppCuKeys+KeyPad : "\E[H"
key End -AppCuKeys+KeyPad : "\E[F"
key Insert +KeyPad : "\E[2~"
key Delete +KeyPad : "\E[3~"
key Prior -Shift+KeyPad : "\E[5~"
key Next -Shift+KeyPad : "\E[6~"
# other grey PC keys
key Enter+NewLine : "\r\n"
key Enter-NewLine : "\r"
key Home -AnyMod-AppCuKeys : "\E[H"
key End -AnyMod-AppCuKeys : "\E[F"
key Home -AnyMod+AppCuKeys : "\EOH"
key End -AnyMod+AppCuKeys : "\EOF"
key Home +AnyMod : "\E[1;*H"
key End +AnyMod : "\E[1;*F"
key Insert -AnyMod : "\E[2~"
key Delete -AnyMod : "\E[3~"
key Insert +AnyMod : "\E[2;*~"
key Delete +AnyMod : "\E[3;*~"
key Prior -Shift-AnyMod : "\E[5~"
key Next -Shift-AnyMod : "\E[6~"
key Prior -Shift+AnyMod : "\E[5;*~"
key Next -Shift+AnyMod : "\E[6;*~"
# Function keys
key F1 -AnyMod : "\EOP"
key F2 -AnyMod : "\EOQ"
key F3 -AnyMod : "\EOR"
key F4 -AnyMod : "\EOS"
key F5 -AnyMod : "\E[15~"
key F6 -AnyMod : "\E[17~"
key F7 -AnyMod : "\E[18~"
key F8 -AnyMod : "\E[19~"
key F9 -AnyMod : "\E[20~"
key F10 -AnyMod : "\E[21~"
key F11 -AnyMod : "\E[23~"
key F12 -AnyMod : "\E[24~"
key F1 +AnyMod : "\EO*P"
key F2 +AnyMod : "\EO*Q"
key F3 +AnyMod : "\EO*R"
key F4 +AnyMod : "\EO*S"
key F5 +AnyMod : "\E[15;*~"
key F6 +AnyMod : "\E[17;*~"
key F7 +AnyMod : "\E[18;*~"
key F8 +AnyMod : "\E[19;*~"
key F9 +AnyMod : "\E[20;*~"
key F10 +AnyMod : "\E[21;*~"
key F11 +AnyMod : "\E[23;*~"
key F12 +AnyMod : "\E[24;*~"
# Work around dead keys
key Space +Control : "\x00"
# Some keys are used by konsole to cause operations.
# The scroll* operations refer to the history buffer.
key Up +Shift-AppScreen : scrollLineUp
key Prior +Shift-AppScreen : scrollPageUp
key Down +Shift-AppScreen : scrollLineDown
key Next +Shift-AppScreen : scrollPageDown
key ScrollLock : scrollLock

View File

@@ -1,133 +0,0 @@
# [vt100.keytab] Konsole Keyboard Table (VT100 keys)
#
# --------------------------------------------------------------
keyboard "vt100 (historical)"
# --------------------------------------------------------------
#
# This configuration table allows to customize the
# meaning of the keys.
#
# The syntax is that each entry has the form :
#
# "key" Keyname { ("+"|"-") Modename } ":" (String|Operation)
#
# Keynames are those defined in <qnamespace.h> with the
# "Qt::Key_" removed. (We'd better insert the list here)
#
# Mode names are :
#
# - Shift
# - Alt
# - Control
#
# The VT100 emulation has two modes that can affect the
# sequences emitted by certain keys. These modes are
# under control of the client program.
#
# - Newline : effects Return and Enter key.
# - Application : effects Up and Down key.
#
# - Ansi : effects Up and Down key (This is for VT52, really).
#
# Operations are
#
# - scrollUpLine
# - scrollUpPage
# - scrollDownLine
# - scrollDownPage
#
# - emitSelection
#
# If the key is not found here, the text of the
# key event as provided by QT is emitted, possibly
# preceeded by ESC if the Alt key is pressed.
#
# --------------------------------------------------------------
key Escape : "\E"
key Tab : "\t"
# VT100 can add an extra \n after return.
# The NewLine mode is set by an escape sequence.
key Return-NewLine : "\r"
key Return+NewLine : "\r\n"
# Some desperately try to save the ^H.
key Backspace : "\x7f"
key Delete : "\E[3~"
# These codes are for the VT52 mode of VT100
# The Ansi mode (i.e. VT100 mode) is set by
# an escape sequence
key Up -Shift-Ansi : "\EA"
key Down -Shift-Ansi : "\EB"
key Right-Shift-Ansi : "\EC"
key Left -Shift-Ansi : "\ED"
# VT100 emits a mode bit together
# with the arrow keys.The AppCuKeys
# mode is set by an escape sequence.
key Up -Shift+Ansi+AppCuKeys : "\EOA"
key Down -Shift+Ansi+AppCuKeys : "\EOB"
key Right-Shift+Ansi+AppCuKeys : "\EOC"
key Left -Shift+Ansi+AppCuKeys : "\EOD"
key Up -Shift+Ansi-AppCuKeys : "\E[A"
key Down -Shift+Ansi-AppCuKeys : "\E[B"
key Right-Shift+Ansi-AppCuKeys : "\E[C"
key Left -Shift+Ansi-AppCuKeys : "\E[D"
# function keys (FIXME: make pf1-pf4)
key F1 : "\E[11~"
key F2 : "\E[12~"
key F3 : "\E[13~"
key F4 : "\E[14~"
key F5 : "\E[15~"
key F6 : "\E[17~"
key F7 : "\E[18~"
key F8 : "\E[19~"
key F9 : "\E[20~"
key F10 : "\E[21~"
key F11 : "\E[23~"
key F12 : "\E[24~"
key Home : "\E[H"
key End : "\E[F"
key Prior -Shift : "\E[5~"
key Next -Shift : "\E[6~"
key Insert-Shift : "\E[2~"
# Keypad-Enter. See comment on Return above.
key Enter+NewLine : "\r\n"
key Enter-NewLine : "\r"
key Space +Control : "\x00"
# some of keys are used by konsole.
key Up +Shift : scrollLineUp
key Prior +Shift : scrollPageUp
key Down +Shift : scrollLineDown
key Next +Shift : scrollPageDown
key ScrollLock : scrollLock
#----------------------------------------------------------
# keypad characters as offered by Qt
# cannot be recognized as such.
#----------------------------------------------------------
# Following other strings as emitted by konsole.

View File

@@ -1,71 +0,0 @@
# [x11r5.Keytab] Keyboard Table for X11 R5
keyboard "XTerm (XFree 3.x.x)"
# --------------------------------------------------------------
#
# Note that this particular table is a "risc" version made to
# ease customization without bothering with obsolete details.
# See VT100.keytab for the more hairy stuff.
#
# --------------------------------------------------------------
# common keys
key Escape : "\E"
key Tab : "\t"
key Return : "\r"
# Backspace and Delete codes are preserving CTRL-H.
key Backspace : "\x7f"
# cursor keys
key Up -Shift : "\EOA"
key Down -Shift : "\EOB"
key Right -Shift : "\EOC"
key Left -Shift : "\EOD"
# other grey PC keys
key Enter : "\r"
key Home : "\E[1~"
key Insert-Shift : "\E[2~"
key Delete : "\E[3~"
key End : "\E[4~"
key Prior -Shift : "\E[5~"
key Next -Shift : "\E[6~"
# function keys
key F1 : "\E[11~"
key F2 : "\E[12~"
key F3 : "\E[13~"
key F4 : "\E[14~"
key F5 : "\E[15~"
key F6 : "\E[17~"
key F7 : "\E[18~"
key F8 : "\E[19~"
key F9 : "\E[20~"
key F10 : "\E[21~"
key F11 : "\E[23~"
key F12 : "\E[24~"
# Work around dead keys
key Space +Control : "\x00"
# Some keys are used by konsole to cause operations.
# The scroll* operations refer to the history buffer.
key Up +Shift : scrollLineUp
key Prior +Shift : scrollPageUp
key Down +Shift : scrollLineDown
key Next +Shift : scrollPageDown
key ScrollLock : scrollLock
# keypad characters are not offered differently by Qt.

View File

@@ -1,164 +0,0 @@
# [linux.keytab] Konsole Keyboard Table (Linux console keys)
#
# --------------------------------------------------------------
# NOT TESTED, MAY NEED SOME CLEANUPS
keyboard "Linux console"
# --------------------------------------------------------------
#
# This configuration table allows to customize the
# meaning of the keys.
#
# The syntax is that each entry has the form :
#
# "key" Keyname { ("+"|"-") Modename } ":" (String|Operation)
#
# Keynames are those defined in <qnamespace.h> with the
# "Qt::Key_" removed. (We'd better insert the list here)
#
# Mode names are :
#
# - Shift
# - Alt
# - Control
#
# The VT100 emulation has two modes that can affect the
# sequences emitted by certain keys. These modes are
# under control of the client program.
#
# - Newline : effects Return and Enter key.
# - Application : effects Up and Down key.
#
# - Ansi : effects Up and Down key (This is for VT52, really).
#
# Operations are
#
# - scrollUpLine
# - scrollUpPage
# - scrollDownLine
# - scrollDownPage
#
# - emitSelection
#
# If the key is not found here, the text of the
# key event as provided by QT is emitted, possibly
# preceeded by ESC if the Alt key is pressed.
#
# --------------------------------------------------------------
key Escape : "\E"
key Tab : "\t"
# VT100 can add an extra \n after return.
# The NewLine mode is set by an escape sequence.
key Return-NewLine : "\r"
key Return+NewLine : "\r\n"
# Some desperately try to save the ^H.
key Backspace : "\x7f"
key Delete : "\E[3~"
# These codes are for the VT52 mode of VT100
# The Ansi mode (i.e. VT100 mode) is set by
# an escape sequence
key Up -Shift-Ansi : "\EA"
key Down -Shift-Ansi : "\EB"
key Right-Shift-Ansi : "\EC"
key Left -Shift-Ansi : "\ED"
# VT100 emits a mode bit together
# with the arrow keys.The AppCuKeys
# mode is set by an escape sequence.
key Up -Shift+Ansi+AppCuKeys : "\EOA"
key Down -Shift+Ansi+AppCuKeys : "\EOB"
key Right-Shift+Ansi+AppCuKeys : "\EOC"
key Left -Shift+Ansi+AppCuKeys : "\EOD"
key Up -Shift+Ansi-AppCuKeys : "\E[A"
key Down -Shift+Ansi-AppCuKeys : "\E[B"
key Right-Shift+Ansi-AppCuKeys : "\E[C"
key Left -Shift+Ansi-AppCuKeys : "\E[D"
# linux functions keys F1-F5 differ from xterm
key F1 : "\E[[A"
key F2 : "\E[[B"
key F3 : "\E[[C"
key F4 : "\E[[D"
key F5 : "\E[[E"
key F6 : "\E[17~"
key F7 : "\E[18~"
key F8 : "\E[19~"
key F9 : "\E[20~"
key F10 : "\E[21~"
key F11 : "\E[23~"
key F12 : "\E[24~"
key Home : "\E[1~"
key End : "\E[4~"
key Prior -Shift : "\E[5~"
key Next -Shift : "\E[6~"
key Insert-Shift : "\E[2~"
# Keypad-Enter. See comment on Return above.
key Enter+NewLine : "\r\n"
key Enter-NewLine : "\r"
key Space +Control : "\x00"
# linux term ctrl seq
key A +Control : "\x01"
key B +Control : "\x02"
key C +Control : "\x03"
key D +Control : "\x04"
key E +Control : "\x05"
key F +Control : "\x06"
key G +Control : "\x07"
key H +Control : "\x08"
key I +Control : "\x09"
key J +Control : "\x0a"
key K +Control : "\x0b"
key L +Control : "\x0c"
key M +Control : "\x0d"
key N +Control : "\x0e"
key O +Control : "\x0f"
key P +Control : "\x10"
key Q +Control : "\x11"
key R +Control : "\x12"
key S +Control : "\x13"
key T +Control : "\x14"
key U +Control : "\x15"
key V +Control : "\x16"
key W +Control : "\x17"
key X +Control : "\x18"
key Y +Control : "\x19"
key Z +Control : "\x1a"
# some of keys are used by konsole.
key Up +Shift : scrollLineUp
key Prior +Shift : scrollPageUp
key Down +Shift : scrollLineDown
key Next +Shift : scrollPageDown
key ScrollLock : scrollLock
#----------------------------------------------------------
# keypad characters as offered by Qt
# cannot be recognized as such.
#----------------------------------------------------------
# Following other strings as emitted by konsole.

View File

@@ -1,175 +0,0 @@
# [README.default.Keytab] Buildin Keyboard Table
#
# To customize your keyboard, copy this file to something
# ending with .keytab and change it to meet you needs.
# Please read the README.KeyTab and the README.keyboard
# in this case.
#
# --------------------------------------------------------------
keyboard "Default (XFree 4)"
# --------------------------------------------------------------
#
# Note that this particular table is a "risc" version made to
# ease customization without bothering with obsolete details.
# See VT100.keytab for the more hairy stuff.
#
# --------------------------------------------------------------
# common keys
key Escape : "\x1b"
#key Control : "^"
key Tab -Shift : "\t"
key Tab +Shift+Ansi : "\E[Z"
key Tab +Shift-Ansi : "\t"
key Backtab +Ansi : "\E[Z"
key Backtab -Ansi : "\t"
key Return-Shift-NewLine : "\r"
key Return-Shift+NewLine : "\r\n"
key Return+Shift : "\EOM"
# Backspace and Delete codes are preserving CTRL-H.
key Backspace : "\x7f"
# Arrow keys in VT52 mode
# shift up/down are reserved for scrolling.
# shift left/right are reserved for switching between tabs (this is hardcoded).
# Command + C
# on mac - Control=Command, Meta=Ctrl
# do not use Control+C for interrupt signal - it's used for "Copy to clipboard"
#key Control +C : "\x03"
key Meta +C: "\x03"
# Arrow keys in ANSI mode with Application - and Normal Cursor Mode)
key Up -Shift+Ansi-AppCuKeys : "\E[A"
key Down -Shift+Ansi-AppCuKeys : "\E[B"
key Right-Shift+Ansi-AppCuKeys : "\E[C"
key Left -Shift+Ansi-AppCuKeys : "\E[D"
key Up -Ansi : "\E[1;*A"
key Down -Ansi : "\E[1;*B"
key Right -Ansi : "\E[1;*C"
key Left -Ansi : "\E[1;*D"
#key Up -Shift-Ansi : "\EA"
#key Down -Shift-Ansi : "\EB"
#key Right-Shift-Ansi : "\EC"
#key Left -Shift-Ansi : "\ED"
#key Up -Shift-AnyMod+Ansi-AppCuKeys : "\E[A"
#key Down -Shift-AnyMod+Ansi-AppCuKeys : "\E[B"
#key Right -Shift-AnyMod+Ansi-AppCuKeys : "\E[C"
#key Left -Shift-AnyMod+Ansi-AppCuKeys : "\E[D"
#key Up -Shift-AnyMod+Ansi-AppCuKeys : "\EOA"
#key Down -Shift-AnyMod+Ansi-AppCuKeys : "\EOB"
#key Right -Shift-AnyMod+Ansi-AppCuKeys : "\EOC"
#key Left -Shift-AnyMod+Ansi-AppCuKeys : "\EOD"
#key Up -Shift-AnyMod+Ansi : "\E[1;*A"
#key Down -Shift-AnyMod+Ansi : "\E[1;*B"
#key Right -Shift-AnyMod+Ansi : "\E[1;*C"
#key Left -Shift-AnyMod+Ansi : "\E[1;*D"
# other grey PC keys
key Enter+NewLine : "\r\n"
key Enter-NewLine : "\r"
key Home -AnyMod -AppCuKeys : "\E[H"
key End -AnyMod -AppCuKeys : "\E[F"
key Home -AnyMod +AppCuKeys : "\EOH"
key End -AnyMod +AppCuKeys : "\EOF"
key Home +AnyMod : "\E[1;*H"
key End +AnyMod : "\E[1;*F"
key Insert -AnyMod : "\E[2~"
key Delete -AnyMod : "\E[3~"
key Insert +AnyMod : "\E[2;*~"
key Delete +AnyMod : "\E[3;*~"
key Prior -Shift-AnyMod : "\E[5~"
key Next -Shift-AnyMod : "\E[6~"
key Prior -Shift+AnyMod : "\E[5;*~"
key Next -Shift+AnyMod : "\E[6;*~"
# Function keys
#key F1 -AnyMod : "\EOP"
#key F2 -AnyMod : "\EOQ"
#key F3 -AnyMod : "\EOR"
#key F4 -AnyMod : "\EOS"
#define ALT_KP_0 "\033Op"
#define ALT_KP_1 "\033Oq"
#define ALT_KP_2 "\033Or"
#define ALT_KP_3 "\033Os"
#define ALT_KP_4 "\033Ot"
#define ALT_KP_5 "\033Ou"
#define ALT_KP_6 "\033Ov"
#define ALT_KP_7 "\033Ow"
#define ALT_KP_8 "\033Ox"
#define ALT_KP_9 "\033Oy"
key F1 -AnyMod : "\EOP"
key F2 -AnyMod : "\EOQ"
key F3 -AnyMod : "\EOR"
key F4 -AnyMod : "\EOS"
key F5 -AnyMod : "\EOT"
key F6 -AnyMod : "\EOU"
key F7 -AnyMod : "\EOV"
key F8 -AnyMod : "\EOW"
key F9 -AnyMod : "\EOX"
key F10 -AnyMod : "\EOY"
#key F5 -AnyMod : "\E[15~"
#key F6 -AnyMod : "\E[17~"
#key F7 -AnyMod : "\E[18~"
#key F8 -AnyMod : "\E[19~"
#key F9 -AnyMod : "\E[20~"
#key F10 -AnyMod : "\E[21~"
#key F11 -AnyMod : "\E[23~"
#key F12 -AnyMod : "\E[24~"
#key F1 +AnyMod : "\EO*P"
#key F2 +AnyMod : "\EO*Q"
#key F3 +AnyMod : "\EO*R"
#key F4 +AnyMod : "\EO*S"
#key F5 +AnyMod : "\E[15;*~"
#key F6 +AnyMod : "\E[17;*~"
#key F7 +AnyMod : "\E[18;*~"
#key F8 +AnyMod : "\E[19;*~"
#key F9 +AnyMod : "\E[20;*~"
#key F10 +AnyMod : "\E[21;*~"
#key F11 +AnyMod : "\E[23;*~"
#key F12 +AnyMod : "\E[24;*~"
# Work around dead keys
key Space +Control : "\x00"
# Some keys are used by konsole to cause operations.
# The scroll* operations refer to the history buffer.
key Up +Shift-AppScreen : scrollLineUp
key Prior +Shift-AppScreen : scrollPageUp
key Down +Shift-AppScreen : scrollLineDown
key Next +Shift-AppScreen : scrollPageDown
#key Up +Shift : scrollLineUp
#key Prior +Shift : scrollPageUp
#key Down +Shift : scrollLineDown
#key Next +Shift : scrollPageDown
key ScrollLock : scrollLock
# keypad characters are not offered differently by Qt.

View File

@@ -1,108 +0,0 @@
# [solaris.keytab] Konsole Keyboard Table
#
keyboard "Solaris console"
# --------------------------------------------------------------
#
# This configuration table allows to customize the
# meaning of the keys.
#
# The syntax is that each entry has the form :
#
# "key" Keyname { ("+"|"-") Modename } ":" (String|Operation)
#
# Keynames are those defined in <qnamespace.h> with the
# "Qt::Key_" removed. (We'd better insert the list here)
#
# Mode names are :
#
# - Shift
# - Alt
# - Control
#
# The VT100 emulation has two modes that can affect the
# sequences emitted by certain keys. These modes are
# under control of the client program.
#
#
# - Newline : effects Return and Enter key.
# - Application : effects Up and Down key.
#
# - Ansi : effects Up and Down key (This is for VT52, really).
#
# Operations are
#
# - scrollUpLine
# - scrollUpPage
# - scrollDownLine
# - scrollDownPage
#
# - emitSelection
#
# If the key is not found here, the text of the
# key event as provided by QT is emitted, possibly
# preceeded by ESC if the Alt key is pressed.
#
# --------------------------------------------------------------
key Escape : "\E"
key Tab : "\t"
key Return-Alt : "\r"
key Return+Alt : "\E\r"
# Backspace and Delete codes are preserving CTRL-H.
key Backspace : "\x08"
#key Delete : "\x7F"
# cursor keys
key Up -Shift : "\EOA"
key Down -Shift : "\EOB"
key Right -Shift : "\EOC"
key Left -Shift : "\EOD"
# other grey PC keys
key Enter : "\r"
key Home : "\E[1~"
key Insert-Shift : "\E[2~"
key Delete : "\E[3~"
key End : "\E[4~"
key Prior -Shift : "\E[5~"
key Next -Shift : "\E[6~"
# function keys
key F1 : "\E[11~"
key F2 : "\E[12~"
key F3 : "\E[13~"
key F4 : "\E[14~"
key F5 : "\E[15~"
key F6 : "\E[17~"
key F7 : "\E[18~"
key F8 : "\E[19~"
key F9 : "\E[20~"
key F10 : "\E[21~"
key F11 : "\E[23~"
key F12 : "\E[24~"
# Work around dead keys
key Space +Control : "\x00"
# Some keys are used by konsole to cause operations.
# The scroll* operations refer to the history buffer.
#key Left +Shift : prevSession
#key Right +Shift : nextSession
key Up +Shift : scrollLineUp
key Prior +Shift : scrollPageUp
key Down +Shift : scrollLineDown
key Next +Shift : scrollPageDown
#key Insert+Shift : emitSelection
# keypad characters are not offered differently by Qt.

View File

@@ -1,168 +0,0 @@
#
# NOTE: This keyboard binding is not installed because it
# apparently doesn't work with actual VT420 systems
# (see BUG:170220)
#
# [vt420pc.keytab] Konsole Keyboard Table (VT420pc keys)
# adapted by ferdinand gassauer f.gassauer@aon.at
# Nov 2000
#
################################################################
#
# The escape sequences emmited by the
# keys Shift+F1 to Shift+F12 might not fit your needs
#
################# IMPORTANT NOTICE #############################
# the key bindings (Kcontrol -> look and feel -> keybindgs)
# overrule the settings in this file. The key bindings might be
# changed by the user WITHOUT notification of the maintainer of
# the keytab file. Konsole will not work as expected by
# the maintainer of the keytab file.
################################################################
#
# --------------------------------------------------------------
keyboard "DEC VT420 Terminal"
# --------------------------------------------------------------
#
# This configuration table allows to customize the
# meaning of the keys.
#
# The syntax is that each entry has the form :
#
# "key" Keyname { ("+"|"-") Modename } ":" (String|Operation)
#
# Keynames are those defined in <qnamespace.h> with the
# "Qt::Key_" removed. (We'd better insert the list here)
#
# Mode names are :
#
# - Shift
# - Alt
# - Control
#
# The VT100 emulation has two modes that can affect the
# sequences emitted by certain keys. These modes are
# under control of the client program.
#
# - Newline : effects Return and Enter key.
# - Application : effects Up and Down key.
#
# - Ansi : effects Up and Down key (This is for VT52, really).
#
# Operations are
#
# - scrollUpLine
# - scrollUpPage
# - scrollDownLine
# - scrollDownPage
#
# - emitSelection
#
# If the key is not found here, the text of the
# key event as provided by QT is emitted, possibly
# preceeded by ESC if the Alt key is pressed.
#
# --------------------------------------------------------------
key Escape : "\E"
key Tab : "\t"
key Backtab: "\E[Z"
# VT100 can add an extra \n after return.
# The NewLine mode is set by an escape sequence.
key Return-NewLine : "\r"
key Return+NewLine : "\r\n"
# Some desperately try to save the ^H.
# may be not everyone wants this
key Backspace : "\x08" # Control H
key Delete : "\x7f"
# These codes are for the VT420pc
# The Ansi mode (i.e. VT100 mode) is set by
# an escape sequence
key Up -Shift-Ansi : "\EA"
key Down -Shift-Ansi : "\EB"
key Right-Shift-Ansi : "\EC"
key Left -Shift-Ansi : "\ED"
# VT100 emits a mode bit together
# with the arrow keys.The AppCuKeys
# mode is set by an escape sequence.
key Up -Shift+Ansi+AppCuKeys : "\EOA"
key Down -Shift+Ansi+AppCuKeys : "\EOB"
key Right-Shift+Ansi+AppCuKeys : "\EOC"
key Left -Shift+Ansi+AppCuKeys : "\EOD"
key Up -Shift+Ansi-AppCuKeys : "\E[A"
key Down -Shift+Ansi-AppCuKeys : "\E[B"
key Right-Shift+Ansi-AppCuKeys : "\E[C"
key Left -Shift+Ansi-AppCuKeys : "\E[D"
# function keys
key F1 -Shift : "\E[11~"
key F2 -Shift : "\E[12~"
key F3 -Shift : "\E[13~"
key F4 -Shift : "\E[14~"
key F5 -Shift : "\E[15~"
key F6 -Shift : "\E[17~"
key F7 -Shift : "\E[18~"
key F8 -Shift : "\E[19~"
key F9 -Shift : "\E[20~"
key F10-Shift : "\E[21~"
key F11-Shift : "\E[23~"
key F12-Shift : "\E[24~"
#
# Shift F1-F12
#
key F1 +Shift : "\E[11;2~"
key F2 +Shift : "\E[12;2~"
key F3 +Shift : "\E[13;2~"
key F4 +Shift : "\E[14;2~"
key F5 +Shift : "\E[15;2~"
key F6 +Shift : "\E[17;2~"
key F7 +Shift : "\E[18;2~"
key F8 +Shift : "\E[19;2~"
key F9 +Shift : "\E[20;2~"
key F10+Shift : "\E[21;2~"
key F11+Shift : "\E[23;2~"
key F12+Shift : "\E[24;2~"
key Home : "\E[H"
key End : "\E[F"
key Prior -Shift : "\E[5~"
key Next -Shift : "\E[6~"
key Insert-Shift : "\E[2~"
# Keypad-Enter. See comment on Return above.
key Enter+NewLine : "\r\n"
key Enter-NewLine : "\r"
key Space +Control : "\x00"
# some of keys are used by konsole.
key Up +Shift : scrollLineUp
key Prior +Shift : scrollPageUp
key Down +Shift : scrollLineDown
key Next +Shift : scrollPageDown
key ScrollLock : scrollLock
#----------------------------------------------------------
# keypad characters as offered by Qt
# cannot be recognized as such.
#----------------------------------------------------------
# Following other strings as emitted by konsole.

View File

@@ -1,196 +0,0 @@
# [README.xterm.Keytab] Xterm Keyboard Table
#
# To customize your keyboard, copy this file to something
# ending with .keytab and change it to meet you needs.
# Please read the README.KeyTab and the README.keyboard
# in this case.
#
# --------------------------------------------------------------
keyboard "Xterm"
# common keys
key Escape : "\E"
key Tab -Shift : "\t"
key Tab +Shift+Ansi : "\E[Z"
key Tab +Shift-Ansi : "\t"
key Backtab +Ansi : "\E[Z"
key Backtab -Ansi : "\t"
key Return-Shift-NewLine : "\r"
key Return-Shift+NewLine : "\r\n"
key Return+Shift : "\EOM"
# Backspace and Delete codes are preserving CTRL-H.
key Backspace : "\x7f"
# Arrow keys in VT52 mode
key Up -Shift-Ansi : "\EA"
key Down -Shift-Ansi : "\EB"
key Right-Shift-Ansi : "\EC"
key Left -Shift-Ansi : "\ED"
# Arrow keys in ANSI mode with Application - and Normal Cursor Mode)
key Up -Shift-AnyMod+Ansi+AppCuKeys : "\EOA"
key Down -Shift-AnyMod+Ansi+AppCuKeys : "\EOB"
key Right -Shift-AnyMod+Ansi+AppCuKeys : "\EOC"
key Left -Shift-AnyMod+Ansi+AppCuKeys : "\EOD"
key Up -Shift-AnyMod+Ansi-AppCuKeys : "\E[A"
key Down -Shift-AnyMod+Ansi-AppCuKeys : "\E[B"
key Right -Shift-AnyMod+Ansi-AppCuKeys : "\E[C"
key Left -Shift-AnyMod+Ansi-AppCuKeys : "\E[D"
key Up +AnyMod+Ansi : "\E[1;*A"
key Down +AnyMod+Ansi : "\E[1;*B"
key Right +AnyMod+Ansi : "\E[1;*C"
key Left +AnyMod+Ansi : "\E[1;*D"
# Keypad keys with NumLock ON
# (see "Numeric Keypad" section at http://www.nw.com/nw/WWW/products/wizcon/vt100.html )
#
# Not enabled for now because it breaks the keypad in Vim.
#
#key 0 +KeyPad+AppKeyPad : "\EOp"
#key 1 +KeyPad+AppKeyPad : "\EOq"
#key 2 +KeyPad+AppKeyPad : "\EOr"
#key 3 +KeyPad+AppKeyPad : "\EOs"
#key 4 +KeyPad+AppKeyPad : "\EOt"
#key 5 +KeyPad+AppKeyPad : "\EOu"
#key 6 +KeyPad+AppKeyPad : "\EOv"
#key 7 +KeyPad+AppKeyPad : "\EOw"
#key 8 +KeyPad+AppKeyPad : "\EOx"
#key 9 +KeyPad+AppKeyPad : "\EOy"
#key + +KeyPad+AppKeyPad : "\EOl"
#key - +KeyPad+AppKeyPad : "\EOm"
#key . +KeyPad+AppKeyPad : "\EOn"
#key * +KeyPad+AppKeyPad : "\EOM"
#key Enter +KeyPad+AppKeyPad : "\r"
# Keypad keys with NumLock Off
key Up -Shift+Ansi+AppCuKeys+KeyPad : "\EOA"
key Down -Shift+Ansi+AppCuKeys+KeyPad : "\EOB"
key Right -Shift+Ansi+AppCuKeys+KeyPad : "\EOC"
key Left -Shift+Ansi+AppCuKeys+KeyPad : "\EOD"
key Up -Shift+Ansi-AppCuKeys+KeyPad : "\E[A"
key Down -Shift+Ansi-AppCuKeys+KeyPad : "\E[B"
key Right -Shift+Ansi-AppCuKeys+KeyPad : "\E[C"
key Left -Shift+Ansi-AppCuKeys+KeyPad : "\E[D"
key Home +AppCuKeys+KeyPad : "\EOH"
key End +AppCuKeys+KeyPad : "\EOF"
key Home -AppCuKeys+KeyPad : "\E[H"
key End -AppCuKeys+KeyPad : "\E[F"
key Insert +KeyPad : "\E[2~"
key Delete +KeyPad : "\E[3~"
key Prior -Shift+KeyPad : "\E[5~"
key Next -Shift+KeyPad : "\E[6~"
# other grey PC keys
key Enter+NewLine : "\r\n"
key Enter-NewLine : "\r"
key Home -AnyMod-AppCuKeys : "\E[H"
key End -AnyMod-AppCuKeys : "\E[F"
key Home -AnyMod+AppCuKeys : "\EOH"
key End -AnyMod+AppCuKeys : "\EOF"
key Home +AnyMod : "\E[1;*H"
key End +AnyMod : "\E[1;*F"
key Insert -AnyMod : "\E[2~"
key Delete -AnyMod : "\E[3~"
key Insert +AnyMod : "\E[2;*~"
key Delete +AnyMod : "\E[3;*~"
key Prior -Shift-AnyMod : "\E[5~"
key Next -Shift-AnyMod : "\E[6~"
key Prior -Shift+AnyMod : "\E[5;*~"
key Next -Shift+AnyMod : "\E[6;*~"
# Function keys
key F1 -AnyMod : "\EOP"
key F2 -AnyMod : "\EOQ"
key F3 -AnyMod : "\EOR"
key F4 -AnyMod : "\EOS"
key F5 -AnyMod : "\E[15~"
key F6 -AnyMod : "\E[17~"
key F7 -AnyMod : "\E[18~"
key F8 -AnyMod : "\E[19~"
key F9 -AnyMod : "\E[20~"
key F10 -AnyMod : "\E[21~"
key F11 -AnyMod : "\E[23~"
key F12 -AnyMod : "\E[24~"
key F1 +AnyMod : "\E[1;*P"
key F2 +AnyMod : "\E[1;*Q"
key F3 +AnyMod : "\E[1;*R"
key F4 +AnyMod : "\E[1;*S"
key F5 +AnyMod : "\E[15;*~"
key F6 +AnyMod : "\E[17;*~"
key F7 +AnyMod : "\E[18;*~"
key F8 +AnyMod : "\E[19;*~"
key F9 +AnyMod : "\E[20;*~"
key F10 +AnyMod : "\E[21;*~"
key F11 +AnyMod : "\E[23;*~"
key F12 +AnyMod : "\E[24;*~"
# Work around dead keys
key Space +Control : "\x00"
key At +Control : "\x00"
key A +Control : "\x01"
key B +Control : "\x02"
key C +Control : "\x03"
key D +Control : "\x04"
key E +Control : "\x05"
key F +Control : "\x06"
key G +Control : "\x07"
key H +Control : "\x08"
key I +Control : "\x09"
key J +Control : "\x0a"
key K +Control : "\x0b"
key L +Control : "\x0c"
key M +Control : "\x0d"
key N +Control : "\x0e"
key O +Control : "\x0f"
key P +Control : "\x10"
key Q +Control : "\x11"
key R +Control : "\x12"
key S +Control : "\x13"
key T +Control : "\x14"
key U +Control : "\x15"
key V +Control : "\x16"
key W +Control : "\x17"
key X +Control : "\x18"
key Y +Control : "\x19"
key Z +Control : "\x1a"
key BracketLeft +Control : "\x1b"
key Backslash +Control : "\x1c"
key BracketRight +Control : "\x1d"
key AsciiCircum +Control : "\x1e"
key _ +Control : "\x1f"
key Question +Control : "\x7f"
# Some keys are used by konsole to cause operations.
# The scroll* operations refer to the history buffer.
key Up +Shift-AppScreen : scrollLineUp
key Prior +Shift-AppScreen : scrollPageUp
key Down +Shift-AppScreen : scrollLineDown
key Next +Shift-AppScreen : scrollPageDown
key ScrollLock : scrollLock

View File

@@ -1,126 +0,0 @@
#########################################
## CONFIGS
#########################################
TEMPLATE = lib
CONFIG += qt plugin hide_symbols
QT += qml quick widgets
DEFINES += HAVE_POSIX_OPENPT HAVE_SYS_TIME_H
!macx:DEFINES += HAVE_UPDWTMPX
macx:DEFINES += HAVE_UTMPX HAVE_UT_USER
#MANUALY DEFINED PLATFORM
DEFINES += Q_WS_UBUNTU
TARGET = kdekonsole
PLUGIN_IMPORT_PATH = org/crt/konsole
PLUGIN_ASSETS = $$PWD/assets/*
DESTDIR = $$OUT_PWD/../imports/$$PLUGIN_IMPORT_PATH
INSTALL_DIR = $$[QT_INSTALL_QML]
# Copy additional plugin files
QMAKE_COPY = "cp -r"
defineTest(copyToDestdir) {
files = $$1
for(FILE, files) {
DDIR = $$DESTDIR
# Replace slashes in paths with backslashes for Windows
win32:FILE ~= s,/,\\,g
win32:DDIR ~= s,/,\\,g
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
}
export(QMAKE_POST_LINK)
}
copyToDestdir($$PLUGIN_ASSETS)
copyToDestdir($$PWD/src/qmldir)
#########################################
## SOURCES
#########################################
SOURCES += \
$$PWD/src/plugin.cpp \
$$PWD/src/Pty.cpp \
$$PWD/src/kptyprocess.cpp \
$$PWD/src/kptydevice.cpp \
$$PWD/src/kpty.cpp \
$$PWD/src/kprocess.cpp \
$$PWD/src/ShellCommand.cpp \
$$PWD/src/Vt102Emulation.cpp \
$$PWD/src/tools.cpp \
$$PWD/src/Session.cpp \
$$PWD/src/Screen.cpp \
$$PWD/src/KeyboardTranslator.cpp \
$$PWD/src/Emulation.cpp \
$$PWD/src/History.cpp \
$$PWD/src/BlockArray.cpp \
$$PWD/src/TerminalCharacterDecoder.cpp \
$$PWD/src/konsole_wcwidth.cpp \
$$PWD/src/ScreenWindow.cpp \
$$PWD/src/Filter.cpp \
$$PWD/src/ColorScheme.cpp \
$$PWD/src/TerminalDisplay.cpp \
$$PWD/src/ksession.cpp
HEADERS += \
$$PWD/src/plugin.h \
$$PWD/src/Pty.h \
$$PWD/src/kptyprocess.h \
$$PWD/src/kptydevice.h \
$$PWD/src/kpty.h \
$$PWD/src/kpty_p.h \
$$PWD/src/kprocess.h \
$$PWD/src/ShellCommand.h \
$$PWD/src/Vt102Emulation.h \
$$PWD/src/tools.h \
$$PWD/src/Session.h \
$$PWD/src/Screen.h \
$$PWD/src/KeyboardTranslator.h \
$$PWD/src/Emulation.h \
$$PWD/src/Character.h \
$$PWD/src/History.h \
$$PWD/src/CharacterColor.h \
$$PWD/src/BlockArray.h \
$$PWD/src/TerminalCharacterDecoder.h \
$$PWD/src/konsole_wcwidth.h \
$$PWD/src/ScreenWindow.h \
$$PWD/src/DefaultTranslatorText.h \
$$PWD/src/LineFont.h \
$$PWD/src/Filter.h \
$$PWD/src/ExtendedDefaultTranslator.h \
$$PWD/src/ColorTables.h \
$$PWD/src/ColorScheme.h \
$$PWD/src/TerminalDisplay.h \
$$PWD/src/ksession.h
OTHER_FILES += \
$$PWD/src/qmldir \
$$PWD/src/plugins.qmltypes
MOC_DIR = $$PWD/.moc
OBJECTS_DIR = $$PWD/.obj
#########################################
## INTALLS
#########################################
target.path = $$INSTALL_DIR/$$PLUGIN_IMPORT_PATH
assets.files += $$PLUGIN_ASSETS
assets.path += $$INSTALL_DIR/$$PLUGIN_IMPORT_PATH
qmldir.files += $$PWD/src/qmldir \
$$PWD/src/plugins.qmltypes
qmldir.path += $$INSTALL_DIR/$$PLUGIN_IMPORT_PATH
INSTALLS += target qmldir assets

View File

@@ -1,377 +0,0 @@
/*
This file is part of Konsole, an X terminal.
Copyright (C) 2000 by Stephan Kulow <coolo@kde.org>
Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
// Own
#include "BlockArray.h"
#include <QtCore>
// System
#include <assert.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <unistd.h>
#include <stdio.h>
static int blocksize = 0;
BlockArray::BlockArray()
: size(0),
current(size_t(-1)),
index(size_t(-1)),
lastmap(0),
lastmap_index(size_t(-1)),
lastblock(0), ion(-1),
length(0)
{
// lastmap_index = index = current = size_t(-1);
if (blocksize == 0) {
blocksize = ((sizeof(Block) / getpagesize()) + 1) * getpagesize();
}
}
BlockArray::~BlockArray()
{
setHistorySize(0);
assert(!lastblock);
}
size_t BlockArray::append(Block * block)
{
if (!size) {
return size_t(-1);
}
++current;
if (current >= size) {
current = 0;
}
int rc;
rc = lseek(ion, current * blocksize, SEEK_SET);
if (rc < 0) {
perror("HistoryBuffer::add.seek");
setHistorySize(0);
return size_t(-1);
}
rc = write(ion, block, blocksize);
if (rc < 0) {
perror("HistoryBuffer::add.write");
setHistorySize(0);
return size_t(-1);
}
length++;
if (length > size) {
length = size;
}
++index;
delete block;
return current;
}
size_t BlockArray::newBlock()
{
if (!size) {
return size_t(-1);
}
append(lastblock);
lastblock = new Block();
return index + 1;
}
Block * BlockArray::lastBlock() const
{
return lastblock;
}
bool BlockArray::has(size_t i) const
{
if (i == index + 1) {
return true;
}
if (i > index) {
return false;
}
if (index - i >= length) {
return false;
}
return true;
}
const Block * BlockArray::at(size_t i)
{
if (i == index + 1) {
return lastblock;
}
if (i == lastmap_index) {
return lastmap;
}
if (i > index) {
qDebug() << "BlockArray::at() i > index\n";
return 0;
}
// if (index - i >= length) {
// kDebug(1211) << "BlockArray::at() index - i >= length\n";
// return 0;
// }
size_t j = i; // (current - (index - i) + (index/size+1)*size) % size ;
assert(j < size);
unmap();
Block * block = (Block *)mmap(0, blocksize, PROT_READ, MAP_PRIVATE, ion, j * blocksize);
if (block == (Block *)-1) {
perror("mmap");
return 0;
}
lastmap = block;
lastmap_index = i;
return block;
}
void BlockArray::unmap()
{
if (lastmap) {
int res = munmap((char *)lastmap, blocksize);
if (res < 0) {
perror("munmap");
}
}
lastmap = 0;
lastmap_index = size_t(-1);
}
bool BlockArray::setSize(size_t newsize)
{
return setHistorySize(newsize * 1024 / blocksize);
}
bool BlockArray::setHistorySize(size_t newsize)
{
// kDebug(1211) << "setHistorySize " << size << " " << newsize;
if (size == newsize) {
return false;
}
unmap();
if (!newsize) {
delete lastblock;
lastblock = 0;
if (ion >= 0) {
close(ion);
}
ion = -1;
current = size_t(-1);
return true;
}
if (!size) {
FILE * tmp = tmpfile();
if (!tmp) {
perror("konsole: cannot open temp file.\n");
} else {
ion = dup(fileno(tmp));
if (ion<0) {
perror("konsole: cannot dup temp file.\n");
fclose(tmp);
}
}
if (ion < 0) {
return false;
}
assert(!lastblock);
lastblock = new Block();
size = newsize;
return false;
}
if (newsize > size) {
increaseBuffer();
size = newsize;
return false;
} else {
decreaseBuffer(newsize);
ftruncate(ion, length*blocksize);
size = newsize;
return true;
}
}
void moveBlock(FILE * fion, int cursor, int newpos, char * buffer2)
{
int res = fseek(fion, cursor * blocksize, SEEK_SET);
if (res) {
perror("fseek");
}
res = fread(buffer2, blocksize, 1, fion);
if (res != 1) {
perror("fread");
}
res = fseek(fion, newpos * blocksize, SEEK_SET);
if (res) {
perror("fseek");
}
res = fwrite(buffer2, blocksize, 1, fion);
if (res != 1) {
perror("fwrite");
}
// printf("moving block %d to %d\n", cursor, newpos);
}
void BlockArray::decreaseBuffer(size_t newsize)
{
if (index < newsize) { // still fits in whole
return;
}
int offset = (current - (newsize - 1) + size) % size;
if (!offset) {
return;
}
// The Block constructor could do somthing in future...
char * buffer1 = new char[blocksize];
FILE * fion = fdopen(dup(ion), "w+b");
if (!fion) {
delete [] buffer1;
perror("fdopen/dup");
return;
}
int firstblock;
if (current <= newsize) {
firstblock = current + 1;
} else {
firstblock = 0;
}
size_t oldpos;
for (size_t i = 0, cursor=firstblock; i < newsize; i++) {
oldpos = (size + cursor + offset) % size;
moveBlock(fion, oldpos, cursor, buffer1);
if (oldpos < newsize) {
cursor = oldpos;
} else {
cursor++;
}
}
current = newsize - 1;
length = newsize;
delete [] buffer1;
fclose(fion);
}
void BlockArray::increaseBuffer()
{
if (index < size) { // not even wrapped once
return;
}
int offset = (current + size + 1) % size;
if (!offset) { // no moving needed
return;
}
// The Block constructor could do somthing in future...
char * buffer1 = new char[blocksize];
char * buffer2 = new char[blocksize];
int runs = 1;
int bpr = size; // blocks per run
if (size % offset == 0) {
bpr = size / offset;
runs = offset;
}
FILE * fion = fdopen(dup(ion), "w+b");
if (!fion) {
perror("fdopen/dup");
delete [] buffer1;
delete [] buffer2;
return;
}
int res;
for (int i = 0; i < runs; i++) {
// free one block in chain
int firstblock = (offset + i) % size;
res = fseek(fion, firstblock * blocksize, SEEK_SET);
if (res) {
perror("fseek");
}
res = fread(buffer1, blocksize, 1, fion);
if (res != 1) {
perror("fread");
}
int newpos = 0;
for (int j = 1, cursor=firstblock; j < bpr; j++) {
cursor = (cursor + offset) % size;
newpos = (cursor - offset + size) % size;
moveBlock(fion, cursor, newpos, buffer2);
}
res = fseek(fion, i * blocksize, SEEK_SET);
if (res) {
perror("fseek");
}
res = fwrite(buffer1, blocksize, 1, fion);
if (res != 1) {
perror("fwrite");
}
}
current = size - 1;
length = size;
delete [] buffer1;
delete [] buffer2;
fclose(fion);
}

View File

@@ -1,126 +0,0 @@
/*
This file is part of Konsole, an X terminal.
Copyright (C) 2000 by Stephan Kulow <coolo@kde.org>
Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
#ifndef BLOCKARRAY_H
#define BLOCKARRAY_H
#include <unistd.h>
//#error Do not use in KDE 2.1
#define BlockSize (1 << 12)
#define ENTRIES ((BlockSize - sizeof(size_t) ) / sizeof(unsigned char))
struct Block {
Block() {
size = 0;
}
unsigned char data[ENTRIES];
size_t size;
};
// ///////////////////////////////////////////////////////
class BlockArray {
public:
/**
* Creates a history file for holding
* maximal size blocks. If more blocks
* are requested, then it drops earlier
* added ones.
*/
BlockArray();
/// destructor
~BlockArray();
/**
* adds the Block at the end of history.
* This may drop other blocks.
*
* The ownership on the block is transfered.
* An unique index number is returned for accessing
* it later (if not yet dropped then)
*
* Note, that the block may be dropped completely
* if history is turned off.
*/
size_t append(Block * block);
/**
* gets the block at the index. Function may return
* 0 if the block isn't available any more.
*
* The returned block is strictly readonly as only
* maped in memory - and will be invalid on the next
* operation on this class.
*/
const Block * at(size_t index);
/**
* reorders blocks as needed. If newsize is null,
* the history is emptied completely. The indices
* returned on append won't change their semantic,
* but they may not be valid after this call.
*/
bool setHistorySize(size_t newsize);
size_t newBlock();
Block * lastBlock() const;
/**
* Convenient function to set the size in KBytes
* instead of blocks
*/
bool setSize(size_t newsize);
size_t len() const {
return length;
}
bool has(size_t index) const;
size_t getCurrent() const {
return current;
}
private:
void unmap();
void increaseBuffer();
void decreaseBuffer(size_t newsize);
size_t size;
// current always shows to the last inserted block
size_t current;
size_t index;
Block * lastmap;
size_t lastmap_index;
Block * lastblock;
int ion;
size_t length;
};
#endif

View File

@@ -1,221 +0,0 @@
/*
This file is part of Konsole, KDE's terminal.
Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
#ifndef CHARACTER_H
#define CHARACTER_H
// Qt
#include <QtCore/QHash>
// Local
#include "CharacterColor.h"
typedef unsigned char LineProperty;
static const int LINE_DEFAULT = 0;
static const int LINE_WRAPPED = (1 << 0);
static const int LINE_DOUBLEWIDTH = (1 << 1);
static const int LINE_DOUBLEHEIGHT = (1 << 2);
#define DEFAULT_RENDITION 0
#define RE_BOLD (1 << 0)
#define RE_BLINK (1 << 1)
#define RE_UNDERLINE (1 << 2)
#define RE_REVERSE (1 << 3) // Screen only
#define RE_INTENSIVE (1 << 3) // Widget only
#define RE_CURSOR (1 << 4)
#define RE_EXTENDED_CHAR (1 << 5)
/**
* A single character in the terminal which consists of a unicode character
* value, foreground and background colors and a set of rendition attributes
* which specify how it should be drawn.
*/
class Character
{
public:
/**
* Constructs a new character.
*
* @param _c The unicode character value of this character.
* @param _f The foreground color used to draw the character.
* @param _b The color used to draw the character's background.
* @param _r A set of rendition flags which specify how this character is to be drawn.
*/
inline Character(quint16 _c = ' ',
CharacterColor _f = CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_FORE_COLOR),
CharacterColor _b = CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR),
quint8 _r = DEFAULT_RENDITION)
: character(_c), rendition(_r), foregroundColor(_f), backgroundColor(_b) {}
union
{
/** The unicode character value for this character. */
quint16 character;
/**
* Experimental addition which allows a single Character instance to contain more than
* one unicode character.
*
* charSequence is a hash code which can be used to look up the unicode
* character sequence in the ExtendedCharTable used to create the sequence.
*/
quint16 charSequence;
};
/** A combination of RENDITION flags which specify options for drawing the character. */
quint8 rendition;
/** The foreground color used to draw this character. */
CharacterColor foregroundColor;
/** The color used to draw this character's background. */
CharacterColor backgroundColor;
/**
* Returns true if this character has a transparent background when
* it is drawn with the specified @p palette.
*/
bool isTransparent(const ColorEntry* palette) const;
/**
* Returns true if this character should always be drawn in bold when
* it is drawn with the specified @p palette, independent of whether
* or not the character has the RE_BOLD rendition flag.
*/
ColorEntry::FontWeight fontWeight(const ColorEntry* base) const;
/**
* returns true if the format (color, rendition flag) of the compared characters is equal
*/
bool equalsFormat(const Character &other) const;
/**
* Compares two characters and returns true if they have the same unicode character value,
* rendition and colors.
*/
friend bool operator == (const Character& a, const Character& b);
/**
* Compares two characters and returns true if they have different unicode character values,
* renditions or colors.
*/
friend bool operator != (const Character& a, const Character& b);
};
inline bool operator == (const Character& a, const Character& b)
{
return a.character == b.character &&
a.rendition == b.rendition &&
a.foregroundColor == b.foregroundColor &&
a.backgroundColor == b.backgroundColor;
}
inline bool operator != (const Character& a, const Character& b)
{
return a.character != b.character ||
a.rendition != b.rendition ||
a.foregroundColor != b.foregroundColor ||
a.backgroundColor != b.backgroundColor;
}
inline bool Character::isTransparent(const ColorEntry* base) const
{
return ((backgroundColor._colorSpace == COLOR_SPACE_DEFAULT) &&
base[backgroundColor._u+0+(backgroundColor._v?BASE_COLORS:0)].transparent)
|| ((backgroundColor._colorSpace == COLOR_SPACE_SYSTEM) &&
base[backgroundColor._u+2+(backgroundColor._v?BASE_COLORS:0)].transparent);
}
inline bool Character::equalsFormat(const Character& other) const
{
return
backgroundColor==other.backgroundColor &&
foregroundColor==other.foregroundColor &&
rendition==other.rendition;
}
inline ColorEntry::FontWeight Character::fontWeight(const ColorEntry* base) const
{
if (backgroundColor._colorSpace == COLOR_SPACE_DEFAULT)
return base[backgroundColor._u+0+(backgroundColor._v?BASE_COLORS:0)].fontWeight;
else if (backgroundColor._colorSpace == COLOR_SPACE_SYSTEM)
return base[backgroundColor._u+2+(backgroundColor._v?BASE_COLORS:0)].fontWeight;
else
return ColorEntry::UseCurrentFormat;
}
extern unsigned short vt100_graphics[32];
/**
* A table which stores sequences of unicode characters, referenced
* by hash keys. The hash key itself is the same size as a unicode
* character ( ushort ) so that it can occupy the same space in
* a structure.
*/
class ExtendedCharTable
{
public:
/** Constructs a new character table. */
ExtendedCharTable();
~ExtendedCharTable();
/**
* Adds a sequences of unicode characters to the table and returns
* a hash code which can be used later to look up the sequence
* using lookupExtendedChar()
*
* If the same sequence already exists in the table, the hash
* of the existing sequence will be returned.
*
* @param unicodePoints An array of unicode character points
* @param length Length of @p unicodePoints
*/
ushort createExtendedChar(ushort* unicodePoints , ushort length);
/**
* Looks up and returns a pointer to a sequence of unicode characters
* which was added to the table using createExtendedChar().
*
* @param hash The hash key returned by createExtendedChar()
* @param length This variable is set to the length of the
* character sequence.
*
* @return A unicode character sequence of size @p length.
*/
ushort* lookupExtendedChar(ushort hash , ushort& length) const;
/** The global ExtendedCharTable instance. */
static ExtendedCharTable instance;
private:
// calculates the hash key of a sequence of unicode points of size 'length'
ushort extendedCharHash(ushort* unicodePoints , ushort length) const;
// tests whether the entry in the table specified by 'hash' matches the
// character sequence 'unicodePoints' of size 'length'
bool extendedCharMatch(ushort hash , ushort* unicodePoints , ushort length) const;
// internal, maps hash keys to character sequence buffers. The first ushort
// in each value is the length of the buffer, followed by the ushorts in the buffer
// themselves.
QHash<ushort,ushort*> extendedCharTable;
};
Q_DECLARE_TYPEINFO(Character, Q_MOVABLE_TYPE);
#endif // CHARACTER_H

Some files were not shown because too many files have changed in this diff Show More