Full Code of Swordfish90/cool-retro-term for AI

master 86ee7da8da8b cached
200 files
344.3 KB
85.2k tokens
31 symbols
1 requests
Download .txt
Showing preview only (375K chars total). Download the full file or copy to clipboard to get everything.
Repository: Swordfish90/cool-retro-term
Branch: master
Commit: 86ee7da8da8b
Files: 200
Total size: 344.3 KB

Directory structure:
gitextract_dw7tnwnr/

├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       └── release.yml
├── .gitignore
├── .gitmodules
├── README.md
├── app/
│   ├── app.pro
│   ├── fileio.cpp
│   ├── fileio.h
│   ├── fontlistmodel.cpp
│   ├── fontlistmodel.h
│   ├── fontmanager.cpp
│   ├── fontmanager.h
│   ├── icons/
│   │   └── crt.icns
│   ├── main.cpp
│   ├── qml/
│   │   ├── AboutDialog.qml
│   │   ├── ApplicationSettings.qml
│   │   ├── BurnInEffect.qml
│   │   ├── CheckableSlider.qml
│   │   ├── ColorButton.qml
│   │   ├── Components/
│   │   │   └── SizedLabel.qml
│   │   ├── InsertNameDialog.qml
│   │   ├── PreprocessedTerminal.qml
│   │   ├── SettingsAdvancedTab.qml
│   │   ├── SettingsEffectsTab.qml
│   │   ├── SettingsGeneralTab.qml
│   │   ├── SettingsTerminalTab.qml
│   │   ├── SettingsWindow.qml
│   │   ├── ShaderTerminal.qml
│   │   ├── SimpleSlider.qml
│   │   ├── SizeOverlay.qml
│   │   ├── Storage.qml
│   │   ├── TerminalContainer.qml
│   │   ├── TerminalFrame.qml
│   │   ├── TerminalTabs.qml
│   │   ├── TerminalWindow.qml
│   │   ├── TimeManager.qml
│   │   ├── fonts/
│   │   │   ├── apple2/
│   │   │   │   └── FreeLicense.txt
│   │   │   ├── bigblue-terminal/
│   │   │   │   └── LICENSE.TXT
│   │   │   ├── departure-mono/
│   │   │   │   ├── DepartureMonoNerdFontMono-Regular.otf
│   │   │   │   └── LICENSE
│   │   │   ├── fira-code/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── gohu/
│   │   │   │   └── LICENSE
│   │   │   ├── greybeard/
│   │   │   │   └── LICENSE
│   │   │   ├── hack/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── ibm-3278/
│   │   │   │   ├── LICENSE.txt
│   │   │   │   └── README.md
│   │   │   ├── iosevka/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── jetbrains-mono/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── oldschool-pc-fonts/
│   │   │   │   └── LICENSE.TXT
│   │   │   ├── opendyslexic/
│   │   │   │   ├── LICENSE.txt
│   │   │   │   └── OpenDyslexicMNerdFontMono-Regular.otf
│   │   │   ├── pet-me/
│   │   │   │   └── FreeLicense.txt
│   │   │   ├── source-code-pro/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── terminus/
│   │   │   │   └── LICENSE-Terminess.txt
│   │   │   └── unscii/
│   │   │       └── LICENSE
│   │   ├── main.qml
│   │   ├── menus/
│   │   │   ├── FullContextMenu.qml
│   │   │   ├── ShortContextMenu.qml
│   │   │   └── WindowMenu.qml
│   │   ├── resources.qrc
│   │   └── utils.js
│   └── shaders/
│       ├── burn_in.frag
│       ├── burn_in.frag.qsb
│       ├── burn_in.vert
│       ├── burn_in.vert.qsb
│       ├── passthrough.vert
│       ├── passthrough.vert.qsb
│       ├── terminal_dynamic.frag
│       ├── terminal_dynamic.vert
│       ├── terminal_dynamic.vert.qsb
│       ├── terminal_dynamic_raster0_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster0_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster0_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster0_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster0_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster0_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster0_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster0_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster1_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster1_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster1_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster1_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster1_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster1_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster1_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster1_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster2_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster2_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster2_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster2_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster2_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster2_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster2_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster2_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster3_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster3_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster3_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster3_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster3_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster3_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster3_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster3_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster4_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster4_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster4_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster4_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster4_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster4_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster4_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster4_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_frame.frag
│       ├── terminal_frame.frag.qsb
│       ├── terminal_frame.vert
│       ├── terminal_frame.vert.qsb
│       ├── terminal_static.frag
│       ├── terminal_static.vert
│       ├── terminal_static.vert.qsb
│       ├── terminal_static_rgb0_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve1_shine0.frag.qsb
│       └── terminal_static_rgb1_chroma1_bloom1_curve1_shine1.frag.qsb
├── cool-retro-term.desktop
├── cool-retro-term.pro
├── gpl-2.0.txt
├── gpl-3.0.txt
├── packaging/
│   ├── appdata/
│   │   └── cool-retro-term.appdata.xml
│   ├── debian/
│   │   ├── .gitignore
│   │   ├── changelog
│   │   ├── compat
│   │   ├── control
│   │   ├── cool-retro-term.1
│   │   ├── copyright
│   │   ├── rules
│   │   ├── source/
│   │   │   └── format
│   │   └── watch
│   └── rpm/
│       └── cool-retro-term.spec
├── scripts/
│   ├── build-appimage.sh
│   ├── build-dmg.sh
│   └── list_glyph_counts.py
└── snap/
    └── snapcraft.yaml

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

patreon: swordfish90
custom: ['https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=flscogna%40gmail.com&item_name=Support+CRT&currency_code=EUR&source=url']


================================================
FILE: .github/workflows/release.yml
================================================
name: Release

on:
  workflow_dispatch:
  push:
    branches:
      - main
      - master
    tags:
      - '*'

permissions:
  contents: write

