├── README.md └── starflut ├── .gitignore ├── .idea ├── .gitignore ├── codeStyles │ └── Project.xml ├── libraries │ ├── Dart_SDK.xml │ └── Flutter_Plugins.xml ├── misc.xml ├── modules.xml ├── runConfigurations │ └── example_lib_main_dart.xml └── workspace.xml ├── .metadata ├── .vscode ├── launch.json └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── libs │ └── starcore_android_r3.76.jar ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── srplab │ │ └── starflut │ │ └── StarflutPlugin.java │ └── jniLibs │ ├── arm64-v8a │ ├── libstar_java.so │ └── libstarcore.so │ ├── armeabi-v7a │ ├── libstar_java.so │ └── libstarcore.so │ ├── armeabi │ ├── libstar_java.so │ └── libstarcore.so │ ├── x86 │ ├── libstar_java.so │ └── libstarcore.so │ └── x86_64 │ ├── libstar_java.so │ └── libstarcore.so ├── example ├── .gitignore ├── .metadata ├── .vscode │ ├── launch.json │ └── settings.json ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ │ ├── arm64-v8a │ │ │ │ │ ├── unicodedata.cpython-39.so │ │ │ │ │ └── zlib.cpython-39.so │ │ │ │ ├── armeabi │ │ │ │ │ ├── unicodedata.cpython-39.so │ │ │ │ │ └── zlib.cpython-39.so │ │ │ │ ├── python3.9.zip │ │ │ │ ├── x86 │ │ │ │ │ ├── unicodedata.cpython-39.so │ │ │ │ │ └── zlib.cpython-39.so │ │ │ │ └── x86_64 │ │ │ │ │ ├── unicodedata.cpython-39.so │ │ │ │ │ └── zlib.cpython-39.so │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── srplab │ │ │ │ │ └── starflut_example │ │ │ │ │ └── MainActivity.java │ │ │ ├── jniLibs │ │ │ │ ├── armeabi │ │ │ │ │ ├── libpython3.9.so │ │ │ │ │ ├── libruby.so │ │ │ │ │ ├── libstar_python39.so │ │ │ │ │ └── libstar_ruby.so │ │ │ │ └── x86 │ │ │ │ │ ├── libpython3.9.so │ │ │ │ │ ├── libruby.so │ │ │ │ │ ├── libstar_python39.so │ │ │ │ │ └── libstar_ruby.so │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── linux │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ ├── main.cc │ ├── my_application.cc │ ├── my_application.h │ └── starcore │ │ └── libstar_python39.so ├── macos │ ├── .gitignore │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── app_icon_1024.png │ │ │ │ ├── app_icon_128.png │ │ │ │ ├── app_icon_16.png │ │ │ │ ├── app_icon_256.png │ │ │ │ ├── app_icon_32.png │ │ │ │ ├── app_icon_512.png │ │ │ │ └── app_icon_64.png │ │ ├── Base.lproj │ │ │ └── MainMenu.xib │ │ ├── Configs │ │ │ ├── AppInfo.xcconfig │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ └── Warnings.xcconfig │ │ ├── DebugProfile.entitlements │ │ ├── Info.plist │ │ ├── MainFlutterWindow.swift │ │ └── Release.entitlements │ └── starcore │ │ ├── libpython3.9.dylib │ │ ├── libruby.2.5.1.dylib │ │ ├── libstar_python39.so │ │ └── libstar_ruby.bundle ├── pubspec.lock ├── pubspec.yaml ├── starfiles │ ├── mymath.lua │ ├── testcallback.py │ ├── testcallback.rb │ └── testpy.py ├── test │ └── widget_test.dart └── windows │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake │ ├── runner │ ├── CMakeLists.txt │ ├── Runner.rc │ ├── flutter_window.cpp │ ├── flutter_window.h │ ├── main.cpp │ ├── resource.h │ ├── resources │ │ └── app_icon.ico │ ├── run_loop.cpp │ ├── run_loop.h │ ├── runner.exe.manifest │ ├── utils.cpp │ ├── utils.h │ ├── win32_window.cpp │ └── win32_window.h │ └── starcore │ └── libstar_python39.pyd ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── StarflutPlugin.h │ ├── StarflutPlugin.m │ ├── SwiftStarflutPlugin.swift │ ├── starflut_plugin_common.h │ └── starflut_plugin_common.mm └── starflut.podspec ├── lib └── starflut.dart ├── linux ├── CMakeLists.txt ├── include │ ├── starcore │ │ ├── lua │ │ │ ├── lauxlib.h │ │ │ ├── lua.h │ │ │ ├── luaconf.h │ │ │ └── lualib.h │ │ ├── vs_shell.h │ │ ├── vscoreshell.h │ │ ├── vsopenapi.h │ │ ├── vsopenapi_c.h │ │ ├── vsopencommtype.h │ │ ├── vsopencoredll.h │ │ ├── vsopendatatype.h │ │ ├── vsopenmemorydisk.h │ │ ├── vsopennetlink.h │ │ └── vsopensyseventdef.h │ └── starflut │ │ └── starflut_plugin.h ├── libstarlib.a ├── starcore │ └── libstarcore.so ├── starflut_plugin.cc └── starflut_plugin_common.cpp ├── macos ├── Classes │ ├── StarflutPlugin.swift │ ├── starflut_plugin_common.h │ └── starflut_plugin_common.mm ├── include │ └── starcore │ │ ├── lua │ │ ├── lauxlib.h │ │ ├── lua.h │ │ ├── luaconf.h │ │ └── lualib.h │ │ ├── vs_shell.h │ │ ├── vscoreshell.h │ │ ├── vsopenapi.h │ │ ├── vsopenapi_c.h │ │ ├── vsopencommtype.h │ │ ├── vsopencoredll.h │ │ ├── vsopendatatype.h │ │ ├── vsopenmemorydisk.h │ │ ├── vsopennetlink.h │ │ └── vsopensyseventdef.h ├── libstarlib.a ├── starcore │ └── libstarcore.dylib └── starflut.podspec ├── pubspec.lock ├── pubspec.yaml ├── starflut.iml ├── test └── starflut_test.dart └── windows ├── .gitignore ├── CMakeLists.txt ├── include ├── starcore │ ├── lua │ │ ├── lauxlib.h │ │ ├── lua.h │ │ ├── luaconf.h │ │ └── lualib.h │ ├── vs_shell.h │ ├── vscoreshell.h │ ├── vsopenapi.h │ ├── vsopenapi_c.h │ ├── vsopencommtype.h │ ├── vsopencoredll.h │ ├── vsopendatatype.h │ ├── vsopenmemorydisk.h │ ├── vsopennetlink.h │ └── vsopensyseventdef.h └── starflut │ └── starflut_plugin.h ├── md5proc.cpp ├── md5proc.h ├── srplib_main.cpp ├── starcore └── libstarcore.dll ├── starflut_plugin.cpp ├── starflut_plugin_common.cpp └── vs_shell.c /starflut/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | -------------------------------------------------------------------------------- /starflut/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /starflut/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /starflut/.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /starflut/.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starflut/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 26 | 45 | 46 | 47 | 48 | 50 | -------------------------------------------------------------------------------- /starflut/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /starflut/.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /starflut/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: bf2c9dfc05a6d281e7d303689f1af9add4030230 8 | channel: master 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /starflut/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | 8 | { 9 | "name": "(gdb) Attach", 10 | "type": "cppdbg", 11 | "request": "launch", 12 | "cwd": ".", 13 | /*"program": "/home/srplab/Desktop/flutter.study/starflut/example/build/linux/debug/bundle/starflut_example",*/ 14 | "program": "C:/Users/srpla/Desktop/flutter.study/starflut/example/build/windows/runner/Debug/starflut_example.exe", 15 | "MIMode": "gdb", 16 | "setupCommands": [ 17 | { 18 | "description": "Enable pretty-printing for gdb", 19 | "text": "-enable-pretty-printing", 20 | "ignoreFailures": true 21 | } 22 | ] 23 | }, 24 | { 25 | "name": "starflut", 26 | "request": "launch", 27 | "type": "dart" 28 | }, 29 | { 30 | "name": "example", 31 | "cwd": "example", 32 | "request": "launch", 33 | "type": "dart", 34 | "flutterMode": "debug" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /starflut/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.sourceDirectory": "${workspaceFolder}/linux", 3 | "files.associations": { 4 | "system_error": "cpp", 5 | "functional": "cpp" 6 | } 7 | } -------------------------------------------------------------------------------- /starflut/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * supports flutter to interact with other scripting languages such as python, java, ruby, golang, rust, etc. It is easy to use, supports android, ios, and desktop 4 | 5 | ## 0.9.0 6 | 7 | * add support for macos,windows,linux 8 | * add more interface functions. 9 | 10 | ## 0.9.1 11 | 12 | * setShareLibraryPath need not be called on linux 13 | * fix deadlock problem of linux/ios/macos 14 | 15 | ## 0.9.5 16 | 17 | * add functions for StarBinBufClass : setOffset, print, asString 18 | * enable call starflut functions in callback 19 | 20 | ## 1.0.0 21 | 22 | * To link with the static frameworks for ios, add STARCORE_FRAMEWORK and STARCORE_FRAMEWORKPATH environment variables to the podspec 23 | * Fix the bug of StarSrvGroup.newParaPkg(null) 24 | * For object's "call" function, if the object is a python, lua or ruby function, then funcName should be null, and, when call class's construct function, funcName should be null 25 | * Add two functions "setEnv" and "getEnv" for Android 26 | * Delete "pushLocalFrame" and "popLocalFrame", and, add functions "newLocalFrame", "freeLocalFrame" 27 | * Add "moveTo" function to starflut object, such as StarServiceClass, StarObjectClass,..., which is used to move the object to other local frame 28 | * Modify the following functions: newParaPkg, createService, newBinBuf, getObject, getObjectEx, newObject, newRawProxy, importRawContext, allObject, restfulCall, add parameters "FrameTag", the FrameTag maybe null. 29 | * Add parameter "FrameTag" for object's callback function StarObjectScriptProc 30 | * Adds version constants : Major_Version, Minor_Version, Build_Version, and string constant "Version" to Starflut 31 | * Adds gc function to Starflut: After running freeLocalFrame, the gc function may be called to release the cle object 32 | * upgrade cle to v3.7.6 33 | 34 | -------------------------------------------------------------------------------- /starflut/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020, srplab 4 | All rights reserved. 5 | -------------------------------------------------------------------------------- /starflut/README.md: -------------------------------------------------------------------------------- 1 | # starflut 2 | 3 | A new Flutter plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter 8 | [plug-in package](https://flutter.dev/developing-packages/), 9 | a specialized package that includes platform-specific implementation code for 10 | Android and/or iOS. 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | 16 | -------------------------------------------------------------------------------- /starflut/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /starflut/android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.srplab.starflut' 2 | version '1.0' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | compileSdkVersion 29 26 | 27 | defaultConfig { 28 | minSdkVersion 16 29 | } 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | } 34 | 35 | dependencies { 36 | implementation files('libs/starcore_android_r3.76.jar') 37 | } 38 | -------------------------------------------------------------------------------- /starflut/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /starflut/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip -------------------------------------------------------------------------------- /starflut/android/libs/starcore_android_r3.76.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/libs/starcore_android_r3.76.jar -------------------------------------------------------------------------------- /starflut/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'starflut' 2 | -------------------------------------------------------------------------------- /starflut/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/arm64-v8a/libstar_java.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/arm64-v8a/libstar_java.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/arm64-v8a/libstarcore.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/arm64-v8a/libstarcore.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/armeabi-v7a/libstar_java.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/armeabi-v7a/libstar_java.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/armeabi-v7a/libstarcore.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/armeabi-v7a/libstarcore.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/armeabi/libstar_java.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/armeabi/libstar_java.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/armeabi/libstarcore.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/armeabi/libstarcore.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/x86/libstar_java.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/x86/libstar_java.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/x86/libstarcore.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/x86/libstarcore.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/x86_64/libstar_java.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/x86_64/libstar_java.so -------------------------------------------------------------------------------- /starflut/android/src/main/jniLibs/x86_64/libstarcore.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/android/src/main/jniLibs/x86_64/libstarcore.so -------------------------------------------------------------------------------- /starflut/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /starflut/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: bf2c9dfc05a6d281e7d303689f1af9add4030230 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /starflut/example/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "(gdb) Launch", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "/home/srplab/Desktop/flutter.study/example/build/linux/debug/bundle/starflut_example", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "${workspaceFolder}", 15 | "environment": [], 16 | "externalConsole": false, 17 | "MIMode": "gdb", 18 | "setupCommands": [ 19 | { 20 | "description": "Enable pretty-printing for gdb", 21 | "text": "-enable-pretty-printing", 22 | "ignoreFailures": true 23 | } 24 | ] 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /starflut/example/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "system_error": "cpp" 4 | } 5 | } -------------------------------------------------------------------------------- /starflut/example/README.md: -------------------------------------------------------------------------------- 1 | # starflut_example 2 | 3 | Demonstrates how to use the starflut plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /starflut/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /starflut/example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 29 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.srplab.starflut_example" 37 | minSdkVersion 16 38 | targetSdkVersion 29 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | } 42 | 43 | buildTypes { 44 | release { 45 | // TODO: Add your own signing config for the release build. 46 | // Signing with the debug keys for now, so `flutter run --release` works. 47 | signingConfig signingConfigs.debug 48 | } 49 | } 50 | } 51 | 52 | flutter { 53 | source '../..' 54 | } 55 | -------------------------------------------------------------------------------- /starflut/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/arm64-v8a/unicodedata.cpython-39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/arm64-v8a/unicodedata.cpython-39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/arm64-v8a/zlib.cpython-39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/arm64-v8a/zlib.cpython-39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/armeabi/unicodedata.cpython-39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/armeabi/unicodedata.cpython-39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/armeabi/zlib.cpython-39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/armeabi/zlib.cpython-39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/python3.9.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/python3.9.zip -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/x86/unicodedata.cpython-39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/x86/unicodedata.cpython-39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/x86/zlib.cpython-39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/x86/zlib.cpython-39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/x86_64/unicodedata.cpython-39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/x86_64/unicodedata.cpython-39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/assets/x86_64/zlib.cpython-39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/assets/x86_64/zlib.cpython-39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/java/com/srplab/starflut_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.srplab.starflut_example; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | public class MainActivity extends FlutterActivity { 6 | } 7 | -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/jniLibs/armeabi/libpython3.9.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/jniLibs/armeabi/libpython3.9.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/jniLibs/armeabi/libruby.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/jniLibs/armeabi/libruby.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/jniLibs/armeabi/libstar_python39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/jniLibs/armeabi/libstar_python39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/jniLibs/armeabi/libstar_ruby.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/jniLibs/armeabi/libstar_ruby.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/jniLibs/x86/libpython3.9.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/jniLibs/x86/libpython3.9.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/jniLibs/x86/libruby.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/jniLibs/x86/libruby.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/jniLibs/x86/libstar_python39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/jniLibs/x86/libstar_python39.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/jniLibs/x86/libstar_ruby.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/jniLibs/x86/libstar_ruby.so -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /starflut/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /starflut/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /starflut/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /starflut/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.enableR8=true 5 | -------------------------------------------------------------------------------- /starflut/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /starflut/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /starflut/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /starflut/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /starflut/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /starflut/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /starflut/example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 33 | end 34 | 35 | post_install do |installer| 36 | installer.pods_project.targets.each do |target| 37 | flutter_additional_ios_build_settings(target) 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /starflut/example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - starflut (1.0.0): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `Flutter`) 8 | - starflut (from `.symlinks/plugins/starflut/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: Flutter 13 | starflut: 14 | :path: ".symlinks/plugins/starflut/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c 18 | starflut: 7deb69d67aa5d5ebcb6e5c7c4a05a2daa3b00df0 19 | 20 | PODFILE CHECKSUM: 124871c13717f2388253dcfb709d8627f84a282d 21 | 22 | COCOAPODS: 1.10.0 23 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | starflut_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /starflut/example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /starflut/example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /starflut/example/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(runner LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "starflut_example") 5 | set(APPLICATION_ID "com.srplab.starflut") 6 | 7 | cmake_policy(SET CMP0063 NEW) 8 | 9 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 10 | 11 | # Configure build options. 12 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 13 | set(CMAKE_BUILD_TYPE "Debug" CACHE 14 | STRING "Flutter build mode" FORCE) 15 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 16 | "Debug" "Profile" "Release") 17 | endif() 18 | 19 | # Compilation settings that should be applied to most targets. 20 | function(APPLY_STANDARD_SETTINGS TARGET) 21 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 22 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 23 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 24 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 25 | endfunction() 26 | 27 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 28 | 29 | # Flutter library and tool build rules. 30 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 31 | 32 | # System-level dependencies. 33 | find_package(PkgConfig REQUIRED) 34 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 35 | 36 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 37 | 38 | # Application build 39 | add_executable(${BINARY_NAME} 40 | "main.cc" 41 | "my_application.cc" 42 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 43 | ) 44 | apply_standard_settings(${BINARY_NAME}) 45 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 46 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 47 | add_dependencies(${BINARY_NAME} flutter_assemble) 48 | # Only the install-generated bundle's copy of the executable will launch 49 | # correctly, since the resources must in the right relative locations. To avoid 50 | # people trying to run the unbundled copy, put it in a subdirectory instead of 51 | # the default top-level location. 52 | set_target_properties(${BINARY_NAME} 53 | PROPERTIES 54 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 55 | ) 56 | 57 | # Generated plugin build rules, which manage building the plugins and adding 58 | # them to the application. 59 | include(flutter/generated_plugins.cmake) 60 | 61 | 62 | # === Installation === 63 | # By default, "installing" just makes a relocatable bundle in the build 64 | # directory. 65 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 66 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 67 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 68 | endif() 69 | 70 | # Start with a clean build bundle directory every time. 71 | install(CODE " 72 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 73 | " COMPONENT Runtime) 74 | 75 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 76 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 77 | 78 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 79 | COMPONENT Runtime) 80 | 81 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 82 | COMPONENT Runtime) 83 | 84 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 85 | COMPONENT Runtime) 86 | 87 | # add by starcore 88 | install(FILES "starcore/libstar_python39.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 89 | COMPONENT Runtime) 90 | 91 | if(PLUGIN_BUNDLED_LIBRARIES) 92 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 93 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 94 | COMPONENT Runtime) 95 | endif() 96 | 97 | # Fully re-copy the assets directory on each build to avoid having stale files 98 | # from a previous install. 99 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 100 | install(CODE " 101 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 102 | " COMPONENT Runtime) 103 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 104 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 105 | 106 | # Install the AOT library on non-Debug builds only. 107 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 108 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 109 | COMPONENT Runtime) 110 | endif() 111 | -------------------------------------------------------------------------------- /starflut/example/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | 11 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 12 | # which isn't available in 3.10. 13 | function(list_prepend LIST_NAME PREFIX) 14 | set(NEW_LIST "") 15 | foreach(element ${${LIST_NAME}}) 16 | list(APPEND NEW_LIST "${PREFIX}${element}") 17 | endforeach(element) 18 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 19 | endfunction() 20 | 21 | # === Flutter Library === 22 | # System-level dependencies. 23 | find_package(PkgConfig REQUIRED) 24 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 25 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 26 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 27 | pkg_check_modules(BLKID REQUIRED IMPORTED_TARGET blkid) 28 | pkg_check_modules(LZMA REQUIRED IMPORTED_TARGET liblzma) 29 | 30 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 31 | 32 | # Published to parent scope for install step. 33 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 34 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 35 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 36 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 37 | 38 | list(APPEND FLUTTER_LIBRARY_HEADERS 39 | "fl_basic_message_channel.h" 40 | "fl_binary_codec.h" 41 | "fl_binary_messenger.h" 42 | "fl_dart_project.h" 43 | "fl_engine.h" 44 | "fl_json_message_codec.h" 45 | "fl_json_method_codec.h" 46 | "fl_message_codec.h" 47 | "fl_method_call.h" 48 | "fl_method_channel.h" 49 | "fl_method_codec.h" 50 | "fl_method_response.h" 51 | "fl_plugin_registrar.h" 52 | "fl_plugin_registry.h" 53 | "fl_standard_message_codec.h" 54 | "fl_standard_method_codec.h" 55 | "fl_string_codec.h" 56 | "fl_value.h" 57 | "fl_view.h" 58 | "flutter_linux.h" 59 | ) 60 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 61 | add_library(flutter INTERFACE) 62 | target_include_directories(flutter INTERFACE 63 | "${EPHEMERAL_DIR}" 64 | ) 65 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 66 | target_link_libraries(flutter INTERFACE 67 | PkgConfig::GTK 68 | PkgConfig::GLIB 69 | PkgConfig::GIO 70 | PkgConfig::BLKID 71 | PkgConfig::LZMA 72 | ) 73 | add_dependencies(flutter flutter_assemble) 74 | 75 | # === Flutter tool backend === 76 | # _phony_ is a non-existent file to force this command to run every time, 77 | # since currently there's no way to get a full input/output list from the 78 | # flutter tool. 79 | add_custom_command( 80 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 81 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 82 | COMMAND ${CMAKE_COMMAND} -E env 83 | ${FLUTTER_TOOL_ENVIRONMENT} 84 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 85 | linux-x64 ${CMAKE_BUILD_TYPE} 86 | ) 87 | add_custom_target(flutter_assemble DEPENDS 88 | "${FLUTTER_LIBRARY}" 89 | ${FLUTTER_LIBRARY_HEADERS} 90 | ) 91 | -------------------------------------------------------------------------------- /starflut/example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #include "generated_plugin_registrant.h" 6 | 7 | #include 8 | 9 | void fl_register_plugins(FlPluginRegistry* registry) { 10 | g_autoptr(FlPluginRegistrar) starflut_registrar = 11 | fl_plugin_registry_get_registrar_for_plugin(registry, "StarflutPlugin"); 12 | starflut_plugin_register_with_registrar(starflut_registrar); 13 | } 14 | -------------------------------------------------------------------------------- /starflut/example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 6 | #define GENERATED_PLUGIN_REGISTRANT_ 7 | 8 | #include 9 | 10 | // Registers Flutter plugins. 11 | void fl_register_plugins(FlPluginRegistry* registry); 12 | 13 | #endif // GENERATED_PLUGIN_REGISTRANT_ 14 | -------------------------------------------------------------------------------- /starflut/example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | starflut 7 | ) 8 | 9 | set(PLUGIN_BUNDLED_LIBRARIES) 10 | 11 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 12 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 13 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 15 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 16 | endforeach(plugin) 17 | -------------------------------------------------------------------------------- /starflut/example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /starflut/example/linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen *screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "starflut_example"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } 47 | else { 48 | gtk_window_set_title(window, "starflut_example"); 49 | } 50 | 51 | gtk_window_set_default_size(window, 1280, 720); 52 | gtk_widget_show(GTK_WIDGET(window)); 53 | 54 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 55 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 56 | 57 | FlView* view = fl_view_new(project); 58 | gtk_widget_show(GTK_WIDGET(view)); 59 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 60 | 61 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 62 | 63 | gtk_widget_grab_focus(GTK_WIDGET(view)); 64 | } 65 | 66 | // Implements GApplication::local_command_line. 67 | static gboolean my_application_local_command_line(GApplication* application, gchar ***arguments, int *exit_status) { 68 | MyApplication* self = MY_APPLICATION(application); 69 | // Strip out the first argument as it is the binary name. 70 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 71 | 72 | g_autoptr(GError) error = nullptr; 73 | if (!g_application_register(application, nullptr, &error)) { 74 | g_warning("Failed to register: %s", error->message); 75 | *exit_status = 1; 76 | return TRUE; 77 | } 78 | 79 | g_application_activate(application); 80 | *exit_status = 0; 81 | 82 | return TRUE; 83 | } 84 | 85 | // Implements GObject::dispose. 86 | static void my_application_dispose(GObject *object) { 87 | MyApplication* self = MY_APPLICATION(object); 88 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 89 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 90 | } 91 | 92 | static void my_application_class_init(MyApplicationClass* klass) { 93 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 94 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 95 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 96 | } 97 | 98 | static void my_application_init(MyApplication* self) {} 99 | 100 | MyApplication* my_application_new() { 101 | return MY_APPLICATION(g_object_new(my_application_get_type(), 102 | "application-id", APPLICATION_ID, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /starflut/example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /starflut/example/linux/starcore/libstar_python39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/linux/starcore/libstar_python39.so -------------------------------------------------------------------------------- /starflut/example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/xcuserdata/ 7 | -------------------------------------------------------------------------------- /starflut/example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /starflut/example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /starflut/example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import starflut 9 | 10 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 11 | StarflutPlugin.register(with: registry.registrar(forPlugin: "StarflutPlugin")) 12 | } 13 | -------------------------------------------------------------------------------- /starflut/example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.11' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def parse_KV_file(file, separator='=') 13 | file_abs_path = File.expand_path(file) 14 | if !File.exists? file_abs_path 15 | return []; 16 | end 17 | pods_ary = [] 18 | skip_line_start_symbols = ["#", "/"] 19 | File.foreach(file_abs_path) { |line| 20 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 21 | plugin = line.split(pattern=separator) 22 | if plugin.length == 2 23 | podname = plugin[0].strip() 24 | path = plugin[1].strip() 25 | podpath = File.expand_path("#{path}", file_abs_path) 26 | pods_ary.push({:name => podname, :path => podpath}); 27 | else 28 | puts "Invalid plugin specification: #{line}" 29 | end 30 | } 31 | return pods_ary 32 | end 33 | 34 | def pubspec_supports_macos(file) 35 | file_abs_path = File.expand_path(file) 36 | if !File.exists? file_abs_path 37 | return false; 38 | end 39 | File.foreach(file_abs_path) { |line| 40 | return true if line =~ /^\s*macos:/ 41 | } 42 | return false 43 | end 44 | 45 | target 'Runner' do 46 | use_frameworks! 47 | use_modular_headers! 48 | 49 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 50 | # referring to absolute paths on developers' machines. 51 | ephemeral_dir = File.join('Flutter', 'ephemeral') 52 | symlink_dir = File.join(ephemeral_dir, '.symlinks') 53 | symlink_plugins_dir = File.join(symlink_dir, 'plugins') 54 | system("rm -rf #{symlink_dir}") 55 | system("mkdir -p #{symlink_plugins_dir}") 56 | 57 | # Flutter Pods 58 | generated_xcconfig = parse_KV_file(File.join(ephemeral_dir, 'Flutter-Generated.xcconfig')) 59 | if generated_xcconfig.empty? 60 | puts "Flutter-Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 61 | end 62 | generated_xcconfig.map { |p| 63 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 64 | symlink = File.join(symlink_dir, 'flutter') 65 | File.symlink(File.dirname(p[:path]), symlink) 66 | pod 'FlutterMacOS', :path => File.join(symlink, File.basename(p[:path])) 67 | end 68 | } 69 | 70 | # Plugin Pods 71 | plugin_pods = parse_KV_file('../.flutter-plugins') 72 | plugin_pods.map { |p| 73 | symlink = File.join(symlink_plugins_dir, p[:name]) 74 | File.symlink(p[:path], symlink) 75 | if pubspec_supports_macos(File.join(symlink, 'pubspec.yaml')) 76 | pod p[:name], :path => File.join(symlink, 'macos') 77 | end 78 | } 79 | end 80 | 81 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 82 | install! 'cocoapods', :disable_input_output_paths => true 83 | -------------------------------------------------------------------------------- /starflut/example/macos/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FlutterMacOS (1.0.0) 3 | - starflut (1.0.0): 4 | - FlutterMacOS 5 | 6 | DEPENDENCIES: 7 | - FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`) 8 | - starflut (from `Flutter/ephemeral/.symlinks/plugins/starflut/macos`) 9 | 10 | EXTERNAL SOURCES: 11 | FlutterMacOS: 12 | :path: Flutter/ephemeral/.symlinks/flutter/darwin-x64 13 | starflut: 14 | :path: Flutter/ephemeral/.symlinks/plugins/starflut/macos 15 | 16 | SPEC CHECKSUMS: 17 | FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9 18 | starflut: afefcd4bab8dbbf90a20d42dcbbcdfc804a33b4a 19 | 20 | PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7 21 | 22 | COCOAPODS: 1.10.0 23 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 42 | 48 | 49 | 50 | 51 | 52 | 62 | 64 | 70 | 71 | 72 | 73 | 79 | 81 | 87 | 88 | 89 | 90 | 92 | 93 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = starflut_example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.srplab.starflutExample 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2020 com.srplab. All rights reserved. 15 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /starflut/example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starflut/example/macos/starcore/libpython3.9.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/starcore/libpython3.9.dylib -------------------------------------------------------------------------------- /starflut/example/macos/starcore/libruby.2.5.1.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/starcore/libruby.2.5.1.dylib -------------------------------------------------------------------------------- /starflut/example/macos/starcore/libstar_python39.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/starcore/libstar_python39.so -------------------------------------------------------------------------------- /starflut/example/macos/starcore/libstar_ruby.bundle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/macos/starcore/libstar_ruby.bundle -------------------------------------------------------------------------------- /starflut/example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.5.0-nullsafety.3" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0-nullsafety.3" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.1.0-nullsafety.5" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.2.0-nullsafety.3" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.0-nullsafety.3" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.15.0-nullsafety.5" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "2.1.5" 60 | cupertino_icons: 61 | dependency: "direct main" 62 | description: 63 | name: cupertino_icons 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "1.0.2" 67 | fake_async: 68 | dependency: transitive 69 | description: 70 | name: fake_async 71 | url: "https://pub.flutter-io.cn" 72 | source: hosted 73 | version: "1.2.0-nullsafety.3" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_test: 80 | dependency: "direct dev" 81 | description: flutter 82 | source: sdk 83 | version: "0.0.0" 84 | matcher: 85 | dependency: transitive 86 | description: 87 | name: matcher 88 | url: "https://pub.flutter-io.cn" 89 | source: hosted 90 | version: "0.12.10-nullsafety.3" 91 | meta: 92 | dependency: transitive 93 | description: 94 | name: meta 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "1.3.0-nullsafety.6" 98 | path: 99 | dependency: transitive 100 | description: 101 | name: path 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "1.8.0-nullsafety.3" 105 | sky_engine: 106 | dependency: transitive 107 | description: flutter 108 | source: sdk 109 | version: "0.0.99" 110 | source_span: 111 | dependency: transitive 112 | description: 113 | name: source_span 114 | url: "https://pub.flutter-io.cn" 115 | source: hosted 116 | version: "1.8.0-nullsafety.4" 117 | stack_trace: 118 | dependency: transitive 119 | description: 120 | name: stack_trace 121 | url: "https://pub.flutter-io.cn" 122 | source: hosted 123 | version: "1.10.0-nullsafety.6" 124 | starflut: 125 | dependency: "direct main" 126 | description: 127 | path: ".." 128 | relative: true 129 | source: path 130 | version: "1.0.0" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "2.1.0-nullsafety.3" 138 | string_scanner: 139 | dependency: transitive 140 | description: 141 | name: string_scanner 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "1.1.0-nullsafety.3" 145 | term_glyph: 146 | dependency: transitive 147 | description: 148 | name: term_glyph 149 | url: "https://pub.flutter-io.cn" 150 | source: hosted 151 | version: "1.2.0-nullsafety.3" 152 | test_api: 153 | dependency: transitive 154 | description: 155 | name: test_api 156 | url: "https://pub.flutter-io.cn" 157 | source: hosted 158 | version: "0.2.19-nullsafety.6" 159 | typed_data: 160 | dependency: transitive 161 | description: 162 | name: typed_data 163 | url: "https://pub.flutter-io.cn" 164 | source: hosted 165 | version: "1.3.0-nullsafety.5" 166 | uuid: 167 | dependency: transitive 168 | description: 169 | name: uuid 170 | url: "https://pub.flutter-io.cn" 171 | source: hosted 172 | version: "2.2.2" 173 | vector_math: 174 | dependency: transitive 175 | description: 176 | name: vector_math 177 | url: "https://pub.flutter-io.cn" 178 | source: hosted 179 | version: "2.1.0-nullsafety.5" 180 | sdks: 181 | dart: ">=2.12.0-0.0 <3.0.0" 182 | flutter: ">=1.20.0" 183 | -------------------------------------------------------------------------------- /starflut/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starflut_example 2 | description: Demonstrates how to use the starflut plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | environment: 9 | sdk: ">=2.7.0 <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | starflut: 16 | # When depending on this package from a real application you should use: 17 | # starflut: ^x.y.z 18 | # See https://dart.dev/tools/pub/dependencies#version-constraints 19 | # The example app is bundled with the plugin so we use a path dependency on 20 | # the parent directory to use the current plugin's version. 21 | path: ../../starflut 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^1.0.1 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | 31 | # For information on the generic Dart part of this file, see the 32 | # following page: https://dart.dev/tools/pub/pubspec 33 | 34 | # The following section is specific to Flutter. 35 | flutter: 36 | 37 | # The following line ensures that the Material Icons font is 38 | # included with your application, so that you can use the icons in 39 | # the material Icons class. 40 | uses-material-design: true 41 | 42 | # To add assets to your application, add an assets section, like this: 43 | assets: 44 | - starfiles/ 45 | # assets: 46 | # - images/a_dot_burr.jpeg 47 | # - images/a_dot_ham.jpeg 48 | 49 | # An image asset can refer to one or more resolution-specific "variants", see 50 | # https://flutter.dev/assets-and-images/#resolution-aware. 51 | 52 | # For details regarding adding assets from package dependencies, see 53 | # https://flutter.dev/assets-and-images/#from-packages 54 | 55 | # To add custom fonts to your application, add a fonts section here, 56 | # in this "flutter" section. Each entry in this list should have a 57 | # "family" key with the font family name, and a "fonts" key with a 58 | # list giving the asset and other descriptors for the font. For 59 | # example: 60 | # fonts: 61 | # - family: Schyler 62 | # fonts: 63 | # - asset: fonts/Schyler-Regular.ttf 64 | # - asset: fonts/Schyler-Italic.ttf 65 | # style: italic 66 | # - family: Trajan Pro 67 | # fonts: 68 | # - asset: fonts/TrajanPro.ttf 69 | # - asset: fonts/TrajanPro_Bold.ttf 70 | # weight: 700 71 | # 72 | # For details regarding fonts from package dependencies, 73 | # see https://flutter.dev/custom-fonts/#from-packages 74 | -------------------------------------------------------------------------------- /starflut/example/starfiles/mymath.lua: -------------------------------------------------------------------------------- 1 | local mymath = {} 2 | 3 | print(123) 4 | 5 | function mymath.add(a,b) 6 | print(a+b) 7 | end 8 | 9 | function mymath.sub(a,b) 10 | print(a-b) 11 | end 12 | 13 | function mymath.mul(a,b) 14 | print(a*b) 15 | end 16 | 17 | function mymath.div(a,b) 18 | print(a/b) 19 | end 20 | 21 | return mymath -------------------------------------------------------------------------------- /starflut/example/starfiles/testcallback.py: -------------------------------------------------------------------------------- 1 | def tt(a,b) : 2 | print(a,b) 3 | ParaPkg = CallBackObj.PrintHello("---------------",{'Name': 'Zara', 'Age': 7, 'Class': True},1234) 4 | print(ParaPkg) 5 | print(ParaPkg._Get(0)) 6 | print(ParaPkg._Get(1)) 7 | print(ParaPkg._Get(1)._ToTuple()) 8 | print(ParaPkg._Get(2)) 9 | return a,b 10 | g1 = 123 11 | 12 | def rr() : 13 | print("ffffffffffffffffffff") 14 | print(CallBackObj) 15 | rrv = CallBackObj.HelloVar(234.33,555.66) 16 | print(rrv) 17 | 18 | def ss() : 19 | print(CallBackObj_S[0]) 20 | print(CallBackObj_S[1]) 21 | print(CallBackObj_S[2]) 22 | print(CallBackObj_S[3]) 23 | 24 | def mm() : 25 | print(CallBackObj_M["sss"]) 26 | print(CallBackObj_M["dddd"]) 27 | print(CallBackObj_M["eeee"]) 28 | 29 | def st() : 30 | print(CallBackObj_T.Val1) 31 | print(CallBackObj_T.Val2) 32 | print(CallBackObj_T.Val3) 33 | 34 | 35 | def set_ss() : 36 | print(CallBackObj_S.length) 37 | CallBackObj_S[0] = CallBackObj_S[0] + "-----python" 38 | CallBackObj_S[1] = CallBackObj_S[1] + "-----python" 39 | CallBackObj_S[2] = CallBackObj_S[2] + "-----python" 40 | 41 | def set_st() : 42 | CallBackObj_T.Val1 = CallBackObj_T.Val1 + 123 43 | CallBackObj_T.Val2 = CallBackObj_T.Val2 + 456 44 | CallBackObj_T.Val3 = CallBackObj_T.Val3 + "---------python" 45 | 46 | 47 | def pf() : 48 | print(CallBackObj) 49 | print(CallBackObj("eeeeeeeeeee",111.222)) 50 | 51 | 52 | def attach() : 53 | SrvGroup = libstarpy._GetSrvGroup(0) 54 | Service = SrvGroup._GetService("","") 55 | TestGo = Service._ImportRawContext("go","gofunc",False,""); 56 | print(TestGo("eeeeeeeeeee",111.222)) 57 | pa = CallBackObj_S._RawToParaPkg() 58 | print(pa[0],pa[1],pa[2]) 59 | 60 | -------------------------------------------------------------------------------- /starflut/example/starfiles/testcallback.rb: -------------------------------------------------------------------------------- 1 | def tt(a,b) 2 | puts(a,b) 3 | paraPkg = $CallBackObj.PrintHello("---------------",{'Name'=>'Zara', 'Age'=>7, 'Class'=>true},1234) 4 | puts(paraPkg) 5 | puts(paraPkg._Get(0)) 6 | puts(paraPkg._Get(1)) 7 | puts(paraPkg._Get(1)._ToTuple()) 8 | puts(paraPkg._Get(2)) 9 | return a,b 10 | end 11 | $g1 = 123 12 | -------------------------------------------------------------------------------- /starflut/example/starfiles/testpy.py: -------------------------------------------------------------------------------- 1 | def tt(a,b) : 2 | print(a,b) 3 | return 666,777 4 | g1 = 123 5 | def yy(a,b,z) : 6 | print(a,b,z) 7 | return {'jack': 4098, 'sape': 4139} 8 | 9 | class Multiply : 10 | def __init__(self,x,y) : 11 | self.a = x 12 | self.b = y 13 | 14 | def multiply(self,a,b): 15 | print("multiply....",self,a,b) 16 | return a * b -------------------------------------------------------------------------------- /starflut/example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:starflut_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /starflut/example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /starflut/example/windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(starflut_example LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "starflut_example") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | # add by starcore 78 | install(FILES "starcore/libstar_python39.pyd" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 79 | COMPONENT Runtime) 80 | 81 | if(PLUGIN_BUNDLED_LIBRARIES) 82 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 83 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 84 | COMPONENT Runtime) 85 | endif() 86 | 87 | # Fully re-copy the assets directory on each build to avoid having stale files 88 | # from a previous install. 89 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 90 | install(CODE " 91 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 92 | " COMPONENT Runtime) 93 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 94 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 95 | 96 | # Install the AOT library on non-Debug builds only. 97 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 98 | CONFIGURATIONS Profile;Release 99 | COMPONENT Runtime) 100 | -------------------------------------------------------------------------------- /starflut/example/windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | ) 27 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 28 | add_library(flutter INTERFACE) 29 | target_include_directories(flutter INTERFACE 30 | "${EPHEMERAL_DIR}" 31 | ) 32 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 33 | add_dependencies(flutter flutter_assemble) 34 | 35 | # === Wrapper === 36 | list(APPEND CPP_WRAPPER_SOURCES_CORE 37 | "core_implementations.cc" 38 | "standard_codec.cc" 39 | ) 40 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 41 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 42 | "plugin_registrar.cc" 43 | ) 44 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 45 | list(APPEND CPP_WRAPPER_SOURCES_APP 46 | "flutter_engine.cc" 47 | "flutter_view_controller.cc" 48 | ) 49 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 50 | 51 | # Wrapper sources needed for a plugin. 52 | add_library(flutter_wrapper_plugin STATIC 53 | ${CPP_WRAPPER_SOURCES_CORE} 54 | ${CPP_WRAPPER_SOURCES_PLUGIN} 55 | ) 56 | apply_standard_settings(flutter_wrapper_plugin) 57 | set_target_properties(flutter_wrapper_plugin PROPERTIES 58 | POSITION_INDEPENDENT_CODE ON) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | CXX_VISIBILITY_PRESET hidden) 61 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 62 | target_include_directories(flutter_wrapper_plugin PUBLIC 63 | "${WRAPPER_ROOT}/include" 64 | ) 65 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 66 | 67 | # Wrapper sources needed for the runner. 68 | add_library(flutter_wrapper_app STATIC 69 | ${CPP_WRAPPER_SOURCES_CORE} 70 | ${CPP_WRAPPER_SOURCES_APP} 71 | ) 72 | apply_standard_settings(flutter_wrapper_app) 73 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 74 | target_include_directories(flutter_wrapper_app PUBLIC 75 | "${WRAPPER_ROOT}/include" 76 | ) 77 | add_dependencies(flutter_wrapper_app flutter_assemble) 78 | 79 | # === Flutter tool backend === 80 | # _phony_ is a non-existent file to force this command to run every time, 81 | # since currently there's no way to get a full input/output list from the 82 | # flutter tool. 83 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 84 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 85 | add_custom_command( 86 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 87 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 88 | ${CPP_WRAPPER_SOURCES_APP} 89 | ${PHONY_OUTPUT} 90 | COMMAND ${CMAKE_COMMAND} -E env 91 | ${FLUTTER_TOOL_ENVIRONMENT} 92 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 93 | windows-x64 $ 94 | ) 95 | add_custom_target(flutter_assemble DEPENDS 96 | "${FLUTTER_LIBRARY}" 97 | ${FLUTTER_LIBRARY_HEADERS} 98 | ${CPP_WRAPPER_SOURCES_CORE} 99 | ${CPP_WRAPPER_SOURCES_PLUGIN} 100 | ${CPP_WRAPPER_SOURCES_APP} 101 | ) 102 | -------------------------------------------------------------------------------- /starflut/example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #include "generated_plugin_registrant.h" 6 | 7 | #include 8 | 9 | void RegisterPlugins(flutter::PluginRegistry* registry) { 10 | StarflutPluginRegisterWithRegistrar( 11 | registry->GetRegistrarForPlugin("StarflutPlugin")); 12 | } 13 | -------------------------------------------------------------------------------- /starflut/example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 6 | #define GENERATED_PLUGIN_REGISTRANT_ 7 | 8 | #include 9 | 10 | // Registers Flutter plugins. 11 | void RegisterPlugins(flutter::PluginRegistry* registry); 12 | 13 | #endif // GENERATED_PLUGIN_REGISTRANT_ 14 | -------------------------------------------------------------------------------- /starflut/example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | starflut 7 | ) 8 | 9 | set(PLUGIN_BUNDLED_LIBRARIES) 10 | 11 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 12 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 13 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 15 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 16 | endforeach(plugin) 17 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "run_loop.cpp" 8 | "utils.cpp" 9 | "win32_window.cpp" 10 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 11 | "Runner.rc" 12 | "runner.exe.manifest" 13 | ) 14 | apply_standard_settings(${BINARY_NAME}) 15 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 16 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 17 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 18 | add_dependencies(${BINARY_NAME} flutter_assemble) 19 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/Runner.rc: -------------------------------------------------------------------------------- 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", "com.srplab" "\0" 93 | VALUE "FileDescription", "Demonstrates how to use the starflut plugin." "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "starflut_example" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2020 com.srplab. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "starflut_example.exe" "\0" 98 | VALUE "ProductName", "starflut_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 122 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(RunLoop* run_loop, 8 | const flutter::DartProject& project) 9 | : run_loop_(run_loop), project_(project) {} 10 | 11 | FlutterWindow::~FlutterWindow() {} 12 | 13 | bool FlutterWindow::OnCreate() { 14 | if (!Win32Window::OnCreate()) { 15 | return false; 16 | } 17 | 18 | RECT frame = GetClientArea(); 19 | 20 | // The size here must match the window dimensions to avoid unnecessary surface 21 | // creation / destruction in the startup path. 22 | flutter_controller_ = std::make_unique( 23 | frame.right - frame.left, frame.bottom - frame.top, project_); 24 | // Ensure that basic setup of the controller was successful. 25 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 26 | return false; 27 | } 28 | RegisterPlugins(flutter_controller_->engine()); 29 | run_loop_->RegisterFlutterInstance(flutter_controller_->engine()); 30 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 31 | return true; 32 | } 33 | 34 | void FlutterWindow::OnDestroy() { 35 | if (flutter_controller_) { 36 | run_loop_->UnregisterFlutterInstance(flutter_controller_->engine()); 37 | flutter_controller_ = nullptr; 38 | } 39 | 40 | Win32Window::OnDestroy(); 41 | } 42 | 43 | LRESULT 44 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 45 | WPARAM const wparam, 46 | LPARAM const lparam) noexcept { 47 | // Give Flutter, including plugins, an opporutunity to handle window messages. 48 | if (flutter_controller_) { 49 | std::optional result = 50 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 51 | lparam); 52 | if (result) { 53 | return *result; 54 | } 55 | } 56 | 57 | switch (message) { 58 | case WM_FONTCHANGE: 59 | flutter_controller_->engine()->ReloadSystemFonts(); 60 | break; 61 | } 62 | 63 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 64 | } 65 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "run_loop.h" 10 | #include "win32_window.h" 11 | 12 | // A window that does nothing but host a Flutter view. 13 | class FlutterWindow : public Win32Window { 14 | public: 15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a 16 | // Flutter view running |project|. 17 | explicit FlutterWindow(RunLoop* run_loop, 18 | const flutter::DartProject& project); 19 | virtual ~FlutterWindow(); 20 | 21 | protected: 22 | // Win32Window: 23 | bool OnCreate() override; 24 | void OnDestroy() override; 25 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 26 | LPARAM const lparam) noexcept override; 27 | 28 | private: 29 | // The run loop driving events for this window. 30 | RunLoop* run_loop_; 31 | 32 | // The project to run. 33 | flutter::DartProject project_; 34 | 35 | // The Flutter instance hosted by this window. 36 | std::unique_ptr flutter_controller_; 37 | }; 38 | 39 | #endif // RUNNER_FLUTTER_WINDOW_H_ 40 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "run_loop.h" 7 | #include "utils.h" 8 | 9 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 10 | _In_ wchar_t *command_line, _In_ int show_command) { 11 | // Attach to console when present (e.g., 'flutter run') or create a 12 | // new console when running with a debugger. 13 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 14 | CreateAndAttachConsole(); 15 | } 16 | 17 | // Initialize COM, so that it is available for use in the library and/or 18 | // plugins. 19 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 20 | 21 | RunLoop run_loop; 22 | 23 | flutter::DartProject project(L"data"); 24 | 25 | std::vector command_line_arguments = 26 | GetCommandLineArguments(); 27 | 28 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 29 | 30 | FlutterWindow window(&run_loop, project); 31 | Win32Window::Point origin(10, 10); 32 | Win32Window::Size size(1280, 720); 33 | if (!window.CreateAndShow(L"starflut_example", origin, size)) { 34 | return EXIT_FAILURE; 35 | } 36 | window.SetQuitOnClose(true); 37 | 38 | run_loop.Run(); 39 | 40 | ::CoUninitialize(); 41 | return EXIT_SUCCESS; 42 | } 43 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/resource.h: -------------------------------------------------------------------------------- 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 17 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /starflut/example/windows/runner/run_loop.cpp: -------------------------------------------------------------------------------- 1 | #include "run_loop.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | RunLoop::RunLoop() {} 8 | 9 | RunLoop::~RunLoop() {} 10 | 11 | void RunLoop::Run() { 12 | bool keep_running = true; 13 | TimePoint next_flutter_event_time = TimePoint::clock::now(); 14 | while (keep_running) { 15 | std::chrono::nanoseconds wait_duration = 16 | std::max(std::chrono::nanoseconds(0), 17 | next_flutter_event_time - TimePoint::clock::now()); 18 | ::MsgWaitForMultipleObjects( 19 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), 20 | QS_ALLINPUT); 21 | bool processed_events = false; 22 | MSG message; 23 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects 24 | // won't return again for items left in the queue after PeekMessage. 25 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 26 | processed_events = true; 27 | if (message.message == WM_QUIT) { 28 | keep_running = false; 29 | break; 30 | } 31 | ::TranslateMessage(&message); 32 | ::DispatchMessage(&message); 33 | // Allow Flutter to process messages each time a Windows message is 34 | // processed, to prevent starvation. 35 | next_flutter_event_time = 36 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 37 | } 38 | // If the PeekMessage loop didn't run, process Flutter messages. 39 | if (!processed_events) { 40 | next_flutter_event_time = 41 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 42 | } 43 | } 44 | } 45 | 46 | void RunLoop::RegisterFlutterInstance( 47 | flutter::FlutterEngine* flutter_instance) { 48 | flutter_instances_.insert(flutter_instance); 49 | } 50 | 51 | void RunLoop::UnregisterFlutterInstance( 52 | flutter::FlutterEngine* flutter_instance) { 53 | flutter_instances_.erase(flutter_instance); 54 | } 55 | 56 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { 57 | TimePoint next_event_time = TimePoint::max(); 58 | for (auto instance : flutter_instances_) { 59 | std::chrono::nanoseconds wait_duration = instance->ProcessMessages(); 60 | if (wait_duration != std::chrono::nanoseconds::max()) { 61 | next_event_time = 62 | std::min(next_event_time, TimePoint::clock::now() + wait_duration); 63 | } 64 | } 65 | return next_event_time; 66 | } 67 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/run_loop.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_RUN_LOOP_H_ 2 | #define RUNNER_RUN_LOOP_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // A runloop that will service events for Flutter instances as well 10 | // as native messages. 11 | class RunLoop { 12 | public: 13 | RunLoop(); 14 | ~RunLoop(); 15 | 16 | // Prevent copying 17 | RunLoop(RunLoop const&) = delete; 18 | RunLoop& operator=(RunLoop const&) = delete; 19 | 20 | // Runs the run loop until the application quits. 21 | void Run(); 22 | 23 | // Registers the given Flutter instance for event servicing. 24 | void RegisterFlutterInstance( 25 | flutter::FlutterEngine* flutter_instance); 26 | 27 | // Unregisters the given Flutter instance from event servicing. 28 | void UnregisterFlutterInstance( 29 | flutter::FlutterEngine* flutter_instance); 30 | 31 | private: 32 | using TimePoint = std::chrono::steady_clock::time_point; 33 | 34 | // Processes all currently pending messages for registered Flutter instances. 35 | TimePoint ProcessFlutterMessages(); 36 | 37 | std::set flutter_instances_; 38 | }; 39 | 40 | #endif // RUNNER_RUN_LOOP_H_ 41 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 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 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(); 30 | } 31 | 32 | std::vector 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 | } 65 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 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, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 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(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( 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(origin.x), 114 | static_cast(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(lparam); 139 | SetWindowLongPtr(window, GWLP_USERDATA, 140 | reinterpret_cast(window_struct->lpCreateParams)); 141 | 142 | auto that = static_cast(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(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( 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 | } 246 | -------------------------------------------------------------------------------- /starflut/example/windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | -------------------------------------------------------------------------------- /starflut/example/windows/starcore/libstar_python39.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/example/windows/starcore/libstar_python39.pyd -------------------------------------------------------------------------------- /starflut/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /starflut/ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /starflut/ios/Classes/StarflutPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface StarflutPlugin : NSObject 4 | @end -------------------------------------------------------------------------------- /starflut/ios/Classes/StarflutPlugin.m: -------------------------------------------------------------------------------- 1 | #import "StarflutPlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "starflut-Swift.h" 9 | #endif 10 | 11 | @implementation StarflutPlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [SwiftStarflutPlugin registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /starflut/ios/Classes/SwiftStarflutPlugin.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | public class SwiftStarflutPlugin: NSObject, FlutterPlugin { 5 | 6 | public var StarflutPluginStub : StarflutPluginCommon? 7 | 8 | public static func register(with registrar: FlutterPluginRegistrar) { 9 | let channel = FlutterMethodChannel(name: "starflut", binaryMessenger: registrar.messenger()) 10 | let instance = SwiftStarflutPlugin() 11 | registrar.addMethodCallDelegate(instance, channel: channel) 12 | instance.StarflutPluginStub = StarflutPluginCommon.starflut_plugin_common_init(channel) 13 | } 14 | 15 | override init(){ 16 | super.init() 17 | self.StarflutPluginStub = nil 18 | } 19 | /* 20 | public static func register(with registrar: FlutterPluginRegistrar) { 21 | let channel = FlutterMethodChannel(name: "starflut", binaryMessenger: registrar.messenger()) 22 | let instance = SwiftStarflutPlugin() 23 | registrar.addMethodCallDelegate(instance, channel: channel) 24 | } 25 | */ 26 | 27 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 28 | /* 29 | result("iOS " + UIDevice.current.systemVersion) 30 | */ 31 | let stub : StarflutPluginCommon = StarflutPluginStub! 32 | stub.handleMethodCall_Common(call,result:result); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /starflut/ios/Classes/starflut_plugin_common.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface StarflutPluginCommon : NSObject 5 | 6 | + (StarflutPluginCommon *)starflut_plugin_common_init:(FlutterMethodChannel *)channel_arg; 7 | - (void)handleMethodCall_Common:(FlutterMethodCall*)call result:(FlutterResult)result; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /starflut/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | set(PROJECT_NAME "starflut") 3 | project(${PROJECT_NAME} LANGUAGES CXX) 4 | 5 | # This value is used when generating builds using this plugin, so it must 6 | # not be changed 7 | set(PLUGIN_NAME "starflut_plugin") 8 | 9 | add_library(${PLUGIN_NAME} SHARED 10 | "starflut_plugin.cc" 11 | "starflut_plugin_common.cpp" 12 | ) 13 | apply_standard_settings(${PLUGIN_NAME}) 14 | set_target_properties(${PLUGIN_NAME} PROPERTIES 15 | CXX_VISIBILITY_PRESET hidden) 16 | target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) 17 | target_include_directories(${PLUGIN_NAME} INTERFACE 18 | "${CMAKE_CURRENT_SOURCE_DIR}/include") 19 | target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) 20 | target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) 21 | target_link_libraries(${PLUGIN_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/libstarlib.a") 22 | 23 | #add by starcore 24 | set(CMAKE_CXX_FLAGS "-DENV_LINUX -DENV_M64 ${CMAKE_CXX_FLAGS}") 25 | target_compile_options(${PLUGIN_NAME} PRIVATE -Wno-unused-function -Wno-unused-variable) 26 | 27 | MESSAGE(STATUS ${CMAKE_HOST_SYSTEM}) 28 | 29 | # List of absolute paths to libraries that should be bundled with the plugin 30 | set(starflut_bundled_libraries 31 | "" 32 | "${CMAKE_CURRENT_SOURCE_DIR}/starcore" 33 | PARENT_SCOPE 34 | ) 35 | -------------------------------------------------------------------------------- /starflut/linux/include/starcore/lua/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_BITLIBNAME "bit32" 39 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 40 | 41 | #define LUA_MATHLIBNAME "math" 42 | LUAMOD_API int (luaopen_math) (lua_State *L); 43 | 44 | #define LUA_DBLIBNAME "debug" 45 | LUAMOD_API int (luaopen_debug) (lua_State *L); 46 | 47 | #define LUA_LOADLIBNAME "package" 48 | LUAMOD_API int (luaopen_package) (lua_State *L); 49 | 50 | 51 | /* open all previous libraries */ 52 | LUALIB_API void (luaL_openlibs) (lua_State *L); 53 | 54 | 55 | 56 | #if !defined(lua_assert) 57 | #define lua_assert(x) ((void)0) 58 | #endif 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /starflut/linux/include/starcore/vscoreshell.h: -------------------------------------------------------------------------------- 1 | #ifndef _VSOPENREG 2 | #define _VSOPENREG 3 | 4 | #include "vsopenapi.h" 5 | 6 | #if( VS_OS_TYPE == VS_OS_WINDOWS || VS_OS_TYPE == VS_OS_WP || VS_OS_TYPE == VS_OS_WINRT || VS_OS_TYPE == VS_OS_WIN10 ) 7 | #define VS_CP_ACP CP_ACP 8 | #define VS_CP_UTF8 CP_UTF8 9 | #endif 10 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) 11 | #define VS_CP_ACP 0 12 | #define VS_CP_UTF8 1 13 | #endif 14 | 15 | #define USR_XML_REG 16 | 17 | /*------------------------------------------------------------------------------*/ 18 | /*----Registry functions need to shift to linux : /var/srplab/ */ 19 | #if( VS_OS_TYPE == VS_OS_WINDOWS || VS_OS_TYPE == VS_OS_WP || VS_OS_TYPE == VS_OS_WINRT || VS_OS_TYPE == VS_OS_WIN10 ) && !defined(USR_XML_REG) 20 | typedef HKEY vs_reg_hkey; 21 | #define VS_REGKEY_CURRENT_USER HKEY_CURRENT_USER 22 | #define VS_REGKEY_CLASSES_ROOT HKEY_CLASSES_ROOT 23 | #define VS_REGKEY_LOCAL_MACHINE HKEY_LOCAL_MACHINE 24 | #define VS_REGTYPE_SZ REG_SZ 25 | #define VS_REGTYPE_DWORD REG_DWORD 26 | #define VS_REGERROR_SUCCESS ERROR_SUCCESS 27 | #define VS_REGERROR_FAIL 1 28 | #define VS_REG_CREATED_NEW_KEY REG_CREATED_NEW_KEY 29 | #define VS_REG_OPENED_EXISTING_KEY REG_OPENED_EXISTING_KEY 30 | #endif 31 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) || defined(USR_XML_REG) 32 | struct StructOfVSRegKey{ 33 | VS_CHAR Buf[512]; /*--Max Key Length--*/ 34 | }; 35 | typedef struct StructOfVSRegKey * vs_reg_hkey; 36 | #define VS_REGKEY_CURRENT_USER ((vs_reg_hkey)0x00000001) 37 | #define VS_REGKEY_CLASSES_ROOT ((vs_reg_hkey)0x00000002) 38 | #define VS_REGKEY_LOCAL_MACHINE ((vs_reg_hkey)0x00000003) 39 | #define VS_REGTYPE_SZ 0 40 | #define VS_REGTYPE_DWORD 1 41 | #define VS_REGERROR_SUCCESS 0 42 | #define VS_REGERROR_FAIL 1 43 | #define VS_REG_CREATED_NEW_KEY 1 44 | #define VS_REG_OPENED_EXISTING_KEY 2 45 | #endif 46 | 47 | #if defined(__cplusplus) || defined(c_plusplus) 48 | class ClassOfCoreShellInterface{ 49 | public: 50 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) 51 | virtual ~ClassOfCoreShellInterface(){}; 52 | #endif 53 | virtual void SRPAPI Release() = 0; 54 | 55 | /*if StrLength == -1 then auto calc */ 56 | /* return is null-terminated string */ 57 | /* default for unicode is UTF-16LE and UTF-32LE */ 58 | /* ToCode set to NULL for default */ 59 | /* CodePage set to VS_CP_UTF8 or VS_CP_ACP */ 60 | virtual VS_INT8 *SRPAPI AnsiToUnicode(VS_UINT32 CodePage,const VS_CHAR *ToCode,const VS_INT8 *AnsiStr,VS_INT32 StrLength)= 0; /*ToCode is ignore on windows, maybe UCS2 UCS4 UTF-16 UTF-32 UTF-16BE UTF-16LE UTF-32BE UTF-32LE */ 61 | /* FromCode set to NULL for default */ 62 | /* CodePage set to VS_CP_UTF8 or VS_CP_ACP */ 63 | virtual VS_INT8 *SRPAPI UnicodeToAnsi(const VS_CHAR *FromCode,VS_UINT32 CodePage,const VS_INT8 *WideStr,VS_INT32 StrLength,VS_INT32 BytesPerChar)= 0; /*BytesPerChar(2/4) is ignore on windows , StrLength is bytes of WideStr */ 64 | virtual VS_INT8 *SRPAPI AnsiToUTF8(const VS_INT8 *AnsiStr,VS_INT32 StrLength)= 0; 65 | virtual VS_INT8 *SRPAPI UTF8ToAnsi(const VS_INT8 *UTFStr,VS_INT32 StrLength)= 0; 66 | virtual VS_INT8 *SRPAPI ToOSPlatString(const VS_INT8 *Str,VS_INT32 StrLength)= 0; /*for linux: discard \r, and reserved \n, for win32 use \r\n */ 67 | virtual VS_INT8 *SRPAPI ToOSPlatStringEx(VS_UINT32 OSType,const VS_INT8 *Str,VS_INT32 StrLength)= 0; /*for linux: discard \r, and reserved \n, for win32 use \r\n */ 68 | /*the return value of above functions is free by the following function */ 69 | virtual void SRPAPI FreeBuf(void *Buf)= 0; 70 | 71 | virtual void SRPAPI vs_reg_beginlock(void)=0; 72 | virtual void SRPAPI vs_reg_endlock(void)=0; 73 | 74 | virtual VS_ULONG SRPAPI vs_reg_createkeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey,const VS_CHAR *Class,vs_reg_hkey *RetKey,VS_ULONG *DisPosition)= 0; 75 | virtual VS_ULONG SRPAPI vs_reg_closekey(vs_reg_hkey hKey)= 0; 76 | virtual VS_ULONG SRPAPI vs_reg_setvalue(vs_reg_hkey hKey,const VS_CHAR *ValueName,VS_ULONG Type,const VS_CHAR *Value,VS_ULONG ValueSize)= 0; 77 | virtual VS_ULONG SRPAPI vs_reg_openkeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey,vs_reg_hkey *RetKey)= 0; 78 | virtual VS_ULONG SRPAPI vs_reg_queryvalueex(vs_reg_hkey hKey,const VS_CHAR *ValueName,VS_ULONG *Type,VS_UINT8 *DataBuf,VS_ULONG *DataBufSize)= 0; 79 | virtual VS_ULONG SRPAPI vs_reg_deletekeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey)= 0; 80 | virtual VS_ULONG SRPAPI vs_reg_enumkey(vs_reg_hkey hKey,VS_ULONG Index,VS_CHAR *NameBuf,VS_ULONG NameBufSize)= 0; 81 | 82 | virtual VS_INT32 SRPAPI GetCharBytes(const VS_INT8 *Buf) = 0; 83 | 84 | virtual VS_INT8 *SRPAPI ToAnsi(const VS_CHAR *Locale,const VS_INT8 *Str)= 0; 85 | virtual VS_INT8 *SRPAPI FromAnsi(const VS_CHAR *Locale,const VS_INT8 *Str)= 0; 86 | /*---note : FromLocale and ToLocale, "ansi" means local chareset. */ 87 | /* InBufSize is the valid byte for input buf in bytes, maybe -1 for normal string */ 88 | /* RetBufSize is the retbuf size in bytes, may be null */ 89 | virtual VS_INT8 *SRPAPI vs_iconv(const VS_CHAR *FromLocale,const VS_CHAR *ToLocale,const VS_INT8 *InBuf,VS_INT32 InBufSize,VS_INT32 *RetBufSize)= 0; 90 | 91 | /*---v2.5.1--*/ 92 | virtual VS_INT8 *SRPAPI AnsiToUnicodeEx(VS_UINT32 CodePage,const VS_CHAR *ToCode,const VS_INT8 *AnsiStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; /* StrLength and RetBufLength is bytes of return buffer */ 93 | virtual VS_INT8 *SRPAPI UnicodeToAnsiEx(const VS_CHAR *FromCode,VS_UINT32 CodePage,const VS_INT8 *WideStr,VS_INT32 StrLength,VS_INT32 BytesPerChar,VS_INT32 *RetBufLength)= 0; /* StrLength and RetBufLength is bytes of return buffer */ 94 | virtual VS_INT8 *SRPAPI AnsiToUTF8Ex(const VS_INT8 *AnsiStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; 95 | virtual VS_INT8 *SRPAPI UTF8ToAnsiEx(const VS_INT8 *UTFStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; 96 | }; 97 | 98 | #endif 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /starflut/linux/include/starcore/vsopenmemorydisk.h: -------------------------------------------------------------------------------- 1 | #ifndef _VSMEMORYDISK 2 | #define _VSMEMORYDISK 3 | 4 | #include "vsopenapi.h" 5 | 6 | #define VSMEMORYDISKFILE_HEADTAG "VSEXECUTEFILE1" 7 | 8 | struct StructOfVSMemoryDiskFileHeader{ 9 | /*---FileHeader 128Bytes fixed*/ 10 | VS_CHAR Tag[16]; 11 | VS_CHAR ServiceName[64]; 12 | VS_UUID FileHeaderUUID; /*---if does not match with server, need not download*/ 13 | VS_ULONG UnCompressLength; 14 | VS_ULONG CompressLength; 15 | VS_UINT32 SupportOsType; 16 | VS_UINT8 CoreVersion; /*--0 for randxor 1 for randxor1*/ 17 | VS_UINT8 Reserved0[3]; 18 | VS_CHAR ScriptInterface[16]; 19 | VS_UINT8 Reserved[64]; 20 | /*VS_CHAR StartFileName[256]; 0 is end*/ 21 | }; 22 | /*Depend Service Name List : ServiceName1,0,DownLoadType1,...,0*/ 23 | /*0 is end of Header part*/ 24 | /*ex: DownLoadType1 == 0 default download from http://www.srplab.com, ==1 include in the file, ==2 download from current website*/ 25 | 26 | /*--------------------------------------------------------*/ 27 | /*FileHeader*/ 28 | /*0 is end*/ 29 | /*extend data size*/ 30 | /*extend data*/ 31 | /*DependFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 32 | /*0 is end*/ 33 | /*ServiceFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 34 | /*0 is end*/ 35 | /*DataFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 36 | /*0 is end*/ 37 | 38 | /*file path and name, UnCompressedSize,CompressedSize,FileMD5*/ 39 | /*0 is end*/ 40 | /*extend data size*/ 41 | /*extend data*/ 42 | 43 | /*file begin,FileStartOffset*/ 44 | /*....reserved*/ 45 | /*file1 data, -----FileStartOffset*/ 46 | /*file2 data, -----FileStartOffset + Offset*/ 47 | /*....*/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /starflut/linux/include/starflut/starflut_plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_PLUGIN_STARFLUT_PLUGIN_H_ 2 | #define FLUTTER_PLUGIN_STARFLUT_PLUGIN_H_ 3 | 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | #ifdef FLUTTER_PLUGIN_IMPL 9 | #define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) 10 | #else 11 | #define FLUTTER_PLUGIN_EXPORT 12 | #endif 13 | 14 | typedef struct _StarflutPlugin StarflutPlugin; 15 | typedef struct { 16 | GObjectClass parent_class; 17 | } StarflutPluginClass; 18 | 19 | FLUTTER_PLUGIN_EXPORT GType starflut_plugin_get_type(); 20 | 21 | FLUTTER_PLUGIN_EXPORT void starflut_plugin_register_with_registrar( 22 | FlPluginRegistrar* registrar); 23 | 24 | G_END_DECLS 25 | 26 | #endif // FLUTTER_PLUGIN_STARFLUT_PLUGIN_H_ 27 | -------------------------------------------------------------------------------- /starflut/linux/libstarlib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/linux/libstarlib.a -------------------------------------------------------------------------------- /starflut/linux/starcore/libstarcore.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/linux/starcore/libstarcore.so -------------------------------------------------------------------------------- /starflut/linux/starflut_plugin.cc: -------------------------------------------------------------------------------- 1 | #include "include/starflut/starflut_plugin.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #define STARFLUT_PLUGIN(obj) \ 10 | (G_TYPE_CHECK_INSTANCE_CAST((obj), starflut_plugin_get_type(), \ 11 | StarflutPlugin)) 12 | 13 | struct _StarflutPlugin { 14 | GObject parent_instance; 15 | 16 | FlPluginRegistrar* registrar; 17 | 18 | // Connection to Flutter engine. 19 | FlMethodChannel* channel; 20 | }; 21 | 22 | G_DEFINE_TYPE(StarflutPlugin, starflut_plugin, g_object_get_type()) 23 | 24 | extern void starflut_plugin_common_handle_method_call(FlPluginRegistrar* registrar,FlMethodChannel* channel,FlMethodCall* method_call); 25 | 26 | // Called when a method call is received from Flutter. 27 | static void starflut_plugin_handle_method_call( 28 | StarflutPlugin* self, 29 | FlMethodCall* method_call) { 30 | #if 0 31 | g_autoptr(FlMethodResponse) response = nullptr; 32 | 33 | const gchar* method = fl_method_call_get_name(method_call); 34 | 35 | if (strcmp(method, "getPlatformVersion") == 0) { 36 | struct utsname uname_data = {}; 37 | uname(&uname_data); 38 | g_autofree gchar *version = g_strdup_printf("Linux %s", uname_data.version); 39 | g_autoptr(FlValue) result = fl_value_new_string(version); 40 | response = FL_METHOD_RESPONSE(fl_method_success_response_new(result)); 41 | } else { 42 | response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); 43 | } 44 | 45 | fl_method_call_respond(method_call, response, nullptr); 46 | #endif 47 | starflut_plugin_common_handle_method_call(self->registrar,self->channel,method_call); 48 | } 49 | 50 | static void starflut_plugin_dispose(GObject* object) { 51 | StarflutPlugin* self = STARFLUT_PLUGIN(object); 52 | 53 | g_clear_object(&self->registrar); 54 | g_clear_object(&self->channel); 55 | 56 | G_OBJECT_CLASS(starflut_plugin_parent_class)->dispose(object); 57 | } 58 | 59 | static void starflut_plugin_class_init(StarflutPluginClass* klass) { 60 | G_OBJECT_CLASS(klass)->dispose = starflut_plugin_dispose; 61 | } 62 | 63 | extern void starflut_plugin_common_init(FlMethodChannel* in_channel); 64 | static void starflut_plugin_init(StarflutPlugin* self) {} 65 | 66 | static void method_call_cb(FlMethodChannel* channel, FlMethodCall* method_call, 67 | gpointer user_data) { 68 | StarflutPlugin* plugin = STARFLUT_PLUGIN(user_data); 69 | starflut_plugin_handle_method_call(plugin, method_call); 70 | } 71 | 72 | void starflut_plugin_register_with_registrar(FlPluginRegistrar* registrar) { 73 | 74 | StarflutPlugin* self = STARFLUT_PLUGIN( 75 | g_object_new(starflut_plugin_get_type(), nullptr)); 76 | 77 | self->registrar = FL_PLUGIN_REGISTRAR(g_object_ref(registrar)); 78 | 79 | g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new(); 80 | self->channel = 81 | fl_method_channel_new(fl_plugin_registrar_get_messenger(registrar), 82 | "starflut",FL_METHOD_CODEC(codec)); 83 | fl_method_channel_set_method_call_handler(self->channel, method_call_cb, 84 | g_object_ref(self), g_object_unref); 85 | starflut_plugin_common_init(self->channel); 86 | } 87 | -------------------------------------------------------------------------------- /starflut/macos/Classes/StarflutPlugin.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | public class StarflutPlugin: NSObject, FlutterPlugin { 5 | public var StarflutPluginStub : StarflutPluginCommon? 6 | 7 | public static func register(with registrar: FlutterPluginRegistrar) { 8 | let channel = FlutterMethodChannel(name: "starflut", binaryMessenger: registrar.messenger) 9 | let instance = StarflutPlugin() 10 | registrar.addMethodCallDelegate(instance, channel: channel) 11 | instance.StarflutPluginStub = StarflutPluginCommon.starflut_plugin_common_init(channel) 12 | } 13 | 14 | override init(){ 15 | super.init() 16 | self.StarflutPluginStub = nil 17 | } 18 | 19 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 20 | /* 21 | switch call.method { 22 | case "getPlatformVersion": 23 | result("macOS " + ProcessInfo.processInfo.operatingSystemVersionString) 24 | default: 25 | result(FlutterMethodNotImplemented) 26 | } 27 | */ 28 | let stub : StarflutPluginCommon = StarflutPluginStub! 29 | stub.handleMethodCall_Common(call,result:result); 30 | } 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /starflut/macos/Classes/starflut_plugin_common.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import 4 | 5 | @interface StarflutPluginCommon : NSObject 6 | 7 | + (StarflutPluginCommon *)starflut_plugin_common_init:(FlutterMethodChannel *)channel_arg; 8 | - (void)handleMethodCall_Common:(FlutterMethodCall*)call result:(FlutterResult)result; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /starflut/macos/include/starcore/lua/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_BITLIBNAME "bit32" 39 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 40 | 41 | #define LUA_MATHLIBNAME "math" 42 | LUAMOD_API int (luaopen_math) (lua_State *L); 43 | 44 | #define LUA_DBLIBNAME "debug" 45 | LUAMOD_API int (luaopen_debug) (lua_State *L); 46 | 47 | #define LUA_LOADLIBNAME "package" 48 | LUAMOD_API int (luaopen_package) (lua_State *L); 49 | 50 | 51 | /* open all previous libraries */ 52 | LUALIB_API void (luaL_openlibs) (lua_State *L); 53 | 54 | 55 | 56 | #if !defined(lua_assert) 57 | #define lua_assert(x) ((void)0) 58 | #endif 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /starflut/macos/include/starcore/vscoreshell.h: -------------------------------------------------------------------------------- 1 | #ifndef _VSOPENREG 2 | #define _VSOPENREG 3 | 4 | #include "vsopenapi.h" 5 | 6 | #if( VS_OS_TYPE == VS_OS_WINDOWS || VS_OS_TYPE == VS_OS_WP || VS_OS_TYPE == VS_OS_WINRT || VS_OS_TYPE == VS_OS_WIN10 ) 7 | #define VS_CP_ACP CP_ACP 8 | #define VS_CP_UTF8 CP_UTF8 9 | #endif 10 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) 11 | #define VS_CP_ACP 0 12 | #define VS_CP_UTF8 1 13 | #endif 14 | 15 | #define USR_XML_REG 16 | 17 | /*------------------------------------------------------------------------------*/ 18 | /*----Registry functions need to shift to linux : /var/srplab/ */ 19 | #if( VS_OS_TYPE == VS_OS_WINDOWS || VS_OS_TYPE == VS_OS_WP || VS_OS_TYPE == VS_OS_WINRT || VS_OS_TYPE == VS_OS_WIN10 ) && !defined(USR_XML_REG) 20 | typedef HKEY vs_reg_hkey; 21 | #define VS_REGKEY_CURRENT_USER HKEY_CURRENT_USER 22 | #define VS_REGKEY_CLASSES_ROOT HKEY_CLASSES_ROOT 23 | #define VS_REGKEY_LOCAL_MACHINE HKEY_LOCAL_MACHINE 24 | #define VS_REGTYPE_SZ REG_SZ 25 | #define VS_REGTYPE_DWORD REG_DWORD 26 | #define VS_REGERROR_SUCCESS ERROR_SUCCESS 27 | #define VS_REGERROR_FAIL 1 28 | #define VS_REG_CREATED_NEW_KEY REG_CREATED_NEW_KEY 29 | #define VS_REG_OPENED_EXISTING_KEY REG_OPENED_EXISTING_KEY 30 | #endif 31 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) || defined(USR_XML_REG) 32 | struct StructOfVSRegKey{ 33 | VS_CHAR Buf[512]; /*--Max Key Length--*/ 34 | }; 35 | typedef struct StructOfVSRegKey * vs_reg_hkey; 36 | #define VS_REGKEY_CURRENT_USER ((vs_reg_hkey)0x00000001) 37 | #define VS_REGKEY_CLASSES_ROOT ((vs_reg_hkey)0x00000002) 38 | #define VS_REGKEY_LOCAL_MACHINE ((vs_reg_hkey)0x00000003) 39 | #define VS_REGTYPE_SZ 0 40 | #define VS_REGTYPE_DWORD 1 41 | #define VS_REGERROR_SUCCESS 0 42 | #define VS_REGERROR_FAIL 1 43 | #define VS_REG_CREATED_NEW_KEY 1 44 | #define VS_REG_OPENED_EXISTING_KEY 2 45 | #endif 46 | 47 | #if defined(__cplusplus) || defined(c_plusplus) 48 | class ClassOfCoreShellInterface{ 49 | public: 50 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) 51 | virtual ~ClassOfCoreShellInterface(){}; 52 | #endif 53 | virtual void SRPAPI Release() = 0; 54 | 55 | /*if StrLength == -1 then auto calc */ 56 | /* return is null-terminated string */ 57 | /* default for unicode is UTF-16LE and UTF-32LE */ 58 | /* ToCode set to NULL for default */ 59 | /* CodePage set to VS_CP_UTF8 or VS_CP_ACP */ 60 | virtual VS_INT8 *SRPAPI AnsiToUnicode(VS_UINT32 CodePage,const VS_CHAR *ToCode,const VS_INT8 *AnsiStr,VS_INT32 StrLength)= 0; /*ToCode is ignore on windows, maybe UCS2 UCS4 UTF-16 UTF-32 UTF-16BE UTF-16LE UTF-32BE UTF-32LE */ 61 | /* FromCode set to NULL for default */ 62 | /* CodePage set to VS_CP_UTF8 or VS_CP_ACP */ 63 | virtual VS_INT8 *SRPAPI UnicodeToAnsi(const VS_CHAR *FromCode,VS_UINT32 CodePage,const VS_INT8 *WideStr,VS_INT32 StrLength,VS_INT32 BytesPerChar)= 0; /*BytesPerChar(2/4) is ignore on windows , StrLength is bytes of WideStr */ 64 | virtual VS_INT8 *SRPAPI AnsiToUTF8(const VS_INT8 *AnsiStr,VS_INT32 StrLength)= 0; 65 | virtual VS_INT8 *SRPAPI UTF8ToAnsi(const VS_INT8 *UTFStr,VS_INT32 StrLength)= 0; 66 | virtual VS_INT8 *SRPAPI ToOSPlatString(const VS_INT8 *Str,VS_INT32 StrLength)= 0; /*for linux: discard \r, and reserved \n, for win32 use \r\n */ 67 | virtual VS_INT8 *SRPAPI ToOSPlatStringEx(VS_UINT32 OSType,const VS_INT8 *Str,VS_INT32 StrLength)= 0; /*for linux: discard \r, and reserved \n, for win32 use \r\n */ 68 | /*the return value of above functions is free by the following function */ 69 | virtual void SRPAPI FreeBuf(void *Buf)= 0; 70 | 71 | virtual void SRPAPI vs_reg_beginlock(void)=0; 72 | virtual void SRPAPI vs_reg_endlock(void)=0; 73 | 74 | virtual VS_ULONG SRPAPI vs_reg_createkeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey,const VS_CHAR *Class,vs_reg_hkey *RetKey,VS_ULONG *DisPosition)= 0; 75 | virtual VS_ULONG SRPAPI vs_reg_closekey(vs_reg_hkey hKey)= 0; 76 | virtual VS_ULONG SRPAPI vs_reg_setvalue(vs_reg_hkey hKey,const VS_CHAR *ValueName,VS_ULONG Type,const VS_CHAR *Value,VS_ULONG ValueSize)= 0; 77 | virtual VS_ULONG SRPAPI vs_reg_openkeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey,vs_reg_hkey *RetKey)= 0; 78 | virtual VS_ULONG SRPAPI vs_reg_queryvalueex(vs_reg_hkey hKey,const VS_CHAR *ValueName,VS_ULONG *Type,VS_UINT8 *DataBuf,VS_ULONG *DataBufSize)= 0; 79 | virtual VS_ULONG SRPAPI vs_reg_deletekeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey)= 0; 80 | virtual VS_ULONG SRPAPI vs_reg_enumkey(vs_reg_hkey hKey,VS_ULONG Index,VS_CHAR *NameBuf,VS_ULONG NameBufSize)= 0; 81 | 82 | virtual VS_INT32 SRPAPI GetCharBytes(const VS_INT8 *Buf) = 0; 83 | 84 | virtual VS_INT8 *SRPAPI ToAnsi(const VS_CHAR *Locale,const VS_INT8 *Str)= 0; 85 | virtual VS_INT8 *SRPAPI FromAnsi(const VS_CHAR *Locale,const VS_INT8 *Str)= 0; 86 | /*---note : FromLocale and ToLocale, "ansi" means local chareset. */ 87 | /* InBufSize is the valid byte for input buf in bytes, maybe -1 for normal string */ 88 | /* RetBufSize is the retbuf size in bytes, may be null */ 89 | virtual VS_INT8 *SRPAPI vs_iconv(const VS_CHAR *FromLocale,const VS_CHAR *ToLocale,const VS_INT8 *InBuf,VS_INT32 InBufSize,VS_INT32 *RetBufSize)= 0; 90 | 91 | /*---v2.5.1--*/ 92 | virtual VS_INT8 *SRPAPI AnsiToUnicodeEx(VS_UINT32 CodePage,const VS_CHAR *ToCode,const VS_INT8 *AnsiStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; /* StrLength and RetBufLength is bytes of return buffer */ 93 | virtual VS_INT8 *SRPAPI UnicodeToAnsiEx(const VS_CHAR *FromCode,VS_UINT32 CodePage,const VS_INT8 *WideStr,VS_INT32 StrLength,VS_INT32 BytesPerChar,VS_INT32 *RetBufLength)= 0; /* StrLength and RetBufLength is bytes of return buffer */ 94 | virtual VS_INT8 *SRPAPI AnsiToUTF8Ex(const VS_INT8 *AnsiStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; 95 | virtual VS_INT8 *SRPAPI UTF8ToAnsiEx(const VS_INT8 *UTFStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; 96 | }; 97 | 98 | #endif 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /starflut/macos/include/starcore/vsopenmemorydisk.h: -------------------------------------------------------------------------------- 1 | #ifndef _VSMEMORYDISK 2 | #define _VSMEMORYDISK 3 | 4 | #include "vsopenapi.h" 5 | 6 | #define VSMEMORYDISKFILE_HEADTAG "VSEXECUTEFILE1" 7 | 8 | struct StructOfVSMemoryDiskFileHeader{ 9 | /*---FileHeader 128Bytes fixed*/ 10 | VS_CHAR Tag[16]; 11 | VS_CHAR ServiceName[64]; 12 | VS_UUID FileHeaderUUID; /*---if does not match with server, need not download*/ 13 | VS_ULONG UnCompressLength; 14 | VS_ULONG CompressLength; 15 | VS_UINT32 SupportOsType; 16 | VS_UINT8 CoreVersion; /*--0 for randxor 1 for randxor1*/ 17 | VS_UINT8 Reserved0[3]; 18 | VS_CHAR ScriptInterface[16]; 19 | VS_UINT8 Reserved[64]; 20 | /*VS_CHAR StartFileName[256]; 0 is end*/ 21 | }; 22 | /*Depend Service Name List : ServiceName1,0,DownLoadType1,...,0*/ 23 | /*0 is end of Header part*/ 24 | /*ex: DownLoadType1 == 0 default download from http://www.srplab.com, ==1 include in the file, ==2 download from current website*/ 25 | 26 | /*--------------------------------------------------------*/ 27 | /*FileHeader*/ 28 | /*0 is end*/ 29 | /*extend data size*/ 30 | /*extend data*/ 31 | /*DependFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 32 | /*0 is end*/ 33 | /*ServiceFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 34 | /*0 is end*/ 35 | /*DataFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 36 | /*0 is end*/ 37 | 38 | /*file path and name, UnCompressedSize,CompressedSize,FileMD5*/ 39 | /*0 is end*/ 40 | /*extend data size*/ 41 | /*extend data*/ 42 | 43 | /*file begin,FileStartOffset*/ 44 | /*....reserved*/ 45 | /*file1 data, -----FileStartOffset*/ 46 | /*file2 data, -----FileStartOffset + Offset*/ 47 | /*....*/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /starflut/macos/libstarlib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/macos/libstarlib.a -------------------------------------------------------------------------------- /starflut/macos/starcore/libstarcore.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/macos/starcore/libstarcore.dylib -------------------------------------------------------------------------------- /starflut/macos/starflut.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint starflut.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'starflut' 7 | s.version = '1.0.0' 8 | s.summary = 'bridge for flutter interact with other programming languages' 9 | s.description = <<-DESC 10 | bridge for flutter interact with other programming languages, such as c/c++ lua, python, ruby, golang, rust, etc. 11 | DESC 12 | s.homepage = 'http://www.srplab.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'srplab' => 'srplab.cn@hotmail.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.public_header_files = 'Classes/**/*.{h}' 18 | s.dependency 'FlutterMacOS' 19 | 20 | s.resources = ['starcore/*'] 21 | s.libraries = 'starlib' 22 | s.compiler_flags = '-DENV_MACOS -DENV_M64' 23 | 24 | current_path_ori = __FILE__ 25 | current_path = current_path_ori[0..current_path_ori.rindex("/")-1] # Dir::pwd 26 | 27 | s.xcconfig = {'HEADER_SEARCH_PATHS' => current_path + '/include/starcore','LIBRARY_SEARCH_PATHS' => current_path} 28 | 29 | s.platform = :osx, '10.11' 30 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 31 | s.swift_version = '5.0' 32 | end 33 | -------------------------------------------------------------------------------- /starflut/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.5.0-nullsafety.3" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0-nullsafety.3" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.1.0-nullsafety.5" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.2.0-nullsafety.3" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.0-nullsafety.3" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.15.0-nullsafety.5" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "2.1.5" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "1.2.0-nullsafety.3" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | matcher: 78 | dependency: transitive 79 | description: 80 | name: matcher 81 | url: "https://pub.flutter-io.cn" 82 | source: hosted 83 | version: "0.12.10-nullsafety.3" 84 | meta: 85 | dependency: transitive 86 | description: 87 | name: meta 88 | url: "https://pub.flutter-io.cn" 89 | source: hosted 90 | version: "1.3.0-nullsafety.6" 91 | path: 92 | dependency: transitive 93 | description: 94 | name: path 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "1.8.0-nullsafety.3" 98 | sky_engine: 99 | dependency: transitive 100 | description: flutter 101 | source: sdk 102 | version: "0.0.99" 103 | source_span: 104 | dependency: transitive 105 | description: 106 | name: source_span 107 | url: "https://pub.flutter-io.cn" 108 | source: hosted 109 | version: "1.8.0-nullsafety.4" 110 | stack_trace: 111 | dependency: transitive 112 | description: 113 | name: stack_trace 114 | url: "https://pub.flutter-io.cn" 115 | source: hosted 116 | version: "1.10.0-nullsafety.6" 117 | stream_channel: 118 | dependency: transitive 119 | description: 120 | name: stream_channel 121 | url: "https://pub.flutter-io.cn" 122 | source: hosted 123 | version: "2.1.0-nullsafety.3" 124 | string_scanner: 125 | dependency: transitive 126 | description: 127 | name: string_scanner 128 | url: "https://pub.flutter-io.cn" 129 | source: hosted 130 | version: "1.1.0-nullsafety.3" 131 | term_glyph: 132 | dependency: transitive 133 | description: 134 | name: term_glyph 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "1.2.0-nullsafety.3" 138 | test_api: 139 | dependency: transitive 140 | description: 141 | name: test_api 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "0.2.19-nullsafety.6" 145 | typed_data: 146 | dependency: transitive 147 | description: 148 | name: typed_data 149 | url: "https://pub.flutter-io.cn" 150 | source: hosted 151 | version: "1.3.0-nullsafety.5" 152 | uuid: 153 | dependency: "direct main" 154 | description: 155 | name: uuid 156 | url: "https://pub.flutter-io.cn" 157 | source: hosted 158 | version: "2.2.2" 159 | vector_math: 160 | dependency: transitive 161 | description: 162 | name: vector_math 163 | url: "https://pub.flutter-io.cn" 164 | source: hosted 165 | version: "2.1.0-nullsafety.5" 166 | sdks: 167 | dart: ">=2.12.0-0.0 <3.0.0" 168 | flutter: ">=1.20.0" 169 | -------------------------------------------------------------------------------- /starflut/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: starflut 2 | description: A new flutter plugin project,which supports flutter to interact with other scripting languages such as python, java, ruby, golang, rust, etc. It is easy to use, supports android, ios, and desktop 3 | version: 1.0.0 4 | homepage: https://github.com/srplab/starcore_for_flutter 5 | 6 | environment: 7 | sdk: ">=2.7.0 <3.0.0" 8 | flutter: ">=1.20.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | uuid: ^2.2.2 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | # For information on the generic Dart part of this file, see the 20 | # following page: https://dart.dev/tools/pub/pubspec 21 | 22 | # The following section is specific to Flutter. 23 | flutter: 24 | # This section identifies this Flutter project as a plugin project. 25 | # The 'pluginClass' and Android 'package' identifiers should not ordinarily 26 | # be modified. They are used by the tooling to maintain consistency when 27 | # adding or updating assets for this project. 28 | plugin: 29 | platforms: 30 | android: 31 | package: com.srplab.starflut 32 | pluginClass: StarflutPlugin 33 | ios: 34 | pluginClass: StarflutPlugin 35 | linux: 36 | pluginClass: StarflutPlugin 37 | windows: 38 | pluginClass: StarflutPlugin 39 | macos: 40 | pluginClass: StarflutPlugin 41 | 42 | # To add assets to your plugin package, add an assets section, like this: 43 | # assets: 44 | # - images/a_dot_burr.jpeg 45 | # - images/a_dot_ham.jpeg 46 | # 47 | # For details regarding assets in packages, see 48 | # https://flutter.dev/assets-and-images/#from-packages 49 | # 50 | # An image asset can refer to one or more resolution-specific "variants", see 51 | # https://flutter.dev/assets-and-images/#resolution-aware. 52 | 53 | # To add custom fonts to your plugin package, add a fonts section here, 54 | # in this "flutter" section. Each entry in this list should have a 55 | # "family" key with the font family name, and a "fonts" key with a 56 | # list giving the asset and other descriptors for the font. For 57 | # example: 58 | # fonts: 59 | # - family: Schyler 60 | # fonts: 61 | # - asset: fonts/Schyler-Regular.ttf 62 | # - asset: fonts/Schyler-Italic.ttf 63 | # style: italic 64 | # - family: Trajan Pro 65 | # fonts: 66 | # - asset: fonts/TrajanPro.ttf 67 | # - asset: fonts/TrajanPro_Bold.ttf 68 | # weight: 700 69 | # 70 | # For details regarding fonts in packages, see 71 | # https://flutter.dev/custom-fonts/#from-packages 72 | -------------------------------------------------------------------------------- /starflut/starflut.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /starflut/test/starflut_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:starflut/starflut.dart'; 4 | 5 | void main() { 6 | const MethodChannel channel = MethodChannel('starflut'); 7 | 8 | TestWidgetsFlutterBinding.ensureInitialized(); 9 | 10 | setUp(() { 11 | channel.setMockMethodCallHandler((MethodCall methodCall) async { 12 | return '42'; 13 | }); 14 | }); 15 | 16 | tearDown(() { 17 | channel.setMockMethodCallHandler(null); 18 | }); 19 | 20 | test('getPlatformVersion', () async { 21 | expect(await Starflut.platformVersion, '42'); 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /starflut/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /starflut/windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | set(PROJECT_NAME "starflut") 3 | project(${PROJECT_NAME} LANGUAGES CXX C) 4 | 5 | # This value is used when generating builds using this plugin, so it must 6 | # not be changed 7 | set(PLUGIN_NAME "starflut_plugin") 8 | 9 | add_library(${PLUGIN_NAME} SHARED 10 | "starflut_plugin.cpp" 11 | "starflut_plugin_common.cpp" 12 | "md5proc.cpp" 13 | "srplib_main.cpp" 14 | "vs_shell.c" 15 | ) 16 | apply_standard_settings(${PLUGIN_NAME}) 17 | set_target_properties(${PLUGIN_NAME} PROPERTIES 18 | CXX_VISIBILITY_PRESET hidden) 19 | target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) 20 | target_include_directories(${PLUGIN_NAME} INTERFACE 21 | "${CMAKE_CURRENT_SOURCE_DIR}/include") 22 | target_include_directories(${PLUGIN_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include/starcore") 23 | target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) 24 | 25 | #add by starcore 26 | set(CMAKE_CXX_FLAGS "-DENV_WINDOWS -D_CRT_SECURE_NO_WARNINGS ${CMAKE_CXX_FLAGS}") 27 | set(CMAKE_C_FLAGS "-DENV_WINDOWS -DENV_M64 -D_CRT_SECURE_NO_WARNINGS ${CMAKE_C_FLAGS}") 28 | 29 | # List of absolute paths to libraries that should be bundled with the plugin 30 | set(starflut_bundled_libraries 31 | "" 32 | "${CMAKE_CURRENT_SOURCE_DIR}/starcore" 33 | PARENT_SCOPE 34 | ) 35 | 36 | -------------------------------------------------------------------------------- /starflut/windows/include/starcore/lua/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_BITLIBNAME "bit32" 39 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 40 | 41 | #define LUA_MATHLIBNAME "math" 42 | LUAMOD_API int (luaopen_math) (lua_State *L); 43 | 44 | #define LUA_DBLIBNAME "debug" 45 | LUAMOD_API int (luaopen_debug) (lua_State *L); 46 | 47 | #define LUA_LOADLIBNAME "package" 48 | LUAMOD_API int (luaopen_package) (lua_State *L); 49 | 50 | 51 | /* open all previous libraries */ 52 | LUALIB_API void (luaL_openlibs) (lua_State *L); 53 | 54 | 55 | 56 | #if !defined(lua_assert) 57 | #define lua_assert(x) ((void)0) 58 | #endif 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /starflut/windows/include/starcore/vscoreshell.h: -------------------------------------------------------------------------------- 1 | #ifndef _VSOPENREG 2 | #define _VSOPENREG 3 | 4 | #include "vsopenapi.h" 5 | 6 | #if( VS_OS_TYPE == VS_OS_WINDOWS || VS_OS_TYPE == VS_OS_WP || VS_OS_TYPE == VS_OS_WINRT || VS_OS_TYPE == VS_OS_WIN10 ) 7 | #define VS_CP_ACP CP_ACP 8 | #define VS_CP_UTF8 CP_UTF8 9 | #endif 10 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) 11 | #define VS_CP_ACP 0 12 | #define VS_CP_UTF8 1 13 | #endif 14 | 15 | #define USR_XML_REG 16 | 17 | /*------------------------------------------------------------------------------*/ 18 | /*----Registry functions need to shift to linux : /var/srplab/ */ 19 | #if( VS_OS_TYPE == VS_OS_WINDOWS || VS_OS_TYPE == VS_OS_WP || VS_OS_TYPE == VS_OS_WINRT || VS_OS_TYPE == VS_OS_WIN10 ) && !defined(USR_XML_REG) 20 | typedef HKEY vs_reg_hkey; 21 | #define VS_REGKEY_CURRENT_USER HKEY_CURRENT_USER 22 | #define VS_REGKEY_CLASSES_ROOT HKEY_CLASSES_ROOT 23 | #define VS_REGKEY_LOCAL_MACHINE HKEY_LOCAL_MACHINE 24 | #define VS_REGTYPE_SZ REG_SZ 25 | #define VS_REGTYPE_DWORD REG_DWORD 26 | #define VS_REGERROR_SUCCESS ERROR_SUCCESS 27 | #define VS_REGERROR_FAIL 1 28 | #define VS_REG_CREATED_NEW_KEY REG_CREATED_NEW_KEY 29 | #define VS_REG_OPENED_EXISTING_KEY REG_OPENED_EXISTING_KEY 30 | #endif 31 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) || defined(USR_XML_REG) 32 | struct StructOfVSRegKey{ 33 | VS_CHAR Buf[512]; /*--Max Key Length--*/ 34 | }; 35 | typedef struct StructOfVSRegKey * vs_reg_hkey; 36 | #define VS_REGKEY_CURRENT_USER ((vs_reg_hkey)0x00000001) 37 | #define VS_REGKEY_CLASSES_ROOT ((vs_reg_hkey)0x00000002) 38 | #define VS_REGKEY_LOCAL_MACHINE ((vs_reg_hkey)0x00000003) 39 | #define VS_REGTYPE_SZ 0 40 | #define VS_REGTYPE_DWORD 1 41 | #define VS_REGERROR_SUCCESS 0 42 | #define VS_REGERROR_FAIL 1 43 | #define VS_REG_CREATED_NEW_KEY 1 44 | #define VS_REG_OPENED_EXISTING_KEY 2 45 | #endif 46 | 47 | #if defined(__cplusplus) || defined(c_plusplus) 48 | class ClassOfCoreShellInterface{ 49 | public: 50 | #if( VS_OS_TYPE == VS_OS_LINUX || VS_OS_TYPE == VS_OS_ANDROID || VS_OS_TYPE == VS_OS_ANDROIDV7A || VS_OS_TYPE == VS_OS_ANDROIDX86 || VS_OS_TYPE == VS_OS_IOS || VS_OS_TYPE == VS_OS_MACOS ) 51 | virtual ~ClassOfCoreShellInterface(){}; 52 | #endif 53 | virtual void SRPAPI Release() = 0; 54 | 55 | /*if StrLength == -1 then auto calc */ 56 | /* return is null-terminated string */ 57 | /* default for unicode is UTF-16LE and UTF-32LE */ 58 | /* ToCode set to NULL for default */ 59 | /* CodePage set to VS_CP_UTF8 or VS_CP_ACP */ 60 | virtual VS_INT8 *SRPAPI AnsiToUnicode(VS_UINT32 CodePage,const VS_CHAR *ToCode,const VS_INT8 *AnsiStr,VS_INT32 StrLength)= 0; /*ToCode is ignore on windows, maybe UCS2 UCS4 UTF-16 UTF-32 UTF-16BE UTF-16LE UTF-32BE UTF-32LE */ 61 | /* FromCode set to NULL for default */ 62 | /* CodePage set to VS_CP_UTF8 or VS_CP_ACP */ 63 | virtual VS_INT8 *SRPAPI UnicodeToAnsi(const VS_CHAR *FromCode,VS_UINT32 CodePage,const VS_INT8 *WideStr,VS_INT32 StrLength,VS_INT32 BytesPerChar)= 0; /*BytesPerChar(2/4) is ignore on windows , StrLength is bytes of WideStr */ 64 | virtual VS_INT8 *SRPAPI AnsiToUTF8(const VS_INT8 *AnsiStr,VS_INT32 StrLength)= 0; 65 | virtual VS_INT8 *SRPAPI UTF8ToAnsi(const VS_INT8 *UTFStr,VS_INT32 StrLength)= 0; 66 | virtual VS_INT8 *SRPAPI ToOSPlatString(const VS_INT8 *Str,VS_INT32 StrLength)= 0; /*for linux: discard \r, and reserved \n, for win32 use \r\n */ 67 | virtual VS_INT8 *SRPAPI ToOSPlatStringEx(VS_UINT32 OSType,const VS_INT8 *Str,VS_INT32 StrLength)= 0; /*for linux: discard \r, and reserved \n, for win32 use \r\n */ 68 | /*the return value of above functions is free by the following function */ 69 | virtual void SRPAPI FreeBuf(void *Buf)= 0; 70 | 71 | virtual void SRPAPI vs_reg_beginlock(void)=0; 72 | virtual void SRPAPI vs_reg_endlock(void)=0; 73 | 74 | virtual VS_ULONG SRPAPI vs_reg_createkeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey,const VS_CHAR *Class,vs_reg_hkey *RetKey,VS_ULONG *DisPosition)= 0; 75 | virtual VS_ULONG SRPAPI vs_reg_closekey(vs_reg_hkey hKey)= 0; 76 | virtual VS_ULONG SRPAPI vs_reg_setvalue(vs_reg_hkey hKey,const VS_CHAR *ValueName,VS_ULONG Type,const VS_CHAR *Value,VS_ULONG ValueSize)= 0; 77 | virtual VS_ULONG SRPAPI vs_reg_openkeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey,vs_reg_hkey *RetKey)= 0; 78 | virtual VS_ULONG SRPAPI vs_reg_queryvalueex(vs_reg_hkey hKey,const VS_CHAR *ValueName,VS_ULONG *Type,VS_UINT8 *DataBuf,VS_ULONG *DataBufSize)= 0; 79 | virtual VS_ULONG SRPAPI vs_reg_deletekeyex(vs_reg_hkey hKey,const VS_CHAR *SubKey)= 0; 80 | virtual VS_ULONG SRPAPI vs_reg_enumkey(vs_reg_hkey hKey,VS_ULONG Index,VS_CHAR *NameBuf,VS_ULONG NameBufSize)= 0; 81 | 82 | virtual VS_INT32 SRPAPI GetCharBytes(const VS_INT8 *Buf) = 0; 83 | 84 | virtual VS_INT8 *SRPAPI ToAnsi(const VS_CHAR *Locale,const VS_INT8 *Str)= 0; 85 | virtual VS_INT8 *SRPAPI FromAnsi(const VS_CHAR *Locale,const VS_INT8 *Str)= 0; 86 | /*---note : FromLocale and ToLocale, "ansi" means local chareset. */ 87 | /* InBufSize is the valid byte for input buf in bytes, maybe -1 for normal string */ 88 | /* RetBufSize is the retbuf size in bytes, may be null */ 89 | virtual VS_INT8 *SRPAPI vs_iconv(const VS_CHAR *FromLocale,const VS_CHAR *ToLocale,const VS_INT8 *InBuf,VS_INT32 InBufSize,VS_INT32 *RetBufSize)= 0; 90 | 91 | /*---v2.5.1--*/ 92 | virtual VS_INT8 *SRPAPI AnsiToUnicodeEx(VS_UINT32 CodePage,const VS_CHAR *ToCode,const VS_INT8 *AnsiStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; /* StrLength and RetBufLength is bytes of return buffer */ 93 | virtual VS_INT8 *SRPAPI UnicodeToAnsiEx(const VS_CHAR *FromCode,VS_UINT32 CodePage,const VS_INT8 *WideStr,VS_INT32 StrLength,VS_INT32 BytesPerChar,VS_INT32 *RetBufLength)= 0; /* StrLength and RetBufLength is bytes of return buffer */ 94 | virtual VS_INT8 *SRPAPI AnsiToUTF8Ex(const VS_INT8 *AnsiStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; 95 | virtual VS_INT8 *SRPAPI UTF8ToAnsiEx(const VS_INT8 *UTFStr,VS_INT32 StrLength,VS_INT32 *RetBufLength)= 0; 96 | }; 97 | 98 | #endif 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /starflut/windows/include/starcore/vsopenmemorydisk.h: -------------------------------------------------------------------------------- 1 | #ifndef _VSMEMORYDISK 2 | #define _VSMEMORYDISK 3 | 4 | #include "vsopenapi.h" 5 | 6 | #define VSMEMORYDISKFILE_HEADTAG "VSEXECUTEFILE1" 7 | 8 | struct StructOfVSMemoryDiskFileHeader{ 9 | /*---FileHeader 128Bytes fixed*/ 10 | VS_CHAR Tag[16]; 11 | VS_CHAR ServiceName[64]; 12 | VS_UUID FileHeaderUUID; /*---if does not match with server, need not download*/ 13 | VS_ULONG UnCompressLength; 14 | VS_ULONG CompressLength; 15 | VS_UINT32 SupportOsType; 16 | VS_UINT8 CoreVersion; /*--0 for randxor 1 for randxor1*/ 17 | VS_UINT8 Reserved0[3]; 18 | VS_CHAR ScriptInterface[16]; 19 | VS_UINT8 Reserved[64]; 20 | /*VS_CHAR StartFileName[256]; 0 is end*/ 21 | }; 22 | /*Depend Service Name List : ServiceName1,0,DownLoadType1,...,0*/ 23 | /*0 is end of Header part*/ 24 | /*ex: DownLoadType1 == 0 default download from http://www.srplab.com, ==1 include in the file, ==2 download from current website*/ 25 | 26 | /*--------------------------------------------------------*/ 27 | /*FileHeader*/ 28 | /*0 is end*/ 29 | /*extend data size*/ 30 | /*extend data*/ 31 | /*DependFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 32 | /*0 is end*/ 33 | /*ServiceFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 34 | /*0 is end*/ 35 | /*DataFileFullName,UnCompressedSize,CompressedSize,Offset,FileMD5*/ 36 | /*0 is end*/ 37 | 38 | /*file path and name, UnCompressedSize,CompressedSize,FileMD5*/ 39 | /*0 is end*/ 40 | /*extend data size*/ 41 | /*extend data*/ 42 | 43 | /*file begin,FileStartOffset*/ 44 | /*....reserved*/ 45 | /*file1 data, -----FileStartOffset*/ 46 | /*file2 data, -----FileStartOffset + Offset*/ 47 | /*....*/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /starflut/windows/include/starflut/starflut_plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_PLUGIN_STARFLUT_PLUGIN_H_ 2 | #define FLUTTER_PLUGIN_STARFLUT_PLUGIN_H_ 3 | 4 | #include 5 | 6 | #ifdef FLUTTER_PLUGIN_IMPL 7 | #define FLUTTER_PLUGIN_EXPORT __declspec(dllexport) 8 | #else 9 | #define FLUTTER_PLUGIN_EXPORT __declspec(dllimport) 10 | #endif 11 | 12 | #if defined(__cplusplus) 13 | extern "C" { 14 | #endif 15 | 16 | FLUTTER_PLUGIN_EXPORT void StarflutPluginRegisterWithRegistrar( 17 | FlutterDesktopPluginRegistrarRef registrar); 18 | 19 | #if defined(__cplusplus) 20 | } // extern "C" 21 | #endif 22 | 23 | #endif // FLUTTER_PLUGIN_STARFLUT_PLUGIN_H_ 24 | -------------------------------------------------------------------------------- /starflut/windows/md5proc.h: -------------------------------------------------------------------------------- 1 | #ifndef _MD5PROC 2 | #define _MD5PROC 3 | 4 | #include "vsopendatatype.h" 5 | 6 | extern VS_INT8* MDString (VS_INT8 *string); 7 | extern VS_INT8* MDDataBuf (VS_INT8 *Buf,VS_INT32 BufSize); 8 | extern VS_INT8* MDDataBuf1(VS_INT8 *Buf,VS_INT32 BufSize); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /starflut/windows/srplib_main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/windows/srplib_main.cpp -------------------------------------------------------------------------------- /starflut/windows/starcore/libstarcore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/windows/starcore/libstarcore.dll -------------------------------------------------------------------------------- /starflut/windows/starflut_plugin.cpp: -------------------------------------------------------------------------------- 1 | #include "include/starflut/starflut_plugin.h" 2 | 3 | // This must be included before many other Windows headers. 4 | #include 5 | 6 | // For getPlatformVersion; remove unless needed for your plugin implementation. 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | extern void starflut_plugin_common_init(std::shared_ptr> channel); 18 | extern void starflut_plugin_common_handle_method_call(const flutter::MethodCall& method_call, 19 | std::unique_ptr> result); 20 | 21 | namespace { 22 | 23 | class StarflutPlugin : public flutter::Plugin { 24 | public: 25 | static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar); 26 | 27 | StarflutPlugin(); 28 | 29 | virtual ~StarflutPlugin(); 30 | 31 | private: 32 | // Called when a method is called on this plugin's channel from Dart. 33 | void HandleMethodCall( 34 | const flutter::MethodCall &method_call, 35 | std::unique_ptr> result); 36 | }; 37 | 38 | // static 39 | void StarflutPlugin::RegisterWithRegistrar( 40 | flutter::PluginRegistrarWindows *registrar) { 41 | auto channel = 42 | std::make_shared>( 43 | registrar->messenger(), "starflut", 44 | &flutter::StandardMethodCodec::GetInstance()); 45 | 46 | auto plugin = std::make_unique(); 47 | 48 | channel->SetMethodCallHandler( 49 | [plugin_pointer = plugin.get()](const auto &call, auto result) { 50 | plugin_pointer->HandleMethodCall(call, std::move(result)); 51 | }); 52 | 53 | registrar->AddPlugin(std::move(plugin)); 54 | starflut_plugin_common_init(channel); 55 | } 56 | 57 | StarflutPlugin::StarflutPlugin() { 58 | } 59 | 60 | StarflutPlugin::~StarflutPlugin() {} 61 | 62 | void StarflutPlugin::HandleMethodCall( 63 | const flutter::MethodCall &method_call, 64 | std::unique_ptr> result) { 65 | #if 0 66 | if (method_call.method_name().compare("getPlatformVersion") == 0) { 67 | std::ostringstream version_stream; 68 | version_stream << "Windows "; 69 | if (IsWindows10OrGreater()) { 70 | version_stream << "10+"; 71 | } else if (IsWindows8OrGreater()) { 72 | version_stream << "8"; 73 | } else if (IsWindows7OrGreater()) { 74 | version_stream << "7"; 75 | } 76 | result->Success(flutter::EncodableValue(version_stream.str())); 77 | } else { 78 | result->NotImplemented(); 79 | } 80 | #endif 81 | starflut_plugin_common_handle_method_call(method_call, std::move(result)); 82 | } 83 | 84 | } // namespace 85 | 86 | void StarflutPluginRegisterWithRegistrar( 87 | FlutterDesktopPluginRegistrarRef registrar) { 88 | StarflutPlugin::RegisterWithRegistrar( 89 | flutter::PluginRegistrarManager::GetInstance() 90 | ->GetRegistrar(registrar)); 91 | } 92 | -------------------------------------------------------------------------------- /starflut/windows/vs_shell.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srplab/starcore_for_flutter/9fa3805cb563437f67251357538ca2b147f1730b/starflut/windows/vs_shell.c --------------------------------------------------------------------------------