├── debian ├── notekit-docs.docs ├── source │ ├── format │ └── options ├── notekit.cron.d.ex ├── changelog ├── salsa-ci.yml.ex ├── notekit.doc-base.EX ├── control ├── preinst.ex ├── rules ├── prerm.ex ├── postrm.ex ├── postinst.ex ├── watch.ex ├── copyright ├── manpage.1.ex ├── manpage.sgml.ex └── manpage.xml.ex ├── notesbase └── .gitignore ├── Apple ├── NoteKit.app │ └── Contents │ │ ├── MacOS │ │ └── .brew │ │ ├── Resources │ │ └── NoteKit.icns │ │ └── Info.plist ├── NoteKit.iconset │ ├── icon_16x16.png │ ├── icon_32x32.png │ ├── icon_128x128.png │ ├── icon_16x16@2x.png │ ├── icon_256x256.png │ ├── icon_32x32@2x.png │ ├── icon_512x512.png │ ├── icon_128x128@2x.png │ ├── icon_256x256@2x.png │ └── icon_512x512@2x.png ├── INSTALL.OSX.md └── llvm.patch ├── screenshots ├── notekit.png ├── notekit_dark.png ├── notekit-example.png ├── osx-notekit-example.png ├── syntax-highlighting.png ├── notekit-syntax_highlighting.png └── notekit_dark-syntax_highlighting.png ├── data ├── fonts │ ├── Charter Bold.otf │ ├── Charter Italic.otf │ ├── Charter Regular.otf │ ├── Charter Bold Italic.otf │ └── Charter license.txt ├── icons │ └── hicolor │ │ ├── index.theme │ │ └── scalable │ │ └── emblems │ │ ├── text-symbolic.svg │ │ ├── pen-tool-symbolic.svg │ │ ├── select-symbolic.svg │ │ ├── maximize.svg │ │ ├── minimize.svg │ │ ├── large-pen-symbolic.svg │ │ ├── medium-pen-symbolic.svg │ │ ├── small-pen-symbolic.svg │ │ ├── pick-color-symbolic.svg │ │ ├── eraser-tool-symbolic.svg │ │ ├── maximize-symbolic.svg │ │ └── minimize-symbolic.svg ├── default_config.json ├── stylesheet.css └── toolbar.glade ├── freedesktop ├── com.github.blackhole89.notekit.png ├── com.github.blackhole89.notekit.desktop ├── install.sh ├── meson.build └── com.github.blackhole89.notekit.metainfo.xml ├── symlink-clatexmath.sh ├── subprojects └── clatexmath.wrap ├── config.h.meson.in ├── config.h.in ├── settings.h ├── .gitignore ├── about.h ├── meson_options.txt ├── about.cpp ├── notekit.workspace ├── .github └── workflows │ ├── flatpak.yml │ ├── package-deb.yml │ ├── windows.yml │ └── ci.yml ├── gnome ├── meson.build └── com.github.blackhole89.notekit.gschema.xml ├── sourceview ├── markdownlisting.lang ├── language.dtd ├── styles.rng ├── classic.xml ├── notekit.xml └── def.lang ├── imagewidgets.h ├── install-clatexmath.sh ├── main.cpp ├── meson.build ├── drawing.h ├── navigation.h ├── notebook_highlight.hpp ├── base64.h ├── pkgs └── flatpak │ └── com.github.blackhole89.notekit.yaml ├── imagewidgets.cpp ├── notebook_widgets.hpp ├── mainwindow.h ├── notebook.h ├── notekit.project ├── CMakeLists.txt ├── notekit.mk ├── README.md └── notebook_clipboard.hpp /debian/notekit-docs.docs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /notesbase/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | 4 | -------------------------------------------------------------------------------- /Apple/NoteKit.app/Contents/MacOS/.brew: -------------------------------------------------------------------------------- 1 | "NoteKit" Mach-O binary will be placed by homebrew here 2 | -------------------------------------------------------------------------------- /screenshots/notekit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/screenshots/notekit.png -------------------------------------------------------------------------------- /data/fonts/Charter Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/data/fonts/Charter Bold.otf -------------------------------------------------------------------------------- /data/fonts/Charter Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/data/fonts/Charter Italic.otf -------------------------------------------------------------------------------- /debian/source/options: -------------------------------------------------------------------------------- 1 | extend-diff-ignore = "^(cLaTeXMath/|data/|cmake-build-Release|config|sourceview|.git)" 2 | -------------------------------------------------------------------------------- /screenshots/notekit_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/screenshots/notekit_dark.png -------------------------------------------------------------------------------- /data/fonts/Charter Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/data/fonts/Charter Regular.otf -------------------------------------------------------------------------------- /screenshots/notekit-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/screenshots/notekit-example.png -------------------------------------------------------------------------------- /data/fonts/Charter Bold Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/data/fonts/Charter Bold Italic.otf -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_16x16.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_32x32.png -------------------------------------------------------------------------------- /screenshots/osx-notekit-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/screenshots/osx-notekit-example.png -------------------------------------------------------------------------------- /screenshots/syntax-highlighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/screenshots/syntax-highlighting.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_128x128.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_256x256.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_512x512.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /Apple/NoteKit.iconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.iconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /screenshots/notekit-syntax_highlighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/screenshots/notekit-syntax_highlighting.png -------------------------------------------------------------------------------- /freedesktop/com.github.blackhole89.notekit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/freedesktop/com.github.blackhole89.notekit.png -------------------------------------------------------------------------------- /Apple/NoteKit.app/Contents/Resources/NoteKit.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/Apple/NoteKit.app/Contents/Resources/NoteKit.icns -------------------------------------------------------------------------------- /screenshots/notekit_dark-syntax_highlighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackhole89/notekit/HEAD/screenshots/notekit_dark-syntax_highlighting.png -------------------------------------------------------------------------------- /symlink-clatexmath.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ln -fs "${MESON_INSTALL_PREFIX}/share/clatexmath" "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/notekit/data/latex" 4 | -------------------------------------------------------------------------------- /debian/notekit.cron.d.ex: -------------------------------------------------------------------------------- 1 | # 2 | # Regular cron jobs for the notekit package 3 | # 4 | 0 4 * * * root [ -x /usr/bin/notekit_maintenance ] && /usr/bin/notekit_maintenance 5 | -------------------------------------------------------------------------------- /subprojects/clatexmath.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | url = https://github.com/NanoMichael/cLaTeXMath.git 3 | revision = head 4 | 5 | [provide] 6 | dependency_names = clatexmath 7 | -------------------------------------------------------------------------------- /config.h.meson.in: -------------------------------------------------------------------------------- 1 | // global config 2 | 3 | #define NK_VERSION "@version@" 4 | #define DEFAULT_SETTINGS_PROVIDER "@settings_provider@" 5 | #mesondefine MIGRATE_LEGACY_SETTINGS 6 | #mesondefine HAVE_CLATEXMATH 7 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | // global config 2 | 3 | #define NK_VERSION "0.3.0" 4 | #cmakedefine HAVE_LASEM 5 | #cmakedefine HAVE_CLATEXMATH 6 | #cmakedefine MIGRATE_LEGACY_SETTINGS 7 | #cmakedefine DEFAULT_SETTINGS_PROVIDER "@DEFAULT_SETTINGS_PROVIDER@" 8 | 9 | -------------------------------------------------------------------------------- /data/icons/hicolor/index.theme: -------------------------------------------------------------------------------- 1 | [Icon Theme] 2 | Name=Hicolor 3 | Comment=Fallback icon theme 4 | Hidden=true 5 | Directories=scalable/emblems 6 | 7 | [scalable/emblems] 8 | MinSize=1 9 | Size=128 10 | MaxSize=256 11 | Context=Emblems 12 | Type=Scalable 13 | 14 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/text-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /settings.h: -------------------------------------------------------------------------------- 1 | #ifndef __SETTINGS_H__ 2 | #define __SETTINGS_H__ 3 | 4 | #include 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | 9 | GSettingsBackend* nk_json_settings_backend_new(const gchar* location); 10 | 11 | G_END_DECLS 12 | 13 | #endif // __SETTINGS_H__ 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # meson generated files 2 | _build/ 3 | config.h 4 | 5 | # gnome builder project configuration 6 | .buildconfig 7 | 8 | # protection against over-aggresive fontconfig 9 | data/fonts/.uuid 10 | 11 | # compile gsettings schemas 12 | gnome/gschemas.compiled 13 | 14 | cmake-build-debug 15 | cmake-build-Release 16 | .idea 17 | -------------------------------------------------------------------------------- /about.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class AboutDiag : public Gtk::AboutDialog { 4 | public: 5 | AboutDiag(); 6 | protected: 7 | std::vector contributers { 8 | "Matvey Soloviev", 9 | "Florian \"sp1rit\"", 10 | "Lyes Saadi" 11 | }; 12 | std::vector artists { 13 | "Thomas Kole" 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /freedesktop/com.github.blackhole89.notekit.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=NoteKit 3 | GenericName=NoteKit 4 | Comment=Write your notes in instantly-formatted Markdown 5 | Icon=com.github.blackhole89.notekit 6 | Exec=notekit 7 | Terminal=false 8 | Type=Application 9 | Categories=Office;WordProcessor; 10 | Keywords=note;onenote;notetaking;markdown; 11 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/pen-tool-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('clatexmath', type : 'boolean', value : true, description : 'Use cLaTeXMath') 2 | option('settings_provider', type: 'combo', choices: ['json', 'gio'], value: 'gio', description: 'Default settings provider') 3 | option('migrate_legacy_settings', type: 'boolean', value: true, description: 'Should NoteKit migrate legacy settings to the new settings format') 4 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | notekit (0.2) unstable; urgency=medium 2 | 3 | * Various bugfixes. 4 | * Add support for inline images and image pasting. 5 | * Misc improvements. 6 | 7 | -- Matvey Soloviev Tue, 23 Nov 2021 16:20:00 -0500 8 | 9 | notekit (0.1-1) unstable; urgency=medium 10 | 11 | * Initial release 12 | 13 | -- Matvey Soloviev Thu, 24 Dec 2020 20:27:45 -0500 14 | -------------------------------------------------------------------------------- /freedesktop/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ "$EUID" -ne 0 ]; then 3 | echo "This script wont work without superuser privileges" 4 | exit 5 | fi 6 | 7 | install -Dm644 com.github.blackhole89.notekit.png -t /usr/share/icons/hicolor/128x128/apps/ 8 | install -Dm644 com.github.blackhole89.notekit.svg -t /usr/share/icons/hicolor/scalable/apps/ 9 | install -Dm644 com.github.blackhole89.notekit.desktop -t /usr/share/applications 10 | 11 | gtk-update-icon-cache -t /usr/share/icons/hicolor 12 | update-desktop-database 13 | -------------------------------------------------------------------------------- /debian/salsa-ci.yml.ex: -------------------------------------------------------------------------------- 1 | # For more information on what jobs are run see: 2 | # https://salsa.debian.org/salsa-ci-team/pipeline 3 | # 4 | # To enable the jobs, go to your repository (at salsa.debian.org) 5 | # and click over Settings > CI/CD > Expand (in General pipelines). 6 | # In "Custom CI config path" write debian/salsa-ci.yml and click 7 | # in "Save Changes". The CI tests will run after the next commit. 8 | --- 9 | include: 10 | - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml 11 | - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml 12 | -------------------------------------------------------------------------------- /about.cpp: -------------------------------------------------------------------------------- 1 | #include "about.h" 2 | #include "config.h" 3 | 4 | AboutDiag::AboutDiag() { 5 | set_program_name("NoteKit"); 6 | set_logo_icon_name("com.github.blackhole89.notekit"); 7 | set_comments("A GTK3 hierarchical markdown notetaking\napplication with tablet support."); 8 | set_version(NK_VERSION); 9 | set_website("https://github.com/blackhole89/notekit"); 10 | set_website_label("GitHub: @blackhole89/notekit"); 11 | set_copyright("Almighty Archjanitor: Matvey Soloviev"); 12 | set_license_type(Gtk::LICENSE_GPL_3_0); 13 | 14 | set_authors(contributers); 15 | set_artists(artists); 16 | } 17 | -------------------------------------------------------------------------------- /notekit.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /debian/notekit.doc-base.EX: -------------------------------------------------------------------------------- 1 | Document: notekit 2 | Title: Debian notekit Manual 3 | Author: 4 | Abstract: This manual describes what notekit is 5 | and how it can be used to 6 | manage online manuals on Debian systems. 7 | Section: unknown 8 | 9 | Format: debiandoc-sgml 10 | Files: /usr/share/doc/notekit/notekit.sgml.gz 11 | 12 | Format: postscript 13 | Files: /usr/share/doc/notekit/notekit.ps.gz 14 | 15 | Format: text 16 | Files: /usr/share/doc/notekit/notekit.text.gz 17 | 18 | Format: HTML 19 | Index: /usr/share/doc/notekit/html/index.html 20 | Files: /usr/share/doc/notekit/html/*.html 21 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/select-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/workflows/flatpak.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [master] 4 | pull_request: 5 | name: Flatpak 6 | jobs: 7 | flatpak: 8 | runs-on: ubuntu-20.04 9 | container: 10 | image: bilelmoussaoui/flatpak-github-actions:gnome-3.38 11 | options: --privileged 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v3 15 | with: 16 | bundle: "notekit-dev.flatpak" 17 | manifest-path: "pkgs/flatpak/com.github.blackhole89.notekit.yaml" 18 | run-tests: "true" 19 | cache-key: flatpak-builder-${{ github.sha }} 20 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: notekit 2 | Section: text 3 | Priority: optional 4 | Maintainer: Matvey Soloviev 5 | Build-Depends: cmake, libfontconfig1-dev, zlib1g-dev, libjsoncpp-dev, libgtksourceviewmm-3.0-dev, libgtkmm-3.0-dev, debhelper-compat (= 12) 6 | Standards-Version: 4.5.1 7 | Homepage: https://github.com/blackhole89/notekit 8 | #Vcs-Browser: https://salsa.debian.org/debian/notekit 9 | Vcs-Git: https://github.com/blackhole89/notekit.git 10 | Rules-Requires-Root: no 11 | 12 | Package: notekit 13 | Architecture: any 14 | Depends: ${shlibs:Depends}, ${misc:Depends} 15 | Description: Markdown note-taking app with tablet support and LaTeX math 16 | 17 | -------------------------------------------------------------------------------- /data/fonts/Charter license.txt: -------------------------------------------------------------------------------- 1 | This is a copy of the Charter fonts which Bitstream contributed to the X consortium. This is the original notice included with the fonts: 2 | 3 | (c) Copyright 1989-1992, Bitstream Inc., Cambridge, MA. You are hereby granted permission under all Bitstream propriety rights to use, copy, modify, sublicense, sell, and redistribute the 4 Bitstream Charter (r) Type 1 outline fonts and the 4 Courier Type 1 outline fonts for any purpose and without restriction; provided, that this notice is left intact on all copies of such fonts and that Bitstream's trademark is acknowledged as shown below on all unmodified copies of the 4 Charter Type 1 fonts. BITSTREAM CHARTER is a registered trademark of Bitstream Inc. -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/maximize.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/minimize.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /debian/preinst.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # preinst script for notekit 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `install' 10 | # * `install' 11 | # * `upgrade' 12 | # * `abort-upgrade' 13 | # for details, see https://www.debian.org/doc/debian-policy/ or 14 | # the debian-policy package 15 | 16 | 17 | case "$1" in 18 | install|upgrade) 19 | ;; 20 | 21 | abort-upgrade) 22 | ;; 23 | 24 | *) 25 | echo "preinst called with unknown argument \`$1'" >&2 26 | exit 1 27 | ;; 28 | esac 29 | 30 | # dh_installdeb will replace this with shell code automatically 31 | # generated by other debhelper scripts. 32 | 33 | #DEBHELPER# 34 | 35 | exit 0 36 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #export DH_VERBOSE = 1 5 | 6 | 7 | # see FEATURE AREAS in dpkg-buildflags(1) 8 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | # see ENVIRONMENT in dpkg-buildflags(1) 11 | # package maintainers to append CFLAGS 12 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 13 | # package maintainers to append LDFLAGS 14 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 15 | 16 | 17 | %: 18 | rm -f Makefile 19 | ./install-clatexmath.sh 20 | dh $@ 21 | 22 | 23 | override_dh_auto_configure: 24 | dh_auto_configure -- \ 25 | -DHAVE_CLATEXMATH=ON 26 | 27 | override_dh_shlibdeps: 28 | dh_shlibdeps 29 | sed -i "s/libtinyxml2-6 (>= 5.0.0)/libtinyxml2-6 (>= 5.0.0) | libtinyxml2-6a (>= 5.0.0)/g" debian/notekit.substvars 30 | 31 | -------------------------------------------------------------------------------- /gnome/meson.build: -------------------------------------------------------------------------------- 1 | install_data('com.github.blackhole89.notekit.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')) 2 | gnome.compile_schemas(build_by_default: true, depend_files: 'com.github.blackhole89.notekit.gschema.xml') 3 | 4 | desktop_database = find_program('update-desktop-database', required: false) 5 | # if update-desktop-database is installed, the other tools are probably installed to 6 | # fixme once someone actually hit this otherwise. 7 | if meson.version().version_compare('>=0.57.0') and desktop_database.found() 8 | if meson.version().version_compare('>=0.59.0') 9 | gnome.post_install( 10 | glib_compile_schemas: true, 11 | gtk_update_icon_cache: true, 12 | update_desktop_database: true 13 | ) 14 | else 15 | gnome.post_install( 16 | glib_compile_schemas: true, 17 | gtk_update_icon_cache: true 18 | ) 19 | endif 20 | endif 21 | -------------------------------------------------------------------------------- /data/default_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "active_document" : "", 3 | "use_headerbar" : true, 4 | "use_highlight_proxy" : false, 5 | "colors" : 6 | [ 7 | { 8 | "b" : 0, 9 | "g" : 0, 10 | "r" : 0 11 | }, 12 | { 13 | "b" : 0.75294119119644165, 14 | "g" : 0.65882354974746704, 15 | "r" : 0.62745100259780884 16 | }, 17 | { 18 | "b" : 0.21568627655506134, 19 | "g" : 0.12156862765550613, 20 | "r" : 0.97647058963775635 21 | }, 22 | { 23 | "b" : 0.3960784375667572, 24 | "g" : 0.7607843279838562, 25 | "r" : 0.61568629741668701 26 | }, 27 | { 28 | "b" : 0.73725491762161255, 29 | "g" : 0.47058823704719543, 30 | "r" : 0.21176470816135406 31 | }, 32 | { 33 | "b" : 0, 34 | "g" : 0.64313727617263794, 35 | "r" : 1 36 | }, 37 | { 38 | "b" : 0.49019607901573181, 39 | "g" : 0.26666668057441711, 40 | "r" : 0.76862746477127075 41 | } 42 | ] 43 | } 44 | 45 | -------------------------------------------------------------------------------- /sourceview/markdownlisting.lang: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 25 | -------------------------------------------------------------------------------- /.github/workflows/package-deb.yml: -------------------------------------------------------------------------------- 1 | name: deb package 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | build: 9 | 10 | runs-on: ubuntu-18.04 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: update package list 15 | run: sudo apt-get update 16 | - name: Downloading dependencies 📥 17 | run: sudo apt-get install build-essential meson libfontconfig1-dev zlib1g-dev libgtksourceviewmm-3.0-dev libgtkmm-3.0-dev libtinyxml2-dev debhelper dpkg-dev libjsoncpp-dev 18 | - name: Running debhelper 🛠️ 19 | run: dpkg-buildpackage -b -uc 20 | - name: Upload build artifacts 📤 21 | uses: actions/upload-artifact@v1 22 | with: 23 | repo_token: "${{ secrets.GITHUB_TOKEN }}" 24 | automatic_release_tag: "latest-deb" 25 | prerelease: true 26 | title: "Ubuntu 18.04 package for development version" 27 | files: ../notekit_0.2_amd64.deb 28 | 29 | -------------------------------------------------------------------------------- /freedesktop/meson.build: -------------------------------------------------------------------------------- 1 | app_id = 'com.github.blackhole89.notekit' 2 | appstream_file = files('@0@.metainfo.xml'.format(app_id)) 3 | desktop_file = files('@0@.desktop'.format(app_id)) 4 | 5 | install_data(appstream_file, install_dir : get_option('datadir')/'metainfo') 6 | install_data(desktop_file, install_dir : get_option('datadir')/'applications') 7 | install_data('@0@.svg'.format(app_id), install_dir : get_option('datadir')/'icons/hicolor/scalable/apps') 8 | install_data('@0@.png'.format(app_id), install_dir : get_option('datadir')/'icons/hicolor/128x128/apps') 9 | 10 | 11 | desktop_utils = find_program('desktop-file-validate', required: false) 12 | if desktop_utils.found() 13 | test('Validate desktop file', desktop_utils, 14 | args: [desktop_file] 15 | ) 16 | endif 17 | 18 | appstream_util = find_program('appstream-util', required: false) 19 | if appstream_util.found() 20 | test('Validate appstream file', appstream_util, 21 | args: ['validate-relax', appstream_file] 22 | ) 23 | endif 24 | -------------------------------------------------------------------------------- /Apple/INSTALL.OSX.md: -------------------------------------------------------------------------------- 1 | ![Screenshot on OS X](/screenshots/osx-notekit-example.png?raw=true) 2 | 3 | # OS X - NoteKit install instructions 4 | 5 | To install notekit on OS X, you need to have a working installation of [Homebrew](https://brew.sh). 6 | 7 | If you don't have homebrew installed, you can do so by pasting `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` into a shell promt. 8 | 9 | Once you have homebrew, you can install NoteKit by typing 10 | ```sh 11 | brew install --HEAD sp1ritCS/tap/notekit 12 | ``` 13 | 14 | if you want to launch NoteKit from your deskop (if you don't know what this means, you probably want to) you have to additionally type 15 | ```sh 16 | ln -s /usr/local/opt/notekit/NoteKit.app /Applications/ 17 | ``` 18 | 19 | --- 20 | 21 | Please keep in mind, that the OS X version is less tested, because we have no iMac to test NoteKit on. If something breaks just create an [Issue](https://github.com/blackhole89/notekit/issues/new) and ping [@sp1ritCS](https://github.com/sp1ritCS). 22 | -------------------------------------------------------------------------------- /debian/prerm.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # prerm script for notekit 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `upgrade' 11 | # * `failed-upgrade' 12 | # * `remove' `in-favour' 13 | # * `deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see https://www.debian.org/doc/debian-policy/ or 17 | # the debian-policy package 18 | 19 | 20 | case "$1" in 21 | remove|upgrade|deconfigure) 22 | ;; 23 | 24 | failed-upgrade) 25 | ;; 26 | 27 | *) 28 | echo "prerm called with unknown argument \`$1'" >&2 29 | exit 1 30 | ;; 31 | esac 32 | 33 | # dh_installdeb will replace this with shell code automatically 34 | # generated by other debhelper scripts. 35 | 36 | #DEBHELPER# 37 | 38 | exit 0 39 | -------------------------------------------------------------------------------- /debian/postrm.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for notekit 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see https://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | 22 | case "$1" in 23 | purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 24 | ;; 25 | 26 | *) 27 | echo "postrm called with unknown argument \`$1'" >&2 28 | exit 1 29 | ;; 30 | esac 31 | 32 | # dh_installdeb will replace this with shell code automatically 33 | # generated by other debhelper scripts. 34 | 35 | #DEBHELPER# 36 | 37 | exit 0 38 | -------------------------------------------------------------------------------- /Apple/NoteKit.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleGetInfoString 8 | 0.1.0, Maintainer: Matvey Soloviev, Licensed under GPL-3.0 9 | CFBundleIdentifier 10 | com.github.blackhole89.notekit 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | NoteKit 15 | CFBundlePackageType 16 | AAPL 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleVersion 20 | 0.1.0 21 | NSHumanReadableCopyright 22 | Maintainer: Matvey Soloviev, Licensed under GPL-3.0 23 | CFBundleExecutable 24 | notekit 25 | CFBundleIconFile 26 | NoteKit.icns 27 | 28 | 29 | -------------------------------------------------------------------------------- /debian/postinst.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for notekit 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see https://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | 21 | case "$1" in 22 | configure) 23 | ;; 24 | 25 | abort-upgrade|abort-remove|abort-deconfigure) 26 | ;; 27 | 28 | *) 29 | echo "postinst called with unknown argument \`$1'" >&2 30 | exit 1 31 | ;; 32 | esac 33 | 34 | # dh_installdeb will replace this with shell code automatically 35 | # generated by other debhelper scripts. 36 | 37 | #DEBHELPER# 38 | 39 | exit 0 40 | -------------------------------------------------------------------------------- /imagewidgets.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAGEWIDGETS_H 2 | #define IMAGEWIDGETS_H 3 | 4 | #include "config.h" 5 | 6 | #include 7 | 8 | class CImageWidget : public Gtk::DrawingArea 9 | { 10 | public: 11 | CImageWidget(Glib::RefPtr wnd); 12 | virtual ~CImageWidget(); 13 | 14 | int w,h; 15 | 16 | bool selected; 17 | 18 | Glib::RefPtr target_window; 19 | Cairo::RefPtr image; 20 | Cairo::RefPtr image_ctx; 21 | void SetSize(int x, int y); 22 | 23 | virtual void Redraw(); 24 | 25 | virtual int GetBaseline(); 26 | 27 | virtual bool on_draw(const Cairo::RefPtr &ctx); 28 | 29 | virtual void on_unrealize(); 30 | virtual void destroy_notify_(); 31 | }; 32 | 33 | #if defined (HAVE_LASEM) || defined (HAVE_CLATEXMATH) 34 | 35 | class CLatexWidget : public CImageWidget 36 | { 37 | public: 38 | CLatexWidget(Glib::RefPtr wnd, Glib::ustring source, Gdk::RGBA fg); 39 | virtual ~CLatexWidget(); 40 | 41 | Glib::ustring source; 42 | 43 | virtual void Redraw(); 44 | 45 | int baseline; 46 | virtual int GetBaseline(); 47 | }; 48 | 49 | #endif 50 | 51 | #endif -------------------------------------------------------------------------------- /debian/watch.ex: -------------------------------------------------------------------------------- 1 | # Example watch control file for uscan 2 | # Rename this file to "watch" and then you can run the "uscan" command 3 | # to check for upstream updates and more. 4 | # See uscan(1) for format 5 | 6 | # Compulsory line, this is a version 4 file 7 | version=4 8 | 9 | # PGP signature mangle, so foo.tar.gz has foo.tar.gz.sig 10 | #opts="pgpsigurlmangle=s%$%.sig%" 11 | 12 | # HTTP site (basic) 13 | #http://example.com/downloads.html \ 14 | # files/notekit-([\d\.]+)\.tar\.gz debian uupdate 15 | 16 | # Uncomment to examine an FTP server 17 | #ftp://ftp.example.com/pub/notekit-(.*)\.tar\.gz debian uupdate 18 | 19 | # SourceForge hosted projects 20 | # http://sf.net/notekit/ notekit-(.*)\.tar\.gz debian uupdate 21 | 22 | # GitHub hosted projects 23 | #opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%-$1.tar.gz%" \ 24 | # https://github.com//notekit/tags \ 25 | # (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate 26 | 27 | # PyPI 28 | # https://pypi.debian.net/notekit/notekit-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) 29 | 30 | # Direct Git 31 | # opts="mode=git" http://git.example.com/notekit.git \ 32 | # refs/tags/v([\d\.]+) debian uupdate 33 | 34 | 35 | 36 | 37 | # Uncomment to find new files on GooglePages 38 | # http://example.googlepages.com/foo.html notekit-(.*)\.tar\.gz 39 | -------------------------------------------------------------------------------- /install-clatexmath.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git clone https://github.com/NanoMichael/cLaTeXMath.git 3 | cd cLaTeXMath 4 | git reset --hard e2adaa4 5 | # patch out C++17 feature use in code, but compile with -std=c++17 6 | (cat <= 201703L) || (defined(_MSC_VER) && defined(_HAS_CXX17) && _HAS_CXX17) 31 | -#define CLATEX_CXX17 1 32 | -#else 33 | #define CLATEX_CXX17 0 34 | -#endif 35 | 36 | #endif // CONFIG_H_INCLUDED 37 | EOF 38 | ) | patch -p1 39 | cmake -DCMAKE_BUILD_TYPE=Release -DHAVE_LOG=OFF -DGRAPHICS_DEBUG=OFF . 40 | make 41 | cp -r res ../data/latex 42 | -------------------------------------------------------------------------------- /Apple/llvm.patch: -------------------------------------------------------------------------------- 1 | From ea003311a6137abe7bd5737900b9d9babfd0a299 Mon Sep 17 00:00:00 2001 2 | From: sp1rit 3 | Date: Mon, 30 Jan 2023 19:52:53 +0100 4 | Subject: [PATCH] tweaks to llvm clang build 5 | 6 | Signed-off-by: sp1rit 7 | --- 8 | main.cpp | 4 ++-- 9 | meson.build | 2 +- 10 | 2 files changed, 3 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/main.cpp b/main.cpp 13 | index 98b67a7..43904bc 100644 14 | --- a/main.cpp 15 | +++ b/main.cpp 16 | @@ -23,8 +23,8 @@ int main (int argc, char *argv[]) 17 | Glib::RefPtr app = Gtk::Application::create(argc, argv, "com.github.blackhole89.notekit"); 18 | #endif 19 | 20 | - app->signal_activate().connect( [app,&mainwindow]() { 21 | - mainwindow=new CMainWindow(app); 22 | + app->signal_activate().connect( [app]() { 23 | + auto mainwindow=new CMainWindow(app); 24 | app->add_window(*mainwindow); 25 | } ); 26 | 27 | diff --git a/meson.build b/meson.build 28 | index 6720b25..c43cee1 100644 29 | --- a/meson.build 30 | +++ b/meson.build 31 | @@ -1,6 +1,6 @@ 32 | project('notekit', 'cpp', 33 | version : '0.3.0', 34 | - default_options : ['warning_level=3', 'cpp_std=c++14'] 35 | + default_options : ['warning_level=3', 'cpp_std=c++17'] 36 | ) 37 | 38 | has_devenv = meson.version().version_compare('>=0.58.0') 39 | -- 40 | 2.39.1 41 | 42 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | CMainWindow *mainwindow; 5 | 6 | #ifdef _WIN32 7 | #include 8 | 9 | int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 10 | #else 11 | int main (int argc, char *argv[]) 12 | #endif 13 | { 14 | Gsv::init(); 15 | 16 | #ifdef _WIN32 17 | if (g_getenv("NK_WIN32_DEBUG") && AllocConsole()) { 18 | freopen("CONOUT$", "w", stdout); 19 | freopen("CONOUT$", "w", stderr); 20 | } 21 | Glib::RefPtr app = Gtk::Application::create("com.github.blackhole89.notekit"); 22 | #else 23 | Glib::RefPtr app = Gtk::Application::create(argc, argv, "com.github.blackhole89.notekit"); 24 | #endif 25 | 26 | app->signal_activate().connect( [app,&mainwindow]() { 27 | mainwindow=new CMainWindow(app); 28 | app->add_window(*mainwindow); 29 | } ); 30 | 31 | app->set_accel_for_action("notebook.next-note", "Tab"); 32 | app->set_accel_for_action("notebook.prev-note", "Tab"); 33 | app->set_accel_for_action("notebook.show-find", "F"); 34 | app->set_accel_for_action("win.sidebar", "F9"); 35 | app->set_accel_for_action("win.presentation", "F11"); 36 | 37 | auto ret = app->run(); 38 | 39 | 40 | if(mainwindow != nullptr){ 41 | delete mainwindow; 42 | } 43 | 44 | return ret; 45 | } 46 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: notekit 3 | Upstream-Contact: Matvey Soloviev 4 | Source: https://github.com/blackhole89/notekit 5 | 6 | Files: * 7 | Copyright: 2019-2020 Matvey Soloviev 8 | License: GPL-3.0+ 9 | 10 | Files: debian/* 11 | Copyright: 2020 Matvey Soloviev 12 | License: GPL-3.0+ 13 | 14 | License: GPL-3.0+ 15 | This program is free software: you can redistribute it and/or modify 16 | it under the terms of the GNU General Public License as published by 17 | the Free Software Foundation, either version 3 of the License, or 18 | (at your option) any later version. 19 | . 20 | This package is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | . 25 | You should have received a copy of the GNU General Public License 26 | along with this program. If not, see . 27 | . 28 | On Debian systems, the complete text of the GNU General 29 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 30 | 31 | # Please also look if there are files or directories which have a 32 | # different copyright/license attached and list them here. 33 | # Please avoid picking licenses with terms that are more restrictive than the 34 | # packaged work, as it may make Debian's contributions unacceptable upstream. 35 | # 36 | # If you need, there are some extra license texts available in two places: 37 | # /usr/share/debhelper/dh_make/licenses/ 38 | # /usr/share/common-licenses/ 39 | -------------------------------------------------------------------------------- /debian/manpage.1.ex: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .\" (C) Copyright 2020 Matvey Soloviev , 3 | .\" 4 | .\" First parameter, NAME, should be all caps 5 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection 6 | .\" other parameters are allowed: see man(7), man(1) 7 | .TH Notekit SECTION "December 24 2020" 8 | .\" Please adjust this date whenever revising the manpage. 9 | .\" 10 | .\" Some roff macros, for reference: 11 | .\" .nh disable hyphenation 12 | .\" .hy enable hyphenation 13 | .\" .ad l left justify 14 | .\" .ad b justify to both left and right margins 15 | .\" .nf disable filling 16 | .\" .fi enable filling 17 | .\" .br insert line break 18 | .\" .sp insert n+1 empty lines 19 | .\" for manpage-specific macros, see man(7) 20 | .SH NAME 21 | notekit \- program to do something 22 | .SH SYNOPSIS 23 | .B notekit 24 | .RI [ options ] " files" ... 25 | .br 26 | .B bar 27 | .RI [ options ] " files" ... 28 | .SH DESCRIPTION 29 | This manual page documents briefly the 30 | .B notekit 31 | and 32 | .B bar 33 | commands. 34 | .PP 35 | .\" TeX users may be more comfortable with the \fB\fP and 36 | .\" \fI\fP escape sequences to invode bold face and italics, 37 | .\" respectively. 38 | \fBnotekit\fP is a program that... 39 | .SH OPTIONS 40 | These programs follow the usual GNU command line syntax, with long 41 | options starting with two dashes (`-'). 42 | A summary of options is included below. 43 | For a complete description, see the Info files. 44 | .TP 45 | .B \-h, \-\-help 46 | Show summary of options. 47 | .TP 48 | .B \-v, \-\-version 49 | Show version of program. 50 | .SH SEE ALSO 51 | .BR bar (1), 52 | .BR baz (1). 53 | .br 54 | The programs are documented fully by 55 | .IR "The Rise and Fall of a Fooish Bar" , 56 | available via the Info system. 57 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('notekit', 'cpp', 2 | version : '0.3.0', 3 | default_options : ['warning_level=3', 'cpp_std=c++14'] 4 | ) 5 | 6 | has_devenv = meson.version().version_compare('>=0.58.0') 7 | if has_devenv 8 | devenv = environment() 9 | devenv.set('NK_DEVEL', meson.project_source_root()) 10 | devenv.set('NK_SETTINGS', 'json') 11 | endif 12 | 13 | conf_data = configuration_data() 14 | conf_data.set('version', meson.project_version()) 15 | 16 | gnome = import('gnome') 17 | 18 | deps = [ 19 | dependency('gtkmm-3.0'), 20 | dependency('gtksourceviewmm-3.0'), 21 | dependency('zlib'), 22 | dependency('fontconfig'), 23 | dependency('gdk-x11-3.0', required : false), 24 | dependency('jsoncpp') 25 | ] 26 | 27 | if get_option('clatexmath') 28 | deps += dependency('clatexmath', version: '>=0.0.3', fallback: ['clatexmath', 'clatexmath_dep']) 29 | conf_data.set('HAVE_CLATEXMATH', true) 30 | endif 31 | 32 | conf_data.set('settings_provider', get_option('settings_provider')) 33 | conf_data.set('MIGRATE_LEGACY_SETTINGS', get_option('migrate_legacy_settings')) 34 | 35 | configure_file(input : 'config.h.meson.in', 36 | output : 'config.h', 37 | configuration : conf_data 38 | ) 39 | 40 | subdir('freedesktop') 41 | 42 | install_subdir('data/', install_dir: get_option('datadir')/'notekit') 43 | install_subdir('sourceview/', install_dir: get_option('datadir')/'notekit') 44 | 45 | subdir('gnome') 46 | 47 | src = [ 48 | 'about.cpp', 49 | 'drawing.cpp', 50 | 'imagewidgets.cpp', 51 | 'main.cpp', 52 | 'mainwindow.cpp', 53 | 'navigation.cpp', 54 | 'notebook.cpp', 55 | 'settings.cpp' 56 | ] 57 | 58 | if meson.version().version_compare('>=0.56.0') 59 | executable('notekit', src, 60 | dependencies: deps, 61 | install : true, 62 | win_subsystem: 'windows' 63 | ) 64 | else 65 | executable('notekit', src, 66 | dependencies: deps, 67 | install : true 68 | ) 69 | endif 70 | 71 | if has_devenv 72 | meson.add_devenv(devenv) 73 | endif 74 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/large-pen-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Gnome Symbolic Icon Theme 6 | 7 | 8 | 9 | image/svg+xml 10 | 11 | Gnome Symbolic Icon Theme 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/medium-pen-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Gnome Symbolic Icon Theme 6 | 7 | 8 | 9 | image/svg+xml 10 | 11 | Gnome Symbolic Icon Theme 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/small-pen-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Gnome Symbolic Icon Theme 6 | 7 | 8 | 9 | image/svg+xml 10 | 11 | Gnome Symbolic Icon Theme 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/pick-color-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Gnome Symbolic Icon Theme 6 | 7 | 8 | 9 | image/svg+xml 10 | 11 | Gnome Symbolic Icon Theme 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /gnome/com.github.blackhole89.notekit.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | "µ{default}" 6 | The directory in which the tree of notes is stored. 7 | 8 | 9 | "" 10 | The currently active document 11 | 12 | 13 | true 14 | Display a GNOME style CSD title bar instead of deferring to the window manager / gtk fallback. 15 | 16 | 17 | true 18 | Enable syntax highlighting in three-backtick code spans, using the languages supported by your system's GtkSourceView (gedit, pluma etc.) setup. 19 | 20 | 21 | true 22 | Enable proximity widgets 23 | 24 | 25 | true 26 | Change the sidebar visibility 27 | 28 | 29 | false 30 | Enables presentation / hide-everything mode 31 | 32 | 33 | false 34 | If NoteKit should use the "classic" sidebar style, used upto the 8th Dec 2021 or a "slightly more theme-agnostic way". 35 | 36 | 37 | [ 38 | (0.0,0.0,0.0,1.0), 39 | (0.62745100259780884,0.65882354974746704,0.75294119119644165,1.0), 40 | (0.97647058963775635,0.12156862765550613,0.21568627655506134,1.0), 41 | (0.61568629741668701,0.7607843279838562,0.3960784375667572,1.0), 42 | (0.21176470816135406,0.47058823704719543,0.73725491762161255,1.0), 43 | (1.0,0.64313727617263794,0.0,1.0), 44 | (0.76862746477127075,0.26666668057441711,0.49019607901573181,1.0) 45 | ] 46 | An array of selected colors specified as a tuple of four doubles, specifying RGBA values between 0 and 1. Each item represents one button within the toolbar. 47 | 48 | 49 | false 50 | Show the config migration dialog, if a legacy config has been found and this is set to false. 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /drawing.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAWING_H 2 | #define DRAWING_H 3 | 4 | #include "config.h" 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | class CStroke { 13 | public: 14 | float r,g,b,a; 15 | std::vector xcoords; 16 | std::vector ycoords; 17 | std::vector pcoords; 18 | 19 | std::vector selected; 20 | 21 | void Reset(); 22 | void Append(float x, float y, float p); 23 | void GetHead(float &x, float &y); 24 | float GetHeadCurvatureWrt(float x, float y); 25 | void Simplify(); 26 | void Render(const Cairo::RefPtr &ctx, float basex, float basey, int start_index=1); 27 | void GetBBox(float &x0, float &x1, float &y0, float &y1, int start_index=0); 28 | void ForceMinXY(float x, float y); 29 | 30 | void RenderSelectionGlow(const Cairo::RefPtr &ctx, float basex, float basey); 31 | bool Select(float x0, float x1, float y0, float y1); 32 | void Unselect(); 33 | }; 34 | 35 | class CBoundDrawing : public Gtk::DrawingArea 36 | { 37 | public: 38 | CBoundDrawing(Glib::RefPtr wnd); 39 | 40 | static CBoundDrawing *TryUpcast(Gtk::Widget *w); 41 | 42 | std::vector strokes; 43 | 44 | /* accelerator structure for quickly finding strokes e.g. when erasing */ 45 | static const int BUCKET_SIZE = 16; 46 | static constexpr int BUCKET(int x,int y) { 47 | return ((y/BUCKET_SIZE)<<16) + (x/BUCKET_SIZE); 48 | } 49 | struct strokeRef { int index; int offset; }; 50 | std::unordered_multimap strokefinder; 51 | 52 | int w,h; 53 | 54 | bool selected; 55 | 56 | Glib::RefPtr target_window; 57 | Cairo::RefPtr image; 58 | Cairo::RefPtr image_ctx; 59 | bool UpdateSize(int w, int h, int dx=0, int dy=0); 60 | void Redraw(); 61 | void RebuildStrokefinder(); 62 | 63 | void RecalculateSize(); 64 | bool AddStroke(CStroke &s, float dx, float dy, bool force=false); 65 | void EraseAt(float x, float y, float radius, bool whole_stroke); 66 | 67 | void Select(float x0, float x1, float y0, float y1); 68 | void Unselect(); 69 | 70 | virtual bool on_button_press_event(GdkEventButton* event); 71 | virtual bool on_button_release_event(GdkEventButton* event); 72 | virtual bool on_motion_notify_event(GdkEventMotion* event); 73 | virtual bool on_draw(const Cairo::RefPtr &ctx); 74 | 75 | virtual void on_unrealize(); 76 | virtual void destroy_notify_(); 77 | 78 | std::string Serialize(); 79 | std::string SerializePNG(); 80 | std::string SerializeSVG(); 81 | void Deserialize(std::string input); 82 | void DumpForDebugging(); 83 | }; 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /sourceview/language.dtd: -------------------------------------------------------------------------------- 1 | 23 | 24 | 27 | 28 | 29 | 31 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 47 | 48 | 49 | 52 | 53 | 54 | 56 | 57 | 58 | 60 | 61 | 62 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /data/stylesheet.css: -------------------------------------------------------------------------------- 1 | .notekit .sidebar .view, .notekit .sidebar iconview, 2 | .notekit .sidebar row { 3 | border-color: rgba(186, 195, 207, 0.6); 4 | } 5 | 6 | .notekit .background, 7 | .notekit .sidebar.classic list { 8 | background-color: transparent; } 9 | 10 | .notekit .sidebar.classic { 11 | color: #BAC3CF; 12 | background-color: rgba(53, 57, 69, 0.95); } 13 | 14 | .notekit .sidebar.classic .view, .notekit .sidebar.classic iconview, 15 | .notekit .sidebar.classic row { 16 | color: #BAC3CF; /* border-width: 0px; */ 17 | } 18 | 19 | .notekit .sidebar.classic .view.cell:selected, .notekit .sidebar.classic iconview.cell:selected, .notekit .sidebar.classic row.cell:selected { 20 | background-color: #5294e2; 21 | color: #ffffff; } 22 | 23 | .notekit .sidebar.classic .view.expander, .notekit .sidebar.classic iconview.expander, .notekit .sidebar.classic row.expander { 24 | color: rgba(123, 129, 141, 0.975); } 25 | 26 | .notekit .sidebar.classic .view.expander:hover, .notekit .sidebar.classic iconview.expander:hover, .notekit .sidebar.classic row.expander:hover { 27 | color: #BAC3CF; } 28 | 29 | .notekit .sidebar.classic row .sidebar-icon { 30 | color: rgba(186, 195, 207, 0.6); } 31 | 32 | .notekit .sidebar.classic row:hover { 33 | background-color: rgba(186, 195, 207, 0.15); } 34 | 35 | .notekit .sidebar.classic row:disabled, .notekit .sidebar.classic row:disabled label, .notekit .sidebar.classic row:disabled image { 36 | color: rgba(186, 195, 207, 0.4); } 37 | 38 | .notekit .sidebar.classic row:not(:selected) button { 39 | color: #BAC3CF; } 40 | 41 | .notekit .sidebar.classic row:not(:selected) button:hover { 42 | color: #BAC3CF; 43 | border-color: rgba(26, 28, 34, 0.35); 44 | background-color: rgba(119, 127, 151, 0.45); } 45 | 46 | .notekit .sidebar.classic row:not(:selected) button:active { 47 | color: #ffffff; 48 | border-color: #2b2e39; 49 | background-color: #5294e2; } 50 | 51 | .notekit .sidebar.classic row:drop(active):not(:disabled), 52 | .notekit .sidebar.classic row:drop(active):not(:disabled) label { 53 | color: #F08437; 54 | } 55 | 56 | .notekit .sidebar.classic row:drop(active):not(:disabled):selected { 57 | background-color: #F08437; } 58 | 59 | .notekit .sidebar.classic row:drop(active):not(:disabled):selected, 60 | .notekit .sidebar.classic row:drop(active):not(:disabled):selected label 61 | { 62 | color: #ffffff; } 63 | 64 | .notekit .sidebar.classic separator { 65 | background-color: transparent; } 66 | 67 | #mainView { 68 | font-size: 16px; 69 | font-family: Charter, Bitstream Charter, Noto Serif, Noto Serif CJK JP, Noto Naskh Arabic, serif; 70 | padding-top: 16px; 71 | padding-right: 16px; 72 | padding-bottom: 16px; 73 | } 74 | 75 | #mainViewScroll { 76 | background: red; 77 | border-color: blue; 78 | } 79 | -------------------------------------------------------------------------------- /navigation.h: -------------------------------------------------------------------------------- 1 | #ifndef NAVIGATION_H 2 | #define NAVIGATION_H 3 | 4 | #include "config.h" 5 | 6 | #include 7 | 8 | enum { 9 | CT_FILE, 10 | CT_DIR_UNLOADED, 11 | CT_DIR_LOADED, 12 | CT_ADDER 13 | }; 14 | 15 | class CMainWindow; 16 | class CNavigationView; 17 | 18 | class CNavigationTreeStore : public Gtk::TreeStore { 19 | public: 20 | class Columns : public Gtk::TreeModel::ColumnRecord { 21 | public: 22 | Columns(); 23 | 24 | Gtk::TreeModelColumn name; 25 | Gtk::TreeModelColumn full_path; 26 | Gtk::TreeModelColumn ext; 27 | Gtk::TreeModelColumn ord; 28 | Gtk::TreeModelColumn type; 29 | Gtk::TreeModelColumn expanded; 30 | }; 31 | protected: 32 | CNavigationTreeStore(const Columns &, CNavigationView*); 33 | 34 | const Columns *cols; // annoyingly, we need to keep a pointer or else do heavy refactoring 35 | CNavigationView *nview; // likewise here 36 | 37 | virtual bool row_draggable_vfunc(const Gtk::TreeModel::Path& path) const override; 38 | virtual bool row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest, const Gtk::SelectionData& selection_data) const override; 39 | virtual bool drag_data_received_vfunc (const Gtk::TreeModel::Path& dest, const Gtk::SelectionData& selection_data) override; 40 | public: 41 | static Glib::RefPtr create(const Columns &cols, CNavigationView*); 42 | }; 43 | 44 | class CNavigationView { 45 | public: 46 | CNavigationTreeStore::Columns cols; 47 | 48 | CNavigationView(); 49 | 50 | std::string base; 51 | void SetBasePath(std::string newbase); 52 | 53 | CMainWindow *mainwindow; 54 | Gtk::TreeView *v; 55 | /*Gtk::CellRendererText name_renderer; 56 | Gtk::CellRendererPixbuf icon_renderer; 57 | Gtk::TreeViewColumn name_col;*/ 58 | 59 | Glib::RefPtr store; 60 | 61 | std::string Row2Path(Gtk::TreeModel::iterator row); 62 | 63 | void AttachView(CMainWindow *w, Gtk::TreeView *v); 64 | void ExpandDirectory(std::string path, const Gtk::TreeNodeChildren *node); 65 | void ExpandAndSelect(Glib::ustring path); 66 | 67 | void NextDoc(); 68 | void PrevDoc(); 69 | 70 | void HandleRename(std::string oldname, std::string newname); 71 | void FixPaths(std::string path, const Gtk::TreeNodeChildren *node); 72 | void MaybeDeleteSelected(); 73 | bool TryMove(const Gtk::TreeModel::Path &src, const Gtk::TreeModel::Path &dst); 74 | 75 | void CreateAdder(Gtk::TreeModel::iterator row); 76 | 77 | void on_row_edit_start(Gtk::CellEditable* cell_editable, const Glib::ustring& path); 78 | void on_row_edit_commit(const Glib::ustring& path_string, const Glib::ustring& new_text); 79 | void on_row_activated(const Gtk::TreeModel::Path &path, const Gtk::TreeViewColumn *col); 80 | bool on_expand_row(const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path); 81 | void on_postexpand_row(const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path); 82 | void on_collapse_row(const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path); 83 | 84 | void on_render_cell(Gtk::CellRenderer *cr, const Gtk::TreeModel::iterator &iter); 85 | 86 | Gtk::Menu popup; 87 | void on_button_press_event(GdkEventButton* event); 88 | 89 | sigc::connection conns[7]; 90 | }; 91 | 92 | #endif -------------------------------------------------------------------------------- /notebook_highlight.hpp: -------------------------------------------------------------------------------- 1 | std::string CNotebook::GetHighlightProxyDir() 2 | { 3 | g_autofree gchar* dir = g_build_path("/", g_get_tmp_dir(), "notekit.gsv", NULL); 4 | errno = 0; 5 | if (g_mkdir_with_parents(dir, 0777) && errno!=EEXIST) { 6 | printf("Failed to create a temporary directory for syntax highlighting data.\n"); 7 | return ""; 8 | } 9 | 10 | g_autofree gchar* listing = g_build_path("/", dir, "markdownlisting.lang", NULL); 11 | if(!access(listing, R_OK)) { 12 | // file already exists 13 | return std::string (dir); 14 | } 15 | FILE *fl = fopen(listing,"wb"); 16 | if(!fl) { 17 | printf("Failed to create a language definition for syntax highlighting data.\n"); 18 | return ""; 19 | } 20 | 21 | /* start detecting languages */ 22 | Glib::RefPtr lm = Gsv::LanguageManager::get_default(); 23 | std::vector langs = lm->get_language_ids(); 24 | std::vector langs_supported; 25 | for(std::string &l : langs) { 26 | if(!lm->get_language(l)->get_hidden()) langs_supported.push_back(l); 27 | } 28 | 29 | /* generate code listing proxy lang definition */ 30 | fprintf(fl,"\n\n"); 31 | fprintf(fl,"\n"); 69 | 70 | fclose(fl); 71 | 72 | return std::string (dir); 73 | } 74 | -------------------------------------------------------------------------------- /base64.h: -------------------------------------------------------------------------------- 1 | 2 | const static char encodeLookup[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 3 | const static char padCharacter = '='; 4 | std::string base64Encode(std::vector inputBuffer) 5 | { 6 | std::string encodedString; 7 | encodedString.reserve(((inputBuffer.size()/3) + (inputBuffer.size() % 3 > 0)) * 4); 8 | unsigned long temp; 9 | std::vector::iterator cursor = inputBuffer.begin(); 10 | for(size_t idx = 0; idx < inputBuffer.size()/3; idx++) 11 | { 12 | temp = (*cursor++) << 16; //Convert to big endian 13 | temp += (*cursor++) << 8; 14 | temp += (*cursor++); 15 | encodedString.append(1,encodeLookup[(temp & 0x00FC0000) >> 18]); 16 | encodedString.append(1,encodeLookup[(temp & 0x0003F000) >> 12]); 17 | encodedString.append(1,encodeLookup[(temp & 0x00000FC0) >> 6 ]); 18 | encodedString.append(1,encodeLookup[(temp & 0x0000003F) ]); 19 | } 20 | switch(inputBuffer.size() % 3) 21 | { 22 | case 1: 23 | temp = (*cursor++) << 16; //Convert to big endian 24 | encodedString.append(1,encodeLookup[(temp & 0x00FC0000) >> 18]); 25 | encodedString.append(1,encodeLookup[(temp & 0x0003F000) >> 12]); 26 | encodedString.append(2,padCharacter); 27 | break; 28 | case 2: 29 | temp = (*cursor++) << 16; //Convert to big endian 30 | temp += (*cursor++) << 8; 31 | encodedString.append(1,encodeLookup[(temp & 0x00FC0000) >> 18]); 32 | encodedString.append(1,encodeLookup[(temp & 0x0003F000) >> 12]); 33 | encodedString.append(1,encodeLookup[(temp & 0x00000FC0) >> 6 ]); 34 | encodedString.append(1,padCharacter); 35 | break; 36 | } 37 | return encodedString; 38 | } 39 | 40 | std::vector base64Decode(const std::string& input) 41 | { 42 | if (input.length() % 4) //Sanity check 43 | throw std::runtime_error("Non-Valid base64!"); 44 | size_t padding = 0; 45 | if (input.length()) 46 | { 47 | if (input[input.length()-1] == padCharacter) 48 | padding++; 49 | if (input[input.length()-2] == padCharacter) 50 | padding++; 51 | } 52 | //Setup a vector to hold the result 53 | std::vector decodedBytes; 54 | decodedBytes.reserve(((input.length()/4)*3) - padding); 55 | unsigned long temp=0; //Holds decoded quanta 56 | std::string::const_iterator cursor = input.begin(); 57 | while (cursor < input.end()) 58 | { 59 | for (size_t quantumPosition = 0; quantumPosition < 4; quantumPosition++) 60 | { 61 | temp <<= 6; 62 | if (*cursor >= 0x41 && *cursor <= 0x5A) // This area will need tweaking if 63 | temp |= *cursor - 0x41; // you are using an alternate alphabet 64 | else if (*cursor >= 0x61 && *cursor <= 0x7A) 65 | temp |= *cursor - 0x47; 66 | else if (*cursor >= 0x30 && *cursor <= 0x39) 67 | temp |= *cursor + 0x04; 68 | else if (*cursor == 0x2B) 69 | temp |= 0x3E; //change to 0x2D for URL alphabet 70 | else if (*cursor == 0x2F) 71 | temp |= 0x3F; //change to 0x5F for URL alphabet 72 | else if (*cursor == padCharacter) //pad 73 | { 74 | switch( input.end() - cursor ) 75 | { 76 | case 1: //One pad character 77 | decodedBytes.push_back((temp >> 16) & 0x000000FF); 78 | decodedBytes.push_back((temp >> 8 ) & 0x000000FF); 79 | return decodedBytes; 80 | case 2: //Two pad characters 81 | decodedBytes.push_back((temp >> 10) & 0x000000FF); 82 | return decodedBytes; 83 | default: 84 | throw std::runtime_error("Invalid Padding in Base 64!"); 85 | } 86 | } else 87 | throw std::runtime_error("Non-Valid Character in Base 64!"); 88 | cursor++; 89 | } 90 | decodedBytes.push_back((temp >> 16) & 0x000000FF); 91 | decodedBytes.push_back((temp >> 8 ) & 0x000000FF); 92 | decodedBytes.push_back((temp ) & 0x000000FF); 93 | } 94 | return decodedBytes; 95 | } -------------------------------------------------------------------------------- /sourceview/styles.rng: -------------------------------------------------------------------------------- 1 | 2 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | ([a-zA-Z0-9_]|-)+ 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 1.0 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | ([a-zA-Z0-9_]|-)+ 72 | 73 | 74 | 75 | 76 | #.* 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | true 103 | false 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: MinGW Windows Nightly Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | mingw: 10 | runs-on: ubuntu-latest 11 | container: 12 | image: registry.fedoraproject.org/fedora:33 13 | options: --privileged 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Download dependencies 📥 17 | run: | 18 | dnf install -y "dnf-command(config-manager)" curl git patch 19 | dnf install -y gcc-c++ meson 20 | dnf install -y mingw64-filesystem mingw64-gcc-c++ 21 | dnf install -y mingw64-winpthreads-static 22 | dnf install -y mingw64-gtkmm30 mingw64-gtksourceviewmm3 mingw64-jsoncpp mingw64-zlib mingw64-fontconfig mingw64-librsvg2 23 | dnf install -y adwaita-icon-theme gtk-update-icon-cache 24 | - name: Install Rust 🦀 25 | run: | 26 | export RUSTUP_HOME=/usr/rustup \ 27 | CARGO_HOME=/usr/cargo \ 28 | PATH=/usr/cargo/bin:$PATH 29 | curl --proto '=https' --tlsv1.2 -sSf -o /tmp/rustup-init.sh https://sh.rustup.rs 30 | sh /tmp/rustup-init.sh -y --no-modify-path -t x86_64-pc-windows-gnu 31 | - name: Build uutils coreutils 🍷 32 | run: | 33 | export RUSTUP_HOME=/usr/rustup \ 34 | CARGO_HOME=/usr/cargo \ 35 | PATH=/usr/cargo/bin:$PATH 36 | git clone https://github.com/uutils/coreutils.git && cd coreutils 37 | git checkout $(git describe --abbrev=0 --tags) 38 | cargo build --target=x86_64-pc-windows-gnu --release -p uu_mkdir -p uu_touch -p uu_mv -p uu_rm 39 | - name: Install cLaTeXMath 🖋 40 | run: | 41 | dnf config-manager --add-repo https://download.opensuse.org/repositories/home:sp1rit:mingw/Fedora_33/home:sp1rit:mingw.repo 42 | dnf install -y mingw64-clatexmath mingw64-clatexmath-static 43 | - name: Configure 🔧 44 | run: meson --prefix=/ --cross-file=/usr/share/mingw/toolchain-mingw64.meson --default-library shared bin-x86_64-w64-mingw32 45 | - name: Compile 🎲 46 | run: ninja -C bin-x86_64-w64-mingw32 47 | - name: Build Windows-compatible directory 📁 48 | run: | 49 | mkdir dist 50 | DESTDIR="$PWD/dist/" ninja -C bin-x86_64-w64-mingw32 install 51 | #cp $(x86_64-w64-mingw32-objdump -p dist/bin/notekit.exe | grep "DLL Name" | awk '{print $3}' | grep -vE '(KERNEL|msvcrt)' | sed "s|^|/usr/x86_64-w64-mingw32/sys-root/mingw/bin/|" | tr "\n" " ") dist/bin/ 52 | # fuck it, we'll ship the whole bin/ folder for now 53 | cp -r /usr/x86_64-w64-mingw32/sys-root/mingw/bin/* dist/bin/ 54 | mv dist/share/ dist/bin/ 55 | mv dist/bin/share/notekit/{data,sourceview} dist/bin/ 56 | # copy share dir from mingw root to release 57 | cp -r /usr/x86_64-w64-mingw32/sys-root/mingw/share/* dist/bin/share/ 58 | # copy clatexmath to direct path, as it's autodetection does not work 59 | cp -r dist/bin/share/clatexmath/ dist/bin/data/latex 60 | # add gtk-pixbuf libs 61 | mkdir dist/bin/lib/ 62 | cp -r /usr/x86_64-w64-mingw32/sys-root/mingw/lib/gdk-pixbuf-2.0 dist/bin/lib/ 63 | # I'd advise against patching auto-generated files, however to run gtk-pixbuf-query-loaders.exe we'd need wine 64 | sed 's|^"\.\./lib/|"./lib/|' -i dist/bin/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache 65 | # add Adwaita icons 66 | cp -r /usr/share/icons/Adwaita/ dist/bin/data/icons/ 67 | # generate icon cache for notekit icons 68 | gtk-update-icon-cache dist/bin/data/icons/hicolor/ 69 | # recompile gsettings schema cache 70 | glib-compile-schemas dist/bin/share/glib-2.0/schemas/gnome 71 | # add rust uutils coreutils 72 | cp coreutils/target/x86_64-pc-windows-gnu/release/{mkdir,touch,mv,rm}.exe dist/bin/ 73 | # add notesbase folder and put README.md into it 74 | mkdir dist/bin/notesbase 75 | cp README.md dist/bin/notesbase 76 | cp LICENSE dist/ 77 | # 78 | mv dist/bin/ dist/notekit/ 79 | pushd dist/ 80 | zip -9r notekit_mingw.zip notekit/ LICENSE 81 | popd 82 | - name: Upload nightly Windows build 📤 83 | uses: actions/upload-artifact@v2 84 | with: 85 | name: NoteKit - Windows x86_64 nightly build 86 | path: dist/notekit_mingw.zip 87 | -------------------------------------------------------------------------------- /pkgs/flatpak/com.github.blackhole89.notekit.yaml: -------------------------------------------------------------------------------- 1 | app-id: com.github.blackhole89.notekit 2 | runtime: org.gnome.Platform 3 | runtime-version: '3.38' 4 | sdk: org.gnome.Sdk 5 | command: notekit 6 | finish-args: 7 | - --socket=wayland 8 | - --socket=fallback-x11 9 | - --device=dri 10 | modules: 11 | - name: jsoncpp 12 | buildsystem: meson 13 | config-opts: 14 | - "-Dtests=false" 15 | sources: 16 | - type: git 17 | url: https://github.com/leethomason/tinyxml2.git 18 | commit: 1dee28e51f9175a31955b9791c74c430fe13dc82 19 | 20 | - name: jsoncpp 21 | buildsystem: meson 22 | config-opts: 23 | - "-Dtests=false" 24 | sources: 25 | - type: archive 26 | url: https://github.com/open-source-parsers/jsoncpp/archive/1.9.5.tar.gz 27 | sha256: f409856e5920c18d0c2fb85276e24ee607d2a09b5e7d5f0a371368903c275da2 28 | 29 | - name: mm-common 30 | buildsystem: meson 31 | sources: 32 | - type: archive 33 | url: https://download.gnome.org/sources/mm-common/1.0/mm-common-1.0.2.tar.xz 34 | sha256: a2a99f3fa943cf662f189163ed39a2cfc19a428d906dd4f92b387d3659d1641d 35 | cleanup: 36 | - '*' 37 | 38 | - name: sigc++ 39 | buildsystem: meson 40 | config-opts: 41 | - "-Dbuild-examples=false" 42 | sources: 43 | - type: archive 44 | url: https://github.com/libsigcplusplus/libsigcplusplus/releases/download/2.10.4/libsigc++-2.10.4.tar.xz 45 | sha256: '1f5874358d9a21379024a4f4edba80a8a3aeb33f0531b192a6b1c35ed7dbfa3e' 46 | cleanup: 47 | - '/lib/sigc++*' 48 | 49 | - name: glibmm 50 | config-opts: 51 | - "--disable-documentation" 52 | sources: 53 | - type: archive 54 | url: https://download.gnome.org/sources/glibmm/2.64/glibmm-2.64.2.tar.xz 55 | sha256: 'a75282e58d556d9b2bb44262b6f5fb76c824ac46a25a06f527108bec86b8d4ec' 56 | 57 | - name: cairomm 58 | config-opts: 59 | - --disable-documentation 60 | sources: 61 | - type: archive 62 | url: 'https://www.cairographics.org/releases/cairomm-1.12.2.tar.gz' 63 | sha256: 45c47fd4d0aa77464a75cdca011143fea3ef795c4753f6e860057da5fb8bd599 64 | cleanup: 65 | - '/lib/cairomm*' 66 | 67 | - name: pangomm 68 | config-opts: 69 | - --disable-documentation 70 | sources: 71 | - type: archive 72 | url: https://download.gnome.org/sources/pangomm/2.42/pangomm-2.42.1.tar.xz 73 | sha256: '14bf04939930870d5cfa96860ed953ad2ce07c3fd8713add4a1bfe585589f40f' 74 | cleanup: 75 | - '/lib/pangomm*' 76 | 77 | - name: atkmm 78 | config-opts: 79 | - --disable-documentation 80 | sources: 81 | - type: archive 82 | url: https://download.gnome.org/sources/atkmm/2.28/atkmm-2.28.0.tar.xz 83 | sha256: 4c4cfc917fd42d3879ce997b463428d6982affa0fb660cafcc0bc2d9afcedd3a 84 | cleanup: 85 | - '/lib/atkmm*' 86 | 87 | - name: gtkmm 88 | config-opts: 89 | - --disable-documentation 90 | sources: 91 | - type: archive 92 | url: https://download.gnome.org/sources/gtkmm/3.24/gtkmm-3.24.2.tar.xz 93 | sha256: '6d71091bcd1863133460d4188d04102810e9123de19706fb656b7bb915b4adc3' 94 | cleanup: 95 | - '/lib/gdkmm*' 96 | - '/lib/gtkmm*' 97 | 98 | - name: gtksourceviewmm 99 | config-opts: 100 | - --disable-documentation 101 | sources: 102 | - type: archive 103 | url : https://download.gnome.org/sources/gtksourceviewmm/3.21/gtksourceviewmm-3.21.3.tar.xz 104 | sha256: 'dbb00b1c28e0407cc27d8b07a2ed0b4ea22f92e4b3e3006431cbd6726b6256b5' 105 | cleanup: 106 | - '/lib/gtksourceviewmm*' 107 | modules: 108 | - name: gtksourceview 109 | config-opts: 110 | - "--disable-gtk-doc" 111 | sources: 112 | - type: archive 113 | url: https://download.gnome.org/sources/gtksourceview/3.24/gtksourceview-3.24.8.tar.xz 114 | sha256: 1e9bb8ff190db705deb916dd23ff681f0e8803aec407bf0fd64c7e615ac436fe 115 | 116 | - name: cLaTeXMath 117 | buildsystem: meson 118 | sources: 119 | - type: git 120 | url: https://github.com/NanoMichael/cLaTeXMath 121 | commit: 580809b4c5177fa59a8a645987bbba105361b4a2 122 | 123 | - name: notekit 124 | buildsystem: meson 125 | sources: 126 | - type: dir 127 | path: ../../ 128 | -------------------------------------------------------------------------------- /freedesktop/com.github.blackhole89.notekit.metainfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.github.blackhole89.notekit 4 | CC0-1.0 5 | GPL-3.0-or-later 6 | NoteKit 7 | com.github.blackhole89.notekit.desktop 8 | A GTK3 hierarchical markdown notetaking application with tablet support 9 | 10 |

