@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,121 @@
|
|
|
1
|
+
// Microsoft Visual C++ generated resource script.
|
|
2
|
+
//
|
|
3
|
+
#pragma code_page(65001)
|
|
4
|
+
#include "resource.h"
|
|
5
|
+
|
|
6
|
+
#define APSTUDIO_READONLY_SYMBOLS
|
|
7
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
8
|
+
//
|
|
9
|
+
// Generated from the TEXTINCLUDE 2 resource.
|
|
10
|
+
//
|
|
11
|
+
#include "winres.h"
|
|
12
|
+
|
|
13
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
14
|
+
#undef APSTUDIO_READONLY_SYMBOLS
|
|
15
|
+
|
|
16
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
17
|
+
// English (United States) resources
|
|
18
|
+
|
|
19
|
+
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
|
20
|
+
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|
21
|
+
|
|
22
|
+
#ifdef APSTUDIO_INVOKED
|
|
23
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
24
|
+
//
|
|
25
|
+
// TEXTINCLUDE
|
|
26
|
+
//
|
|
27
|
+
|
|
28
|
+
1 TEXTINCLUDE
|
|
29
|
+
BEGIN
|
|
30
|
+
"resource.h\0"
|
|
31
|
+
END
|
|
32
|
+
|
|
33
|
+
2 TEXTINCLUDE
|
|
34
|
+
BEGIN
|
|
35
|
+
"#include ""winres.h""\r\n"
|
|
36
|
+
"\0"
|
|
37
|
+
END
|
|
38
|
+
|
|
39
|
+
3 TEXTINCLUDE
|
|
40
|
+
BEGIN
|
|
41
|
+
"\r\n"
|
|
42
|
+
"\0"
|
|
43
|
+
END
|
|
44
|
+
|
|
45
|
+
#endif // APSTUDIO_INVOKED
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
49
|
+
//
|
|
50
|
+
// Icon
|
|
51
|
+
//
|
|
52
|
+
|
|
53
|
+
// Icon with lowest ID value placed first to ensure application icon
|
|
54
|
+
// remains consistent on all systems.
|
|
55
|
+
IDI_APP_ICON ICON "resources\\app_icon.ico"
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
59
|
+
//
|
|
60
|
+
// Version
|
|
61
|
+
//
|
|
62
|
+
|
|
63
|
+
#ifdef FLUTTER_BUILD_NUMBER
|
|
64
|
+
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
|
|
65
|
+
#else
|
|
66
|
+
#define VERSION_AS_NUMBER 1,0,0
|
|
67
|
+
#endif
|
|
68
|
+
|
|
69
|
+
#ifdef FLUTTER_BUILD_NAME
|
|
70
|
+
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME
|
|
71
|
+
#else
|
|
72
|
+
#define VERSION_AS_STRING "1.0.0"
|
|
73
|
+
#endif
|
|
74
|
+
|
|
75
|
+
VS_VERSION_INFO VERSIONINFO
|
|
76
|
+
FILEVERSION VERSION_AS_NUMBER
|
|
77
|
+
PRODUCTVERSION VERSION_AS_NUMBER
|
|
78
|
+
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
|
79
|
+
#ifdef _DEBUG
|
|
80
|
+
FILEFLAGS VS_FF_DEBUG
|
|
81
|
+
#else
|
|
82
|
+
FILEFLAGS 0x0L
|
|
83
|
+
#endif
|
|
84
|
+
FILEOS VOS__WINDOWS32
|
|
85
|
+
FILETYPE VFT_APP
|
|
86
|
+
FILESUBTYPE 0x0L
|
|
87
|
+
BEGIN
|
|
88
|
+
BLOCK "StringFileInfo"
|
|
89
|
+
BEGIN
|
|
90
|
+
BLOCK "040904e4"
|
|
91
|
+
BEGIN
|
|
92
|
+
VALUE "CompanyName", "io.nano.microtex" "\0"
|
|
93
|
+
VALUE "FileDescription", "microtex_example" "\0"
|
|
94
|
+
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
|
95
|
+
VALUE "InternalName", "microtex_example" "\0"
|
|
96
|
+
VALUE "LegalCopyright", "Copyright (C) 2022 io.nano.microtex. All rights reserved." "\0"
|
|
97
|
+
VALUE "OriginalFilename", "microtex_example.exe" "\0"
|
|
98
|
+
VALUE "ProductName", "microtex_example" "\0"
|
|
99
|
+
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
|
100
|
+
END
|
|
101
|
+
END
|
|
102
|
+
BLOCK "VarFileInfo"
|
|
103
|
+
BEGIN
|
|
104
|
+
VALUE "Translation", 0x409, 1252
|
|
105
|
+
END
|
|
106
|
+
END
|
|
107
|
+
|
|
108
|
+
#endif // English (United States) resources
|
|
109
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
#ifndef APSTUDIO_INVOKED
|
|
114
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
115
|
+
//
|
|
116
|
+
// Generated from the TEXTINCLUDE 3 resource.
|
|
117
|
+
//
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
121
|
+
#endif // not APSTUDIO_INVOKED
|
package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.cpp
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#include "flutter_window.h"
|
|
2
|
+
|
|
3
|
+
#include <optional>
|
|
4
|
+
|
|
5
|
+
#include "flutter/generated_plugin_registrant.h"
|
|
6
|
+
|
|
7
|
+
FlutterWindow::FlutterWindow(const flutter::DartProject& project)
|
|
8
|
+
: project_(project) {}
|
|
9
|
+
|
|
10
|
+
FlutterWindow::~FlutterWindow() {}
|
|
11
|
+
|
|
12
|
+
bool FlutterWindow::OnCreate() {
|
|
13
|
+
if (!Win32Window::OnCreate()) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
RECT frame = GetClientArea();
|
|
18
|
+
|
|
19
|
+
// The size here must match the window dimensions to avoid unnecessary surface
|
|
20
|
+
// creation / destruction in the startup path.
|
|
21
|
+
flutter_controller_ = std::make_unique<flutter::FlutterViewController>(
|
|
22
|
+
frame.right - frame.left, frame.bottom - frame.top, project_);
|
|
23
|
+
// Ensure that basic setup of the controller was successful.
|
|
24
|
+
if (!flutter_controller_->engine() || !flutter_controller_->view()) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
RegisterPlugins(flutter_controller_->engine());
|
|
28
|
+
SetChildContent(flutter_controller_->view()->GetNativeWindow());
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
void FlutterWindow::OnDestroy() {
|
|
33
|
+
if (flutter_controller_) {
|
|
34
|
+
flutter_controller_ = nullptr;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Win32Window::OnDestroy();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
LRESULT
|
|
41
|
+
FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
|
|
42
|
+
WPARAM const wparam,
|
|
43
|
+
LPARAM const lparam) noexcept {
|
|
44
|
+
// Give Flutter, including plugins, an opportunity to handle window messages.
|
|
45
|
+
if (flutter_controller_) {
|
|
46
|
+
std::optional<LRESULT> result =
|
|
47
|
+
flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
|
|
48
|
+
lparam);
|
|
49
|
+
if (result) {
|
|
50
|
+
return *result;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
switch (message) {
|
|
55
|
+
case WM_FONTCHANGE:
|
|
56
|
+
flutter_controller_->engine()->ReloadSystemFonts();
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
|
|
61
|
+
}
|
package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/flutter_window.h
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#ifndef RUNNER_FLUTTER_WINDOW_H_
|
|
2
|
+
#define RUNNER_FLUTTER_WINDOW_H_
|
|
3
|
+
|
|
4
|
+
#include <flutter/dart_project.h>
|
|
5
|
+
#include <flutter/flutter_view_controller.h>
|
|
6
|
+
|
|
7
|
+
#include <memory>
|
|
8
|
+
|
|
9
|
+
#include "win32_window.h"
|
|
10
|
+
|
|
11
|
+
// A window that does nothing but host a Flutter view.
|
|
12
|
+
class FlutterWindow : public Win32Window {
|
|
13
|
+
public:
|
|
14
|
+
// Creates a new FlutterWindow hosting a Flutter view running |project|.
|
|
15
|
+
explicit FlutterWindow(const flutter::DartProject& project);
|
|
16
|
+
virtual ~FlutterWindow();
|
|
17
|
+
|
|
18
|
+
protected:
|
|
19
|
+
// Win32Window:
|
|
20
|
+
bool OnCreate() override;
|
|
21
|
+
void OnDestroy() override;
|
|
22
|
+
LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
|
|
23
|
+
LPARAM const lparam) noexcept override;
|
|
24
|
+
|
|
25
|
+
private:
|
|
26
|
+
// The project to run.
|
|
27
|
+
flutter::DartProject project_;
|
|
28
|
+
|
|
29
|
+
// The Flutter instance hosted by this window.
|
|
30
|
+
std::unique_ptr<flutter::FlutterViewController> flutter_controller_;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
#endif // RUNNER_FLUTTER_WINDOW_H_
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#include <flutter/dart_project.h>
|
|
2
|
+
#include <flutter/flutter_view_controller.h>
|
|
3
|
+
#include <windows.h>
|
|
4
|
+
|
|
5
|
+
#include "flutter_window.h"
|
|
6
|
+
#include "utils.h"
|
|
7
|
+
|
|
8
|
+
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
|
9
|
+
_In_ wchar_t *command_line, _In_ int show_command) {
|
|
10
|
+
// Attach to console when present (e.g., 'flutter run') or create a
|
|
11
|
+
// new console when running with a debugger.
|
|
12
|
+
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
|
|
13
|
+
CreateAndAttachConsole();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Initialize COM, so that it is available for use in the library and/or
|
|
17
|
+
// plugins.
|
|
18
|
+
::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
|
|
19
|
+
|
|
20
|
+
flutter::DartProject project(L"data");
|
|
21
|
+
|
|
22
|
+
std::vector<std::string> command_line_arguments =
|
|
23
|
+
GetCommandLineArguments();
|
|
24
|
+
|
|
25
|
+
project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
|
|
26
|
+
|
|
27
|
+
FlutterWindow window(project);
|
|
28
|
+
Win32Window::Point origin(10, 10);
|
|
29
|
+
Win32Window::Size size(1280, 720);
|
|
30
|
+
if (!window.CreateAndShow(L"microtex_example", origin, size)) {
|
|
31
|
+
return EXIT_FAILURE;
|
|
32
|
+
}
|
|
33
|
+
window.SetQuitOnClose(true);
|
|
34
|
+
|
|
35
|
+
::MSG msg;
|
|
36
|
+
while (::GetMessage(&msg, nullptr, 0, 0)) {
|
|
37
|
+
::TranslateMessage(&msg);
|
|
38
|
+
::DispatchMessage(&msg);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
::CoUninitialize();
|
|
42
|
+
return EXIT_SUCCESS;
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//{{NO_DEPENDENCIES}}
|
|
2
|
+
// Microsoft Visual C++ generated include file.
|
|
3
|
+
// Used by Runner.rc
|
|
4
|
+
//
|
|
5
|
+
#define IDI_APP_ICON 101
|
|
6
|
+
|
|
7
|
+
// Next default values for new objects
|
|
8
|
+
//
|
|
9
|
+
#ifdef APSTUDIO_INVOKED
|
|
10
|
+
#ifndef APSTUDIO_READONLY_SYMBOLS
|
|
11
|
+
#define _APS_NEXT_RESOURCE_VALUE 102
|
|
12
|
+
#define _APS_NEXT_COMMAND_VALUE 40001
|
|
13
|
+
#define _APS_NEXT_CONTROL_VALUE 1001
|
|
14
|
+
#define _APS_NEXT_SYMED_VALUE 101
|
|
15
|
+
#endif
|
|
16
|
+
#endif
|
|
Binary file
|
package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/runner.exe.manifest
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
|
3
|
+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
|
4
|
+
<windowsSettings>
|
|
5
|
+
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
|
|
6
|
+
</windowsSettings>
|
|
7
|
+
</application>
|
|
8
|
+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
|
9
|
+
<application>
|
|
10
|
+
<!-- Windows 10 -->
|
|
11
|
+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
|
12
|
+
<!-- Windows 8.1 -->
|
|
13
|
+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
|
14
|
+
<!-- Windows 8 -->
|
|
15
|
+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
|
16
|
+
<!-- Windows 7 -->
|
|
17
|
+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
|
18
|
+
</application>
|
|
19
|
+
</compatibility>
|
|
20
|
+
</assembly>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#include "utils.h"
|
|
2
|
+
|
|
3
|
+
#include <flutter_windows.h>
|
|
4
|
+
#include <io.h>
|
|
5
|
+
#include <stdio.h>
|
|
6
|
+
#include <windows.h>
|
|
7
|
+
|
|
8
|
+
#include <iostream>
|
|
9
|
+
|
|
10
|
+
void CreateAndAttachConsole() {
|
|
11
|
+
if (::AllocConsole()) {
|
|
12
|
+
FILE *unused;
|
|
13
|
+
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
|
|
14
|
+
_dup2(_fileno(stdout), 1);
|
|
15
|
+
}
|
|
16
|
+
if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
|
|
17
|
+
_dup2(_fileno(stdout), 2);
|
|
18
|
+
}
|
|
19
|
+
std::ios::sync_with_stdio();
|
|
20
|
+
FlutterDesktopResyncOutputStreams();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
std::vector<std::string> GetCommandLineArguments() {
|
|
25
|
+
// Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
|
|
26
|
+
int argc;
|
|
27
|
+
wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
|
|
28
|
+
if (argv == nullptr) {
|
|
29
|
+
return std::vector<std::string>();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
std::vector<std::string> command_line_arguments;
|
|
33
|
+
|
|
34
|
+
// Skip the first argument as it's the binary name.
|
|
35
|
+
for (int i = 1; i < argc; i++) {
|
|
36
|
+
command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
::LocalFree(argv);
|
|
40
|
+
|
|
41
|
+
return command_line_arguments;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
std::string Utf8FromUtf16(const wchar_t* utf16_string) {
|
|
45
|
+
if (utf16_string == nullptr) {
|
|
46
|
+
return std::string();
|
|
47
|
+
}
|
|
48
|
+
int target_length = ::WideCharToMultiByte(
|
|
49
|
+
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
|
|
50
|
+
-1, nullptr, 0, nullptr, nullptr);
|
|
51
|
+
if (target_length == 0) {
|
|
52
|
+
return std::string();
|
|
53
|
+
}
|
|
54
|
+
std::string utf8_string;
|
|
55
|
+
utf8_string.resize(target_length);
|
|
56
|
+
int converted_length = ::WideCharToMultiByte(
|
|
57
|
+
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
|
|
58
|
+
-1, utf8_string.data(),
|
|
59
|
+
target_length, nullptr, nullptr);
|
|
60
|
+
if (converted_length == 0) {
|
|
61
|
+
return std::string();
|
|
62
|
+
}
|
|
63
|
+
return utf8_string;
|
|
64
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#ifndef RUNNER_UTILS_H_
|
|
2
|
+
#define RUNNER_UTILS_H_
|
|
3
|
+
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <vector>
|
|
6
|
+
|
|
7
|
+
// Creates a console for the process, and redirects stdout and stderr to
|
|
8
|
+
// it for both the runner and the Flutter library.
|
|
9
|
+
void CreateAndAttachConsole();
|
|
10
|
+
|
|
11
|
+
// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
|
|
12
|
+
// encoded in UTF-8. Returns an empty std::string on failure.
|
|
13
|
+
std::string Utf8FromUtf16(const wchar_t* utf16_string);
|
|
14
|
+
|
|
15
|
+
// Gets the command line arguments passed in as a std::vector<std::string>,
|
|
16
|
+
// encoded in UTF-8. Returns an empty std::vector<std::string> on failure.
|
|
17
|
+
std::vector<std::string> GetCommandLineArguments();
|
|
18
|
+
|
|
19
|
+
#endif // RUNNER_UTILS_H_
|
package/native/vendor/microtex/platform/flutter/microtex/example/windows/runner/win32_window.cpp
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
#include "win32_window.h"
|
|
2
|
+
|
|
3
|
+
#include <flutter_windows.h>
|
|
4
|
+
|
|
5
|
+
#include "resource.h"
|
|
6
|
+
|
|
7
|
+
namespace {
|
|
8
|
+
|
|
9
|
+
constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
|
|
10
|
+
|
|
11
|
+
// The number of Win32Window objects that currently exist.
|
|
12
|
+
static int g_active_window_count = 0;
|
|
13
|
+
|
|
14
|
+
using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);
|
|
15
|
+
|
|
16
|
+
// Scale helper to convert logical scaler values to physical using passed in
|
|
17
|
+
// scale factor
|
|
18
|
+
int Scale(int source, double scale_factor) {
|
|
19
|
+
return static_cast<int>(source * scale_factor);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.
|
|
23
|
+
// This API is only needed for PerMonitor V1 awareness mode.
|
|
24
|
+
void EnableFullDpiSupportIfAvailable(HWND hwnd) {
|
|
25
|
+
HMODULE user32_module = LoadLibraryA("User32.dll");
|
|
26
|
+
if (!user32_module) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
auto enable_non_client_dpi_scaling =
|
|
30
|
+
reinterpret_cast<EnableNonClientDpiScaling*>(
|
|
31
|
+
GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
|
|
32
|
+
if (enable_non_client_dpi_scaling != nullptr) {
|
|
33
|
+
enable_non_client_dpi_scaling(hwnd);
|
|
34
|
+
FreeLibrary(user32_module);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
} // namespace
|
|
39
|
+
|
|
40
|
+
// Manages the Win32Window's window class registration.
|
|
41
|
+
class WindowClassRegistrar {
|
|
42
|
+
public:
|
|
43
|
+
~WindowClassRegistrar() = default;
|
|
44
|
+
|
|
45
|
+
// Returns the singleton registar instance.
|
|
46
|
+
static WindowClassRegistrar* GetInstance() {
|
|
47
|
+
if (!instance_) {
|
|
48
|
+
instance_ = new WindowClassRegistrar();
|
|
49
|
+
}
|
|
50
|
+
return instance_;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Returns the name of the window class, registering the class if it hasn't
|
|
54
|
+
// previously been registered.
|
|
55
|
+
const wchar_t* GetWindowClass();
|
|
56
|
+
|
|
57
|
+
// Unregisters the window class. Should only be called if there are no
|
|
58
|
+
// instances of the window.
|
|
59
|
+
void UnregisterWindowClass();
|
|
60
|
+
|
|
61
|
+
private:
|
|
62
|
+
WindowClassRegistrar() = default;
|
|
63
|
+
|
|
64
|
+
static WindowClassRegistrar* instance_;
|
|
65
|
+
|
|
66
|
+
bool class_registered_ = false;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;
|
|
70
|
+
|
|
71
|
+
const wchar_t* WindowClassRegistrar::GetWindowClass() {
|
|
72
|
+
if (!class_registered_) {
|
|
73
|
+
WNDCLASS window_class{};
|
|
74
|
+
window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
|
75
|
+
window_class.lpszClassName = kWindowClassName;
|
|
76
|
+
window_class.style = CS_HREDRAW | CS_VREDRAW;
|
|
77
|
+
window_class.cbClsExtra = 0;
|
|
78
|
+
window_class.cbWndExtra = 0;
|
|
79
|
+
window_class.hInstance = GetModuleHandle(nullptr);
|
|
80
|
+
window_class.hIcon =
|
|
81
|
+
LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));
|
|
82
|
+
window_class.hbrBackground = 0;
|
|
83
|
+
window_class.lpszMenuName = nullptr;
|
|
84
|
+
window_class.lpfnWndProc = Win32Window::WndProc;
|
|
85
|
+
RegisterClass(&window_class);
|
|
86
|
+
class_registered_ = true;
|
|
87
|
+
}
|
|
88
|
+
return kWindowClassName;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
void WindowClassRegistrar::UnregisterWindowClass() {
|
|
92
|
+
UnregisterClass(kWindowClassName, nullptr);
|
|
93
|
+
class_registered_ = false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
Win32Window::Win32Window() {
|
|
97
|
+
++g_active_window_count;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
Win32Window::~Win32Window() {
|
|
101
|
+
--g_active_window_count;
|
|
102
|
+
Destroy();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
bool Win32Window::CreateAndShow(const std::wstring& title,
|
|
106
|
+
const Point& origin,
|
|
107
|
+
const Size& size) {
|
|
108
|
+
Destroy();
|
|
109
|
+
|
|
110
|
+
const wchar_t* window_class =
|
|
111
|
+
WindowClassRegistrar::GetInstance()->GetWindowClass();
|
|
112
|
+
|
|
113
|
+
const POINT target_point = {static_cast<LONG>(origin.x),
|
|
114
|
+
static_cast<LONG>(origin.y)};
|
|
115
|
+
HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);
|
|
116
|
+
UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
|
|
117
|
+
double scale_factor = dpi / 96.0;
|
|
118
|
+
|
|
119
|
+
HWND window = CreateWindow(
|
|
120
|
+
window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
|
121
|
+
Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
|
|
122
|
+
Scale(size.width, scale_factor), Scale(size.height, scale_factor),
|
|
123
|
+
nullptr, nullptr, GetModuleHandle(nullptr), this);
|
|
124
|
+
|
|
125
|
+
if (!window) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return OnCreate();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// static
|
|
133
|
+
LRESULT CALLBACK Win32Window::WndProc(HWND const window,
|
|
134
|
+
UINT const message,
|
|
135
|
+
WPARAM const wparam,
|
|
136
|
+
LPARAM const lparam) noexcept {
|
|
137
|
+
if (message == WM_NCCREATE) {
|
|
138
|
+
auto window_struct = reinterpret_cast<CREATESTRUCT*>(lparam);
|
|
139
|
+
SetWindowLongPtr(window, GWLP_USERDATA,
|
|
140
|
+
reinterpret_cast<LONG_PTR>(window_struct->lpCreateParams));
|
|
141
|
+
|
|
142
|
+
auto that = static_cast<Win32Window*>(window_struct->lpCreateParams);
|
|
143
|
+
EnableFullDpiSupportIfAvailable(window);
|
|
144
|
+
that->window_handle_ = window;
|
|
145
|
+
} else if (Win32Window* that = GetThisFromHandle(window)) {
|
|
146
|
+
return that->MessageHandler(window, message, wparam, lparam);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return DefWindowProc(window, message, wparam, lparam);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
LRESULT
|
|
153
|
+
Win32Window::MessageHandler(HWND hwnd,
|
|
154
|
+
UINT const message,
|
|
155
|
+
WPARAM const wparam,
|
|
156
|
+
LPARAM const lparam) noexcept {
|
|
157
|
+
switch (message) {
|
|
158
|
+
case WM_DESTROY:
|
|
159
|
+
window_handle_ = nullptr;
|
|
160
|
+
Destroy();
|
|
161
|
+
if (quit_on_close_) {
|
|
162
|
+
PostQuitMessage(0);
|
|
163
|
+
}
|
|
164
|
+
return 0;
|
|
165
|
+
|
|
166
|
+
case WM_DPICHANGED: {
|
|
167
|
+
auto newRectSize = reinterpret_cast<RECT*>(lparam);
|
|
168
|
+
LONG newWidth = newRectSize->right - newRectSize->left;
|
|
169
|
+
LONG newHeight = newRectSize->bottom - newRectSize->top;
|
|
170
|
+
|
|
171
|
+
SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,
|
|
172
|
+
newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
|
|
173
|
+
|
|
174
|
+
return 0;
|
|
175
|
+
}
|
|
176
|
+
case WM_SIZE: {
|
|
177
|
+
RECT rect = GetClientArea();
|
|
178
|
+
if (child_content_ != nullptr) {
|
|
179
|
+
// Size and position the child window.
|
|
180
|
+
MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
|
|
181
|
+
rect.bottom - rect.top, TRUE);
|
|
182
|
+
}
|
|
183
|
+
return 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
case WM_ACTIVATE:
|
|
187
|
+
if (child_content_ != nullptr) {
|
|
188
|
+
SetFocus(child_content_);
|
|
189
|
+
}
|
|
190
|
+
return 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return DefWindowProc(window_handle_, message, wparam, lparam);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
void Win32Window::Destroy() {
|
|
197
|
+
OnDestroy();
|
|
198
|
+
|
|
199
|
+
if (window_handle_) {
|
|
200
|
+
DestroyWindow(window_handle_);
|
|
201
|
+
window_handle_ = nullptr;
|
|
202
|
+
}
|
|
203
|
+
if (g_active_window_count == 0) {
|
|
204
|
+
WindowClassRegistrar::GetInstance()->UnregisterWindowClass();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
|
|
209
|
+
return reinterpret_cast<Win32Window*>(
|
|
210
|
+
GetWindowLongPtr(window, GWLP_USERDATA));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
void Win32Window::SetChildContent(HWND content) {
|
|
214
|
+
child_content_ = content;
|
|
215
|
+
SetParent(content, window_handle_);
|
|
216
|
+
RECT frame = GetClientArea();
|
|
217
|
+
|
|
218
|
+
MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
|
|
219
|
+
frame.bottom - frame.top, true);
|
|
220
|
+
|
|
221
|
+
SetFocus(child_content_);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
RECT Win32Window::GetClientArea() {
|
|
225
|
+
RECT frame;
|
|
226
|
+
GetClientRect(window_handle_, &frame);
|
|
227
|
+
return frame;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
HWND Win32Window::GetHandle() {
|
|
231
|
+
return window_handle_;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
void Win32Window::SetQuitOnClose(bool quit_on_close) {
|
|
235
|
+
quit_on_close_ = quit_on_close;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
bool Win32Window::OnCreate() {
|
|
239
|
+
// No-op; provided for subclasses.
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
void Win32Window::OnDestroy() {
|
|
244
|
+
// No-op; provided for subclasses.
|
|
245
|
+
}
|