├── android ├── settings.gradle ├── src │ └── main │ │ └── AndroidManifest.xml ├── .gitignore └── build.gradle ├── screenshot.png ├── example ├── ios │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── 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-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── RunnerTests │ │ └── RunnerTests.swift │ ├── Podfile.lock │ ├── .gitignore │ └── Podfile ├── macos │ ├── Runner │ │ ├── Configs │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ ├── Warnings.xcconfig │ │ │ └── AppInfo.xcconfig │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── app_icon_128.png │ │ │ │ ├── app_icon_16.png │ │ │ │ ├── app_icon_256.png │ │ │ │ ├── app_icon_32.png │ │ │ │ ├── app_icon_512.png │ │ │ │ ├── app_icon_64.png │ │ │ │ ├── app_icon_1024.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Release.entitlements │ │ ├── DebugProfile.entitlements │ │ ├── MainFlutterWindow.swift │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ └── MainMenu.xib │ ├── .gitignore │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── RunnerTests │ │ └── RunnerTests.swift │ ├── Podfile.lock │ └── Podfile ├── android │ ├── gradle.properties │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── 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 │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── re_svg_example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── build.gradle │ └── settings.gradle ├── README.md ├── .gitignore ├── analysis_options.yaml ├── pubspec.yaml └── pubspec.lock ├── analysis_options.yaml ├── CHANGELOG.md ├── src ├── CMakeLists.txt ├── re_svg.c ├── re_svg.h └── resvg.h ├── ffigen.yaml ├── macos ├── Classes │ ├── ReSvgPlugin.swift │ └── resvg.h └── re_svg.podspec ├── .gitignore ├── ios ├── Classes │ ├── ReSvgPlugin.swift │ └── resvg.h └── re_svg.podspec ├── LICENSE ├── .metadata ├── README.md ├── pubspec.yaml └── lib ├── re_svg.dart └── resvg_ffi.dart /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 're_svg' 2 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/screenshot.png -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .cxx 10 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustui/re_svg/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/re_svg_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.re_svg_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() 6 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.5 2 | 3 | * Add Android(x86_64) support. 4 | 5 | ## 0.0.4 6 | 7 | * Add MacOS support. 8 | 9 | ## 0.0.3 10 | 11 | * Add Android support. 12 | 13 | ## 0.0.2 14 | 15 | * Add `ReSvg` class. 16 | 17 | ## 0.0.1 18 | 19 | * Initial release. 20 | -------------------------------------------------------------------------------- /example/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-7.6.3-all.zip 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import re_svg 9 | 10 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 11 | ReSvgPlugin.register(with: registry.registrar(forPlugin: "ReSvgPlugin")) 12 | } 13 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /example/macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = "../build" 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(":app") 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 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 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The Flutter tooling requires that developers have CMake 3.10 or later 2 | # installed. You should not increase this version, as doing so will cause 3 | # the plugin to fail to compile for some customers of the plugin. 4 | cmake_minimum_required(VERSION 3.10) 5 | 6 | project(re_svg_library VERSION 0.0.1 LANGUAGES C) 7 | 8 | add_library(re_svg SHARED 9 | "re_svg.c" 10 | ) 11 | 12 | set_target_properties(re_svg PROPERTIES 13 | PUBLIC_HEADER re_svg.h 14 | OUTPUT_NAME "re_svg" 15 | ) 16 | 17 | target_compile_definitions(re_svg PUBLIC DART_SHARED_LIB) 18 | -------------------------------------------------------------------------------- /ffigen.yaml: -------------------------------------------------------------------------------- 1 | # Run with `dart run ffigen --config ffigen.yaml`. 2 | name: ReSvgBindings 3 | description: | 4 | Bindings for `src/resvg.h`. 5 | 6 | Regenerate bindings with `dart run ffigen --config ffigen.yaml`. 7 | output: 'lib/resvg_bindings_generated.dart' 8 | headers: 9 | entry-points: 10 | - 'src/resvg.h' 11 | include-directives: 12 | - 'src/resvg.h' 13 | preamble: | 14 | // ignore_for_file: always_specify_types 15 | // ignore_for_file: camel_case_types 16 | // ignore_for_file: non_constant_identifier_names 17 | comments: 18 | style: any 19 | length: full 20 | -------------------------------------------------------------------------------- /macos/Classes/ReSvgPlugin.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | 3 | public class ReSvgPlugin: NSObject, FlutterPlugin { 4 | public static func register(with registrar: FlutterPluginRegistrar) { 5 | 6 | } 7 | 8 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 9 | 10 | } 11 | 12 | public func dummy() { 13 | print(resvg_options_create) 14 | print(resvg_options_destroy) 15 | print(resvg_parse_tree_from_data) 16 | print(resvg_tree_destroy) 17 | print(resvg_get_image_size) 18 | print(resvg_transform_identity) 19 | print(resvg_render) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # re_svg_example 2 | 3 | Demonstrates how to use the re_svg 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://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | build/ 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = re_svg_example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reSvgExample 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - re_svg (0.0.1): 4 | - Flutter 5 | - resvg (~> 0.1.2) 6 | - resvg (0.1.2) 7 | 8 | DEPENDENCIES: 9 | - Flutter (from `Flutter`) 10 | - re_svg (from `.symlinks/plugins/re_svg/ios`) 11 | 12 | SPEC REPOS: 13 | trunk: 14 | - resvg 15 | 16 | EXTERNAL SOURCES: 17 | Flutter: 18 | :path: Flutter 19 | re_svg: 20 | :path: ".symlinks/plugins/re_svg/ios" 21 | 22 | SPEC CHECKSUMS: 23 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 24 | re_svg: 64ecdbb41724c0c27e42a64dbd7de56c4180c578 25 | resvg: 0c79160ff7225147153f9c8e2bda5377714a4a54 26 | 27 | PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796 28 | 29 | COCOAPODS: 1.15.2 30 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/macos/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FlutterMacOS (1.0.0) 3 | - re_svg (0.0.1): 4 | - FlutterMacOS 5 | - resvg (~> 0.1.2) 6 | - resvg (0.1.2) 7 | 8 | DEPENDENCIES: 9 | - FlutterMacOS (from `Flutter/ephemeral`) 10 | - re_svg (from `Flutter/ephemeral/.symlinks/plugins/re_svg/macos`) 11 | 12 | SPEC REPOS: 13 | trunk: 14 | - resvg 15 | 16 | EXTERNAL SOURCES: 17 | FlutterMacOS: 18 | :path: Flutter/ephemeral 19 | re_svg: 20 | :path: Flutter/ephemeral/.symlinks/plugins/re_svg/macos 21 | 22 | SPEC CHECKSUMS: 23 | FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 24 | re_svg: f7472ad76f7b93ef83754d513c4717c35a07456a 25 | resvg: 0c79160ff7225147153f9c8e2bda5377714a4a54 26 | 27 | PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 28 | 29 | COCOAPODS: 1.15.2 30 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "7.3.0" apply false 22 | id "org.jetbrains.kotlin.android" version "1.9.25" apply false 23 | } 24 | 25 | include ":app" 26 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Symbolication related 35 | app.*.symbols 36 | 37 | # Obfuscation related 38 | app.*.map.json 39 | 40 | # Android Studio will place build artifacts here 41 | /android/app/debug 42 | /android/app/profile 43 | /android/app/release 44 | -------------------------------------------------------------------------------- /ios/Classes/ReSvgPlugin.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | 3 | public class ReSvgPlugin: NSObject, FlutterPlugin { 4 | public static func register(with registrar: FlutterPluginRegistrar) { 5 | let channel = FlutterMethodChannel(name: "re_svg", binaryMessenger: registrar.messenger()) 6 | let instance = ReSvgPlugin() 7 | registrar.addMethodCallDelegate(instance, channel: channel) 8 | } 9 | 10 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 11 | switch call.method { 12 | default: 13 | result(FlutterMethodNotImplemented) 14 | } 15 | } 16 | 17 | public func dummy(){ 18 | print(resvg_options_create) 19 | print(resvg_options_destroy) 20 | print(resvg_parse_tree_from_data) 21 | print(resvg_tree_destroy) 22 | print(resvg_get_image_size) 23 | print(resvg_transform_identity) 24 | print(resvg_render) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/re_svg.c: -------------------------------------------------------------------------------- 1 | #include "re_svg.h" 2 | 3 | // A very short-lived native function. 4 | // 5 | // For very short-lived functions, it is fine to call them on the main isolate. 6 | // They will block the Dart execution while running the native function, so 7 | // only do this for native functions which are guaranteed to be short-lived. 8 | FFI_PLUGIN_EXPORT int sum(int a, int b) { return a + b; } 9 | 10 | // A longer-lived native function, which occupies the thread calling it. 11 | // 12 | // Do not call these kind of native functions in the main isolate. They will 13 | // block Dart execution. This will cause dropped frames in Flutter applications. 14 | // Instead, call these native functions on a separate isolate. 15 | FFI_PLUGIN_EXPORT int sum_long_running(int a, int b) { 16 | // Simulate work. 17 | #if _WIN32 18 | Sleep(5000); 19 | #else 20 | usleep(5000 * 1000); 21 | #endif 22 | return a + b; 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/re_svg.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #if _WIN32 6 | #include 7 | #else 8 | #include 9 | #include 10 | #endif 11 | 12 | #if _WIN32 13 | #define FFI_PLUGIN_EXPORT __declspec(dllexport) 14 | #else 15 | #define FFI_PLUGIN_EXPORT 16 | #endif 17 | 18 | // A very short-lived native function. 19 | // 20 | // For very short-lived functions, it is fine to call them on the main isolate. 21 | // They will block the Dart execution while running the native function, so 22 | // only do this for native functions which are guaranteed to be short-lived. 23 | FFI_PLUGIN_EXPORT int sum(int a, int b); 24 | 25 | // A longer lived native function, which occupies the thread calling it. 26 | // 27 | // Do not call these kind of native functions in the main isolate. They will 28 | // block Dart execution. This will cause dropped frames in Flutter applications. 29 | // Instead, call these native functions on a separate isolate. 30 | FFI_PLUGIN_EXPORT int sum_long_running(int a, int b); 31 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024 rustui <90625190+rustui@users.noreply.github.com> 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /macos/re_svg.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint re_svg.podspec` to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 're_svg' 7 | s.version = '0.0.1' 8 | s.summary = 'A new Flutter FFI plugin project.' 9 | s.description = <<-DESC 10 | A new Flutter FFI plugin project. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | 16 | # This will ensure the source files in Classes/ are included in the native 17 | # builds of apps using this FFI plugin. Podspec does not support relative 18 | # paths, so Classes contains a forwarder C file that relatively imports 19 | # `../src/*` so that the C sources can be shared among all target platforms. 20 | s.source = { :path => '.' } 21 | s.source_files = 'Classes/**/*' 22 | s.public_header_files = 'Classes/*.h' 23 | s.static_framework = true 24 | s.dependency 'resvg', '~> 0.1.2' 25 | s.dependency 'FlutterMacOS' 26 | 27 | s.platform = :osx, '10.13' 28 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 29 | s.swift_version = '5.0' 30 | end 31 | -------------------------------------------------------------------------------- /ios/re_svg.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint re_svg.podspec` to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 're_svg' 7 | s.version = '0.0.1' 8 | s.summary = 'A new Flutter FFI plugin project.' 9 | s.description = <<-DESC 10 | A new Flutter FFI plugin project. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | 16 | # This will ensure the source files in Classes/ are included in the native 17 | # builds of apps using this FFI plugin. Podspec does not support relative 18 | # paths, so Classes contains a forwarder C file that relatively imports 19 | # `../src/*` so that the C sources can be shared among all target platforms. 20 | s.source = { :path => '.' } 21 | s.source_files = 'Classes/**/*' 22 | s.public_header_files = 'Classes/*.h' 23 | s.static_framework = true 24 | s.dependency 'resvg', '~> 0.1.2' 25 | s.dependency 'Flutter' 26 | s.platform = :ios, '12.0' 27 | 28 | # Flutter.framework does not contain a i386 slice. 29 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } 30 | s.swift_version = '5.0' 31 | end 32 | -------------------------------------------------------------------------------- /.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: "b0850beeb25f6d5b10426284f506557f66181b36" 8 | channel: "stable" 9 | 10 | project_type: plugin_ffi 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36 17 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36 18 | - platform: android 19 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36 20 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36 21 | - platform: ios 22 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36 23 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36 24 | - platform: macos 25 | create_revision: b0850beeb25f6d5b10426284f506557f66181b36 26 | base_revision: b0850beeb25f6d5b10426284f506557f66181b36 27 | 28 | # User provided section 29 | 30 | # List of Local paths (relative to this file) that should be 31 | # ignored by the migrate tool. 32 | # 33 | # Files that are not part of the templates will be ignored by default. 34 | unmanaged_files: 35 | - 'lib/main.dart' 36 | - 'ios/Runner.xcodeproj/project.pbxproj' 37 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // The Android Gradle Plugin builds the native code with the Android NDK. 2 | 3 | group = "com.example.re_svg" 4 | version = "1.0" 5 | 6 | buildscript { 7 | repositories { 8 | google() 9 | mavenCentral() 10 | } 11 | 12 | dependencies { 13 | // The Android Gradle Plugin knows how to build native code with the NDK. 14 | classpath("com.android.tools.build:gradle:7.3.0") 15 | } 16 | } 17 | 18 | rootProject.allprojects { 19 | repositories { 20 | google() 21 | mavenCentral() 22 | } 23 | } 24 | 25 | apply plugin: "com.android.library" 26 | 27 | android { 28 | if (project.android.hasProperty("namespace")) { 29 | namespace = "com.example.re_svg" 30 | } 31 | 32 | // Bumping the plugin compileSdk version requires all clients of this plugin 33 | // to bump the version in their app. 34 | compileSdk = 34 35 | 36 | // Use the NDK version 37 | // declared in /android/app/build.gradle file of the Flutter project. 38 | // Replace it with a version number if this plugin requires a specific NDK version. 39 | // (e.g. ndkVersion "23.1.7779620") 40 | ndkVersion = android.ndkVersion 41 | 42 | compileOptions { 43 | sourceCompatibility = JavaVersion.VERSION_1_8 44 | targetCompatibility = JavaVersion.VERSION_1_8 45 | } 46 | 47 | defaultConfig { 48 | minSdk = 21 49 | } 50 | } 51 | 52 | dependencies { 53 | implementation 'io.github.rustui:resvg:0.3' 54 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # re_svg 2 | 3 | [![Pub](https://img.shields.io/pub/v/re_svg.svg)](https://pub.dev/packages/re_svg) 4 | 5 | A tiny and super-fast SVG rendering library for Flutter, with CSS support. 6 | 7 | Underneath, the parsing and rendering of SVG run in isolates to prevent any potential frame drops. 8 | 9 | ## Getting Started 10 | re_svg is designed for ease of use. By simply introducing the SvgView widget, SVGs can be rendered correctly. 11 | ```dart 12 | import 'package:re_svg/re_svg.dart'; 13 | 14 | final data = """ 15 | 16 | 17 | 18 | """; 19 | 20 | SvgView( 21 | data: data, 22 | intrinsic: true, 23 | ); 24 | ``` 25 | 26 | ## Screenshot 27 | 28 | ![Screenshot](screenshot.png) 29 | 30 | ## Supported Platforms 31 | - [x] iOS 32 | - [x] Android 33 | - [x] macOS 34 | - [ ] Windows 35 | - [ ] Linux 36 | - [ ] Web 37 | 38 | ## Related Projects 39 | - [resvg_action](https://github.com/rustui/resvg_action) - Use GitHub Actions to compile the Rust library resvg for different platforms. 40 | - [resvg_pod](https://github.com/rustui/resvg_pod) - For the iOS platform, Flutter’s local pod cannot directly download the online static library. Therefore, a new pod is created to download the resvg static library. 41 | - [resvg_module](https://github.com/rustui/resvg_module) - An Android library for dynamically linking the Rust library resvg. 42 | 43 | ## For Rustaceans 44 | This project demonstrates how to integrate Flutter with Rust libraries. -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 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 flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.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 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Re Svg 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | re_svg_example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. 5 | id "dev.flutter.flutter-gradle-plugin" 6 | } 7 | 8 | def localProperties = new Properties() 9 | def localPropertiesFile = rootProject.file("local.properties") 10 | if (localPropertiesFile.exists()) { 11 | localPropertiesFile.withReader("UTF-8") { reader -> 12 | localProperties.load(reader) 13 | } 14 | } 15 | 16 | def flutterVersionCode = localProperties.getProperty("flutter.versionCode") 17 | if (flutterVersionCode == null) { 18 | flutterVersionCode = "1" 19 | } 20 | 21 | def flutterVersionName = localProperties.getProperty("flutter.versionName") 22 | if (flutterVersionName == null) { 23 | flutterVersionName = "1.0" 24 | } 25 | 26 | android { 27 | namespace = "com.example.re_svg_example" 28 | compileSdk = flutter.compileSdkVersion 29 | ndkVersion = flutter.ndkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility = JavaVersion.VERSION_1_8 33 | targetCompatibility = JavaVersion.VERSION_1_8 34 | } 35 | 36 | defaultConfig { 37 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 38 | applicationId = "com.example.re_svg_example" 39 | // You can update the following values to match your application needs. 40 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 41 | minSdk = flutter.minSdkVersion 42 | targetSdk = flutter.targetSdkVersion 43 | versionCode = flutterVersionCode.toInteger() 44 | versionName = flutterVersionName 45 | } 46 | 47 | buildTypes { 48 | release { 49 | // TODO: Add your own signing config for the release build. 50 | // Signing with the debug keys for now, so `flutter run --release` works. 51 | signingConfig = signingConfigs.debug 52 | } 53 | } 54 | } 55 | 56 | flutter { 57 | source = "../.." 58 | } 59 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: re_svg 2 | description: "A tiny and super-fast SVG rendering library for Flutter, with CSS support." 3 | version: 0.0.5 4 | homepage: https://github.com/rustui/re_svg 5 | repository: https://github.com/rustui/re_svg 6 | 7 | environment: 8 | sdk: '>=3.4.3 <4.0.0' 9 | flutter: '>=3.3.0' 10 | 11 | dependencies: 12 | ffi: ^2.1.2 13 | flutter: 14 | sdk: flutter 15 | plugin_platform_interface: ^2.0.2 16 | 17 | dev_dependencies: 18 | ffigen: ^13.0.0 19 | flutter_test: 20 | sdk: flutter 21 | flutter_lints: ^4.0.0 22 | 23 | # For information on the generic Dart part of this file, see the 24 | # following page: https://dart.dev/tools/pub/pubspec 25 | 26 | # The following section is specific to Flutter packages. 27 | flutter: 28 | # This section identifies this Flutter project as a plugin project. 29 | # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) 30 | # which should be registered in the plugin registry. This is required for 31 | # using method channels. 32 | # The Android 'package' specifies package in which the registered class is. 33 | # This is required for using method channels on Android. 34 | # The 'ffiPlugin' specifies that native code should be built and bundled. 35 | # This is required for using `dart:ffi`. 36 | # All these are used by the tooling to maintain consistency when 37 | # adding or updating assets for this project. 38 | # 39 | # Please refer to README.md for a detailed explanation. 40 | plugin: 41 | platforms: 42 | ios: 43 | ffiPlugin: true 44 | pluginClass: ReSvgPlugin 45 | android: 46 | ffiPlugin: true 47 | macos: 48 | ffiPlugin: true 49 | pluginClass: ReSvgPlugin 50 | 51 | # To add assets to your plugin package, add an assets section, like this: 52 | # assets: 53 | # - images/a_dot_burr.jpeg 54 | # - images/a_dot_ham.jpeg 55 | # 56 | # For details regarding assets in packages, see 57 | # https://flutter.dev/assets-and-images/#from-packages 58 | # 59 | # An image asset can refer to one or more resolution-specific "variants", see 60 | # https://flutter.dev/assets-and-images/#resolution-aware 61 | 62 | # To add custom fonts to your plugin package, add a fonts section here, 63 | # in this "flutter" section. Each entry in this list should have a 64 | # "family" key with the font family name, and a "fonts" key with a 65 | # list giving the asset and other descriptors for the font. For 66 | # example: 67 | # fonts: 68 | # - family: Schyler 69 | # fonts: 70 | # - asset: fonts/Schyler-Regular.ttf 71 | # - asset: fonts/Schyler-Italic.ttf 72 | # style: italic 73 | # - family: Trajan Pro 74 | # fonts: 75 | # - asset: fonts/TrajanPro.ttf 76 | # - asset: fonts/TrajanPro_Bold.ttf 77 | # weight: 700 78 | # 79 | # For details regarding fonts in packages, see 80 | # https://flutter.dev/custom-fonts/#from-packages 81 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /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 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: re_svg_example 2 | description: "Demonstrates how to use the re_svg plugin." 3 | # The following line prevents the package from being accidentally published to 4 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # In Android, build-name is used as versionName while build-number used as versionCode. 13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 15 | # Read more about iOS versioning at 16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 17 | # In Windows, build-name is used as the major, minor, and patch parts 18 | # of the product and file versions while build-number is used as the build suffix. 19 | version: 1.0.0+1 20 | 21 | environment: 22 | sdk: '>=3.4.3 <4.0.0' 23 | 24 | # Dependencies specify other packages that your package needs in order to work. 25 | # To automatically upgrade your package dependencies to the latest versions 26 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 27 | # dependencies can be manually updated by changing the version numbers below to 28 | # the latest version available on pub.dev. To see which dependencies have newer 29 | # versions available, run `flutter pub outdated`. 30 | dependencies: 31 | flutter: 32 | sdk: flutter 33 | 34 | re_svg: 35 | # When depending on this package from a real application you should use: 36 | # re_svg: ^x.y.z 37 | # See https://dart.dev/tools/pub/dependencies#version-constraints 38 | # The example app is bundled with the plugin so we use a path dependency on 39 | # the parent directory to use the current plugin's version. 40 | path: ../ 41 | 42 | # The following adds the Cupertino Icons font to your application. 43 | # Use with the CupertinoIcons class for iOS style icons. 44 | cupertino_icons: ^1.0.6 45 | 46 | dev_dependencies: 47 | flutter_test: 48 | sdk: flutter 49 | 50 | # The "flutter_lints" package below contains a set of recommended lints to 51 | # encourage good coding practices. The lint set provided by the package is 52 | # activated in the `analysis_options.yaml` file located at the root of your 53 | # package. See that file for information about deactivating specific lint 54 | # rules and activating additional ones. 55 | flutter_lints: ^3.0.0 56 | 57 | # For information on the generic Dart part of this file, see the 58 | # following page: https://dart.dev/tools/pub/pubspec 59 | 60 | # The following section is specific to Flutter packages. 61 | flutter: 62 | 63 | # The following line ensures that the Material Icons font is 64 | # included with your application, so that you can use the icons in 65 | # the material Icons class. 66 | uses-material-design: true 67 | 68 | # To add assets to your application, add an assets section, like this: 69 | # assets: 70 | # - images/a_dot_burr.jpeg 71 | # - images/a_dot_ham.jpeg 72 | 73 | # An image asset can refer to one or more resolution-specific "variants", see 74 | # https://flutter.dev/assets-and-images/#resolution-aware 75 | 76 | # For details regarding adding assets from package dependencies, see 77 | # https://flutter.dev/assets-and-images/#from-packages 78 | 79 | # To add custom fonts to your application, add a fonts section here, 80 | # in this "flutter" section. Each entry in this list should have a 81 | # "family" key with the font family name, and a "fonts" key with a 82 | # list giving the asset and other descriptors for the font. For 83 | # example: 84 | # fonts: 85 | # - family: Schyler 86 | # fonts: 87 | # - asset: fonts/Schyler-Regular.ttf 88 | # - asset: fonts/Schyler-Italic.ttf 89 | # style: italic 90 | # - family: Trajan Pro 91 | # fonts: 92 | # - asset: fonts/TrajanPro.ttf 93 | # - asset: fonts/TrajanPro_Bold.ttf 94 | # weight: 700 95 | # 96 | # For details regarding fonts from package dependencies, 97 | # see https://flutter.dev/custom-fonts/#from-packages 98 | -------------------------------------------------------------------------------- /lib/re_svg.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'dart:ui' as ui; 5 | 6 | import 'package:re_svg/resvg_ffi.dart'; 7 | 8 | class SvgView extends StatefulWidget { 9 | final String data; 10 | final bool intrinsic; 11 | 12 | const SvgView({super.key, required this.data, this.intrinsic = false}); 13 | @override 14 | State createState() => _SvgViewState(); 15 | } 16 | 17 | class _SvgViewState extends State { 18 | late Future _reSvg; 19 | 20 | @override 21 | void initState() { 22 | super.initState(); 23 | _reSvg = ReSvg.spawn(widget.data); 24 | } 25 | 26 | @override 27 | void didUpdateWidget(oldWidget) { 28 | super.didUpdateWidget(oldWidget); 29 | 30 | if (widget.data != oldWidget.data) { 31 | _clean(); 32 | _reSvg = ReSvg.spawn(widget.data); 33 | } 34 | } 35 | 36 | @override 37 | void dispose() { 38 | _clean(); 39 | 40 | super.dispose(); 41 | } 42 | 43 | @override 44 | Widget build(BuildContext context) { 45 | return LayoutBuilder(builder: (context, BoxConstraints constraints) { 46 | final devicePixelRatio = MediaQuery.of(context).devicePixelRatio; 47 | return FutureBuilder( 48 | future: _getImage(constraints, devicePixelRatio), 49 | builder: (context, snapshot) { 50 | if (snapshot.hasData) { 51 | return RawImage( 52 | image: snapshot.data, 53 | scale: devicePixelRatio, 54 | ); 55 | } else { 56 | return const CircularProgressIndicator(); 57 | } 58 | }); 59 | }); 60 | } 61 | 62 | Future _getImage( 63 | BoxConstraints constraints, double devicePixelRatio) async { 64 | final reSvg = await _reSvg; 65 | final size = await reSvg.getSize(); 66 | if (size == null) { 67 | return null; 68 | } else { 69 | final (width, height) = 70 | _getPhysicalSize(size, constraints, devicePixelRatio); 71 | final image = await reSvg.render(width, height); 72 | return image; 73 | } 74 | } 75 | 76 | void _clean() { 77 | _reSvg.then((reSvg) => reSvg.close()); 78 | } 79 | 80 | (int, int) _getPhysicalSize( 81 | Size size, BoxConstraints constraints, double devicePixelRatio) { 82 | final ratio = size.width / size.height; 83 | double logicalWidth, logicalHeight; 84 | 85 | if (constraints.maxWidth == double.infinity) { 86 | if (constraints.maxHeight == double.infinity) { 87 | logicalWidth = size.width; 88 | logicalHeight = size.height; 89 | } else { 90 | if (widget.intrinsic) { 91 | if (size.height > constraints.maxHeight) { 92 | logicalHeight = constraints.maxHeight; 93 | logicalWidth = logicalHeight * ratio; 94 | } else { 95 | logicalHeight = size.height; 96 | logicalWidth = size.width; 97 | } 98 | } else { 99 | logicalHeight = constraints.maxHeight; 100 | logicalWidth = logicalHeight * ratio; 101 | } 102 | } 103 | } else if (constraints.maxHeight == double.infinity) { 104 | if (widget.intrinsic) { 105 | if (size.width > constraints.maxWidth) { 106 | logicalWidth = constraints.maxWidth; 107 | logicalHeight = logicalWidth / ratio; 108 | } else { 109 | logicalWidth = size.width; 110 | logicalHeight = size.height; 111 | } 112 | } else { 113 | logicalWidth = constraints.maxWidth; 114 | logicalHeight = logicalWidth / ratio; 115 | } 116 | } else { 117 | final boxRatio = constraints.maxWidth / constraints.maxHeight; 118 | if (ratio > boxRatio) { 119 | if (widget.intrinsic) { 120 | if (size.width > constraints.maxWidth) { 121 | logicalWidth = constraints.maxWidth; 122 | logicalHeight = logicalWidth / ratio; 123 | } else { 124 | logicalWidth = size.width; 125 | logicalHeight = size.height; 126 | } 127 | } else { 128 | logicalWidth = constraints.maxWidth; 129 | logicalHeight = logicalWidth / ratio; 130 | } 131 | } else { 132 | if (widget.intrinsic) { 133 | if (size.height > constraints.maxHeight) { 134 | logicalHeight = constraints.maxHeight; 135 | logicalWidth = logicalHeight * ratio; 136 | } else { 137 | logicalHeight = size.height; 138 | logicalWidth = size.width; 139 | } 140 | } else { 141 | logicalHeight = constraints.maxHeight; 142 | logicalWidth = logicalHeight * ratio; 143 | } 144 | } 145 | } 146 | 147 | final physicalWidth = logicalWidth * devicePixelRatio; 148 | final physicalHeight = logicalHeight * devicePixelRatio; 149 | return (physicalWidth.round(), physicalHeight.round()); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /lib/resvg_ffi.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:ffi' hide Size; 3 | import 'dart:io'; 4 | import 'dart:isolate'; 5 | import 'dart:ui'; 6 | 7 | import 'package:ffi/ffi.dart'; 8 | 9 | import 'resvg_bindings_generated.dart'; 10 | 11 | class _ReSvgSync { 12 | final Pointer> _tree; 13 | final Size size; 14 | final resvg_transform _transform; 15 | bool _closed = false; 16 | _ReSvgSync._(this._tree, this.size, this._transform); 17 | 18 | static _ReSvgSync from(String data) { 19 | final str = data.toNativeUtf8(); 20 | final options = _bindings.resvg_options_create(); 21 | final tree = malloc>(); 22 | _bindings.resvg_parse_tree_from_data(str.cast(), str.length, options, tree); 23 | _bindings.resvg_options_destroy(options); 24 | 25 | final rawSize = _bindings.resvg_get_image_size(tree.value); 26 | final size = Size(rawSize.width, rawSize.height); 27 | 28 | final transform = _bindings.resvg_transform_identity(); 29 | 30 | return _ReSvgSync._(tree, size, transform); 31 | } 32 | 33 | (Pointer, int)? render(int width, int height) { 34 | if (_closed) return null; 35 | _transform.a = width / size.width; 36 | _transform.d = height / size.height; 37 | final length = width * height * 4; 38 | final pixels = malloc(length); 39 | _bindings.resvg_render( 40 | _tree.value, _transform, width, height, pixels.cast()); 41 | 42 | return (pixels, length); 43 | } 44 | 45 | void close() { 46 | if (!_closed) { 47 | _closed = true; 48 | _bindings.resvg_tree_destroy(_tree.value); 49 | malloc.free(_tree); 50 | } 51 | } 52 | } 53 | 54 | class ReSvg { 55 | final SendPort _commands; 56 | final ReceivePort _responses; 57 | final Map> _activeRequests = {}; 58 | int _idCounter = 0; 59 | bool _closed = false; 60 | 61 | Future render(int width, int height) async { 62 | if (_closed) return null; 63 | final completer = Completer.sync(); 64 | final id = _idCounter++; 65 | _activeRequests[id] = completer; 66 | _commands.send(_RenderRequest(id, width, height)); 67 | return await completer.future; 68 | } 69 | 70 | Future getSize() async { 71 | if (_closed) return null; 72 | final completer = Completer.sync(); 73 | final id = _idCounter++; 74 | _activeRequests[id] = completer; 75 | _commands.send(_SizeRequest(id)); 76 | return await completer.future; 77 | } 78 | 79 | static Future spawn(String data) async { 80 | final initPort = RawReceivePort(); 81 | final connection = Completer<(ReceivePort, SendPort)>.sync(); 82 | initPort.handler = (initialMessage) { 83 | final commandPort = initialMessage as SendPort; 84 | connection.complete(( 85 | ReceivePort.fromRawReceivePort(initPort), 86 | commandPort, 87 | )); 88 | }; 89 | 90 | try { 91 | await Isolate.spawn(_startRemoteIsolate, initPort.sendPort); 92 | } on Object { 93 | initPort.close(); 94 | rethrow; 95 | } 96 | 97 | final (ReceivePort receivePort, SendPort sendPort) = 98 | await connection.future; 99 | 100 | sendPort.send(_CreateRequest(data)); 101 | 102 | return ReSvg._(receivePort, sendPort); 103 | } 104 | 105 | ReSvg._(this._responses, this._commands) { 106 | _responses.listen(_handleResponsesFromIsolate); 107 | } 108 | 109 | void _handleResponsesFromIsolate(dynamic message) { 110 | if (message is _Identifiable) { 111 | final completer = _activeRequests.remove(message.id); 112 | if (completer != null) { 113 | if (message is _RenderResponse) { 114 | final pixels = message.pixels; 115 | if (pixels == null) { 116 | completer.complete(null); 117 | } else { 118 | decodeImageFromPixels(pixels.asTypedList(message.length), 119 | message.width, message.height, PixelFormat.rgba8888, (image) { 120 | malloc.free(pixels); 121 | completer.complete(image); 122 | }); 123 | } 124 | } else if (message is _SizeResponse) { 125 | completer.complete(message.size); 126 | } 127 | } 128 | } 129 | 130 | if (_closed && _activeRequests.isEmpty) _responses.close(); 131 | } 132 | 133 | static void _startRemoteIsolate(SendPort sendPort) { 134 | final receivePort = ReceivePort(); 135 | sendPort.send(receivePort.sendPort); 136 | _ReSvgSync? rss; 137 | receivePort.listen((message) { 138 | if (message is _Shutdown) { 139 | receivePort.close(); 140 | rss?.close(); 141 | } else if (message is _CreateRequest) { 142 | rss = _ReSvgSync.from(message.data); 143 | } else if (message is _RenderRequest) { 144 | final result = rss?.render(message.width, message.height); 145 | if (result == null) { 146 | sendPort.send(_RenderResponse(message.id, null, 0, 0, 0)); 147 | } else { 148 | final (pixels, length) = result; 149 | sendPort.send(_RenderResponse( 150 | message.id, pixels, length, message.width, message.height)); 151 | } 152 | } else if (message is _SizeRequest) { 153 | sendPort.send(_SizeResponse(message.id, rss?.size)); 154 | } 155 | }); 156 | } 157 | 158 | void close() { 159 | if (!_closed) { 160 | _closed = true; 161 | _commands.send(_Shutdown()); 162 | if (_activeRequests.isEmpty) _responses.close(); 163 | } 164 | } 165 | } 166 | 167 | const String _libName = 'resvg'; 168 | 169 | /// The dynamic library in which the symbols for [ResvgFfiBindings] can be found. 170 | final DynamicLibrary _dylib = () { 171 | if (Platform.isMacOS || Platform.isIOS) { 172 | return DynamicLibrary.executable(); 173 | } 174 | if (Platform.isAndroid || Platform.isLinux) { 175 | return DynamicLibrary.open('lib$_libName.so'); 176 | } 177 | if (Platform.isWindows) { 178 | return DynamicLibrary.open('$_libName.dll'); 179 | } 180 | throw UnsupportedError('Unknown platform: ${Platform.operatingSystem}'); 181 | }(); 182 | 183 | /// The bindings to the native functions in [_dylib]. 184 | final ReSvgBindings _bindings = ReSvgBindings(_dylib); 185 | 186 | class _Identifiable { 187 | final int id; 188 | 189 | const _Identifiable(this.id); 190 | } 191 | 192 | class _RenderRequest extends _Identifiable { 193 | final int width; 194 | final int height; 195 | 196 | const _RenderRequest(super.id, this.width, this.height); 197 | } 198 | 199 | class _RenderResponse extends _Identifiable { 200 | final Pointer? pixels; 201 | final int length; 202 | final int width; 203 | final int height; 204 | 205 | const _RenderResponse( 206 | super.id, this.pixels, this.length, this.width, this.height); 207 | } 208 | 209 | class _SizeRequest extends _Identifiable { 210 | const _SizeRequest(super.id); 211 | } 212 | 213 | class _SizeResponse extends _Identifiable { 214 | final Size? size; 215 | 216 | const _SizeResponse(super.id, this.size); 217 | } 218 | 219 | class _CreateRequest { 220 | final String data; 221 | 222 | const _CreateRequest(this.data); 223 | } 224 | 225 | class _Shutdown {} 226 | -------------------------------------------------------------------------------- /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 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.18.0" 44 | cupertino_icons: 45 | dependency: "direct main" 46 | description: 47 | name: cupertino_icons 48 | sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.0.8" 52 | fake_async: 53 | dependency: transitive 54 | description: 55 | name: fake_async 56 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.3.1" 60 | ffi: 61 | dependency: transitive 62 | description: 63 | name: ffi 64 | sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "2.1.2" 68 | flutter: 69 | dependency: "direct main" 70 | description: flutter 71 | source: sdk 72 | version: "0.0.0" 73 | flutter_lints: 74 | dependency: "direct dev" 75 | description: 76 | name: flutter_lints 77 | sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" 78 | url: "https://pub.dev" 79 | source: hosted 80 | version: "3.0.2" 81 | flutter_test: 82 | dependency: "direct dev" 83 | description: flutter 84 | source: sdk 85 | version: "0.0.0" 86 | leak_tracker: 87 | dependency: transitive 88 | description: 89 | name: leak_tracker 90 | sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "10.0.4" 94 | leak_tracker_flutter_testing: 95 | dependency: transitive 96 | description: 97 | name: leak_tracker_flutter_testing 98 | sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "3.0.3" 102 | leak_tracker_testing: 103 | dependency: transitive 104 | description: 105 | name: leak_tracker_testing 106 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "3.0.1" 110 | lints: 111 | dependency: transitive 112 | description: 113 | name: lints 114 | sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "3.0.0" 118 | matcher: 119 | dependency: transitive 120 | description: 121 | name: matcher 122 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "0.12.16+1" 126 | material_color_utilities: 127 | dependency: transitive 128 | description: 129 | name: material_color_utilities 130 | sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" 131 | url: "https://pub.dev" 132 | source: hosted 133 | version: "0.8.0" 134 | meta: 135 | dependency: transitive 136 | description: 137 | name: meta 138 | sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" 139 | url: "https://pub.dev" 140 | source: hosted 141 | version: "1.12.0" 142 | path: 143 | dependency: transitive 144 | description: 145 | name: path 146 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 147 | url: "https://pub.dev" 148 | source: hosted 149 | version: "1.9.0" 150 | plugin_platform_interface: 151 | dependency: transitive 152 | description: 153 | name: plugin_platform_interface 154 | sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" 155 | url: "https://pub.dev" 156 | source: hosted 157 | version: "2.1.8" 158 | re_svg: 159 | dependency: "direct main" 160 | description: 161 | path: ".." 162 | relative: true 163 | source: path 164 | version: "0.0.4" 165 | sky_engine: 166 | dependency: transitive 167 | description: flutter 168 | source: sdk 169 | version: "0.0.99" 170 | source_span: 171 | dependency: transitive 172 | description: 173 | name: source_span 174 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "1.10.0" 178 | stack_trace: 179 | dependency: transitive 180 | description: 181 | name: stack_trace 182 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "1.11.1" 186 | stream_channel: 187 | dependency: transitive 188 | description: 189 | name: stream_channel 190 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "2.1.2" 194 | string_scanner: 195 | dependency: transitive 196 | description: 197 | name: string_scanner 198 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 199 | url: "https://pub.dev" 200 | source: hosted 201 | version: "1.2.0" 202 | term_glyph: 203 | dependency: transitive 204 | description: 205 | name: term_glyph 206 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 207 | url: "https://pub.dev" 208 | source: hosted 209 | version: "1.2.1" 210 | test_api: 211 | dependency: transitive 212 | description: 213 | name: test_api 214 | sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" 215 | url: "https://pub.dev" 216 | source: hosted 217 | version: "0.7.0" 218 | vector_math: 219 | dependency: transitive 220 | description: 221 | name: vector_math 222 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 223 | url: "https://pub.dev" 224 | source: hosted 225 | version: "2.1.4" 226 | vm_service: 227 | dependency: transitive 228 | description: 229 | name: vm_service 230 | sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" 231 | url: "https://pub.dev" 232 | source: hosted 233 | version: "14.2.1" 234 | sdks: 235 | dart: ">=3.4.3 <4.0.0" 236 | flutter: ">=3.18.0-18.0.pre.54" 237 | -------------------------------------------------------------------------------- /src/resvg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | /** 8 | * @file resvg.h 9 | * 10 | * resvg C API 11 | */ 12 | 13 | #ifndef RESVG_H 14 | #define RESVG_H 15 | 16 | #include 17 | #include 18 | 19 | #define RESVG_MAJOR_VERSION 0 20 | #define RESVG_MINOR_VERSION 42 21 | #define RESVG_PATCH_VERSION 0 22 | #define RESVG_VERSION "0.42.0" 23 | 24 | /** 25 | * @brief List of possible errors. 26 | */ 27 | typedef enum { 28 | /** 29 | * Everything is ok. 30 | */ 31 | RESVG_OK = 0, 32 | /** 33 | * Only UTF-8 content are supported. 34 | */ 35 | RESVG_ERROR_NOT_AN_UTF8_STR, 36 | /** 37 | * Failed to open the provided file. 38 | */ 39 | RESVG_ERROR_FILE_OPEN_FAILED, 40 | /** 41 | * Compressed SVG must use the GZip algorithm. 42 | */ 43 | RESVG_ERROR_MALFORMED_GZIP, 44 | /** 45 | * We do not allow SVG with more than 1_000_000 elements for security reasons. 46 | */ 47 | RESVG_ERROR_ELEMENTS_LIMIT_REACHED, 48 | /** 49 | * SVG doesn't have a valid size. 50 | * 51 | * Occurs when width and/or height are <= 0. 52 | * 53 | * Also occurs if width, height and viewBox are not set. 54 | */ 55 | RESVG_ERROR_INVALID_SIZE, 56 | /** 57 | * Failed to parse an SVG data. 58 | */ 59 | RESVG_ERROR_PARSING_FAILED, 60 | } resvg_error; 61 | 62 | /** 63 | * @brief A image rendering method. 64 | */ 65 | typedef enum { 66 | RESVG_IMAGE_RENDERING_OPTIMIZE_QUALITY, 67 | RESVG_IMAGE_RENDERING_OPTIMIZE_SPEED, 68 | } resvg_image_rendering; 69 | 70 | /** 71 | * @brief A shape rendering method. 72 | */ 73 | typedef enum { 74 | RESVG_SHAPE_RENDERING_OPTIMIZE_SPEED, 75 | RESVG_SHAPE_RENDERING_CRISP_EDGES, 76 | RESVG_SHAPE_RENDERING_GEOMETRIC_PRECISION, 77 | } resvg_shape_rendering; 78 | 79 | /** 80 | * @brief A text rendering method. 81 | */ 82 | typedef enum { 83 | RESVG_TEXT_RENDERING_OPTIMIZE_SPEED, 84 | RESVG_TEXT_RENDERING_OPTIMIZE_LEGIBILITY, 85 | RESVG_TEXT_RENDERING_GEOMETRIC_PRECISION, 86 | } resvg_text_rendering; 87 | 88 | /** 89 | * @brief An SVG to #resvg_render_tree conversion options. 90 | * 91 | * Also, contains a fonts database used during text to path conversion. 92 | * The database is empty by default. 93 | */ 94 | typedef struct resvg_options resvg_options; 95 | 96 | /** 97 | * @brief An opaque pointer to the rendering tree. 98 | */ 99 | typedef struct resvg_render_tree resvg_render_tree; 100 | 101 | /** 102 | * @brief A 2D transform representation. 103 | */ 104 | typedef struct { 105 | float a; 106 | float b; 107 | float c; 108 | float d; 109 | float e; 110 | float f; 111 | } resvg_transform; 112 | 113 | /** 114 | * @brief A size representation. 115 | */ 116 | typedef struct { 117 | float width; 118 | float height; 119 | } resvg_size; 120 | 121 | /** 122 | * @brief A rectangle representation. 123 | */ 124 | typedef struct { 125 | float x; 126 | float y; 127 | float width; 128 | float height; 129 | } resvg_rect; 130 | 131 | #ifdef __cplusplus 132 | extern "C" { 133 | #endif // __cplusplus 134 | 135 | /** 136 | * @brief Creates an identity transform. 137 | */ 138 | resvg_transform resvg_transform_identity(void); 139 | 140 | /** 141 | * @brief Initializes the library log. 142 | * 143 | * Use it if you want to see any warnings. 144 | * 145 | * Must be called only once. 146 | * 147 | * All warnings will be printed to the `stderr`. 148 | */ 149 | void resvg_init_log(void); 150 | 151 | /** 152 | * @brief Creates a new #resvg_options object. 153 | * 154 | * Should be destroyed via #resvg_options_destroy. 155 | */ 156 | resvg_options *resvg_options_create(void); 157 | 158 | /** 159 | * @brief Sets a directory that will be used during relative paths resolving. 160 | * 161 | * Expected to be the same as the directory that contains the SVG file, 162 | * but can be set to any. 163 | * 164 | * Must be UTF-8. Can be set to NULL. 165 | * 166 | * Default: NULL 167 | */ 168 | void resvg_options_set_resources_dir(resvg_options *opt, const char *path); 169 | 170 | /** 171 | * @brief Sets the target DPI. 172 | * 173 | * Impact units conversion. 174 | * 175 | * Default: 96 176 | */ 177 | void resvg_options_set_dpi(resvg_options *opt, float dpi); 178 | 179 | /** 180 | * @brief Sets the default font family. 181 | * 182 | * Will be used when no `font-family` attribute is set in the SVG. 183 | * 184 | * Must be UTF-8. NULL is not allowed. 185 | * 186 | * Default: Times New Roman 187 | */ 188 | void resvg_options_set_font_family(resvg_options *opt, const char *family); 189 | 190 | /** 191 | * @brief Sets the default font size. 192 | * 193 | * Will be used when no `font-size` attribute is set in the SVG. 194 | * 195 | * Default: 12 196 | */ 197 | void resvg_options_set_font_size(resvg_options *opt, float size); 198 | 199 | /** 200 | * @brief Sets the `serif` font family. 201 | * 202 | * Must be UTF-8. NULL is not allowed. 203 | * 204 | * Has no effect when the `text` feature is not enabled. 205 | * 206 | * Default: Times New Roman 207 | */ 208 | void resvg_options_set_serif_family(resvg_options *opt, const char *family); 209 | 210 | /** 211 | * @brief Sets the `sans-serif` font family. 212 | * 213 | * Must be UTF-8. NULL is not allowed. 214 | * 215 | * Has no effect when the `text` feature is not enabled. 216 | * 217 | * Default: Arial 218 | */ 219 | void resvg_options_set_sans_serif_family(resvg_options *opt, const char *family); 220 | 221 | /** 222 | * @brief Sets the `cursive` font family. 223 | * 224 | * Must be UTF-8. NULL is not allowed. 225 | * 226 | * Has no effect when the `text` feature is not enabled. 227 | * 228 | * Default: Comic Sans MS 229 | */ 230 | void resvg_options_set_cursive_family(resvg_options *opt, const char *family); 231 | 232 | /** 233 | * @brief Sets the `fantasy` font family. 234 | * 235 | * Must be UTF-8. NULL is not allowed. 236 | * 237 | * Has no effect when the `text` feature is not enabled. 238 | * 239 | * Default: Papyrus on macOS, Impact on other OS'es 240 | */ 241 | void resvg_options_set_fantasy_family(resvg_options *opt, const char *family); 242 | 243 | /** 244 | * @brief Sets the `monospace` font family. 245 | * 246 | * Must be UTF-8. NULL is not allowed. 247 | * 248 | * Has no effect when the `text` feature is not enabled. 249 | * 250 | * Default: Courier New 251 | */ 252 | void resvg_options_set_monospace_family(resvg_options *opt, const char *family); 253 | 254 | /** 255 | * @brief Sets a comma-separated list of languages. 256 | * 257 | * Will be used to resolve a `systemLanguage` conditional attribute. 258 | * 259 | * Example: en,en-US. 260 | * 261 | * Must be UTF-8. Can be NULL. 262 | * 263 | * Default: en 264 | */ 265 | void resvg_options_set_languages(resvg_options *opt, const char *languages); 266 | 267 | /** 268 | * @brief Sets the default shape rendering method. 269 | * 270 | * Will be used when an SVG element's `shape-rendering` property is set to `auto`. 271 | * 272 | * Default: `RESVG_SHAPE_RENDERING_GEOMETRIC_PRECISION` 273 | */ 274 | void resvg_options_set_shape_rendering_mode(resvg_options *opt, resvg_shape_rendering mode); 275 | 276 | /** 277 | * @brief Sets the default text rendering method. 278 | * 279 | * Will be used when an SVG element's `text-rendering` property is set to `auto`. 280 | * 281 | * Default: `RESVG_TEXT_RENDERING_OPTIMIZE_LEGIBILITY` 282 | */ 283 | void resvg_options_set_text_rendering_mode(resvg_options *opt, resvg_text_rendering mode); 284 | 285 | /** 286 | * @brief Sets the default image rendering method. 287 | * 288 | * Will be used when an SVG element's `image-rendering` property is set to `auto`. 289 | * 290 | * Default: `RESVG_IMAGE_RENDERING_OPTIMIZE_QUALITY` 291 | */ 292 | void resvg_options_set_image_rendering_mode(resvg_options *opt, resvg_image_rendering mode); 293 | 294 | /** 295 | * @brief Loads a font data into the internal fonts database. 296 | * 297 | * Prints a warning into the log when the data is not a valid TrueType font. 298 | * 299 | * Has no effect when the `text` feature is not enabled. 300 | */ 301 | void resvg_options_load_font_data(resvg_options *opt, const char *data, uintptr_t len); 302 | 303 | /** 304 | * @brief Loads a font file into the internal fonts database. 305 | * 306 | * Prints a warning into the log when the data is not a valid TrueType font. 307 | * 308 | * Has no effect when the `text` feature is not enabled. 309 | * 310 | * @return #resvg_error with RESVG_OK, RESVG_ERROR_NOT_AN_UTF8_STR or RESVG_ERROR_FILE_OPEN_FAILED 311 | */ 312 | int32_t resvg_options_load_font_file(resvg_options *opt, const char *file_path); 313 | 314 | /** 315 | * @brief Loads system fonts into the internal fonts database. 316 | * 317 | * This method is very IO intensive. 318 | * 319 | * This method should be executed only once per #resvg_options. 320 | * 321 | * The system scanning is not perfect, so some fonts may be omitted. 322 | * Please send a bug report in this case. 323 | * 324 | * Prints warnings into the log. 325 | * 326 | * Has no effect when the `text` feature is not enabled. 327 | */ 328 | void resvg_options_load_system_fonts(resvg_options *opt); 329 | 330 | /** 331 | * @brief Destroys the #resvg_options. 332 | */ 333 | void resvg_options_destroy(resvg_options *opt); 334 | 335 | /** 336 | * @brief Creates #resvg_render_tree from file. 337 | * 338 | * .svg and .svgz files are supported. 339 | * 340 | * See #resvg_is_image_empty for details. 341 | * 342 | * @param file_path UTF-8 file path. 343 | * @param opt Rendering options. Must not be NULL. 344 | * @param tree Parsed render tree. Should be destroyed via #resvg_tree_destroy. 345 | * @return #resvg_error 346 | */ 347 | int32_t resvg_parse_tree_from_file(const char *file_path, 348 | const resvg_options *opt, 349 | resvg_render_tree **tree); 350 | 351 | /** 352 | * @brief Creates #resvg_render_tree from data. 353 | * 354 | * See #resvg_is_image_empty for details. 355 | * 356 | * @param data SVG data. Can contain SVG string or gzip compressed data. Must not be NULL. 357 | * @param len Data length. 358 | * @param opt Rendering options. Must not be NULL. 359 | * @param tree Parsed render tree. Should be destroyed via #resvg_tree_destroy. 360 | * @return #resvg_error 361 | */ 362 | int32_t resvg_parse_tree_from_data(const char *data, 363 | uintptr_t len, 364 | const resvg_options *opt, 365 | resvg_render_tree **tree); 366 | 367 | /** 368 | * @brief Checks that tree has any nodes. 369 | * 370 | * @param tree Render tree. 371 | * @return Returns `true` if tree has no nodes. 372 | */ 373 | bool resvg_is_image_empty(const resvg_render_tree *tree); 374 | 375 | /** 376 | * @brief Returns an image size. 377 | * 378 | * The size of a canvas that required to render this SVG. 379 | * 380 | * The `width` and `height` attributes in SVG. 381 | * 382 | * @param tree Render tree. 383 | * @return Image size. 384 | */ 385 | resvg_size resvg_get_image_size(const resvg_render_tree *tree); 386 | 387 | /** 388 | * @brief Returns an image bounding box. 389 | * 390 | * Can be smaller or bigger than a `viewbox`. 391 | * 392 | * @param tree Render tree. 393 | * @param bbox Image's bounding box. 394 | * @return `false` if an image has no elements. 395 | */ 396 | bool resvg_get_image_bbox(const resvg_render_tree *tree, resvg_rect *bbox); 397 | 398 | /** 399 | * @brief Returns `true` if a renderable node with such an ID exists. 400 | * 401 | * @param tree Render tree. 402 | * @param id Node's ID. UTF-8 string. Must not be NULL. 403 | * @return `true` if a node exists. 404 | * @return `false` if a node doesn't exist or ID isn't a UTF-8 string. 405 | * @return `false` if a node exists, but not renderable. 406 | */ 407 | bool resvg_node_exists(const resvg_render_tree *tree, const char *id); 408 | 409 | /** 410 | * @brief Returns node's transform by ID. 411 | * 412 | * @param tree Render tree. 413 | * @param id Node's ID. UTF-8 string. Must not be NULL. 414 | * @param transform Node's transform. 415 | * @return `true` if a node exists. 416 | * @return `false` if a node doesn't exist or ID isn't a UTF-8 string. 417 | * @return `false` if a node exists, but not renderable. 418 | */ 419 | bool resvg_get_node_transform(const resvg_render_tree *tree, 420 | const char *id, 421 | resvg_transform *transform); 422 | 423 | /** 424 | * @brief Returns node's bounding box in canvas coordinates by ID. 425 | * 426 | * @param tree Render tree. 427 | * @param id Node's ID. Must not be NULL. 428 | * @param bbox Node's bounding box. 429 | * @return `false` if a node with such an ID does not exist 430 | * @return `false` if ID isn't a UTF-8 string. 431 | * @return `false` if ID is an empty string 432 | */ 433 | bool resvg_get_node_bbox(const resvg_render_tree *tree, const char *id, resvg_rect *bbox); 434 | 435 | /** 436 | * @brief Returns node's bounding box, including stroke, in canvas coordinates by ID. 437 | * 438 | * @param tree Render tree. 439 | * @param id Node's ID. Must not be NULL. 440 | * @param bbox Node's bounding box. 441 | * @return `false` if a node with such an ID does not exist 442 | * @return `false` if ID isn't a UTF-8 string. 443 | * @return `false` if ID is an empty string 444 | */ 445 | bool resvg_get_node_stroke_bbox(const resvg_render_tree *tree, const char *id, resvg_rect *bbox); 446 | 447 | /** 448 | * @brief Destroys the #resvg_render_tree. 449 | */ 450 | void resvg_tree_destroy(resvg_render_tree *tree); 451 | 452 | /** 453 | * @brief Renders the #resvg_render_tree onto the pixmap. 454 | * 455 | * @param tree A render tree. 456 | * @param transform A root SVG transform. Can be used to position SVG inside the `pixmap`. 457 | * @param width Pixmap width. 458 | * @param height Pixmap height. 459 | * @param pixmap Pixmap data. Should have width*height*4 size and contain 460 | * premultiplied RGBA8888 pixels. 461 | */ 462 | void resvg_render(const resvg_render_tree *tree, 463 | resvg_transform transform, 464 | uint32_t width, 465 | uint32_t height, 466 | char *pixmap); 467 | 468 | /** 469 | * @brief Renders a Node by ID onto the image. 470 | * 471 | * @param tree A render tree. 472 | * @param id Node's ID. Must not be NULL. 473 | * @param transform A root SVG transform. Can be used to position SVG inside the `pixmap`. 474 | * @param width Pixmap width. 475 | * @param height Pixmap height. 476 | * @param pixmap Pixmap data. Should have width*height*4 size and contain 477 | * premultiplied RGBA8888 pixels. 478 | * @return `false` when `id` is not a non-empty UTF-8 string. 479 | * @return `false` when the selected `id` is not present. 480 | * @return `false` when an element has a zero bbox. 481 | */ 482 | bool resvg_render_node(const resvg_render_tree *tree, 483 | const char *id, 484 | resvg_transform transform, 485 | uint32_t width, 486 | uint32_t height, 487 | char *pixmap); 488 | 489 | #ifdef __cplusplus 490 | } // extern "C" 491 | #endif // __cplusplus 492 | 493 | #endif /* RESVG_H */ 494 | -------------------------------------------------------------------------------- /ios/Classes/resvg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | /** 8 | * @file resvg.h 9 | * 10 | * resvg C API 11 | */ 12 | 13 | #ifndef RESVG_H 14 | #define RESVG_H 15 | 16 | #include 17 | #include 18 | 19 | #define RESVG_MAJOR_VERSION 0 20 | #define RESVG_MINOR_VERSION 42 21 | #define RESVG_PATCH_VERSION 0 22 | #define RESVG_VERSION "0.42.0" 23 | 24 | /** 25 | * @brief List of possible errors. 26 | */ 27 | typedef enum { 28 | /** 29 | * Everything is ok. 30 | */ 31 | RESVG_OK = 0, 32 | /** 33 | * Only UTF-8 content are supported. 34 | */ 35 | RESVG_ERROR_NOT_AN_UTF8_STR, 36 | /** 37 | * Failed to open the provided file. 38 | */ 39 | RESVG_ERROR_FILE_OPEN_FAILED, 40 | /** 41 | * Compressed SVG must use the GZip algorithm. 42 | */ 43 | RESVG_ERROR_MALFORMED_GZIP, 44 | /** 45 | * We do not allow SVG with more than 1_000_000 elements for security reasons. 46 | */ 47 | RESVG_ERROR_ELEMENTS_LIMIT_REACHED, 48 | /** 49 | * SVG doesn't have a valid size. 50 | * 51 | * Occurs when width and/or height are <= 0. 52 | * 53 | * Also occurs if width, height and viewBox are not set. 54 | */ 55 | RESVG_ERROR_INVALID_SIZE, 56 | /** 57 | * Failed to parse an SVG data. 58 | */ 59 | RESVG_ERROR_PARSING_FAILED, 60 | } resvg_error; 61 | 62 | /** 63 | * @brief A image rendering method. 64 | */ 65 | typedef enum { 66 | RESVG_IMAGE_RENDERING_OPTIMIZE_QUALITY, 67 | RESVG_IMAGE_RENDERING_OPTIMIZE_SPEED, 68 | } resvg_image_rendering; 69 | 70 | /** 71 | * @brief A shape rendering method. 72 | */ 73 | typedef enum { 74 | RESVG_SHAPE_RENDERING_OPTIMIZE_SPEED, 75 | RESVG_SHAPE_RENDERING_CRISP_EDGES, 76 | RESVG_SHAPE_RENDERING_GEOMETRIC_PRECISION, 77 | } resvg_shape_rendering; 78 | 79 | /** 80 | * @brief A text rendering method. 81 | */ 82 | typedef enum { 83 | RESVG_TEXT_RENDERING_OPTIMIZE_SPEED, 84 | RESVG_TEXT_RENDERING_OPTIMIZE_LEGIBILITY, 85 | RESVG_TEXT_RENDERING_GEOMETRIC_PRECISION, 86 | } resvg_text_rendering; 87 | 88 | /** 89 | * @brief An SVG to #resvg_render_tree conversion options. 90 | * 91 | * Also, contains a fonts database used during text to path conversion. 92 | * The database is empty by default. 93 | */ 94 | typedef struct resvg_options resvg_options; 95 | 96 | /** 97 | * @brief An opaque pointer to the rendering tree. 98 | */ 99 | typedef struct resvg_render_tree resvg_render_tree; 100 | 101 | /** 102 | * @brief A 2D transform representation. 103 | */ 104 | typedef struct { 105 | float a; 106 | float b; 107 | float c; 108 | float d; 109 | float e; 110 | float f; 111 | } resvg_transform; 112 | 113 | /** 114 | * @brief A size representation. 115 | */ 116 | typedef struct { 117 | float width; 118 | float height; 119 | } resvg_size; 120 | 121 | /** 122 | * @brief A rectangle representation. 123 | */ 124 | typedef struct { 125 | float x; 126 | float y; 127 | float width; 128 | float height; 129 | } resvg_rect; 130 | 131 | #ifdef __cplusplus 132 | extern "C" { 133 | #endif // __cplusplus 134 | 135 | /** 136 | * @brief Creates an identity transform. 137 | */ 138 | resvg_transform resvg_transform_identity(void); 139 | 140 | /** 141 | * @brief Initializes the library log. 142 | * 143 | * Use it if you want to see any warnings. 144 | * 145 | * Must be called only once. 146 | * 147 | * All warnings will be printed to the `stderr`. 148 | */ 149 | void resvg_init_log(void); 150 | 151 | /** 152 | * @brief Creates a new #resvg_options object. 153 | * 154 | * Should be destroyed via #resvg_options_destroy. 155 | */ 156 | resvg_options *resvg_options_create(void); 157 | 158 | /** 159 | * @brief Sets a directory that will be used during relative paths resolving. 160 | * 161 | * Expected to be the same as the directory that contains the SVG file, 162 | * but can be set to any. 163 | * 164 | * Must be UTF-8. Can be set to NULL. 165 | * 166 | * Default: NULL 167 | */ 168 | void resvg_options_set_resources_dir(resvg_options *opt, const char *path); 169 | 170 | /** 171 | * @brief Sets the target DPI. 172 | * 173 | * Impact units conversion. 174 | * 175 | * Default: 96 176 | */ 177 | void resvg_options_set_dpi(resvg_options *opt, float dpi); 178 | 179 | /** 180 | * @brief Sets the default font family. 181 | * 182 | * Will be used when no `font-family` attribute is set in the SVG. 183 | * 184 | * Must be UTF-8. NULL is not allowed. 185 | * 186 | * Default: Times New Roman 187 | */ 188 | void resvg_options_set_font_family(resvg_options *opt, const char *family); 189 | 190 | /** 191 | * @brief Sets the default font size. 192 | * 193 | * Will be used when no `font-size` attribute is set in the SVG. 194 | * 195 | * Default: 12 196 | */ 197 | void resvg_options_set_font_size(resvg_options *opt, float size); 198 | 199 | /** 200 | * @brief Sets the `serif` font family. 201 | * 202 | * Must be UTF-8. NULL is not allowed. 203 | * 204 | * Has no effect when the `text` feature is not enabled. 205 | * 206 | * Default: Times New Roman 207 | */ 208 | void resvg_options_set_serif_family(resvg_options *opt, const char *family); 209 | 210 | /** 211 | * @brief Sets the `sans-serif` font family. 212 | * 213 | * Must be UTF-8. NULL is not allowed. 214 | * 215 | * Has no effect when the `text` feature is not enabled. 216 | * 217 | * Default: Arial 218 | */ 219 | void resvg_options_set_sans_serif_family(resvg_options *opt, const char *family); 220 | 221 | /** 222 | * @brief Sets the `cursive` font family. 223 | * 224 | * Must be UTF-8. NULL is not allowed. 225 | * 226 | * Has no effect when the `text` feature is not enabled. 227 | * 228 | * Default: Comic Sans MS 229 | */ 230 | void resvg_options_set_cursive_family(resvg_options *opt, const char *family); 231 | 232 | /** 233 | * @brief Sets the `fantasy` font family. 234 | * 235 | * Must be UTF-8. NULL is not allowed. 236 | * 237 | * Has no effect when the `text` feature is not enabled. 238 | * 239 | * Default: Papyrus on macOS, Impact on other OS'es 240 | */ 241 | void resvg_options_set_fantasy_family(resvg_options *opt, const char *family); 242 | 243 | /** 244 | * @brief Sets the `monospace` font family. 245 | * 246 | * Must be UTF-8. NULL is not allowed. 247 | * 248 | * Has no effect when the `text` feature is not enabled. 249 | * 250 | * Default: Courier New 251 | */ 252 | void resvg_options_set_monospace_family(resvg_options *opt, const char *family); 253 | 254 | /** 255 | * @brief Sets a comma-separated list of languages. 256 | * 257 | * Will be used to resolve a `systemLanguage` conditional attribute. 258 | * 259 | * Example: en,en-US. 260 | * 261 | * Must be UTF-8. Can be NULL. 262 | * 263 | * Default: en 264 | */ 265 | void resvg_options_set_languages(resvg_options *opt, const char *languages); 266 | 267 | /** 268 | * @brief Sets the default shape rendering method. 269 | * 270 | * Will be used when an SVG element's `shape-rendering` property is set to `auto`. 271 | * 272 | * Default: `RESVG_SHAPE_RENDERING_GEOMETRIC_PRECISION` 273 | */ 274 | void resvg_options_set_shape_rendering_mode(resvg_options *opt, resvg_shape_rendering mode); 275 | 276 | /** 277 | * @brief Sets the default text rendering method. 278 | * 279 | * Will be used when an SVG element's `text-rendering` property is set to `auto`. 280 | * 281 | * Default: `RESVG_TEXT_RENDERING_OPTIMIZE_LEGIBILITY` 282 | */ 283 | void resvg_options_set_text_rendering_mode(resvg_options *opt, resvg_text_rendering mode); 284 | 285 | /** 286 | * @brief Sets the default image rendering method. 287 | * 288 | * Will be used when an SVG element's `image-rendering` property is set to `auto`. 289 | * 290 | * Default: `RESVG_IMAGE_RENDERING_OPTIMIZE_QUALITY` 291 | */ 292 | void resvg_options_set_image_rendering_mode(resvg_options *opt, resvg_image_rendering mode); 293 | 294 | /** 295 | * @brief Loads a font data into the internal fonts database. 296 | * 297 | * Prints a warning into the log when the data is not a valid TrueType font. 298 | * 299 | * Has no effect when the `text` feature is not enabled. 300 | */ 301 | void resvg_options_load_font_data(resvg_options *opt, const char *data, uintptr_t len); 302 | 303 | /** 304 | * @brief Loads a font file into the internal fonts database. 305 | * 306 | * Prints a warning into the log when the data is not a valid TrueType font. 307 | * 308 | * Has no effect when the `text` feature is not enabled. 309 | * 310 | * @return #resvg_error with RESVG_OK, RESVG_ERROR_NOT_AN_UTF8_STR or RESVG_ERROR_FILE_OPEN_FAILED 311 | */ 312 | int32_t resvg_options_load_font_file(resvg_options *opt, const char *file_path); 313 | 314 | /** 315 | * @brief Loads system fonts into the internal fonts database. 316 | * 317 | * This method is very IO intensive. 318 | * 319 | * This method should be executed only once per #resvg_options. 320 | * 321 | * The system scanning is not perfect, so some fonts may be omitted. 322 | * Please send a bug report in this case. 323 | * 324 | * Prints warnings into the log. 325 | * 326 | * Has no effect when the `text` feature is not enabled. 327 | */ 328 | void resvg_options_load_system_fonts(resvg_options *opt); 329 | 330 | /** 331 | * @brief Destroys the #resvg_options. 332 | */ 333 | void resvg_options_destroy(resvg_options *opt); 334 | 335 | /** 336 | * @brief Creates #resvg_render_tree from file. 337 | * 338 | * .svg and .svgz files are supported. 339 | * 340 | * See #resvg_is_image_empty for details. 341 | * 342 | * @param file_path UTF-8 file path. 343 | * @param opt Rendering options. Must not be NULL. 344 | * @param tree Parsed render tree. Should be destroyed via #resvg_tree_destroy. 345 | * @return #resvg_error 346 | */ 347 | int32_t resvg_parse_tree_from_file(const char *file_path, 348 | const resvg_options *opt, 349 | resvg_render_tree **tree); 350 | 351 | /** 352 | * @brief Creates #resvg_render_tree from data. 353 | * 354 | * See #resvg_is_image_empty for details. 355 | * 356 | * @param data SVG data. Can contain SVG string or gzip compressed data. Must not be NULL. 357 | * @param len Data length. 358 | * @param opt Rendering options. Must not be NULL. 359 | * @param tree Parsed render tree. Should be destroyed via #resvg_tree_destroy. 360 | * @return #resvg_error 361 | */ 362 | int32_t resvg_parse_tree_from_data(const char *data, 363 | uintptr_t len, 364 | const resvg_options *opt, 365 | resvg_render_tree **tree); 366 | 367 | /** 368 | * @brief Checks that tree has any nodes. 369 | * 370 | * @param tree Render tree. 371 | * @return Returns `true` if tree has no nodes. 372 | */ 373 | bool resvg_is_image_empty(const resvg_render_tree *tree); 374 | 375 | /** 376 | * @brief Returns an image size. 377 | * 378 | * The size of a canvas that required to render this SVG. 379 | * 380 | * The `width` and `height` attributes in SVG. 381 | * 382 | * @param tree Render tree. 383 | * @return Image size. 384 | */ 385 | resvg_size resvg_get_image_size(const resvg_render_tree *tree); 386 | 387 | /** 388 | * @brief Returns an image bounding box. 389 | * 390 | * Can be smaller or bigger than a `viewbox`. 391 | * 392 | * @param tree Render tree. 393 | * @param bbox Image's bounding box. 394 | * @return `false` if an image has no elements. 395 | */ 396 | bool resvg_get_image_bbox(const resvg_render_tree *tree, resvg_rect *bbox); 397 | 398 | /** 399 | * @brief Returns `true` if a renderable node with such an ID exists. 400 | * 401 | * @param tree Render tree. 402 | * @param id Node's ID. UTF-8 string. Must not be NULL. 403 | * @return `true` if a node exists. 404 | * @return `false` if a node doesn't exist or ID isn't a UTF-8 string. 405 | * @return `false` if a node exists, but not renderable. 406 | */ 407 | bool resvg_node_exists(const resvg_render_tree *tree, const char *id); 408 | 409 | /** 410 | * @brief Returns node's transform by ID. 411 | * 412 | * @param tree Render tree. 413 | * @param id Node's ID. UTF-8 string. Must not be NULL. 414 | * @param transform Node's transform. 415 | * @return `true` if a node exists. 416 | * @return `false` if a node doesn't exist or ID isn't a UTF-8 string. 417 | * @return `false` if a node exists, but not renderable. 418 | */ 419 | bool resvg_get_node_transform(const resvg_render_tree *tree, 420 | const char *id, 421 | resvg_transform *transform); 422 | 423 | /** 424 | * @brief Returns node's bounding box in canvas coordinates by ID. 425 | * 426 | * @param tree Render tree. 427 | * @param id Node's ID. Must not be NULL. 428 | * @param bbox Node's bounding box. 429 | * @return `false` if a node with such an ID does not exist 430 | * @return `false` if ID isn't a UTF-8 string. 431 | * @return `false` if ID is an empty string 432 | */ 433 | bool resvg_get_node_bbox(const resvg_render_tree *tree, const char *id, resvg_rect *bbox); 434 | 435 | /** 436 | * @brief Returns node's bounding box, including stroke, in canvas coordinates by ID. 437 | * 438 | * @param tree Render tree. 439 | * @param id Node's ID. Must not be NULL. 440 | * @param bbox Node's bounding box. 441 | * @return `false` if a node with such an ID does not exist 442 | * @return `false` if ID isn't a UTF-8 string. 443 | * @return `false` if ID is an empty string 444 | */ 445 | bool resvg_get_node_stroke_bbox(const resvg_render_tree *tree, const char *id, resvg_rect *bbox); 446 | 447 | /** 448 | * @brief Destroys the #resvg_render_tree. 449 | */ 450 | void resvg_tree_destroy(resvg_render_tree *tree); 451 | 452 | /** 453 | * @brief Renders the #resvg_render_tree onto the pixmap. 454 | * 455 | * @param tree A render tree. 456 | * @param transform A root SVG transform. Can be used to position SVG inside the `pixmap`. 457 | * @param width Pixmap width. 458 | * @param height Pixmap height. 459 | * @param pixmap Pixmap data. Should have width*height*4 size and contain 460 | * premultiplied RGBA8888 pixels. 461 | */ 462 | void resvg_render(const resvg_render_tree *tree, 463 | resvg_transform transform, 464 | uint32_t width, 465 | uint32_t height, 466 | char *pixmap); 467 | 468 | /** 469 | * @brief Renders a Node by ID onto the image. 470 | * 471 | * @param tree A render tree. 472 | * @param id Node's ID. Must not be NULL. 473 | * @param transform A root SVG transform. Can be used to position SVG inside the `pixmap`. 474 | * @param width Pixmap width. 475 | * @param height Pixmap height. 476 | * @param pixmap Pixmap data. Should have width*height*4 size and contain 477 | * premultiplied RGBA8888 pixels. 478 | * @return `false` when `id` is not a non-empty UTF-8 string. 479 | * @return `false` when the selected `id` is not present. 480 | * @return `false` when an element has a zero bbox. 481 | */ 482 | bool resvg_render_node(const resvg_render_tree *tree, 483 | const char *id, 484 | resvg_transform transform, 485 | uint32_t width, 486 | uint32_t height, 487 | char *pixmap); 488 | 489 | #ifdef __cplusplus 490 | } // extern "C" 491 | #endif // __cplusplus 492 | 493 | #endif /* RESVG_H */ 494 | -------------------------------------------------------------------------------- /macos/Classes/resvg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | /** 8 | * @file resvg.h 9 | * 10 | * resvg C API 11 | */ 12 | 13 | #ifndef RESVG_H 14 | #define RESVG_H 15 | 16 | #include 17 | #include 18 | 19 | #define RESVG_MAJOR_VERSION 0 20 | #define RESVG_MINOR_VERSION 42 21 | #define RESVG_PATCH_VERSION 0 22 | #define RESVG_VERSION "0.42.0" 23 | 24 | /** 25 | * @brief List of possible errors. 26 | */ 27 | typedef enum { 28 | /** 29 | * Everything is ok. 30 | */ 31 | RESVG_OK = 0, 32 | /** 33 | * Only UTF-8 content are supported. 34 | */ 35 | RESVG_ERROR_NOT_AN_UTF8_STR, 36 | /** 37 | * Failed to open the provided file. 38 | */ 39 | RESVG_ERROR_FILE_OPEN_FAILED, 40 | /** 41 | * Compressed SVG must use the GZip algorithm. 42 | */ 43 | RESVG_ERROR_MALFORMED_GZIP, 44 | /** 45 | * We do not allow SVG with more than 1_000_000 elements for security reasons. 46 | */ 47 | RESVG_ERROR_ELEMENTS_LIMIT_REACHED, 48 | /** 49 | * SVG doesn't have a valid size. 50 | * 51 | * Occurs when width and/or height are <= 0. 52 | * 53 | * Also occurs if width, height and viewBox are not set. 54 | */ 55 | RESVG_ERROR_INVALID_SIZE, 56 | /** 57 | * Failed to parse an SVG data. 58 | */ 59 | RESVG_ERROR_PARSING_FAILED, 60 | } resvg_error; 61 | 62 | /** 63 | * @brief A image rendering method. 64 | */ 65 | typedef enum { 66 | RESVG_IMAGE_RENDERING_OPTIMIZE_QUALITY, 67 | RESVG_IMAGE_RENDERING_OPTIMIZE_SPEED, 68 | } resvg_image_rendering; 69 | 70 | /** 71 | * @brief A shape rendering method. 72 | */ 73 | typedef enum { 74 | RESVG_SHAPE_RENDERING_OPTIMIZE_SPEED, 75 | RESVG_SHAPE_RENDERING_CRISP_EDGES, 76 | RESVG_SHAPE_RENDERING_GEOMETRIC_PRECISION, 77 | } resvg_shape_rendering; 78 | 79 | /** 80 | * @brief A text rendering method. 81 | */ 82 | typedef enum { 83 | RESVG_TEXT_RENDERING_OPTIMIZE_SPEED, 84 | RESVG_TEXT_RENDERING_OPTIMIZE_LEGIBILITY, 85 | RESVG_TEXT_RENDERING_GEOMETRIC_PRECISION, 86 | } resvg_text_rendering; 87 | 88 | /** 89 | * @brief An SVG to #resvg_render_tree conversion options. 90 | * 91 | * Also, contains a fonts database used during text to path conversion. 92 | * The database is empty by default. 93 | */ 94 | typedef struct resvg_options resvg_options; 95 | 96 | /** 97 | * @brief An opaque pointer to the rendering tree. 98 | */ 99 | typedef struct resvg_render_tree resvg_render_tree; 100 | 101 | /** 102 | * @brief A 2D transform representation. 103 | */ 104 | typedef struct { 105 | float a; 106 | float b; 107 | float c; 108 | float d; 109 | float e; 110 | float f; 111 | } resvg_transform; 112 | 113 | /** 114 | * @brief A size representation. 115 | */ 116 | typedef struct { 117 | float width; 118 | float height; 119 | } resvg_size; 120 | 121 | /** 122 | * @brief A rectangle representation. 123 | */ 124 | typedef struct { 125 | float x; 126 | float y; 127 | float width; 128 | float height; 129 | } resvg_rect; 130 | 131 | #ifdef __cplusplus 132 | extern "C" { 133 | #endif // __cplusplus 134 | 135 | /** 136 | * @brief Creates an identity transform. 137 | */ 138 | resvg_transform resvg_transform_identity(void); 139 | 140 | /** 141 | * @brief Initializes the library log. 142 | * 143 | * Use it if you want to see any warnings. 144 | * 145 | * Must be called only once. 146 | * 147 | * All warnings will be printed to the `stderr`. 148 | */ 149 | void resvg_init_log(void); 150 | 151 | /** 152 | * @brief Creates a new #resvg_options object. 153 | * 154 | * Should be destroyed via #resvg_options_destroy. 155 | */ 156 | resvg_options *resvg_options_create(void); 157 | 158 | /** 159 | * @brief Sets a directory that will be used during relative paths resolving. 160 | * 161 | * Expected to be the same as the directory that contains the SVG file, 162 | * but can be set to any. 163 | * 164 | * Must be UTF-8. Can be set to NULL. 165 | * 166 | * Default: NULL 167 | */ 168 | void resvg_options_set_resources_dir(resvg_options *opt, const char *path); 169 | 170 | /** 171 | * @brief Sets the target DPI. 172 | * 173 | * Impact units conversion. 174 | * 175 | * Default: 96 176 | */ 177 | void resvg_options_set_dpi(resvg_options *opt, float dpi); 178 | 179 | /** 180 | * @brief Sets the default font family. 181 | * 182 | * Will be used when no `font-family` attribute is set in the SVG. 183 | * 184 | * Must be UTF-8. NULL is not allowed. 185 | * 186 | * Default: Times New Roman 187 | */ 188 | void resvg_options_set_font_family(resvg_options *opt, const char *family); 189 | 190 | /** 191 | * @brief Sets the default font size. 192 | * 193 | * Will be used when no `font-size` attribute is set in the SVG. 194 | * 195 | * Default: 12 196 | */ 197 | void resvg_options_set_font_size(resvg_options *opt, float size); 198 | 199 | /** 200 | * @brief Sets the `serif` font family. 201 | * 202 | * Must be UTF-8. NULL is not allowed. 203 | * 204 | * Has no effect when the `text` feature is not enabled. 205 | * 206 | * Default: Times New Roman 207 | */ 208 | void resvg_options_set_serif_family(resvg_options *opt, const char *family); 209 | 210 | /** 211 | * @brief Sets the `sans-serif` font family. 212 | * 213 | * Must be UTF-8. NULL is not allowed. 214 | * 215 | * Has no effect when the `text` feature is not enabled. 216 | * 217 | * Default: Arial 218 | */ 219 | void resvg_options_set_sans_serif_family(resvg_options *opt, const char *family); 220 | 221 | /** 222 | * @brief Sets the `cursive` font family. 223 | * 224 | * Must be UTF-8. NULL is not allowed. 225 | * 226 | * Has no effect when the `text` feature is not enabled. 227 | * 228 | * Default: Comic Sans MS 229 | */ 230 | void resvg_options_set_cursive_family(resvg_options *opt, const char *family); 231 | 232 | /** 233 | * @brief Sets the `fantasy` font family. 234 | * 235 | * Must be UTF-8. NULL is not allowed. 236 | * 237 | * Has no effect when the `text` feature is not enabled. 238 | * 239 | * Default: Papyrus on macOS, Impact on other OS'es 240 | */ 241 | void resvg_options_set_fantasy_family(resvg_options *opt, const char *family); 242 | 243 | /** 244 | * @brief Sets the `monospace` font family. 245 | * 246 | * Must be UTF-8. NULL is not allowed. 247 | * 248 | * Has no effect when the `text` feature is not enabled. 249 | * 250 | * Default: Courier New 251 | */ 252 | void resvg_options_set_monospace_family(resvg_options *opt, const char *family); 253 | 254 | /** 255 | * @brief Sets a comma-separated list of languages. 256 | * 257 | * Will be used to resolve a `systemLanguage` conditional attribute. 258 | * 259 | * Example: en,en-US. 260 | * 261 | * Must be UTF-8. Can be NULL. 262 | * 263 | * Default: en 264 | */ 265 | void resvg_options_set_languages(resvg_options *opt, const char *languages); 266 | 267 | /** 268 | * @brief Sets the default shape rendering method. 269 | * 270 | * Will be used when an SVG element's `shape-rendering` property is set to `auto`. 271 | * 272 | * Default: `RESVG_SHAPE_RENDERING_GEOMETRIC_PRECISION` 273 | */ 274 | void resvg_options_set_shape_rendering_mode(resvg_options *opt, resvg_shape_rendering mode); 275 | 276 | /** 277 | * @brief Sets the default text rendering method. 278 | * 279 | * Will be used when an SVG element's `text-rendering` property is set to `auto`. 280 | * 281 | * Default: `RESVG_TEXT_RENDERING_OPTIMIZE_LEGIBILITY` 282 | */ 283 | void resvg_options_set_text_rendering_mode(resvg_options *opt, resvg_text_rendering mode); 284 | 285 | /** 286 | * @brief Sets the default image rendering method. 287 | * 288 | * Will be used when an SVG element's `image-rendering` property is set to `auto`. 289 | * 290 | * Default: `RESVG_IMAGE_RENDERING_OPTIMIZE_QUALITY` 291 | */ 292 | void resvg_options_set_image_rendering_mode(resvg_options *opt, resvg_image_rendering mode); 293 | 294 | /** 295 | * @brief Loads a font data into the internal fonts database. 296 | * 297 | * Prints a warning into the log when the data is not a valid TrueType font. 298 | * 299 | * Has no effect when the `text` feature is not enabled. 300 | */ 301 | void resvg_options_load_font_data(resvg_options *opt, const char *data, uintptr_t len); 302 | 303 | /** 304 | * @brief Loads a font file into the internal fonts database. 305 | * 306 | * Prints a warning into the log when the data is not a valid TrueType font. 307 | * 308 | * Has no effect when the `text` feature is not enabled. 309 | * 310 | * @return #resvg_error with RESVG_OK, RESVG_ERROR_NOT_AN_UTF8_STR or RESVG_ERROR_FILE_OPEN_FAILED 311 | */ 312 | int32_t resvg_options_load_font_file(resvg_options *opt, const char *file_path); 313 | 314 | /** 315 | * @brief Loads system fonts into the internal fonts database. 316 | * 317 | * This method is very IO intensive. 318 | * 319 | * This method should be executed only once per #resvg_options. 320 | * 321 | * The system scanning is not perfect, so some fonts may be omitted. 322 | * Please send a bug report in this case. 323 | * 324 | * Prints warnings into the log. 325 | * 326 | * Has no effect when the `text` feature is not enabled. 327 | */ 328 | void resvg_options_load_system_fonts(resvg_options *opt); 329 | 330 | /** 331 | * @brief Destroys the #resvg_options. 332 | */ 333 | void resvg_options_destroy(resvg_options *opt); 334 | 335 | /** 336 | * @brief Creates #resvg_render_tree from file. 337 | * 338 | * .svg and .svgz files are supported. 339 | * 340 | * See #resvg_is_image_empty for details. 341 | * 342 | * @param file_path UTF-8 file path. 343 | * @param opt Rendering options. Must not be NULL. 344 | * @param tree Parsed render tree. Should be destroyed via #resvg_tree_destroy. 345 | * @return #resvg_error 346 | */ 347 | int32_t resvg_parse_tree_from_file(const char *file_path, 348 | const resvg_options *opt, 349 | resvg_render_tree **tree); 350 | 351 | /** 352 | * @brief Creates #resvg_render_tree from data. 353 | * 354 | * See #resvg_is_image_empty for details. 355 | * 356 | * @param data SVG data. Can contain SVG string or gzip compressed data. Must not be NULL. 357 | * @param len Data length. 358 | * @param opt Rendering options. Must not be NULL. 359 | * @param tree Parsed render tree. Should be destroyed via #resvg_tree_destroy. 360 | * @return #resvg_error 361 | */ 362 | int32_t resvg_parse_tree_from_data(const char *data, 363 | uintptr_t len, 364 | const resvg_options *opt, 365 | resvg_render_tree **tree); 366 | 367 | /** 368 | * @brief Checks that tree has any nodes. 369 | * 370 | * @param tree Render tree. 371 | * @return Returns `true` if tree has no nodes. 372 | */ 373 | bool resvg_is_image_empty(const resvg_render_tree *tree); 374 | 375 | /** 376 | * @brief Returns an image size. 377 | * 378 | * The size of a canvas that required to render this SVG. 379 | * 380 | * The `width` and `height` attributes in SVG. 381 | * 382 | * @param tree Render tree. 383 | * @return Image size. 384 | */ 385 | resvg_size resvg_get_image_size(const resvg_render_tree *tree); 386 | 387 | /** 388 | * @brief Returns an image bounding box. 389 | * 390 | * Can be smaller or bigger than a `viewbox`. 391 | * 392 | * @param tree Render tree. 393 | * @param bbox Image's bounding box. 394 | * @return `false` if an image has no elements. 395 | */ 396 | bool resvg_get_image_bbox(const resvg_render_tree *tree, resvg_rect *bbox); 397 | 398 | /** 399 | * @brief Returns `true` if a renderable node with such an ID exists. 400 | * 401 | * @param tree Render tree. 402 | * @param id Node's ID. UTF-8 string. Must not be NULL. 403 | * @return `true` if a node exists. 404 | * @return `false` if a node doesn't exist or ID isn't a UTF-8 string. 405 | * @return `false` if a node exists, but not renderable. 406 | */ 407 | bool resvg_node_exists(const resvg_render_tree *tree, const char *id); 408 | 409 | /** 410 | * @brief Returns node's transform by ID. 411 | * 412 | * @param tree Render tree. 413 | * @param id Node's ID. UTF-8 string. Must not be NULL. 414 | * @param transform Node's transform. 415 | * @return `true` if a node exists. 416 | * @return `false` if a node doesn't exist or ID isn't a UTF-8 string. 417 | * @return `false` if a node exists, but not renderable. 418 | */ 419 | bool resvg_get_node_transform(const resvg_render_tree *tree, 420 | const char *id, 421 | resvg_transform *transform); 422 | 423 | /** 424 | * @brief Returns node's bounding box in canvas coordinates by ID. 425 | * 426 | * @param tree Render tree. 427 | * @param id Node's ID. Must not be NULL. 428 | * @param bbox Node's bounding box. 429 | * @return `false` if a node with such an ID does not exist 430 | * @return `false` if ID isn't a UTF-8 string. 431 | * @return `false` if ID is an empty string 432 | */ 433 | bool resvg_get_node_bbox(const resvg_render_tree *tree, const char *id, resvg_rect *bbox); 434 | 435 | /** 436 | * @brief Returns node's bounding box, including stroke, in canvas coordinates by ID. 437 | * 438 | * @param tree Render tree. 439 | * @param id Node's ID. Must not be NULL. 440 | * @param bbox Node's bounding box. 441 | * @return `false` if a node with such an ID does not exist 442 | * @return `false` if ID isn't a UTF-8 string. 443 | * @return `false` if ID is an empty string 444 | */ 445 | bool resvg_get_node_stroke_bbox(const resvg_render_tree *tree, const char *id, resvg_rect *bbox); 446 | 447 | /** 448 | * @brief Destroys the #resvg_render_tree. 449 | */ 450 | void resvg_tree_destroy(resvg_render_tree *tree); 451 | 452 | /** 453 | * @brief Renders the #resvg_render_tree onto the pixmap. 454 | * 455 | * @param tree A render tree. 456 | * @param transform A root SVG transform. Can be used to position SVG inside the `pixmap`. 457 | * @param width Pixmap width. 458 | * @param height Pixmap height. 459 | * @param pixmap Pixmap data. Should have width*height*4 size and contain 460 | * premultiplied RGBA8888 pixels. 461 | */ 462 | void resvg_render(const resvg_render_tree *tree, 463 | resvg_transform transform, 464 | uint32_t width, 465 | uint32_t height, 466 | char *pixmap); 467 | 468 | /** 469 | * @brief Renders a Node by ID onto the image. 470 | * 471 | * @param tree A render tree. 472 | * @param id Node's ID. Must not be NULL. 473 | * @param transform A root SVG transform. Can be used to position SVG inside the `pixmap`. 474 | * @param width Pixmap width. 475 | * @param height Pixmap height. 476 | * @param pixmap Pixmap data. Should have width*height*4 size and contain 477 | * premultiplied RGBA8888 pixels. 478 | * @return `false` when `id` is not a non-empty UTF-8 string. 479 | * @return `false` when the selected `id` is not present. 480 | * @return `false` when an element has a zero bbox. 481 | */ 482 | bool resvg_render_node(const resvg_render_tree *tree, 483 | const char *id, 484 | resvg_transform transform, 485 | uint32_t width, 486 | uint32_t height, 487 | char *pixmap); 488 | 489 | #ifdef __cplusplus 490 | } // extern "C" 491 | #endif // __cplusplus 492 | 493 | #endif /* RESVG_H */ 494 | -------------------------------------------------------------------------------- /example/macos/Runner/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 12 | 3A7F741393850298F07C8272 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C28295DB424136AFE8B87450 /* Pods_RunnerTests.framework */; }; 13 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 14 | 4867B5FB1CA353C708A01F0D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC045A1BB6A41DA6C51C6183 /* Pods_Runner.framework */; }; 15 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 16 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 17 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 18 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 97C146E61CF9000F007C117D /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 97C146ED1CF9000F007C117D; 27 | remoteInfo = Runner; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXCopyFilesBuildPhase section */ 32 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 33 | isa = PBXCopyFilesBuildPhase; 34 | buildActionMask = 2147483647; 35 | dstPath = ""; 36 | dstSubfolderSpec = 10; 37 | files = ( 38 | ); 39 | name = "Embed Frameworks"; 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXCopyFilesBuildPhase section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 0BC263D1320890452574706B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 46 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 47 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 48 | 2E0CD2A1E6BF1501FC9BC43D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 49 | 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 50 | 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 52 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 53 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 54 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 55 | 871E54D0934E8221FAA63AA5 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; 56 | 8AA37A0ADD242721C79FD7DA /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 57 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 58 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 59 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 61 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 62 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 63 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 64 | BF30324FAB74F5F78F7C98CF /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 65 | C28295DB424136AFE8B87450 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | C7864522EEF7810C90DE140A /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 67 | DC045A1BB6A41DA6C51C6183 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | /* End PBXFileReference section */ 69 | 70 | /* Begin PBXFrameworksBuildPhase section */ 71 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | 4867B5FB1CA353C708A01F0D /* Pods_Runner.framework in Frameworks */, 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | F18A1AA291D5A4BC6AE0EF4C /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | 3A7F741393850298F07C8272 /* Pods_RunnerTests.framework in Frameworks */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | 331C8082294A63A400263BE5 /* RunnerTests */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 331C807B294A618700263BE5 /* RunnerTests.swift */, 94 | ); 95 | path = RunnerTests; 96 | sourceTree = ""; 97 | }; 98 | 5BE6676650954B239E6E5EB0 /* Frameworks */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | DC045A1BB6A41DA6C51C6183 /* Pods_Runner.framework */, 102 | C28295DB424136AFE8B87450 /* Pods_RunnerTests.framework */, 103 | ); 104 | name = Frameworks; 105 | sourceTree = ""; 106 | }; 107 | 93906ED4A1BC3422EAC6133A /* Pods */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 2E0CD2A1E6BF1501FC9BC43D /* Pods-Runner.debug.xcconfig */, 111 | C7864522EEF7810C90DE140A /* Pods-Runner.release.xcconfig */, 112 | 0BC263D1320890452574706B /* Pods-Runner.profile.xcconfig */, 113 | 8AA37A0ADD242721C79FD7DA /* Pods-RunnerTests.debug.xcconfig */, 114 | 871E54D0934E8221FAA63AA5 /* Pods-RunnerTests.release.xcconfig */, 115 | BF30324FAB74F5F78F7C98CF /* Pods-RunnerTests.profile.xcconfig */, 116 | ); 117 | name = Pods; 118 | path = Pods; 119 | sourceTree = ""; 120 | }; 121 | 9740EEB11CF90186004384FC /* Flutter */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 125 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 126 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 127 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 128 | ); 129 | name = Flutter; 130 | sourceTree = ""; 131 | }; 132 | 97C146E51CF9000F007C117D = { 133 | isa = PBXGroup; 134 | children = ( 135 | 9740EEB11CF90186004384FC /* Flutter */, 136 | 97C146F01CF9000F007C117D /* Runner */, 137 | 97C146EF1CF9000F007C117D /* Products */, 138 | 331C8082294A63A400263BE5 /* RunnerTests */, 139 | 93906ED4A1BC3422EAC6133A /* Pods */, 140 | 5BE6676650954B239E6E5EB0 /* Frameworks */, 141 | ); 142 | sourceTree = ""; 143 | }; 144 | 97C146EF1CF9000F007C117D /* Products */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 97C146EE1CF9000F007C117D /* Runner.app */, 148 | 331C8081294A63A400263BE5 /* RunnerTests.xctest */, 149 | ); 150 | name = Products; 151 | sourceTree = ""; 152 | }; 153 | 97C146F01CF9000F007C117D /* Runner */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 157 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 158 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 159 | 97C147021CF9000F007C117D /* Info.plist */, 160 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 161 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 162 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 163 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 164 | ); 165 | path = Runner; 166 | sourceTree = ""; 167 | }; 168 | /* End PBXGroup section */ 169 | 170 | /* Begin PBXNativeTarget section */ 171 | 331C8080294A63A400263BE5 /* RunnerTests */ = { 172 | isa = PBXNativeTarget; 173 | buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; 174 | buildPhases = ( 175 | 73C9AD9B42B534AFBE954717 /* [CP] Check Pods Manifest.lock */, 176 | 331C807D294A63A400263BE5 /* Sources */, 177 | 331C807F294A63A400263BE5 /* Resources */, 178 | F18A1AA291D5A4BC6AE0EF4C /* Frameworks */, 179 | ); 180 | buildRules = ( 181 | ); 182 | dependencies = ( 183 | 331C8086294A63A400263BE5 /* PBXTargetDependency */, 184 | ); 185 | name = RunnerTests; 186 | productName = RunnerTests; 187 | productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; 188 | productType = "com.apple.product-type.bundle.unit-test"; 189 | }; 190 | 97C146ED1CF9000F007C117D /* Runner */ = { 191 | isa = PBXNativeTarget; 192 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 193 | buildPhases = ( 194 | 63EBE137A92E501D5F2D2EE5 /* [CP] Check Pods Manifest.lock */, 195 | 9740EEB61CF901F6004384FC /* Run Script */, 196 | 97C146EA1CF9000F007C117D /* Sources */, 197 | 97C146EB1CF9000F007C117D /* Frameworks */, 198 | 97C146EC1CF9000F007C117D /* Resources */, 199 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 200 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | ); 206 | name = Runner; 207 | productName = Runner; 208 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 209 | productType = "com.apple.product-type.application"; 210 | }; 211 | /* End PBXNativeTarget section */ 212 | 213 | /* Begin PBXProject section */ 214 | 97C146E61CF9000F007C117D /* Project object */ = { 215 | isa = PBXProject; 216 | attributes = { 217 | BuildIndependentTargetsInParallel = YES; 218 | LastUpgradeCheck = 1510; 219 | ORGANIZATIONNAME = ""; 220 | TargetAttributes = { 221 | 331C8080294A63A400263BE5 = { 222 | CreatedOnToolsVersion = 14.0; 223 | TestTargetID = 97C146ED1CF9000F007C117D; 224 | }; 225 | 97C146ED1CF9000F007C117D = { 226 | CreatedOnToolsVersion = 7.3.1; 227 | LastSwiftMigration = 1100; 228 | }; 229 | }; 230 | }; 231 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 232 | compatibilityVersion = "Xcode 9.3"; 233 | developmentRegion = en; 234 | hasScannedForEncodings = 0; 235 | knownRegions = ( 236 | en, 237 | Base, 238 | ); 239 | mainGroup = 97C146E51CF9000F007C117D; 240 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 241 | projectDirPath = ""; 242 | projectRoot = ""; 243 | targets = ( 244 | 97C146ED1CF9000F007C117D /* Runner */, 245 | 331C8080294A63A400263BE5 /* RunnerTests */, 246 | ); 247 | }; 248 | /* End PBXProject section */ 249 | 250 | /* Begin PBXResourcesBuildPhase section */ 251 | 331C807F294A63A400263BE5 /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | 97C146EC1CF9000F007C117D /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 263 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 264 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 265 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | /* End PBXResourcesBuildPhase section */ 270 | 271 | /* Begin PBXShellScriptBuildPhase section */ 272 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 273 | isa = PBXShellScriptBuildPhase; 274 | alwaysOutOfDate = 1; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | ); 278 | inputPaths = ( 279 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 280 | ); 281 | name = "Thin Binary"; 282 | outputPaths = ( 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | shellPath = /bin/sh; 286 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 287 | }; 288 | 63EBE137A92E501D5F2D2EE5 /* [CP] Check Pods Manifest.lock */ = { 289 | isa = PBXShellScriptBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | ); 293 | inputFileListPaths = ( 294 | ); 295 | inputPaths = ( 296 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 297 | "${PODS_ROOT}/Manifest.lock", 298 | ); 299 | name = "[CP] Check Pods Manifest.lock"; 300 | outputFileListPaths = ( 301 | ); 302 | outputPaths = ( 303 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | shellPath = /bin/sh; 307 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 308 | showEnvVarsInLog = 0; 309 | }; 310 | 73C9AD9B42B534AFBE954717 /* [CP] Check Pods Manifest.lock */ = { 311 | isa = PBXShellScriptBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | ); 315 | inputFileListPaths = ( 316 | ); 317 | inputPaths = ( 318 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 319 | "${PODS_ROOT}/Manifest.lock", 320 | ); 321 | name = "[CP] Check Pods Manifest.lock"; 322 | outputFileListPaths = ( 323 | ); 324 | outputPaths = ( 325 | "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | shellPath = /bin/sh; 329 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 330 | showEnvVarsInLog = 0; 331 | }; 332 | 9740EEB61CF901F6004384FC /* Run Script */ = { 333 | isa = PBXShellScriptBuildPhase; 334 | alwaysOutOfDate = 1; 335 | buildActionMask = 2147483647; 336 | files = ( 337 | ); 338 | inputPaths = ( 339 | ); 340 | name = "Run Script"; 341 | outputPaths = ( 342 | ); 343 | runOnlyForDeploymentPostprocessing = 0; 344 | shellPath = /bin/sh; 345 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 346 | }; 347 | /* End PBXShellScriptBuildPhase section */ 348 | 349 | /* Begin PBXSourcesBuildPhase section */ 350 | 331C807D294A63A400263BE5 /* Sources */ = { 351 | isa = PBXSourcesBuildPhase; 352 | buildActionMask = 2147483647; 353 | files = ( 354 | 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, 355 | ); 356 | runOnlyForDeploymentPostprocessing = 0; 357 | }; 358 | 97C146EA1CF9000F007C117D /* Sources */ = { 359 | isa = PBXSourcesBuildPhase; 360 | buildActionMask = 2147483647; 361 | files = ( 362 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 363 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | }; 367 | /* End PBXSourcesBuildPhase section */ 368 | 369 | /* Begin PBXTargetDependency section */ 370 | 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { 371 | isa = PBXTargetDependency; 372 | target = 97C146ED1CF9000F007C117D /* Runner */; 373 | targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; 374 | }; 375 | /* End PBXTargetDependency section */ 376 | 377 | /* Begin PBXVariantGroup section */ 378 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 379 | isa = PBXVariantGroup; 380 | children = ( 381 | 97C146FB1CF9000F007C117D /* Base */, 382 | ); 383 | name = Main.storyboard; 384 | sourceTree = ""; 385 | }; 386 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 387 | isa = PBXVariantGroup; 388 | children = ( 389 | 97C147001CF9000F007C117D /* Base */, 390 | ); 391 | name = LaunchScreen.storyboard; 392 | sourceTree = ""; 393 | }; 394 | /* End PBXVariantGroup section */ 395 | 396 | /* Begin XCBuildConfiguration section */ 397 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ALWAYS_SEARCH_USER_PATHS = NO; 401 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 402 | CLANG_ANALYZER_NONNULL = YES; 403 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 404 | CLANG_CXX_LIBRARY = "libc++"; 405 | CLANG_ENABLE_MODULES = YES; 406 | CLANG_ENABLE_OBJC_ARC = YES; 407 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 408 | CLANG_WARN_BOOL_CONVERSION = YES; 409 | CLANG_WARN_COMMA = YES; 410 | CLANG_WARN_CONSTANT_CONVERSION = YES; 411 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 412 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 413 | CLANG_WARN_EMPTY_BODY = YES; 414 | CLANG_WARN_ENUM_CONVERSION = YES; 415 | CLANG_WARN_INFINITE_RECURSION = YES; 416 | CLANG_WARN_INT_CONVERSION = YES; 417 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 418 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 419 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 420 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 421 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 422 | CLANG_WARN_STRICT_PROTOTYPES = YES; 423 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 424 | CLANG_WARN_UNREACHABLE_CODE = YES; 425 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 426 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 427 | COPY_PHASE_STRIP = NO; 428 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 429 | ENABLE_NS_ASSERTIONS = NO; 430 | ENABLE_STRICT_OBJC_MSGSEND = YES; 431 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 432 | GCC_C_LANGUAGE_STANDARD = gnu99; 433 | GCC_NO_COMMON_BLOCKS = YES; 434 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 435 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 436 | GCC_WARN_UNDECLARED_SELECTOR = YES; 437 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 438 | GCC_WARN_UNUSED_FUNCTION = YES; 439 | GCC_WARN_UNUSED_VARIABLE = YES; 440 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 441 | MTL_ENABLE_DEBUG_INFO = NO; 442 | SDKROOT = iphoneos; 443 | SUPPORTED_PLATFORMS = iphoneos; 444 | TARGETED_DEVICE_FAMILY = "1,2"; 445 | VALIDATE_PRODUCT = YES; 446 | }; 447 | name = Profile; 448 | }; 449 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 450 | isa = XCBuildConfiguration; 451 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 452 | buildSettings = { 453 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 454 | CLANG_ENABLE_MODULES = YES; 455 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 456 | DEVELOPMENT_TEAM = 38825Z82DU; 457 | ENABLE_BITCODE = NO; 458 | INFOPLIST_FILE = Runner/Info.plist; 459 | LD_RUNPATH_SEARCH_PATHS = ( 460 | "$(inherited)", 461 | "@executable_path/Frameworks", 462 | ); 463 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reSvgExample; 464 | PRODUCT_NAME = "$(TARGET_NAME)"; 465 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 466 | SWIFT_VERSION = 5.0; 467 | VERSIONING_SYSTEM = "apple-generic"; 468 | }; 469 | name = Profile; 470 | }; 471 | 331C8088294A63A400263BE5 /* Debug */ = { 472 | isa = XCBuildConfiguration; 473 | baseConfigurationReference = 8AA37A0ADD242721C79FD7DA /* Pods-RunnerTests.debug.xcconfig */; 474 | buildSettings = { 475 | BUNDLE_LOADER = "$(TEST_HOST)"; 476 | CODE_SIGN_STYLE = Automatic; 477 | CURRENT_PROJECT_VERSION = 1; 478 | GENERATE_INFOPLIST_FILE = YES; 479 | MARKETING_VERSION = 1.0; 480 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reSvgExample.RunnerTests; 481 | PRODUCT_NAME = "$(TARGET_NAME)"; 482 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 483 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 484 | SWIFT_VERSION = 5.0; 485 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; 486 | }; 487 | name = Debug; 488 | }; 489 | 331C8089294A63A400263BE5 /* Release */ = { 490 | isa = XCBuildConfiguration; 491 | baseConfigurationReference = 871E54D0934E8221FAA63AA5 /* Pods-RunnerTests.release.xcconfig */; 492 | buildSettings = { 493 | BUNDLE_LOADER = "$(TEST_HOST)"; 494 | CODE_SIGN_STYLE = Automatic; 495 | CURRENT_PROJECT_VERSION = 1; 496 | GENERATE_INFOPLIST_FILE = YES; 497 | MARKETING_VERSION = 1.0; 498 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reSvgExample.RunnerTests; 499 | PRODUCT_NAME = "$(TARGET_NAME)"; 500 | SWIFT_VERSION = 5.0; 501 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; 502 | }; 503 | name = Release; 504 | }; 505 | 331C808A294A63A400263BE5 /* Profile */ = { 506 | isa = XCBuildConfiguration; 507 | baseConfigurationReference = BF30324FAB74F5F78F7C98CF /* Pods-RunnerTests.profile.xcconfig */; 508 | buildSettings = { 509 | BUNDLE_LOADER = "$(TEST_HOST)"; 510 | CODE_SIGN_STYLE = Automatic; 511 | CURRENT_PROJECT_VERSION = 1; 512 | GENERATE_INFOPLIST_FILE = YES; 513 | MARKETING_VERSION = 1.0; 514 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reSvgExample.RunnerTests; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | SWIFT_VERSION = 5.0; 517 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; 518 | }; 519 | name = Profile; 520 | }; 521 | 97C147031CF9000F007C117D /* Debug */ = { 522 | isa = XCBuildConfiguration; 523 | buildSettings = { 524 | ALWAYS_SEARCH_USER_PATHS = NO; 525 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 526 | CLANG_ANALYZER_NONNULL = YES; 527 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 528 | CLANG_CXX_LIBRARY = "libc++"; 529 | CLANG_ENABLE_MODULES = YES; 530 | CLANG_ENABLE_OBJC_ARC = YES; 531 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 532 | CLANG_WARN_BOOL_CONVERSION = YES; 533 | CLANG_WARN_COMMA = YES; 534 | CLANG_WARN_CONSTANT_CONVERSION = YES; 535 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 536 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 537 | CLANG_WARN_EMPTY_BODY = YES; 538 | CLANG_WARN_ENUM_CONVERSION = YES; 539 | CLANG_WARN_INFINITE_RECURSION = YES; 540 | CLANG_WARN_INT_CONVERSION = YES; 541 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 542 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 543 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 544 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 545 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 546 | CLANG_WARN_STRICT_PROTOTYPES = YES; 547 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 548 | CLANG_WARN_UNREACHABLE_CODE = YES; 549 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 550 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 551 | COPY_PHASE_STRIP = NO; 552 | DEBUG_INFORMATION_FORMAT = dwarf; 553 | ENABLE_STRICT_OBJC_MSGSEND = YES; 554 | ENABLE_TESTABILITY = YES; 555 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 556 | GCC_C_LANGUAGE_STANDARD = gnu99; 557 | GCC_DYNAMIC_NO_PIC = NO; 558 | GCC_NO_COMMON_BLOCKS = YES; 559 | GCC_OPTIMIZATION_LEVEL = 0; 560 | GCC_PREPROCESSOR_DEFINITIONS = ( 561 | "DEBUG=1", 562 | "$(inherited)", 563 | ); 564 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 565 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 566 | GCC_WARN_UNDECLARED_SELECTOR = YES; 567 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 568 | GCC_WARN_UNUSED_FUNCTION = YES; 569 | GCC_WARN_UNUSED_VARIABLE = YES; 570 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 571 | MTL_ENABLE_DEBUG_INFO = YES; 572 | ONLY_ACTIVE_ARCH = YES; 573 | SDKROOT = iphoneos; 574 | TARGETED_DEVICE_FAMILY = "1,2"; 575 | }; 576 | name = Debug; 577 | }; 578 | 97C147041CF9000F007C117D /* Release */ = { 579 | isa = XCBuildConfiguration; 580 | buildSettings = { 581 | ALWAYS_SEARCH_USER_PATHS = NO; 582 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 583 | CLANG_ANALYZER_NONNULL = YES; 584 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 585 | CLANG_CXX_LIBRARY = "libc++"; 586 | CLANG_ENABLE_MODULES = YES; 587 | CLANG_ENABLE_OBJC_ARC = YES; 588 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 589 | CLANG_WARN_BOOL_CONVERSION = YES; 590 | CLANG_WARN_COMMA = YES; 591 | CLANG_WARN_CONSTANT_CONVERSION = YES; 592 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 593 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 594 | CLANG_WARN_EMPTY_BODY = YES; 595 | CLANG_WARN_ENUM_CONVERSION = YES; 596 | CLANG_WARN_INFINITE_RECURSION = YES; 597 | CLANG_WARN_INT_CONVERSION = YES; 598 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 599 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 600 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 601 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 602 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 603 | CLANG_WARN_STRICT_PROTOTYPES = YES; 604 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 605 | CLANG_WARN_UNREACHABLE_CODE = YES; 606 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 607 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 608 | COPY_PHASE_STRIP = NO; 609 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 610 | ENABLE_NS_ASSERTIONS = NO; 611 | ENABLE_STRICT_OBJC_MSGSEND = YES; 612 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 613 | GCC_C_LANGUAGE_STANDARD = gnu99; 614 | GCC_NO_COMMON_BLOCKS = YES; 615 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 616 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 617 | GCC_WARN_UNDECLARED_SELECTOR = YES; 618 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 619 | GCC_WARN_UNUSED_FUNCTION = YES; 620 | GCC_WARN_UNUSED_VARIABLE = YES; 621 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 622 | MTL_ENABLE_DEBUG_INFO = NO; 623 | SDKROOT = iphoneos; 624 | SUPPORTED_PLATFORMS = iphoneos; 625 | SWIFT_COMPILATION_MODE = wholemodule; 626 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 627 | TARGETED_DEVICE_FAMILY = "1,2"; 628 | VALIDATE_PRODUCT = YES; 629 | }; 630 | name = Release; 631 | }; 632 | 97C147061CF9000F007C117D /* Debug */ = { 633 | isa = XCBuildConfiguration; 634 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 635 | buildSettings = { 636 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 637 | CLANG_ENABLE_MODULES = YES; 638 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 639 | DEVELOPMENT_TEAM = 38825Z82DU; 640 | ENABLE_BITCODE = NO; 641 | INFOPLIST_FILE = Runner/Info.plist; 642 | LD_RUNPATH_SEARCH_PATHS = ( 643 | "$(inherited)", 644 | "@executable_path/Frameworks", 645 | ); 646 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reSvgExample; 647 | PRODUCT_NAME = "$(TARGET_NAME)"; 648 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 649 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 650 | SWIFT_VERSION = 5.0; 651 | VERSIONING_SYSTEM = "apple-generic"; 652 | }; 653 | name = Debug; 654 | }; 655 | 97C147071CF9000F007C117D /* Release */ = { 656 | isa = XCBuildConfiguration; 657 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 658 | buildSettings = { 659 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 660 | CLANG_ENABLE_MODULES = YES; 661 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 662 | DEVELOPMENT_TEAM = 38825Z82DU; 663 | ENABLE_BITCODE = NO; 664 | INFOPLIST_FILE = Runner/Info.plist; 665 | LD_RUNPATH_SEARCH_PATHS = ( 666 | "$(inherited)", 667 | "@executable_path/Frameworks", 668 | ); 669 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reSvgExample; 670 | PRODUCT_NAME = "$(TARGET_NAME)"; 671 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 672 | SWIFT_VERSION = 5.0; 673 | VERSIONING_SYSTEM = "apple-generic"; 674 | }; 675 | name = Release; 676 | }; 677 | /* End XCBuildConfiguration section */ 678 | 679 | /* Begin XCConfigurationList section */ 680 | 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { 681 | isa = XCConfigurationList; 682 | buildConfigurations = ( 683 | 331C8088294A63A400263BE5 /* Debug */, 684 | 331C8089294A63A400263BE5 /* Release */, 685 | 331C808A294A63A400263BE5 /* Profile */, 686 | ); 687 | defaultConfigurationIsVisible = 0; 688 | defaultConfigurationName = Release; 689 | }; 690 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 691 | isa = XCConfigurationList; 692 | buildConfigurations = ( 693 | 97C147031CF9000F007C117D /* Debug */, 694 | 97C147041CF9000F007C117D /* Release */, 695 | 249021D3217E4FDB00AE95B9 /* Profile */, 696 | ); 697 | defaultConfigurationIsVisible = 0; 698 | defaultConfigurationName = Release; 699 | }; 700 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 701 | isa = XCConfigurationList; 702 | buildConfigurations = ( 703 | 97C147061CF9000F007C117D /* Debug */, 704 | 97C147071CF9000F007C117D /* Release */, 705 | 249021D4217E4FDB00AE95B9 /* Profile */, 706 | ); 707 | defaultConfigurationIsVisible = 0; 708 | defaultConfigurationName = Release; 709 | }; 710 | /* End XCConfigurationList section */ 711 | }; 712 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 713 | } 714 | --------------------------------------------------------------------------------