11 | This program is a structured notetaking application based on GTK+ 3. 12 | Write your notes in instantly-formatted Markdown, organise them in a 13 | tree of folders that can be instantly navigated from within the 14 | program, and add hand-drawn notes by mouse, touchscreen or 15 | digitiser. 16 |

17 |

18 | 1. Why? 19 |

20 |

21 | I figured it would be nice to have a free-software, 22 | platform-independent OneNote. While there is a remarkable number of 23 | free (speech or beer) notetaking applications out there, to my best 24 | knowledge, none of them simultaneously check the following boxes: 25 |

26 |
    27 |
  • note organisation
  • 28 |
  • text as a first-class object
  • 29 |
  • formatting
  • 30 |
  • simple, standard on-disk format
  • 31 |
  • tablet input
  • 32 |
33 |

34 | 2. Usage notes 35 |

36 |

37 | Note management 38 |

39 |
    40 |
  • To create a new note, doubleclick a "+" node in the tree view 41 | and enter a name.
  • 42 |
  • To create a new folder, doubleclick a "+" node in the tree view 43 | and enter a name ending in "/", e.g. new "folder/".
  • 44 |
  • Notes will be sorted alphabetically.
  • 45 |
  • You can move notes and whole folders between folders by dragging 46 | and dropping.
  • 47 |
  • Files are saved automatically when the window is closed, when a 48 | different file is opened, and after a timeout when no user 49 | action is performed.
  • 50 |
