├── .gitattributes ├── Android ├── AndroidManifest.xml ├── build.gradle └── res │ ├── drawable-hdpi │ └── icon.png │ ├── drawable-ldpi │ └── icon.png │ ├── drawable-mdpi │ └── icon.png │ ├── drawable-xhdpi │ └── icon.png │ ├── drawable-xxhdpi │ └── icon.png │ ├── drawable-xxxhdpi │ └── icon.png │ └── values │ └── libs.xml ├── Archived └── qtnqc.d.tar ├── Distributions ├── DEBIAN-PI-ARM32 │ └── control ├── DEBIAN-PI-ARM64 │ └── control ├── DEBIAN-POWERPC │ └── control ├── DEBIAN │ └── control ├── README ├── build-debian-amd64.bash ├── build-debian-pios.bash ├── build-debian-powerpc.bash ├── build-macos.bash ├── build-tar-amd64.bash ├── glitch-darkmode.bat └── glitch.desktop ├── Documentation ├── APPLE-SILICON ├── Arduino │ ├── Arduino.pdf │ └── Links ├── DEBIAN ├── DEFINES ├── Glitch.1 ├── Glitch.odt ├── Glitch.pdf ├── KDE ├── QT ├── README.QT4 ├── ReleaseNotes.html └── documentation.qrc ├── Examples └── Arduino │ ├── Arduino-ASCIITable.db │ ├── Arduino-ASCIITable.ino │ ├── Arduino-AnalogReadSerial.db │ ├── Arduino-AnalogReadSerial.ino │ ├── Arduino-Blink.db │ ├── Arduino-Blink.ino │ ├── Arduino-BlinkWithoutDelay.db │ ├── Arduino-BlinkWithoutDelay.ino │ ├── Arduino-Button.ino │ ├── Arduino-Diagram-SipHash.db │ ├── Arduino-DigitalReadSerial.db │ ├── Arduino-DigitalReadSerial.ino │ ├── Arduino-Fade.db │ ├── Arduino-Fade.ino │ ├── Arduino-ReadAnalogVoltage.db │ ├── Arduino-ReadAnalogVoltage.ino │ ├── Arduino-ReadSens-and-Condition.db │ ├── Arduino-ReadSens-and-Condition.ino │ ├── Glitch-Arduino-ASCIITable │ └── Glitch-Arduino-ASCIITable.ino │ ├── Glitch-Arduino-AnalogReadSerial │ └── Glitch-Arduino-AnalogReadSerial.ino │ ├── Glitch-Arduino-Blink │ └── Glitch-Arduino-Blink.ino │ ├── Glitch-Arduino-BlinkWithoutDelay │ └── Glitch-Arduino-BlinkWithoutDelay.ino │ ├── Glitch-Arduino-Button │ └── Glitch-Arduino-Button.ino │ ├── Glitch-Arduino-DigitalReadSerial │ └── Glitch-Arduino-DigitalReadSerial.ino │ ├── Glitch-Arduino-Fade │ └── Glitch-Arduino-Fade.ino │ ├── Glitch-Arduino-ReadAnalogVoltage │ └── Glitch-Arduino-ReadAnalogVoltage.ino │ ├── Glitch-Arduino-ReadSens-and-Condition │ └── Glitch-Arduino-ReadSens-and-Condition.ino │ ├── Glitch-Arduino-SipHash │ └── Glitch-Arduino-SipHash-Diagram.ino │ └── README ├── Icons ├── Arduino │ ├── analog.png │ ├── arithmetic.png │ ├── ascii.png │ ├── binary.png │ ├── boolean.png │ ├── catalog.png │ ├── compound.png │ ├── constant.png │ ├── convert.png │ ├── decoration.png │ ├── digital.png │ ├── flow.png │ ├── interrupt.png │ ├── mathematics.png │ ├── pulse.png │ ├── random.png │ ├── serial.png │ ├── structure.png │ ├── syntax.png │ ├── time.png │ ├── trigonometry.png │ ├── utilities.png │ ├── variable.png │ └── xor.png ├── Logo │ ├── glitch-arduino-logo.png │ ├── glitch-logo.icns │ ├── glitch-logo.ico │ └── glitch-logo.png ├── about.png ├── adjust-size.png ├── bottom-align.png ├── clear.png ├── close.png ├── compress.png ├── context-menu.png ├── copy.png ├── delete.png ├── disconnect.png ├── document-edit.png ├── down.png ├── find.png ├── font.png ├── fullscreen.png ├── glitch.rc ├── horizontal-center-align.png ├── horizontal-stack.png ├── icons.qrc ├── language.png ├── left-align.png ├── missing-image.png ├── new-document.png ├── next.png ├── open.png ├── paste.png ├── pin.png ├── png.png ├── previous.png ├── print.png ├── quit.png ├── recent.png ├── redo.png ├── reset.png ├── right-align.png ├── save-as.png ├── save.png ├── select-all.png ├── settings.png ├── source.png ├── tools.png ├── top-align.png ├── undo.png ├── upload.png ├── verify.png ├── vertical-center-align.png ├── vertical-stack.png ├── widget-properties.png ├── wire.png ├── zoom-in.png ├── zoom-out.png └── zoom-reset.png ├── Images ├── glitch-android-1.png ├── glitch-android-2.png ├── glitch-arduino.png └── glitch-macos.png ├── LICENSE ├── Qt └── qt.conf ├── Qup.d └── qup.txt ├── README.md ├── REMINDERS ├── Source ├── Arduino │ ├── glitch-object-advanced-io-arduino.cc │ ├── glitch-object-advanced-io-arduino.h │ ├── glitch-object-analog-io-arduino.cc │ ├── glitch-object-analog-io-arduino.h │ ├── glitch-object-arithmetic-operator-arduino.cc │ ├── glitch-object-arithmetic-operator-arduino.h │ ├── glitch-object-bits-and-bytes-arduino.cc │ ├── glitch-object-bits-and-bytes-arduino.h │ ├── glitch-object-bitwise-operator-arduino.cc │ ├── glitch-object-bitwise-operator-arduino.h │ ├── glitch-object-block-comment-arduino.cc │ ├── glitch-object-block-comment-arduino.h │ ├── glitch-object-boolean-operator-arduino.cc │ ├── glitch-object-boolean-operator-arduino.h │ ├── glitch-object-characters-arduino.cc │ ├── glitch-object-characters-arduino.h │ ├── glitch-object-compound-operator-arduino.cc │ ├── glitch-object-compound-operator-arduino.h │ ├── glitch-object-constant-arduino.cc │ ├── glitch-object-constant-arduino.h │ ├── glitch-object-conversion-arduino.cc │ ├── glitch-object-conversion-arduino.h │ ├── glitch-object-digital-io-arduino.cc │ ├── glitch-object-digital-io-arduino.h │ ├── glitch-object-flow-control-arduino.cc │ ├── glitch-object-flow-control-arduino.h │ ├── glitch-object-function-arduino.cc │ ├── glitch-object-function-arduino.h │ ├── glitch-object-interrupts-arduino.cc │ ├── glitch-object-interrupts-arduino.h │ ├── glitch-object-library-function-arduino.cc │ ├── glitch-object-library-function-arduino.h │ ├── glitch-object-loop-arduino.cc │ ├── glitch-object-loop-arduino.h │ ├── glitch-object-mathematics-arduino.cc │ ├── glitch-object-mathematics-arduino.h │ ├── glitch-object-random-arduino.cc │ ├── glitch-object-random-arduino.h │ ├── glitch-object-serial-arduino.cc │ ├── glitch-object-serial-arduino.h │ ├── glitch-object-setup-arduino.cc │ ├── glitch-object-setup-arduino.h │ ├── glitch-object-simple-text-arduino.cc │ ├── glitch-object-simple-text-arduino.h │ ├── glitch-object-syntax-arduino.cc │ ├── glitch-object-syntax-arduino.h │ ├── glitch-object-time-arduino.cc │ ├── glitch-object-time-arduino.h │ ├── glitch-object-trigonometry-arduino.cc │ ├── glitch-object-trigonometry-arduino.h │ ├── glitch-object-utilities-arduino.cc │ ├── glitch-object-utilities-arduino.h │ ├── glitch-object-variable-arduino.cc │ ├── glitch-object-variable-arduino.h │ ├── glitch-structures-arduino.cc │ ├── glitch-structures-arduino.h │ ├── glitch-view-arduino.cc │ └── glitch-view-arduino.h ├── CocoaInitializer.h ├── CocoaInitializer.mm ├── glitch-alignment.cc ├── glitch-alignment.h ├── glitch-application.cc ├── glitch-application.h ├── glitch-arduino.pro ├── glitch-ash-state-machine.h ├── glitch-ash.cc ├── glitch-ash.h ├── glitch-aware-containers.h ├── glitch-canvas-preview.cc ├── glitch-canvas-preview.h ├── glitch-canvas-settings.cc ├── glitch-canvas-settings.h ├── glitch-collapse-expand-tool-button.h ├── glitch-common.cc ├── glitch-common.h ├── glitch-docked-container.cc ├── glitch-docked-container.h ├── glitch-documentation.cc ├── glitch-documentation.h ├── glitch-find-objects-position-item.h ├── glitch-find-objects.cc ├── glitch-find-objects.h ├── glitch-floating-context-menu.cc ├── glitch-floating-context-menu.h ├── glitch-font-filter.h ├── glitch-graphicsview.cc ├── glitch-graphicsview.h ├── glitch-main.cc ├── glitch-object-arrow.cc ├── glitch-object-arrow.h ├── glitch-object-edit-window-ash.cc ├── glitch-object-edit-window.cc ├── glitch-object-edit-window.h ├── glitch-object-lineedit.h ├── glitch-object-view.cc ├── glitch-object-view.h ├── glitch-object.cc ├── glitch-object.h ├── glitch-point.h ├── glitch-port-colors.cc ├── glitch-port-colors.h ├── glitch-preferences.cc ├── glitch-preferences.h ├── glitch-proxy-widget.cc ├── glitch-proxy-widget.h ├── glitch-recent-diagram.h ├── glitch-recent-diagrams-view.cc ├── glitch-recent-diagrams-view.h ├── glitch-redo-undo-stack.cc ├── glitch-redo-undo-stack.h ├── glitch-resize-widget-rectangle.cc ├── glitch-resize-widget-rectangle.h ├── glitch-resize-widget.cc ├── glitch-resize-widget.h ├── glitch-scene.cc ├── glitch-scene.h ├── glitch-scroll-filter.h ├── glitch-separated-diagram-window.cc ├── glitch-separated-diagram-window.h ├── glitch-serial-port-window.cc ├── glitch-serial-port-window.h ├── glitch-source-preview.cc ├── glitch-source-preview.h ├── glitch-structures-treewidget.cc ├── glitch-structures-treewidget.h ├── glitch-style-sheet.cc ├── glitch-style-sheet.h ├── glitch-swifty.h ├── glitch-syntax-highlighter.cc ├── glitch-syntax-highlighter.h ├── glitch-tab-tabbar.cc ├── glitch-tab-tabbar.h ├── glitch-tab.cc ├── glitch-tab.h ├── glitch-tools.cc ├── glitch-tools.h ├── glitch-ui-a.cc ├── glitch-ui-ash.cc ├── glitch-ui-b.cc ├── glitch-ui.h ├── glitch-undo-command.cc ├── glitch-undo-command.h ├── glitch-user-functions-model.cc ├── glitch-user-functions-model.h ├── glitch-user-functions-tableview.cc ├── glitch-user-functions-tableview.h ├── glitch-user-functions.cc ├── glitch-user-functions.h ├── glitch-variety.cc ├── glitch-variety.h ├── glitch-version.h ├── glitch-view-ash.cc ├── glitch-view.cc ├── glitch-view.h ├── glitch-wire.cc └── glitch-wire.h ├── Tools ├── glitch-prepare-apk-name.bash └── html2spell.bash ├── UI ├── Arduino │ ├── glitch-object-block-comment-arduino.ui │ ├── glitch-object-compound-operator-arduino.ui │ ├── glitch-object-constant-arduino.ui │ ├── glitch-object-flow-control-arduino.ui │ ├── glitch-object-function-arduino.ui │ ├── glitch-object-syntax-arduino.ui │ └── glitch-object-variable-arduino.ui ├── glitch-ash.ui ├── glitch-canvas-preview.ui ├── glitch-canvas-settings.ui ├── glitch-docked-container.ui ├── glitch-documentation.ui ├── glitch-errors-dialog.ui ├── glitch-find-objects.ui ├── glitch-floating-context-menu.ui ├── glitch-mainwindow.ui ├── glitch-port-colors.ui ├── glitch-preferences.ui ├── glitch-redo-undo-stack.ui ├── glitch-separated-diagram-window.ui ├── glitch-serial-port-window.ui ├── glitch-source-preview.ui ├── glitch-structures.ui ├── glitch-style-sheet.ui ├── glitch-tools.ui ├── glitch-user-functions.ui └── glitch-view.ui ├── glitch-version.bash ├── glitch.pro └── glitch.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | *.rb linguist-language=C++ 2 | *.rb linguist-vendored=C++ 3 | 4 | Doxygen/* linguist-vendored=true 5 | -------------------------------------------------------------------------------- /Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:7.4.1' 9 | } 10 | } 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | } 16 | 17 | apply plugin: 'com.android.application' 18 | 19 | dependencies { 20 | implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) 21 | } 22 | 23 | android { 24 | /******************************************************* 25 | * The following variables: 26 | * - androidBuildToolsVersion, 27 | * - androidCompileSdkVersion 28 | * - qtAndroidDir - holds the path to qt android files 29 | * needed to build any Qt application 30 | * on Android. 31 | * 32 | * are defined in gradle.properties file. This file is 33 | * updated by QtCreator and androiddeployqt tools. 34 | * Changing them manually might break the compilation! 35 | *******************************************************/ 36 | 37 | compileSdkVersion androidCompileSdkVersion 38 | buildToolsVersion androidBuildToolsVersion 39 | ndkVersion androidNdkVersion 40 | 41 | // Extract native libraries from the APK 42 | packagingOptions.jniLibs.useLegacyPackaging true 43 | 44 | sourceSets { 45 | main { 46 | manifest.srcFile 'AndroidManifest.xml' 47 | java.srcDirs = [qtAndroidDir + '/src', 'src', 'java'] 48 | aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl'] 49 | res.srcDirs = [qtAndroidDir + '/res', 'res'] 50 | resources.srcDirs = ['resources'] 51 | renderscript.srcDirs = ['src'] 52 | assets.srcDirs = ['assets'] 53 | jniLibs.srcDirs = ['libs'] 54 | } 55 | } 56 | 57 | tasks.withType(JavaCompile) { 58 | options.incremental = true 59 | } 60 | 61 | compileOptions { 62 | sourceCompatibility JavaVersion.VERSION_1_8 63 | targetCompatibility JavaVersion.VERSION_1_8 64 | } 65 | 66 | lintOptions { 67 | abortOnError false 68 | } 69 | 70 | // Do not compress Qt binary resources file 71 | aaptOptions { 72 | noCompress 'rcc' 73 | } 74 | 75 | defaultConfig { 76 | resConfig "en" 77 | minSdkVersion qtMinSdkVersion 78 | targetSdkVersion qtTargetSdkVersion 79 | ndk.abiFilters = qtTargetAbiList.split(",") 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Android/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /Android/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Android/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /Android/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Android/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /Android/res/values/libs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Archived/qtnqc.d.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Archived/qtnqc.d.tar -------------------------------------------------------------------------------- /Distributions/DEBIAN-PI-ARM32/control: -------------------------------------------------------------------------------- 1 | Architecture: armhf 2 | Depends: libqt5core5a, 3 | libqt5gui5, 4 | libqt5network5, 5 | libqt5printsupport5, 6 | libqt5serialport5, 7 | libqt5sql5, 8 | libqt5sql5-sqlite, 9 | libqt5widgets5 10 | Maintainer: f83043e79dc03a0abfbcbc376879a97d66f2cacb@protonmail.ch 11 | Package: Glitch 12 | Priority: optional 13 | Section: Development 14 | Version: 2025.05.03 15 | Description: Glitch 16 | Welcome to Glitch on PiOS32! 17 | Glitch is governed by a BSD license. Enjoy! 18 | -------------------------------------------------------------------------------- /Distributions/DEBIAN-PI-ARM64/control: -------------------------------------------------------------------------------- 1 | Architecture: arm64 2 | Depends: libqt6core6, 3 | libqt6gui6, 4 | libqt6network6, 5 | libqt6pdf6, 6 | libqt6pdfwidgets6, 7 | libqt6printsupport6, 8 | libqt6serialport6, 9 | libqt6sql6, 10 | libqt6sql6-sqlite, 11 | libqt6widgets6 12 | Maintainer: f83043e79dc03a0abfbcbc376879a97d66f2cacb@protonmail.ch 13 | Package: Glitch 14 | Priority: optional 15 | Section: Development 16 | Version: 2025.05.03 17 | Description: Glitch 18 | Welcome to Glitch on PiOS64! 19 | Glitch is governed by a BSD license. Enjoy! 20 | -------------------------------------------------------------------------------- /Distributions/DEBIAN-POWERPC/control: -------------------------------------------------------------------------------- 1 | Architecture: powerpc 2 | Depends: libqt5core5a, 3 | libqt5gui5, 4 | libqt5network5, 5 | libqt5printsupport5, 6 | libqt5serialport5, 7 | libqt5sql5, 8 | libqt5sql5-sqlite, 9 | libqt5widgets5 10 | Maintainer: f83043e79dc03a0abfbcbc376879a97d66f2cacb@protonmail.ch 11 | Package: Glitch 12 | Priority: optional 13 | Section: Development 14 | Version: 2025.05.03 15 | Description: Glitch 16 | Welcome to Glitch on PowerPC! 17 | Glitch is governed by a BSD license. Enjoy! 18 | -------------------------------------------------------------------------------- /Distributions/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Architecture: amd64 2 | Depends: libqt5core5a (>= 5.15.0), 3 | libqt5gui5 (>= 5.15.0), 4 | libqt5network5 (>= 5.15.0), 5 | libqt5pdf5 (>= 5.15.0), 6 | libqt5pdfwidgets5 (>= 5.15.0), 7 | libqt5printsupport5 (>= 5.15.0), 8 | libqt5serialport5 (>= 5.15.0), 9 | libqt5sql5 (>= 5.15.0), 10 | libqt5sql5-sqlite (>= 5.15.0), 11 | libqt5widgets5 (>= 5.15.0) 12 | Maintainer: f83043e79dc03a0abfbcbc376879a97d66f2cacb@protonmail.ch 13 | Package: Glitch 14 | Priority: optional 15 | Section: Development 16 | Version: 2025.05.03 17 | Description: Glitch 18 | Welcome to Glitch! 19 | Glitch is governed by a BSD license. Enjoy! 20 | -------------------------------------------------------------------------------- /Distributions/README: -------------------------------------------------------------------------------- 1 | Please execute in the parent directory. 2 | 3 | > ./Distributions/build_debian_amd64.bash 4 | -------------------------------------------------------------------------------- /Distributions/build-debian-amd64.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Alexis Megas. 4 | 5 | if [ ! -x /usr/bin/dpkg-deb ] 6 | then 7 | echo "Please install dpkg-deb." 8 | exit 1 9 | fi 10 | 11 | if [ ! -x /usr/bin/fakeroot ] 12 | then 13 | echo "Please install fakeroot." 14 | exit 1 15 | fi 16 | 17 | if [ ! -r glitch.pro ] 18 | then 19 | echo "Please issue $0 from the primary directory." 20 | exit 1 21 | fi 22 | 23 | # Prepare ./opt/glitch. 24 | 25 | make distclean 2>/dev/null 26 | mkdir -p ./opt/glitch/Documentation 27 | qmake -o Makefile glitch.pro 28 | lupdate glitch.pro 2>/dev/null 29 | lrelease glitch.pro 2>/dev/null 30 | make -j $(nproc) 31 | cp -p ./Documentation/*.1 ./opt/glitch/Documentation/. 32 | cp -p ./Glitch ./opt/glitch/. 33 | cp -p ./Icons/Logo/glitch-logo.png ./opt/glitch/. 34 | cp -p ./glitch.sh ./opt/glitch/. 35 | cp -pr ./Documentation/Arduino ./opt/glitch/Documentation/. 36 | cp -pr ./Examples ./opt/glitch/. 37 | 38 | # Prepare Glitch-x.deb. 39 | 40 | mkdir -p glitch-debian/opt 41 | cp -pr ./Distributions/DEBIAN glitch-debian/. 42 | cp -r ./opt/glitch glitch-debian/opt/. 43 | fakeroot dpkg-deb --build glitch-debian Glitch-2025.05.03_amd64.deb 44 | rm -fr ./opt 45 | rm -fr glitch-debian 46 | make distclean 47 | -------------------------------------------------------------------------------- /Distributions/build-debian-pios.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Alexis Megas. 4 | 5 | if [ ! -x /usr/bin/dpkg ] 6 | then 7 | echo "Please install dpkg." 8 | exit 1 9 | fi 10 | 11 | if [ ! -x /usr/bin/dpkg-deb ] 12 | then 13 | echo "Please install dpkg-deb." 14 | exit 1 15 | fi 16 | 17 | if [ ! -x /usr/bin/fakeroot ] 18 | then 19 | echo "Please install fakeroot." 20 | exit 1 21 | fi 22 | 23 | if [ ! -r glitch.pro ] 24 | then 25 | echo "Please issue $0 from the primary directory." 26 | exit 1 27 | fi 28 | 29 | # Prepare ./opt/glitch. 30 | 31 | make distclean 2>/dev/null 32 | mkdir -p ./opt/glitch/Documentation 33 | 34 | if [ ! -z "$(which qmake6)" ] 35 | then 36 | qmake6 2>/dev/null 37 | else 38 | qmake 2>/dev/null 39 | fi 40 | 41 | lupdate glitch.pro 2>/dev/null 42 | lrelease glitch.pro 2>/dev/null 43 | make -j $(nproc) 44 | cp -p ./Documentation/*.1 ./opt/glitch/Documentation/. 45 | cp -p ./Glitch ./opt/glitch/. 46 | cp -p ./Icons/Logo/glitch-logo.png ./opt/glitch/. 47 | cp -p ./glitch.sh ./opt/glitch/. 48 | cp -pr ./Documentation/Arduino ./opt/glitch/Documentation/. 49 | cp -pr ./Examples ./opt/glitch/. 50 | 51 | # Prepare Glitch-x.deb. 52 | 53 | mkdir -p glitch-debian/opt 54 | 55 | architecture="$(dpkg --print-architecture)" 56 | 57 | if [ "$architecture" = "armhf" ] 58 | then 59 | cp -pr ./Distributions/DEBIAN-PI-ARM32 glitch-debian/DEBIAN 60 | else 61 | cp -pr ./Distributions/DEBIAN-PI-ARM64 glitch-debian/DEBIAN 62 | fi 63 | 64 | cp -r ./opt/glitch glitch-debian/opt/. 65 | fakeroot dpkg-deb --build glitch-debian Glitch-2025.05.03_$architecture.deb 66 | rm -fr ./opt 67 | rm -fr glitch-debian 68 | make distclean 69 | -------------------------------------------------------------------------------- /Distributions/build-debian-powerpc.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Alexis Megas. 4 | 5 | if [ ! -x /usr/bin/dpkg-deb ] 6 | then 7 | echo "Please install dpkg-deb." 8 | exit 1 9 | fi 10 | 11 | if [ ! -x /usr/bin/fakeroot ] 12 | then 13 | echo "Please install fakeroot." 14 | exit 1 15 | fi 16 | 17 | if [ ! -r glitch.pro ] 18 | then 19 | echo "Please issue $0 from the primary directory." 20 | exit 1 21 | fi 22 | 23 | # Prepare ./opt/glitch. 24 | 25 | make distclean 2>/dev/null 26 | mkdir -p ./opt/glitch/Documentation 27 | qmake -o Makefile glitch.pro 28 | lupdate glitch.pro 2>/dev/null 29 | lrelease glitch.pro 2>/dev/null 30 | make -j $(nproc) 31 | cp -p ./Documentation/*.1 ./opt/glitch/Documentation/. 32 | cp -p ./Glitch ./opt/glitch/. 33 | cp -p ./Icons/Logo/glitch-logo.png ./opt/glitch/. 34 | cp -p ./glitch.sh ./opt/glitch/. 35 | cp -pr ./Documentation/Arduino ./opt/glitch/Documentation/. 36 | cp -pr ./Examples ./opt/glitch/. 37 | 38 | # Prepare Glitch-x.deb. 39 | 40 | mkdir -p glitch-debian/opt 41 | cp -pr ./Distributions/DEBIAN-POWERPC glitch-debian/DEBIAN 42 | cp -r ./opt/glitch glitch-debian/opt/. 43 | fakeroot dpkg-deb --build glitch-debian Glitch-2025.05.03_powerpc.deb 44 | rm -fr ./opt 45 | rm -fr glitch-debian 46 | make distclean 47 | -------------------------------------------------------------------------------- /Distributions/build-macos.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Alexis Megas. 4 | 5 | if [ ! -e glitch.pro ] 6 | then 7 | echo "Please issue $0 from the primary directory." 8 | exit 1 9 | fi 10 | 11 | if [ ! -x ~/Qt/6.8.3/macos/bin/qmake ] 12 | then 13 | echo "Please install the official Qt LTS." 14 | exit 1 15 | fi 16 | 17 | make distclean 2>/dev/null 18 | rm -f Glitch.d.dmg 19 | ~/Qt/6.8.3/macos/bin/qmake -o Makefile 20 | make -j 5 21 | make dmg 22 | 23 | if [ ! -r Glitch.d.dmg ] 24 | then 25 | echo "Glitch.d.dmg is not a readable file." 26 | exit 1 27 | fi 28 | 29 | mv Glitch.d.dmg Glitch-2025.05.03_universal.d.dmg 30 | make distclean 2>/dev/null 31 | -------------------------------------------------------------------------------- /Distributions/build-tar-amd64.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Alexis Megas. 4 | 5 | if [ ! -r glitch.pro ] 6 | then 7 | echo "Please execute $0 from the primary directory." 8 | exit 1 9 | fi 10 | 11 | # Prepare ./glitch. 12 | 13 | make distclean 2>/dev/null 14 | mkdir -p ./glitch/Documentation 15 | mkdir -p ./glitch/Lib 16 | qmake -o Makefile glitch.pro 17 | lupdate glitch.pro 2>/dev/null 18 | lrelease glitch.pro 2>/dev/null 19 | make -j $(nproc) 20 | cp -p ./Documentation/*.1 ./glitch/Documentation/. 21 | cp -p ./Glitch ./glitch/. 22 | cp -p ./Icons/Logo/glitch-logo.png ./glitch/. 23 | cp -p ./glitch.sh ./glitch/. 24 | cp -pr ./Documentation/Arduino ./glitch/Documentation/. 25 | cp -pr ./Examples ./usr/local/glitch/. 26 | 27 | # Prepare a tar bundle. 28 | 29 | cp $(ldd ./Glitch | awk '{print $3}' | grep -e '^/') ./glitch/Lib/. 30 | chmod -x ./glitch/Lib/*.so* 31 | tar -cv -f Glitch-2025.05.03.tar ./glitch 32 | make distclean 33 | rm -fr ./glitch 34 | -------------------------------------------------------------------------------- /Distributions/glitch-darkmode.bat: -------------------------------------------------------------------------------- 1 | :: Alexis Megas. 2 | 3 | :: Windows only. 4 | 5 | @echo "Launching Glitch." 6 | start "Glitch" Glitch.exe -style fusion 7 | exit 8 | -------------------------------------------------------------------------------- /Distributions/glitch.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Categories=Library 3 | Comment=Glitch 4 | Exec=/opt/glitch/glitch.sh 5 | GenericName=Glitch 6 | Icon=/opt/glitch/glitch-logo.png 7 | Name=Glitch 8 | StartupNotify=true 9 | Terminal=false 10 | Type=Application 11 | -------------------------------------------------------------------------------- /Documentation/APPLE-SILICON: -------------------------------------------------------------------------------- 1 | Apple Silicon requires signed software and therefore a bundled 2 | package will be considered tarnished. We recommend a Homebrew 3 | solution. Please visit https://brew.sh and install Homebrew. 4 | 5 | > brew install git 6 | > brew install qt 7 | > cd 8 | > git clone https://github.com/textbrowser/glitch glitch.d 9 | > cd glitch.d 10 | > qmake 11 | > make 12 | > open ./Glitch.app 13 | -------------------------------------------------------------------------------- /Documentation/Arduino/Arduino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Documentation/Arduino/Arduino.pdf -------------------------------------------------------------------------------- /Documentation/Arduino/Links: -------------------------------------------------------------------------------- 1 | https://github.com/arduino/ArduinoCore-API/tree/master/api 2 | https://www.arduino.cc/en/Reference/HomePage 3 | -------------------------------------------------------------------------------- /Documentation/DEBIAN: -------------------------------------------------------------------------------- 1 | https://www.debian.org/doc/manuals/maint-guide/dreq.en.html 2 | -------------------------------------------------------------------------------- /Documentation/DEFINES: -------------------------------------------------------------------------------- 1 | GLITCH_FUTURE 2 | 3 | Some logic is incomplete and this option is a review reminder. 4 | 5 | GLITCH_MEASURE_ELAPSED_TIME 6 | 7 | Measure various execution times. 8 | 9 | GLITCH_PDF_SUPPORTED 10 | 11 | Defined if the Qt modules pdf and pdfwidgets are discovered. 12 | 13 | GLITCH_SERIAL_PORT_SUPPORTED 14 | 15 | Defined if the Qt module serialport is discovered. 16 | -------------------------------------------------------------------------------- /Documentation/Glitch.1: -------------------------------------------------------------------------------- 1 | .TH Glitch 1 "April 26, 2025" 2 | .SH NAME 3 | Glitch 4 | .SH SYNOPSIS 5 | .B Glitch [file.db] ... [file.db] [options] 6 | .SH DESCRIPTION 7 | .B Glitch 8 | is a graphical interface capable of generating Arduino-compliant source from 9 | graphical diagrams. 10 | .SH OPTIONS 11 | .TP 12 | .BI --full-screen 13 | Display Glitch in a full-screen window. 14 | .TP 15 | .BI --generate-source 16 | Generate the source of the diagrams specified by --open-arduino-diagrams. 17 | .TP 18 | .BI --help 19 | Display available command-line options. 20 | .TP 21 | .BI --new-arduino-diagram " diagram-name" 22 | Create the specified Arduino diagram. Multiple instances are supported. 23 | .TP 24 | .BI --open-arduino-diagrams " file-name(s)" 25 | Open the specified Arduino diagram(s). Multiple instances are supported. 26 | This option is optional as Glitch will attempt to open a file having an 27 | extension of db. 28 | .TP 29 | .BI --show-serial-port-window 30 | Display the Serial Port Window. 31 | .TP 32 | .BI --show-tools 33 | Display Tools dialog(s). Requires a diagram. 34 | .TP 35 | .BI --version 36 | Display version information. Exit. 37 | .SH NOTES 38 | .SH AUTHOR(S) 39 | .B Alexis Megas 40 | -------------------------------------------------------------------------------- /Documentation/Glitch.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Documentation/Glitch.odt -------------------------------------------------------------------------------- /Documentation/Glitch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Documentation/Glitch.pdf -------------------------------------------------------------------------------- /Documentation/KDE: -------------------------------------------------------------------------------- 1 | Please add the following to ~/.config/kdeglobals on KDE systems. 2 | The setting will disable automatic mnemonics. 3 | 4 | [Development] 5 | AutoCheckAccelerators=false 6 | -------------------------------------------------------------------------------- /Documentation/QT: -------------------------------------------------------------------------------- 1 | Android 2 | 3 | OpenJDK 17 is required with Qt 6.5 LTS. 4 | 5 | MacOS 6 | 7 | Please utilize the newest Qt LTS provided by Homebrew or Qt. 8 | 9 | Qt 10 | 11 | Qt 5.5.1 (PowerPC) 12 | Qt LTS 13 | -------------------------------------------------------------------------------- /Documentation/README.QT4: -------------------------------------------------------------------------------- 1 | Qt 4 is not supported! 2 | -------------------------------------------------------------------------------- /Documentation/documentation.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Arduino/Arduino.pdf 4 | ReleaseNotes.html 5 | 6 | 7 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-ASCIITable.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-ASCIITable.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-ASCIITable.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ASCII table 3 | 4 | Prints out byte values in all possible formats: 5 | - as raw binary values 6 | - as ASCII-encoded decimal, hex, octal, and binary values 7 | 8 | For more on ASCII, see http://www.asciitable.com and http://en.wikipedia.org/wiki/ASCII 9 | 10 | The circuit: No external hardware needed. 11 | 12 | created 2006 13 | by Nicholas Zambetti 14 | modified 9 Apr 2012 15 | by Tom Igoe 16 | 17 | This example code is in the public domain. 18 | 19 | https://www.arduino.cc/en/Tutorial/BuiltInExamples/ASCIITable 20 | */ 21 | 22 | void setup() { 23 | //Initialize serial and wait for port to open: 24 | Serial.begin(9600); 25 | while (!Serial) { 26 | ; // wait for serial port to connect. Needed for native USB port only 27 | } 28 | 29 | // prints title with ending line break 30 | Serial.println("ASCII Table ~ Character Map"); 31 | } 32 | 33 | // first visible ASCIIcharacter '!' is number 33: 34 | int thisByte = 33; 35 | // you can also write ASCII characters in single quotes. 36 | // for example, '!' is the same as 33, so you could also use this: 37 | // int thisByte = '!'; 38 | 39 | void loop() { 40 | // prints value unaltered, i.e. the raw binary version of the byte. 41 | // The Serial Monitor interprets all bytes as ASCII, so 33, the first number, 42 | // will show up as '!' 43 | Serial.write(thisByte); 44 | 45 | Serial.print(", dec: "); 46 | // prints value as string as an ASCII-encoded decimal (base 10). 47 | // Decimal is the default format for Serial.print() and Serial.println(), 48 | // so no modifier is needed: 49 | Serial.print(thisByte); 50 | // But you can declare the modifier for decimal if you want to. 51 | // this also works if you uncomment it: 52 | 53 | // Serial.print(thisByte, DEC); 54 | 55 | 56 | Serial.print(", hex: "); 57 | // prints value as string in hexadecimal (base 16): 58 | Serial.print(thisByte, HEX); 59 | 60 | Serial.print(", oct: "); 61 | // prints value as string in octal (base 8); 62 | Serial.print(thisByte, OCT); 63 | 64 | Serial.print(", bin: "); 65 | // prints value as string in binary (base 2) also prints ending line break: 66 | Serial.println(thisByte, BIN); 67 | 68 | // if printed last visible character '~' or 126, stop: 69 | if (thisByte == 126) { // you could also use if (thisByte == '~') { 70 | // This loop loops forever and does nothing 71 | while (true) { 72 | continue; 73 | } 74 | } 75 | // go on to the next character 76 | thisByte++; 77 | } 78 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-AnalogReadSerial.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-AnalogReadSerial.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-AnalogReadSerial.ino: -------------------------------------------------------------------------------- 1 | /* 2 | AnalogReadSerial 3 | 4 | Reads an analog input on pin 0, prints the result to the Serial Monitor. 5 | Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu). 6 | Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. 7 | 8 | This example code is in the public domain. 9 | 10 | https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogReadSerial 11 | */ 12 | 13 | // the setup routine runs once when you press reset: 14 | void setup() { 15 | // initialize serial communication at 9600 bits per second: 16 | Serial.begin(9600); 17 | } 18 | 19 | // the loop routine runs over and over again forever: 20 | void loop() { 21 | // read the input on analog pin 0: 22 | int sensorValue = analogRead(A0); 23 | // print out the value you read: 24 | Serial.println(sensorValue); 25 | delay(1); // delay in between reads for stability 26 | } 27 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-Blink.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-Blink.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-Blink.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Blink 3 | 4 | Turns an LED on for one second, then off for one second, repeatedly. 5 | 6 | Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO 7 | it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to 8 | the correct LED pin independent of which board is used. 9 | If you want to know what pin the on-board LED is connected to on your Arduino 10 | model, check the Technical Specs of your board at: 11 | https://www.arduino.cc/en/Main/Products 12 | 13 | modified 8 May 2014 14 | by Scott Fitzgerald 15 | modified 2 Sep 2016 16 | by Arturo Guadalupi 17 | modified 8 Sep 2016 18 | by Colby Newman 19 | 20 | This example code is in the public domain. 21 | 22 | https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink 23 | */ 24 | 25 | // the setup function runs once when you press reset or power the board 26 | void setup() { 27 | // initialize digital pin LED_BUILTIN as an output. 28 | pinMode(LED_BUILTIN, OUTPUT); 29 | } 30 | 31 | // the loop function runs over and over again forever 32 | void loop() { 33 | digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) 34 | delay(1000); // wait for a second 35 | digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW 36 | delay(1000); // wait for a second 37 | } 38 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-BlinkWithoutDelay.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-BlinkWithoutDelay.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-BlinkWithoutDelay.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Blink without Delay 3 | 4 | Turns on and off a light emitting diode (LED) connected to a digital pin, 5 | without using the delay() function. This means that other code can run at the 6 | same time without being interrupted by the LED code. 7 | 8 | The circuit: 9 | - Use the onboard LED. 10 | - Note: Most Arduinos have an on-board LED you can control. On the UNO, MEGA 11 | and ZERO it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN 12 | is set to the correct LED pin independent of which board is used. 13 | If you want to know what pin the on-board LED is connected to on your 14 | Arduino model, check the Technical Specs of your board at: 15 | https://www.arduino.cc/en/Main/Products 16 | 17 | created 2005 18 | by David A. Mellis 19 | modified 8 Feb 2010 20 | by Paul Stoffregen 21 | modified 11 Nov 2013 22 | by Scott Fitzgerald 23 | modified 9 Jan 2017 24 | by Arturo Guadalupi 25 | 26 | This example code is in the public domain. 27 | 28 | https://www.arduino.cc/en/Tutorial/BuiltInExamples/BlinkWithoutDelay 29 | */ 30 | 31 | // constants won't change. Used here to set a pin number: 32 | const int ledPin = LED_BUILTIN;// the number of the LED pin 33 | 34 | // Variables will change: 35 | int ledState = LOW; // ledState used to set the LED 36 | 37 | // Generally, you should use "unsigned long" for variables that hold time 38 | // The value will quickly become too large for an int to store 39 | unsigned long previousMillis = 0; // will store last time LED was updated 40 | 41 | // constants won't change: 42 | const long interval = 1000; // interval at which to blink (milliseconds) 43 | 44 | void setup() { 45 | // set the digital pin as output: 46 | pinMode(ledPin, OUTPUT); 47 | } 48 | 49 | void loop() { 50 | // here is where you'd put code that needs to be running all the time. 51 | 52 | // check to see if it's time to blink the LED; that is, if the difference 53 | // between the current time and last time you blinked the LED is bigger than 54 | // the interval at which you want to blink the LED. 55 | unsigned long currentMillis = millis(); 56 | 57 | if (currentMillis - previousMillis >= interval) { 58 | // save the last time you blinked the LED 59 | previousMillis = currentMillis; 60 | 61 | // if the LED is off turn it on and vice-versa: 62 | if (ledState == LOW) { 63 | ledState = HIGH; 64 | } else { 65 | ledState = LOW; 66 | } 67 | 68 | // set the LED with the ledState of the variable: 69 | digitalWrite(ledPin, ledState); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-Button.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Button 3 | 4 | Turns on and off a light emitting diode(LED) connected to digital pin 13, 5 | when pressing a pushbutton attached to pin 2. 6 | 7 | The circuit: 8 | - LED attached from pin 13 to ground through 220 ohm resistor 9 | - pushbutton attached to pin 2 from +5V 10 | - 10K resistor attached to pin 2 from ground 11 | 12 | - Note: on most Arduinos there is already an LED on the board 13 | attached to pin 13. 14 | 15 | created 2005 16 | by DojoDave 17 | modified 30 Aug 2011 18 | by Tom Igoe 19 | 20 | This example code is in the public domain. 21 | 22 | https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button 23 | */ 24 | 25 | // constants won't change. They're used here to set pin numbers: 26 | const int buttonPin = 2; // the number of the pushbutton pin 27 | const int ledPin = 13; // the number of the LED pin 28 | 29 | // variables will change: 30 | int buttonState = 0; // variable for reading the pushbutton status 31 | 32 | void setup() { 33 | // initialize the LED pin as an output: 34 | pinMode(ledPin, OUTPUT); 35 | // initialize the pushbutton pin as an input: 36 | pinMode(buttonPin, INPUT); 37 | } 38 | 39 | void loop() { 40 | // read the state of the pushbutton value: 41 | buttonState = digitalRead(buttonPin); 42 | 43 | // check if the pushbutton is pressed. If it is, the buttonState is HIGH: 44 | if (buttonState == HIGH) { 45 | // turn LED on: 46 | digitalWrite(ledPin, HIGH); 47 | } else { 48 | // turn LED off: 49 | digitalWrite(ledPin, LOW); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-Diagram-SipHash.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-Diagram-SipHash.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-DigitalReadSerial.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-DigitalReadSerial.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-DigitalReadSerial.ino: -------------------------------------------------------------------------------- 1 | /* 2 | DigitalReadSerial 3 | 4 | Reads a digital input on pin 2, prints the result to the Serial Monitor 5 | 6 | This example code is in the public domain. 7 | 8 | https://www.arduino.cc/en/Tutorial/BuiltInExamples/DigitalReadSerial 9 | */ 10 | 11 | // digital pin 2 has a pushbutton attached to it. Give it a name: 12 | int pushButton = 2; 13 | 14 | // the setup routine runs once when you press reset: 15 | void setup() { 16 | // initialize serial communication at 9600 bits per second: 17 | Serial.begin(9600); 18 | // make the pushbutton's pin an input: 19 | pinMode(pushButton, INPUT); 20 | } 21 | 22 | // the loop routine runs over and over again forever: 23 | void loop() { 24 | // read the input pin: 25 | int buttonState = digitalRead(pushButton); 26 | // print out the state of the button: 27 | Serial.println(buttonState); 28 | delay(1); // delay in between reads for stability 29 | } 30 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-Fade.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-Fade.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-Fade.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Fade 3 | 4 | This example shows how to fade an LED on pin 9 using the analogWrite() 5 | function. 6 | 7 | The analogWrite() function uses PWM, so if you want to change the pin you're 8 | using, be sure to use another PWM capable pin. On most Arduino, the PWM pins 9 | are identified with a "~" sign, like ~3, ~5, ~6, ~9, ~10 and ~11. 10 | 11 | This example code is in the public domain. 12 | 13 | https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fade 14 | */ 15 | 16 | int led = 9; // the PWM pin the LED is attached to 17 | int brightness = 0; // how bright the LED is 18 | int fadeAmount = 5; // how many points to fade the LED by 19 | 20 | // the setup routine runs once when you press reset: 21 | void setup() { 22 | // declare pin 9 to be an output: 23 | pinMode(led, OUTPUT); 24 | } 25 | 26 | // the loop routine runs over and over again forever: 27 | void loop() { 28 | // set the brightness of pin 9: 29 | analogWrite(led, brightness); 30 | 31 | // change the brightness for next time through the loop: 32 | brightness = brightness + fadeAmount; 33 | 34 | // reverse the direction of the fading at the ends of the fade: 35 | if (brightness <= 0 || brightness >= 255) { 36 | fadeAmount = -fadeAmount; 37 | } 38 | // wait for 30 milliseconds to see the dimming effect 39 | delay(30); 40 | } 41 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-ReadAnalogVoltage.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-ReadAnalogVoltage.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-ReadAnalogVoltage.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ReadAnalogVoltage 3 | 4 | Reads an analog input on pin 0, converts it to voltage, and prints the result to the Serial Monitor. 5 | Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu). 6 | Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. 7 | 8 | This example code is in the public domain. 9 | 10 | https://www.arduino.cc/en/Tutorial/BuiltInExamples/ReadAnalogVoltage 11 | */ 12 | 13 | // the setup routine runs once when you press reset: 14 | void setup() { 15 | // initialize serial communication at 9600 bits per second: 16 | Serial.begin(9600); 17 | } 18 | 19 | // the loop routine runs over and over again forever: 20 | void loop() { 21 | // read the input on analog pin 0: 22 | int sensorValue = analogRead(A0); 23 | // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): 24 | float voltage = sensorValue * (5.0 / 1023.0); 25 | // print out the value you read: 26 | Serial.println(voltage); 27 | } 28 | -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-ReadSens-and-Condition.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Examples/Arduino/Arduino-ReadSens-and-Condition.db -------------------------------------------------------------------------------- /Examples/Arduino/Arduino-ReadSens-and-Condition.ino: -------------------------------------------------------------------------------- 1 | int ReadSens_and_Condition(){ 2 | int i; 3 | int sval = 0; 4 | 5 | for (i = 0; i < 5; i++){ 6 | sval = sval + analogRead(0); // sensor on analog pin 0 7 | } 8 | 9 | sval = sval / 5; // average 10 | sval = sval / 4; // scale to 8 bits (0 - 255) 11 | sval = 255 - sval; // invert output 12 | return sval; 13 | } 14 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-ASCIITable/Glitch-Arduino-ASCIITable.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Apr 21 19:59:33 2025 3 | 4 | int thisByte = 33; 5 | 6 | void loop(void) 7 | { 8 | Serial.write(thisByte); 9 | Serial.print(", dec: "); 10 | Serial.print(thisByte); 11 | Serial.print(", hex: "); 12 | Serial.print(thisByte, HEX); 13 | Serial.print(", oct: "); 14 | Serial.print(thisByte, OCT); 15 | Serial.print(", bin: "); 16 | Serial.println(thisByte, BIN); 17 | if(thisByte == 126) 18 | { 19 | while(true) 20 | { 21 | continue; 22 | } 23 | } 24 | thisByte = ((thisByte) + (1)); 25 | } 26 | 27 | void setup(void) 28 | { 29 | Serial.begin(9600); 30 | while(!Serial) 31 | { 32 | } 33 | Serial.println("ASCII Table ~ Character Map"); 34 | } 35 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-AnalogReadSerial/Glitch-Arduino-AnalogReadSerial.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Apr 21 19:59:36 2025 3 | 4 | void loop(void) 5 | { 6 | int sensorValue = analogRead(A0); 7 | Serial.println(sensorValue); 8 | delay(1); 9 | } 10 | 11 | void setup(void) 12 | { 13 | Serial.begin(9600); 14 | } 15 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-Blink/Glitch-Arduino-Blink.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Apr 21 19:59:30 2025 3 | 4 | void loop(void) 5 | { 6 | digitalWrite(LED_BUILTIN, HIGH); 7 | delay(1000); 8 | digitalWrite(LED_BUILTIN, LOW); 9 | delay(1000); 10 | } 11 | 12 | void setup(void) 13 | { 14 | pinMode(LED_BUILTIN, OUTPUT); 15 | } 16 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-BlinkWithoutDelay/Glitch-Arduino-BlinkWithoutDelay.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Apr 21 19:59:28 2025 3 | 4 | const int ledPin = LED_BUILTIN; 5 | 6 | int ledState = LOW; 7 | 8 | unsigned long previousMillis = 0; 9 | 10 | const long interval = 1000; 11 | 12 | void loop(void) 13 | { 14 | unsigned long currentMillis = millis(); 15 | if(currentMillis - previousMillis >= interval) 16 | { 17 | previousMillis = currentMillis; 18 | if(ledState == LOW) 19 | { 20 | ledState = HIGH; 21 | } 22 | else 23 | { 24 | ledState = LOW; 25 | } 26 | digitalWrite(ledPin, ledState); 27 | } 28 | } 29 | 30 | void setup(void) 31 | { 32 | pinMode(ledPin, OUTPUT); 33 | } 34 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-Button/Glitch-Arduino-Button.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Aug 1 22:52:06 2022 3 | 4 | const int buttonPin = 2; 5 | 6 | const int ledPin = 13; 7 | 8 | int buttonState = 0; 9 | 10 | void loop(void) 11 | { 12 | buttonState = digitalRead(buttonPin); 13 | if(buttonState == HIGH) 14 | { 15 | digitalWrite(ledPin, HIGH); 16 | } 17 | else 18 | { 19 | digitalWrite(ledPin, LOW); 20 | } 21 | } 22 | 23 | void setup(void) 24 | { 25 | pinMode(ledPin, OUTPUT); 26 | pinMode(buttonPin, INPUT); 27 | } 28 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-DigitalReadSerial/Glitch-Arduino-DigitalReadSerial.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Apr 21 19:59:22 2025 3 | 4 | int pushButton = 2; 5 | 6 | void loop(void) 7 | { 8 | int buttonState = digitalRead(pushButton); 9 | Serial.println(buttonState); 10 | delay(1); 11 | } 12 | 13 | void setup(void) 14 | { 15 | Serial.begin(9600); 16 | pinMode(pushButton, INPUT); 17 | } 18 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-Fade/Glitch-Arduino-Fade.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Apr 21 19:59:19 2025 3 | 4 | int brightness = 0; 5 | 6 | int fadeAmount = 5; 7 | 8 | int led = 9; 9 | 10 | void loop(void) 11 | { 12 | analogWrite(led, brightness); 13 | brightness = ((brightness) + (fadeAmount)); 14 | if(brightness <=0 || brightness >= 255) 15 | { 16 | fadeAmount = ((0) - (fadeAmount)); 17 | } 18 | delay(30); 19 | } 20 | 21 | void setup(void) 22 | { 23 | pinMode(led, OUTPUT); 24 | } 25 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-ReadAnalogVoltage/Glitch-Arduino-ReadAnalogVoltage.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Apr 21 19:59:16 2025 3 | 4 | void loop(void) 5 | { 6 | int sensorValue = analogRead(A0); 7 | float voltage = ((sensorValue) * (((5.0) / (1023.0)))); 8 | Serial.println(voltage); 9 | } 10 | 11 | void setup(void) 12 | { 13 | Serial.begin(9600); 14 | } 15 | -------------------------------------------------------------------------------- /Examples/Arduino/Glitch-Arduino-ReadSens-and-Condition/Glitch-Arduino-ReadSens-and-Condition.ino: -------------------------------------------------------------------------------- 1 | // Generated by Glitch! 2 | // Mon Apr 21 19:59:13 2025 3 | 4 | int ReadSens_and_Condition(void) 5 | { 6 | int i ; 7 | int sval = 0; 8 | sval = ((sval) / (5)); 9 | for(i = 0; i < 5; i++) 10 | { 11 | sval = ((sval) + (analogRead(0))); 12 | } 13 | sval = ((sval) / (4)); 14 | sval = ((255) - (sval)); 15 | return(sval); 16 | } 17 | 18 | void loop(void) 19 | { 20 | } 21 | 22 | void setup(void) 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /Examples/Arduino/README: -------------------------------------------------------------------------------- 1 | Examples from https://docs.arduino.cc/built-in-examples translated to Glitch! 2 | 3 | Please copy the files into your home directory because of permissions! 4 | -------------------------------------------------------------------------------- /Icons/Arduino/analog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/analog.png -------------------------------------------------------------------------------- /Icons/Arduino/arithmetic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/arithmetic.png -------------------------------------------------------------------------------- /Icons/Arduino/ascii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/ascii.png -------------------------------------------------------------------------------- /Icons/Arduino/binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/binary.png -------------------------------------------------------------------------------- /Icons/Arduino/boolean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/boolean.png -------------------------------------------------------------------------------- /Icons/Arduino/catalog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/catalog.png -------------------------------------------------------------------------------- /Icons/Arduino/compound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/compound.png -------------------------------------------------------------------------------- /Icons/Arduino/constant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/constant.png -------------------------------------------------------------------------------- /Icons/Arduino/convert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/convert.png -------------------------------------------------------------------------------- /Icons/Arduino/decoration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/decoration.png -------------------------------------------------------------------------------- /Icons/Arduino/digital.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/digital.png -------------------------------------------------------------------------------- /Icons/Arduino/flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/flow.png -------------------------------------------------------------------------------- /Icons/Arduino/interrupt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/interrupt.png -------------------------------------------------------------------------------- /Icons/Arduino/mathematics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/mathematics.png -------------------------------------------------------------------------------- /Icons/Arduino/pulse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/pulse.png -------------------------------------------------------------------------------- /Icons/Arduino/random.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/random.png -------------------------------------------------------------------------------- /Icons/Arduino/serial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/serial.png -------------------------------------------------------------------------------- /Icons/Arduino/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/structure.png -------------------------------------------------------------------------------- /Icons/Arduino/syntax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/syntax.png -------------------------------------------------------------------------------- /Icons/Arduino/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/time.png -------------------------------------------------------------------------------- /Icons/Arduino/trigonometry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/trigonometry.png -------------------------------------------------------------------------------- /Icons/Arduino/utilities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/utilities.png -------------------------------------------------------------------------------- /Icons/Arduino/variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/variable.png -------------------------------------------------------------------------------- /Icons/Arduino/xor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Arduino/xor.png -------------------------------------------------------------------------------- /Icons/Logo/glitch-arduino-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Logo/glitch-arduino-logo.png -------------------------------------------------------------------------------- /Icons/Logo/glitch-logo.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Logo/glitch-logo.icns -------------------------------------------------------------------------------- /Icons/Logo/glitch-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Logo/glitch-logo.ico -------------------------------------------------------------------------------- /Icons/Logo/glitch-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/Logo/glitch-logo.png -------------------------------------------------------------------------------- /Icons/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/about.png -------------------------------------------------------------------------------- /Icons/adjust-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/adjust-size.png -------------------------------------------------------------------------------- /Icons/bottom-align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/bottom-align.png -------------------------------------------------------------------------------- /Icons/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/clear.png -------------------------------------------------------------------------------- /Icons/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/close.png -------------------------------------------------------------------------------- /Icons/compress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/compress.png -------------------------------------------------------------------------------- /Icons/context-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/context-menu.png -------------------------------------------------------------------------------- /Icons/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/copy.png -------------------------------------------------------------------------------- /Icons/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/delete.png -------------------------------------------------------------------------------- /Icons/disconnect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/disconnect.png -------------------------------------------------------------------------------- /Icons/document-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/document-edit.png -------------------------------------------------------------------------------- /Icons/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/down.png -------------------------------------------------------------------------------- /Icons/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/find.png -------------------------------------------------------------------------------- /Icons/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/font.png -------------------------------------------------------------------------------- /Icons/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/fullscreen.png -------------------------------------------------------------------------------- /Icons/glitch.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "Logo/glitch-logo.ico" 2 | -------------------------------------------------------------------------------- /Icons/horizontal-center-align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/horizontal-center-align.png -------------------------------------------------------------------------------- /Icons/horizontal-stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/horizontal-stack.png -------------------------------------------------------------------------------- /Icons/icons.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Arduino/analog.png 4 | Arduino/arithmetic.png 5 | Arduino/ascii.png 6 | Arduino/binary.png 7 | Arduino/boolean.png 8 | Arduino/catalog.png 9 | Arduino/compound.png 10 | Arduino/constant.png 11 | Arduino/convert.png 12 | Arduino/decoration.png 13 | Arduino/digital.png 14 | Arduino/flow.png 15 | Arduino/interrupt.png 16 | Arduino/mathematics.png 17 | Arduino/pulse.png 18 | Arduino/random.png 19 | Arduino/serial.png 20 | Arduino/structure.png 21 | Arduino/syntax.png 22 | Arduino/time.png 23 | Arduino/trigonometry.png 24 | Arduino/utilities.png 25 | Arduino/variable.png 26 | Arduino/xor.png 27 | Logo/glitch-arduino-logo.png 28 | Logo/glitch-logo.png 29 | about.png 30 | adjust-size.png 31 | bottom-align.png 32 | clear.png 33 | close.png 34 | compress.png 35 | context-menu.png 36 | copy.png 37 | delete.png 38 | disconnect.png 39 | document-edit.png 40 | down.png 41 | find.png 42 | font.png 43 | fullscreen.png 44 | horizontal-center-align.png 45 | horizontal-stack.png 46 | language.png 47 | left-align.png 48 | missing-image.png 49 | new-document.png 50 | next.png 51 | open.png 52 | paste.png 53 | pin.png 54 | png.png 55 | previous.png 56 | print.png 57 | quit.png 58 | recent.png 59 | redo.png 60 | reset.png 61 | right-align.png 62 | save-as.png 63 | save.png 64 | select-all.png 65 | settings.png 66 | source.png 67 | tools.png 68 | top-align.png 69 | undo.png 70 | upload.png 71 | verify.png 72 | vertical-center-align.png 73 | vertical-stack.png 74 | widget-properties.png 75 | wire.png 76 | zoom-in.png 77 | zoom-out.png 78 | zoom-reset.png 79 | 80 | 81 | -------------------------------------------------------------------------------- /Icons/language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/language.png -------------------------------------------------------------------------------- /Icons/left-align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/left-align.png -------------------------------------------------------------------------------- /Icons/missing-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/missing-image.png -------------------------------------------------------------------------------- /Icons/new-document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/new-document.png -------------------------------------------------------------------------------- /Icons/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/next.png -------------------------------------------------------------------------------- /Icons/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/open.png -------------------------------------------------------------------------------- /Icons/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/paste.png -------------------------------------------------------------------------------- /Icons/pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/pin.png -------------------------------------------------------------------------------- /Icons/png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/png.png -------------------------------------------------------------------------------- /Icons/previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/previous.png -------------------------------------------------------------------------------- /Icons/print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/print.png -------------------------------------------------------------------------------- /Icons/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/quit.png -------------------------------------------------------------------------------- /Icons/recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/recent.png -------------------------------------------------------------------------------- /Icons/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/redo.png -------------------------------------------------------------------------------- /Icons/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/reset.png -------------------------------------------------------------------------------- /Icons/right-align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/right-align.png -------------------------------------------------------------------------------- /Icons/save-as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/save-as.png -------------------------------------------------------------------------------- /Icons/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/save.png -------------------------------------------------------------------------------- /Icons/select-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/select-all.png -------------------------------------------------------------------------------- /Icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/settings.png -------------------------------------------------------------------------------- /Icons/source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/source.png -------------------------------------------------------------------------------- /Icons/tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/tools.png -------------------------------------------------------------------------------- /Icons/top-align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/top-align.png -------------------------------------------------------------------------------- /Icons/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/undo.png -------------------------------------------------------------------------------- /Icons/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/upload.png -------------------------------------------------------------------------------- /Icons/verify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/verify.png -------------------------------------------------------------------------------- /Icons/vertical-center-align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/vertical-center-align.png -------------------------------------------------------------------------------- /Icons/vertical-stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/vertical-stack.png -------------------------------------------------------------------------------- /Icons/widget-properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/widget-properties.png -------------------------------------------------------------------------------- /Icons/wire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/wire.png -------------------------------------------------------------------------------- /Icons/zoom-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/zoom-in.png -------------------------------------------------------------------------------- /Icons/zoom-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/zoom-out.png -------------------------------------------------------------------------------- /Icons/zoom-reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Icons/zoom-reset.png -------------------------------------------------------------------------------- /Images/glitch-android-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Images/glitch-android-1.png -------------------------------------------------------------------------------- /Images/glitch-android-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Images/glitch-android-2.png -------------------------------------------------------------------------------- /Images/glitch-arduino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Images/glitch-arduino.png -------------------------------------------------------------------------------- /Images/glitch-macos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textbrowser/glitch/bfa5cb1c3ea22cc2622f2a4a641dc182cb363038/Images/glitch-macos.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2004 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | -------------------------------------------------------------------------------- /Qt/qt.conf: -------------------------------------------------------------------------------- 1 | [Paths] 2 | Plugins = plugins 3 | -------------------------------------------------------------------------------- /Qup.d/qup.txt: -------------------------------------------------------------------------------- 1 | # Qup definitions file. 2 | # Visit https://github.com/textbrowser/qup. 3 | 4 | # Sorted order of keys is required. 5 | 6 | [General] 7 | 8 | file = glitch-logo.png 9 | file_destination = . 10 | url = https://github.com/textbrowser/glitch/releases/download/qup 11 | 12 | [General] 13 | 14 | file = Arduino.pdf 15 | file = Glitch.1 16 | file = Glitch.pdf 17 | file = REMINDERS 18 | file_destination = Documentation 19 | url = https://github.com/textbrowser/glitch/releases/download/qup 20 | 21 | [MacOS] 22 | 23 | executable = Glitch_Intel.app.zip 24 | local_executable = Glitch.app 25 | url = https://github.com/textbrowser/glitch/releases/download/qup 26 | 27 | [Unix] 28 | 29 | executable = Glitch_PiOS_12_ARM 30 | executable = Glitch_PiOS_12_ARM64 31 | executable = Glitch_Ubuntu_16_PowerPC 32 | executable = Glitch_Ubuntu_24_AMD64 33 | file = ./glitch.desktop 34 | local_executable = Glitch 35 | shell = ./glitch.sh 36 | url = https://github.com/textbrowser/glitch/releases/download/qup 37 | 38 | [Windows] 39 | 40 | executable = Glitch_Intel.exe 41 | local_executable = Glitch.exe 42 | url = https://github.com/textbrowser/glitch/releases/download/qup 43 | 44 | # End of file. Required comment. 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Life is a glitch. Your Arduino projects should not be. 2 | Awesome diagrams for the curious. 3 | 4 | Glitch is a graphical lightweight interactive tool and compiler hybrid. 5 | Generate Arduino software via beautiful graphical diagrams (blueprints). 6 | Now with a natural language processor! 7 | 8 | Glitch, originally QtNQC, was discovered in 2004! 9 | 10 |