jobs:
  build-appimage:
    name: Build (Linux, AppImage)
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Install build deps
        run: |
          sudo apt update
          sudo apt install -y build-essential rsync wget

      - name: Install Qt
        uses: jurplel/install-qt-action@v4
        with:
          version: 6.10.0
          dir: ..
          modules: qt5compat qtshadertools
          setup-python: false
          cache: true

      - name: Build AppImage
        run: |
          ./scripts/build-appimage.sh

      - name: Collect artifact
        run: |
          mkdir -p release
          mv ./*.AppImage release/

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: cool-retro-term-appimage
          path: ./release/*

  build-dmg:
    name: Build (macOS, DMG)
    runs-on: macos-14
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Install Qt
        uses: jurplel/install-qt-action@v4
        with:
          version: 6.10.*
          modules: qt5compat qtshadertools
          setup-python: true
          python-version: '3.11'
          cache: true

      - name: Build DMG
        run: |
          JOBS="$(sysctl -n hw.ncpu)"
          ./scripts/build-dmg.sh

      - name: Collect artifact
        run: |
          mkdir -p release
          mv ./*.dmg release/

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: cool-retro-term-dmg
          path: ./release/*

  release:
    name: Create Release
    runs-on: ubuntu-22.04
    needs:
      - build-appimage
      - build-dmg
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Download AppImage
        uses: actions/download-artifact@v4
        with:
          name: cool-retro-term-appimage
          path: ./release

      - name: Download DMG
        uses: actions/download-artifact@v4
        with:
          name: cool-retro-term-dmg
          path: ./release

      - name: Update rolling tag
        if: startsWith(github.ref, 'refs/heads/')
        run: |
          git tag -f rolling
          git push -f origin rolling

      - name: Publish rolling release
        if: startsWith(github.ref, 'refs/heads/')
        uses: softprops/action-gh-release@v2
        with:
          tag_name: rolling
          name: Rolling Release
          prerelease: true
          files: ./release/*

      - name: Publish tagged release
        if: startsWith(github.ref, 'refs/tags/')
        uses: softprops/action-gh-release@v2
        with:
          tag_name: ${{ github.ref_name }}
          files: ./release/*


================================================
FILE: .gitignore
================================================
# C++ objects and libs

*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib

# Qt-es

/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
Makefile*
*-build-*

# QtCreator

*.autosave

# QtCtreator Qml
*.qmlproject.user
*.qmlproject.user.*

# Others

*.xcf

# Ubuntu SDk
*.excludes
*.json

# Excludes compiled files

imports
cool-retro-term
build

# Linux

*.AppImage

# Mac OSX

.DS_Store
*.app
*.dmg


================================================
FILE: .gitmodules
================================================
[submodule "qmltermwidget"]
	path = qmltermwidget
	url = https://github.com/Swordfish90/qmltermwidget
	branch = unstable
[submodule "KDSingleApplication"]
	path = KDSingleApplication
	url = https://github.com/KDAB/KDSingleApplication.git


================================================
FILE: README.md
================================================
# cool-retro-term

|> Default Amber|C:\ IBM DOS|$ Default Green|
|---|---|---|
|![Default Amber Cool Retro Term](https://user-images.githubusercontent.com/121322/32070717-16708784-ba42-11e7-8572-a8fcc10d7f7d.gif)|![IBM DOS](https://user-images.githubusercontent.com/121322/32070716-16567e5c-ba42-11e7-9e64-ba96dfe9b64d.gif)|![Default Green Cool Retro Term](https://user-images.githubusercontent.com/121322/32070715-163a1c94-ba42-11e7-80bb-41fbf10fc634.gif)|

## Description
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 QML port of qtermwidget (Konsole): https://github.com/Swordfish90/qmltermwidget.

This terminal emulator works under Linux and macOS and requires Qt6.

Settings such as colors, fonts, and effects can be accessed via context menu.

## Screenshots
![Image](<https://i.imgur.com/TNumkDn.png>)
![Image](<https://i.imgur.com/hfjWOM4.png>)
![Image](<https://i.imgur.com/GYRDPzJ.jpg>)

## Install

If you want to get a hold of the latest version, just go to the Releases page and grab the latest AppImage (Linux) or dmg (macOS).

Alternatively, most distributions such as Ubuntu, Fedora or Arch already package cool-retro-term in their official repositories.

## Building

Check out the wiki and follow the instructions on how to build it on [Linux](https://github.com/Swordfish90/cool-retro-term/wiki/Build-Instructions-(Linux)) and [macOS](https://github.com/Swordfish90/cool-retro-term/wiki/Build-Instructions-(macOS)).


================================================
FILE: app/app.pro
================================================
QT += qml quick widgets sql quickcontrols2
TARGET = cool-retro-term
APP_VERSION = $$system(git -C $$PWD/.. describe --tags --always --dirty=-dirty)
isEmpty(APP_VERSION): APP_VERSION = "unknown"
DEFINES += APP_VERSION=\\\"$$APP_VERSION\\\"

# TODO: When migrating to CMake, use KDSingleApplication's CMakeLists.txt instead of these manual sources.
INCLUDEPATH += $$PWD/../KDSingleApplication/src
HEADERS += \
    $$PWD/../KDSingleApplication/src/kdsingleapplication.h \
    $$PWD/../KDSingleApplication/src/kdsingleapplication_lib.h \
    $$PWD/../KDSingleApplication/src/kdsingleapplication_localsocket_p.h
SOURCES += \
    $$PWD/../KDSingleApplication/src/kdsingleapplication.cpp \
    $$PWD/../KDSingleApplication/src/kdsingleapplication_localsocket.cpp
DEFINES += KDSINGLEAPPLICATION_STATIC_BUILD

DESTDIR = $$OUT_PWD/../

HEADERS += \
    fileio.h \
    fontmanager.h \
    fontlistmodel.h

SOURCES += main.cpp \
    fileio.cpp \
    fontmanager.cpp \
    fontlistmodel.cpp

macx:ICON = icons/crt.icns

RESOURCES += qml/resources.qrc

# Shader compilation (Qt Shader Baker)
QSB_BIN = $$[QT_HOST_BINS]/qsb
isEmpty(QSB_BIN): QSB_BIN = $$[QT_INSTALL_BINS]/qsb

SHADERS_DIR = $${_PRO_FILE_PWD_}/shaders
SHADERS += $$files($$SHADERS_DIR/*.frag) $$files($$SHADERS_DIR/*.vert)
SHADERS -= $$SHADERS_DIR/terminal_dynamic.frag
SHADERS -= $$SHADERS_DIR/terminal_static.frag
SHADERS -= $$SHADERS_DIR/passthrough.vert

qsb.input = SHADERS
qsb.output = ../../app/shaders/${QMAKE_FILE_NAME}.qsb
qsb.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
qsb.clean = $$qsb.output
qsb.name = qsb ${QMAKE_FILE_IN}
qsb.variable_out = QSB_FILES
QMAKE_EXTRA_COMPILERS += qsb
PRE_TARGETDEPS += $$QSB_FILES
OTHER_FILES += $$SHADERS $$QSB_FILES

DYNAMIC_SHADER = $$SHADERS_DIR/terminal_dynamic.frag
STATIC_SHADER = $$SHADERS_DIR/terminal_static.frag

RASTER_MODES = 0 1 2 3 4
BINARY_FLAGS = 0 1
VARIANT_SHADER_DIR = $$relative_path($$PWD/shaders, $$OUT_PWD)
VARIANT_OUTPUTS =

for(raster_mode, RASTER_MODES) {
    for(burn_in, BINARY_FLAGS) {
        for(display_frame, BINARY_FLAGS) {
            for(chroma_on, BINARY_FLAGS) {
                dynamic_variant = terminal_dynamic_raster$${raster_mode}_burn$${burn_in}_frame$${display_frame}_chroma$${chroma_on}
                dynamic_output = $${VARIANT_SHADER_DIR}/$${dynamic_variant}.frag.qsb
                dynamic_target = shader_variant_$${dynamic_variant}
                $${dynamic_target}.target = $${dynamic_output}
                $${dynamic_target}.depends = $$DYNAMIC_SHADER
                $${dynamic_target}.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -DCRT_RASTER_MODE=$${raster_mode} -DCRT_BURN_IN=$${burn_in} -DCRT_DISPLAY_FRAME=$${display_frame} -DCRT_CHROMA=$${chroma_on} -o $${dynamic_output} $$DYNAMIC_SHADER
                QMAKE_EXTRA_TARGETS += $${dynamic_target}
                VARIANT_OUTPUTS += $${dynamic_output}
            }
        }
    }
}

for(rgb_shift, BINARY_FLAGS) {
    for(bloom_on, BINARY_FLAGS) {
        for(curve_on, BINARY_FLAGS) {
            for(shine_on, BINARY_FLAGS) {
                static_variant = terminal_static_rgb$${rgb_shift}_bloom$${bloom_on}_curve$${curve_on}_shine$${shine_on}
                static_output = $${VARIANT_SHADER_DIR}/$${static_variant}.frag.qsb
                static_target = shader_variant_$${static_variant}
                $${static_target}.target = $${static_output}
                $${static_target}.depends = $$STATIC_SHADER
                $${static_target}.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -DCRT_RGB_SHIFT=$${rgb_shift} -DCRT_BLOOM=$${bloom_on} -DCRT_CURVATURE=$${curve_on} -DCRT_FRAME_SHININESS=$${shine_on} -o $${static_output} $$STATIC_SHADER
                QMAKE_EXTRA_TARGETS += $${static_target}
                VARIANT_OUTPUTS += $${static_output}
            }
        }
    }
}
PRE_TARGETDEPS += $${VARIANT_OUTPUTS}

#########################################
##              INTALLS
#########################################

target.path += /usr/bin/

INSTALLS += target

# Install icons
unix {
    icon32.files = icons/32x32/cool-retro-term.png
    icon32.path = /usr/share/icons/hicolor/32x32/apps
    icon64.files = icons/64x64/cool-retro-term.png
    icon64.path = /usr/share/icons/hicolor/64x64/apps
    icon128.files = icons/128x128/cool-retro-term.png
    icon128.path = /usr/share/icons/hicolor/128x128/apps
    icon256.files = icons/256x256/cool-retro-term.png
    icon256.path = /usr/share/icons/hicolor/256x256/apps

    INSTALLS += icon32 icon64 icon128 icon256
}


================================================
FILE: app/fileio.cpp
================================================
#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;
}


================================================
FILE: app/fileio.h
================================================
#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


================================================
FILE: app/fontlistmodel.cpp
================================================
#include "fontlistmodel.h"

FontListModel::FontListModel(QObject *parent)
    : QAbstractListModel(parent)
{
}

int FontListModel::rowCount(const QModelIndex &parent) const
{
    if (parent.isValid()) {
        return 0;
    }
    return m_fonts.size();
}

QVariant FontListModel::data(const QModelIndex &index, int role) const
{
    if (!index.isValid() || index.row() < 0 || index.row() >= m_fonts.size()) {
        return QVariant();
    }

    const FontEntry &font = m_fonts.at(index.row());

    switch (role) {
    case NameRole:
        return font.name;
    case TextRole:
        return font.text;
    case SourceRole:
        return font.source;
    case BaseWidthRole:
        return font.baseWidth;
    case PixelSizeRole:
        return font.pixelSize;
    case LowResolutionRole:
        return font.lowResolutionFont;
    case IsSystemRole:
        return font.isSystemFont;
    case FamilyRole:
        return font.family;
    case FallbackNameRole:
        return font.fallbackName;
    default:
        return QVariant();
    }
}

QHash<int, QByteArray> FontListModel::roleNames() const
{
    QHash<int, QByteArray> roles;
    roles[NameRole] = "name";
    roles[TextRole] = "text";
    roles[SourceRole] = "source";
    roles[BaseWidthRole] = "baseWidth";
    roles[PixelSizeRole] = "pixelSize";
    roles[LowResolutionRole] = "lowResolutionFont";
    roles[IsSystemRole] = "isSystemFont";
    roles[FamilyRole] = "family";
    roles[FallbackNameRole] = "fallbackName";
    return roles;
}

void FontListModel::setFonts(const QVector<FontEntry> &fonts)
{
    beginResetModel();
    m_fonts = fonts;
    endResetModel();
    emit countChanged();
}

const QVector<FontEntry> &FontListModel::fonts() const
{
    return m_fonts;
}

QVariantMap FontListModel::get(int index) const
{
    QVariantMap map;
    if (index < 0 || index >= m_fonts.size()) {
        return map;
    }

    const FontEntry &font = m_fonts.at(index);
    map.insert("name", font.name);
    map.insert("text", font.text);
    map.insert("source", font.source);
    map.insert("baseWidth", font.baseWidth);
    map.insert("pixelSize", font.pixelSize);
    map.insert("lowResolutionFont", font.lowResolutionFont);
    map.insert("isSystemFont", font.isSystemFont);
    map.insert("family", font.family);
    map.insert("fallbackName", font.fallbackName);
    return map;
}


================================================
FILE: app/fontlistmodel.h
================================================
#ifndef FONTLISTMODEL_H
#define FONTLISTMODEL_H

#include <QAbstractListModel>
#include <QVector>
#include <QVariant>
#include <QVariantMap>
#include <QString>

struct FontEntry
{
    QString name;
    QString text;
    QString source;
    qreal baseWidth = 1.0;
    int pixelSize = 0;
    bool lowResolutionFont = false;
    bool isSystemFont = false;
    QString family;
    QString fallbackName;
};

class FontListModel : public QAbstractListModel
{
    Q_OBJECT
    Q_PROPERTY(int count READ rowCount NOTIFY countChanged)

public:
    explicit FontListModel(QObject *parent = nullptr);

    enum Roles {
        NameRole = Qt::UserRole + 1,
        TextRole,
        SourceRole,
        BaseWidthRole,
        PixelSizeRole,
        LowResolutionRole,
        IsSystemRole,
        FamilyRole,
        FallbackNameRole
    };

    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
    QVariant data(const QModelIndex &index, int role) const override;
    QHash<int, QByteArray> roleNames() const override;

    void setFonts(const QVector<FontEntry> &fonts);
    const QVector<FontEntry> &fonts() const;

    Q_INVOKABLE QVariantMap get(int index) const;

signals:
    void countChanged();

private:
    QVector<FontEntry> m_fonts;
};

#endif // FONTLISTMODEL_H


================================================
FILE: app/fontmanager.cpp
================================================
#include "fontmanager.h"

#include <QFont>
#include <QFontDatabase>
#include <QFontMetricsF>
#include <QtGlobal>
#include <QtMath>

namespace {
constexpr int kModernRasterization = 4;
constexpr int kBaseFontPixelHeight = 32;
constexpr int kSystemFontPixelSize = 32;
}

FontManager::FontManager(QObject *parent)
    : QObject(parent)
    , m_fontListModel(this)
    , m_filteredFontListModel(this)
{
    populateBundledFonts();
    populateSystemFonts();
    m_fontListModel.setFonts(m_allFonts);
    updateFilteredFonts();
    updateComputedFont();
}

QStringList FontManager::retrieveMonospaceFonts()
{
    QStringList result;

    QFontDatabase fontDatabase;
    const QStringList fontFamilies = fontDatabase.families();

    for (const QString &fontFamily : fontFamilies) {
        QFont font(fontFamily);
        if (fontDatabase.isFixedPitch(font.family())) {
            result.append(fontFamily);
        }
    }

    return result;
}

void FontManager::refresh()
{
    updateFilteredFonts();
    updateComputedFont();
}

FontListModel *FontManager::fontList()
{
    return &m_fontListModel;
}

FontListModel *FontManager::filteredFontList()
{
    return &m_filteredFontListModel;
}

int FontManager::fontSource() const
{
    return m_fontSource;
}

void FontManager::setFontSource(int fontSource)
{
    if (m_fontSource == fontSource) {
        return;
    }
    m_fontSource = fontSource;
    emit fontSourceChanged();
    updateFilteredFonts();
    updateComputedFont();
}

int FontManager::rasterization() const
{
    return m_rasterization;
}

void FontManager::setRasterization(int rasterization)
{
    if (m_rasterization == rasterization) {
        return;
    }
    m_rasterization = rasterization;
    emit rasterizationChanged();
    updateFilteredFonts();
    updateComputedFont();
}

QString FontManager::fontName() const
{
    return m_fontName;
}

void FontManager::setFontName(const QString &fontName)
{
    if (m_fontName == fontName) {
        return;
    }
    m_fontName = fontName;
    emit fontNameChanged();
    updateFilteredFonts();
    updateComputedFont();
}

qreal FontManager::fontScaling() const
{
    return m_fontScaling;
}

void FontManager::setFontScaling(qreal fontScaling)
{
    if (qFuzzyCompare(m_fontScaling, fontScaling)) {
        return;
    }
    m_fontScaling = fontScaling;
    emit fontScalingChanged();
    updateComputedFont();
}

qreal FontManager::fontWidth() const
{
    return m_fontWidth;
}

void FontManager::setFontWidth(qreal fontWidth)
{
    if (qFuzzyCompare(m_fontWidth, fontWidth)) {
        return;
    }
    m_fontWidth = fontWidth;
    emit fontWidthChanged();
    updateComputedFont();
}

qreal FontManager::lineSpacing() const
{
    return m_lineSpacing;
}

void FontManager::setLineSpacing(qreal lineSpacing)
{
    if (qFuzzyCompare(m_lineSpacing, lineSpacing)) {
        return;
    }
    m_lineSpacing = lineSpacing;
    emit lineSpacingChanged();
    updateComputedFont();
}

qreal FontManager::baseFontScaling() const
{
    return m_baseFontScaling;
}

void FontManager::setBaseFontScaling(qreal baseFontScaling)
{
    if (qFuzzyCompare(m_baseFontScaling, baseFontScaling)) {
        return;
    }
    m_baseFontScaling = baseFontScaling;
    emit baseFontScalingChanged();
    updateComputedFont();
}

bool FontManager::lowResolutionFont() const
{
    return m_lowResolutionFont;
}

void FontManager::setFontSubstitutions(const QString &family, const QStringList &substitutes)
{
    if (family.isEmpty()) {
        return;
    }

    QFont::removeSubstitutions(family);

    if (substitutes.isEmpty()) {
        return;
    }

    QFont::insertSubstitutions(family, substitutes);
}

void FontManager::removeFontSubstitution(const QString &family)
{
    if (family.isEmpty()) {
        return;
    }

    QFont::removeSubstitutions(family);
}

void FontManager::populateBundledFonts()
{
    m_allFonts.clear();

    addBundledFont(
        "TERMINESS_SCALED",
        "Terminess",
        ":/fonts/terminus/TerminessNerdFontMono-Regular.ttf",
        1.0,
        12,
        true);
    addBundledFont(
        "BIGBLUE_TERMINAL_SCALED",
        "BigBlue Terminal",
        ":/fonts/bigblue-terminal/BigBlueTerm437NerdFontMono-Regular.ttf",
        1.0,
        12,
        true);
    addBundledFont(
        "EXCELSIOR_SCALED",
        "Fixedsys Excelsior",
        ":/fonts/fixedsys-excelsior/FSEX301-L2.ttf",
        1.0,
        16,
        true,
        "UNSCII_16_SCALED");
    addBundledFont(
        "GREYBEARD_SCALED",
        "Greybeard",
        ":/fonts/greybeard/Greybeard-16px.ttf",
        1.0,
        16,
        true,
        "UNSCII_16_SCALED");
    addBundledFont(
        "COMMODORE_PET_SCALED",
        "Commodore PET",
        ":/fonts/pet-me/PetMe.ttf",
        0.5,
        8,
        true,
        "UNSCII_8_SCALED");
    addBundledFont(
        "GOHU_11_SCALED",
        "Gohu 11",
        ":/fonts/gohu/GohuFont11NerdFontMono-Regular.ttf",
        1.0,
        11,
        true);
    addBundledFont(
        "COZETTE_SCALED",
        "Cozette",
        ":/fonts/cozette/CozetteVector.ttf",
        1.0,
        13,
        true);
    addBundledFont(
        "UNSCII_8_SCALED",
        "Unscii 8",
        ":/fonts/unscii/unscii-8.ttf",
        0.5,
        8,
        true,
        "UNSCII_8_SCALED");
    addBundledFont(
        "UNSCII_8_THIN_SCALED",
        "Unscii 8 Thin",
        ":/fonts/unscii/unscii-8-thin.ttf",
        0.5,
        8,
        true,
        "UNSCII_8_SCALED");
    addBundledFont(
        "UNSCII_16_SCALED",
        "Unscii 16",
        ":/fonts/unscii/unscii-16-full.ttf",
        1.0,
        16,
        true,
        "UNSCII_16_SCALED");
    addBundledFont(
        "APPLE_II_SCALED",
        "Apple ][",
        ":/fonts/apple2/PrintChar21.ttf",
        0.5,
        8,
        true,
        "UNSCII_8_SCALED");
    addBundledFont(
        "ATARI_400_SCALED",
        "Atari 400-800",
        ":/fonts/atari-400-800/AtariClassic-Regular.ttf",
        0.5,
        8,
        true,
        "UNSCII_8_SCALED");
    addBundledFont(
        "COMMODORE_64_SCALED",
        "Commodore 64",
        ":/fonts/pet-me/PetMe64.ttf",
        0.5,
        8,
        true,
        "UNSCII_8_SCALED");
    addBundledFont(
        "IBM_EGA_8x8",
        "IBM EGA 8x8",
        ":/fonts/oldschool-pc-fonts/PxPlus_IBM_EGA_8x8.ttf",
        0.5,
        8,
        true,
        "UNSCII_8_SCALED");
    addBundledFont(
        "IBM_VGA_8x16",
        "IBM VGA 8x16",
        ":/fonts/oldschool-pc-fonts/PxPlus_IBM_VGA_8x16.ttf",
        1.0,
        16,
        true,
        "UNSCII_16_SCALED");

    addBundledFont(
        "TERMINESS",
        "Terminess",
        ":/fonts/terminus/TerminessNerdFontMono-Regular.ttf",
        1.0,
        32,
        false);
    addBundledFont(
        "HACK",
        "Hack",
        ":/fonts/hack/HackNerdFontMono-Regular.ttf",
        1.0,
        32,
        false);
    addBundledFont(
        "FIRA_CODE",
        "Fira Code",
        ":/fonts/fira-code/FiraCodeNerdFontMono-Regular.ttf",
        1.0,
        32,
        false);
    addBundledFont(
        "IOSEVKA",
        "Iosevka",
        ":/fonts/iosevka/IosevkaTermNerdFontMono-Regular.ttf",
        1.0,
        32,
        false);
    addBundledFont(
        "JETBRAINS_MONO",
        "JetBrains Mono",
        ":/fonts/jetbrains-mono/JetBrainsMonoNerdFontMono-Regular.ttf",
        1.0,
        32,
        false);
    addBundledFont(
        "IBM_3278",
        "IBM 3278",
        ":/fonts/ibm-3278/3270NerdFontMono-Regular.ttf",
        1.0,
        32,
        false);
    addBundledFont(
        "SOURCE_CODE_PRO",
        "Source Code Pro",
        ":/fonts/source-code-pro/SauceCodeProNerdFontMono-Regular.ttf",
        1.0,
        32,
        false);
    addBundledFont(
        "DEPARTURE_MONO_SCALED",
        "Departure Mono",
        ":/fonts/departure-mono/DepartureMonoNerdFontMono-Regular.otf",
        1.0,
        11,
        true);
    addBundledFont(
        "OPENDYSLEXIC",
        "OpenDyslexic",
        ":/fonts/opendyslexic/OpenDyslexicMNerdFontMono-Regular.otf",
        1.0,
        32,
        false);
}

void FontManager::addBundledFont(const QString &name,
                                 const QString &text,
                                 const QString &source,
                                 qreal baseWidth,
                                 int pixelSize,
                                 bool lowResolutionFont,
                                 const QString &fallbackName)
{
    FontEntry entry;
    entry.name = name;
    entry.text = text;
    entry.source = source;
    entry.pixelSize = pixelSize;
    entry.lowResolutionFont = lowResolutionFont;
    entry.isSystemFont = false;
    entry.fallbackName = fallbackName;
    entry.family = resolveFontFamily(source);
    entry.baseWidth = lowResolutionFont
        ? computeBaseWidth(entry.family, pixelSize, baseWidth)
        : baseWidth;
    m_allFonts.append(entry);
}

void FontManager::populateSystemFonts()
{
    const QStringList families = retrieveMonospaceFonts();
    for (const QString &family : families) {
        if (m_bundledFamilies.contains(family)) {
            continue;
        }
        FontEntry entry;
        entry.name = family;
        entry.text = family;
        entry.source = QString();
        entry.baseWidth = 1.0;
        entry.pixelSize = kSystemFontPixelSize;
        entry.lowResolutionFont = false;
        entry.isSystemFont = true;
        entry.family = family;
        m_allFonts.append(entry);
    }
}

void FontManager::updateFilteredFonts()
{
    QVector<FontEntry> filtered;
    bool fontNameFound = false;
    const bool modernMode = (m_rasterization == kModernRasterization);

    for (const FontEntry &font : m_allFonts) {
        const bool isBundled = !font.isSystemFont;
        const bool matchesSource = (m_fontSource == 0 && isBundled)
            || (m_fontSource == 1 && font.isSystemFont);

        if (!matchesSource) {
            continue;
        }

        const bool matchesRasterization = font.isSystemFont
            || (modernMode == !font.lowResolutionFont);

        if (!matchesRasterization) {
            continue;
        }

        filtered.append(font);
        if (font.name == m_fontName) {
            fontNameFound = true;
        }
    }

    if (!fontNameFound && !filtered.isEmpty()) {
        if (m_fontName != filtered.first().name) {
            m_fontName = filtered.first().name;
            emit fontNameChanged();
        }
    }

    m_filteredFontListModel.setFonts(filtered);
    emit filteredFontListChanged();
}

void FontManager::updateComputedFont()
{
    const FontEntry *font = findFontByName(m_fontName);
    if (!font) {
        const QVector<FontEntry> &filteredFonts = m_filteredFontListModel.fonts();
        if (!filteredFonts.isEmpty()) {
            font = &filteredFonts.first();
        }
    }

    if (!font) {
        return;
    }

    const qreal totalFontScaling = m_baseFontScaling * m_fontScaling;
    const qreal targetPixelHeight = kBaseFontPixelHeight * totalFontScaling;
    const qreal lineSpacingFactor = m_lineSpacing;

    const int lineSpacing = qRound(targetPixelHeight * lineSpacingFactor);
    const int pixelSize = font->lowResolutionFont
        ? font->pixelSize
        : static_cast<int>(targetPixelHeight);

    const qreal nativeLineHeight = font->pixelSize + qRound(font->pixelSize * lineSpacingFactor);
    const qreal targetLineHeight = targetPixelHeight + lineSpacing;
    const qreal screenScaling = font->lowResolutionFont
        ? (nativeLineHeight > 0 ? targetLineHeight / nativeLineHeight : 1.0)
        : 1.0;

    const qreal fontWidth = font->baseWidth * m_fontWidth;

    QString fontFamily = font->family.isEmpty() ? font->name : font->family;
    QString fallbackFontFamily;

    if (!font->fallbackName.isEmpty() && font->fallbackName != font->name) {
        const FontEntry *fallback = findFontByName(font->fallbackName);
        if (fallback) {
            fallbackFontFamily = fallback->family.isEmpty() ? fallback->name : fallback->family;
        }
    }

    QStringList fallbackChain;
    if (!fallbackFontFamily.isEmpty()) {
        fallbackChain.append(fallbackFontFamily);
    }
#if defined(Q_OS_MAC)
    fallbackChain.append(QStringLiteral("Menlo"));
#else
    fallbackChain.append(QStringLiteral("Monospace"));
#endif
    setFontSubstitutions(fontFamily, fallbackChain);

    if (m_lowResolutionFont != font->lowResolutionFont) {
        m_lowResolutionFont = font->lowResolutionFont;
        emit lowResolutionFontChanged();
    }

    emit terminalFontChanged(fontFamily,
                             pixelSize,
                             lineSpacing,
                             screenScaling,
                             fontWidth,
                             fallbackFontFamily,
                             font->lowResolutionFont);
}

const FontEntry *FontManager::findFontByName(const QString &name) const
{
    for (const FontEntry &font : m_allFonts) {
        if (font.name == name) {
            return &font;
        }
    }
    return nullptr;
}

QString FontManager::resolveFontFamily(const QString &sourcePath)
{
    const auto cached = m_loadedFamilies.constFind(sourcePath);
    if (cached != m_loadedFamilies.constEnd()) {
        return cached.value();
    }

    const int fontId = QFontDatabase::addApplicationFont(sourcePath);
    QString family;
    if (fontId != -1) {
        const QStringList families = QFontDatabase::applicationFontFamilies(fontId);
        if (!families.isEmpty()) {
            family = families.first();
        }
    }

    if (!family.isEmpty()) {
        m_bundledFamilies.insert(family);
    }

    m_loadedFamilies.insert(sourcePath, family);
    return family;
}

qreal FontManager::computeBaseWidth(const QString &family, int pixelSize, qreal fallbackWidth) const
{
    if (family.isEmpty()) {
        return fallbackWidth;
    }

    QFont font(family);
    font.setPixelSize(pixelSize);
    QFontMetricsF metrics(font);

    const qreal glyphWidth = metrics.horizontalAdvance(QLatin1String("M"));
    const qreal glyphHeight = metrics.height();
    if (glyphWidth <= 0.0 || glyphHeight <= 0.0) {
        return fallbackWidth;
    }

    const qreal targetRatio = 0.5;
    qreal computedWidth = (targetRatio * glyphHeight) / glyphWidth;
    return qBound(0.25, computedWidth, 2.0);
}


================================================
FILE: app/fontmanager.h
================================================
#ifndef FONTMANAGER_H
#define FONTMANAGER_H

#include <QObject>
#include <QStringList>
#include <QHash>
#include <QSet>

#include "fontlistmodel.h"

class FontManager : public QObject
{
    Q_OBJECT
    Q_PROPERTY(FontListModel *fontList READ fontList CONSTANT)
    Q_PROPERTY(FontListModel *filteredFontList READ filteredFontList NOTIFY filteredFontListChanged)
    Q_PROPERTY(int fontSource READ fontSource WRITE setFontSource NOTIFY fontSourceChanged)
    Q_PROPERTY(int rasterization READ rasterization WRITE setRasterization NOTIFY rasterizationChanged)
    Q_PROPERTY(QString fontName READ fontName WRITE setFontName NOTIFY fontNameChanged)
    Q_PROPERTY(qreal fontScaling READ fontScaling WRITE setFontScaling NOTIFY fontScalingChanged)
    Q_PROPERTY(qreal fontWidth READ fontWidth WRITE setFontWidth NOTIFY fontWidthChanged)
    Q_PROPERTY(qreal lineSpacing READ lineSpacing WRITE setLineSpacing NOTIFY lineSpacingChanged)
    Q_PROPERTY(qreal baseFontScaling READ baseFontScaling WRITE setBaseFontScaling NOTIFY baseFontScalingChanged)
    Q_PROPERTY(bool lowResolutionFont READ lowResolutionFont NOTIFY lowResolutionFontChanged)

public:
    explicit FontManager(QObject *parent = nullptr);

    Q_INVOKABLE void refresh();

    FontListModel *fontList();
    FontListModel *filteredFontList();

    int fontSource() const;
    void setFontSource(int fontSource);

    int rasterization() const;
    void setRasterization(int rasterization);

    QString fontName() const;
    void setFontName(const QString &fontName);

    qreal fontScaling() const;
    void setFontScaling(qreal fontScaling);

    qreal fontWidth() const;
    void setFontWidth(qreal fontWidth);

    qreal lineSpacing() const;
    void setLineSpacing(qreal lineSpacing);

    qreal baseFontScaling() const;
    void setBaseFontScaling(qreal baseFontScaling);

    bool lowResolutionFont() const;

signals:
    void fontSourceChanged();
    void rasterizationChanged();
    void fontNameChanged();
    void fontScalingChanged();
    void fontWidthChanged();
    void lineSpacingChanged();
    void baseFontScalingChanged();
    void lowResolutionFontChanged();
    void filteredFontListChanged();

    void terminalFontChanged(QString fontFamily,
                             int pixelSize,
                             int lineSpacing,
                             qreal screenScaling,
                             qreal fontWidth,
                             QString fallbackFontFamily,
                             bool lowResolutionFont);

private:
    QStringList retrieveMonospaceFonts();
    void populateBundledFonts();
    void populateSystemFonts();
    void addBundledFont(const QString &name,
                        const QString &text,
                        const QString &source,
                        qreal baseWidth,
                        int pixelSize,
                        bool lowResolutionFont,
                        const QString &fallbackName = QString());
    void setFontSubstitutions(const QString &family, const QStringList &substitutes);
    void removeFontSubstitution(const QString &family);
    void updateFilteredFonts();
    void updateComputedFont();
    const FontEntry *findFontByName(const QString &name) const;
    QString resolveFontFamily(const QString &sourcePath);
    qreal computeBaseWidth(const QString &family, int pixelSize, qreal fallbackWidth) const;

    FontListModel m_fontListModel;
    FontListModel m_filteredFontListModel;
    QVector<FontEntry> m_allFonts;

    int m_fontSource = 0;
    int m_rasterization = 0;
    QString m_fontName = QStringLiteral("TERMINESS_SCALED");
    qreal m_fontScaling = 1.0;
    qreal m_fontWidth = 1.0;
    qreal m_lineSpacing = 0.1;
    qreal m_baseFontScaling = 0.75;
    bool m_lowResolutionFont = false;

    QHash<QString, QString> m_loadedFamilies;
    QSet<QString> m_bundledFamilies;
};

#endif // FONTMANAGER_H


================================================
FILE: app/main.cpp
================================================
#include <QtQml/QQmlApplicationEngine>
#include <QtGui/QGuiApplication>

#include <QQmlContext>
#include <QStringList>

#include <QDir>

#include <QtWidgets/QApplication>
#include <QIcon>
#include <QQuickStyle>
#include <QtQml/qqml.h>

#include <kdsingleapplication.h>

#include <QDebug>
#include <stdlib.h>

#include <QLoggingCategory>

#include <fileio.h>
#include <fontlistmodel.h>
#include <fontmanager.h>

#if defined(Q_OS_MAC)
#include <CoreFoundation/CoreFoundation.h>
#include <QStyleFactory>
#include <QMenu>
#endif

QString getNamedArgument(QStringList args, QString name, QString defaultName)
{
    int index = args.indexOf(name);
    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.
    // Disable Connections slot warnings
    QLoggingCategory::setFilterRules("qt.qml.connections.warning=false");
    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round);

// #if defined (Q_OS_LINUX)
//     setenv("QSG_RENDER_LOOP", "threaded", 0);
// #endif

#if defined(Q_OS_MAC)
    // This allows UTF-8 characters usage in OSX.
    setenv("LC_CTYPE", "UTF-8", 1);

    // Ensure key repeat works for letter keys (disable macOS press-and-hold for this app).
    CFPreferencesSetAppValue(CFSTR("ApplePressAndHoldEnabled"), kCFBooleanFalse, kCFPreferencesCurrentApplication);
    CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);

    // Qt6 macOS default look is still lacking, so let's force Fusion for now
    QQuickStyle::setStyle(QStringLiteral("Fusion"));
#endif

    if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {
        QTextStream cout(stdout, QIODevice::WriteOnly);
        cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << Qt::endl;
        cout << "  --default-settings  Run cool-retro-term with the default settings" << Qt::endl;
        cout << "  --workdir <dir>     Change working directory to 'dir'" << Qt::endl;
        cout << "  -e <cmd>            Command to execute. This option will catch all following arguments, so use it as the last option." << Qt::endl;
        cout << "  --fullscreen        Run cool-retro-term in fullscreen." << Qt::endl;
        cout << "  -p|--profile <prof> Run cool-retro-term with the given profile." << Qt::endl;
        cout << "  -h|--help           Print this help." << Qt::endl;
        cout << "  --verbose           Print additional information such as profiles and settings." << Qt::endl;
        return 0;
    }

    QString appVersion(QStringLiteral(APP_VERSION));

    if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
        QTextStream cout(stdout, QIODevice::WriteOnly);
        cout << "cool-retro-term " << appVersion << Qt::endl;
        return 0;
    }

    QApplication app(argc, argv);
    app.setAttribute(Qt::AA_MacDontSwapCtrlAndMeta, true);
    app.setApplicationName(QStringLiteral("cool-retro-term"));
    app.setOrganizationName(QStringLiteral("cool-retro-term"));
    app.setOrganizationDomain(QStringLiteral("cool-retro-term"));
    app.setApplicationVersion(appVersion);

    KDSingleApplication singleApp(QStringLiteral("cool-retro-term"));

    if (!singleApp.isPrimaryInstance()) {
        if (singleApp.sendMessage("new-window"))
            return 0;
        qWarning() << "KDSingleApplication: primary not reachable, continuing as independent instance.";
    }

    QQmlApplicationEngine engine;
    FileIO fileIO;

    qmlRegisterType<FontManager>("CoolRetroTerm", 1, 0, "FontManager");
    qmlRegisterUncreatableType<FontListModel>("CoolRetroTerm", 1, 0, "FontListModel", "FontListModel is created by FontManager");

#if !defined(Q_OS_MAC)
    app.setWindowIcon(QIcon::fromTheme("cool-retro-term", QIcon(":../icons/32x32/cool-retro-term.png")));
#if defined(Q_OS_LINUX)
    QGuiApplication::setDesktopFileName(QStringLiteral("cool-retro-term"));
#endif
#else
    app.setWindowIcon(QIcon(":../icons/32x32/cool-retro-term.png"));
#endif

    // Manage command line arguments from the cpp side
    QStringList args = app.arguments();

    // 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("appVersion", appVersion);
    engine.rootContext()->setContextProperty("defaultCmd", command);
    engine.rootContext()->setContextProperty("defaultCmdArgs", commandArgs);

    engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir", QDir::currentPath()));
    engine.rootContext()->setContextProperty("fileIO", &fileIO);

    // Manage import paths for Linux and OSX.
    QStringList importPathList = engine.importPathList();
    importPathList.append(QCoreApplication::applicationDirPath() + "/qmltermwidget");
    importPathList.append(QCoreApplication::applicationDirPath() + "/../PlugIns");
    importPathList.append(QCoreApplication::applicationDirPath() + "/../../../qmltermwidget");
    engine.setImportPathList(importPathList);

    engine.load(QUrl(QStringLiteral ("qrc:/main.qml")));

    if (engine.rootObjects().isEmpty()) {
        qDebug() << "Cannot load QML interface";
        return EXIT_FAILURE;
    }

    // Quit the application when the engine closes.
    QObject::connect((QObject*) &engine, SIGNAL(quit()), (QObject*) &app, SLOT(quit()));

    auto requestNewWindow = [&engine]() {
        if (engine.rootObjects().isEmpty())
            return;

        QObject *rootObject = engine.rootObjects().constFirst();
        QMetaObject::invokeMethod(rootObject, "createWindow", Qt::QueuedConnection);
    };

    QObject::connect(&singleApp, &KDSingleApplication::messageReceived, &app,
                     [&requestNewWindow](const QByteArray &message) {
        if (message.isEmpty() || message == QByteArray("new-window"))
            requestNewWindow();
    });

#if defined(Q_OS_MAC)
    QMenu *dockMenu = new QMenu(nullptr);
    dockMenu->addAction(QObject::tr("New Window"), [&requestNewWindow]() { requestNewWindow(); });
    dockMenu->setAsDockMenu();
#endif

    return app.exec();
}


================================================
FILE: app/qml/AboutDialog.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.2
import QtQuick.Layouts 1.1
import QtQuick.Window 2.0

ApplicationWindow {
    id: dialogwindow
    title: qsTr("About")
    width: 600
    height: 400

    ColumnLayout {
        anchors.fill: parent
        anchors.margins: 15
        spacing: 15
        Text {
            Layout.alignment: Qt.AlignHCenter
            text: "cool-retro-term"
            color: palette.text
            font {
                bold: true
                pointSize: 18
            }
        }
        Loader {
            id: mainContent
            Layout.fillHeight: true
            Layout.fillWidth: true

            states: [
                State {
                    name: "Default"
                    PropertyChanges {
                        target: mainContent
                        sourceComponent: defaultComponent
                    }
                },
                State {
                    name: "License"
                    PropertyChanges {
                        target: mainContent
                        sourceComponent: licenseComponent
                    }
                }
            ]
            Component.onCompleted: mainContent.state = "Default"
        }
        Item {
            Layout.fillWidth: true
            height: childrenRect.height
            Button {
                anchors.left: parent.left
                text: qsTr("License")
                onClicked: {
                    mainContent.state == "Default" ? mainContent.state
                                                     = "License" : mainContent.state = "Default"
                }
            }
            Button {
                anchors.right: parent.right
                text: qsTr("Close")
                onClicked: dialogwindow.close()
            }
        }
    }
    // MAIN COMPONENTS ////////////////////////////////////////////////////////
    Component {
        id: defaultComponent
        ColumnLayout {
            anchors.fill: parent
            spacing: 10
            Image {
                Layout.fillWidth: true
                Layout.fillHeight: true
                Layout.alignment: Qt.AlignHCenter
                fillMode: Image.PreserveAspectFit
                source: "images/crt256.png"
                smooth: true
            }
            Text {
                Layout.alignment: Qt.AlignCenter
                horizontalAlignment: Text.AlignHCenter
                color: palette.text
                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"
            }
        }
    }
    Component {
        id: licenseComponent
        ScrollView {
            anchors.fill: parent
            clip: true
            TextArea {
                readOnly: true
                wrapMode: TextEdit.Wrap
                color: palette.text
                text: "Copyright (c) 2013-2025 Filippo Scognamiglio <flscogna@gmail.com>\n\n"
                      + "https://github.com/Swordfish90/cool-retro-term\n\n" +
                      "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.\n\n" +
                      "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.\n\n" +
                      "You should have received a copy of the GNU General Public License "
                      + "along with this program.  If not, see <http://www.gnu.org/licenses/>."
            }
        }
    }
}


================================================
FILE: app/qml/ApplicationSettings.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.0
import CoolRetroTerm 1.0

import "utils.js" as Utils

QtObject {
    readonly property string version: appVersion
    readonly property int profileVersion: 2

    // STATIC CONSTANTS ////////////////////////////////////////////////////////
    readonly property real screenCurvatureSize: 0.6
    readonly property real minimumFontScaling: 0.25
    readonly property real maximumFontScaling: 2.50

    readonly property int defaultMargin: 16

    readonly property real minBurnInFadeTime: 0.16
    readonly property real maxBurnInFadeTime: 1.6

    property bool isMacOS: Qt.platform.os === "osx"

    // GENERAL SETTINGS ///////////////////////////////////////////////////////
    property bool showMenubar: false

    property bool showTerminalSize: true
    property real windowScaling: 1.0

    property int effectsFrameSkip: 3
    property bool verbose: false

    property real bloomQuality: 0.5
    property real burnInQuality: 0.5

    property bool blinkingCursor: false


    // PROFILE SETTINGS ///////////////////////////////////////////////////////
    property real windowOpacity: 1.0
    property real ambientLight: 0.2
    property real contrast: 0.80
    property real brightness: 0.5

    property bool useCustomCommand: false
    property string customCommand: ""

    property string _backgroundColor: "#000000"
    property string _fontColor: "#ff8100"
    property string _frameColor: "#ffffff"
    property string saturatedColor: Utils.mix(Utils.strToColor(_fontColor), Utils.strToColor("#FFFFFF"), (saturationColor * 0.5))
    property color fontColor: Utils.mix(Utils.strToColor(_backgroundColor), Utils.strToColor(saturatedColor), (0.7 + (contrast * 0.3)))
    property color backgroundColor: Utils.mix(Utils.strToColor(saturatedColor), Utils.strToColor(_backgroundColor), (0.7 + (contrast * 0.3)))
    property color frameColor: Utils.strToColor(_frameColor)

    property real staticNoise: 0.12
    property real screenCurvature: 0.3
    property real glowingLine: 0.2
    property real burnIn: 0.25
    property real bloom: 0.55

    property real chromaColor: 0.25
    property real saturationColor: 0.25

    property real jitter: 0.2

    property real horizontalSync: 0.08
    property real flickering: 0.1

    property real rgbShift: 0.0

    property real _frameShininess: 0.2
    property real frameShininess: _frameShininess * 0.5

    property real _frameSize: 0.2
    property real frameSize: _frameSize * 0.05

    property real _screenRadius: 0.2
    property real screenRadius: Utils.lint(4.0, 120.0, _screenRadius)

    property real _margin: 0.5
    property real margin: Utils.lint(1.0, 40.0, _margin) + (1.0 - Math.SQRT1_2) * screenRadius

    readonly property bool frameEnabled: ambientLight > 0 || _frameSize > 0 || screenCurvature > 0

    readonly property int no_rasterization: 0
    readonly property int scanline_rasterization: 1
    readonly property int pixel_rasterization: 2
    readonly property int subpixel_rasterization: 3
    readonly property int modern_rasterization: 4

    property alias rasterization: fontManager.rasterization

    readonly property int bundled_fonts: 0
    readonly property int system_fonts: 1

    property alias fontSource: fontManager.fontSource

    // FONTS //////////////////////////////////////////////////////////////////
    readonly property real baseFontScaling: 0.75
    property alias fontScaling: fontManager.fontScaling
    property real totalFontScaling: baseFontScaling * fontScaling

    property alias fontWidth: fontManager.fontWidth
    property alias lineSpacing: fontManager.lineSpacing

    property alias lowResolutionFont: fontManager.lowResolutionFont

    property alias fontName: fontManager.fontName
    property alias filteredFontList: fontManager.filteredFontList

    property FontManager fontManager: FontManager {
        id: fontManager
        baseFontScaling: baseFontScaling
    }

    signal initializedSettings

    function incrementScaling() {
        fontScaling = Math.min(fontScaling + 0.05, maximumFontScaling)
    }

    function decrementScaling() {
        fontScaling = Math.max(fontScaling - 0.05, minimumFontScaling)
    }

    function close() {
        storeSettings()
        storeCustomProfiles()
        Qt.quit()
    }

    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 = {
            "effectsFrameSkip": effectsFrameSkip,
            "windowScaling": windowScaling,
            "showTerminalSize": showTerminalSize,
            "fontScaling": fontScaling,
            "showMenubar": showMenubar,
            "bloomQuality": bloomQuality,
            "burnInQuality": burnInQuality,
            "useCustomCommand": useCustomCommand,
            "customCommand": customCommand
        }
        return stringify(settings)
    }

    function composeProfileObject() {
        var profile = {
            "backgroundColor": _backgroundColor,
            "fontColor": _fontColor,
            "flickering": flickering,
            "horizontalSync": horizontalSync,
            "staticNoise": staticNoise,
            "chromaColor": chromaColor,
            "saturationColor": saturationColor,
            "screenCurvature": screenCurvature,
            "glowingLine": glowingLine,
            "burnIn": burnIn,
            "bloom": bloom,
            "rasterization": rasterization,
            "jitter": jitter,
            "rgbShift": rgbShift,
            "brightness": brightness,
            "contrast": contrast,
            "ambientLight": ambientLight,
            "windowOpacity": windowOpacity,
            "fontName": fontName,
            "fontSource": fontSource,
            "fontWidth": fontWidth,
            "margin": _margin,
            "blinkingCursor": blinkingCursor,
            "frameSize": _frameSize,
            "screenRadius": _screenRadius,
            "frameColor": _frameColor,
            "frameShininess": _frameShininess
        }
        return profile
    }

    function composeProfileString() {
        return stringify(composeProfileObject())
    }

    function loadSettings() {
        var settingsString = storage.getSetting("_CURRENT_SETTINGS")
        var profileString = storage.getSetting("_CURRENT_PROFILE")

        if (!settingsString)
            return
        if (!profileString)
            return

        loadSettingsString(settingsString)
        loadProfileString(profileString)

        if (verbose)
            console.log("Loading settings: " + settingsString + profileString)
    }

    function storeSettings() {
        var settingsString = composeSettingsString()
        var profileString = composeProfileString()

        storage.setSetting("_CURRENT_SETTINGS", settingsString)
        storage.setSetting("_CURRENT_PROFILE", profileString)

        if (verbose) {
            console.log("Storing settings: " + settingsString)
            console.log("Storing profile: " + profileString)
        }
    }

    function loadSettingsString(settingsString) {
        var settings = JSON.parse(settingsString)

        showTerminalSize = settings.showTerminalSize
                !== undefined ? settings.showTerminalSize : showTerminalSize

        effectsFrameSkip = settings.effectsFrameSkip !== undefined ? settings.effectsFrameSkip : effectsFrameSkip
        windowScaling = settings.windowScaling
                !== undefined ? settings.windowScaling : windowScaling

        fontScaling = settings.fontScaling !== undefined ? settings.fontScaling : fontScaling

        showMenubar = settings.showMenubar !== undefined ? settings.showMenubar : showMenubar

        bloomQuality = settings.bloomQuality !== undefined ? settings.bloomQuality : bloomQuality
        burnInQuality = settings.burnInQuality
                !== undefined ? settings.burnInQuality : burnInQuality

        useCustomCommand = settings.useCustomCommand
                !== undefined ? settings.useCustomCommand : useCustomCommand
        customCommand = settings.customCommand
                !== undefined ? settings.customCommand : customCommand
    }

    function loadProfileString(profileString) {
        var settings = JSON.parse(profileString)

        _backgroundColor = settings.backgroundColor
                !== undefined ? settings.backgroundColor : _backgroundColor
        _fontColor = settings.fontColor !== undefined ? settings.fontColor : _fontColor

        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

        burnIn = settings.burnIn !== undefined ? settings.burnIn : burnIn
        bloom = settings.bloom !== undefined ? settings.bloom : bloom

        rasterization = settings.rasterization
                !== undefined ? settings.rasterization : rasterization

        jitter = settings.jitter !== undefined ? settings.jitter : jitter

        rgbShift = settings.rgbShift !== undefined ? settings.rgbShift : rgbShift

        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

        fontName = settings.fontName !== undefined ? settings.fontName : fontName
        fontSource = settings.fontSource !== undefined ? settings.fontSource : fontSource
        fontWidth = settings.fontWidth !== undefined ? settings.fontWidth : fontWidth
        lineSpacing = settings.lineSpacing !== undefined ? settings.lineSpacing : lineSpacing

        _margin = settings.margin !== undefined ? settings.margin : _margin
        _frameSize = settings.frameSize !== undefined ? settings.frameSize : _frameSize
        _screenRadius = settings.screenRadius !== undefined ? settings.screenRadius : _screenRadius
        _frameColor = settings.frameColor !== undefined ? settings.frameColor : _frameColor
        _frameShininess = settings.frameShininess !== undefined ? settings.frameShininess : _frameShininess

        blinkingCursor = settings.blinkingCursor !== undefined ? settings.blinkingCursor : blinkingCursor
    }

    function storeCustomProfiles() {
        storage.setSetting("_CUSTOM_PROFILES", composeCustomProfilesString())
    }

    function loadCustomProfiles() {
        var customProfileString = storage.getSetting("_CUSTOM_PROFILES")
        if (customProfileString === undefined)
            customProfileString = "[]"
        loadCustomProfilesString(customProfileString)
    }

    function loadCustomProfilesString(customProfilesString) {
        var customProfiles = JSON.parse(customProfilesString)
        for (var i = 0; i < customProfiles.length; i++) {
            var profile = customProfiles[i]

            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)
            if (profile.builtin)
                continue
            customProfiles.push({
                                    "text": profile.text,
                                    "obj_string": profile.obj_string,
                                    "builtin": false
                                })
        }
        return stringify(customProfiles)
    }

    function loadProfile(index) {
        var profile = profilesList.get(index)
        loadProfileString(profile.obj_string)
    }

    function appendCustomProfile(name, profileString) {
        profilesList.append({
                                "text": name,
                                "obj_string": profileString,
                                "builtin": false
                            })
    }

    // PROFILES ///////////////////////////////////////////////////////////////
    property ListModel profilesList: ListModel {
        ListElement {
            text: "Default Amber"
            obj_string: '{
                "ambientLight": 0.3,
                "backgroundColor": "#000000",
                "bloom": 0.6,
                "brightness": 0.5,
                "burnIn": 0.3,
                "chromaColor": 0.2,
                "contrast": 0.8,
                "flickering": 0.1,
                "fontColor": "#ff8100",
                "fontName": "TERMINESS_SCALED",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.2,
                "horizontalSync": 0.1,
                "jitter": 0.2,
                "rasterization": 0,
                "rgbShift": 0,
                "saturationColor": 0.2,
                "screenCurvature": 0.2,
                "screenRadius": 0.1,
                "staticNoise": 0.1,
                "windowOpacity": 1,
                "margin": 0.3,
                "blinkingCursor": false,
                "frameSize": 0.1,
                "frameColor": "#cfcfcf",
                "frameShininess": 0.3
            }'
            builtin: true
        }
        ListElement {
            text: "Monochrome Green"
            obj_string: '{
                "ambientLight": 0.3,
                "backgroundColor": "#000000",
                "bloom": 0.5,
                "brightness": 0.5,
                "burnIn": 0.3,
                "chromaColor": 0.0,
                "contrast": 0.8,
                "flickering": 0.1,
                "fontColor": "#0ccc68",
                "fontName": "DEPARTURE_MONO_SCALED",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.2,
                "horizontalSync": 0.1,
                "jitter": 0.2,
                "rasterization": 0,
                "rgbShift": 0,
                "saturationColor": 0.0,
                "screenCurvature": 0.3,
                "screenRadius": 0.2,
                "staticNoise": 0.1,
                "windowOpacity": 1,
                "margin": 0.3,
                "blinkingCursor": false,
                "frameSize": 0.1,
                "frameColor": "#d4d4d4",
                "frameShininess": 0.1
            }'
            builtin: true
        }
        ListElement {
            text: "Deep Blue"
            obj_string: '{
                "ambientLight": 0.0,
                "backgroundColor": "#000000",
                "bloom": 0.6,
                "brightness": 0.5,
                "burnIn": 0.3,
                "chromaColor": 1.0,
                "contrast": 0.8,
                "flickering": 0.1,
                "fontColor": "#7fb4ff",
                "fontName": "BIGBLUE_TERMINAL_SCALED",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.2,
                "horizontalSync": 0.1,
                "jitter": 0.2,
                "rasterization": 0,
                "rgbShift": 0,
                "saturationColor": 0.2,
                "screenCurvature": 0.4,
                "screenRadius": 0.1,
                "staticNoise": 0.1,
                "windowOpacity": 1,
                "margin": 0.3,
                "blinkingCursor": false,
                "frameSize": 0.1,
                "frameColor": "#ffffff",
                "frameShininess": 0.9
            }'
            builtin: true
        }
        ListElement {
            text: "Commodore 64"
            obj_string: '{
                "ambientLight": 0.4,
                "backgroundColor": "#3b3b8f",
                "bloom": 0.4,
                "brightness": 0.6,
                "burnIn": 0.1,
                "chromaColor": 0.0,
                "contrast": 0.7,
                "flickering": 0.1,
                "fontColor": "#a9a7ff",
                "fontName": "COMMODORE_64_SCALED",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.1,
                "horizontalSync": 0.0,
                "jitter": 0.0,
                "rasterization": 1,
                "rgbShift": 0,
                "saturationColor": 0,
                "screenCurvature": 0.5,
                "screenRadius": 0.1,
                "staticNoise": 0.1,
                "windowOpacity": 1,
                "margin": 0.3,
                "blinkingCursor": false,
                "frameSize": 0.5,
                "frameColor": "#999999",
                "frameShininess": 0.0
            }'
            builtin: true
        }
        ListElement {
            text: "Commodore PET"
            obj_string: '{
                "ambientLight": 0.0,
                "backgroundColor": "#000000",
                "bloom": 0.4,
                "brightness": 0.5,
                "burnIn": 0.4,
                "chromaColor": 0,
                "contrast": 0.8,
                "flickering": 0.2,
                "fontColor": "#ffffff",
                "fontName": "COMMODORE_PET_SCALED",
                "fontSource": 0,
                "fontWidth": 1.25,
                "lineSpacing": 0.1,
                "glowingLine": 0.3,
                "horizontalSync": 0.2,
                "jitter": 0.15,
                "rasterization": 1,
                "rgbShift": 0.0,
                "saturationColor": 0,
                "screenCurvature": 0.7,
                "screenRadius": 0.3,
                "staticNoise": 0.2,
                "windowOpacity": 1,
                "margin": 0.2,
                "blinkingCursor": false,
                "frameSize": 0.5,
                "frameColor": "#000000",
                "frameShininess": 0.6
            }'
            builtin: true
        }
        ListElement {
            text: "Apple ]["
            obj_string: '{
                "ambientLight": 1.0,
                "backgroundColor": "#001100",
                "bloom": 0.3,
                "brightness": 0.5,
                "burnIn": 0.3,
                "chromaColor": 0,
                "contrast": 0.8,
                "flickering": 0.2,
                "fontColor": "#4dff6b",
                "fontName": "APPLE_II_SCALED",
                "fontSource": 0,
                "fontWidth": 1.25,
                "lineSpacing": 0.1,
                "glowingLine": 0.3,
                "horizontalSync": 0.2,
                "jitter": 0.2,
                "rasterization": 1,
                "rgbShift": 0.0,
                "saturationColor": 0,
                "screenCurvature": 0.5,
                "screenRadius": 0.3,
                "staticNoise": 0.2,
                "windowOpacity": 1,
                "margin": 0.0,
                "blinkingCursor": false,
                "frameSize": 0.2,
                "frameColor": "#ffffff",
                "frameShininess": 0.8
            }'
            builtin: true
        }
        ListElement {
            text: "Atari 400"
            obj_string: '{
                "ambientLight": 0.1,
                "backgroundColor": "#0f1f5a",
                "bloom": 0.1,
                "brightness": 0.6,
                "burnIn": 0.2,
                "chromaColor": 0,
                "contrast": 0.9,
                "flickering": 0.1,
                "fontColor": "#8ed6ff",
                "fontName": "ATARI_400_SCALED",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.1,
                "horizontalSync": 0.0,
                "jitter": 0.0,
                "rasterization": 1,
                "rgbShift": 0.0,
                "saturationColor": 0,
                "screenCurvature": 0.4,
                "screenRadius": 0.2,
                "staticNoise": 0.1,
                "windowOpacity": 1,
                "margin": 0.2,
                "blinkingCursor": false,
                "frameSize": 0.4,
                "frameColor": "#cccccc",
                "frameShininess": 0.3
            }'
            builtin: true
        }
        ListElement {
            text: "IBM VGA 8x16"
            obj_string: '{
                "ambientLight": 0.2,
                "backgroundColor": "#000000",
                "bloom": 0.2,
                "brightness": 0.6,
                "burnIn": 0.1,
                "chromaColor": 0.5,
                "contrast": 1.0,
                "flickering": 0.1,
                "fontColor": "#c0c0c0",
                "fontName": "IBM_VGA_8x16",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.1,
                "horizontalSync": 0.0,
                "jitter": 0.0,
                "rasterization": 1,
                "rgbShift": 0.1,
                "saturationColor": 0,
                "screenCurvature": 0.3,
                "screenRadius": 0.1,
                "staticNoise": 0.0,
                "windowOpacity": 1,
                "margin": 0.2,
                "blinkingCursor": false,
                "frameSize": 0.1,
                "frameColor": "#ffffff",
                "frameShininess": 0.3
            }'
            builtin: true
        }
        ListElement {
            text: "IBM 3278 Reborn"
            obj_string: '{
                "ambientLight": 0.2,
                "backgroundColor": "#000000",
                "bloom": 0.2,
                "brightness": 0.5,
                "burnIn": 0.5,
                "chromaColor": 0,
                "contrast": 0.8,
                "flickering": 0,
                "fontColor": "#3cff7a",
                "fontName": "IBM_3278",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.0,
                "horizontalSync": 0,
                "jitter": 0,
                "rasterization": 4,
                "rgbShift": 0,
                "saturationColor": 0,
                "screenCurvature": 0,
                "screenRadius": 0.0,
                "staticNoise": 0.0,
                "windowOpacity": 1,
                "margin": 0.1,
                "blinkingCursor": false,
                "frameSize": 0,
                "frameColor": "#ffffff",
                "frameShininess": 0.2
            }'
            builtin: true
        }
        ListElement {
            text: "Neon Cyan"
            obj_string: '{
                "ambientLight": 0.1,
                "backgroundColor": "#001018",
                "bloom": 0.6,
                "brightness": 0.6,
                "burnIn": 0.1,
                "chromaColor": 1,
                "contrast": 0.9,
                "flickering": 0.1,
                "fontColor": "#52f7ff",
                "fontName": "IOSEVKA",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.2,
                "horizontalSync": 0.0,
                "jitter": 0.1,
                "rasterization": 4,
                "rgbShift": 0.0,
                "saturationColor": 0.6,
                "screenCurvature": 0,
                "screenRadius": 0.0,
                "staticNoise": 0.1,
                "windowOpacity": 0.8,
                "margin": 0.1,
                "blinkingCursor": false,
                "frameSize": 0,
                "frameColor": "#c3c3c3",
                "frameShininess": 0.2
            }'
            builtin: true
        }
        ListElement {
            text: "Ghost Terminal"
            obj_string: '{
                "ambientLight": 0.3,
                "backgroundColor": "#0b1014",
                "bloom": 0.3,
                "brightness": 0.6,
                "burnIn": 0.2,
                "chromaColor": 0,
                "contrast": 0.5,
                "flickering": 0.0,
                "fontColor": "#a6b3c0",
                "fontName": "JETBRAINS_MONO",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.1,
                "horizontalSync": 0.0,
                "jitter": 0.0,
                "rasterization": 4,
                "rgbShift": 0.0,
                "saturationColor": 0.0,
                "screenCurvature": 0,
                "screenRadius": 0.0,
                "staticNoise": 0.1,
                "windowOpacity": 0.7,
                "margin": 0.1,
                "blinkingCursor": false,
                "frameSize": 0,
                "frameColor": "#a7a7a7",
                "frameShininess": 0.2
            }'
            builtin: true
        }
        ListElement {
            text: "Plasma"
            obj_string: '{
                "ambientLight": 0.1,
                "backgroundColor": "#070014",
                "bloom": 0.7,
                "brightness": 0.6,
                "burnIn": 0.1,
                "chromaColor": 1,
                "contrast": 0.8,
                "flickering": 0.1,
                "fontColor": "#ff9bd6",
                "fontName": "FIRA_CODE",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.2,
                "horizontalSync": 0.0,
                "jitter": 0.1,
                "rasterization": 4,
                "rgbShift": 0.1,
                "saturationColor": 0.8,
                "screenCurvature": 0,
                "screenRadius": 0.0,
                "staticNoise": 0.1,
                "windowOpacity": 1.0,
                "margin": 0.1,
                "blinkingCursor": false,
                "frameSize": 0,
                "frameColor": "#d0d0d0",
                "frameShininess": 0.2
            }'
            builtin: true
        }
        ListElement {
            text: "Boring"
            obj_string: '{
                "ambientLight": 0.1,
                "backgroundColor": "#000000",
                "bloom": 0.5,
                "brightness": 0.5,
                "burnIn": 0.05,
                "chromaColor": 1,
                "contrast": 0.8,
                "flickering": 0.0,
                "fontColor": "#ffffff",
                "fontName": "JETBRAINS_MONO",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.1,
                "horizontalSync": 0,
                "jitter": 0.0,
                "rasterization": 4,
                "rgbShift": 0,
                "saturationColor": 0.0,
                "screenCurvature": 0,
                "screenRadius": 0.0,
                "staticNoise": 0.0,
                "windowOpacity": 1.0,
                "margin": 0.0,
                "blinkingCursor": false,
                "frameSize": 0,
                "frameColor": "#c0c0c0",
                "frameShininess": 0.2
            }'
            builtin: true
        }
        ListElement {
            text: "E-Ink"
            obj_string: '{
                "ambientLight": 0.6,
                "backgroundColor": "#f2f2ec",
                "bloom": 0.0,
                "brightness": 1.0,
                "burnIn": 0.6,
                "chromaColor": 0,
                "contrast": 0.5,
                "flickering": 0.0,
                "fontColor": "#101010",
                "fontName": "HACK",
                "fontSource": 0,
                "fontWidth": 1,
                "lineSpacing": 0.1,
                "glowingLine": 0.0,
                "horizontalSync": 0.0,
                "jitter": 0.0,
                "rasterization": 4,
                "rgbShift": 0,
                "saturationColor": 0,
                "screenCurvature": 0,
                "screenRadius": 0.0,
                "staticNoise": 0.0,
                "windowOpacity": 1,
                "margin": 0.1,
                "blinkingCursor": false,
                "frameSize": 0,
                "frameColor": "#cdcdcd",
                "frameShininess": 0.2
            }'
            builtin: true
        }
    }

    function getProfileIndexByName(name) {
        for (var i = 0; i < profilesList.count; i++) {
            if (profilesList.get(i).text === name)
                return i
        }
        return -1
    }

    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()
        }

        loadCustomProfiles()

        var profileArgPosition = args.indexOf("--profile")
        if (profileArgPosition !== -1) {
            var profileIndex = getProfileIndexByName(args[profileArgPosition + 1])
            if (profileIndex !== -1) {
                loadProfile(profileIndex)
            } else {
                console.log("Warning: selected profile is not valid; ignoring it")
            }
        }

        initializedSettings()
    }

    // VARS ///////////////////////////////////////////////////////////////////
    property Label _sampleLabel: Label {
        text: "100%"
    }
    property real labelWidth: _sampleLabel.width
}


================================================
FILE: app/qml/BurnInEffect.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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.0

import "utils.js" as Utils

Loader {
    id: burnInEffect

    property ShaderEffectSource effectSource: item ? item.source : null
    property bool resizing: false

    property real lastUpdate: 0
    property real prevLastUpdate: 0

    property real burnIn: appSettings.burnIn
    property real burnInFadeTime: 1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn)
    property real _minBurnInFadeTime: appSettings.minBurnInFadeTime
    property real _maxBurnInFadeTime: appSettings.maxBurnInFadeTime

    active: appSettings.burnIn !== 0

    anchors.fill: parent

    function completelyUpdate() {
        let newTime = timeManager.time
        if (newTime > lastUpdate) {
            prevLastUpdate = lastUpdate
            lastUpdate = newTime
        }

        item.source.scheduleUpdate()
    }

    function restartBlurSource() {
        prevLastUpdate = timeManager.time
        lastUpdate = prevLastUpdate
        completelyUpdate()
    }

    sourceComponent: Item {
        property alias source: burnInEffectSource

        ShaderEffectSource {
            id: burnInEffectSource

            anchors.fill: parent

            sourceItem: burnInShaderEffect
            live: false
            recursive: !resizing
            hideSource: true
            wrapMode: ShaderEffectSource.ClampToEdge

            format: ShaderEffectSource.RGBA
            smooth: true

            visible: false

            Connections {
                target: kterminal

                onImagePainted: {
                    completelyUpdate()
                }
            }
            // Restart blurred source settings change.
            Connections {
                target: appSettings.fontManager

                onTerminalFontChanged: {
                    burnInEffect.restartBlurSource()
                }
            }

            Connections {
                target: appSettings

                onBurnInChanged: {
                    burnInEffect.restartBlurSource()
                }

                onRasterizationChanged: {
                    burnInEffect.restartBlurSource()
                }

                onBurnInQualityChanged: {
                    burnInEffect.restartBlurSource()
                }
            }
        }

        ShaderEffect {
            id: burnInShaderEffect

            property real time: timeManager.time

            property variant txt_source: kterminalSource
            property variant burnInSource: burnInEffectSource
            property real burnInTime: burnInFadeTime
            property real burnInLastUpdate: burnInEffect.lastUpdate
            property real prevLastUpdate: burnInEffect.prevLastUpdate

            anchors.fill: parent
            blending: false

            fragmentShader: "qrc:/shaders/burn_in.frag.qsb"
            vertexShader: "qrc:/shaders/burn_in.vert.qsb"

            onStatusChanged: if (log) console.log(log) //Print warning messages
        }
    }

    onWidthChanged: {
        resizing = true
        resizeTimer.restart()
    }

    onHeightChanged: {
        resizing = true
        resizeTimer.restart()
    }

    Timer {
        id: resizeTimer
        interval: 300
        onTriggered: resizing = false
    }
}


================================================
FILE: app/qml/CheckableSlider.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.0
import QtQuick.Layouts 1.1

import "Components"

RowLayout {
    property alias name: check.text

    property double value
    property alias min_value: slider.from
    property alias max_value: slider.to
    property alias stepSize: slider.stepSize

    signal newValue(real newValue)

    id: setting_component
    Layout.fillWidth: true

    onValueChanged: {
        check.checked = !(value == 0)
        if (check.checked)
            slider.value = value
    }

    CheckBox {
        id: check
        implicitWidth: 160
        onClicked: {
            if (!checked) {
                checked = false
                slider.enabled = false
                newValue(0)
            } else {
                checked = true
                newValue(slider.value)
                slider.enabled = true
            }
        }
    }
    Slider {
        id: slider
        stepSize: parent.stepSize
        Layout.fillWidth: true
        onValueChanged: {
            newValue(value)
        }
    }
    SizedLabel {
        text: Math.round(
                  ((value - min_value) / (max_value - min_value)) * 100) + "%"
    }
}


================================================
FILE: app/qml/ColorButton.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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.Dialogs

Item {
    id: rootItem

    signal colorSelected(color color)
    property color color
    property string name

    ColorDialog {
        id: colorDialog
        title: qsTr("Choose a color")
        modality: Qt.ApplicationModal
        selectedColor: rootItem.color

        onSelectedColorChanged: {
            if (!appSettings.isMacOS && visible)
                colorSelected(selectedColor)
        }
        onAccepted: colorSelected(selectedColor)
    }
    Rectangle {
        anchors.fill: parent
        radius: 10
        color: rootItem.color

        Rectangle {
            anchors.fill: parent
            anchors.margins: parent.height * 0.25
            radius: parent.radius
            color: "white"
            opacity: 0.5
        }
        Text {
            anchors.centerIn: parent
            z: parent.z + 1
            text: name + ":  " + rootItem.color
        }
    }
    MouseArea {
        anchors.fill: parent
        onClicked: colorDialog.open()
    }
}


================================================
FILE: app/qml/Components/SizedLabel.qml
================================================


/*******************************************************************************
* Copyright (c) 2013-2021 "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.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0

// This component is simply a label with a predefined size.
// Used to improve alignment.
Label {
    id: textfield
    Layout.minimumWidth: appSettings.labelWidth
    width: appSettings.labelWidth
}


================================================
FILE: app/qml/InsertNameDialog.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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.Window 2.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.1
import QtQuick.Dialogs

Window {
    id: insertnamedialog
    width: 400
    height: 100
    modality: Qt.ApplicationModal
    title: qsTr("Save new profile")

    property alias profileName: namefield.text
    signal nameSelected(string name)

    MessageDialog {
        id: errorDialog
        title: qsTr("Error")
        visible: false

        function showError(message) {
            text = message
            open()
        }
    }

    function validateName(name) {
        var profile_list = appSettings.profilesList
        if (name === "")
            return 1
        return 0
    }

    ColumnLayout {
        anchors.margins: 10
        anchors.fill: parent
        RowLayout {
            Label {
                text: qsTr("Name")
            }
            TextField {
                id: namefield
                Layout.fillWidth: true
                Component.onCompleted: forceActiveFocus()
                onAccepted: okbutton.clickAction()
            }
        }
        RowLayout {
            Layout.alignment: Qt.AlignBottom | Qt.AlignRight
            Button {
                id: okbutton
                text: qsTr("OK")
                onClicked: clickAction()
                function clickAction() {
                    var name = namefield.text
                    switch (validateName(name)) {
                    case 1:
                        errorDialog.showError(
                                    qsTr("The name you inserted is empty. Please choose a different one."))
                        break
                    default:
                        nameSelected(name)
                        close()
                    }
                }
            }
            Button {
                text: qsTr("Cancel")
                onClicked: close()
            }
        }
    }
}


================================================
FILE: app/qml/PreprocessedTerminal.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.0

import QMLTermWidget 2.0

import "menus"
import "utils.js" as Utils

Item{
    id: terminalContainer
    signal sessionFinished()

    property size virtualResolution: Qt.size(kterminal.totalWidth, kterminal.totalHeight)
    property alias mainTerminal: kterminal

    property ShaderEffectSource mainSource: kterminalSource
    property BurnInEffect burnInEffect: burnInEffect
    property real fontWidth: 1.0
    property real screenScaling: 1.0
    property real scaleTexture: 1.0
    property alias title: ksession.title
    property alias kterminal: kterminal
    property bool isActive: false

    property size terminalSize: kterminal.terminalSize
    property size fontMetrics: kterminal.fontMetrics

    // Manage copy and paste
    Connections {
        target: copyAction

        onTriggered: {
            if (terminalContainer.isActive) {
                kterminal.copyClipboard()
            }
        }
    }
    Connections {
        target: pasteAction

        onTriggered: {
            if (terminalContainer.isActive) {
                kterminal.pasteClipboard()
            }
        }
    }

    //When settings are updated sources need to be redrawn.
    Connections {
        target: appSettings

        onFontScalingChanged: {
            terminalContainer.updateSources()
        }

        onFontWidthChanged: {
            terminalContainer.updateSources()
        }
    }
    Connections {
        target: terminalContainer

        onWidthChanged: {
            terminalContainer.updateSources()
        }

        onHeightChanged: {
            terminalContainer.updateSources()
        }
    }

    function updateSources() {
        kterminal.update()
    }

    QMLTermWidget {
        id: kterminal

        property int textureResolutionScale: appSettings.lowResolutionFont ? Screen.devicePixelRatio : 1
        property int margin: appSettings.margin / screenScaling
        property int totalWidth: Math.floor(parent.width / (screenScaling * fontWidth))
        property int totalHeight: Math.floor(parent.height / screenScaling)

        property int rawWidth: totalWidth - 2 * margin
        property int rawHeight: totalHeight - 2 * margin

        textureSize: Qt.size(width / textureResolutionScale, height / textureResolutionScale)

        width: ensureMultiple(rawWidth, Screen.devicePixelRatio)
        height: ensureMultiple(rawHeight, Screen.devicePixelRatio)

        /** Ensure size is a multiple of factor. This is needed for pixel perfect scaling on highdpi screens. */
        function ensureMultiple(size, factor) {
            return Math.round(size / factor) * factor;
        }

        fullCursorHeight: true
        blinkingCursor: appSettings.blinkingCursor

        colorScheme: "cool-retro-term"

        session: QMLTermSession {
            id: ksession

            onFinished: {
                terminalContainer.sessionFinished()
            }
        }

        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"
                opacity: 0.7
            }
        }

        function handleFontChanged(fontFamily, pixelSize, lineSpacing, screenScaling, fontWidth, fallbackFontFamily, lowResolutionFont) {
            kterminal.lineSpacing = lineSpacing;
            kterminal.antialiasText = !lowResolutionFont;
            kterminal.smooth = !lowResolutionFont;
            kterminal.enableBold = !lowResolutionFont;
            kterminal.enableItalic = !lowResolutionFont;

            kterminal.font = Qt.font({
                family: fontFamily,
                pixelSize: pixelSize
            });

            terminalContainer.fontWidth = fontWidth;
            terminalContainer.screenScaling = screenScaling;
            scaleTexture = Math.max(1.0, Math.floor(screenScaling * appSettings.windowScaling));
        }

        Connections {
            target: appSettings

            onWindowScalingChanged: {
                scaleTexture = Math.max(1.0, Math.floor(terminalContainer.screenScaling * appSettings.windowScaling));
            }
        }

        function startSession() {
            // Retrieve the variable set in main.cpp if arguments are passed.
            if (defaultCmd) {
                ksession.setShellProgram(defaultCmd);
                ksession.setArgs(defaultCmdArgs);
            } else if (appSettings.useCustomCommand) {
                var args = Utils.tokenizeCommandLine(appSettings.customCommand);
                ksession.setShellProgram(args[0]);
                ksession.setArgs(args.slice(1));
            } else if (!defaultCmd && appSettings.isMacOS) {
                // OSX Requires the following default parameters for auto login.
                ksession.setArgs(["-i", "-l"]);
            }

            if (workdir)
                ksession.initialWorkingDirectory = workdir;

            ksession.startShellProgram();
            forceActiveFocus();
        }
        Component.onCompleted: {
            appSettings.fontManager.terminalFontChanged.connect(handleFontChanged);
            appSettings.fontManager.refresh()
            startSession();
        }
        Component.onDestruction: {
            appSettings.fontManager.terminalFontChanged.disconnect(handleFontChanged);
        }
    }

    Component {
        id: shortContextMenu
        ShortContextMenu { }
    }

    Component {
        id: fullContextMenu
        FullContextMenu { }
    }

    Loader {
        id: menuLoader
        sourceComponent: (appSettings.isMacOS || (appSettings.showMenubar && !terminalWindow.fullscreen) ? shortContextMenu : fullContextMenu)
    }
    property alias contextmenu: menuLoader.item

    MouseArea {
        property real margin: appSettings.margin
        property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale

        acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
        anchors.fill: parent
        cursorShape: kterminal.terminalUsesMouse ? Qt.ArrowCursor : Qt.IBeamCursor
        onWheel: function(wheel) {
            if (wheel.modifiers & Qt.ControlModifier) {
               wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
            } else {
                var coord = correctDistortion(wheel.x, wheel.y);
                kterminal.simulateWheel(coord.x, coord.y, wheel.buttons, wheel.modifiers, wheel.angleDelta);
            }
        }
        onDoubleClicked: function(mouse) {
            var coord = correctDistortion(mouse.x, mouse.y);
            kterminal.simulateMouseDoubleClick(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
        }
        onPressed: function(mouse) {
            kterminal.forceActiveFocus()
            if ((!kterminal.terminalUsesMouse || mouse.modifiers & Qt.ShiftModifier) && mouse.button == Qt.RightButton) {
                contextmenu.popup();
            } else {
                var coord = correctDistortion(mouse.x, mouse.y);
                kterminal.simulateMousePress(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers)
            }
        }
        onReleased: function(mouse) {
            var coord = correctDistortion(mouse.x, mouse.y);
            kterminal.simulateMouseRelease(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
        }
        onPositionChanged: function(mouse) {
            var coord = correctDistortion(mouse.x, mouse.y);
            kterminal.simulateMouseMove(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
        }

        function correctDistortion(x, y) {
            x = (x - margin) / width;
            y = (y - margin) / height;

            x = x * (1 + frameSize * 2) - frameSize;
            y = y * (1 + frameSize * 2) - frameSize;

            var cc = Qt.size(0.5 - x, 0.5 - y);
            var distortion = (cc.height * cc.height + cc.width * cc.width)
                    * appSettings.screenCurvature * appSettings.screenCurvatureSize
                    * terminalWindow.normalizedWindowScale;

            return Qt.point((x - cc.width  * (1+distortion) * distortion) * (kterminal.totalWidth),
                           (y - cc.height * (1+distortion) * distortion) * (kterminal.totalHeight))
        }
    }
    ShaderEffectSource{
        id: kterminalSource
        sourceItem: kterminal
        hideSource: true
        wrapMode: ShaderEffectSource.Repeat
        visible: false
        textureSize: Qt.size(kterminal.totalWidth * scaleTexture, kterminal.totalHeight * scaleTexture)
        sourceRect: Qt.rect(-kterminal.margin, -kterminal.margin, kterminal.totalWidth, kterminal.totalHeight)
    }

    Item {
        id: burnInContainer

        property int burnInScaling: scaleTexture * appSettings.burnInQuality

        width: Math.round(appSettings.lowResolutionFont
               ? kterminal.totalWidth * Math.max(1, burnInScaling)
               : kterminal.totalWidth * scaleTexture * appSettings.burnInQuality)

        height: Math.round(appSettings.lowResolutionFont
                ? kterminal.totalHeight * Math.max(1, burnInScaling)
                : kterminal.totalHeight * scaleTexture * appSettings.burnInQuality)


        BurnInEffect {
            id: burnInEffect
        }
    }
}


================================================
FILE: app/qml/SettingsAdvancedTab.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.0
import QtQuick.Layouts 1.1
import QtQml 2.0

import "Components"

ColumnLayout {
    GroupBox {
        Layout.fillWidth: true
        Layout.fillHeight: true
        title: qsTr("Miscellaneous")
        padding: appSettings.defaultMargin

        ColumnLayout {
            anchors.fill: parent
            CheckBox {
                id: useCustomCommand
                text: qsTr("Use custom command instead of shell at startup")
                checked: appSettings.useCustomCommand
                onCheckedChanged: appSettings.useCustomCommand = checked
            }
            TextField {
                id: customCommand
                Layout.fillWidth: true
                text: appSettings.customCommand
                enabled: useCustomCommand.checked
                onEditingFinished: appSettings.customCommand = text

                // Save text even if user forgets to press enter or unfocus
                function saveSetting() {
                    appSettings.customCommand = text
                }
                Component.onCompleted: settings_window.closing.connect(
                                           saveSetting)
            }
            CheckBox {
                id: blinkingCursor
                text: qsTr("Blinking Cursor")
                checked: appSettings.blinkingCursor
                onCheckedChanged: appSettings.blinkingCursor = checked
            }
            CheckBox {
                id: showMenubar
                text: qsTr("Show Menubar")
                enabled: !appSettings.isMacOS
                checked: appSettings.showMenubar
                onCheckedChanged: appSettings.showMenubar = checked
            }
        }
    }

    GroupBox {
        title: qsTr("Performance")
        Layout.fillWidth: true
        Layout.fillHeight: true
        padding: appSettings.defaultMargin
        GridLayout {
            anchors.fill: parent
            columns: 4

            Label {
                text: qsTr("Effects FPS")
            }
            Slider {
                Layout.fillWidth: true
                Layout.columnSpan: 2
                id: effectsFpsSlider
                onValueChanged: appSettings.effectsFrameSkip = Math.round(value)
                stepSize: 1
                enabled: true
                from: 5
                to: 1
                value: appSettings.effectsFrameSkip
            }

            SizedLabel {
                text: Math.round(100 / Math.max(1, Math.round(effectsFpsSlider.value))) + "%"
            }
            Label {
                text: qsTr("Texture Quality")
            }
            Slider {
                id: txtslider
                Layout.fillWidth: true
                Layout.columnSpan: 2
                onValueChanged: appSettings.windowScaling = value
                stepSize: 0.05
                enabled: true
                from: 0.25
                value: appSettings.windowScaling
            }
            SizedLabel {
                text: Math.round(txtslider.value * 100) + "%"
            }

            Label {
                text: qsTr("Bloom Quality")
            }
            Slider {
                Layout.fillWidth: true
                Layout.columnSpan: 2
                id: bloomSlider
                onValueChanged: appSettings.bloomQuality = value
                stepSize: 0.05
                enabled: true
                from: 0.25
                value: appSettings.bloomQuality
            }
            SizedLabel {
                text: Math.round(bloomSlider.value * 100) + "%"
            }

            Label {
                text: qsTr("BurnIn Quality")
            }
            Slider {
                Layout.fillWidth: true
                id: burnInSlider
                Layout.columnSpan: 2
                onValueChanged: appSettings.burnInQuality = value
                stepSize: 0.05
                enabled: true
                from: 0.25
                value: appSettings.burnInQuality
            }
            SizedLabel {
                text: Math.round(burnInSlider.value * 100) + "%"
            }
        }
    }
}


================================================
FILE: app/qml/SettingsEffectsTab.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.0
import QtQuick.Layouts 1.1

ColumnLayout {
    Layout.fillWidth: true
    Layout.fillHeight: true
    spacing: 2

    GroupBox {
        title: qsTr("Effects")
        Layout.fillWidth: true
        Layout.fillHeight: true
        padding: appSettings.defaultMargin

        ColumnLayout {
            anchors.fill: parent

            CheckableSlider {
                name: qsTr("Bloom")
                onNewValue: function(newValue) { appSettings.bloom = newValue }
                value: appSettings.bloom
            }
            CheckableSlider {
                name: qsTr("BurnIn")
                onNewValue: function(newValue) { appSettings.burnIn = newValue }
                value: appSettings.burnIn
            }
            CheckableSlider {
                name: qsTr("Static Noise")
                onNewValue: function(newValue) { appSettings.staticNoise = newValue }
                value: appSettings.staticNoise
            }
            CheckableSlider {
                name: qsTr("Jitter")
                onNewValue: function(newValue) { appSettings.jitter = newValue }
                value: appSettings.jitter
            }
            CheckableSlider {
                name: qsTr("Glow Line")
                onNewValue: function(newValue) { appSettings.glowingLine = newValue }
                value: appSettings.glowingLine
            }
            CheckableSlider {
                name: qsTr("Screen Curvature")
                onNewValue: function(newValue) { appSettings.screenCurvature = newValue }
                value: appSettings.screenCurvature
            }
            CheckableSlider {
                name: qsTr("Ambient Light")
                onNewValue: function(newValue) { appSettings.ambientLight = newValue }
                value: appSettings.ambientLight
                enabled: appSettings.framesIndex !== 0
            }
            CheckableSlider {
                name: qsTr("Flickering")
                onNewValue: function(newValue) { appSettings.flickering = newValue }
                value: appSettings.flickering
            }
            CheckableSlider {
                name: qsTr("Horizontal Sync")
                onNewValue: function(newValue) { appSettings.horizontalSync = newValue }
                value: appSettings.horizontalSync
            }
            CheckableSlider {
                name: qsTr("RGB Shift")
                onNewValue: function(newValue) { appSettings.rgbShift = newValue }
                value: appSettings.rgbShift
            }
            CheckableSlider {
                name: qsTr("Frame Shininess")
                onNewValue: function(newValue) { appSettings._frameShininess = newValue }
                value: appSettings._frameShininess
            }
        }
    }
}


================================================
FILE: app/qml/SettingsGeneralTab.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs

ColumnLayout {
    GroupBox {
        Layout.fillWidth: true
        Layout.fillHeight: true
        title: qsTr("Profile")
        padding: appSettings.defaultMargin
        RowLayout {
            anchors.fill: parent
            ListView {
                id: profilesView
                Layout.fillWidth: true
                Layout.fillHeight: true
                model: appSettings.profilesList
                clip: true
                delegate: Rectangle {
                    width: label.width
                    height: label.height
                    color: (index == profilesView.currentIndex) ? palette.highlight : palette.base
                    Label {
                        id: label
                        text: appSettings.profilesList.get(index).text
                        MouseArea {
                            anchors.fill: parent
                            onClicked: profilesView.currentIndex = index
                            onDoubleClicked: appSettings.loadProfile(index)
                        }
                    }
                }
            }
            ColumnLayout {
                Layout.fillHeight: true
                Layout.fillWidth: false
                Button {
                    Layout.fillWidth: true
                    text: qsTr("Save")
                    onClicked: {
                        insertname.profileName = ""
                        insertname.show()
                    }
                }
                Button {
                    Layout.fillWidth: true
                    property alias currentIndex: profilesView.currentIndex
                    enabled: currentIndex >= 0
                    text: qsTr("Load")
                    onClicked: {
                        var index = currentIndex
                        if (index >= 0)
                            appSettings.loadProfile(index)
                    }
                }
                Button {
                    Layout.fillWidth: true
                    text: qsTr("Remove")
                    property alias currentIndex: profilesView.currentIndex

                    enabled: currentIndex >= 0 && !appSettings.profilesList.get(
                                 currentIndex).builtin
                    onClicked: {
                        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"

                            var version = profileObject.version
                                    !== undefined ? profileObject.version : 1
                            if (version !== appSettings.profileVersion)
                                throw "This profile is not supported on this version of CRT."

                            delete profileObject.name

                            appSettings.appendCustomProfile(name,
                                                            JSON.stringify(
                                                                profileObject))
                        } catch (err) {
                            messageDialog.text = qsTr(err)
                            messageDialog.open()
                        }
                    }
                }
                Button {
                    property alias currentIndex: profilesView.currentIndex

                    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
                            profileSettings["version"] = appSettings.profileVersion

                            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()
                        }
                    }
                }
            }
        }
    }

    GroupBox {
        title: qsTr("Screen")
        Layout.fillWidth: true
        Layout.fillHeight: true
        padding: appSettings.defaultMargin
        GridLayout {
            anchors.fill: parent
            columns: 2
            Label {
                text: qsTr("Brightness")
            }
            SimpleSlider {
                onValueChanged: appSettings.brightness = value
                value: appSettings.brightness
            }
            Label {
                text: qsTr("Contrast")
            }
            SimpleSlider {
                onValueChanged: appSettings.contrast = value
                value: appSettings.contrast
            }
            Label {
                text: qsTr("Margin")
            }
            SimpleSlider {
                onValueChanged: appSettings._margin = value
                value: appSettings._margin
            }
            Label {
                text: qsTr("Radius")
            }
            SimpleSlider {
                onValueChanged: appSettings._screenRadius = value
                value: appSettings._screenRadius
            }
            Label {
                text: qsTr("Frame size")
            }
            SimpleSlider {
                onValueChanged: appSettings._frameSize = value
                value: appSettings._frameSize
            }
            Label {
                text: qsTr("Opacity")
                visible: !appSettings.isMacOS
            }
            SimpleSlider {
                onValueChanged: appSettings.windowOpacity = value
                value: appSettings.windowOpacity
                visible: !appSettings.isMacOS
            }
        }
    }

    // DIALOGS ////////////////////////////////////////////////////////////////
    InsertNameDialog {
        id: insertname
        onNameSelected: {
            appSettings.appendCustomProfile(name,
                                            appSettings.composeProfileString())
        }
    }
    MessageDialog {
        id: messageDialog
        title: qsTr("File Error")
        buttons: MessageDialog.Ok
        onAccepted: {
            messageDialog.close()
        }
    }
    Loader {
        property var callBack
        property bool selectExisting: false
        id: fileDialog

        sourceComponent: FileDialog {
            nameFilters: ["Json files (*.json)"]
            fileMode: fileDialog.selectExisting ? FileDialog.OpenFile : FileDialog.SaveFile
            onAccepted: callBack(selectedFile)
        }

        onSelectExistingChanged: reload()

        function open() {
            item.open()
        }

        function reload() {
            active = false
            active = true
        }
    }
}