51 |

52 | Markdown 53 |

54 |
    55 |
  • Some markdown features are unsupported as a stylistic choice or 56 | because of parser limitations. If you are feeling adventurous, 57 | you can adjust the markdown parser by editing the GtkSourceView 58 | language definition in "sourceview/markdown.lang".
  • 59 |
  • Add LaTeX math using single "$" signs, e.g. "$\int x dx$".
  • 60 |
  • Some markdown will be hidden ("rendered") unless your cursor is 61 | next to it.
  • 62 |
63 |

64 | Note management 65 |

66 |
    67 |
  • Drawings can currently only be deleted whole. (This will be 68 | fixed eventually.)
  • 69 |
  • To edit the default colour palette, right-click any of the 70 | colour buttons on the right-hand toolbar.
  • 71 |
  • Due to present limitations, drawing clears the undo stack.
  • 72 |
  • When copypasting text into other applications, drawings will be 73 | automatically converted into data URL PNGs.
  • 74 |
75 |

76 | Note management 77 |

78 |
    79 |
  • 80 | The program loads a custom Gtk+ stylesheet found in 81 | "data/stylesheet.css". Clear it if parts of the UI look wonky. 82 |
  • 83 |
  • If something unexpected happens, it is often useful to run the 84 | program from a terminal and look at stdout.
  • 85 |