Summary of Glitch

11 | 12 | 37 | 38 | ![Glitch](https://github.com/textbrowser/glitch/blob/master/Images/glitch-android-1.png) 39 | ![Glitch](https://github.com/textbrowser/glitch/blob/master/Images/glitch-android-2.png) 40 | ![Glitch](https://github.com/textbrowser/glitch/blob/master/Images/glitch-arduino.png) 41 | ![Glitch](https://github.com/textbrowser/glitch/blob/master/Images/glitch-macos.png) 42 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-arithmetic-operator-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_arithmetic_operator_arduino_h_ 29 | #define _glitch_object_arithmetic_operator_arduino_h_ 30 | 31 | #include "glitch-object-simple-text-arduino.h" 32 | 33 | class glitch_object_arithmetic_operator_arduino: 34 | public glitch_object_simple_text_arduino 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | enum class OperatorTypes 40 | { 41 | ADDITION_OPERATOR = 0, 42 | DIVISION_OPERATOR, 43 | MULTIPLICATION_OPERATOR, 44 | REMAINDER_OPERATOR, 45 | SUBTRACTION_OPERATOR 46 | }; 47 | 48 | glitch_object_arithmetic_operator_arduino(const QString &operatorType, 49 | QWidget *parent); 50 | ~glitch_object_arithmetic_operator_arduino(); 51 | QString code(void) const; 52 | QString arithmeticOperator(void) const; 53 | bool hasInput(void) const; 54 | bool hasOutput(void) const; 55 | bool isFullyWired(void) const; 56 | bool shouldPrint(void) const; 57 | glitch_object_arithmetic_operator_arduino *clone(QWidget *parent) const; 58 | static glitch_object_arithmetic_operator_arduino *createFromValues 59 | (const QMap &values, QString &error, QWidget *parent); 60 | void save(const QSqlDatabase &db, QString &error); 61 | void setOperatorType(const QString &operatorType); 62 | 63 | private: 64 | glitch_object_arithmetic_operator_arduino(QWidget *parent); 65 | glitch_object_arithmetic_operator_arduino(const qint64 id, QWidget *parent); 66 | OperatorTypes m_operatorType; 67 | void setOperatorType(const OperatorTypes operatorType); 68 | void setProperties(const QStringList &list); 69 | void setProperty(const Properties property, const QVariant &value); 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-bitwise-operator-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_bitwise_operator_arduino_h_ 29 | #define _glitch_object_bitwise_operator_arduino_h_ 30 | 31 | #include "glitch-object-simple-text-arduino.h" 32 | 33 | class glitch_object_bitwise_operator_arduino: 34 | public glitch_object_simple_text_arduino 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | enum class OperatorTypes 40 | { 41 | AND_OPERATOR = 0, 42 | LEFT_SHIFT_OPERATOR, 43 | NOT_OPERATOR, 44 | OR_OPERATOR, 45 | RIGHT_SHIFT_OPERATOR, 46 | XOR_OPERATOR 47 | }; 48 | 49 | glitch_object_bitwise_operator_arduino(const QString &operatorType, 50 | QWidget *parent); 51 | ~glitch_object_bitwise_operator_arduino(); 52 | QString code(void) const; 53 | QString bitwiseOperator(void) const; 54 | bool hasInput(void) const; 55 | bool hasOutput(void) const; 56 | bool isFullyWired(void) const; 57 | bool shouldPrint(void) const; 58 | glitch_object_bitwise_operator_arduino *clone(QWidget *parent) const; 59 | static glitch_object_bitwise_operator_arduino *createFromValues 60 | (const QMap &values, QString &error, QWidget *parent); 61 | void save(const QSqlDatabase &db, QString &error); 62 | void setOperatorType(const QString &operatorType); 63 | 64 | private: 65 | glitch_object_bitwise_operator_arduino(QWidget *parent); 66 | glitch_object_bitwise_operator_arduino(const qint64 id, QWidget *parent); 67 | void setOperatorType(const OperatorTypes operatorType); 68 | void setProperties(const QStringList &list); 69 | void setProperty(const Properties property, const QVariant &value); 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-block-comment-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_block_comment_arduino_h_ 29 | #define _glitch_object_block_comment_arduino_h_ 30 | 31 | #include "glitch-object.h" 32 | #include "ui_glitch-object-block-comment-arduino.h" 33 | 34 | class glitch_object_block_comment_arduino: public glitch_object 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | glitch_object_block_comment_arduino(QWidget *parent); 40 | ~glitch_object_block_comment_arduino(); 41 | QPlainTextEdit *plainTextEdit(void) const; 42 | QString code(void) const; 43 | bool isFullyWired(void) const; 44 | bool shouldPrint(void) const; 45 | glitch_object_block_comment_arduino *clone(QWidget *parent) const; 46 | static glitch_object_block_comment_arduino *createFromValues 47 | (const QMap &values, QString &error, QWidget *parent); 48 | void addActions(QMenu &menu); 49 | void save(const QSqlDatabase &db, QString &error); 50 | void setProperty(const Properties property, const QVariant &value); 51 | 52 | private: 53 | glitch_object_block_comment_arduino(const qint64 id, QWidget *parent); 54 | Ui_glitch_object_block_comment_arduino m_ui; 55 | void setProperties(const QStringList &list); 56 | 57 | private slots: 58 | void slotTextChanged(void); 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-constant-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_constant_arduino_h_ 29 | #define _glitch_object_constant_arduino_h_ 30 | 31 | #include "glitch-object.h" 32 | #include "ui_glitch-object-constant-arduino.h" 33 | 34 | class glitch_object_constant_arduino: public glitch_object 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | glitch_object_constant_arduino(const QString &constantType, QWidget *parent); 40 | ~glitch_object_constant_arduino(); 41 | QString code(void) const; 42 | QString constantType(void) const; 43 | bool hasOutput(void) const; 44 | bool isFullyWired(void) const; 45 | bool shouldPrint(void) const; 46 | static glitch_object_constant_arduino *createFromValues 47 | (const QMap &values, QString &error, QWidget *parent); 48 | glitch_object_constant_arduino *clone(QWidget *parent) const; 49 | void addActions(QMenu &menu); 50 | void save(const QSqlDatabase &db, QString &error); 51 | void setConstantType(const QString &constantType); 52 | 53 | private: 54 | glitch_object_constant_arduino(QWidget *parent); 55 | glitch_object_constant_arduino(const qint64 id, QWidget *parent); 56 | QSize preferredSize(void) const; 57 | Ui_glitch_object_constant_arduino m_ui; 58 | void compressWidget(const bool state); 59 | void setName(const QString &n); 60 | void setProperties(const QStringList &list); 61 | void setProperty(const Properties property, const QVariant &value); 62 | 63 | private slots: 64 | void slotAdjustSize(void); 65 | void slotConstantChanged(void); 66 | void slotOtherConstantChanged(void); 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-conversion-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_conversion_arduino_h_ 29 | #define _glitch_object_conversion_arduino_h_ 30 | 31 | #include "glitch-object-simple-text-arduino.h" 32 | 33 | class glitch_object_conversion_arduino: 34 | public glitch_object_simple_text_arduino 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | enum class ConversionTypes 40 | { 41 | BYTE = 0, 42 | CHAR, 43 | FLOAT, 44 | INT, 45 | LONG, 46 | UINT8_T, 47 | UINT16_T, 48 | UINT32_T, 49 | UNSIGNED_INT, 50 | UNSIGNED_LONG, 51 | WORD 52 | }; 53 | 54 | glitch_object_conversion_arduino(const QString &conversionType, 55 | QWidget *parent); 56 | ~glitch_object_conversion_arduino(); 57 | QString code(void) const; 58 | QString conversion(void) const; 59 | QString description(void) const; 60 | bool hasInput(void) const; 61 | bool hasOutput(void) const; 62 | bool isFullyWired(void) const; 63 | bool shouldPrint(void) const; 64 | glitch_object_conversion_arduino *clone(QWidget *parent) const; 65 | static glitch_object_conversion_arduino *createFromValues 66 | (const QMap &values, QString &error, QWidget *parent); 67 | void save(const QSqlDatabase &db, QString &error); 68 | void setConversionType(const QString &ct); 69 | 70 | private: 71 | glitch_object_conversion_arduino(QWidget *parent); 72 | glitch_object_conversion_arduino(const qint64 id, QWidget *parent); 73 | void setConversionType(const ConversionTypes conversionType); 74 | void setProperties(const QStringList &list); 75 | void setProperty(const Properties property, const QVariant &value); 76 | }; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-loop-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_loop_arduino_h_ 29 | #define _glitch_object_loop_arduino_h_ 30 | 31 | #include "glitch-object-simple-text-arduino.h" 32 | 33 | class glitch_object_loop_arduino: public glitch_object_simple_text_arduino 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | glitch_object_loop_arduino(QWidget *parent); 39 | ~glitch_object_loop_arduino(); 40 | QString code(void) const; 41 | bool hasView(void) const; 42 | bool isFullyWired(void) const; 43 | bool isMandatory(void) const; 44 | bool shouldPrint(void) const; 45 | glitch_object_loop_arduino *clone(QWidget *parent) const; 46 | void addActions(QMenu &menu); 47 | void createEditObjects(void); 48 | void hideOrShowOccupied(void); 49 | void save(const QSqlDatabase &db, QString &error); 50 | 51 | private: 52 | glitch_object_loop_arduino(const qint64 id, QWidget *parent); 53 | 54 | private slots: 55 | void slotCopy(void); 56 | void slotEdit(void); 57 | void slotHideOrShowOccupied(void); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-setup-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_setup_arduino_h_ 29 | #define _glitch_object_setup_arduino_h_ 30 | 31 | #include "glitch-object-simple-text-arduino.h" 32 | 33 | class glitch_object_setup_arduino: public glitch_object_simple_text_arduino 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | glitch_object_setup_arduino(QWidget *parent); 39 | ~glitch_object_setup_arduino(); 40 | QString code(void) const; 41 | bool hasView(void) const; 42 | bool isFullyWired(void) const; 43 | bool isMandatory(void) const; 44 | bool shouldPrint(void) const; 45 | glitch_object_setup_arduino *clone(QWidget *parent) const; 46 | void addActions(QMenu &menu); 47 | void createEditObjects(void); 48 | void hideOrShowOccupied(void); 49 | void save(const QSqlDatabase &db, QString &error); 50 | 51 | private: 52 | glitch_object_setup_arduino(const qint64 id, QWidget *parent); 53 | 54 | private slots: 55 | void slotCopy(void); 56 | void slotEdit(void); 57 | void slotHideOrShowOccupied(void); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-syntax-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_syntax_arduino_h_ 29 | #define _glitch_object_syntax_arduino_h_ 30 | 31 | #include "glitch-object.h" 32 | #include "ui_glitch-object-syntax-arduino.h" 33 | 34 | class glitch_object_syntax_arduino: public glitch_object 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | glitch_object_syntax_arduino(const QString &syntax, QWidget *parent); 40 | ~glitch_object_syntax_arduino(); 41 | 42 | QSize sizeHint(void) const 43 | { 44 | QFontMetrics const fontMetrics(font()); 45 | auto const width = 5 * qCeil 46 | (fontMetrics.boundingRect(m_ui.text->text().trimmed()).width() / 5.0); 47 | 48 | return QSize(s_widthTweak + width, qMax(50, fontMetrics.height())); 49 | } 50 | 51 | QString code(void) const; 52 | bool hasOutput(void) const; 53 | bool isFullyWired(void) const; 54 | bool shouldPrint(void) const; 55 | static glitch_object_syntax_arduino *createFromValues 56 | (const QMap &values, QString &error, QWidget *parent); 57 | glitch_object_syntax_arduino *clone(QWidget *parent) const; 58 | void addActions(QMenu &menu); 59 | void save(const QSqlDatabase &db, QString &error); 60 | 61 | private: 62 | glitch_object_syntax_arduino(QWidget *parent); 63 | glitch_object_syntax_arduino(const qint64 id, QWidget *parent); 64 | Ui_glitch_object_syntax_arduino m_ui; 65 | void setProperties(const QStringList &list); 66 | void setProperty(const Properties property, const QVariant &value); 67 | 68 | private slots: 69 | void slotSyntaxChanged(void); 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-object-variable-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_object_variable_arduino_h_ 29 | #define _glitch_object_variable_arduino_h_ 30 | 31 | #include "glitch-object.h" 32 | #include "ui_glitch-object-variable-arduino.h" 33 | 34 | class glitch_object_variable_arduino: public glitch_object 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | glitch_object_variable_arduino(const QString &variableType, QWidget *parent); 40 | ~glitch_object_variable_arduino(); 41 | QString code(void) const; 42 | bool hasInput(void) const; 43 | bool hasOutput(void) const; 44 | bool isFullyWired(void) const; 45 | bool shouldPrint(void) const; 46 | static glitch_object_variable_arduino *createFromValues 47 | (const QMap &values, QString &error, QWidget *parent); 48 | glitch_object_variable_arduino *clone(QWidget *parent) const; 49 | void addActions(QMenu &menu); 50 | void save(const QSqlDatabase &db, QString &error); 51 | 52 | private: 53 | glitch_object_variable_arduino(QWidget *parent); 54 | glitch_object_variable_arduino(const qint64 id, QWidget *parent); 55 | QSize preferredSize(void) const; 56 | Ui_glitch_object_variable_arduino m_ui; 57 | void compressWidget(const bool state); 58 | void connectSignals(const bool state); 59 | void prepareHighlights(void); 60 | void setName(const QString &n); 61 | void setProperties(const QStringList &list); 62 | void setProperty(const Properties property, const QVariant &value); 63 | 64 | private slots: 65 | void slotAdjustSize(void); 66 | void slotComboBoxChanged(void); 67 | void slotLineEditSet(void); 68 | void slotToolButtonChecked(void); 69 | void slotVariableTypeActionTriggered(void); 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /Source/Arduino/glitch-structures-arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_structures_arduino_h_ 29 | #define _glitch_structures_arduino_h_ 30 | 31 | #include 32 | #include 33 | 34 | #include "ui_glitch-structures.h" 35 | 36 | class glitch_collapse_expand_tool_button; 37 | 38 | class glitch_structures_arduino: public QDialog 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | glitch_structures_arduino(QWidget *parent); 44 | ~glitch_structures_arduino(); 45 | QFrame *frame(void) const; 46 | static QHash defaultColors(void); 47 | static QStringList keywords(void); 48 | static QStringList nonArrayVariableTypes(void); 49 | static QStringList sortedKeywords(void); 50 | static QStringList variableTypes(void); 51 | static bool containsStructure(const QString &structureName); 52 | static bool isReserved(const QString &t); 53 | void prepareCategories(void); 54 | void setIconSize(const QString &t); 55 | 56 | private: 57 | QMap m_categoriesMap; 58 | QTimer m_filterTimer; 59 | Ui_glitch_structures m_ui; 60 | glitch_collapse_expand_tool_button *m_collapse; 61 | static QMap s_itemsForIcons; 62 | static QMap s_itemsForCategories; 63 | static QMap s_structureNamesMap; 64 | static QStringList s_nonArrayVariableTypes; 65 | static QStringList s_variableTypes; 66 | static QStringList structureNames(void); 67 | 68 | private slots: 69 | void slotFilter(const QString &text); 70 | void slotFilter(void); 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /Source/CocoaInitializer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Remko Troncon. 3 | */ 4 | 5 | #ifndef COCOAINITIALIZER_H 6 | #define COCOAINITIALIZER_H 7 | 8 | class CocoaInitializer 9 | { 10 | public: 11 | CocoaInitializer(); 12 | ~CocoaInitializer(); 13 | 14 | private: 15 | class Private; 16 | Private *d; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/CocoaInitializer.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Remko Troncon. 3 | */ 4 | 5 | #include "CocoaInitializer.h" 6 | 7 | #include 8 | #include 9 | 10 | class CocoaInitializer::Private 11 | { 12 | public: 13 | NSAutoreleasePool *autoReleasePool_; 14 | }; 15 | 16 | CocoaInitializer::CocoaInitializer() 17 | { 18 | d = new CocoaInitializer::Private(); 19 | NSApplicationLoad(); 20 | d->autoReleasePool_ = [[NSAutoreleasePool alloc] init]; 21 | } 22 | 23 | CocoaInitializer::~CocoaInitializer() 24 | { 25 | [d->autoReleasePool_ release]; 26 | delete d; 27 | } 28 | -------------------------------------------------------------------------------- /Source/glitch-application.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_application_h_ 29 | #define _glitch_application_h_ 30 | 31 | #include 32 | 33 | class glitch_application: public QApplication 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | glitch_application(int &argc, char **argv); 39 | static int blockShortcuts(void); 40 | static void blockShortcutsDecrement(void); 41 | static void blockShortcutsIncrement(void); 42 | 43 | private: 44 | static QAtomicInteger s_blockShortcuts; 45 | bool eventFilter(QObject *object, QEvent *event); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Source/glitch-aware-containers.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_aware_containers_h_ 29 | #define _glitch_aware_containers_h_ 30 | 31 | #include 32 | 33 | class glitch_aware_container_object: public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | glitch_aware_container_object(QObject *parent):QObject(parent) 39 | { 40 | } 41 | 42 | signals: 43 | void cleared(void); 44 | void inserted(void); 45 | }; 46 | 47 | template 48 | class glitch_aware_multi_map: public QMultiMap, 49 | public glitch_aware_container_object 50 | { 51 | public: 52 | glitch_aware_multi_map(void):glitch_aware_container_object(nullptr) 53 | { 54 | } 55 | 56 | void clear(void) 57 | { 58 | QMultiMap::clear(); 59 | emit cleared(); 60 | } 61 | 62 | void insert(const K &key, const V &value) 63 | { 64 | QMultiMap::insert(key, value); 65 | emit inserted(); 66 | } 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /Source/glitch-canvas-preview.cc: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "glitch-canvas-preview.h" 29 | 30 | #include 31 | 32 | glitch_canvas_preview::glitch_canvas_preview(QWidget *parent):QWidget(parent) 33 | { 34 | m_ui.setupUi(this); 35 | m_ui.view->setRenderHints(QPainter::Antialiasing | 36 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) 37 | QPainter::LosslessImageRendering | 38 | #endif 39 | QPainter::SmoothPixmapTransform | 40 | QPainter::TextAntialiasing); 41 | 42 | QTransform transform; 43 | const qreal factor = 1.25; 44 | 45 | transform.scale(factor, factor); 46 | 47 | if(transform.isInvertible()) 48 | m_ui.view->setTransform(m_ui.view->transform() * transform.inverted()); 49 | 50 | m_ui.view->centerOn(QPointF(0.0, 0.0)); 51 | } 52 | 53 | glitch_canvas_preview::~glitch_canvas_preview() 54 | { 55 | } 56 | 57 | #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) 58 | void glitch_canvas_preview::enterEvent(QEnterEvent *event) 59 | #else 60 | void glitch_canvas_preview::enterEvent(QEvent *event) 61 | #endif 62 | { 63 | QWidget::enterEvent(event); 64 | m_ui.view->setFocus(); 65 | } 66 | 67 | void glitch_canvas_preview::mouseDoubleClickEvent(QMouseEvent *event) 68 | { 69 | QWidget::mouseDoubleClickEvent(event); 70 | 71 | if(m_ui.view->scene()) 72 | { 73 | foreach(auto view, m_ui.view->scene()->views()) 74 | if(m_ui.view != view) 75 | view->centerOn(m_ui.view->mapToScene(event->pos())); 76 | } 77 | } 78 | 79 | void glitch_canvas_preview::setScene(QGraphicsScene *scene) 80 | { 81 | m_ui.view->setScene(scene); 82 | } 83 | -------------------------------------------------------------------------------- /Source/glitch-canvas-preview.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_canvas_preview_h_ 29 | #define _glitch_canvas_preview_h_ 30 | 31 | #include "ui_glitch-canvas-preview.h" 32 | 33 | class glitch_canvas_preview: public QWidget 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | glitch_canvas_preview(QWidget *parent); 39 | ~glitch_canvas_preview(); 40 | void setScene(QGraphicsScene *scene); 41 | 42 | private: 43 | Ui_glitch_canvas_preview m_ui; 44 | #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) 45 | void enterEvent(QEnterEvent *event); 46 | #else 47 | void enterEvent(QEvent *event); 48 | #endif 49 | void mouseDoubleClickEvent(QMouseEvent *event); 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Source/glitch-common.cc: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "glitch-common.h" 29 | #include "glitch-variety.h" 30 | 31 | QAtomicInteger glitch_common::s_dbId = 0; 32 | QChar glitch_common::s_indentationCharacter = ' '; 33 | qreal glitch_common::s_maximumZValue = 100000000.0; 34 | qreal glitch_common::s_minimumZValue = -100000000.0; 35 | 36 | QSqlDatabase glitch_common::sqliteDatabase(void) 37 | { 38 | return QSqlDatabase::addDatabase 39 | ("QSQLITE", 40 | QString("glitch_database_%1").arg(s_dbId.fetchAndAddOrdered(1))); 41 | } 42 | 43 | QString glitch_common::projectTypeToString(const ProjectTypes projectType) 44 | { 45 | switch(projectType) 46 | { 47 | case ProjectTypes::ArduinoProject: 48 | return "ArduinoProject"; 49 | default: 50 | return ""; 51 | } 52 | } 53 | 54 | void glitch_common::discardDatabase(const QString &connectionName) 55 | { 56 | QSqlDatabase::removeDatabase(connectionName); 57 | } 58 | -------------------------------------------------------------------------------- /Source/glitch-common.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_common_h_ 29 | #define _glitch_common_h_ 30 | 31 | #include 32 | #include 33 | 34 | class glitch_common 35 | { 36 | public: 37 | enum class ProjectTypes 38 | { 39 | ArduinoProject = 0, 40 | XYZProject 41 | }; 42 | 43 | static QChar s_indentationCharacter; 44 | static qreal s_maximumZValue; 45 | static qreal s_minimumZValue; 46 | static QSqlDatabase sqliteDatabase(void); 47 | static QString projectTypeToString(const ProjectTypes projectType); 48 | static void discardDatabase(const QString &connectionName); 49 | 50 | private: 51 | glitch_common(void); 52 | ~glitch_common(void); 53 | static QAtomicInteger s_dbId; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Source/glitch-docked-container.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_docked_container_h_ 29 | #define _glitch_docked_container_h_ 30 | 31 | #include "ui_glitch-docked-container.h" 32 | 33 | class glitch_floating_context_menu; 34 | class glitch_user_functions_model; 35 | 36 | class glitch_docked_container: public QWidget 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | glitch_docked_container(QWidget *parent); 42 | ~glitch_docked_container(); 43 | void add(glitch_floating_context_menu *widget); 44 | void detach(void); 45 | 46 | private: 47 | Ui_glitch_docked_container m_ui; 48 | glitch_user_functions_model *m_model; 49 | 50 | private slots: 51 | void slotWidgetClosed(void); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Source/glitch-documentation.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_documentation_h_ 29 | #define _glitch_documentation_h_ 30 | 31 | #include "ui_glitch-documentation.h" 32 | 33 | #ifdef GLITCH_PDF_SUPPORTED 34 | class QPdfDocument; 35 | class QPdfView; 36 | #endif 37 | 38 | class glitch_documentation: public QMainWindow 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | glitch_documentation(QWidget *parent); 44 | glitch_documentation(const QString &fileName, QWidget *parent); 45 | glitch_documentation(const QUrl &url, QWidget *parent); 46 | ~glitch_documentation(); 47 | 48 | QTextDocument *document(void) const 49 | { 50 | return m_ui.text->document(); 51 | } 52 | 53 | void setAllowOpeningOfExternalLinks(const bool state); 54 | void setHtml(const QString &html); 55 | void setPlainText(const QString &text); 56 | 57 | public slots: 58 | void show(void); 59 | 60 | private: 61 | QPalette m_originalFindPalette; 62 | #ifdef GLITCH_PDF_SUPPORTED 63 | QPdfDocument *m_pdfDocument; 64 | QPdfView *m_pdfView; 65 | #endif 66 | Ui_glitch_documentation m_ui; 67 | bool m_openExternalLinks; 68 | void connectSignals(void); 69 | 70 | private slots: 71 | void slotAnchorClicked(const QUrl &url); 72 | void slotFind(void); 73 | void slotFindText(void); 74 | void slotPrint(void); 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /Source/glitch-find-objects.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_find_objects_h_ 29 | #define _glitch_find_objects_h_ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #include "ui_glitch-find-objects.h" 36 | 37 | class QTreeWidgetItem; 38 | class glitch_collapse_expand_tool_button; 39 | class glitch_find_objects_position_item; 40 | class glitch_object; 41 | class glitch_view; 42 | 43 | class glitch_find_objects: public QDialog 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | enum class Columns 49 | { 50 | Identifier = 1, 51 | Object = 0, 52 | Position = 2, 53 | Type = 3, 54 | TypeTotal = 4 55 | }; 56 | 57 | glitch_find_objects(QWidget *parent); 58 | ~glitch_find_objects(); 59 | 60 | public slots: 61 | void slotSynchronize(void); 62 | 63 | private: 64 | QHash m_typeTotals; 65 | QPointer m_view; 66 | QVector m_items; 67 | QTimer m_searchTimer; 68 | QTimer m_synchronizeTimer; 69 | Ui_glitch_find_objects m_ui; 70 | glitch_collapse_expand_tool_button *m_collapse; 71 | void find(QTreeWidgetItem *i, const QSet &ids, glitch_object *object); 72 | void find(const QSet &ids); 73 | 74 | private slots: 75 | void slotCustomContextMenuRequested(const QPoint &point); 76 | void slotFind(void); 77 | void slotItemDoubleClicked(QTreeWidgetItem *i, int column); 78 | void slotSearch(void); 79 | void slotSynchronizeImplementation(void); 80 | 81 | signals: 82 | void setTotals(const QHash &totals); 83 | }; 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /Source/glitch-floating-context-menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_floating_context_menu_h_ 29 | #define _glitch_floating_context_menu_h_ 30 | 31 | #include 32 | 33 | #include "glitch-object.h" 34 | #include "ui_glitch-floating-context-menu.h" 35 | 36 | class glitch_floating_context_menu: public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | glitch_floating_context_menu(QWidget *parent); 42 | ~glitch_floating_context_menu(); 43 | 44 | QPointer object(void) const 45 | { 46 | return m_object; 47 | } 48 | 49 | void addActions(const QList &actions); 50 | void dockedFloatingContextMenu(const bool state); 51 | void setIdentifier(const qint64 id); 52 | void setObject(glitch_object *object); 53 | void setName(const QString &n); 54 | void setProperty 55 | (const glitch_object::Properties property, const QVariant &value); 56 | 57 | public slots: 58 | void slotActionChanged(void); 59 | void slotObjectChanged(void); 60 | void slotSizeChanged(int value); 61 | void slotZValueChanged(qreal value); 62 | 63 | private: 64 | QPointer m_zValue; 65 | QPointer m_object; 66 | Ui_glitch_floating_context_menu m_ui; 67 | void closeEvent(QCloseEvent *event); 68 | void hideEvent(QHideEvent *event); 69 | void setPushButtonColors(void); 70 | 71 | signals: 72 | void closed(void); 73 | void propertyChanged 74 | (const glitch_object::Properties property, const QVariant &value); 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /Source/glitch-font-filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_font_filter_h_ 29 | #define _glitch_font_filter_h_ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #include "glitch-object.h" 36 | 37 | class glitch_font_filter: public QObject 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | glitch_font_filter(QObject *parent):QObject(parent) 43 | { 44 | m_object = qobject_cast (parent); 45 | } 46 | 47 | private: 48 | QPointer m_object; 49 | 50 | bool eventFilter(QObject *object, QEvent *event) 51 | { 52 | if(event && event->type() == QEvent::ApplicationFontChange && m_object) 53 | m_object->setSizeBeforeFontChange(m_object->size()); 54 | 55 | return QObject::eventFilter(object, event); 56 | } 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Source/glitch-graphicsview.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_graphicsview_h_ 29 | #define _glitch_graphicsview_h_ 30 | 31 | #include 32 | 33 | class glitch_graphicsview: public QGraphicsView 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | glitch_graphicsview(QWidget *parent); 39 | bool containsFunction(const QString &name) const; 40 | qreal scalingFactor(void) const; 41 | void zoom(const int direction); 42 | 43 | private: 44 | void scroll(const QPoint &point); 45 | 46 | protected: 47 | #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) 48 | void enterEvent(QEnterEvent *event); 49 | #else 50 | void enterEvent(QEvent *event); 51 | #endif 52 | void leaveEvent(QEvent *event); 53 | void mouseDoubleClickEvent(QMouseEvent *event); 54 | void mouseMoveEvent(QMouseEvent *event); 55 | 56 | signals: 57 | void mouseEnterEvent(void); 58 | void mouseLeaveEvent(void); 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Source/glitch-object-edit-window-ash.cc: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "glitch-ash-state-machine.h" 29 | #include "glitch-object-edit-window.h" 30 | 31 | void glitch_object_edit_window::slotProcessCommand(const QString &command) 32 | { 33 | glitch_ash_state_machine::processCommand(command, this); 34 | } 35 | -------------------------------------------------------------------------------- /Source/glitch-point.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_point_h_ 29 | #define _glitch_point_h_ 30 | 31 | class glitch_point 32 | { 33 | public: 34 | glitch_point(const QPointF &point) 35 | { 36 | m_x = point.x(); 37 | m_y = point.y(); 38 | }; 39 | 40 | glitch_point(void) 41 | { 42 | m_x = m_y = 0.0; 43 | } 44 | 45 | QPointF pos(void) const 46 | { 47 | return QPointF(m_x, m_y); 48 | } 49 | 50 | bool operator<(const glitch_point &point) const 51 | { 52 | return m_y < point.m_y || 53 | (m_x < point.m_x && qFuzzyCompare(m_y, point.m_y)); 54 | } 55 | 56 | private: 57 | qreal m_x; 58 | qreal m_y; 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Source/glitch-port-colors.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_port_colors_h_ 29 | #define _glitch_port_colors_h_ 30 | 31 | #include 32 | 33 | #include "ui_glitch-port-colors.h" 34 | 35 | class glitch_object; 36 | 37 | class glitch_port_colors: public QDialog 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | glitch_port_colors(QWidget *parent); 43 | ~glitch_port_colors(); 44 | QString colors(void) const; 45 | void setColors(const QVariant &value); 46 | void setObject(glitch_object *object); 47 | 48 | private: 49 | QPointer m_object; 50 | Ui_glitch_port_colors m_ui; 51 | 52 | private slots: 53 | void slotSelectColor(void); 54 | 55 | signals: 56 | void applied(void); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Source/glitch-preferences.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_preferences_h_ 29 | #define _glitch_preferences_h_ 30 | 31 | #include "ui_glitch-preferences.h" 32 | 33 | class glitch_preferences: public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | glitch_preferences(QWidget *parent); 39 | ~glitch_preferences(); 40 | static void prepareEnvironmentVariables(void); 41 | void processSettings(void); 42 | 43 | private: 44 | QString m_defaultOutputDirectory; 45 | Ui_glitch_preferences m_ui; 46 | void prepareLanguages(void); 47 | 48 | private slots: 49 | #ifdef Q_OS_ANDROID 50 | void reject(void) 51 | { 52 | hide(); 53 | setResult(QDialog::Rejected); 54 | } 55 | #endif 56 | 57 | void slotApply(void); 58 | void slotOutputDirectoryTextChanged(const QString &text); 59 | void slotSelectFont(void); 60 | void slotSelectOutputDirectory(void); 61 | 62 | signals: 63 | void accept(void); 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /Source/glitch-redo-undo-stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_redo_undo_stack_h_ 29 | #define _glitch_redo_undo_stack_h_ 30 | 31 | #include 32 | #include 33 | 34 | #include "ui_glitch-redo-undo-stack.h" 35 | 36 | class glitch_redo_undo_stack: public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | glitch_redo_undo_stack(QWidget *parent); 42 | ~glitch_redo_undo_stack(); 43 | void setUndoStack(QUndoStack *undoStack); 44 | 45 | private: 46 | QPointer m_undoStack; 47 | Ui_glitch_redo_undo_stack m_ui; 48 | 49 | private slots: 50 | void slotDoubleClicked(const QModelIndex &index); 51 | void slotPopulate(void); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Source/glitch-resize-widget-rectangle.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_resize_widget_rectangle_h_ 29 | #define _glitch_resize_widget_rectangle_h_ 30 | 31 | #include 32 | 33 | class glitch_resize_widget_rectangle: public QGraphicsRectItem 34 | { 35 | public: 36 | enum class RectangleLocations 37 | { 38 | BottomCenter = 0, 39 | BottomLeft, 40 | BottomRight, 41 | CenterLeft, 42 | CenterRight, 43 | TopCenter, 44 | TopLeft, 45 | TopRight 46 | }; 47 | 48 | glitch_resize_widget_rectangle 49 | (QGraphicsItem *parent, const RectangleLocations location); 50 | ~glitch_resize_widget_rectangle(); 51 | RectangleLocations location(void) const; 52 | void setParentLocked(const bool parentLocked); 53 | static qreal SQUARE_SIZE; 54 | 55 | private: 56 | QRectF m_lastRect; 57 | RectangleLocations m_location; 58 | bool m_parentLocked; 59 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); 60 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); 61 | void mouseMoveEvent(QGraphicsSceneMouseEvent *event); 62 | void mousePressEvent(QGraphicsSceneMouseEvent *event); 63 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 64 | }; 65 | 66 | #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) 67 | inline size_t 68 | #else 69 | inline uint 70 | #endif 71 | qHash(const glitch_resize_widget_rectangle::RectangleLocations &key, 72 | #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) 73 | size_t seed) 74 | #else 75 | uint seed) 76 | #endif 77 | { 78 | return ::qHash(static_cast (key), seed); 79 | } 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /Source/glitch-resize-widget.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_resize_widget_h_ 29 | #define _glitch_resize_widget_h_ 30 | 31 | #include 32 | 33 | #include "glitch-resize-widget-rectangle.h" 34 | 35 | class glitch_proxy_widget; 36 | 37 | class glitch_resize_widget: public QGraphicsItem 38 | { 39 | public: 40 | glitch_resize_widget(QGraphicsItem *parent); 41 | ~glitch_resize_widget(); 42 | QList rectangles(void) const; 43 | QRectF boundingRect(void) const; 44 | void paint(QPainter *painter, 45 | const QStyleOptionGraphicsItem *option, 46 | QWidget *widget = 0); 47 | void positionEdgeRectangles(void); 48 | void showEdgeRectangles(const bool state); 49 | void showEdgeRectanglesForLockedPosition(const bool isParentSelected, 50 | const bool state); 51 | 52 | private: 53 | QHash m_rectangles; 55 | glitch_proxy_widget *m_parent; 56 | void prepareRectangles(void); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Source/glitch-scroll-filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_scroll_filter_h_ 29 | #define _glitch_scroll_filter_h_ 30 | 31 | #include 32 | #include 33 | 34 | class glitch_scroll_filter: public QObject 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | glitch_scroll_filter(QObject *parent):QObject(parent) 40 | { 41 | } 42 | 43 | private: 44 | bool eventFilter(QObject *object, QEvent *event) 45 | { 46 | if(!event || !object) 47 | return QObject::eventFilter(object, event); 48 | 49 | if(event->type() == QEvent::Wheel) 50 | return true; 51 | else 52 | return QObject::eventFilter(object, event); 53 | } 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Source/glitch-serial-port-window.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_serial_port_window_h_ 29 | #define _glitch_serial_port_window_h_ 30 | 31 | #ifdef GLITCH_SERIAL_PORT_SUPPORTED 32 | #include 33 | #endif 34 | 35 | #include "ui_glitch-serial-port-window.h" 36 | 37 | class glitch_serial_port_window: public QDialog 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | glitch_serial_port_window(QWidget *parent); 43 | ~glitch_serial_port_window(); 44 | 45 | private: 46 | Ui_glitch_serial_port_window m_ui; 47 | quint64 m_packetsReceived; 48 | void closeEvent(QCloseEvent *event); 49 | void discoverDevices(void); 50 | void showEvent(QShowEvent *event); 51 | 52 | private slots: 53 | void slotClear(void); 54 | void slotConnect(void); 55 | void slotDisconnect(void); 56 | #ifdef GLITCH_SERIAL_PORT_SUPPORTED 57 | void slotErrorOccurred(QSerialPort::SerialPortError error); 58 | #endif 59 | void slotReadyRead(void); 60 | void slotRefresh(void); 61 | void slotSend(void); 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Source/glitch-source-preview.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_source_preview_h_ 29 | #define _glitch_source_preview_h_ 30 | 31 | #include 32 | 33 | #include "ui_glitch-source-preview.h" 34 | 35 | class glitch_object; 36 | class glitch_syntax_highlighter; 37 | 38 | class glitch_source_preview: public QDialog 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | glitch_source_preview(QWidget *parent); 44 | ~glitch_source_preview(); 45 | void setKeywordsColors(const QMap &map); 46 | void setObject(glitch_object *object); 47 | 48 | public slots: 49 | void slotObjectChanged(void); 50 | 51 | private: 52 | QPalette m_originalFindPalette; 53 | QPointer m_object; 54 | Ui_glitch_source_preview m_ui; 55 | glitch_syntax_highlighter *m_syntaxHighlighter; 56 | void setSource(const QString &text); 57 | 58 | private slots: 59 | void slotFind(void); 60 | void slotFindText(void); 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Source/glitch-structures-treewidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_structures_treewidget_h_ 29 | #define _glitch_structures_treewidget_h_ 30 | 31 | #include 32 | #include 33 | 34 | #include "glitch-common.h" 35 | 36 | class Ui_glitch_structures; 37 | 38 | class glitch_structures_treewidget: public QTreeWidget 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | glitch_structures_treewidget(QWidget *parent); 44 | ~glitch_structures_treewidget(); 45 | void setProjectType(const glitch_common::ProjectTypes projectType); 46 | 47 | private: 48 | QList m_uis; 49 | QTimer m_pressAndHoldTimer; 50 | glitch_common::ProjectTypes m_projectType; 51 | void addChildren(QTreeWidgetItem *item, Ui_glitch_structures *ui); 52 | void mousePressEvent(QMouseEvent *event); 53 | void mouseReleaseEvent(QMouseEvent *event); 54 | void startDrag(Qt::DropActions supportedActions); 55 | 56 | private slots: 57 | void slotCustomContextMenuRequested(const QPoint &point); 58 | void slotFloatingCategoryDialog(void); 59 | void slotPressAndHoldTimeout(void); 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /Source/glitch-style-sheet.cc: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "glitch-style-sheet.h" 29 | 30 | glitch_style_sheet::glitch_style_sheet(QWidget *parent):QDialog(parent) 31 | { 32 | m_ui.setupUi(this); 33 | m_ui.buttonBox->setEnabled(false); 34 | m_ui.preview->setEnabled(false); 35 | m_ui.style_sheet->setPlainText(tr("Glitch error. m_widget is zero.")); 36 | m_ui.style_sheet->setReadOnly(true); 37 | connect(m_ui.preview, 38 | &QPushButton::clicked, 39 | this, 40 | &glitch_style_sheet::slotPreview); 41 | } 42 | 43 | glitch_style_sheet::~glitch_style_sheet() 44 | { 45 | } 46 | 47 | QString glitch_style_sheet::styleSheet(void) const 48 | { 49 | return m_ui.style_sheet->toPlainText(); 50 | } 51 | 52 | void glitch_style_sheet::setWidget(QWidget *widget) 53 | { 54 | m_ui.buttonBox->setEnabled(widget != nullptr); 55 | m_ui.preview->setEnabled(widget != nullptr); 56 | 57 | if(!m_widget) 58 | m_widget = widget; 59 | 60 | if(m_widget) 61 | { 62 | m_ui.style_sheet->setPlainText(m_widget->styleSheet()); 63 | m_ui.style_sheet->setReadOnly(false); 64 | } 65 | else 66 | { 67 | m_ui.style_sheet->setPlainText(tr("Glitch error. m_widget is zero.")); 68 | m_ui.style_sheet->setReadOnly(true); 69 | } 70 | } 71 | 72 | void glitch_style_sheet::slotPreview(void) 73 | { 74 | if(!m_widget) 75 | return; 76 | 77 | m_widget->setStyleSheet(m_ui.style_sheet->toPlainText()); 78 | } 79 | -------------------------------------------------------------------------------- /Source/glitch-style-sheet.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_style_sheet_h_ 29 | #define _glitch_style_sheet_h_ 30 | 31 | #include 32 | 33 | #include "ui_glitch-style-sheet.h" 34 | 35 | class glitch_style_sheet: public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | glitch_style_sheet(QWidget *parent); 41 | ~glitch_style_sheet(); 42 | QString styleSheet(void) const; 43 | void setWidget(QWidget *widget); 44 | 45 | private: 46 | QPointer m_widget; 47 | Ui_glitch_style_sheet m_ui; 48 | 49 | private slots: 50 | void slotPreview(void); 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Source/glitch-syntax-highlighter.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_syntax_highlighter_ 29 | #define _glitch_syntax_highlighter_ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | class glitch_syntax_highlighter: public QSyntaxHighlighter 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | glitch_syntax_highlighter(QTextDocument *document); 41 | ~glitch_syntax_highlighter(); 42 | void setKeywordsColors(const QMap &map); 43 | 44 | private: 45 | struct HighlightingRule 46 | { 47 | QRegularExpression pattern; 48 | QTextCharFormat format; 49 | }; 50 | 51 | QVector m_highlightingRules; 52 | void highlightBlock(const QString &text); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Source/glitch-tab-tabbar.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_tab_tabbar_h_ 29 | #define _glitch_tab_tabbar_h_ 30 | 31 | #include 32 | 33 | class glitch_tab_tabbar: public QTabBar 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | glitch_tab_tabbar(QWidget *parent); 39 | ~glitch_tab_tabbar(); 40 | QTabBar::ButtonPosition preferredCloseButtonPositionOpposite(void) const; 41 | void disableSeparation(void); 42 | 43 | private: 44 | bool m_disableSeparation; 45 | QSize tabSizeHint(int index) const; 46 | void mouseMoveEvent(QMouseEvent *event); 47 | 48 | private slots: 49 | void slotCustomContextMenuRequested(const QPoint &point); 50 | 51 | signals: 52 | void separate(QWidget *widget); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Source/glitch-tab.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_tab_h_ 29 | #define _glitch_tab_h_ 30 | 31 | #include 32 | 33 | class QPushButton; 34 | class glitch_tab_tabbar; 35 | class glitch_view; 36 | 37 | class glitch_tab: public QTabWidget 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | glitch_tab(QWidget *parent); 43 | ~glitch_tab(); 44 | QTabBar *tabBar(void) const; 45 | 46 | int addTab(QWidget *widget, const QString &title) 47 | { 48 | return QTabWidget::addTab(widget, title.trimmed()); 49 | } 50 | 51 | int addTab(glitch_view *view, const QIcon &icon, const QString &label); 52 | void disableSeparation(void); 53 | void setPushButton(QPushButton *pushButton, const int index); 54 | 55 | private: 56 | glitch_tab_tabbar *m_tabBar; 57 | 58 | signals: 59 | void separate(QWidget *widget); 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /Source/glitch-tools.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_tools_h_ 29 | #define _glitch_tools_h_ 30 | 31 | #include "ui_glitch-tools.h" 32 | 33 | class glitch_tools: public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | enum class Operations 39 | { 40 | INTELLIGENT = 0, 41 | SELECT, 42 | WIRE_CONNECT, 43 | WIRE_DISCONNECT, 44 | XYZ 45 | }; 46 | 47 | glitch_tools(QWidget *parent); 48 | ~glitch_tools(); 49 | Operations operation(void) const; 50 | void populateMenu(QMenu *menu, QObject *parent); 51 | void setOperation(const Operations operation); 52 | 53 | private: 54 | Ui_glitch_tools m_ui; 55 | 56 | private slots: 57 | void slotAboutToShowConnectionsMenu(void); 58 | void slotOperationChanged(void); 59 | 60 | signals: 61 | void operation(const glitch_tools::Operations operation); 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Source/glitch-user-functions-model.cc: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "glitch-user-functions-model.h" 29 | #include "glitch-view.h" 30 | 31 | glitch_user_functions_model::glitch_user_functions_model 32 | (QObject *parent):QStandardItemModel(parent) 33 | { 34 | m_view = qobject_cast (parent); 35 | } 36 | 37 | glitch_user_functions_model::~glitch_user_functions_model() 38 | { 39 | } 40 | 41 | void glitch_user_functions_model::openFunction(const QModelIndex &index) 42 | { 43 | if(!index.isValid() || !m_view) 44 | return; 45 | 46 | m_view->openFunction(index.data().toString()); 47 | } 48 | -------------------------------------------------------------------------------- /Source/glitch-user-functions-model.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_user_functions_model_h_ 29 | #define _glitch_user_functions_model_h_ 30 | 31 | #include 32 | #include 33 | 34 | class glitch_view; 35 | 36 | class glitch_user_functions_model: public QStandardItemModel 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | glitch_user_functions_model(QObject *parent); 42 | ~glitch_user_functions_model(); 43 | void openFunction(const QModelIndex &index); 44 | 45 | private: 46 | QPointer m_view; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Source/glitch-user-functions-tableview.cc: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | #include 30 | 31 | #include "glitch-user-functions-tableview.h" 32 | 33 | glitch_user_functions_tableview:: 34 | glitch_user_functions_tableview(QWidget *parent):QTableView(parent) 35 | { 36 | m_projectType = glitch_common::ProjectTypes::XYZProject; 37 | } 38 | 39 | glitch_user_functions_tableview:: 40 | ~glitch_user_functions_tableview() 41 | { 42 | } 43 | 44 | void glitch_user_functions_tableview::setProjectType 45 | (const glitch_common::ProjectTypes projectType) 46 | { 47 | m_projectType = projectType; 48 | } 49 | 50 | void glitch_user_functions_tableview::startDrag 51 | (Qt::DropActions supportedActions) 52 | { 53 | Q_UNUSED(supportedActions); 54 | 55 | auto const index = selectedIndexes().value(0); 56 | 57 | if(!index.isValid()) 58 | return; 59 | 60 | auto drag = new QDrag(this); 61 | auto mimeData = new QMimeData(); 62 | 63 | if(m_projectType == glitch_common::ProjectTypes::ArduinoProject) 64 | mimeData->setText("glitch-arduino-function-" + index.data().toString()); 65 | else 66 | mimeData->setText("glitch-function-" + index.data().toString()); 67 | 68 | drag->setMimeData(mimeData); 69 | drag->exec(Qt::CopyAction); 70 | } 71 | -------------------------------------------------------------------------------- /Source/glitch-user-functions-tableview.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_user_functions_tableview_h_ 29 | #define _glitch_user_functions_tableview_h_ 30 | 31 | #include 32 | 33 | #include "glitch-common.h" 34 | 35 | class glitch_user_functions_tableview: public QTableView 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | glitch_user_functions_tableview(QWidget *parent); 41 | ~glitch_user_functions_tableview(); 42 | void setProjectType(const glitch_common::ProjectTypes projectType); 43 | 44 | private: 45 | glitch_common::ProjectTypes m_projectType; 46 | void startDrag(Qt::DropActions supportedActions); 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Source/glitch-user-functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_user_functions_h_ 29 | #define _glitch_user_functions_h_ 30 | 31 | #include 32 | 33 | #include "glitch-user-functions-model.h" 34 | #include "ui_glitch-user-functions.h" 35 | 36 | class glitch_user_functions: public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | glitch_user_functions(QWidget *parent); 42 | ~glitch_user_functions(); 43 | QFrame *frame(void) const; 44 | bool contains(const QString &name) const; 45 | void addFunction(const QString &name); 46 | void deleteFunction(const QString &name); 47 | void renameFunction(const QString &before, const QString &after); 48 | void setModel(glitch_user_functions_model *model); 49 | void setProjectType(const glitch_common::ProjectTypes projectType); 50 | 51 | private: 52 | QPointer m_model; 53 | Ui_glitch_user_functions m_ui; 54 | 55 | private slots: 56 | void slotDoubleClicked(const QModelIndex &index); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Source/glitch-variety.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_variety_h_ 29 | #define _glitch_variety_h_ 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | class QComboBox; 36 | class QLineEdit; 37 | class QPushButton; 38 | class QWidget; 39 | 40 | class glitch_variety 41 | { 42 | public: 43 | static QPointF dbPointToPointF(const QString &text); 44 | static QString homePath(void); 45 | static Qt::KeyboardModifiers keyboardModifiers(void); 46 | static bool sameAncestors(const QObject *object1, const QObject *object2); 47 | static void assignImage(QPushButton *button, const QColor &color); 48 | static void centerWindow(QWidget *parent, QWidget *window); 49 | static void highlight(QLineEdit *lineEdit); 50 | static void searchText 51 | (QLineEdit *find, 52 | QTextEdit *text, 53 | const QPalette &originalFindPalette, 54 | const QTextDocument::FindFlags options); 55 | static void showErrorDialog(const QString &text, QWidget *parent); 56 | static void sortCombinationBox(QComboBox *comboBox); 57 | 58 | private: 59 | glitch_variety(void); 60 | ~glitch_variety(); 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Source/glitch-version.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_version_h_ 29 | #define _glitch_version_h_ 30 | #define GLITCH_VERSION_FILE_URL \ 31 | "https://raw.githubusercontent.com/" \ 32 | "textbrowser/glitch/master/Source/glitch-version.h" 33 | #define GLITCH_VERSION_STRING "2025.06.06" 34 | #define GLITCH_VERSION_STRING_LTS "2025.05.03" 35 | #endif 36 | -------------------------------------------------------------------------------- /Source/glitch-view-ash.cc: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "glitch-ash-state-machine.h" 29 | #include "glitch-view.h" 30 | 31 | void glitch_view::slotProcessCommand(const QString &command) 32 | { 33 | glitch_ash_state_machine::processCommand(command, this); 34 | } 35 | -------------------------------------------------------------------------------- /Source/glitch-wire.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2015 - 10^10^10, Alexis Megas. 3 | ** All rights reserved. 4 | ** 5 | ** Redistribution and use in source and binary forms, with or without 6 | ** modification, are permitted provided that the following conditions 7 | ** are met: 8 | ** 1. Redistributions of source code must retain the above copyright 9 | ** notice, this list of conditions and the following disclaimer. 10 | ** 2. Redistributions in binary form must reproduce the above copyright 11 | ** notice, this list of conditions and the following disclaimer in the 12 | ** documentation and/or other materials provided with the distribution. 13 | ** 3. The name of the author may not be used to endorse or promote products 14 | ** derived from Glitch without specific prior written permission. 15 | ** 16 | ** GLITCH IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | ** GLITCH, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _glitch_wire_h_ 29 | #define _glitch_wire_h_ 30 | 31 | #include 32 | #include 33 | 34 | class glitch_proxy_widget; 35 | 36 | class glitch_wire: public QGraphicsObject 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | enum // Must not be a class. 42 | { 43 | Type = QGraphicsObject::UserType + 2 44 | }; 45 | 46 | enum class WireTypes 47 | { 48 | CURVE = 0, 49 | LINE 50 | }; 51 | 52 | glitch_wire(QGraphicsItem *parent, const bool visible = true); 53 | ~glitch_wire(); 54 | QPointer leftProxy(void) const; 55 | QPointer rightProxy(void) const; 56 | 57 | int type(void) const 58 | { 59 | return Type; 60 | } 61 | 62 | void setBoundingRect(const QRectF &rect); 63 | void setColor(const QColor &color); 64 | void setLeftProxy(glitch_proxy_widget *proxy); 65 | void setRightProxy(glitch_proxy_widget *proxy); 66 | void setWireType(const QString &wireType); 67 | void setWireType(const WireTypes wireType); 68 | void setWireWidth(const double value); 69 | 70 | private: 71 | QColor m_color; 72 | QPointer m_leftProxy; 73 | QPointer m_rightProxy; 74 | QRectF m_boundingRect; 75 | WireTypes m_wireType; 76 | double m_wireWidth; 77 | QPainterPath shape(void) const; 78 | QRectF boundingRect(void) const; 79 | void mousePressEvent(QGraphicsSceneMouseEvent *event); 80 | void paint(QPainter *painter, 81 | const QStyleOptionGraphicsItem *opt, 82 | QWidget *widget); 83 | 84 | private slots: 85 | void slotUpdate(const QList ®ion); 86 | 87 | signals: 88 | void disconnectWireIfNecessary(void); 89 | }; 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /Tools/glitch-prepare-apk-name.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Alexis Megas. 4 | 5 | VERSION=$1 6 | 7 | if [ -z "$VERSION" ] 8 | then 9 | echo "Please specify the version: $0 ." 10 | exit 1 11 | fi 12 | 13 | for i in $(find . -iname '*.apk') 14 | do 15 | if [[ "$i" == *"arm64"* ]] 16 | then 17 | mv $i ~/Glitch-"$VERSION"_arm64.apk 18 | 19 | if [ -e ~/Glitch-"$VERSION"_arm64.apk ] 20 | then 21 | echo "Created ~/Glitch-"$VERSION"_arm64.apk." 22 | fi 23 | fi 24 | 25 | if [[ "$i" == *"armeabi"* ]] 26 | then 27 | mv $i ~/Glitch-"$VERSION"_arm32.apk 28 | 29 | if [ -e ~/Glitch-"$VERSION"_arm32.apk ] 30 | then 31 | echo "Created ~/Glitch-"$VERSION"_arm32.apk." 32 | fi 33 | fi 34 | done 35 | -------------------------------------------------------------------------------- /Tools/html2spell.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Alexis Megas. 4 | 5 | sed 's///' $1 | sed 's/<\/b>//' | sed 's/
  • //' | sed 's/<\/li>//' | spell 6 | -------------------------------------------------------------------------------- /UI/Arduino/glitch-object-block-comment-arduino.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_object_block_comment_arduino 4 | 5 | 6 | 7 | 0 8 | 0 9 | 300 10 | 100 11 | 12 | 13 | 14 | 15 | 0 16 | 100 17 | 18 | 19 | 20 | 21 | 15 22 | 23 | 24 | 15 25 | 26 | 27 | 15 28 | 29 | 30 | 15 31 | 32 | 33 | 34 | 35 | 36 | 0 37 | 0 38 | 39 | 40 | 41 | Comment 42 | 43 | 44 | QFrame::NoFrame 45 | 46 | 47 | Block Comment 48 | 49 | 50 | 51 | 52 | 53 | 54 | comment 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /UI/Arduino/glitch-object-function-arduino.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_object_function_arduino 4 | 5 | 6 | 7 | 0 8 | 0 9 | 300 10 | 50 11 | 12 | 13 | 14 | 15 | 5 16 | 17 | 18 | 15 19 | 20 | 21 | 5 22 | 23 | 24 | 15 25 | 26 | 27 | 5 28 | 29 | 30 | 31 | 32 | 33 | 75 34 | true 35 | 36 | 37 | 38 | function() 39 | 40 | 41 | Qt::RichText 42 | 43 | 44 | Qt::AlignCenter 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 0 53 | 0 54 | 55 | 56 | 57 | * 58 | 59 | 60 | 61 | 62 | 63 | 64 | Return Type 65 | 66 | 67 | QComboBox { combobox-popup: 0; } 68 | 69 | 70 | 71 | 72 | 73 | QComboBox::AdjustToContents 74 | 75 | 76 | 77 | 78 | 79 | 80 | asterisk 81 | return_type 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /UI/Arduino/glitch-object-syntax-arduino.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_object_syntax_arduino 4 | 5 | 6 | 7 | 0 8 | 0 9 | 300 10 | 50 11 | 12 | 13 | 14 | 15 | 5 16 | 17 | 18 | 5 19 | 20 | 21 | 5 22 | 23 | 24 | 5 25 | 26 | 27 | 5 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Text 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | glitch_object_lineedit 44 | QLineEdit 45 |
    glitch-object-lineedit.h
    46 |
    47 |
    48 | 49 | text 50 | 51 | 52 | 53 | 54 | 55 |
    56 | -------------------------------------------------------------------------------- /UI/glitch-ash.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_ash 4 | 5 | 6 | 7 | 0 8 | 0 9 | 500 10 | 500 11 | 12 | 13 | 14 | Glitch: ASH 15 | 16 | 17 | 18 | 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 28 | 29 | ASH Command Terminal 30 | 31 | 32 | true 33 | 34 | 35 | 36 | 37 | 38 | 39 | Qt::TextEditable|Qt::TextSelectableByKeyboard 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | glitch_ash_textedit 51 | QTextEdit 52 |
    glitch-ash.h
    53 |
    54 |
    55 | 56 | 57 |
    58 | -------------------------------------------------------------------------------- /UI/glitch-canvas-preview.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_canvas_preview 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | 15 | 0 16 | 17 | 18 | 0 19 | 20 | 21 | 22 | 23 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 24 | 25 | 26 | QGraphicsView::FullViewportUpdate 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /UI/glitch-docked-container.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_docked_container 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | 15 | 0 16 | 17 | 18 | 0 19 | 20 | 21 | 22 | 23 | true 24 | 25 | 26 | QAbstractItemView::SingleSelection 27 | 28 | 29 | QAbstractItemView::SelectRows 30 | 31 | 32 | QAbstractItemView::ScrollPerPixel 33 | 34 | 35 | QAbstractItemView::ScrollPerPixel 36 | 37 | 38 | false 39 | 40 | 41 | true 42 | 43 | 44 | false 45 | 46 | 47 | 500 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /UI/glitch-errors-dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_errors_dialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Glitch: Errors 15 | 16 | 17 | 18 | :/Logo/glitch-logo.png:/Logo/glitch-logo.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 0 26 | 0 27 | 28 | 29 | 30 | Please set this text. 31 | 32 | 33 | 34 | 35 | 36 | 37 | true 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Horizontal 45 | 46 | 47 | QDialogButtonBox::Ok 48 | 49 | 50 | 51 | 52 | 53 | 54 | text 55 | buttonBox 56 | 57 | 58 | 59 | 60 | 61 | 62 | buttonBox 63 | accepted() 64 | glitch_errors_dialog 65 | accept() 66 | 67 | 68 | 248 69 | 254 70 | 71 | 72 | 157 73 | 274 74 | 75 | 76 | 77 | 78 | buttonBox 79 | rejected() 80 | glitch_errors_dialog 81 | reject() 82 | 83 | 84 | 316 85 | 260 86 | 87 | 88 | 286 89 | 274 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /UI/glitch-structures.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_structures 4 | 5 | 6 | 7 | 0 8 | 0 9 | 250 10 | 200 11 | 12 | 13 | 14 | Glitch: Structures 15 | 16 | 17 | 18 | :/Logo/glitch-logo.png:/Logo/glitch-logo.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 0 26 | 27 | 28 | 0 29 | 30 | 31 | 32 | 33 | Find 34 | 35 | 36 | true 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | true 47 | 48 | 49 | QAbstractItemView::DragOnly 50 | 51 | 52 | true 53 | 54 | 55 | QAbstractItemView::ExtendedSelection 56 | 57 | 58 | QAbstractItemView::ScrollPerPixel 59 | 60 | 61 | true 62 | 63 | 64 | true 65 | 66 | 67 | true 68 | 69 | 70 | true 71 | 72 | 73 | 74 | 1 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | glitch_structures_treewidget 87 | QTreeWidget 88 |
    glitch-structures-treewidget.h
    89 |
    90 |
    91 | 92 | filter 93 | tree 94 | 95 | 96 | 97 | 98 | 99 |
    100 | -------------------------------------------------------------------------------- /UI/glitch-style-sheet.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_style_sheet 4 | 5 | 6 | 7 | 0 8 | 0 9 | 350 10 | 250 11 | 12 | 13 | 14 | Glitch: Widget Style Sheet 15 | 16 | 17 | 18 | :/Logo/glitch-logo.png:/Logo/glitch-logo.png 19 | 20 | 21 | 22 | 23 | 24 | Glitch does not validate style sheets. Please be careful. 25 | 26 | 27 | true 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | &Preview 40 | 41 | 42 | 43 | 44 | 45 | 46 | Qt::Horizontal 47 | 48 | 49 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | style_sheet 59 | preview 60 | buttonBox 61 | 62 | 63 | 64 | 65 | 66 | 67 | buttonBox 68 | accepted() 69 | glitch_style_sheet 70 | accept() 71 | 72 | 73 | 248 74 | 254 75 | 76 | 77 | 157 78 | 274 79 | 80 | 81 | 82 | 83 | buttonBox 84 | rejected() 85 | glitch_style_sheet 86 | reject() 87 | 88 | 89 | 316 90 | 260 91 | 92 | 93 | 286 94 | 274 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /UI/glitch-view.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | glitch_view 4 | 5 | 6 | 7 | 0 8 | 0 9 | 600 10 | 600 11 | 12 | 13 | 14 | 15 | 16 | 17 | Qt::ElideRight 18 | 19 | 20 | 21 | Primary Diagram 22 | 23 | 24 | 25 | 26 | 27 | Qt::Vertical 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | glitch_tab 46 | QTabWidget 47 |
    glitch-tab.h
    48 | 1 49 |
    50 |
    51 | 52 | 53 |
    54 | -------------------------------------------------------------------------------- /glitch-version.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Alexis Megas. 4 | 5 | echo "The command sed may fail on MacOS." 6 | 7 | VERSION=$1 8 | 9 | if [ -z "$VERSION" ] 10 | then 11 | echo "Please specify the version: $0 ." 12 | exit 1 13 | fi 14 | 15 | for file in Distributions/*/control 16 | do 17 | sed -i "s/Version: .*/Version: $VERSION/" $file 18 | done 19 | 20 | for file in Distributions/build* 21 | do 22 | sed -i \ 23 | "s/Glitch-[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/Glitch-$VERSION/" \ 24 | $file 25 | done 26 | 27 | FILE="Android/AndroidManifest.xml" 28 | 29 | sed -i \ 30 | 's/\(android:versionCode="\)[0-9]\+\([0-9]\+\)*"/\1'"${VERSION//./}"'"/' \ 31 | $FILE 32 | sed -i \ 33 | 's/\(android:versionName="\)[0-9]\+\(\.[0-9]\+\)*"/\1'"$VERSION"'"/' \ 34 | $FILE 35 | 36 | FILE="Source/glitch-version.h" 37 | 38 | sed -i \ 39 | 's/\(GLITCH_VERSION_STRING "\)[0-9]\+\(\.[0-9]\+\)*"/\1'"$VERSION"'"/' \ 40 | $FILE 41 | sed -i \ 42 | 's/\(GLITCH_VERSION_STRING_LTS "\)[0-9]\+\(\.[0-9]\+\)*"/\1'"$VERSION"'"/' \ 43 | $FILE 44 | echo "Please modify ReleaseNotes.html." 45 | -------------------------------------------------------------------------------- /glitch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Alexis Megas. 4 | 5 | export AA_ENABLEHIGHDPISCALING=1 6 | export AA_USEHIGHDPIPIXMAPS=1 7 | export QT_AUTO_SCREEN_SCALE_FACTOR=1 8 | export QT_X11_NO_MITSHM=1 9 | 10 | if [ -r ./Glitch ] && [ -x ./Glitch ] 11 | then 12 | echo "Launching a local Glitch." 13 | ./Glitch "$@" 14 | exit $? 15 | elif [ -r /opt/glitch/Glitch ] && [ -x /opt/glitch/Glitch ] 16 | then 17 | echo "Launching an official Glitch." 18 | /opt/glitch/Glitch "$@" 19 | exit $? 20 | elif [ -r /usr/local/glitch/Glitch ] && [ -x /usr/local/glitch/Glitch ] 21 | then 22 | echo "Launching an official Glitch." 23 | /usr/local/glitch/Glitch "$@" 24 | exit $? 25 | else 26 | echo "Cannot locate Glitch. Why?" 27 | exit 1 28 | fi 29 | --------------------------------------------------------------------------------