================================================
FILE: app/qml/SettingsTerminalTab.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.1
import QtQuick.Layouts 1.1
import QtQml 2.0

import "Components"

ColumnLayout {
    GroupBox {
        title: qsTr("Font")
        Layout.fillWidth: true
        Layout.fillHeight: true
        padding: appSettings.defaultMargin
        GridLayout {
            anchors.fill: parent
            columns: 2
            Label {
                text: qsTr("Source")
            }
            RowLayout {
                Layout.fillWidth: true
                RadioButton {
                    text: qsTr("Bundled")
                    checked: appSettings.fontSource === appSettings.bundled_fonts
                    onClicked: {
                        appSettings.fontSource = appSettings.bundled_fonts
                    }
                }
                RadioButton {
                    text: qsTr("System")
                    checked: appSettings.fontSource === appSettings.system_fonts
                    onClicked: {
                        appSettings.fontSource = appSettings.system_fonts
                    }
                }
            }
            Label {
                text: qsTr("Rendering")
                enabled: appSettings.fontSource === appSettings.bundled_fonts
            }
            ComboBox {
                id: renderingBox

                property string selectedElement: model[currentIndex]

                Layout.fillWidth: true
                model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels"), qsTr("Sub-Pixels"), qsTr("Modern")]
                currentIndex: appSettings.rasterization
                onCurrentIndexChanged: {
                    appSettings.rasterization = currentIndex
                }
                enabled: appSettings.fontSource === appSettings.bundled_fonts
            }
            Label {
                text: qsTr("Name")
            }
            ComboBox {
                id: fontChanger
                Layout.fillWidth: true
                model: appSettings.filteredFontList
                textRole: "text"
                onActivated: {
                    var font = appSettings.filteredFontList.get(currentIndex)

                    // If selecting a high-res font while not in Modern mode,
                    // switch to Modern to render at full resolution.
                    if (!font.lowResolutionFont && appSettings.rasterization !== appSettings.modern_rasterization) {
                        appSettings.rasterization = appSettings.modern_rasterization
                    }
                    // If selecting a low-res font while in Modern mode, switch back to default.
                    if (font.lowResolutionFont && appSettings.rasterization === appSettings.modern_rasterization) {
                        appSettings.rasterization = appSettings.no_rasterization
                    }

                    appSettings.fontName = font.name
                }
                function updateIndex() {
                    for (var i = 0; i < appSettings.filteredFontList.count; i++) {
                        var font = appSettings.filteredFontList.get(i)
                        if (font.name === appSettings.fontName) {
                            currentIndex = i
                            return
                        }
                    }
                    currentIndex = 0
                }
                Connections {
                    target: appSettings.fontManager

                    onTerminalFontChanged: {
                        fontChanger.updateIndex()
                    }

                    onFilteredFontListChanged: {
                        fontChanger.updateIndex()
                    }
                }
                Component.onCompleted: updateIndex()
            }
            Label {
                text: qsTr("Scaling")
            }
            RowLayout {
                Layout.fillWidth: true
                Slider {
                    Layout.fillWidth: true
                    id: fontScalingChanger
                    onValueChanged: appSettings.fontScaling = value
                    value: appSettings.fontScaling
                    stepSize: 0.05
                    from: appSettings.minimumFontScaling
                    to: appSettings.maximumFontScaling
                }
                SizedLabel {
                    text: Math.round(fontScalingChanger.value * 100) + "%"
                }
            }
            Label {
                text: qsTr("Font Width")
            }
            RowLayout {
                Layout.fillWidth: true
                Slider {
                    Layout.fillWidth: true
                    id: widthChanger
                    onValueChanged: appSettings.fontWidth = value
                    value: appSettings.fontWidth
                    stepSize: 0.05
                    from: 0.5
                    to: 1.5
                }
                SizedLabel {
                    text: Math.round(widthChanger.value * 100) + "%"
                }
            }
            Label {
                text: qsTr("Line Spacing")
            }
            RowLayout {
                Layout.fillWidth: true
                Slider {
                    Layout.fillWidth: true
                    id: lineSpacingChanger
                    onValueChanged: appSettings.lineSpacing = value
                    value: appSettings.lineSpacing
                    stepSize: 0.01
                    from: 0.0
                    to: 1.0
                }
                SizedLabel {
                    text: Math.round(lineSpacingChanger.value * 100) + "%"
                }
            }
        }
    }
    GroupBox {
        title: qsTr("Colors")
        Layout.fillWidth: true
        Layout.fillHeight: true
        padding: appSettings.defaultMargin
        ColumnLayout {
            anchors.fill: parent
            ColumnLayout {
                Layout.fillWidth: true
                CheckableSlider {
                    name: qsTr("Chroma Color")
                    onNewValue: function(newValue) { appSettings.chromaColor = newValue }
                    value: appSettings.chromaColor
                }
                CheckableSlider {
                    name: qsTr("Saturation Color")
                    onNewValue: function(newValue) { appSettings.saturationColor = newValue }
                    value: appSettings.saturationColor
                    enabled: appSettings.chromaColor !== 0
                }
            }
            RowLayout {
                Layout.fillWidth: true
                ColorButton {
                    name: qsTr("Font")
                    height: 50
                    Layout.fillWidth: true
                    onColorSelected: appSettings._fontColor = color
                    color: appSettings._fontColor
                }
                ColorButton {
                    name: qsTr("Background")
                    height: 50
                    Layout.fillWidth: true
                    onColorSelected: appSettings._backgroundColor = color
                    color: appSettings._backgroundColor
                }
                ColorButton {
                    name: qsTr("Frame")
                    height: 50
                    Layout.fillWidth: true
                    onColorSelected: appSettings._frameColor = color
                    color: appSettings._frameColor
                }
            }
        }
    }
}


================================================
FILE: app/qml/SettingsWindow.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.1
import QtQuick.Window 2.1
import QtQuick.Layouts 1.3
import QtQuick.Dialogs

ApplicationWindow {
    readonly property real tabButtonPadding: 10

    id: settings_window
    title: qsTr("Settings")
    width: 640
    height: 520

    Item {
        anchors { fill: parent; }

        TabBar {
            id: bar
            anchors { left: parent.left; right: parent.right; top: parent.top; }
            TabButton {
                padding: tabButtonPadding
                text: qsTr("General")
            }
            TabButton {
                padding: tabButtonPadding
                text: qsTr("Terminal")
            }
            TabButton {
                padding: tabButtonPadding
                text: qsTr("Effects")
            }
            TabButton {
                padding: tabButtonPadding
                text: qsTr("Advanced")
            }
        }

        StackLayout {
            anchors {
                top: bar.bottom
                left: parent.left
                right: parent.right
                bottom: parent.bottom
                margins: 16
            }

            currentIndex: bar.currentIndex

            SettingsGeneralTab { }
            SettingsTerminalTab { }
            SettingsEffectsTab { }
            SettingsAdvancedTab { }
        }
    }
}


================================================
FILE: app/qml/ShaderTerminal.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 "utils.js" as Utils

Item {
    function dynamicFragmentPath() {
        var rasterMode = appSettings.rasterization;
        var burnInOn = appSettings.burnIn > 0 ? 1 : 0;
        var frameOn = appSettings.frameEnabled ? 1 : 0;
        var chromaOn = appSettings.chromaColor > 0 ? 1 : 0;
        return "qrc:/shaders/terminal_dynamic_raster" + rasterMode +
               "_burn" + burnInOn +
               "_frame" + frameOn +
               "_chroma" + chromaOn +
               ".frag.qsb";
    }

    function staticFragmentPath() {
        var rgbShiftOn = appSettings.rgbShift > 0 ? 1 : 0;
        var bloomOn = appSettings.bloom > 0 ? 1 : 0;
        var curvatureOn = (appSettings.screenCurvature > 0 || appSettings.frameSize > 0) ? 1 : 0;
        var shineOn = appSettings.frameShininess > 0 ? 1 : 0;
        return "qrc:/shaders/terminal_static_rgb" + rgbShiftOn +
               "_bloom" + bloomOn +
               "_curve" + curvatureOn +
               "_shine" + shineOn +
               ".frag.qsb";
    }

    property ShaderEffectSource source
    property BurnInEffect burnInEffect
    property ShaderEffectSource bloomSource

    property color fontColor: appSettings.fontColor
    property color backgroundColor: appSettings.backgroundColor

    property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize * terminalWindow.normalizedWindowScale
    property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale

    property real chromaColor: appSettings.chromaColor

    property real ambientLight: appSettings.ambientLight * 0.2

    property size virtualResolution
    property size screenResolution

    property real _screenDensity: Math.min(
        screenResolution.width / virtualResolution.width,
        screenResolution.height / virtualResolution.height
    )

    ShaderEffect {
        id: dynamicShader

        property ShaderEffectSource screenBuffer: frameBuffer
        property ShaderEffectSource burnInSource: burnInEffect.effectSource
        property ShaderEffectSource frameSource: terminalFrameLoader.item

        property color fontColor: parent.fontColor
        property color backgroundColor: parent.backgroundColor
        property real screenCurvature: parent.screenCurvature
        property real chromaColor: parent.chromaColor
        property real ambientLight: parent.ambientLight

        property real flickering: appSettings.flickering
        property real horizontalSync: appSettings.horizontalSync
        property real horizontalSyncStrength: Utils.lint(0.05, 0.35, horizontalSync)
        property real glowingLine: appSettings.glowingLine * 0.2

        // Fast burnin properties
        property real burnIn: appSettings.burnIn
        property real burnInLastUpdate: burnInEffect.lastUpdate
        property real burnInTime: burnInEffect.burnInFadeTime

        property real jitter: appSettings.jitter
        property size jitterDisplacement: Qt.size(0.007 * jitter, 0.002 * jitter)
        property real staticNoise: appSettings.staticNoise
        property size scaleNoiseSize: Qt.size((width * 0.75) / (noiseTexture.width * appSettings.windowScaling * appSettings.totalFontScaling),
                                              (height * 0.75) / (noiseTexture.height * appSettings.windowScaling * appSettings.totalFontScaling))

        property size virtualResolution: parent.virtualResolution

        // Rasterization might display oversamping issues if virtual resolution is close to physical display resolution.
        // We progressively disable rasterization from 4x up to 2x resolution.
        property real rasterizationIntensity: Utils.smoothstep(2.0, 4.0, _screenDensity)

        property real time: timeManager ? timeManager.time : 0
        property ShaderEffectSource noiseSource: noiseShaderSource

        property real frameSize: parent.frameSize
        property real frameShininess: appSettings.frameShininess
        property real bloom: parent.bloomSource ? appSettings.bloom * 2.5 : 0

        anchors.fill: parent
        blending: false

        Image {
            id: noiseTexture
            source: "images/allNoise512.png"
            width: 512
            height: 512
            fillMode: Image.Tile
            visible: false
        }
        ShaderEffectSource {
            id: noiseShaderSource
            sourceItem: noiseTexture
            wrapMode: ShaderEffectSource.Repeat
            visible: false
            smooth: true
        }

        vertexShader: "qrc:/shaders/terminal_dynamic.vert.qsb"
        fragmentShader: dynamicFragmentPath()

        onStatusChanged: if (log) console.log(log)
    }

    Loader {
        id: terminalFrameLoader

        active: appSettings.frameEnabled

        width: staticShader.width
        height: staticShader.height

        sourceComponent: ShaderEffectSource {

            sourceItem: terminalFrame
            hideSource: true
            visible: false
            format: ShaderEffectSource.RGBA

            TerminalFrame {
                id: terminalFrame
                blending: false
                anchors.fill: parent
            }
        }
    }

    ShaderEffect {
        id: staticShader

        width: parent.width * appSettings.windowScaling
        height: parent.height * appSettings.windowScaling

        property ShaderEffectSource source: parent.source
        property ShaderEffectSource bloomSource: parent.bloomSource

        property color fontColor: parent.fontColor
        property color backgroundColor: parent.backgroundColor
        property real bloom: bloomSource ? appSettings.bloom * 2.5 : 0

        property real screenCurvature: parent.screenCurvature

        property real chromaColor: appSettings.chromaColor;

        property real rgbShift: appSettings.rgbShift * (4.0 / width) * appSettings.totalFontScaling

        property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
        property real frameShininess: appSettings.frameShininess
        property real frameSize: parent.frameSize

        blending: false
        visible: false

        vertexShader: "qrc:/shaders/terminal_static.vert.qsb"
        fragmentShader: staticFragmentPath()

        onStatusChanged: if (log) console.log(log)
    }

    ShaderEffectSource {
        id: frameBuffer
        visible: false
        sourceItem: staticShader
        hideSource: true
    }
}


================================================
FILE: app/qml/SimpleSlider.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 2.0
import QtQuick.Layouts 1.1

import "Components"

RowLayout {
    property alias value: slider.value
    property alias stepSize: slider.stepSize
    property alias minimumValue: slider.from
    property alias maximumValue: slider.to
    property real maxMultiplier: 100

    id: setting_component
    spacing: 10
    Slider {
        id: slider
        stepSize: parent.stepSize
        Layout.fillWidth: true
    }
    SizedLabel {
        text: Math.round(value * maxMultiplier) + "%"
    }
}


================================================
FILE: app/qml/SizeOverlay.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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

Rectangle {
    property size terminalSize
    property real topOpacity: 0.5

    width: textSize.width * 2
    height: textSize.height * 2
    radius: 5
    color: "black"
    opacity: sizetimer.running ? 0.5 : 0.0

    Behavior on opacity {
        NumberAnimation {
            duration: 200
        }
    }

    onTerminalSizeChanged: sizetimer.restart()

    Text {
        id: textSize
        anchors.centerIn: parent
        color: "white"
        text: terminalSize.width + "x" + terminalSize.height
    }
    Timer {
        id: sizetimer
        interval: 1000
        running: false
    }
}


================================================
FILE: app/qml/Storage.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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.LocalStorage 2.0

QtObject {
    readonly property string dbMajorVersion: "2"
    readonly property string dbMinorVersion: "1.0"
    property bool initialized: false

    function getDatabase() {
         return LocalStorage.openDatabaseSync("coolretroterm" + dbMajorVersion, dbMinorVersion, "StorageDatabase", 100000)
    }

    function initialize() {
        var db = getDatabase();
        db.transaction(
            function(tx) {
                tx.executeSql('CREATE TABLE IF NOT EXISTS settings(setting TEXT UNIQUE, value TEXT)');
            }
        )

        initialized = true
    }

    function setSetting(setting, value) {
        if(!initialized) initialize();

        var db = getDatabase();
        var res = "";
        db.transaction(
            function(tx) {
                var rs = tx.executeSql('INSERT OR REPLACE INTO settings VALUES (?,?);', [setting,value]);
                //console.log(rs.rowsAffected)
                if (rs.rowsAffected > 0) {
                    res = "OK";
                } else {
                    res = "Error";
                }
           }
      )
      // The function returns “OK” if it was successful, or “Error” if it wasn't
      return res
    }

    function getSetting(setting) {
        if(!initialized) initialize();
        var db = getDatabase();
        var res = "";
        db.transaction(
            function(tx) {
                var rs = tx.executeSql('SELECT value FROM settings WHERE setting=?;', [setting]);
                if (rs.rows.length > 0) {
                res = rs.rows.item(0).value;
                } else {
                res = undefined;
                }
            }
        )
        return res
    }

    function dropSettings(){
        var db = getDatabase();
        db.transaction(
            function(tx) {
                tx.executeSql('DROP TABLE settings');
            }
        )
    }
}


================================================
FILE: app/qml/TerminalContainer.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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 Qt5Compat.GraphicalEffects

import "utils.js" as Utils

ShaderTerminal {
    property alias title: terminal.title
    property alias terminalSize: terminal.terminalSize
    property bool isActive: false
    signal sessionFinished()

    property bool loadBloomEffect: appSettings.bloom > 0 || appSettings._frameShininess > 0

    id: mainShader
    opacity: appSettings.windowOpacity * 0.3 + 0.7

    source: terminal.mainSource
    burnInEffect: terminal.burnInEffect
    virtualResolution: terminal.virtualResolution
    screenResolution: Qt.size(
        terminalWindow.width * Screen.devicePixelRatio * appSettings.windowScaling,
        terminalWindow.height * Screen.devicePixelRatio * appSettings.windowScaling
    )
    bloomSource: bloomSourceLoader.item

    PreprocessedTerminal {
        id: terminal
        anchors.fill: parent
        isActive: mainShader.isActive
        onSessionFinished: mainShader.sessionFinished()
    }

    function activate() {
        terminal.mainTerminal.forceActiveFocus()
    }

    //  EFFECTS  ////////////////////////////////////////////////////////////////
    Loader {
        id: bloomEffectLoader
        active: loadBloomEffect
        asynchronous: true
        width: parent.width * appSettings.bloomQuality
        height: parent.height * appSettings.bloomQuality

        sourceComponent: FastBlur {
            radius: Utils.lint(16, 64, appSettings.bloomQuality)
            source: terminal.mainSource
            transparentBorder: true
        }
    }
    Loader {
        id: bloomSourceLoader
        active: loadBloomEffect
        asynchronous: true
        sourceComponent: ShaderEffectSource {
            id: _bloomEffectSource
            sourceItem: bloomEffectLoader.item
            wrapMode: ShaderEffectSource.Repeat
            hideSource: true
            smooth: true
            visible: false
        }
    }
}


================================================
FILE: app/qml/TerminalFrame.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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.0

import "utils.js" as Utils

ShaderEffect {
    property color _staticFrameColor: Utils.sum(appSettings.frameColor, Qt.rgba(0.1, 0.1, 0.1, 1.0))
    property color _backgroundColor: appSettings.backgroundColor
    property color _fontColor: appSettings.fontColor
    property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)

    property color frameColor: Utils.mix(
        Utils.scaleColor(_lightColor, 0.2),
        _staticFrameColor,
        0.125 + 0.750 * ambientLight
    )

    property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize * terminalWindow.normalizedWindowScale

    property real frameShininess: appSettings.frameShininess

    property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale

    property real screenRadius: appSettings.screenRadius

    property size viewportSize: Qt.size(width / appSettings.windowScaling, height / appSettings.windowScaling)

    property real ambientLight: appSettings.ambientLight

    vertexShader: "qrc:/shaders/terminal_frame.vert.qsb"
    fragmentShader: "qrc:/shaders/terminal_frame.frag.qsb"

    onStatusChanged: if (log) console.log(log) //Print warning messages
}


================================================
FILE: app/qml/TerminalTabs.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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
import QtQuick.Controls
import QtQuick.Layouts
import QtQml.Models

Item {
    id: tabsRoot

    readonly property int innerPadding: 6
    readonly property string currentTitle: tabsModel.get(currentIndex).title ?? "cool-retro-term"
    property alias currentIndex: tabBar.currentIndex
    readonly property int count: tabsModel.count
    property size terminalSize: Qt.size(0, 0)

    function normalizeTitle(rawTitle) {
        if (rawTitle === undefined || rawTitle === null) {
            return ""
        }
        return String(rawTitle).trim()
    }

    function addTab() {
        tabsModel.append({ title: "" })
        tabBar.currentIndex = tabsModel.count - 1
    }

    function closeTab(index) {
        if (tabsModel.count <= 1) {
            terminalWindow.close()
            return
        }

        tabsModel.remove(index)
        tabBar.currentIndex = Math.min(tabBar.currentIndex, tabsModel.count - 1)
    }

    ListModel {
        id: tabsModel
    }

    Component.onCompleted: addTab()

    ColumnLayout {
        anchors.fill: parent
        spacing: 0

        Rectangle {
            id: tabRow
            Layout.fillWidth: true
            height: rowLayout.implicitHeight
            color: palette.window
            visible: tabsModel.count > 1

            RowLayout {
                id: rowLayout
                anchors.fill: parent
                spacing: 0

                TabBar {
                    id: tabBar
                    Layout.fillWidth: true
                    Layout.fillHeight: true
                    focusPolicy: Qt.NoFocus

                    Repeater {
                        model: tabsModel
                        TabButton {
                            id: tabButton
                            contentItem: RowLayout {
                                anchors.fill: parent
                                anchors { leftMargin: innerPadding; rightMargin: innerPadding }
                                spacing: innerPadding

                                Label {
                                    text: model.title
                                    elide: Text.ElideRight
                                    Layout.fillWidth: true
                                    Layout.alignment: Qt.AlignVCenter
                                }

                                ToolButton {
                                    text: "\u00d7"
                                    focusPolicy: Qt.NoFocus
                                    padding: innerPadding
                                    Layout.alignment: Qt.AlignVCenter
                                    onClicked: tabsRoot.closeTab(index)
                                }
                            }
                        }
                    }
                }

                ToolButton {
                    id: addTabButton
                    text: "+"
                    focusPolicy: Qt.NoFocus
                    Layout.fillHeight: true
                    padding: innerPadding
                    Layout.alignment: Qt.AlignVCenter
                    onClicked: tabsRoot.addTab()
                }
            }
        }

        StackLayout {
            id: stack
            Layout.fillWidth: true
            Layout.fillHeight: true
            currentIndex: tabBar.currentIndex

            Repeater {
                model: tabsModel
                TerminalContainer {
                    property bool shouldHaveFocus: terminalWindow.active && StackLayout.isCurrentItem
                    isActive: StackLayout.isCurrentItem
                    onShouldHaveFocusChanged: {
                        if (shouldHaveFocus) {
                            activate()
                        }
                    }
                    onTitleChanged: tabsModel.setProperty(index, "title", normalizeTitle(title))
                    Layout.fillWidth: true
                    Layout.fillHeight: true
                    onSessionFinished: tabsRoot.closeTab(index)
                    onTerminalSizeChanged: updateTerminalSize()

                    function updateTerminalSize() {
                        // Every tab will have the same size so we can simply take the first one.
                        if (index == 0) {
                            tabsRoot.terminalSize = terminalSize
                        }
                    }
                }
            }
        }
    }
}


================================================
FILE: app/qml/TerminalWindow.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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
import QtQuick.Window
import QtQuick.Controls

import "menus"

ApplicationWindow {
    id: terminalWindow

    width: 1024
    height: 768

    // Show the window once it is ready.
    Component.onCompleted: {
        visible = true
    }

    minimumWidth: 320
    minimumHeight: 240

    visible: false

    property bool fullscreen: false
    onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)

    menuBar: WindowMenu { }

    property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height))

    color: "#00000000"

    title: terminalTabs.currentTitle

    Action {
        id: fullscreenAction
        text: qsTr("Fullscreen")
        enabled: !appSettings.isMacOS
        shortcut: StandardKey.FullScreen
        onTriggered: fullscreen = !fullscreen
        checkable: true
        checked: fullscreen
    }
    Action {
        id: newWindowAction
        text: qsTr("New Window")
        shortcut: appSettings.isMacOS ? "Meta+N" : "Ctrl+Shift+N"
        onTriggered: appRoot.createWindow()
    }
    Action {
        id: quitAction
        text: qsTr("Quit")
        shortcut: appSettings.isMacOS ? StandardKey.Close : "Ctrl+Shift+Q"
        onTriggered: terminalWindow.close()
    }
    Action {
        id: showsettingsAction
        text: qsTr("Settings")
        onTriggered: {
            settingsWindow.show()
            settingsWindow.requestActivate()
            settingsWindow.raise()
        }
    }
    Action {
        id: copyAction
        text: qsTr("Copy")
        shortcut: appSettings.isMacOS ? StandardKey.Copy : "Ctrl+Shift+C"
    }
    Action {
        id: pasteAction
        text: qsTr("Paste")
        shortcut: appSettings.isMacOS ? StandardKey.Paste : "Ctrl+Shift+V"
    }
    Action {
        id: zoomIn
        text: qsTr("Zoom In")
        shortcut: StandardKey.ZoomIn
        onTriggered: appSettings.incrementScaling()
    }
    Action {
        id: zoomOut
        text: qsTr("Zoom Out")
        shortcut: StandardKey.ZoomOut
        onTriggered: appSettings.decrementScaling()
    }
    Action {
        id: showAboutAction
        text: qsTr("About")
        onTriggered: {
            aboutDialog.show()
            aboutDialog.requestActivate()
            aboutDialog.raise()
        }
    }
    Action {
        id: newTabAction
        text: qsTr("New Tab")
        shortcut: appSettings.isMacOS ? "Meta+T" : "Ctrl+Shift+T"
        onTriggered: terminalTabs.addTab()
    }
    Action {
        id: closeTabAction
        text: qsTr("Close Tab")
        shortcut: appSettings.isMacOS ? "Meta+W" : "Ctrl+Shift+W"
        onTriggered: terminalTabs.closeTab(terminalTabs.currentIndex)
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+1" : "Alt+1"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 0) terminalTabs.currentIndex = 0
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+2" : "Alt+2"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 1) terminalTabs.currentIndex = 1
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+3" : "Alt+3"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 2) terminalTabs.currentIndex = 2
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+4" : "Alt+4"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 3) terminalTabs.currentIndex = 3
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+5" : "Alt+5"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 4) terminalTabs.currentIndex = 4
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+6" : "Alt+6"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 5) terminalTabs.currentIndex = 5
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+7" : "Alt+7"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 6) terminalTabs.currentIndex = 6
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+8" : "Alt+8"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 7) terminalTabs.currentIndex = 7
    }
    Shortcut {
        sequence: appSettings.isMacOS ? "Meta+9" : "Alt+9"
        context: Qt.WindowShortcut
        onActivated: if (terminalTabs.count > 8) terminalTabs.currentIndex = 8
    }
    TerminalTabs {
        id: terminalTabs
        width: parent.width
        height: (parent.height + Math.abs(y))
    }
    Loader {
        anchors.centerIn: parent
        active: appSettings.showTerminalSize
        sourceComponent: SizeOverlay {
            z: 3
            terminalSize: terminalTabs.terminalSize
        }
    }
    onClosing: {
        appRoot.closeWindow(terminalWindow)
    }
}