86 |
87 | 88 | 89 | https://raw.githubusercontent.com/blackhole89/notekit/master/screenshots/notekit.png 90 | 91 | 92 | https://raw.githubusercontent.com/blackhole89/notekit/master/screenshots/notekit-syntax_highlighting.png 93 | 94 | 95 | https://raw.githubusercontent.com/blackhole89/notekit/master/screenshots/notekit_dark.png 96 | 97 | 98 | https://raw.githubusercontent.com/blackhole89/notekit/master/screenshots/notekit_dark-syntax_highlighting.png 99 | 100 | 101 | https://github.com/blackhole89/notekit 102 | 103 | 104 | 108 |
109 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: NoteKit CI 2 | 3 | on: 4 | - push 5 | - pull_request 6 | 7 | jobs: 8 | Linux: 9 | runs-on: ${{ matrix.os }} 10 | strategy: 11 | matrix: 12 | os: 13 | - ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Downloading dependencies 📥 17 | run: sudo apt-get install build-essential meson libfontconfig1-dev zlib1g-dev libgtksourceviewmm-3.0-dev libgtkmm-3.0-dev libtinyxml2-dev libjsoncpp-dev 18 | - name: Configure 🔧 19 | run: meson _build --default-library static 20 | - name: Compile 🎲 21 | run: ninja -C _build 22 | - name: Compress build artifacts 📦 23 | run: | 24 | pushd _build 25 | tar -c * | zstd -o $GITHUB_WORKSPACE/x86_64-linux-gnu.tar.zst 26 | popd 27 | - name: Upload build artifacts 📤 28 | uses: actions/upload-artifact@v1 29 | with: 30 | name: Build artifacts (Linux) 31 | path: x86_64-linux-gnu.tar.zst 32 | MinGW: 33 | runs-on: ubuntu-latest 34 | container: 35 | image: registry.fedoraproject.org/fedora:33 36 | options: --privileged 37 | steps: 38 | - uses: actions/checkout@v2 39 | - name: Download dependencies 📥 40 | run: | 41 | dnf install -y "dnf-command(config-manager)" curl git patch tar zstd 42 | dnf install -y gcc-c++ meson 43 | dnf install -y mingw64-filesystem mingw64-gcc-c++ 44 | dnf install -y mingw64-winpthreads-static 45 | dnf install -y mingw64-gtkmm30 mingw64-gtksourceviewmm3 mingw64-jsoncpp mingw64-zlib mingw64-fontconfig mingw64-librsvg2 46 | - name: Install cLaTeXMath 🖋 47 | run: | 48 | dnf config-manager --add-repo https://download.opensuse.org/repositories/home:sp1rit:mingw/Fedora_33/home:sp1rit:mingw.repo 49 | dnf install -y mingw64-clatexmath mingw64-clatexmath-static 50 | - name: Configure 🔧 51 | run: meson --prefix=/ --cross-file=/usr/share/mingw/toolchain-mingw64.meson --default-library shared bin-x86_64-w64-mingw32 52 | - name: Compile 🎲 53 | run: ninja -C bin-x86_64-w64-mingw32 54 | - name: Compress build artifacts 📦 55 | run: | 56 | pushd bin-x86_64-w64-mingw32 57 | tar -c * | zstd -o $GITHUB_WORKSPACE/x86_64-w64-mingw32.tar.zst 58 | popd 59 | - name: Upload build artifacts 📤 60 | uses: actions/upload-artifact@v2 61 | with: 62 | name: Build artifacts (Windows MinGW) 63 | path: x86_64-w64-mingw32.tar.zst 64 | Darwin: 65 | strategy: 66 | matrix: 67 | os: 68 | - name: Linux Homebrew 69 | id: ubuntu-latest 70 | triplet: x86_64-linux-gnu 71 | - name: OS X 72 | id: macos-latest 73 | triplet: x86_64-apple-darwin 74 | runs-on: ${{ matrix.os.id }} 75 | steps: 76 | - uses: actions/checkout@v2 77 | - name: Set up Homebrew 🍺 78 | uses: Homebrew/actions/setup-homebrew@master 79 | - name: Download dependencies 📥 80 | run: | 81 | brew install meson ninja pkg-config 82 | brew install fontconfig gtkmm3 gtksourceviewmm3 jsoncpp librsvg zlib 83 | brew install -s sp1ritCS/tap/clatexmath 84 | - name: Patch NoteKit 🩹 85 | run: patch -p1 < Apple/llvm.patch 86 | - name: Configure 🔧 87 | if: ${{ matrix.os.triplet == 'x86_64-apple-darwin' }} 88 | run: | 89 | export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig" 90 | meson ${{ matrix.os.triplet }} 91 | - name: Compile 🎲 92 | if: ${{ matrix.os.triplet == 'x86_64-apple-darwin' }} 93 | run: ninja -C ${{ matrix.os.triplet }} 94 | - name: Build in Brew shell 🧮 95 | if: ${{ matrix.os.triplet == 'x86_64-linux-gnu' }} 96 | run: | 97 | brew sh < wnd) : Glib::ObjectBase("CImageWidget"), Gtk::DrawingArea() 5 | { 6 | target_window=wnd; 7 | w=h=1; 8 | 9 | signal_draw().connect(sigc::mem_fun(this,&CImageWidget::on_draw)); 10 | 11 | //set_size_request(1,1); 12 | } 13 | 14 | void CImageWidget::on_unrealize() 15 | { 16 | printf("unrealize event on CImageWidget %p\n", (void*) this); 17 | } 18 | 19 | void CImageWidget::destroy_notify_() 20 | { 21 | printf("destroy event on CImageWidget %p\n", (void*) this); 22 | } 23 | 24 | void CImageWidget::SetSize(int x, int y) 25 | { 26 | w=x; h=y; 27 | 28 | image = target_window->create_similar_surface(Cairo::CONTENT_COLOR_ALPHA,w,h); 29 | image_ctx = Cairo::Context::create(image); 30 | 31 | set_size_request(w,h); 32 | } 33 | 34 | void CImageWidget::Redraw() 35 | { 36 | 37 | } 38 | 39 | int CImageWidget::GetBaseline() 40 | { 41 | return 0; 42 | } 43 | 44 | bool CImageWidget::on_draw(const Cairo::RefPtr &ctx) 45 | { 46 | if(!image) Redraw(); 47 | /* blit our internal buffer */ 48 | ctx->set_source(image,0,0); 49 | ctx->rectangle(0,0,w,h); 50 | ctx->fill(); 51 | 52 | return true; 53 | } 54 | 55 | CImageWidget::~CImageWidget() 56 | { 57 | // printf("destructor on CImageWidget %08lX\n", (unsigned long) this); 58 | } 59 | 60 | #ifdef HAVE_LASEM 61 | 62 | #include 63 | #include 64 | 65 | CLatexWidget::CLatexWidget(Glib::RefPtr wnd, Glib::ustring text, Gdk::RGBA fg) : CImageWidget(wnd) 66 | { 67 | source=text; 68 | 69 | LsmDomDocument *doc; 70 | LsmDomView *view; 71 | GError *err = NULL; 72 | doc = LSM_DOM_DOCUMENT (lsm_mathml_document_new_from_itex(source.c_str(),source.length(),&err)); 73 | 74 | if(!err) { 75 | view = lsm_dom_document_create_view (doc); 76 | lsm_dom_view_set_resolution (view, target_window->get_screen()->get_resolution()); 77 | 78 | lsm_dom_view_get_size_pixels (view, (unsigned int*)&w, (unsigned int*)&h, (unsigned int*)&baseline); 79 | SetSize(w,h); 80 | lsm_dom_view_render(view, image_ctx->cobj(), 0, 0); 81 | 82 | g_object_unref(view); 83 | g_object_unref(doc); 84 | } else { 85 | SetSize(128,16); 86 | image_ctx->set_source_rgb(1,0,0); 87 | image_ctx->set_font_size(10); 88 | image_ctx->move_to(0,14); 89 | image_ctx->show_text(err->message); 90 | image_ctx->fill(); //paint(); 91 | g_error_free(err); 92 | } 93 | } 94 | 95 | CLatexWidget::~CLatexWidget() 96 | { 97 | } 98 | 99 | void CLatexWidget::Redraw() 100 | { 101 | 102 | } 103 | 104 | int CLatexWidget::GetBaseline() 105 | { 106 | return baseline; 107 | } 108 | 109 | #endif 110 | 111 | #ifdef HAVE_CLATEXMATH 112 | 113 | #define __OS_Linux__ 114 | #define BUILD_GTK 115 | 116 | #include "latex.h" 117 | #include "platform/cairo/graphic_cairo.h" 118 | 119 | using namespace tex; 120 | 121 | CLatexWidget::CLatexWidget(Glib::RefPtr wnd, Glib::ustring text, Gdk::RGBA fg) : CImageWidget(wnd) 122 | { 123 | source=text; 124 | 125 | unsigned int clr; 126 | clr=0xff000000|int(fg.get_red()*255)<<16|int(fg.get_green()*255)<<8|int(fg.get_blue()*255); 127 | 128 | try { 129 | TeXRender *r; 130 | r = LaTeX::parse(utf82wide(text.c_str()), 131 | wnd->get_width()-64, 132 | 18, 133 | 18 / 3.f, 134 | clr); 135 | 136 | float h = r->getHeight(), w = r->getWidth(); 137 | 138 | SetSize(w+4,h+2); 139 | 140 | baseline=(int)(round((0+(h)*(1.0f-r->getBaseline())))); 141 | 142 | // workaround for not entirely correct baseline arithmetic 143 | if(h>12) baseline+=1; 144 | 145 | Graphics2D_cairo g2(image_ctx); 146 | r->draw(g2,2,1); 147 | 148 | if(r) delete r; 149 | } catch(tex::ex_parse &e) { 150 | printf("LaTeX parsing error: %s\n",e.what()); 151 | SetSize(128,16); 152 | baseline=0; 153 | 154 | image_ctx->set_source_rgb(1,0,0); 155 | image_ctx->set_font_size(10); 156 | image_ctx->move_to(0,14); 157 | image_ctx->show_text("LaTeX parse failed"); 158 | 159 | image_ctx->fill(); 160 | } catch(tex::ex_invalid_state &e) { 161 | printf("LaTeX rendering error: %s\n",e.what()); 162 | SetSize(128,16); 163 | baseline=0; 164 | 165 | image_ctx->set_source_rgb(1,0,0); 166 | image_ctx->set_font_size(10); 167 | image_ctx->move_to(0,14); 168 | image_ctx->show_text("LaTeX render failed"); 169 | 170 | image_ctx->fill(); 171 | } 172 | } 173 | 174 | CLatexWidget::~CLatexWidget() 175 | { 176 | } 177 | 178 | void CLatexWidget::Redraw() 179 | { 180 | 181 | } 182 | 183 | int CLatexWidget::GetBaseline() 184 | { 185 | return baseline; 186 | } 187 | 188 | #endif 189 | -------------------------------------------------------------------------------- /notebook_widgets.hpp: -------------------------------------------------------------------------------- 1 | namespace widgets { 2 | 3 | /* ** Widget API ** 4 | * in: nb: Pointer to notebook to add widget to. 5 | * in: start, end: Iterators bracketing the textual representation of the widget. 6 | * The first character will be a special code representing the anchor at which the 7 | * widget lands in the buffer. The actual textual representation begins at start+1. 8 | * return: Pointer to an unowned Gtk::Widget, or NULL. The caller will call Gtk::manage on it. 9 | * 10 | * You may not modify the buffer in the widget API. However, you can apply and remove tags, such 11 | * as baseline modifiers, and signal callbacks you hook up to your widgets may modify the buffer contents. 12 | * */ 13 | 14 | Gtk::Widget *RenderCheckbox(CNotebook *nb, Gtk::TextBuffer::iterator start, Gtk::TextBuffer::iterator end) 15 | { 16 | Glib::RefPtr mstart = nb->sbuffer->create_mark(start,true); 17 | Gtk::TextIter i=start; 18 | ++i; 19 | if(i.get_char()=='[') ++i; 20 | 21 | bool is_checked = (i.get_char()=='x'||i.get_char()=='X'); 22 | 23 | auto j = start; ++j; 24 | // shift baseline for gtk checkbox widget 25 | nb->sbuffer->apply_tag(nb->GetBaselineTag(2),start,j); 26 | 27 | Gtk::CheckButton *b = new Gtk::CheckButton(); 28 | if(is_checked) b->set_active(true); 29 | b->property_can_focus().set_value(false); 30 | 31 | b->property_active().signal_changed().connect(sigc::slot( [b,mstart,nb]() { 32 | Gtk::TextIter i = nb->sbuffer->get_iter_at_mark(mstart); 33 | ++i; ++i; 34 | if(b->get_active()) 35 | i=nb->sbuffer->insert(i,"x"); 36 | else 37 | i=nb->sbuffer->insert(i," "); 38 | Gtk::TextIter j=i; ++j; 39 | nb->sbuffer->erase(i,j); 40 | } )); 41 | 42 | /* set appropriate cursor when checkbox hovered */ 43 | b->signal_enter().connect(sigc::slot( [mstart,nb]() { nb->SetCursor(nb->pointer_cursor); } )); 44 | b->signal_leave().connect(sigc::slot( [mstart,nb]() { nb->update_cursor = true; } )); 45 | 46 | /* destroy the mark when the widget is unmapped */ 47 | b->signal_unmap().connect(sigc::slot( [mstart,nb]() { 48 | /* need to defer the destruction due to mysterious interactions with signal chain */ 49 | auto s = Glib::IdleSource::create(); 50 | s->connect(sigc::slot( [mstart,nb]() { 51 | nb->sbuffer->delete_mark(mstart); 52 | return false; 53 | })); 54 | s->attach(); 55 | })); 56 | 57 | return b; 58 | } 59 | 60 | std::string urldecode(std::string in) 61 | { 62 | std::size_t len = in.length(), p=0, nextp; 63 | std::string out; 64 | out.reserve(len); // reserve space to prevent costly reallocs on += 65 | char hexcode[3]={0}; // memory to hold extracted hex codes without allocations 66 | 67 | while(p0 && (unsigned char)cc) 73 | out += (unsigned char)cc; // seems like we got a hex code, append 74 | p=nextp+nread+1; // skip the % and however many characters we successfully read as hex 75 | } 76 | out += std::string(in, p); // copy in the rest of the string 77 | printf("'%s'\n",out.c_str()); fflush(stdout); 78 | return out; 79 | } 80 | 81 | Gtk::Widget *RenderImage(CNotebook *nb, Gtk::TextBuffer::iterator start, Gtk::TextBuffer::iterator end) 82 | { 83 | /* the worst thing that could happen is that we go to the end and URL becomes empty */ 84 | auto urlstart = start; 85 | nb->sbuffer->iter_forward_to_context_class_toggle(urlstart,"url"); 86 | 87 | if(urlstart < end) { 88 | auto urlend = urlstart; 89 | nb->sbuffer->iter_forward_to_context_class_toggle(urlend,"url"); 90 | 91 | // workaround for canonicalize_filename not being supported in glibmm<2.64 92 | Glib::RefPtr file = Glib::wrap(g_file_new_for_commandline_arg_and_cwd(urldecode(urlstart.get_text(urlend)).c_str(), nb->document_path.c_str())); 93 | Gtk::Image *d = new Gtk::Image(file->get_path()); 94 | 95 | return d; 96 | } else { 97 | // condition fails if url was empty, vis. () 98 | Gtk::Image *d = new Gtk::Image(); 99 | d->set_from_icon_name("action-unavailable",Gtk::ICON_SIZE_BUTTON); 100 | 101 | return d; 102 | } 103 | } 104 | 105 | #if defined (HAVE_LASEM) || defined (HAVE_CLATEXMATH) 106 | Gtk::Widget *RenderLatex(CNotebook *nb, Gtk::TextBuffer::iterator start, Gtk::TextBuffer::iterator end) 107 | { 108 | CLatexWidget *d = new CLatexWidget(nb->get_window(Gtk::TEXT_WINDOW_TEXT),nb->sbuffer->get_text(start,end,true),nb->get_style_context()->get_color()); 109 | 110 | auto j = start; ++j; 111 | nb->sbuffer->apply_tag(nb->GetBaselineTag(d->GetBaseline()),start,j); 112 | 113 | return d; 114 | } 115 | #endif 116 | 117 | } -------------------------------------------------------------------------------- /data/icons/hicolor/scalable/emblems/eraser-tool-symbolic.svg: -------------------------------------------------------------------------------- 1 | http://thenounproject.comThe Noun ProjectIcon TemplateRemindersStrokesTry to keep strokes at 4pxMinimum stroke weight is 2pxFor thicker strokes use even numbers: 6px, 8px etc.Remember to expand strokes before saving as an SVG SizeCannot be wider or taller than 100px (artboard size)Scale your icon to fill as much of the artboard as possibleUngroupIf your design has more than one shape, make sure to ungroupSave asSave as .SVG and make sure “Use Artboards” is checked100px.SVG -------------------------------------------------------------------------------- /debian/manpage.sgml.ex: -------------------------------------------------------------------------------- 1 | manpage.1'. You may view 5 | the manual page with: `docbook-to-man manpage.sgml | nroff -man | 6 | less'. A typical entry in a Makefile or Makefile.am is: 7 | 8 | manpage.1: manpage.sgml 9 | docbook-to-man $< > $@ 10 | 11 | 12 | The docbook-to-man binary is found in the docbook-to-man package. 13 | Please remember that if you create the nroff version in one of the 14 | debian/rules file targets (such as build), you will need to include 15 | docbook-to-man in your Build-Depends control field. 16 | 17 | --> 18 | 19 | 20 | FIRSTNAME"> 21 | SURNAME"> 22 | 23 | December 24 2020"> 24 | 26 | SECTION"> 27 | blackhole89@gmail.com"> 28 | 29 | Notekit"> 30 | 31 | 32 | Debian"> 33 | GNU"> 34 | GPL"> 35 | ]> 36 | 37 | 38 | 39 |
40 | &dhemail; 41 |
42 | 43 | &dhfirstname; 44 | &dhsurname; 45 | 46 | 47 | 2003 48 | &dhusername; 49 | 50 | &dhdate; 51 |
52 | 53 | &dhucpackage; 54 | 55 | &dhsection; 56 | 57 | 58 | &dhpackage; 59 | 60 | program to do something 61 | 62 | 63 | 64 | &dhpackage; 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | DESCRIPTION 73 | 74 | This manual page documents briefly the 75 | &dhpackage; and bar 76 | commands. 77 | 78 | This manual page was written for the &debian; distribution 79 | because the original program does not have a manual page. 80 | Instead, it has documentation in the &gnu; 81 | Info format; see below. 82 | 83 | &dhpackage; is a program that... 84 | 85 | 86 | 87 | OPTIONS 88 | 89 | These programs follow the usual &gnu; command line syntax, 90 | with long options starting with two dashes (`-'). A summary of 91 | options is included below. For a complete description, see the 92 | Info files. 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | Show summary of options. 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | Show version of program. 109 | 110 | 111 | 112 | 113 | 114 | SEE ALSO 115 | 116 | bar (1), baz (1). 117 | 118 | The programs are documented fully by The Rise and 119 | Fall of a Fooish Bar available via the 120 | Info system. 121 | 122 | 123 | AUTHOR 124 | 125 | This manual page was written by &dhusername; &dhemail; for 126 | the &debian; system (and may be used by others). Permission is 127 | granted to copy, distribute and/or modify this document under 128 | the terms of the &gnu; General Public License, Version 2 any 129 | later version published by the Free Software Foundation. 130 | 131 | 132 | On Debian systems, the complete text of the GNU General Public 133 | License can be found in /usr/share/common-licenses/GPL. 134 | 135 | 136 | 137 |
138 | 139 | 155 | -------------------------------------------------------------------------------- /mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include "config.h" 5 | 6 | #include 7 | 8 | #include "about.h" 9 | #include "notebook.h" 10 | #include "navigation.h" 11 | #include "settings.h" 12 | 13 | enum { 14 | WND_ACTION_COLOR, 15 | WND_ACTION_NEXT_NOTE, 16 | WND_ACTION_PREV_NOTE, 17 | WND_ACTION_SHOW_FIND, 18 | WND_ACTION_TOGGLE_SIDEBAR, 19 | WND_ACTION_TOGGLE_PRESENTATION, 20 | WND_ACTION_TOGGLE_MARKDOWN_RENDERING 21 | }; 22 | 23 | int mkdirp(std::string dir); 24 | 25 | class CMainWindow : public Gtk::ApplicationWindow 26 | { 27 | public: 28 | CMainWindow(const Glib::RefPtr &); 29 | virtual ~CMainWindow(); 30 | 31 | std::string active_document; 32 | std::string selected_document; 33 | 34 | sigc::connection close_handler; 35 | 36 | void HardClose(); 37 | void FetchAndSave(); 38 | void OpenDocument(std::string filename); 39 | void SetupDocumentWindow(Glib::ustring filename); 40 | 41 | void FetchAndExport(); 42 | 43 | void FocusDocument(); 44 | 45 | void FollowLink(Glib::ustring url); 46 | 47 | typedef std::tuple color_t; 48 | protected: 49 | /* low level window for csd check */ 50 | GdkWindow* window; 51 | 52 | //Signal handlers: 53 | bool on_close(GdkEventAny* any_event); 54 | void on_action(std::string name,int type, int param); 55 | bool on_click_color(GdkEventButton *btn, unsigned int num); 56 | bool on_motion_notify(GdkEventMotion* event); 57 | void on_search_text_changed(); 58 | void on_search_next(); 59 | void on_search_prev(); 60 | void on_search_stop(); 61 | bool on_search_lost_focus(GdkEventFocus *event); 62 | bool on_search_key_press(GdkEventKey *event); 63 | 64 | sigc::connection idle_timer; 65 | bool on_idle(); 66 | 67 | Gtk::HBox split; 68 | //Gtk::Box filler; 69 | 70 | /* config */ 71 | std::string default_base_path; 72 | std::string data_path; 73 | std::string json_config_path; 74 | 75 | void CalculatePaths(); 76 | const gchar* InitializeSettings(); 77 | void RunPreferenceDiag(); 78 | 79 | /* settings */ 80 | Glib::RefPtr settings; 81 | void SettingChange(const Glib::ustring& key); 82 | bool binit = true; 83 | void UpdateBasePath(); 84 | 85 | /* tree view on the left */ 86 | Gtk::ScrolledWindow nav_scroll; 87 | Gtk::TreeView nav; 88 | CNavigationView nav_model; 89 | 90 | /* document view */ 91 | Gtk::VBox doc_view_box; 92 | Gtk::ScrolledWindow sview_scroll; 93 | CNotebook sview; 94 | Glib::RefPtr sbuffer; 95 | Glib::RefPtr pen_cursor, text_cursor, eraser_cursor, selection_cursor; 96 | 97 | /* search bar */ 98 | Gtk::SearchBar search_bar; 99 | Gtk::SearchEntry search_entry; 100 | 101 | /* tool palette */ 102 | Glib::RefPtr toolbar_builder; 103 | Glib::RefPtr toolbar_style; 104 | Gtk::Toolbar *toolbar; 105 | void InitToolbar(); 106 | void UpdateToolbarColors(); 107 | unsigned int active_color = 0; 108 | 109 | /* header */ 110 | Gtk::HeaderBar hbar; 111 | Gtk::MenuButton appbutton; 112 | 113 | Gtk::Button presentbtn; 114 | 115 | AboutDiag about; 116 | void RunAboutDiag(); 117 | /* menu */ 118 | bool navigation = true; 119 | bool presentation_mode = false; 120 | bool markdown_rendering = true; 121 | Glib::RefPtr export_action = add_action("export", sigc::mem_fun(this,&CMainWindow::FetchAndExport)); 122 | Glib::RefPtr pref_action = add_action("pref", sigc::mem_fun(this,&CMainWindow::RunPreferenceDiag)); 123 | Glib::RefPtr about_action = add_action("about", sigc::mem_fun(this,&CMainWindow::RunAboutDiag)); 124 | Glib::RefPtr sidebar_action = add_action_bool("sidebar", sigc::bind( sigc::mem_fun(this,&CMainWindow::on_action), "toggle-sidebar", WND_ACTION_TOGGLE_SIDEBAR, 1), navigation); 125 | Glib::RefPtr presentation_action = add_action_bool("presentation", sigc::bind( sigc::mem_fun(this,&CMainWindow::on_action), "toggle-presentation-mode", WND_ACTION_TOGGLE_PRESENTATION, 1), presentation_mode); 126 | Glib::RefPtr markdown_rendering_action = add_action_bool("markdown-rendering", sigc::bind( sigc::mem_fun(this,&CMainWindow::on_action), "markdown-rendering", WND_ACTION_TOGGLE_MARKDOWN_RENDERING, 0), markdown_rendering); 127 | Glib::RefPtr menu = Gio::Menu::create(); 128 | Gtk::Menu appmenu; 129 | 130 | /* classic menu */ 131 | struct { 132 | Gtk::VBox menu_box; 133 | Gtk::MenuBar mbar; 134 | } cm; 135 | 136 | Gtk::FileChooserButton *dir; 137 | 138 | void SettingBasepathUpdate(); 139 | void SettingDocumentUpdate(); 140 | void SettingCsdUpdate(); 141 | void SettingProximityUpdate(); 142 | void SettingSidebarUpdate(); 143 | void SettingClassicSidebarUpdate(); 144 | void SettingPresentationModeUpdate(); 145 | 146 | typedef std::map> settingmap_t; 147 | settingmap_t settingmap { 148 | {"base-path", sigc::mem_fun(this,&CMainWindow::SettingBasepathUpdate)}, 149 | {"active-document", sigc::mem_fun(this,&CMainWindow::SettingDocumentUpdate)}, 150 | {"colors", sigc::mem_fun(this,&CMainWindow::UpdateToolbarColors)}, 151 | {"csd", sigc::mem_fun(this,&CMainWindow::SettingCsdUpdate)}, 152 | {"proximity-widgets", sigc::mem_fun(this,&CMainWindow::SettingProximityUpdate)}, 153 | {"sidebar", sigc::mem_fun(this,&CMainWindow::SettingSidebarUpdate)}, 154 | {"classic-sidebar", sigc::mem_fun(this,&CMainWindow::SettingClassicSidebarUpdate)}, 155 | {"presentation-mode", sigc::mem_fun(this,&CMainWindow::SettingPresentationModeUpdate)} 156 | }; 157 | }; 158 | 159 | #endif // MAINWINDOW_H 160 | -------------------------------------------------------------------------------- /notebook.h: -------------------------------------------------------------------------------- 1 | #ifndef NOTEBOOK_H 2 | #define NOTEBOOK_H 3 | 4 | #include "config.h" 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include "drawing.h" 12 | 13 | enum { 14 | NB_ACTION_CMODE, 15 | NB_ACTION_STROKE, 16 | NB_ACTION_COLOR 17 | }; 18 | 19 | enum { 20 | NB_MODE_TEXT, 21 | NB_MODE_DRAW, 22 | NB_MODE_ERASE, 23 | NB_MODE_SELECT 24 | }; 25 | 26 | enum { 27 | NB_STATE_NOTHING=0, 28 | NB_STATE_DRAW, 29 | NB_STATE_ERASE, 30 | NB_STATE_SELECT 31 | }; 32 | 33 | class CNotebook : public Gsv::View 34 | { 35 | public: 36 | CNotebook(); 37 | 38 | void Init(std::string data_path, bool use_highlight_proxy); 39 | std::string GetHighlightProxyDir(); 40 | 41 | Glib::RefPtr actions; 42 | 43 | int margin_x; 44 | 45 | /* mouse input related data */ 46 | CStroke active; // current stroke 47 | int active_state; // whether we are in the process of drawing in some mode 48 | std::set floats; 49 | float stroke_width; // width of current stroke 50 | void CommitStroke(); 51 | void EraseAtPosition(float x, float y); 52 | 53 | double sel_x0, sel_y0, sel_x1, sel_y1; 54 | void SelectBox(float x0, float x1, float y0, float y1); 55 | 56 | GdkDevice *last_device; // most recently seen device 57 | bool update_cursor; // signal to main window to update cursor 58 | std::map devicemodes; // current input modes, per device 59 | 60 | Glib::RefPtr pointer_cursor; // default pointer cursor 61 | Glib::RefPtr hand_cursor; // cursor for links 62 | bool using_hand_cursor; // if we need to reset the cursor from hand state 63 | 64 | void SetCursor(Glib::RefPtr c); 65 | 66 | /* link-related functions and signal */ 67 | bool IsLinkAt(int x, int y); 68 | Glib::ustring GetLinkAt(int x, int y); 69 | sigc::signal< void(Glib::ustring) > signal_link; 70 | 71 | /* the buffer */ 72 | Glib::RefPtr sbuffer; 73 | Glib::RefPtr langman; 74 | 75 | /* text search */ 76 | bool Find(Glib::ustring text, bool forward, bool skip); 77 | 78 | /* toggle raw display */ 79 | void DisableProximityRendering(); 80 | void EnableProximityRendering(); 81 | 82 | /* menu-related events */ 83 | void on_action(std::string name, int type, int param); 84 | 85 | /* drawing-related events */ 86 | Gtk::DrawingArea overlay; 87 | Cairo::RefPtr overlay_image; 88 | Cairo::RefPtr overlay_ctx; 89 | void on_allocate(Gtk::Allocation &a); 90 | bool on_redraw_overlay(const Cairo::RefPtr &ctx); 91 | void on_redraw_underlay(const Cairo::RefPtr &ctx); 92 | 93 | float attention_ewma; 94 | bool on_button_press(GdkEventButton* event); 95 | bool on_button_release(GdkEventButton* event); 96 | bool on_motion_notify(GdkEventMotion* event); 97 | 98 | float ReadPressure(GdkEvent *e); 99 | void Widget2Doc(double in_x, double in_y, double &out_x, double &out_y); 100 | 101 | /* text-related events and functionality */ 102 | Glib::RefPtr tag_proximity; 103 | Glib::RefPtr last_position; 104 | void on_move_cursor(); 105 | void update_prox_to_cursor(); 106 | 107 | void on_highlight_updated(Gtk::TextBuffer::iterator &start, Gtk::TextBuffer::iterator &end); 108 | void on_leave_region(Gtk::TextBuffer::iterator &start, Gtk::TextBuffer::iterator &end); 109 | void on_enter_region(Gtk::TextBuffer::iterator &start, Gtk::TextBuffer::iterator &end); 110 | 111 | int modifier_keys; // modifier keys active during most recent keypress 112 | int latest_keyval; // most recent keypress 113 | gint64 last_modified; // time of last modification or 0 if no modification since last save 114 | virtual bool on_key_press_event(GdkEventKey *k); 115 | void on_insert(const Gtk::TextBuffer::iterator &,const Glib::ustring& str,int len); 116 | void on_changed(); 117 | virtual bool on_event(GdkEvent *ev); 118 | 119 | // additional Gtk::TextTags for metadata and formatting unsupported by Gsv language spec 120 | void DebugTags(Gtk::TextBuffer::iterator &start, Gtk::TextBuffer::iterator &end); 121 | Glib::RefPtr tag_extra_space, tag_blockquote, tag_invisible, tag_override_bg, tag_hidden, tag_mono, tag_is_anchor; 122 | void RecalculateColors(); 123 | 124 | std::map > baseline_tags; 125 | Glib::RefPtr GetBaselineTag(int baseline); 126 | 127 | /* embedded widget handling */ 128 | 129 | std::string document_path; // base path for relative URLs 130 | void SetDocumentPath(std::string); 131 | 132 | std::string DepositImage(GdkPixbuf *pixbuf); 133 | 134 | // list of Gsv language spec context classes that can be rendered to widgets 135 | static std::unordered_map > widget_classes; 136 | 137 | void QueueChildAnchor(Glib::RefPtr mstart); 138 | void RenderToWidget(Glib::ustring wtype, Gtk::TextBuffer::iterator &start, Gtk::TextBuffer::iterator &end); 139 | void UnrenderWidgets(Gtk::TextBuffer::iterator &start, Gtk::TextBuffer::iterator &end); 140 | void CleanUpSpan(Gtk::TextBuffer::iterator &start, Gtk::TextBuffer::iterator &end); 141 | 142 | /* export and import for copypaste/save */ 143 | guint8* on_serialize(const Glib::RefPtr& content_buffer, const Gtk::TextBuffer::iterator& start, const Gtk::TextBuffer::iterator& end, gsize& length, bool render_images); 144 | bool on_deserialize(const Glib::RefPtr& content_buffer, Gtk::TextBuffer::iterator& iter, const guint8* data, gsize length, bool create_tags); 145 | 146 | /* iterator stack for preserving iterators across buffer changes */ 147 | std::stack > iter_stack; 148 | Glib::RefPtr PushIter(Gtk::TextIter i); 149 | Gtk::TextIter PopIter(); 150 | }; 151 | 152 | #endif 153 | -------------------------------------------------------------------------------- /notekit.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | None 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | None 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /sourceview/classic.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 | 25 | GtkSourceView team 26 | <_description>Classic color scheme 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |