pumaguard 21.post29__py3-none-any.whl → 21.post83__py3-none-any.whl
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.
- pumaguard/presets.py +1 -0
- pumaguard/pumaguard-ui/.last_build_id +1 -1
- pumaguard/pumaguard-ui/assets/NOTICES +621 -71
- pumaguard/pumaguard-ui/assets/fonts/MaterialIcons-Regular.otf +0 -0
- pumaguard/pumaguard-ui/flutter_bootstrap.js +1 -1
- pumaguard/pumaguard-ui/main.dart.js +28869 -28787
- pumaguard/web_routes/dhcp.py +311 -54
- pumaguard/web_routes/diagnostics.py +6 -0
- pumaguard/web_routes/settings.py +13 -0
- pumaguard/web_ui.py +29 -0
- {pumaguard-21.post29.dist-info → pumaguard-21.post83.dist-info}/METADATA +1 -1
- pumaguard-21.post83.dist-info/RECORD +254 -0
- pumaguard-ui/.gitignore +48 -0
- pumaguard-ui/.metadata +45 -0
- pumaguard-ui/API_REFERENCE.md +717 -0
- pumaguard-ui/LICENSE +201 -0
- pumaguard-ui/Makefile +36 -0
- pumaguard-ui/README.md +371 -0
- pumaguard-ui/UI_DEVELOPMENT_CONTEXT.md +427 -0
- pumaguard-ui/analysis_options.yaml +28 -0
- pumaguard-ui/android/.gitignore +14 -0
- pumaguard-ui/android/app/build.gradle.kts +44 -0
- pumaguard-ui/android/app/src/debug/AndroidManifest.xml +7 -0
- pumaguard-ui/android/app/src/main/AndroidManifest.xml +45 -0
- pumaguard-ui/android/app/src/main/kotlin/com/example/pumaguard_ui/MainActivity.kt +5 -0
- pumaguard-ui/android/app/src/main/res/drawable/launch_background.xml +12 -0
- pumaguard-ui/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
- pumaguard-ui/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- pumaguard-ui/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- pumaguard-ui/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- pumaguard-ui/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- pumaguard-ui/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- pumaguard-ui/android/app/src/main/res/values/styles.xml +18 -0
- pumaguard-ui/android/app/src/main/res/values-night/styles.xml +18 -0
- pumaguard-ui/android/app/src/profile/AndroidManifest.xml +7 -0
- pumaguard-ui/android/build.gradle.kts +24 -0
- pumaguard-ui/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- pumaguard-ui/android/gradle.properties +2 -0
- pumaguard-ui/android/settings.gradle.kts +26 -0
- pumaguard-ui/fonts/README.md +38 -0
- pumaguard-ui/fonts/Roboto-Bold.ttf +0 -0
- pumaguard-ui/fonts/Roboto-Light.ttf +0 -0
- pumaguard-ui/fonts/Roboto-Medium.ttf +0 -0
- pumaguard-ui/fonts/Roboto-Regular.ttf +0 -0
- pumaguard-ui/fonts/RobotoMono-Bold.ttf +0 -0
- pumaguard-ui/fonts/RobotoMono-Medium.ttf +0 -0
- pumaguard-ui/fonts/RobotoMono-Regular.ttf +0 -0
- pumaguard-ui/fonts/download_fonts.sh +76 -0
- pumaguard-ui/ios/.gitignore +34 -0
- pumaguard-ui/ios/Flutter/AppFrameworkInfo.plist +26 -0
- pumaguard-ui/ios/Flutter/Debug.xcconfig +1 -0
- pumaguard-ui/ios/Flutter/Release.xcconfig +1 -0
- pumaguard-ui/ios/Runner/AppDelegate.swift +13 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
- pumaguard-ui/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
- pumaguard-ui/ios/Runner/Base.lproj/LaunchScreen.storyboard +37 -0
- pumaguard-ui/ios/Runner/Base.lproj/Main.storyboard +26 -0
- pumaguard-ui/ios/Runner/Info.plist +49 -0
- pumaguard-ui/ios/Runner/Runner-Bridging-Header.h +1 -0
- pumaguard-ui/ios/Runner.xcodeproj/project.pbxproj +616 -0
- pumaguard-ui/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- pumaguard-ui/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- pumaguard-ui/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- pumaguard-ui/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +101 -0
- pumaguard-ui/ios/Runner.xcworkspace/contents.xcworkspacedata +7 -0
- pumaguard-ui/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- pumaguard-ui/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- pumaguard-ui/ios/RunnerTests/RunnerTests.swift +12 -0
- pumaguard-ui/lib/main.dart +56 -0
- pumaguard-ui/lib/models/camera.dart +45 -0
- pumaguard-ui/lib/models/plug.dart +45 -0
- pumaguard-ui/lib/models/settings.dart +112 -0
- pumaguard-ui/lib/models/status.dart +58 -0
- pumaguard-ui/lib/screens/directories_screen.dart +319 -0
- pumaguard-ui/lib/screens/home_screen.dart +545 -0
- pumaguard-ui/lib/screens/image_browser_screen.dart +1248 -0
- pumaguard-ui/lib/screens/server_discovery_screen.dart +390 -0
- pumaguard-ui/lib/screens/settings_screen.dart +1162 -0
- pumaguard-ui/lib/screens/wifi_settings_screen.dart +671 -0
- pumaguard-ui/lib/services/api_service.dart +717 -0
- pumaguard-ui/lib/services/camera_events_service.dart +195 -0
- pumaguard-ui/lib/services/mdns_service.dart +4 -0
- pumaguard-ui/lib/services/mdns_service_impl.dart +282 -0
- pumaguard-ui/lib/services/mdns_service_io.dart +1 -0
- pumaguard-ui/lib/services/mdns_service_web.dart +106 -0
- pumaguard-ui/lib/utils/download_helper.dart +2 -0
- pumaguard-ui/lib/utils/download_helper_stub.dart +6 -0
- pumaguard-ui/lib/utils/download_helper_web.dart +14 -0
- pumaguard-ui/lib/utils/platform_url.dart +10 -0
- pumaguard-ui/lib/utils/platform_url_stub.dart +11 -0
- pumaguard-ui/lib/utils/platform_url_web.dart +16 -0
- pumaguard-ui/linux/.gitignore +1 -0
- pumaguard-ui/linux/CMakeLists.txt +128 -0
- pumaguard-ui/linux/flutter/CMakeLists.txt +88 -0
- pumaguard-ui/linux/flutter/generated_plugin_registrant.cc +15 -0
- pumaguard-ui/linux/flutter/generated_plugin_registrant.h +15 -0
- pumaguard-ui/linux/flutter/generated_plugins.cmake +24 -0
- pumaguard-ui/linux/runner/CMakeLists.txt +26 -0
- pumaguard-ui/linux/runner/main.cc +6 -0
- pumaguard-ui/linux/runner/my_application.cc +148 -0
- pumaguard-ui/linux/runner/my_application.h +21 -0
- pumaguard-ui/macos/.gitignore +7 -0
- pumaguard-ui/macos/Flutter/Flutter-Debug.xcconfig +1 -0
- pumaguard-ui/macos/Flutter/Flutter-Release.xcconfig +1 -0
- pumaguard-ui/macos/Flutter/GeneratedPluginRegistrant.swift +16 -0
- pumaguard-ui/macos/Runner/AppDelegate.swift +13 -0
- pumaguard-ui/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- pumaguard-ui/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- pumaguard-ui/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- pumaguard-ui/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- pumaguard-ui/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- pumaguard-ui/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- pumaguard-ui/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- pumaguard-ui/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- pumaguard-ui/macos/Runner/Base.lproj/MainMenu.xib +343 -0
- pumaguard-ui/macos/Runner/Configs/AppInfo.xcconfig +14 -0
- pumaguard-ui/macos/Runner/Configs/Debug.xcconfig +2 -0
- pumaguard-ui/macos/Runner/Configs/Release.xcconfig +2 -0
- pumaguard-ui/macos/Runner/Configs/Warnings.xcconfig +13 -0
- pumaguard-ui/macos/Runner/DebugProfile.entitlements +12 -0
- pumaguard-ui/macos/Runner/Info.plist +32 -0
- pumaguard-ui/macos/Runner/MainFlutterWindow.swift +15 -0
- pumaguard-ui/macos/Runner/Release.entitlements +8 -0
- pumaguard-ui/macos/Runner.xcodeproj/project.pbxproj +705 -0
- pumaguard-ui/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- pumaguard-ui/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +99 -0
- pumaguard-ui/macos/Runner.xcworkspace/contents.xcworkspacedata +7 -0
- pumaguard-ui/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- pumaguard-ui/macos/RunnerTests/RunnerTests.swift +12 -0
- pumaguard-ui/pubspec.lock +882 -0
- pumaguard-ui/pubspec.yaml +125 -0
- pumaguard-ui/test/models/camera_test.dart +515 -0
- pumaguard-ui/test/models/plug_test.dart +499 -0
- pumaguard-ui/test/models/settings_test.dart +903 -0
- pumaguard-ui/test/models/status_test.dart +707 -0
- pumaguard-ui/test/screens/image_browser_grouping_test.dart +555 -0
- pumaguard-ui/test/services/api_service_cameras_test.dart +580 -0
- pumaguard-ui/test/services/api_service_image_browser_test.dart +512 -0
- pumaguard-ui/test/widget_test.dart.skip +38 -0
- pumaguard-ui/web/favicon.png +0 -0
- pumaguard-ui/web/icons/Icon-192.png +0 -0
- pumaguard-ui/web/icons/Icon-512.png +0 -0
- pumaguard-ui/web/icons/Icon-maskable-192.png +0 -0
- pumaguard-ui/web/icons/Icon-maskable-512.png +0 -0
- pumaguard-ui/web/index.html +38 -0
- pumaguard-ui/web/manifest.json +35 -0
- pumaguard-ui/windows/.gitignore +17 -0
- pumaguard-ui/windows/CMakeLists.txt +108 -0
- pumaguard-ui/windows/flutter/CMakeLists.txt +109 -0
- pumaguard-ui/windows/flutter/generated_plugin_registrant.cc +14 -0
- pumaguard-ui/windows/flutter/generated_plugin_registrant.h +15 -0
- pumaguard-ui/windows/flutter/generated_plugins.cmake +24 -0
- pumaguard-ui/windows/runner/CMakeLists.txt +40 -0
- pumaguard-ui/windows/runner/Runner.rc +121 -0
- pumaguard-ui/windows/runner/flutter_window.cpp +71 -0
- pumaguard-ui/windows/runner/flutter_window.h +33 -0
- pumaguard-ui/windows/runner/main.cpp +43 -0
- pumaguard-ui/windows/runner/resource.h +16 -0
- pumaguard-ui/windows/runner/resources/app_icon.ico +0 -0
- pumaguard-ui/windows/runner/runner.exe.manifest +14 -0
- pumaguard-ui/windows/runner/utils.cpp +65 -0
- pumaguard-ui/windows/runner/utils.h +19 -0
- pumaguard-ui/windows/runner/win32_window.cpp +288 -0
- pumaguard-ui/windows/runner/win32_window.h +102 -0
- pumaguard-21.post29.dist-info/RECORD +0 -83
- {pumaguard-21.post29.dist-info → pumaguard-21.post83.dist-info}/WHEEL +0 -0
- {pumaguard-21.post29.dist-info → pumaguard-21.post83.dist-info}/entry_points.txt +0 -0
- {pumaguard-21.post29.dist-info → pumaguard-21.post83.dist-info}/licenses/LICENSE +0 -0
- {pumaguard-21.post29.dist-info → pumaguard-21.post83.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Project-level configuration.
|
|
2
|
+
cmake_minimum_required(VERSION 3.14)
|
|
3
|
+
project(pumaguard_ui LANGUAGES CXX)
|
|
4
|
+
|
|
5
|
+
# The name of the executable created for the application. Change this to change
|
|
6
|
+
# the on-disk name of your application.
|
|
7
|
+
set(BINARY_NAME "pumaguard_ui")
|
|
8
|
+
|
|
9
|
+
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
|
10
|
+
# versions of CMake.
|
|
11
|
+
cmake_policy(VERSION 3.14...3.25)
|
|
12
|
+
|
|
13
|
+
# Define build configuration option.
|
|
14
|
+
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
|
15
|
+
if(IS_MULTICONFIG)
|
|
16
|
+
set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
|
|
17
|
+
CACHE STRING "" FORCE)
|
|
18
|
+
else()
|
|
19
|
+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
20
|
+
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
|
21
|
+
STRING "Flutter build mode" FORCE)
|
|
22
|
+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
|
23
|
+
"Debug" "Profile" "Release")
|
|
24
|
+
endif()
|
|
25
|
+
endif()
|
|
26
|
+
# Define settings for the Profile build mode.
|
|
27
|
+
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
|
|
28
|
+
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
|
|
29
|
+
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
|
|
30
|
+
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
|
|
31
|
+
|
|
32
|
+
# Use Unicode for all projects.
|
|
33
|
+
add_definitions(-DUNICODE -D_UNICODE)
|
|
34
|
+
|
|
35
|
+
# Compilation settings that should be applied to most targets.
|
|
36
|
+
#
|
|
37
|
+
# Be cautious about adding new options here, as plugins use this function by
|
|
38
|
+
# default. In most cases, you should add new options to specific targets instead
|
|
39
|
+
# of modifying this function.
|
|
40
|
+
function(APPLY_STANDARD_SETTINGS TARGET)
|
|
41
|
+
target_compile_features(${TARGET} PUBLIC cxx_std_17)
|
|
42
|
+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
|
|
43
|
+
target_compile_options(${TARGET} PRIVATE /EHsc)
|
|
44
|
+
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
|
|
45
|
+
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
|
|
46
|
+
endfunction()
|
|
47
|
+
|
|
48
|
+
# Flutter library and tool build rules.
|
|
49
|
+
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
|
50
|
+
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
|
51
|
+
|
|
52
|
+
# Application build; see runner/CMakeLists.txt.
|
|
53
|
+
add_subdirectory("runner")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# Generated plugin build rules, which manage building the plugins and adding
|
|
57
|
+
# them to the application.
|
|
58
|
+
include(flutter/generated_plugins.cmake)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# === Installation ===
|
|
62
|
+
# Support files are copied into place next to the executable, so that it can
|
|
63
|
+
# run in place. This is done instead of making a separate bundle (as on Linux)
|
|
64
|
+
# so that building and running from within Visual Studio will work.
|
|
65
|
+
set(BUILD_BUNDLE_DIR "$<TARGET_FILE_DIR:${BINARY_NAME}>")
|
|
66
|
+
# Make the "install" step default, as it's required to run.
|
|
67
|
+
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
|
|
68
|
+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
|
69
|
+
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
|
70
|
+
endif()
|
|
71
|
+
|
|
72
|
+
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
|
73
|
+
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
|
|
74
|
+
|
|
75
|
+
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
|
76
|
+
COMPONENT Runtime)
|
|
77
|
+
|
|
78
|
+
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
|
79
|
+
COMPONENT Runtime)
|
|
80
|
+
|
|
81
|
+
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
82
|
+
COMPONENT Runtime)
|
|
83
|
+
|
|
84
|
+
if(PLUGIN_BUNDLED_LIBRARIES)
|
|
85
|
+
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
|
|
86
|
+
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
87
|
+
COMPONENT Runtime)
|
|
88
|
+
endif()
|
|
89
|
+
|
|
90
|
+
# Copy the native assets provided by the build.dart from all packages.
|
|
91
|
+
set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")
|
|
92
|
+
install(DIRECTORY "${NATIVE_ASSETS_DIR}"
|
|
93
|
+
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
|
94
|
+
COMPONENT Runtime)
|
|
95
|
+
|
|
96
|
+
# Fully re-copy the assets directory on each build to avoid having stale files
|
|
97
|
+
# from a previous install.
|
|
98
|
+
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
|
|
99
|
+
install(CODE "
|
|
100
|
+
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
|
|
101
|
+
" COMPONENT Runtime)
|
|
102
|
+
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
|
|
103
|
+
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
|
|
104
|
+
|
|
105
|
+
# Install the AOT library on non-Debug builds only.
|
|
106
|
+
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
|
107
|
+
CONFIGURATIONS Profile;Release
|
|
108
|
+
COMPONENT Runtime)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# This file controls Flutter-level build steps. It should not be edited.
|
|
2
|
+
cmake_minimum_required(VERSION 3.14)
|
|
3
|
+
|
|
4
|
+
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
|
5
|
+
|
|
6
|
+
# Configuration provided via flutter tool.
|
|
7
|
+
include(${EPHEMERAL_DIR}/generated_config.cmake)
|
|
8
|
+
|
|
9
|
+
# TODO: Move the rest of this into files in ephemeral. See
|
|
10
|
+
# https://github.com/flutter/flutter/issues/57146.
|
|
11
|
+
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
|
|
12
|
+
|
|
13
|
+
# Set fallback configurations for older versions of the flutter tool.
|
|
14
|
+
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
|
|
15
|
+
set(FLUTTER_TARGET_PLATFORM "windows-x64")
|
|
16
|
+
endif()
|
|
17
|
+
|
|
18
|
+
# === Flutter Library ===
|
|
19
|
+
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
|
|
20
|
+
|
|
21
|
+
# Published to parent scope for install step.
|
|
22
|
+
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
|
23
|
+
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
|
24
|
+
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
|
25
|
+
set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
|
|
26
|
+
|
|
27
|
+
list(APPEND FLUTTER_LIBRARY_HEADERS
|
|
28
|
+
"flutter_export.h"
|
|
29
|
+
"flutter_windows.h"
|
|
30
|
+
"flutter_messenger.h"
|
|
31
|
+
"flutter_plugin_registrar.h"
|
|
32
|
+
"flutter_texture_registrar.h"
|
|
33
|
+
)
|
|
34
|
+
list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
|
|
35
|
+
add_library(flutter INTERFACE)
|
|
36
|
+
target_include_directories(flutter INTERFACE
|
|
37
|
+
"${EPHEMERAL_DIR}"
|
|
38
|
+
)
|
|
39
|
+
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
|
|
40
|
+
add_dependencies(flutter flutter_assemble)
|
|
41
|
+
|
|
42
|
+
# === Wrapper ===
|
|
43
|
+
list(APPEND CPP_WRAPPER_SOURCES_CORE
|
|
44
|
+
"core_implementations.cc"
|
|
45
|
+
"standard_codec.cc"
|
|
46
|
+
)
|
|
47
|
+
list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
|
|
48
|
+
list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
|
|
49
|
+
"plugin_registrar.cc"
|
|
50
|
+
)
|
|
51
|
+
list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
|
|
52
|
+
list(APPEND CPP_WRAPPER_SOURCES_APP
|
|
53
|
+
"flutter_engine.cc"
|
|
54
|
+
"flutter_view_controller.cc"
|
|
55
|
+
)
|
|
56
|
+
list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
|
|
57
|
+
|
|
58
|
+
# Wrapper sources needed for a plugin.
|
|
59
|
+
add_library(flutter_wrapper_plugin STATIC
|
|
60
|
+
${CPP_WRAPPER_SOURCES_CORE}
|
|
61
|
+
${CPP_WRAPPER_SOURCES_PLUGIN}
|
|
62
|
+
)
|
|
63
|
+
apply_standard_settings(flutter_wrapper_plugin)
|
|
64
|
+
set_target_properties(flutter_wrapper_plugin PROPERTIES
|
|
65
|
+
POSITION_INDEPENDENT_CODE ON)
|
|
66
|
+
set_target_properties(flutter_wrapper_plugin PROPERTIES
|
|
67
|
+
CXX_VISIBILITY_PRESET hidden)
|
|
68
|
+
target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
|
|
69
|
+
target_include_directories(flutter_wrapper_plugin PUBLIC
|
|
70
|
+
"${WRAPPER_ROOT}/include"
|
|
71
|
+
)
|
|
72
|
+
add_dependencies(flutter_wrapper_plugin flutter_assemble)
|
|
73
|
+
|
|
74
|
+
# Wrapper sources needed for the runner.
|
|
75
|
+
add_library(flutter_wrapper_app STATIC
|
|
76
|
+
${CPP_WRAPPER_SOURCES_CORE}
|
|
77
|
+
${CPP_WRAPPER_SOURCES_APP}
|
|
78
|
+
)
|
|
79
|
+
apply_standard_settings(flutter_wrapper_app)
|
|
80
|
+
target_link_libraries(flutter_wrapper_app PUBLIC flutter)
|
|
81
|
+
target_include_directories(flutter_wrapper_app PUBLIC
|
|
82
|
+
"${WRAPPER_ROOT}/include"
|
|
83
|
+
)
|
|
84
|
+
add_dependencies(flutter_wrapper_app flutter_assemble)
|
|
85
|
+
|
|
86
|
+
# === Flutter tool backend ===
|
|
87
|
+
# _phony_ is a non-existent file to force this command to run every time,
|
|
88
|
+
# since currently there's no way to get a full input/output list from the
|
|
89
|
+
# flutter tool.
|
|
90
|
+
set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
|
|
91
|
+
set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
|
|
92
|
+
add_custom_command(
|
|
93
|
+
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
|
|
94
|
+
${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
|
|
95
|
+
${CPP_WRAPPER_SOURCES_APP}
|
|
96
|
+
${PHONY_OUTPUT}
|
|
97
|
+
COMMAND ${CMAKE_COMMAND} -E env
|
|
98
|
+
${FLUTTER_TOOL_ENVIRONMENT}
|
|
99
|
+
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
|
|
100
|
+
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
|
|
101
|
+
VERBATIM
|
|
102
|
+
)
|
|
103
|
+
add_custom_target(flutter_assemble DEPENDS
|
|
104
|
+
"${FLUTTER_LIBRARY}"
|
|
105
|
+
${FLUTTER_LIBRARY_HEADERS}
|
|
106
|
+
${CPP_WRAPPER_SOURCES_CORE}
|
|
107
|
+
${CPP_WRAPPER_SOURCES_PLUGIN}
|
|
108
|
+
${CPP_WRAPPER_SOURCES_APP}
|
|
109
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Generated file. Do not edit.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// clang-format off
|
|
6
|
+
|
|
7
|
+
#include "generated_plugin_registrant.h"
|
|
8
|
+
|
|
9
|
+
#include <url_launcher_windows/url_launcher_windows.h>
|
|
10
|
+
|
|
11
|
+
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|
12
|
+
UrlLauncherWindowsRegisterWithRegistrar(
|
|
13
|
+
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Generated file. Do not edit.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// clang-format off
|
|
6
|
+
|
|
7
|
+
#ifndef GENERATED_PLUGIN_REGISTRANT_
|
|
8
|
+
#define GENERATED_PLUGIN_REGISTRANT_
|
|
9
|
+
|
|
10
|
+
#include <flutter/plugin_registry.h>
|
|
11
|
+
|
|
12
|
+
// Registers Flutter plugins.
|
|
13
|
+
void RegisterPlugins(flutter::PluginRegistry* registry);
|
|
14
|
+
|
|
15
|
+
#endif // GENERATED_PLUGIN_REGISTRANT_
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Generated file, do not edit.
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
list(APPEND FLUTTER_PLUGIN_LIST
|
|
6
|
+
url_launcher_windows
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
set(PLUGIN_BUNDLED_LIBRARIES)
|
|
13
|
+
|
|
14
|
+
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
|
15
|
+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
|
|
16
|
+
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
|
|
17
|
+
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
|
18
|
+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
|
19
|
+
endforeach(plugin)
|
|
20
|
+
|
|
21
|
+
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
|
22
|
+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
|
|
23
|
+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
|
24
|
+
endforeach(ffi_plugin)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.14)
|
|
2
|
+
project(runner LANGUAGES CXX)
|
|
3
|
+
|
|
4
|
+
# Define the application target. To change its name, change BINARY_NAME in the
|
|
5
|
+
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
|
|
6
|
+
# work.
|
|
7
|
+
#
|
|
8
|
+
# Any new source files that you add to the application should be added here.
|
|
9
|
+
add_executable(${BINARY_NAME} WIN32
|
|
10
|
+
"flutter_window.cpp"
|
|
11
|
+
"main.cpp"
|
|
12
|
+
"utils.cpp"
|
|
13
|
+
"win32_window.cpp"
|
|
14
|
+
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
|
15
|
+
"Runner.rc"
|
|
16
|
+
"runner.exe.manifest"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
# Apply the standard set of build settings. This can be removed for applications
|
|
20
|
+
# that need different build settings.
|
|
21
|
+
apply_standard_settings(${BINARY_NAME})
|
|
22
|
+
|
|
23
|
+
# Add preprocessor definitions for the build version.
|
|
24
|
+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
|
|
25
|
+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
|
|
26
|
+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
|
|
27
|
+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
|
|
28
|
+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
|
|
29
|
+
|
|
30
|
+
# Disable Windows macros that collide with C++ standard library functions.
|
|
31
|
+
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
|
|
32
|
+
|
|
33
|
+
# Add dependency libraries and include directories. Add any application-specific
|
|
34
|
+
# dependencies here.
|
|
35
|
+
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
|
|
36
|
+
target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
|
|
37
|
+
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
|
38
|
+
|
|
39
|
+
# Run the Flutter tool portions of the build. This must not be removed.
|
|
40
|
+
add_dependencies(${BINARY_NAME} flutter_assemble)
|
|
@@ -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
|
+
#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
|
|
64
|
+
#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
|
|
65
|
+
#else
|
|
66
|
+
#define VERSION_AS_NUMBER 1,0,0,0
|
|
67
|
+
#endif
|
|
68
|
+
|
|
69
|
+
#if defined(FLUTTER_VERSION)
|
|
70
|
+
#define VERSION_AS_STRING FLUTTER_VERSION
|
|
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", "com.example" "\0"
|
|
93
|
+
VALUE "FileDescription", "pumaguard_ui" "\0"
|
|
94
|
+
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
|
95
|
+
VALUE "InternalName", "pumaguard_ui" "\0"
|
|
96
|
+
VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0"
|
|
97
|
+
VALUE "OriginalFilename", "pumaguard_ui.exe" "\0"
|
|
98
|
+
VALUE "ProductName", "pumaguard_ui" "\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
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
|
|
30
|
+
flutter_controller_->engine()->SetNextFrameCallback([&]() {
|
|
31
|
+
this->Show();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Flutter can complete the first frame before the "show window" callback is
|
|
35
|
+
// registered. The following call ensures a frame is pending to ensure the
|
|
36
|
+
// window is shown. It is a no-op if the first frame hasn't completed yet.
|
|
37
|
+
flutter_controller_->ForceRedraw();
|
|
38
|
+
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
void FlutterWindow::OnDestroy() {
|
|
43
|
+
if (flutter_controller_) {
|
|
44
|
+
flutter_controller_ = nullptr;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Win32Window::OnDestroy();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
LRESULT
|
|
51
|
+
FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
|
|
52
|
+
WPARAM const wparam,
|
|
53
|
+
LPARAM const lparam) noexcept {
|
|
54
|
+
// Give Flutter, including plugins, an opportunity to handle window messages.
|
|
55
|
+
if (flutter_controller_) {
|
|
56
|
+
std::optional<LRESULT> result =
|
|
57
|
+
flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
|
|
58
|
+
lparam);
|
|
59
|
+
if (result) {
|
|
60
|
+
return *result;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
switch (message) {
|
|
65
|
+
case WM_FONTCHANGE:
|
|
66
|
+
flutter_controller_->engine()->ReloadSystemFonts();
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
|
|
71
|
+
}
|
|
@@ -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.Create(L"pumaguard_ui", 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
|
|
@@ -0,0 +1,14 @@
|
|
|
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 and Windows 11 -->
|
|
11
|
+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
|
12
|
+
</application>
|
|
13
|
+
</compatibility>
|
|
14
|
+
</assembly>
|