================================================
FILE: app/qml/TimeManager.qml
================================================
/*******************************************************************************
* Copyright (c) 2013-2021 "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

QtObject {
    id: timeManager

    property bool enableTimer: false
    property real time: 0

    property int framesPerUpdate: Math.max(1, appSettings.effectsFrameSkip)
    property int _frameCounter: 0

    property var frameDriver: FrameAnimation {
        running: enableTimer
        onTriggered: {
            timeManager._frameCounter += 1

            if (timeManager._frameCounter >= timeManager.framesPerUpdate) {
                time = elapsedTime
                timeManager._frameCounter = 0
            }
        }
    }

    onEnableTimerChanged: if (!enableTimer) _frameCounter = 0
    onFramesPerUpdateChanged: _frameCounter = 0
}


================================================
FILE: app/qml/fonts/apple2/FreeLicense.txt
================================================
KREATIVE SOFTWARE RELAY FONTS FREE USE LICENSE
version 1.2f

Permission is hereby granted, free of charge, to any person or entity (the "User") obtaining a copy of the included font files (the "Software") produced by Kreative Software, to utilize, display, embed, or redistribute the Software, subject to the following conditions:

1. The User may not sell copies of the Software for a fee.

1a. The User may give away copies of the Software free of charge provided this license and any documentation is included verbatim and credit is given to Kreative Korporation or Kreative Software.

2. The User may not modify, reverse-engineer, or create any derivative works of the Software.

3. Any Software carrying the following font names or variations thereof is not covered by this license and may not be used under the terms of this license: Jewel Hill, Miss Diode n Friends, This is Beckie's font!

3a. Any Software carrying a font name ending with the string "Pro CE" is not covered by this license and may not be used under the terms of this license.

4. This license becomes null and void if any of the above conditions are not met.

5. Kreative Software reserves the right to change this license at any time without notice.

THE 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 SOFTWARE OR FROM OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: app/qml/fonts/bigblue-terminal/LICENSE.TXT
================================================
Attribution-ShareAlike 4.0 International

=======================================================================

Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.

Using Creative Commons Public Licenses

Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.

     Considerations for licensors: Our public licenses are
     intended for use by those authorized to give the public
     permission to use material in ways otherwise restricted by
     copyright and certain other rights. Our licenses are
     irrevocable. Licensors should read and understand the terms
     and conditions of the license they choose before applying it.
     Licensors should also secure all rights necessary before
     applying our licenses so that the public can reuse the
     material as expected. Licensors should clearly mark any
     material not subject to the license. This includes other CC-
     licensed material, or material used under an exception or
     limitation to copyright. More considerations for licensors:
	wiki.creativecommons.org/Considerations_for_licensors

     Considerations for the public: By using one of our public
     licenses, a licensor grants the public permission to use the
     licensed material under specified terms and conditions. If
     the licensor's permission is not necessary for any reason--for
     example, because of any applicable exception or limitation to
     copyright--then that use is not regulated by the license. Our
     licenses grant only permissions under copyright and certain
     other rights that a licensor has authority to grant. Use of
     the licensed material may still be restricted for other
     reasons, including because others have copyright or other
     rights in the material. A licensor may make special requests,
     such as asking that all changes be marked or described.
     Although not required by our licenses, you are encouraged to
     respect those requests where reasonable. More_considerations
     for the public: 
	wiki.creativecommons.org/Considerations_for_licensees

=======================================================================

Creative Commons Attribution-ShareAlike 4.0 International Public
License

By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.


Section 1 -- Definitions.

  a. Adapted Material means material subject to Copyright and Similar
     Rights that is derived from or based upon the Licensed Material
     and in which the Licensed Material is translated, altered,
     arranged, transformed, or otherwise modified in a manner requiring
     permission under the Copyright and Similar Rights held by the
     Licensor. For purposes of this Public License, where the Licensed
     Material is a musical work, performance, or sound recording,
     Adapted Material is always produced where the Licensed Material is
     synched in timed relation with a moving image.

  b. Adapter's License means the license You apply to Your Copyright
     and Similar Rights in Your contributions to Adapted Material in
     accordance with the terms and conditions of this Public License.

  c. BY-SA Compatible License means a license listed at
     creativecommons.org/compatiblelicenses, approved by Creative
     Commons as essentially the equivalent of this Public License.

  d. Copyright and Similar Rights means copyright and/or similar rights
     closely related to copyright including, without limitation,
     performance, broadcast, sound recording, and Sui Generis Database
     Rights, without regard to how the rights are labeled or
     categorized. For purposes of this Public License, the rights
     specified in Section 2(b)(1)-(2) are not Copyright and Similar
     Rights.

  e. Effective Technological Measures means those measures that, in the
     absence of proper authority, may not be circumvented under laws
     fulfilling obligations under Article 11 of the WIPO Copyright
     Treaty adopted on December 20, 1996, and/or similar international
     agreements.

  f. Exceptions and Limitations means fair use, fair dealing, and/or
     any other exception or limitation to Copyright and Similar Rights
     that applies to Your use of the Licensed Material.

  g. License Elements means the license attributes listed in the name
     of a Creative Commons Public License. The License Elements of this
     Public License are Attribution and ShareAlike.

  h. Licensed Material means the artistic or literary work, database,
     or other material to which the Licensor applied this Public
     License.

  i. Licensed Rights means the rights granted to You subject to the
     terms and conditions of this Public License, which are limited to
     all Copyright and Similar Rights that apply to Your use of the
     Licensed Material and that the Licensor has authority to license.

  j. Licensor means the individual(s) or entity(ies) granting rights
     under this Public License.

  k. Share means to provide material to the public by any means or
     process that requires permission under the Licensed Rights, such
     as reproduction, public display, public performance, distribution,
     dissemination, communication, or importation, and to make material
     available to the public including in ways that members of the
     public may access the material from a place and at a time
     individually chosen by them.

  l. Sui Generis Database Rights means rights other than copyright
     resulting from Directive 96/9/EC of the European Parliament and of
     the Council of 11 March 1996 on the legal protection of databases,
     as amended and/or succeeded, as well as other essentially
     equivalent rights anywhere in the world.

  m. You means the individual or entity exercising the Licensed Rights
     under this Public License. Your has a corresponding meaning.


Section 2 -- Scope.

  a. License grant.

       1. Subject to the terms and conditions of this Public License,
          the Licensor hereby grants You a worldwide, royalty-free,
          non-sublicensable, non-exclusive, irrevocable license to
          exercise the Licensed Rights in the Licensed Material to:

            a. reproduce and Share the Licensed Material, in whole or
               in part; and

            b. produce, reproduce, and Share Adapted Material.

       2. Exceptions and Limitations. For the avoidance of doubt, where
          Exceptions and Limitations apply to Your use, this Public
          License does not apply, and You do not need to comply with
          its terms and conditions.

       3. Term. The term of this Public License is specified in Section
          6(a).

       4. Media and formats; technical modifications allowed. The
          Licensor authorizes You to exercise the Licensed Rights in
          all media and formats whether now known or hereafter created,
          and to make technical modifications necessary to do so. The
          Licensor waives and/or agrees not to assert any right or
          authority to forbid You from making technical modifications
          necessary to exercise the Licensed Rights, including
          technical modifications necessary to circumvent Effective
          Technological Measures. For purposes of this Public License,
          simply making modifications authorized by this Section 2(a)
          (4) never produces Adapted Material.

       5. Downstream recipients.

            a. Offer from the Licensor -- Licensed Material. Every
               recipient of the Licensed Material automatically
               receives an offer from the Licensor to exercise the
               Licensed Rights under the terms and conditions of this
               Public License.

            b. Additional offer from the Licensor -- Adapted Material.
               Every recipient of Adapted Material from You
               automatically receives an offer from the Licensor to
               exercise the Licensed Rights in the Adapted Material
               under the conditions of the Adapter's License You apply.

            c. No downstream restrictions. You may not offer or impose
               any additional or different terms or conditions on, or
               apply any Effective Technological Measures to, the
               Licensed Material if doing so restricts exercise of the
               Licensed Rights by any recipient of the Licensed
               Material.

       6. No endorsement. Nothing in this Public License constitutes or
          may be construed as permission to assert or imply that You
          are, or that Your use of the Licensed Material is, connected
          with, or sponsored, endorsed, or granted official status by,
          the Licensor or others designated to receive attribution as
          provided in Section 3(a)(1)(A)(i).

  b. Other rights.

       1. Moral rights, such as the right of integrity, are not
          licensed under this Public License, nor are publicity,
          privacy, and/or other similar personality rights; however, to
          the extent possible, the Licensor waives and/or agrees not to
          assert any such rights held by the Licensor to the limited
          extent necessary to allow You to exercise the Licensed
          Rights, but not otherwise.

       2. Patent and trademark rights are not licensed under this
          Public License.

       3. To the extent possible, the Licensor waives any right to
          collect royalties from You for the exercise of the Licensed
          Rights, whether directly or through a collecting society
          under any voluntary or waivable statutory or compulsory
          licensing scheme. In all other cases the Licensor expressly
          reserves any right to collect such royalties.


Section 3 -- License Conditions.

Your exercise of the Licensed Rights is expressly made subject to the
following conditions.

  a. Attribution.

       1. If You Share the Licensed Material (including in modified
          form), You must:

            a. retain the following if it is supplied by the Licensor
               with the Licensed Material:

                 i. identification of the creator(s) of the Licensed
                    Material and any others designated to receive
                    attribution, in any reasonable manner requested by
                    the Licensor (including by pseudonym if
                    designated);

                ii. a copyright notice;

               iii. a notice that refers to this Public License;

                iv. a notice that refers to the disclaimer of
                    warranties;

                 v. a URI or hyperlink to the Licensed Material to the
                    extent reasonably practicable;

            b. indicate if You modified the Licensed Material and
               retain an indication of any previous modifications; and

            c. indicate the Licensed Material is licensed under this
               Public License, and include the text of, or the URI or
               hyperlink to, this Public License.

       2. You may satisfy the conditions in Section 3(a)(1) in any
          reasonable manner based on the medium, means, and context in
          which You Share the Licensed Material. For example, it may be
          reasonable to satisfy the conditions by providing a URI or
          hyperlink to a resource that includes the required
          information.

       3. If requested by the Licensor, You must remove any of the
          information required by Section 3(a)(1)(A) to the extent
          reasonably practicable.

  b. ShareAlike.

     In addition to the conditions in Section 3(a), if You Share
     Adapted Material You produce, the following conditions also apply.

       1. The Adapter's License You apply must be a Creative Commons
          license with the same License Elements, this version or
          later, or a BY-SA Compatible License.

       2. You must include the text of, or the URI or hyperlink to, the
          Adapter's License You apply. You may satisfy this condition
          in any reasonable manner based on the medium, means, and
          context in which You Share Adapted Material.

       3. You may not offer or impose any additional or different terms
          or conditions on, or apply any Effective Technological
          Measures to, Adapted Material that restrict exercise of the
          rights granted under the Adapter's License You apply.


Section 4 -- Sui Generis Database Rights.

Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:

  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
     to extract, reuse, reproduce, and Share all or a substantial
     portion of the contents of the database;

  b. if You include all or a substantial portion of the database
     contents in a database in which You have Sui Generis Database
     Rights, then the database in which You have Sui Generis Database
     Rights (but not its individual contents) is Adapted Material,

     including for purposes of Section 3(b); and
  c. You must comply with the conditions in Section 3(a) if You Share
     all or a substantial portion of the contents of the database.

For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.


Section 5 -- Disclaimer of Warranties and Limitation of Liability.

  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.

  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.

  c. The disclaimer of warranties and limitation of liability provided
     above shall be interpreted in a manner that, to the extent
     possible, most closely approximates an absolute disclaimer and
     waiver of all liability.


Section 6 -- Term and Termination.

  a. This Public License applies for the term of the Copyright and
     Similar Rights licensed here. However, if You fail to comply with
     this Public License, then Your rights under this Public License
     terminate automatically.

  b. Where Your right to use the Licensed Material has terminated under
     Section 6(a), it reinstates:

       1. automatically as of the date the violation is cured, provided
          it is cured within 30 days of Your discovery of the
          violation; or

       2. upon express reinstatement by the Licensor.

     For the avoidance of doubt, this Section 6(b) does not affect any
     right the Licensor may have to seek remedies for Your violations
     of this Public License.

  c. For the avoidance of doubt, the Licensor may also offer the
     Licensed Material under separate terms or conditions or stop
     distributing the Licensed Material at any time; however, doing so
     will not terminate this Public License.

  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
     License.


Section 7 -- Other Terms and Conditions.

  a. The Licensor shall not be bound by any additional or different
     terms or conditions communicated by You unless expressly agreed.

  b. Any arrangements, understandings, or agreements regarding the
     Licensed Material not stated herein are separate from and
     independent of the terms and conditions of this Public License.


Section 8 -- Interpretation.

  a. For the avoidance of doubt, this Public License does not, and
     shall not be interpreted to, reduce, limit, restrict, or impose
     conditions on any use of the Licensed Material that could lawfully
     be made without permission under this Public License.

  b. To the extent possible, if any provision of this Public License is
     deemed unenforceable, it shall be automatically reformed to the
     minimum extent necessary to make it enforceable. If the provision
     cannot be reformed, it shall be severed from this Public License
     without affecting the enforceability of the remaining terms and
     conditions.

  c. No term or condition of this Public License will be waived and no
     failure to comply consented to unless expressly agreed to by the
     Licensor.

  d. Nothing in this Public License constitutes or may be interpreted
     as a limitation upon, or waiver of, any privileges and immunities
     that apply to the Licensor or You, including from the legal
     processes of any jurisdiction or authority.


=======================================================================

Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.

Creative Commons may be contacted at creativecommons.org.



================================================
FILE: app/qml/fonts/departure-mono/LICENSE
================================================
Copyright 2022–2024 Helena Zhang (helenazhang.com).

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:
https://openfontlicense.org


-----------------------------------------------------------
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.


================================================
FILE: app/qml/fonts/fira-code/LICENSE.txt
================================================
Copyright (c) 2014, The Fira Code Project Authors (https://github.com/tonsky/FiraCode)

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.


================================================
FILE: app/qml/fonts/gohu/LICENSE
================================================
            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                    Version 2, December 2004

 Copyright (C) 2004 Sam Hocevar
  14 rue de Plaisance, 75014 Paris, France
 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FUCK YOU WANT TO. 


================================================
FILE: app/qml/fonts/greybeard/LICENSE
================================================
MIT License

Copyright (c) 2012-2015 Uwe Waldmann
Modified work Copyright 2018 Andy Walker

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.


================================================
FILE: app/qml/fonts/hack/LICENSE.txt
================================================
The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License

The work in the DejaVu project was committed to the public domain.

Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"

### MIT License

Copyright (c) 2018 Source Foundry Authors

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.

### BITSTREAM VERA LICENSE

Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:

The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.

The Font Software may be modified, altered, or added to, and in particular the design
Download .txt
gitextract_dw7tnwnr/

├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       └── release.yml
├── .gitignore
├── .gitmodules
├── README.md
├── app/
│   ├── app.pro
│   ├── fileio.cpp
│   ├── fileio.h
│   ├── fontlistmodel.cpp
│   ├── fontlistmodel.h
│   ├── fontmanager.cpp
│   ├── fontmanager.h
│   ├── icons/
│   │   └── crt.icns
│   ├── main.cpp
│   ├── qml/
│   │   ├── AboutDialog.qml
│   │   ├── ApplicationSettings.qml
│   │   ├── BurnInEffect.qml
│   │   ├── CheckableSlider.qml
│   │   ├── ColorButton.qml
│   │   ├── Components/
│   │   │   └── SizedLabel.qml
│   │   ├── InsertNameDialog.qml
│   │   ├── PreprocessedTerminal.qml
│   │   ├── SettingsAdvancedTab.qml
│   │   ├── SettingsEffectsTab.qml
│   │   ├── SettingsGeneralTab.qml
│   │   ├── SettingsTerminalTab.qml
│   │   ├── SettingsWindow.qml
│   │   ├── ShaderTerminal.qml
│   │   ├── SimpleSlider.qml
│   │   ├── SizeOverlay.qml
│   │   ├── Storage.qml
│   │   ├── TerminalContainer.qml
│   │   ├── TerminalFrame.qml
│   │   ├── TerminalTabs.qml
│   │   ├── TerminalWindow.qml
│   │   ├── TimeManager.qml
│   │   ├── fonts/
│   │   │   ├── apple2/
│   │   │   │   └── FreeLicense.txt
│   │   │   ├── bigblue-terminal/
│   │   │   │   └── LICENSE.TXT
│   │   │   ├── departure-mono/
│   │   │   │   ├── DepartureMonoNerdFontMono-Regular.otf
│   │   │   │   └── LICENSE
│   │   │   ├── fira-code/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── gohu/
│   │   │   │   └── LICENSE
│   │   │   ├── greybeard/
│   │   │   │   └── LICENSE
│   │   │   ├── hack/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── ibm-3278/
│   │   │   │   ├── LICENSE.txt
│   │   │   │   └── README.md
│   │   │   ├── iosevka/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── jetbrains-mono/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── oldschool-pc-fonts/
│   │   │   │   └── LICENSE.TXT
│   │   │   ├── opendyslexic/
│   │   │   │   ├── LICENSE.txt
│   │   │   │   └── OpenDyslexicMNerdFontMono-Regular.otf
│   │   │   ├── pet-me/
│   │   │   │   └── FreeLicense.txt
│   │   │   ├── source-code-pro/
│   │   │   │   └── LICENSE.txt
│   │   │   ├── terminus/
│   │   │   │   └── LICENSE-Terminess.txt
│   │   │   └── unscii/
│   │   │       └── LICENSE
│   │   ├── main.qml
│   │   ├── menus/
│   │   │   ├── FullContextMenu.qml
│   │   │   ├── ShortContextMenu.qml
│   │   │   └── WindowMenu.qml
│   │   ├── resources.qrc
│   │   └── utils.js
│   └── shaders/
│       ├── burn_in.frag
│       ├── burn_in.frag.qsb
│       ├── burn_in.vert
│       ├── burn_in.vert.qsb
│       ├── passthrough.vert
│       ├── passthrough.vert.qsb
│       ├── terminal_dynamic.frag
│       ├── terminal_dynamic.vert
│       ├── terminal_dynamic.vert.qsb
│       ├── terminal_dynamic_raster0_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster0_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster0_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster0_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster0_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster0_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster0_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster0_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster1_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster1_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster1_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster1_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster1_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster1_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster1_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster1_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster2_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster2_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster2_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster2_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster2_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster2_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster2_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster2_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster3_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster3_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster3_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster3_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster3_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster3_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster3_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster3_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster4_burn0_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster4_burn0_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster4_burn0_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster4_burn0_frame1_chroma1.frag.qsb
│       ├── terminal_dynamic_raster4_burn1_frame0_chroma0.frag.qsb
│       ├── terminal_dynamic_raster4_burn1_frame0_chroma1.frag.qsb
│       ├── terminal_dynamic_raster4_burn1_frame1_chroma0.frag.qsb
│       ├── terminal_dynamic_raster4_burn1_frame1_chroma1.frag.qsb
│       ├── terminal_frame.frag
│       ├── terminal_frame.frag.qsb
│       ├── terminal_frame.vert
│       ├── terminal_frame.vert.qsb
│       ├── terminal_static.frag
│       ├── terminal_static.vert
│       ├── terminal_static.vert.qsb
│       ├── terminal_static_rgb0_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve1.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma0_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve1.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb0_chroma1_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve1.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma0_bloom1_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve1_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom0_curve1_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve0_shine0.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve0_shine1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve1.frag.qsb
│       ├── terminal_static_rgb1_chroma1_bloom1_curve1_shine0.frag.qsb
│       └── terminal_static_rgb1_chroma1_bloom1_curve1_shine1.frag.qsb
├── cool-retro-term.desktop
├── cool-retro-term.pro
├── gpl-2.0.txt
├── gpl-3.0.txt
├── packaging/
│   ├── appdata/
│   │   └── cool-retro-term.appdata.xml
│   ├── debian/
│   │   ├── .gitignore
│   │   ├── changelog
│   │   ├── compat
│   │   ├── control
│   │   ├── cool-retro-term.1
│   │   ├── copyright
│   │   ├── rules
│   │   ├── source/
│   │   │   └── format
│   │   └── watch
│   └── rpm/
│       └── cool-retro-term.spec
├── scripts/
│   ├── build-appimage.sh
│   ├── build-dmg.sh
│   └── list_glyph_counts.py
└── snap/
    └── snapcraft.yaml
Download .txt
SYMBOL INDEX (31 symbols across 9 files)

FILE: app/fileio.cpp
  function QString (line 22) | QString FileIO::read(const QString& sourceUrl) {

FILE: app/fileio.h
  function class (line 9) | class FileIO : public QObject

FILE: app/fontlistmodel.cpp
  function QVariant (line 16) | QVariant FontListModel::data(const QModelIndex &index, int role) const
  function QVariantMap (line 76) | QVariantMap FontListModel::get(int index) const

FILE: app/fontlistmodel.h
  type FontEntry (line 10) | struct FontEntry
  function class (line 23) | class FontListModel : public QAbstractListModel

FILE: app/fontmanager.cpp
  function QStringList (line 27) | QStringList FontManager::retrieveMonospaceFonts()
  function FontListModel (line 50) | FontListModel *FontManager::fontList()
  function FontListModel (line 55) | FontListModel *FontManager::filteredFontList()
  function QString (line 92) | QString FontManager::fontName() const
  function qreal (line 108) | qreal FontManager::fontScaling() const
  function qreal (line 123) | qreal FontManager::fontWidth() const
  function qreal (line 138) | qreal FontManager::lineSpacing() const
  function qreal (line 153) | qreal FontManager::baseFontScaling() const
  function FontEntry (line 531) | const FontEntry *FontManager::findFontByName(const QString &name) const
  function QString (line 541) | QString FontManager::resolveFontFamily(const QString &sourcePath)
  function qreal (line 565) | qreal FontManager::computeBaseWidth(const QString &family, int pixelSize...

FILE: app/fontmanager.h
  function class (line 11) | class FontManager : public QObject

FILE: app/main.cpp
  function QString (line 31) | QString getNamedArgument(QStringList args, QString name, QString default...
  function QString (line 37) | QString getNamedArgument(QStringList args, QString name)
  function main (line 42) | int main(int argc, char *argv[])

FILE: app/qml/utils.js
  function clamp (line 22) | function clamp(x, min, max) {
  function lint (line 30) | function lint(a, b, t) {
  function mix (line 34) | function mix(c1, c2, alpha) {
  function sum (line 41) | function sum(c1, c2) {
  function scaleColor (line 51) | function scaleColor(c1, value) {
  function smoothstep (line 60) | function smoothstep(min, max, value) {
  function strToColor (line 65) | function strToColor(s){
  function tokenizeCommandLine (line 76) | function tokenizeCommandLine(s){

FILE: scripts/list_glyph_counts.py
  function count_glyphs (line 10) | def count_glyphs(font_path: Path) -> int:
  function main (line 16) | def main() -> None:
Condensed preview — 200 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (369K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 214,
    "preview": "# These are supported funding model platforms\n\npatreon: swordfish90\ncustom: ['https://www.paypal.com/cgi-bin/webscr?cmd="
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 2928,
    "preview": "name: Release\n\non:\n  workflow_dispatch:\n  push:\n    branches:\n      - main\n      - master\n    tags:\n      - '*'\n\npermiss"
  },
  {
    "path": ".gitignore",
    "chars": 439,
    "preview": "# C++ objects and libs\n\n*.slo\n*.lo\n*.o\n*.a\n*.la\n*.lai\n*.so\n*.dll\n*.dylib\n\n# Qt-es\n\n/.qmake.cache\n/.qmake.stash\n*.pro.use"
  },
  {
    "path": ".gitmodules",
    "chars": 238,
    "preview": "[submodule \"qmltermwidget\"]\n\tpath = qmltermwidget\n\turl = https://github.com/Swordfish90/qmltermwidget\n\tbranch = unstable"
  },
  {
    "path": "README.md",
    "chars": 1586,
    "preview": "# cool-retro-term\n\n|> Default Amber|C:\\ IBM DOS|$ Default Green|\n|---|---|---|\n|![Default Amber Cool Retro Term](https:/"
  },
  {
    "path": "app/app.pro",
    "chars": 4627,
    "preview": "QT += qml quick widgets sql quickcontrols2\nTARGET = cool-retro-term\nAPP_VERSION = $$system(git -C $$PWD/.. describe --ta"
  },
  {
    "path": "app/fileio.cpp",
    "chars": 703,
    "preview": "#include \"fileio.h\"\n\nFileIO::FileIO()\n{\n}\n\nbool FileIO::write(const QString& sourceUrl, const QString& data) {\n    if (s"
  },
  {
    "path": "app/fileio.h",
    "chars": 324,
    "preview": "#ifndef FILEIO_H\n#define FILEIO_H\n\n#include <QObject>\n#include <QFile>\n#include <QTextStream>\n#include <QUrl>\n\nclass Fil"
  },
  {
    "path": "app/fontlistmodel.cpp",
    "chars": 2360,
    "preview": "#include \"fontlistmodel.h\"\n\nFontListModel::FontListModel(QObject *parent)\n    : QAbstractListModel(parent)\n{\n}\n\nint Font"
  },
  {
    "path": "app/fontlistmodel.h",
    "chars": 1288,
    "preview": "#ifndef FONTLISTMODEL_H\n#define FONTLISTMODEL_H\n\n#include <QAbstractListModel>\n#include <QVector>\n#include <QVariant>\n#i"
  },
  {
    "path": "app/fontmanager.cpp",
    "chars": 14433,
    "preview": "#include \"fontmanager.h\"\n\n#include <QFont>\n#include <QFontDatabase>\n#include <QFontMetricsF>\n#include <QtGlobal>\n#includ"
  },
  {
    "path": "app/fontmanager.h",
    "chars": 3902,
    "preview": "#ifndef FONTMANAGER_H\n#define FONTMANAGER_H\n\n#include <QObject>\n#include <QStringList>\n#include <QHash>\n#include <QSet>\n"
  },
  {
    "path": "app/main.cpp",
    "chars": 6541,
    "preview": "#include <QtQml/QQmlApplicationEngine>\n#include <QtGui/QGuiApplication>\n\n#include <QQmlContext>\n#include <QStringList>\n\n"
  },
  {
    "path": "app/qml/AboutDialog.qml",
    "chars": 5087,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/ApplicationSettings.qml",
    "chars": 31165,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/BurnInEffect.qml",
    "chars": 4196,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/CheckableSlider.qml",
    "chars": 2121,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/ColorButton.qml",
    "chars": 1977,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/Components/SizedLabel.qml",
    "chars": 1218,
    "preview": "\n\n/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Sc"
  },
  {
    "path": "app/qml/InsertNameDialog.qml",
    "chars": 2869,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/PreprocessedTerminal.qml",
    "chars": 10483,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/SettingsAdvancedTab.qml",
    "chars": 5118,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/SettingsEffectsTab.qml",
    "chars": 3773,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/SettingsGeneralTab.qml",
    "chars": 10475,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/SettingsTerminalTab.qml",
    "chars": 8400,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/SettingsWindow.qml",
    "chars": 2299,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/ShaderTerminal.qml",
    "chars": 7409,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/SimpleSlider.qml",
    "chars": 1483,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/SizeOverlay.qml",
    "chars": 1564,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/Storage.qml",
    "chars": 2882,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/TerminalContainer.qml",
    "chars": 2859,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/TerminalFrame.qml",
    "chars": 2167,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/TerminalTabs.qml",
    "chars": 5389,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/TerminalWindow.qml",
    "chars": 5793,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/TimeManager.qml",
    "chars": 1607,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/fonts/apple2/FreeLicense.txt",
    "chars": 1826,
    "preview": "KREATIVE SOFTWARE RELAY FONTS FREE USE LICENSE\r\nversion 1.2f\r\n\r\nPermission is hereby granted, free of charge, to any per"
  },
  {
    "path": "app/qml/fonts/bigblue-terminal/LICENSE.TXT",
    "chars": 20129,
    "preview": "Attribution-ShareAlike 4.0 International\n\n=======================================================================\n\nCreat"
  },
  {
    "path": "app/qml/fonts/departure-mono/LICENSE",
    "chars": 4355,
    "preview": "Copyright 2022–2024 Helena Zhang (helenazhang.com).\n\nThis Font Software is licensed under the SIL Open Font License, Ver"
  },
  {
    "path": "app/qml/fonts/fira-code/LICENSE.txt",
    "chars": 4389,
    "preview": "Copyright (c) 2014, The Fira Code Project Authors (https://github.com/tonsky/FiraCode)\n\nThis Font Software is licensed u"
  },
  {
    "path": "app/qml/fonts/gohu/LICENSE",
    "chars": 508,
    "preview": "            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n                    Version 2, December 2004\n\n Copyright (C) 200"
  },
  {
    "path": "app/qml/fonts/greybeard/LICENSE",
    "chars": 1115,
    "preview": "MIT License\n\nCopyright (c) 2012-2015 Uwe Waldmann\nModified work Copyright 2018 Andy Walker\n\nPermission is hereby granted"
  },
  {
    "path": "app/qml/fonts/hack/LICENSE.txt",
    "chars": 3744,
    "preview": "The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License\n\nThe work in th"
  },
  {
    "path": "app/qml/fonts/ibm-3278/LICENSE.txt",
    "chars": 2675,
    "preview": "Copyright 2022 The 3270font Authors (https://github.com/rbanffy/3270font)\n\nCopyright (c) 2011-2022, Ricardo Banffy.\nCopy"
  },
  {
    "path": "app/qml/fonts/ibm-3278/README.md",
    "chars": 4971,
    "preview": "3270font: A font for the nostalgic\n==================================\n\n![Travis-CI](https://api.travis-ci.org/rbanffy/32"
  },
  {
    "path": "app/qml/fonts/iosevka/LICENSE.txt",
    "chars": 4493,
    "preview": "Copyright (c) 2015-2023, Renzhi Li (aka. Belleve Invis, belleve@typeof.net)\n\nThis Font Software is licensed under the SI"
  },
  {
    "path": "app/qml/fonts/jetbrains-mono/LICENSE.txt",
    "chars": 4399,
    "preview": "Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)\n\nThis Font Software is li"
  },
  {
    "path": "app/qml/fonts/oldschool-pc-fonts/LICENSE.TXT",
    "chars": 20129,
    "preview": "Attribution-ShareAlike 4.0 International\n\n=======================================================================\n\nCreat"
  },
  {
    "path": "app/qml/fonts/opendyslexic/LICENSE.txt",
    "chars": 2425,
    "preview": "License\n-------\nThe license for this font is: \n\n♡ Copying is an act of love. Please copy.\nBitstream License: \n\nCopyright"
  },
  {
    "path": "app/qml/fonts/pet-me/FreeLicense.txt",
    "chars": 1826,
    "preview": "KREATIVE SOFTWARE RELAY FONTS FREE USE LICENSE\r\nversion 1.2f\r\n\r\nPermission is hereby granted, free of charge, to any per"
  },
  {
    "path": "app/qml/fonts/source-code-pro/LICENSE.txt",
    "chars": 4578,
    "preview": "Copyright 2010-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a tr"
  },
  {
    "path": "app/qml/fonts/terminus/LICENSE-Terminess.txt",
    "chars": 4570,
    "preview": "Copyright (c) 2010 Dimitar Toshkov Zhekov,\r\nwith Reserved Font Name \"Terminus Font\".\r\n\r\nCopyright (c) 2011-2021 Tilman B"
  },
  {
    "path": "app/qml/fonts/unscii/LICENSE",
    "chars": 257,
    "preview": "You can consider it Public Domain (or CC-0) except for the files derived from or containing parts of Roman Czyborra's Un"
  },
  {
    "path": "app/qml/main.qml",
    "chars": 2134,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/menus/FullContextMenu.qml",
    "chars": 2586,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/menus/ShortContextMenu.qml",
    "chars": 1115,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/menus/WindowMenu.qml",
    "chars": 2591,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/qml/resources.qrc",
    "chars": 7960,
    "preview": "<RCC>\n    <qresource prefix=\"/\">\n        <file>SizeOverlay.qml</file>\n        <file>ShaderTerminal.qml</file>\n        <f"
  },
  {
    "path": "app/qml/utils.js",
    "chars": 4016,
    "preview": "/*******************************************************************************\n* Copyright (c) 2013-2021 \"Filippo Scog"
  },
  {
    "path": "app/shaders/burn_in.frag",
    "chars": 945,
    "preview": "#version 440\n\nlayout(location = 0) in vec2 qt_TexCoord0;\nlayout(location = 0) out vec4 fragColor;\n\nlayout(std140, bindin"
  },
  {
    "path": "app/shaders/burn_in.vert",
    "chars": 408,
    "preview": "#version 440\n\nlayout(location = 0) in vec4 qt_Vertex;\nlayout(location = 1) in vec2 qt_MultiTexCoord0;\n\nlayout(std140, bi"
  },
  {
    "path": "app/shaders/passthrough.vert",
    "chars": 1037,
    "preview": "#version 440\n\nlayout(location = 0) in vec4 qt_Vertex;\nlayout(location = 1) in vec2 qt_MultiTexCoord0;\n\nlayout(std140, bi"
  },
  {
    "path": "app/shaders/terminal_dynamic.frag",
    "chars": 5729,
    "preview": "#version 440\n\n#ifndef CRT_RASTER_MODE\n#define CRT_RASTER_MODE 0\n#endif\n#ifndef CRT_BURN_IN\n#define CRT_BURN_IN 1\n#endif\n"
  },
  {
    "path": "app/shaders/terminal_dynamic.vert",
    "chars": 1477,
    "preview": "#version 440\n\nlayout(location = 0) in vec4 qt_Vertex;\nlayout(location = 1) in vec2 qt_MultiTexCoord0;\n\nlayout(std140, bi"
  },
  {
    "path": "app/shaders/terminal_frame.frag",
    "chars": 2970,
    "preview": "#version 440\n\nlayout(location = 0) in vec2 qt_TexCoord0;\nlayout(location = 0) out vec4 fragColor;\n\nlayout(std140, bindin"
  },
  {
    "path": "app/shaders/terminal_frame.vert",
    "chars": 498,
    "preview": "#version 440\n\nlayout(location = 0) in vec4 qt_Vertex;\nlayout(location = 1) in vec2 qt_MultiTexCoord0;\n\nlayout(std140, bi"
  },
  {
    "path": "app/shaders/terminal_static.frag",
    "chars": 3123,
    "preview": "#version 440\n\n#ifndef CRT_RGB_SHIFT\n#define CRT_RGB_SHIFT 1\n#endif\n#ifndef CRT_BLOOM\n#define CRT_BLOOM 1\n#endif\n#ifndef "
  },
  {
    "path": "app/shaders/terminal_static.vert",
    "chars": 472,
    "preview": "#version 440\n\nlayout(location = 0) in vec4 qt_Vertex;\nlayout(location = 1) in vec2 qt_MultiTexCoord0;\n\nlayout(std140, bi"
  },
  {
    "path": "cool-retro-term.desktop",
    "chars": 364,
    "preview": "[Desktop Entry]\nComment=Use the command line the old way\nExec=cool-retro-term\nGenericName=Terminal emulator\nIcon=cool-re"
  },
  {
    "path": "cool-retro-term.pro",
    "chars": 182,
    "preview": "TEMPLATE = subdirs\n\nCONFIG += ordered\n\nSUBDIRS += qmltermwidget\nSUBDIRS += app\n\ndesktop.files += cool-retro-term.desktop"
  },
  {
    "path": "gpl-2.0.txt",
    "chars": 18092,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Fr"
  },
  {
    "path": "gpl-3.0.txt",
    "chars": 35147,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "packaging/appdata/cool-retro-term.appdata.xml",
    "chars": 1483,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Copyright 2014 Markus S. <kamikazow@web.de> -->\n<component type=\"desktop\">\n "
  },
  {
    "path": "packaging/debian/.gitignore",
    "chars": 55,
    "preview": "/*.debhelper.log\n/*.substvars\n/cool-retro-term/\n/files\n"
  },
  {
    "path": "packaging/debian/changelog",
    "chars": 158,
    "preview": "cool-retro-term (0.9-1) UNRELEASED; urgency=medium\n\n  * Initial release. (Closes: #758238)\n\n -- Jeka Der <jekader@gmail."
  },
  {
    "path": "packaging/debian/compat",
    "chars": 2,
    "preview": "9\n"
  },
  {
    "path": "packaging/debian/control",
    "chars": 1045,
    "preview": "Source: cool-retro-term\nMaintainer: Jeka Der <jekader@gmail.com>\nSection: x11\nPriority: optional\nStandards-Version: 3.9."
  },
  {
    "path": "packaging/debian/cool-retro-term.1",
    "chars": 1429,
    "preview": ".TH \"COOL-RETRO-TERM\" 1 \"2017-11-06\"\n.SH NAME\ncool\\-retro\\-term \\- terminal emulator mimicking an old cathode display\n.S"
  },
  {
    "path": "packaging/debian/copyright",
    "chars": 428,
    "preview": "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\nUpstream-Name: cool-retro-term\nUpstream-Contac"
  },
  {
    "path": "packaging/debian/rules",
    "chars": 30,
    "preview": "#!/usr/bin/make -f\n%:\n\tdh $@\n\n"
  },
  {
    "path": "packaging/debian/source/format",
    "chars": 12,
    "preview": "3.0 (quilt)\n"
  },
  {
    "path": "packaging/debian/watch",
    "chars": 193,
    "preview": "version=4\nopts=\"filenamemangle=s%(?:.*?)?v?(\\d[\\d.]*)\\.tar\\.gz%<project>-$1.tar.gz%\" \\\n   https://github.com/Swordfish90"
  },
  {
    "path": "packaging/rpm/cool-retro-term.spec",
    "chars": 3166,
    "preview": "#\n# spec file for package cool-retro-term\n#\n# Copyright © 2014 Markus S. <kamikazow@web.de>\n#\n# This program is free sof"
  },
  {
    "path": "scripts/build-appimage.sh",
    "chars": 2674,
    "preview": "#!/usr/bin/env bash\nset -euo pipefail\nset -x\n\nREPO_ROOT=\"$(readlink -f \"$(dirname \"$(dirname \"$0\")\")\")\"\nOLD_CWD=\"$(readl"
  },
  {
    "path": "scripts/build-dmg.sh",
    "chars": 1472,
    "preview": "#!/usr/bin/env bash\nset -euo pipefail\nset -x\n\nREPO_ROOT=\"$(cd \"$(dirname \"$0\")/..\" && pwd -P)\"\nOLD_CWD=\"$(pwd -P)\"\nBUILD"
  },
  {
    "path": "scripts/list_glyph_counts.py",
    "chars": 1072,
    "preview": "#!/usr/bin/env python3\n\"\"\"\nPrint glyph counts for all font files under app/qml/fonts.\nRequires fontTools (already availa"
  },
  {
    "path": "snap/snapcraft.yaml",
    "chars": 2193,
    "preview": "name: cool-retro-term # check to see if it's available\nversion: '1.1.1' # this is freakin' awesome\nsummary: cool-retro-t"
  }
]

// ... and 114 more files (download for full content)

About this extraction

This page contains the full source code of the Swordfish90/cool-retro-term GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 200 files (344.3 KB), approximately 85.2k tokens, and a symbol index with 31 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!