@simonklee/opentui-tex-native-source 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/LICENSE-PROJECT +21 -0
- package/README.md +7 -0
- package/build.zig +112 -0
- package/build.zig.zon +12 -0
- package/native/lib.zig +280 -0
- package/native/nanosvg.c +4 -0
- package/native/vendor/.bootstrap-v5 +1 -0
- package/native/vendor/LICENSE-NANOSVG +18 -0
- package/native/vendor/microtex/.clang-format +26 -0
- package/native/vendor/microtex/.github/workflows/ubuntu.yml +92 -0
- package/native/vendor/microtex/.github/workflows/windows-gdi.yml +34 -0
- package/native/vendor/microtex/.github/workflows/windows-qt.yml +52 -0
- package/native/vendor/microtex/CMakeLists.txt +110 -0
- package/native/vendor/microtex/LICENSE +21 -0
- package/native/vendor/microtex/MicroTeXInstall.cmake +42 -0
- package/native/vendor/microtex/README.md +600 -0
- package/native/vendor/microtex/build.zig +209 -0
- package/native/vendor/microtex/clatexmath.wrap +6 -0
- package/native/vendor/microtex/doc/meson.build +38 -0
- package/native/vendor/microtex/doc/microtex-doc.toml.in +47 -0
- package/native/vendor/microtex/doc/microtex.svg +39 -0
- package/native/vendor/microtex/doc/urlmap.js +6 -0
- package/native/vendor/microtex/example/gtk/CMakeLists.txt +68 -0
- package/native/vendor/microtex/example/gtk/gtk_main.c +170 -0
- package/native/vendor/microtex/example/gtk/isamples.cpp +21 -0
- package/native/vendor/microtex/example/gtk/isamples.h +15 -0
- package/native/vendor/microtex/example/gtk/meson.build +27 -0
- package/native/vendor/microtex/example/gtk/microtex-gtk.gresource.xml +6 -0
- package/native/vendor/microtex/example/gtk/microtex-gtk.ui +117 -0
- package/native/vendor/microtex/example/gtkmm/CMakeLists.txt +19 -0
- package/native/vendor/microtex/example/gtkmm/gtkmm_main.cpp +531 -0
- package/native/vendor/microtex/example/gtkmm/meson.build +19 -0
- package/native/vendor/microtex/example/memcheck/CMakeLists.txt +12 -0
- package/native/vendor/microtex/example/memcheck/mem_check_main.cpp +154 -0
- package/native/vendor/microtex/example/qt/CMakeLists.txt +37 -0
- package/native/vendor/microtex/example/qt/meson.build +25 -0
- package/native/vendor/microtex/example/qt/qt_main.cpp +70 -0
- package/native/vendor/microtex/example/qt/qt_mainwindow.cpp +107 -0
- package/native/vendor/microtex/example/qt/qt_mainwindow.h +40 -0
- package/native/vendor/microtex/example/qt/qt_skiatexwidget.cpp +149 -0
- package/native/vendor/microtex/example/qt/qt_skiatexwidget.h +48 -0
- package/native/vendor/microtex/example/qt/qt_tex_render.h +15 -0
- package/native/vendor/microtex/example/qt/qt_texqmlitem.cpp +56 -0
- package/native/vendor/microtex/example/qt/qt_texqmlitem.h +31 -0
- package/native/vendor/microtex/example/qt/qt_texwidget.cpp +62 -0
- package/native/vendor/microtex/example/qt/qt_texwidget.h +31 -0
- package/native/vendor/microtex/example/qtpng/CMakeLists.txt +11 -0
- package/native/vendor/microtex/example/qtpng/latex2png.cpp +115 -0
- package/native/vendor/microtex/example/samples/samples.cpp +52 -0
- package/native/vendor/microtex/example/samples/samples.h +32 -0
- package/native/vendor/microtex/example/win32/CMakeLists.txt +15 -0
- package/native/vendor/microtex/example/win32/meson.build +18 -0
- package/native/vendor/microtex/example/win32/win32_main.cpp +375 -0
- package/native/vendor/microtex/githooks/pre-commit +19 -0
- package/native/vendor/microtex/githooks/pre-push +103 -0
- package/native/vendor/microtex/lib/CMakeLists.txt +234 -0
- package/native/vendor/microtex/lib/atom/atom.cpp +14 -0
- package/native/vendor/microtex/lib/atom/atom.h +96 -0
- package/native/vendor/microtex/lib/atom/atom_accent.cpp +115 -0
- package/native/vendor/microtex/lib/atom/atom_accent.h +53 -0
- package/native/vendor/microtex/lib/atom/atom_basic.cpp +146 -0
- package/native/vendor/microtex/lib/atom/atom_basic.h +273 -0
- package/native/vendor/microtex/lib/atom/atom_box.cpp +41 -0
- package/native/vendor/microtex/lib/atom/atom_box.h +70 -0
- package/native/vendor/microtex/lib/atom/atom_char.cpp +99 -0
- package/native/vendor/microtex/lib/atom/atom_char.h +147 -0
- package/native/vendor/microtex/lib/atom/atom_delim.cpp +65 -0
- package/native/vendor/microtex/lib/atom/atom_delim.h +58 -0
- package/native/vendor/microtex/lib/atom/atom_fence.cpp +65 -0
- package/native/vendor/microtex/lib/atom/atom_fence.h +56 -0
- package/native/vendor/microtex/lib/atom/atom_font.cpp +20 -0
- package/native/vendor/microtex/lib/atom/atom_font.h +49 -0
- package/native/vendor/microtex/lib/atom/atom_frac.cpp +101 -0
- package/native/vendor/microtex/lib/atom/atom_frac.h +42 -0
- package/native/vendor/microtex/lib/atom/atom_matrix.cpp +756 -0
- package/native/vendor/microtex/lib/atom/atom_matrix.h +268 -0
- package/native/vendor/microtex/lib/atom/atom_misc.cpp +230 -0
- package/native/vendor/microtex/lib/atom/atom_misc.h +200 -0
- package/native/vendor/microtex/lib/atom/atom_operator.cpp +51 -0
- package/native/vendor/microtex/lib/atom/atom_operator.h +41 -0
- package/native/vendor/microtex/lib/atom/atom_root.cpp +61 -0
- package/native/vendor/microtex/lib/atom/atom_root.h +27 -0
- package/native/vendor/microtex/lib/atom/atom_row.cpp +334 -0
- package/native/vendor/microtex/lib/atom/atom_row.h +176 -0
- package/native/vendor/microtex/lib/atom/atom_scripts.cpp +182 -0
- package/native/vendor/microtex/lib/atom/atom_scripts.h +52 -0
- package/native/vendor/microtex/lib/atom/atom_sideset.cpp +92 -0
- package/native/vendor/microtex/lib/atom/atom_sideset.h +24 -0
- package/native/vendor/microtex/lib/atom/atom_space.cpp +22 -0
- package/native/vendor/microtex/lib/atom/atom_space.h +38 -0
- package/native/vendor/microtex/lib/atom/atom_stack.cpp +117 -0
- package/native/vendor/microtex/lib/atom/atom_stack.h +103 -0
- package/native/vendor/microtex/lib/atom/atom_text.cpp +17 -0
- package/native/vendor/microtex/lib/atom/atom_text.h +33 -0
- package/native/vendor/microtex/lib/atom/atom_vrow.cpp +96 -0
- package/native/vendor/microtex/lib/atom/atom_vrow.h +47 -0
- package/native/vendor/microtex/lib/atom/atom_zstack.cpp +66 -0
- package/native/vendor/microtex/lib/atom/atom_zstack.h +37 -0
- package/native/vendor/microtex/lib/atom/colors_def.cpp +157 -0
- package/native/vendor/microtex/lib/atom/meson.build +50 -0
- package/native/vendor/microtex/lib/box/box.cpp +49 -0
- package/native/vendor/microtex/lib/box/box.h +184 -0
- package/native/vendor/microtex/lib/box/box_factory.cpp +162 -0
- package/native/vendor/microtex/lib/box/box_factory.h +24 -0
- package/native/vendor/microtex/lib/box/box_group.cpp +503 -0
- package/native/vendor/microtex/lib/box/box_group.h +285 -0
- package/native/vendor/microtex/lib/box/box_single.cpp +179 -0
- package/native/vendor/microtex/lib/box/box_single.h +157 -0
- package/native/vendor/microtex/lib/box/meson.build +15 -0
- package/native/vendor/microtex/lib/core/debug_config.cpp +3 -0
- package/native/vendor/microtex/lib/core/debug_config.h +24 -0
- package/native/vendor/microtex/lib/core/formula.cpp +180 -0
- package/native/vendor/microtex/lib/core/formula.h +137 -0
- package/native/vendor/microtex/lib/core/formula_def.cpp +167 -0
- package/native/vendor/microtex/lib/core/glue.cpp +108 -0
- package/native/vendor/microtex/lib/core/glue.h +55 -0
- package/native/vendor/microtex/lib/core/localized_num.cpp +51 -0
- package/native/vendor/microtex/lib/core/meson.build +19 -0
- package/native/vendor/microtex/lib/core/parser.cpp +874 -0
- package/native/vendor/microtex/lib/core/parser.h +306 -0
- package/native/vendor/microtex/lib/core/split.cpp +185 -0
- package/native/vendor/microtex/lib/core/split.h +40 -0
- package/native/vendor/microtex/lib/env/env.cpp +141 -0
- package/native/vendor/microtex/lib/env/env.h +221 -0
- package/native/vendor/microtex/lib/env/meson.build +11 -0
- package/native/vendor/microtex/lib/env/units.cpp +109 -0
- package/native/vendor/microtex/lib/env/units.h +61 -0
- package/native/vendor/microtex/lib/graphic/font_style.cpp +63 -0
- package/native/vendor/microtex/lib/graphic/font_style.h +61 -0
- package/native/vendor/microtex/lib/graphic/graphic.cpp +38 -0
- package/native/vendor/microtex/lib/graphic/graphic.h +314 -0
- package/native/vendor/microtex/lib/graphic/graphic_basic.cpp +44 -0
- package/native/vendor/microtex/lib/graphic/graphic_basic.h +131 -0
- package/native/vendor/microtex/lib/graphic/meson.build +13 -0
- package/native/vendor/microtex/lib/macro/macro.cpp +143 -0
- package/native/vendor/microtex/lib/macro/macro.h +155 -0
- package/native/vendor/microtex/lib/macro/macro_accent.cpp +50 -0
- package/native/vendor/microtex/lib/macro/macro_accent.h +61 -0
- package/native/vendor/microtex/lib/macro/macro_boxes.h +68 -0
- package/native/vendor/microtex/lib/macro/macro_colors.cpp +42 -0
- package/native/vendor/microtex/lib/macro/macro_colors.h +42 -0
- package/native/vendor/microtex/lib/macro/macro_decl.h +16 -0
- package/native/vendor/microtex/lib/macro/macro_def.cpp +418 -0
- package/native/vendor/microtex/lib/macro/macro_delims.cpp +56 -0
- package/native/vendor/microtex/lib/macro/macro_delims.h +73 -0
- package/native/vendor/microtex/lib/macro/macro_env.h +212 -0
- package/native/vendor/microtex/lib/macro/macro_fonts.cpp +53 -0
- package/native/vendor/microtex/lib/macro/macro_fonts.h +78 -0
- package/native/vendor/microtex/lib/macro/macro_frac.cpp +138 -0
- package/native/vendor/microtex/lib/macro/macro_frac.h +50 -0
- package/native/vendor/microtex/lib/macro/macro_misc.cpp +211 -0
- package/native/vendor/microtex/lib/macro/macro_misc.h +217 -0
- package/native/vendor/microtex/lib/macro/macro_scripts.cpp +32 -0
- package/native/vendor/microtex/lib/macro/macro_scripts.h +17 -0
- package/native/vendor/microtex/lib/macro/macro_sizes.h +110 -0
- package/native/vendor/microtex/lib/macro/macro_space.cpp +31 -0
- package/native/vendor/microtex/lib/macro/macro_space.h +17 -0
- package/native/vendor/microtex/lib/macro/macro_styles.cpp +45 -0
- package/native/vendor/microtex/lib/macro/macro_styles.h +22 -0
- package/native/vendor/microtex/lib/macro/macro_types.h +48 -0
- package/native/vendor/microtex/lib/macro/meson.build +33 -0
- package/native/vendor/microtex/lib/meson.build +102 -0
- package/native/vendor/microtex/lib/microtex.cpp +208 -0
- package/native/vendor/microtex/lib/microtex.h +225 -0
- package/native/vendor/microtex/lib/microtexConfig.cmake.in +2 -0
- package/native/vendor/microtex/lib/microtexapi.h +22 -0
- package/native/vendor/microtex/lib/microtexconfig.h.in +7 -0
- package/native/vendor/microtex/lib/microtexexport.h +31 -0
- package/native/vendor/microtex/lib/otf/clm.cpp +405 -0
- package/native/vendor/microtex/lib/otf/clm.h +61 -0
- package/native/vendor/microtex/lib/otf/fontsense.cpp +191 -0
- package/native/vendor/microtex/lib/otf/fontsense.h +20 -0
- package/native/vendor/microtex/lib/otf/glyph.cpp +53 -0
- package/native/vendor/microtex/lib/otf/glyph.h +384 -0
- package/native/vendor/microtex/lib/otf/math_consts.h +154 -0
- package/native/vendor/microtex/lib/otf/meson.build +18 -0
- package/native/vendor/microtex/lib/otf/otf.cpp +84 -0
- package/native/vendor/microtex/lib/otf/otf.h +177 -0
- package/native/vendor/microtex/lib/otf/otfconfig.h +32 -0
- package/native/vendor/microtex/lib/otf/path.cpp +187 -0
- package/native/vendor/microtex/lib/otf/path.h +120 -0
- package/native/vendor/microtex/lib/render/builder.cpp +68 -0
- package/native/vendor/microtex/lib/render/builder.h +73 -0
- package/native/vendor/microtex/lib/render/meson.build +11 -0
- package/native/vendor/microtex/lib/render/render.cpp +136 -0
- package/native/vendor/microtex/lib/render/render.h +59 -0
- package/native/vendor/microtex/lib/unimath/font_meta.h +22 -0
- package/native/vendor/microtex/lib/unimath/font_src.cpp +21 -0
- package/native/vendor/microtex/lib/unimath/font_src.h +61 -0
- package/native/vendor/microtex/lib/unimath/math_type.cpp +318 -0
- package/native/vendor/microtex/lib/unimath/math_type.h +105 -0
- package/native/vendor/microtex/lib/unimath/meson.build +18 -0
- package/native/vendor/microtex/lib/unimath/uni_char.cpp +121 -0
- package/native/vendor/microtex/lib/unimath/uni_char.h +109 -0
- package/native/vendor/microtex/lib/unimath/uni_font.cpp +248 -0
- package/native/vendor/microtex/lib/unimath/uni_font.h +139 -0
- package/native/vendor/microtex/lib/unimath/uni_symbol.cpp +2929 -0
- package/native/vendor/microtex/lib/unimath/uni_symbol.h +31 -0
- package/native/vendor/microtex/lib/utils/dict_tree.h +68 -0
- package/native/vendor/microtex/lib/utils/exceptions.h +61 -0
- package/native/vendor/microtex/lib/utils/log.h +34 -0
- package/native/vendor/microtex/lib/utils/meson.build +18 -0
- package/native/vendor/microtex/lib/utils/nums.h +24 -0
- package/native/vendor/microtex/lib/utils/string_utils.cpp +85 -0
- package/native/vendor/microtex/lib/utils/string_utils.h +130 -0
- package/native/vendor/microtex/lib/utils/types.h +152 -0
- package/native/vendor/microtex/lib/utils/utf.cpp +115 -0
- package/native/vendor/microtex/lib/utils/utf.h +58 -0
- package/native/vendor/microtex/lib/utils/utils.cpp +40 -0
- package/native/vendor/microtex/lib/utils/utils.h +88 -0
- package/native/vendor/microtex/lib/wrapper/byte_seq.cpp +46 -0
- package/native/vendor/microtex/lib/wrapper/byte_seq.h +70 -0
- package/native/vendor/microtex/lib/wrapper/callback.cpp +10 -0
- package/native/vendor/microtex/lib/wrapper/callback.h +72 -0
- package/native/vendor/microtex/lib/wrapper/cwrapper.cpp +206 -0
- package/native/vendor/microtex/lib/wrapper/cwrapper.h +305 -0
- package/native/vendor/microtex/lib/wrapper/graphic_wrapper.cpp +211 -0
- package/native/vendor/microtex/lib/wrapper/graphic_wrapper.h +159 -0
- package/native/vendor/microtex/lib/wrapper/meson.build +22 -0
- package/native/vendor/microtex/meson.build +75 -0
- package/native/vendor/microtex/meson_options.txt +29 -0
- package/native/vendor/microtex/platform/cairo/CMakeLists.txt +36 -0
- package/native/vendor/microtex/platform/cairo/graphic_cairo.cpp +384 -0
- package/native/vendor/microtex/platform/cairo/graphic_cairo.h +119 -0
- package/native/vendor/microtex/platform/cairo/meson.build +47 -0
- package/native/vendor/microtex/platform/cairo/microtex-cairoConfig.cmake.in +11 -0
- package/native/vendor/microtex/platform/flutter/microtex/.metadata +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/CHANGELOG.md +3 -0
- package/native/vendor/microtex/platform/flutter/microtex/LICENSE +1 -0
- package/native/vendor/microtex/platform/flutter/microtex/README.md +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/analysis_options.yaml +4 -0
- package/native/vendor/microtex/platform/flutter/microtex/android/build.gradle +56 -0
- package/native/vendor/microtex/platform/flutter/microtex/android/settings.gradle +1 -0
- package/native/vendor/microtex/platform/flutter/microtex/android/src/main/AndroidManifest.xml +3 -0
- package/native/vendor/microtex/platform/flutter/microtex/android/src/main/kotlin/io/nano/microtex/microtex/MicrotexPlugin.kt +35 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/.metadata +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/README.md +16 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/analysis_options.yaml +31 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/build.gradle +68 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/debug/AndroidManifest.xml +7 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/AndroidManifest.xml +34 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/kotlin/io/nano/microtex/microtex_example/MainActivity.kt +6 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/drawable/launch_background.xml +12 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/values/styles.xml +18 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/main/res/values-night/styles.xml +18 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/app/src/profile/AndroidManifest.xml +7 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/build.gradle +31 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/gradle.properties +3 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/android/settings.gradle +11 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/AppFrameworkInfo.plist +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/Debug.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Flutter/Release.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Podfile +41 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Podfile.lock +22 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/AppDelegate.swift +13 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Base.lproj/Main.storyboard +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Info.plist +49 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner/Runner-Bridging-Header.h +1 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.pbxproj +549 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +87 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/contents.xcworkspacedata +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/main.dart +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/screen/edit_in_one.dart +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/screen/edit_screen.dart +208 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/utils/convert_spans.dart +63 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/utils/string_ext.dart +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/cmp.dart +118 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/draggable.dart +75 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/rich.dart +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/split.dart +72 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/tex_highlight_controller.dart +66 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/lib/widget/tex_input_controller.dart +19 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/CMakeLists.txt +116 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/CMakeLists.txt +87 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugin_registrant.cc +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugin_registrant.h +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/flutter/generated_plugins.cmake +24 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/main.cc +6 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/my_application.cc +104 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/linux/my_application.h +18 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/Flutter-Debug.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/Flutter-Release.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Flutter/GeneratedPluginRegistrant.swift +12 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Podfile +40 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Podfile.lock +22 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/AppDelegate.swift +9 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Base.lproj/MainMenu.xib +343 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/AppInfo.xcconfig +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Debug.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Release.xcconfig +2 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Configs/Warnings.xcconfig +13 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/DebugProfile.entitlements +12 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Info.plist +32 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/MainFlutterWindow.swift +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner/Release.entitlements +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/project.pbxproj +633 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +87 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcworkspace/contents.xcworkspacedata +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/pubspec.lock +191 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/pubspec.yaml +56 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/test/widget_test.dart +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/CMakeLists.txt +95 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/CMakeLists.txt +103 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugin_registrant.cc +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugin_registrant.h +15 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/flutter/generated_plugins.cmake +24 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/CMakeLists.txt +17 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/Runner.rc +121 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.cpp +61 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.h +33 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/main.cpp +43 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/resource.h +16 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/resources/app_icon.ico +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/runner.exe.manifest +20 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/utils.cpp +64 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/utils.h +19 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.cpp +245 -0
- package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.h +98 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Assets/.gitkeep +0 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/MicrotexPlugin.h +4 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/MicrotexPlugin.m +19 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/SwiftMicrotexPlugin.swift +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/Classes/dummy.h +4 -0
- package/native/vendor/microtex/platform/flutter/microtex/ios/microtex.podspec +27 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/microtex.dart +7 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/bindings.dart +218 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/bounds.dart +10 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/context.dart +205 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/fontdesc.dart +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/fontmeta.dart +14 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/pathcache.dart +17 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/render.dart +291 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/texstyle.dart +11 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/textlayout.dart +93 -0
- package/native/vendor/microtex/platform/flutter/microtex/lib/src/widget.dart +163 -0
- package/native/vendor/microtex/platform/flutter/microtex/linux/CMakeLists.txt +33 -0
- package/native/vendor/microtex/platform/flutter/microtex/linux/include/microtex/microtex_plugin.h +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/linux/microtex_plugin.cc +70 -0
- package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/MicrotexPlugin.swift +20 -0
- package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/dummy.h +4 -0
- package/native/vendor/microtex/platform/flutter/microtex/macos/Classes/microtex-Bridging-Header.h +1 -0
- package/native/vendor/microtex/platform/flutter/microtex/macos/microtex.podspec +26 -0
- package/native/vendor/microtex/platform/flutter/microtex/nativelib/CMakeLists.txt +44 -0
- package/native/vendor/microtex/platform/flutter/microtex/nativelib/builddarwin.sh +108 -0
- package/native/vendor/microtex/platform/flutter/microtex/pubspec.yaml +37 -0
- package/native/vendor/microtex/platform/flutter/microtex/test/microtex_test.dart +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/windows/CMakeLists.txt +32 -0
- package/native/vendor/microtex/platform/flutter/microtex/windows/include/microtex/microtex_plugin.h +23 -0
- package/native/vendor/microtex/platform/flutter/microtex/windows/microtex_plugin.cpp +82 -0
- package/native/vendor/microtex/platform/gdi_win/CMakeLists.txt +20 -0
- package/native/vendor/microtex/platform/gdi_win/graphic_win32.cpp +352 -0
- package/native/vendor/microtex/platform/gdi_win/graphic_win32.h +137 -0
- package/native/vendor/microtex/platform/gdi_win/meson.build +39 -0
- package/native/vendor/microtex/platform/gtk/CMakeLists.txt +36 -0
- package/native/vendor/microtex/platform/gtk/meson.build +65 -0
- package/native/vendor/microtex/platform/gtk/microtex-gtkConfig.cmake.in +11 -0
- package/native/vendor/microtex/platform/gtk/microtexequation.cpp +708 -0
- package/native/vendor/microtex/platform/gtk/microtexequation.h +72 -0
- package/native/vendor/microtex/platform/qt/CMakeLists.txt +37 -0
- package/native/vendor/microtex/platform/qt/graphic_qt.cpp +355 -0
- package/native/vendor/microtex/platform/qt/graphic_qt.h +116 -0
- package/native/vendor/microtex/platform/qt/meson.build +38 -0
- package/native/vendor/microtex/platform/qt/microtex-qtConfig.cmake.in +7 -0
- package/native/vendor/microtex/platform/skia/CMakeLists.txt +46 -0
- package/native/vendor/microtex/platform/skia/graphic_skia.cpp +306 -0
- package/native/vendor/microtex/platform/skia/graphic_skia.h +125 -0
- package/native/vendor/microtex/platform/skia/microtex-skiaConfig.cmake.in +6 -0
- package/native/vendor/microtex/platform/wasm/CMakeLists.txt +38 -0
- package/native/vendor/microtex/platform/wasm/emscripten.cross +31 -0
- package/native/vendor/microtex/platform/wasm/main.cpp +15 -0
- package/native/vendor/microtex/platform/wasm/meson.build +8 -0
- package/native/vendor/microtex/platform/wasm/prebuild-example-meson.sh +21 -0
- package/native/vendor/microtex/platform/wasm/prebuild-example.sh +21 -0
- package/native/vendor/microtex/platform/wasm/prebuild-lib-meson.sh +28 -0
- package/native/vendor/microtex/platform/wasm/prebuild-lib.sh +31 -0
- package/native/vendor/microtex/platform/wasm/web/.babelrc +10 -0
- package/native/vendor/microtex/platform/wasm/web/example/examples.js +43 -0
- package/native/vendor/microtex/platform/wasm/web/example/hello.js +31 -0
- package/native/vendor/microtex/platform/wasm/web/example/index.html +55 -0
- package/native/vendor/microtex/platform/wasm/web/example/index.js +243 -0
- package/native/vendor/microtex/platform/wasm/web/example/styles.css +86 -0
- package/native/vendor/microtex/platform/wasm/web/example/utils.js +47 -0
- package/native/vendor/microtex/platform/wasm/web/lib/context.js +271 -0
- package/native/vendor/microtex/platform/wasm/web/lib/index.js +10 -0
- package/native/vendor/microtex/platform/wasm/web/lib/render.js +293 -0
- package/native/vendor/microtex/platform/wasm/web/lib/runtime.js +14 -0
- package/native/vendor/microtex/platform/wasm/web/lib/svg.js +237 -0
- package/native/vendor/microtex/platform/wasm/web/lib/textlayout.js +88 -0
- package/native/vendor/microtex/platform/wasm/web/package-lock.json +5931 -0
- package/native/vendor/microtex/platform/wasm/web/package.json +45 -0
- package/native/vendor/microtex/platform/wasm/web/publish-example.sh +17 -0
- package/native/vendor/microtex/platform/wasm/web/rollup.config.example.js +24 -0
- package/native/vendor/microtex/platform/wasm/web/rollup.config.lib.js +16 -0
- package/native/vendor/microtex/prebuilt/otf2clm.py +807 -0
- package/native/vendor/microtex/prebuilt/otf2clm.sh +9 -0
- package/native/vendor/microtex/prebuilt/preclms.sh +17 -0
- package/native/vendor/microtex/readme/example_bw_false.svg +680 -0
- package/native/vendor/microtex/readme/example_bw_true.svg +680 -0
- package/native/vendor/microtex/readme/example_cjk_trying.svg +54 -0
- package/native/vendor/microtex/readme/example_custom_symbols.svg +92 -0
- package/native/vendor/microtex/readme/example_debug.svg +764 -0
- package/native/vendor/microtex/readme/example_emoji.svg +199 -0
- package/native/vendor/microtex/readme/example_have_log.svg +79 -0
- package/native/vendor/microtex/readme/example_keep_trying.svg +101 -0
- package/native/vendor/microtex/readme/example_logos.svg +50 -0
- package/native/vendor/microtex/readme/example_ubuntu.png +0 -0
- package/native/vendor/microtex/readme/example_windows.png +0 -0
- package/native/vendor/microtex/readme/samples/sample_0.svg +665 -0
- package/native/vendor/microtex/readme/samples/sample_1.svg +1259 -0
- package/native/vendor/microtex/readme/samples/sample_10.svg +333 -0
- package/native/vendor/microtex/readme/samples/sample_11.svg +306 -0
- package/native/vendor/microtex/readme/samples/sample_2.svg +2461 -0
- package/native/vendor/microtex/readme/samples/sample_3.svg +2653 -0
- package/native/vendor/microtex/readme/samples/sample_4.svg +554 -0
- package/native/vendor/microtex/readme/samples/sample_5.svg +247 -0
- package/native/vendor/microtex/readme/samples/sample_6.svg +1082 -0
- package/native/vendor/microtex/readme/samples/sample_7.svg +518 -0
- package/native/vendor/microtex/readme/samples/sample_8.svg +529 -0
- package/native/vendor/microtex/readme/samples/sample_9.svg +1702 -0
- package/native/vendor/microtex/readme/samples.md +301 -0
- package/native/vendor/microtex/readme/tex_logo.svg +19 -0
- package/native/vendor/microtex/res/EXAMPLE.txt +25 -0
- package/native/vendor/microtex/res/SAMPLES.tex +946 -0
- package/native/vendor/microtex/res/firamath/FiraMath-Regular.clm1 +0 -0
- package/native/vendor/microtex/res/firamath/FiraMath-Regular.clm2 +0 -0
- package/native/vendor/microtex/res/firamath/FiraMath-Regular.otf +0 -0
- package/native/vendor/microtex/res/firamath/README.md +42 -0
- package/native/vendor/microtex/res/lm-math/README +92 -0
- package/native/vendor/microtex/res/lm-math/latinmodern-math.clm1 +0 -0
- package/native/vendor/microtex/res/lm-math/latinmodern-math.clm2 +0 -0
- package/native/vendor/microtex/res/lm-math/latinmodern-math.otf +0 -0
- package/native/vendor/microtex/res/tex-gyre/README-TeX-Gyre-DejaVu-Math.txt +82 -0
- package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.clm1 +0 -0
- package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.clm2 +0 -0
- package/native/vendor/microtex/res/tex-gyre/texgyredejavu-math.otf +0 -0
- package/native/vendor/microtex/res/xits/FONTLOG.txt +246 -0
- package/native/vendor/microtex/res/xits/OFL.txt +98 -0
- package/native/vendor/microtex/res/xits/README.txt +15 -0
- package/native/vendor/microtex/res/xits/XITS-Bold.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Bold.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Bold.otf +0 -0
- package/native/vendor/microtex/res/xits/XITS-BoldItalic.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITS-BoldItalic.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITS-BoldItalic.otf +0 -0
- package/native/vendor/microtex/res/xits/XITS-Italic.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Italic.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Italic.otf +0 -0
- package/native/vendor/microtex/res/xits/XITS-Regular.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Regular.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITS-Regular.otf +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Bold.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Bold.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Bold.otf +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Regular.clm1 +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Regular.clm2 +0 -0
- package/native/vendor/microtex/res/xits/XITSMath-Regular.otf +0 -0
- package/native/vendor/microtex/test/clm/meson.build +10 -0
- package/native/vendor/microtex/test/clm/test_clm.cpp +140 -0
- package/native/vendor/microtex/test/env/meson.build +10 -0
- package/native/vendor/microtex/test/env/test_env.cpp +100 -0
- package/native/vendor/microtex/test/fuzzer/afl.native +20 -0
- package/native/vendor/microtex/test/fuzzer/fuzz.sh +135 -0
- package/native/vendor/microtex/test/fuzzer/fuzzer.cpp +61 -0
- package/native/vendor/microtex/test/fuzzer/generateSeed.java +33 -0
- package/native/vendor/microtex/test/fuzzer/meson.build +9 -0
- package/native/vendor/microtex/test/fuzzer/microtex.dict +3708 -0
- package/native/vendor/microtex/test/fuzzer/platform_none.cpp +100 -0
- package/native/vendor/microtex/test/has_filesystem.cpp +8 -0
- package/native/vendor/microtex/test/meson.build +6 -0
- package/native/vendor/nanosvg.h +3278 -0
- package/native/vendor/nanosvgrast.h +1472 -0
- package/native/vendor/zigtex/.github/assets/example.svg +27 -0
- package/native/vendor/zigtex/LICENSE +674 -0
- package/native/vendor/zigtex/README.md +52 -0
- package/native/vendor/zigtex/build.zig +52 -0
- package/native/vendor/zigtex/build.zig.zon +16 -0
- package/native/vendor/zigtex/fonts/latinmodern-math.clm2 +0 -0
- package/native/vendor/zigtex/src/main.zig +22 -0
- package/native/vendor/zigtex/src/root.zig +124 -0
- package/native/vendor/zigtex/src/svg.zig +273 -0
- package/native/vendor/zigtex/src/tex.zig +383 -0
- package/native/zigtex-0.16.patch +35 -0
- package/package.json +27 -0
- package/scripts/bootstrap-native +89 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
// clang-format off
|
|
2
|
+
#include "graphic_win32.h"
|
|
3
|
+
#include "microtex.h"
|
|
4
|
+
#include "samples.h"
|
|
5
|
+
#include "utils/string_utils.h"
|
|
6
|
+
|
|
7
|
+
#include <comdef.h>
|
|
8
|
+
#include <gdiplus.h>
|
|
9
|
+
#include <windows.h>
|
|
10
|
+
// clang-format off
|
|
11
|
+
|
|
12
|
+
#define ID_SETTER 256
|
|
13
|
+
#define ID_CANVAS 512
|
|
14
|
+
#define ID_EDITBOX 1024
|
|
15
|
+
#define ID_BUTTON_SIZE 2048
|
|
16
|
+
#define ID_BUTTON_NEXT 4096
|
|
17
|
+
|
|
18
|
+
#define BUTTON_WIDTH 180
|
|
19
|
+
#define BUTTON_HEIGHT 35
|
|
20
|
+
#define EDITOR_WIDTH 640
|
|
21
|
+
|
|
22
|
+
using namespace std;
|
|
23
|
+
using namespace microtex;
|
|
24
|
+
using namespace Gdiplus;
|
|
25
|
+
|
|
26
|
+
microtex::Render* _render = nullptr;
|
|
27
|
+
int _size = 26;
|
|
28
|
+
color _color = 0xff424242;
|
|
29
|
+
Samples* _samples;
|
|
30
|
+
|
|
31
|
+
HWND hEditor, hBtnSize, hBtnNext, hCanvas, hEditSize;
|
|
32
|
+
WNDPROC editorProc, setterProc;
|
|
33
|
+
|
|
34
|
+
void RegisterCanvas();
|
|
35
|
+
|
|
36
|
+
void CreateCtrl(HINSTANCE, HWND);
|
|
37
|
+
|
|
38
|
+
void ResizeCtrl(HWND);
|
|
39
|
+
|
|
40
|
+
void HandleOK();
|
|
41
|
+
|
|
42
|
+
void HandleNext();
|
|
43
|
+
|
|
44
|
+
void HandleSize();
|
|
45
|
+
|
|
46
|
+
void RenderFormula(HWND, HDC);
|
|
47
|
+
|
|
48
|
+
void init();
|
|
49
|
+
|
|
50
|
+
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
|
51
|
+
|
|
52
|
+
LRESULT CALLBACK CanvasProc(HWND, UINT, WPARAM, LPARAM);
|
|
53
|
+
|
|
54
|
+
LRESULT CALLBACK EditorProc(HWND, UINT, WPARAM, LPARAM);
|
|
55
|
+
|
|
56
|
+
LRESULT CALLBACK SetterProc(HWND, UINT, WPARAM, LPARAM);
|
|
57
|
+
|
|
58
|
+
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow) {
|
|
59
|
+
HWND hWnd;
|
|
60
|
+
MSG msg;
|
|
61
|
+
WNDCLASS wndClass;
|
|
62
|
+
GdiplusStartupInput gdiplusStartupInput;
|
|
63
|
+
ULONG_PTR gdiplusToken;
|
|
64
|
+
|
|
65
|
+
// Initialize GDI+.
|
|
66
|
+
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, nullptr);
|
|
67
|
+
init();
|
|
68
|
+
|
|
69
|
+
RegisterCanvas();
|
|
70
|
+
|
|
71
|
+
wndClass.style = CS_HREDRAW | CS_VREDRAW;
|
|
72
|
+
wndClass.lpfnWndProc = WndProc;
|
|
73
|
+
wndClass.cbClsExtra = 0;
|
|
74
|
+
wndClass.cbWndExtra = 0;
|
|
75
|
+
wndClass.hInstance = hInstance;
|
|
76
|
+
wndClass.hIcon = LoadIcon(nullptr, IDI_APPLICATION);
|
|
77
|
+
wndClass.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
|
78
|
+
wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
|
|
79
|
+
wndClass.lpszMenuName = nullptr;
|
|
80
|
+
wndClass.lpszClassName = TEXT("MicroTeX");
|
|
81
|
+
|
|
82
|
+
RegisterClass(&wndClass);
|
|
83
|
+
|
|
84
|
+
hWnd = CreateWindow(
|
|
85
|
+
TEXT("MicroTeX"), // window class name
|
|
86
|
+
TEXT("MicroTeX"), // window caption
|
|
87
|
+
WS_OVERLAPPEDWINDOW, // window style
|
|
88
|
+
0, // initial x position
|
|
89
|
+
0, // initial y position
|
|
90
|
+
780, // initial x size
|
|
91
|
+
480, // initial y size
|
|
92
|
+
nullptr, // parent window handle
|
|
93
|
+
nullptr, // window menu handle
|
|
94
|
+
hInstance, // program instance handle
|
|
95
|
+
nullptr // creation parameters
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
CreateCtrl(hInstance, hWnd);
|
|
99
|
+
ShowWindow(hWnd, SW_SHOWMAXIMIZED);
|
|
100
|
+
UpdateWindow(hWnd);
|
|
101
|
+
|
|
102
|
+
while (GetMessage(&msg, nullptr, 0, 0)) {
|
|
103
|
+
TranslateMessage(&msg);
|
|
104
|
+
DispatchMessage(&msg);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
delete _render;
|
|
108
|
+
delete _samples;
|
|
109
|
+
MicroTeX::release();
|
|
110
|
+
GdiplusShutdown(gdiplusToken);
|
|
111
|
+
return msg.wParam;
|
|
112
|
+
} // WinMain
|
|
113
|
+
|
|
114
|
+
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
|
|
115
|
+
switch (message) {
|
|
116
|
+
case WM_DESTROY: PostQuitMessage(0); return 0;
|
|
117
|
+
case WM_COMMAND:
|
|
118
|
+
if (wParam == ID_BUTTON_SIZE) {
|
|
119
|
+
HandleSize();
|
|
120
|
+
} else if (wParam == ID_BUTTON_NEXT) {
|
|
121
|
+
HandleNext();
|
|
122
|
+
}
|
|
123
|
+
return 0;
|
|
124
|
+
case WM_SIZE: ResizeCtrl(hWnd); return 0;
|
|
125
|
+
default: return DefWindowProc(hWnd, message, wParam, lParam);
|
|
126
|
+
}
|
|
127
|
+
} // WndProc
|
|
128
|
+
|
|
129
|
+
void init() {
|
|
130
|
+
if (__argc < 5) {
|
|
131
|
+
fprintf(
|
|
132
|
+
stderr,
|
|
133
|
+
"Required options:\n"
|
|
134
|
+
" <clm data file>\n"
|
|
135
|
+
" <math font file>\n"
|
|
136
|
+
" <samples file>\n"
|
|
137
|
+
);
|
|
138
|
+
exit(1);
|
|
139
|
+
}
|
|
140
|
+
const FontSrcFile math{__argv[2], __argv[3]};
|
|
141
|
+
MicroTeX::init(math);
|
|
142
|
+
PlatformFactory::registerFactory("gdi", std::make_unique<PlatformFactory_gdi>());
|
|
143
|
+
PlatformFactory::activate("gdi");
|
|
144
|
+
_samples = new Samples(__argv[4]);
|
|
145
|
+
_render = MicroTeX::parse(
|
|
146
|
+
"\\text{Hello from \\MicroTeX, have fun! Press Ctrl + Enter on editor to show "
|
|
147
|
+
"formulas.}",
|
|
148
|
+
720,
|
|
149
|
+
_size,
|
|
150
|
+
_size / 3.f,
|
|
151
|
+
_color
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
void HandleNext() {
|
|
156
|
+
delete _render;
|
|
157
|
+
RECT r;
|
|
158
|
+
GetClientRect(hCanvas, &r);
|
|
159
|
+
_render = MicroTeX::parse(_samples->next(), r.right - r.left, _size, _size / 3.f, _color);
|
|
160
|
+
InvalidateRect(hCanvas, nullptr, TRUE);
|
|
161
|
+
UpdateWindow(hCanvas);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
void HandleOK() {
|
|
165
|
+
int len = GetWindowTextLengthA(hEditor);
|
|
166
|
+
char* data = new char[len + 10];
|
|
167
|
+
GetWindowTextA(hEditor, data, len + 10);
|
|
168
|
+
std::string txt = data;
|
|
169
|
+
delete _render;
|
|
170
|
+
delete[] data;
|
|
171
|
+
RECT r;
|
|
172
|
+
GetClientRect(hCanvas, &r);
|
|
173
|
+
_render = MicroTeX::parse(txt, r.right - r.left, _size, _size / 3.f, _color);
|
|
174
|
+
InvalidateRect(hCanvas, nullptr, TRUE);
|
|
175
|
+
UpdateWindow(hCanvas);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
void HandleSize() {
|
|
179
|
+
if (_render == nullptr) return;
|
|
180
|
+
int len = GetWindowTextLength(hEditSize);
|
|
181
|
+
if (len == 0) return;
|
|
182
|
+
char* txt = new char[len + 10];
|
|
183
|
+
GetWindowText(hEditSize, txt, len + 10);
|
|
184
|
+
string x = txt;
|
|
185
|
+
microtex::valueOf(x, _size);
|
|
186
|
+
_render->setTextSize(_size);
|
|
187
|
+
InvalidateRect(hCanvas, nullptr, TRUE);
|
|
188
|
+
UpdateWindow(hCanvas);
|
|
189
|
+
delete[] txt;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
void RenderFormula(HWND hwnd, HDC hdc) {
|
|
193
|
+
// draw rectangle
|
|
194
|
+
RECT r;
|
|
195
|
+
GetClientRect(hwnd, &r);
|
|
196
|
+
Graphics g(hdc);
|
|
197
|
+
Graphics2D_win32 g2(&g);
|
|
198
|
+
g2.drawRect(r.left, r.top, r.right - r.left - 1, r.bottom - r.top - 1);
|
|
199
|
+
// draw formula
|
|
200
|
+
if (_render != nullptr) {
|
|
201
|
+
_render->draw(g2, 10, 10);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
void CreateCtrl(HINSTANCE hInst, HWND hwnd) {
|
|
206
|
+
// create first, relayout through message WM_SIZE
|
|
207
|
+
int l = 0, t = 0, w = 10, h = 10;
|
|
208
|
+
// edit-box
|
|
209
|
+
hEditor = CreateWindowEx(
|
|
210
|
+
WS_EX_TOPMOST,
|
|
211
|
+
"edit",
|
|
212
|
+
nullptr,
|
|
213
|
+
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_MULTILINE | ES_AUTOVSCROLL,
|
|
214
|
+
l,
|
|
215
|
+
t,
|
|
216
|
+
w,
|
|
217
|
+
h,
|
|
218
|
+
hwnd,
|
|
219
|
+
(HMENU)ID_EDITBOX,
|
|
220
|
+
hInst,
|
|
221
|
+
nullptr
|
|
222
|
+
);
|
|
223
|
+
HFONT hf = CreateFont(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Consolas");
|
|
224
|
+
SendMessage(hEditor, WM_SETFONT, (WPARAM)hf, 0);
|
|
225
|
+
SetFocus(hEditor);
|
|
226
|
+
editorProc = (WNDPROC)SetWindowLongPtr(hEditor, GWLP_WNDPROC, (LONG_PTR)EditorProc);
|
|
227
|
+
// size setter
|
|
228
|
+
hEditSize = CreateWindowEx(
|
|
229
|
+
WS_EX_TOPMOST,
|
|
230
|
+
"edit",
|
|
231
|
+
nullptr,
|
|
232
|
+
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_CENTER | ES_NUMBER,
|
|
233
|
+
l,
|
|
234
|
+
t,
|
|
235
|
+
w,
|
|
236
|
+
h,
|
|
237
|
+
hwnd,
|
|
238
|
+
(HMENU)ID_SETTER,
|
|
239
|
+
hInst,
|
|
240
|
+
nullptr
|
|
241
|
+
);
|
|
242
|
+
SendMessage(hEditSize, WM_SETFONT, (WPARAM)hf, 0);
|
|
243
|
+
setterProc = (WNDPROC)SetWindowLongPtr(hEditSize, GWLP_WNDPROC, (LONG_PTR)SetterProc);
|
|
244
|
+
// button size
|
|
245
|
+
hBtnSize = CreateWindowEx(
|
|
246
|
+
WS_EX_TOPMOST,
|
|
247
|
+
"Button",
|
|
248
|
+
nullptr,
|
|
249
|
+
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
|
|
250
|
+
l,
|
|
251
|
+
t,
|
|
252
|
+
w,
|
|
253
|
+
h,
|
|
254
|
+
hwnd,
|
|
255
|
+
(HMENU)ID_BUTTON_SIZE,
|
|
256
|
+
hInst,
|
|
257
|
+
nullptr
|
|
258
|
+
);
|
|
259
|
+
SendMessage(hBtnSize, WM_SETFONT, (WPARAM)hf, 0);
|
|
260
|
+
SendMessage(hBtnSize, WM_SETTEXT, (WPARAM) nullptr, (LPARAM)("Set Text Size"));
|
|
261
|
+
// button next
|
|
262
|
+
hBtnNext = CreateWindowEx(
|
|
263
|
+
WS_EX_TOPMOST,
|
|
264
|
+
"Button",
|
|
265
|
+
nullptr,
|
|
266
|
+
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
|
|
267
|
+
l,
|
|
268
|
+
t,
|
|
269
|
+
w,
|
|
270
|
+
h,
|
|
271
|
+
hwnd,
|
|
272
|
+
(HMENU)ID_BUTTON_NEXT,
|
|
273
|
+
hInst,
|
|
274
|
+
nullptr
|
|
275
|
+
);
|
|
276
|
+
SendMessage(hBtnNext, WM_SETFONT, (WPARAM)hf, 0);
|
|
277
|
+
SendMessage(hBtnNext, WM_SETTEXT, (WPARAM) nullptr, (LPARAM)("Next Example"));
|
|
278
|
+
// canvas
|
|
279
|
+
hCanvas = CreateWindowEx(
|
|
280
|
+
WS_EX_TOPMOST,
|
|
281
|
+
"canvas",
|
|
282
|
+
nullptr,
|
|
283
|
+
WS_CHILD | WS_VISIBLE,
|
|
284
|
+
l,
|
|
285
|
+
t,
|
|
286
|
+
w,
|
|
287
|
+
h,
|
|
288
|
+
hwnd,
|
|
289
|
+
(HMENU)ID_CANVAS,
|
|
290
|
+
hInst,
|
|
291
|
+
nullptr
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
void ResizeCtrl(HWND hwnd) {
|
|
296
|
+
RECT r;
|
|
297
|
+
GetClientRect(hwnd, &r);
|
|
298
|
+
const int margin = 10;
|
|
299
|
+
// editor
|
|
300
|
+
int w = EDITOR_WIDTH, h = BUTTON_HEIGHT;
|
|
301
|
+
int l = r.right - w - margin, t = r.top + margin;
|
|
302
|
+
h = r.bottom - t - h - 2 * margin;
|
|
303
|
+
MoveWindow(hEditor, l, t, w, h, TRUE);
|
|
304
|
+
// setter
|
|
305
|
+
w = EDITOR_WIDTH - BUTTON_WIDTH * 2 - margin * 2, h = BUTTON_HEIGHT, t = r.bottom - h - margin;
|
|
306
|
+
MoveWindow(hEditSize, l, t, w, h, TRUE);
|
|
307
|
+
// button size
|
|
308
|
+
w = BUTTON_WIDTH;
|
|
309
|
+
l = r.right - w * 2 - margin * 2;
|
|
310
|
+
MoveWindow(hBtnSize, l, t, w, h, TRUE);
|
|
311
|
+
// button next
|
|
312
|
+
w = BUTTON_WIDTH;
|
|
313
|
+
l = r.right - w - margin;
|
|
314
|
+
MoveWindow(hBtnNext, l, t, w, h, TRUE);
|
|
315
|
+
// canvas
|
|
316
|
+
l = r.left + margin, t = r.top + margin;
|
|
317
|
+
w = r.right - EDITOR_WIDTH - 2 * margin - l, h = r.bottom - t - margin;
|
|
318
|
+
MoveWindow(hCanvas, l, t, w, h, TRUE);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
void RegisterCanvas() {
|
|
322
|
+
WNDCLASS wnd = {0};
|
|
323
|
+
wnd.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW;
|
|
324
|
+
wnd.lpfnWndProc = CanvasProc;
|
|
325
|
+
wnd.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
|
326
|
+
wnd.lpszClassName = "canvas";
|
|
327
|
+
RegisterClass(&wnd);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
LRESULT CALLBACK EditorProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
|
|
331
|
+
if (msg == WM_KEYDOWN && wp == VK_RETURN && GetKeyState(VK_CONTROL) < 0) {
|
|
332
|
+
HandleOK();
|
|
333
|
+
return 0;
|
|
334
|
+
}
|
|
335
|
+
if (msg == WM_CHAR && wp == '\n' && GetKeyState(VK_CONTROL) < 0) {
|
|
336
|
+
return 0;
|
|
337
|
+
}
|
|
338
|
+
return CallWindowProc(editorProc, hwnd, msg, wp, lp);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
LRESULT CALLBACK SetterProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
|
|
342
|
+
if (msg == WM_KEYDOWN && wp == VK_RETURN) {
|
|
343
|
+
HandleSize();
|
|
344
|
+
return 0;
|
|
345
|
+
}
|
|
346
|
+
return CallWindowProc(setterProc, hwnd, msg, wp, lp);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
void ScrollCanvas(int d) {
|
|
350
|
+
ScrollWindow(hCanvas, 0, d, nullptr, nullptr);
|
|
351
|
+
UpdateWindow(hCanvas);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
LRESULT CALLBACK CanvasProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
|
|
355
|
+
HDC hdc;
|
|
356
|
+
PAINTSTRUCT ps;
|
|
357
|
+
|
|
358
|
+
switch (message) {
|
|
359
|
+
case WM_PAINT: {
|
|
360
|
+
hdc = BeginPaint(hWnd, &ps);
|
|
361
|
+
RenderFormula(hWnd, hdc);
|
|
362
|
+
EndPaint(hWnd, &ps);
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
case WM_ERASEBKGND: {
|
|
366
|
+
hdc = (HDC)wParam;
|
|
367
|
+
RECT r;
|
|
368
|
+
GetClientRect(hWnd, &r);
|
|
369
|
+
FillRect(hdc, &r, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
default: return DefWindowProc(hWnd, message, wParam, lParam);
|
|
373
|
+
}
|
|
374
|
+
return 0;
|
|
375
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Check compiling before commit
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
CYAN='\033[0;36m'
|
|
7
|
+
RESET='\033[0m'
|
|
8
|
+
|
|
9
|
+
echo -e "${CYAN}############################### START BUILD ##############################${RESET}"
|
|
10
|
+
|
|
11
|
+
workingDir=$(pwd)
|
|
12
|
+
|
|
13
|
+
cd build
|
|
14
|
+
cmake -DCMAKE_BUILD_TYPE=Debug -DGRAPHICS_DEBUG=ON -DMEM_CHECK=OFF -DHAVE_LOG=ON ..
|
|
15
|
+
make -j32
|
|
16
|
+
|
|
17
|
+
cd $workingDir
|
|
18
|
+
|
|
19
|
+
echo -e "${CYAN}################################## DONE ##################################${RESET}"
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Update samples before push
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
GREEN='\033[0;32m'
|
|
7
|
+
RED='\033[0;31m'
|
|
8
|
+
CYAN='\033[0;36m'
|
|
9
|
+
RESET='\033[0m'
|
|
10
|
+
|
|
11
|
+
echo -e "${CYAN}############################# UPDATE SAMPLES #############################${RESET}"
|
|
12
|
+
|
|
13
|
+
workingDir=$(pwd)
|
|
14
|
+
|
|
15
|
+
cd build
|
|
16
|
+
|
|
17
|
+
write_sample() {
|
|
18
|
+
echo -e "\`\`\`tex" >> samples.md
|
|
19
|
+
cat __tmp >> samples.md
|
|
20
|
+
echo -e "\`\`\`" >> samples.md
|
|
21
|
+
cp /dev/null __tmp
|
|
22
|
+
echo -e "\n\n\n" >> samples.md
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
update_samples() {
|
|
26
|
+
# regenerate sample_*.svg
|
|
27
|
+
if [ -d samples ]; then
|
|
28
|
+
rm -r samples
|
|
29
|
+
fi
|
|
30
|
+
mkdir samples
|
|
31
|
+
./LaTeX -headless \
|
|
32
|
+
-outputdir=./samples \
|
|
33
|
+
-prefix=sample_ \
|
|
34
|
+
-textsize=14 \
|
|
35
|
+
-foreground=black \
|
|
36
|
+
-background=white
|
|
37
|
+
# regenerate samples.md
|
|
38
|
+
if [ -e samples.md ]; then
|
|
39
|
+
rm samples.md
|
|
40
|
+
fi
|
|
41
|
+
touch samples.md
|
|
42
|
+
echo -e "# SAMPLES\n" >> samples.md
|
|
43
|
+
touch __tmp
|
|
44
|
+
cp /dev/null __tmp
|
|
45
|
+
j=0
|
|
46
|
+
while IFS='' read -r i || [[ -n "$i" ]]; do
|
|
47
|
+
if [[ $i == +(['%']) ]]; then
|
|
48
|
+
write_sample $j
|
|
49
|
+
j=`expr $j + 1`
|
|
50
|
+
elif [ -n "$i" ]; then
|
|
51
|
+
echo "$i" >> __tmp
|
|
52
|
+
fi
|
|
53
|
+
done < res/SAMPLES.tex
|
|
54
|
+
# the last sample
|
|
55
|
+
write_sample $j
|
|
56
|
+
|
|
57
|
+
rm __tmp
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
update_change() {
|
|
61
|
+
if [ ! -d ../readme/samples ]; then
|
|
62
|
+
mkdir ../readme/samples
|
|
63
|
+
fi
|
|
64
|
+
# compress svg files
|
|
65
|
+
for svg in `ls samples`; do
|
|
66
|
+
scour -i `pwd`/samples/$svg -o ../readme/samples/$svg \
|
|
67
|
+
--enable-viewboxing --enable-id-stripping \
|
|
68
|
+
--enable-comment-stripping --shorten-ids --indent=none
|
|
69
|
+
done
|
|
70
|
+
cp samples.md ../readme
|
|
71
|
+
# check if samples changed
|
|
72
|
+
git add ../readme/samples.md
|
|
73
|
+
git add ../readme/samples
|
|
74
|
+
git diff --cached --exit-code ../readme/samples > /dev/null
|
|
75
|
+
samplesChanged=$?
|
|
76
|
+
git diff --cached --exit-code ../readme/samples.md > /dev/null
|
|
77
|
+
mdChanged=$?
|
|
78
|
+
if [ $samplesChanged != 0 -o $mdChanged != 0 ]; then
|
|
79
|
+
echo -e "${RED}Samples changed, commit changes...${RESET}"
|
|
80
|
+
git commit -m "update samples"
|
|
81
|
+
else
|
|
82
|
+
echo -e "${GREEN}No changes need to commit.${RESET}"
|
|
83
|
+
fi
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
# Allows us to read user input below, assigns stdin to keyboard,
|
|
87
|
+
# since git hooks not run in an interactive environment
|
|
88
|
+
exec < /dev/tty
|
|
89
|
+
|
|
90
|
+
while true; do
|
|
91
|
+
read -p "Do you wish to update samples (Y/N)?" yn
|
|
92
|
+
case $yn in
|
|
93
|
+
[Yy]* ) update_samples; update_change; break;;
|
|
94
|
+
* ) echo -e "${RED}Samples updating canceled.${RESET}"; break;;
|
|
95
|
+
esac
|
|
96
|
+
done
|
|
97
|
+
|
|
98
|
+
# Close STDIN
|
|
99
|
+
exec <&-
|
|
100
|
+
|
|
101
|
+
cd $workingDir
|
|
102
|
+
|
|
103
|
+
echo -e "${CYAN}################################## DONE ##################################${RESET}"
|