├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── org │ │ │ │ └── bellz │ │ │ │ └── treetag │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-mdpi │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-xxxhdpi │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ └── ic_launcher.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── help │ ├── config_fields.md │ ├── config_options.md │ ├── config_output.md │ ├── config_tree.md │ ├── contents.md │ ├── detail_view.md │ ├── features.md │ ├── files.md │ ├── installation.md │ ├── introduction.md │ ├── net_files.md │ ├── quick_start.md │ ├── requirements.md │ ├── settings_view.md │ ├── tree_view.md │ └── undo_view.md ├── images │ ├── tree_icon_32.png │ ├── tree_icon_48.png │ └── tree_icon_64.png ├── launcher │ ├── tree_icon.svg │ ├── tree_icon_1024.png │ ├── tree_icon_1024_white.png │ ├── tree_icon_108.png │ └── tree_icon_512.png └── samples │ ├── Movies_sample.trtg │ └── US_mass_shootings_sample.trtg ├── docs ├── CNAME ├── default.css ├── download.html ├── favicon.png ├── feature.html ├── index.html ├── install.html ├── logo.png ├── privacy.html ├── require.html ├── scrnsht.html ├── treetag_sm.png ├── tt_edit_light.png ├── tt_phone_dark.png ├── tt_phone_light.png ├── tt_split_dark.png ├── tt_split_light.png └── use.html ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── main.dart ├── model │ ├── csv_export.dart │ ├── csv_import.dart │ ├── display_node.dart │ ├── field_format_tools.dart │ ├── fields.dart │ ├── io_file.dart │ ├── parsed_line.dart │ ├── stored_node.dart │ ├── structure.dart │ ├── text_export.dart │ ├── theme_model.dart │ ├── treeline_export.dart │ ├── treeline_import.dart │ ├── undos.dart │ └── word_set_en.dart └── views │ ├── common_dialogs.dart │ ├── common_widgets.dart │ ├── config │ ├── choice_format_edit.dart │ ├── config_view.dart │ ├── field_config.dart │ ├── field_edit.dart │ ├── field_format_edit.dart │ ├── line_edit.dart │ ├── line_field_edit.dart │ ├── option_config.dart │ ├── output_config.dart │ ├── rule_edit.dart │ ├── sort_edit.dart │ └── tree_config.dart │ ├── detail_view.dart │ ├── edit_view.dart │ ├── file_control.dart │ ├── frame_view.dart │ ├── help_view.dart │ ├── sample_control.dart │ ├── search_view.dart │ ├── setting_edit.dart │ ├── tree_view.dart │ └── undo_view.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── metadata └── en-US │ ├── changelogs │ ├── 1.txt │ ├── 10.txt │ ├── 12.txt │ ├── 13.txt │ ├── 14.txt │ ├── 15.txt │ ├── 17.txt │ ├── 18.txt │ ├── 2.txt │ ├── 3.txt │ ├── 4.txt │ ├── 5.txt │ ├── 6.txt │ ├── 7.txt │ └── 9.txt │ ├── full_description.txt │ ├── images │ ├── icon.png │ └── phoneScreenshots │ │ ├── tt_phone_dark.png │ │ └── tt_phone_light.png │ ├── short_description.txt │ └── title.txt ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── treetag.desktop ├── treetag_icon_64.png ├── tt_make.sh └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android related 44 | **/.cxx/ 45 | 46 | # Android Studio will place build artifacts here 47 | /android/app/debug 48 | /android/app/profile 49 | /android/app/release 50 | -------------------------------------------------------------------------------- /.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. 5 | 6 | version: 7 | revision: 135454af32477f815a7525073027a3ff9eff1bfd 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 17 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 18 | - platform: windows 19 | create_revision: 135454af32477f815a7525073027a3ff9eff1bfd 20 | base_revision: 135454af32477f815a7525073027a3ff9eff1bfd 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /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 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | } 6 | 7 | def localProperties = new Properties() 8 | def localPropertiesFile = rootProject.file('local.properties') 9 | if (localPropertiesFile.exists()) { 10 | localPropertiesFile.withReader('UTF-8') { reader -> 11 | localProperties.load(reader) 12 | } 13 | } 14 | 15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 16 | if (flutterVersionCode == null) { 17 | flutterVersionCode = '1' 18 | } 19 | 20 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 21 | if (flutterVersionName == null) { 22 | flutterVersionName = '1.0' 23 | } 24 | 25 | def keystoreProperties = new Properties() 26 | def keystorePropertiesFile = rootProject.file('key.properties') 27 | if (keystorePropertiesFile.exists()) { 28 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 29 | } 30 | 31 | android { 32 | namespace "org.bellz.treetag" 33 | compileSdkVersion 35 34 | ndkVersion "26.1.10909125" 35 | 36 | compileOptions { 37 | sourceCompatibility JavaVersion.VERSION_1_8 38 | targetCompatibility JavaVersion.VERSION_1_8 39 | } 40 | 41 | kotlinOptions { 42 | jvmTarget = '1.8' 43 | } 44 | 45 | sourceSets { 46 | main.java.srcDirs += 'src/main/kotlin' 47 | } 48 | 49 | defaultConfig { 50 | applicationId "org.bellz.treetag" 51 | minSdkVersion flutter.minSdkVersion 52 | targetSdkVersion 35 53 | versionCode flutterVersionCode.toInteger() 54 | versionName flutterVersionName 55 | } 56 | 57 | signingConfigs { 58 | release { 59 | keyAlias keystoreProperties['keyAlias'] 60 | keyPassword keystoreProperties['keyPassword'] 61 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null 62 | storePassword keystoreProperties['storePassword'] 63 | } 64 | } 65 | buildTypes { 66 | release { 67 | signingConfig signingConfigs.release 68 | } 69 | } 70 | } 71 | 72 | flutter { 73 | source '../..' 74 | } 75 | 76 | dependencies {} 77 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 29 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/org/bellz/treetag/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package org.bellz.treetag 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ffffff 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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-8.7-all.zip 6 | -------------------------------------------------------------------------------- /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 "8.5.0" apply false 22 | id "org.jetbrains.kotlin.android" version "1.9.10" apply false 23 | } 24 | 25 | include ":app" 26 | -------------------------------------------------------------------------------- /assets/help/config_fields.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Configure Fields 5 | --- 6 | 7 | The Fields tab of the Configuration view lists the fields that are defined for 8 | leaf node data. Tapping/clicking a field name toggles its selection. There are 9 | icons above the list to create a new field ("+"), edit a field (pencil), delete 10 | a field (trashcan), or move a field up or down (arrows). 11 | 12 | Editing a new or existing field shows a form with the field name, type, initial 13 | value, and default prefix and suffix. When done editing, use the left arrow at 14 | the top to finish editing. There is also a reset button on the upper right to 15 | restore previous settings. 16 | 17 | The available field types include Text, LongText, Choice, AutoChoice, Number, 18 | Date and Time. The default type is Text. LongText is the same except for 19 | showing more lines in the edit view. The AutoChoice type allows prior values 20 | for the field to be selected from a pull-down menu, or a new value can be typed. 21 | 22 | The Choice, Number, Date and Time types add a field format definition editor to 23 | the configuration edit form. Tapping on the format will show an edit view with 24 | oval chips for each segment of the format. The chips can be tapped/clicked to 25 | select them, and can be edited using the icons above the chips. The Number, 26 | Date and Time types show a format sample preview below the chips that formats an 27 | arbitrary value. 28 | 29 | The field configuration edit form includes an option for allowing multiple 30 | entries. If enabled, a plus sign will appear at that field when editing a leaf 31 | node. Clicking the plus will add an extra entry for that field. This allows 32 | leaf nodes to show under multiple categories. Any blank entries will be removed 33 | after editing. Enabling this option in the field configuration edit form also 34 | shows a field separator option. This separator is used in leaf node outputs to 35 | join multiple entries. By default, it is set to a comma and a space. Use a 36 | "\n" in the separator to show the entries on different lines, duplicating the 37 | entire output line. Note that two fields with the multiple entries option 38 | enabled can not be combined in the same rule or output line. Also note that 39 | multiple entry fields do not work well when nested rules use that same field 40 | with different formats (such as date field rules for years then for months). 41 | -------------------------------------------------------------------------------- /assets/help/config_options.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Configure Options 5 | --- 6 | 7 | The Options tab of the Configuration view shows an option to enable Markdown 8 | text formatting. If enabled, text entries with Markdown syntax will show 9 | formatted text in the Tree and Detail Views. Many guides to Markdown syntax 10 | are available on the web. TreeTag specifically supports the GitHub Flavored 11 | Markdown version. Clickable links to http and https addresses can be entered 12 | with the link text enclosed in square brackets followed by the address in 13 | parenthesis. 14 | 15 | On desktop platforms, right-clicking on field text editors when Markdown is 16 | enabled will show a command to add a file link. This will show a file 17 | select dialog box to select the link target. Clicking on that link in the 18 | formatted tree or detail views opens the default application for that file 19 | type. An option in the Options tab is used to toggle between absolute and 20 | relative paths for new links. 21 | 22 | -------------------------------------------------------------------------------- /assets/help/config_output.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Configure Output 5 | --- 6 | 7 | The Output tab of the Configuration view shows a title line followed by one or 8 | more output lines. The title line defines how a leaf node is shown as a single 9 | line in the main tree view. The output lines are combined to define how a leaf 10 | node is shown when expanded in the main tree view and in the detail view. 11 | 12 | Tapping/clicking a title or output line toggles its selection. There are icons 13 | above the lines to add a new output line ("+"), edit a line (pencil), delete an 14 | output line (trashcan), or move an output line up or down. 15 | 16 | Adding or editing a line shows the line editor. Fields and text that are added 17 | show up as oval chips for each segment of the line. These chips can be edited, 18 | deleted and moved to fully define the line. Editing a field chip allows the 19 | user to define a custom prefix and suffix, as well as a field format for 20 | applicable field types. If not explicitly set, these will use the field 21 | defaults. Once the line is not empty, the line editor can be exited by using 22 | the left arrow at the top. 23 | -------------------------------------------------------------------------------- /assets/help/config_tree.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Configure the Tree 5 | --- 6 | 7 | The Tree tab of the Configuration view shows how the title and grouping nodes 8 | are arranged in the tree. Tapping/clicking a node name toggles its selection. 9 | There are icons above the tree to create a new node ("+"), edit a node (pencil), 10 | delete a node (trashcan), or move a title node up or down (arrows). The new 11 | node button shows a menu for adding a title node as a sibling or child of the 12 | selected node, or for adding a group node as a child. The delete a node button 13 | shows a menu for deleting just the node or deleting the node along with its 14 | children. 15 | 16 | Title nodes function as static headings in the tree. They form a scaffold that 17 | organizes and arranges the grouping nodes. The top level of the structure must 18 | consist only of title node(s). When adding and editing title nodes, a dialog 19 | box prompts for the title text. Deleting a title with the node only option will 20 | move any child nodes up by one level. 21 | 22 | Grouping nodes contain rules that categorize the leaf nodes into groups. The 23 | rules consist of a field, sometimes combined with other fields or extra text. In 24 | the main tree view, the data from each leaf node is used to fill in the fields, 25 | and the resulting text strings become headings. Leaf nodes that match are 26 | placed under that heading. Group nodes can be nested to further subdivide the 27 | leaf nodes, but they cannot have any siblings and cannot have title nodes as 28 | children. Adding a new child title or group when there is an existing group 29 | node will move the existing group down by one level. 30 | 31 | Nested group nodes can also contain the same field as their parent but with a 32 | different field format. For example, a group node with a date field could have 33 | a field format showing only the year, and a nested group could have a field 34 | format showing months as lower level headings. 35 | 36 | Adding a new group node shows a rule line editor. Fields and text that are 37 | added show up as oval chips for each segment of the rule. These chips can be 38 | edited, deleted and moved to define the rule. Editing a field chip allows the 39 | user to define a custom prefix and suffix, as well as a field format for 40 | applicable field types. If not explicitly set, these will use the field 41 | defaults. Once the rule line contains at least one field, the line editor can 42 | be exited by using the left arrow at the top. Then a summary view for the group 43 | node will be shown. 44 | 45 | The summary view for the group node is also shown when editing an existing group 46 | node. Tapping the rule definition at the top will start the rule line editor 47 | described above. Group sorting settings are shown below the rule definition. 48 | This defines how the group's headings are sorted. The default sorts using the 49 | fields from the rule line in ascending order. The custom button can be used to 50 | define other sequences. Finally, if the group node has no nested child groups, 51 | child sorting settings are shown below the group sort settings. This defines 52 | how the child leaf nodes are sorted. The default sorts using all of the fields 53 | in ascending order. The custom button can be used to define other sequences. 54 | -------------------------------------------------------------------------------- /assets/help/contents.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Contents 3 | --- 4 | 5 | * [Introduction](introduction.md) 6 | * [Features](features.md) 7 | * [System Requirements](requirements.md) 8 | * [Installation](installation.md) 9 | * Usage 10 | * [Quick Start](quick_start.md) 11 | * [Files](files.md) 12 | * [Network Files](net_files.md) 13 | * [Tree View](tree_view.md) 14 | * [Detail View](detail_view.md) 15 | * [Configure Fields](config_fields.md) 16 | * [Configure the Tree](config_tree.md) 17 | * [Configure Output](config_output.md) 18 | * [Configure Options](config_options.md) 19 | * [Undo View](undo_view.md) 20 | * [Settings View](settings_view.md) 21 | 22 | -------------------------------------------------------------------------------- /assets/help/detail_view.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Detail View 5 | --- 6 | 7 | If started from a title or grouping node, the detail view shows a list of that 8 | node's children. Child title or grouping nodes show the same line of text as 9 | is shown in the tree view. Child leaf nodes show the lines that are configured 10 | in the output configuration. 11 | 12 | Tapping/clicking on a child title or grouping node will show a new detail view 13 | with that node's children. Tapping/clicking on a child leaf node will show a 14 | new detail view with that node by itself. Tapping/clicking the left arrow above 15 | the view will return to the previous view. 16 | 17 | Tapping/clicking the "+" icon will create a new leaf node and show it in an edit 18 | view. If started from a view of a grouping node or a leaf node, at least some of 19 | the fields will initially be populated to match the group or leaf. 20 | 21 | A detail view showing the children of a title node or a grouping node will have 22 | a three-dots menu. This menu includes commands to edit or delete all descendant 23 | leaf nodes. The edit command will show an edit view filled with data that is 24 | common to all nodes. The edits from adding or changing any fields will be 25 | applied to all of the nodes. The delete command will remove all of the 26 | descendant leaf nodes. Deleting with a title node as the current parent will 27 | remove all leaf nodes from the file. 28 | 29 | A detail view with an isolated leaf node will show edit (pencil icon) and delete 30 | (trash icon) commands. The edit command will show an edit view for this leaf 31 | node. The delete command will remove all instances of this leaf node. 32 | 33 | Also, text can be selected and copied from an isolated leaf node in a detail 34 | view. 35 | -------------------------------------------------------------------------------- /assets/help/features.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Features 3 | --- 4 | 5 | * Stores almost any type of information, including plain text, formatted text, 6 | numbers, dates, times, booleans, URLs, etc. 7 | * Nodes can have several fields that form a mini-database. 8 | * The user-defined tree structure keeps things organized automatically. 9 | * The same nodes can appear in multiple locations. 10 | * Users can drill down into various sections of the tree to find nodes using 11 | different criteria. 12 | * Pressing on a leaf node in the tree expands it to show its full output. 13 | * A long or double press on a node in the tree opens a detail view showing the 14 | full output of the node and any children. 15 | * Creating a new leaf node when the detail view shows a grouping node will 16 | pre-populate fields to match the group. 17 | * Phrase, keyword and regular expression searches will list all matching nodes 18 | from an active group or from the entire tree. 19 | * String replace operations can be performed on search results. 20 | * By default, the text field editor will show misspelled English words with a 21 | red underline. 22 | * An option can be set to support Markdown text formatting in all text fields. 23 | * When using Markdown, links can be added that will open web pages in an 24 | external browser. 25 | * When using Markdown on desktop platforms, file links can be added that will 26 | open files using their default applications. 27 | * An option can be set to allow multiple entries in a field, so leaf nodes can 28 | show up in multiple categories. 29 | * Undo operations are stored in the files, so operations from a previous session 30 | can be undone. 31 | * The data from a two TreeTag files can be merged together. 32 | * Files can be imported and exported to or from both TreeLine and CSV files. 33 | * Files can be exported to indented text files. 34 | * TreeTag can interface with a Kinto storage server to store and retrieve files 35 | from the cloud. 36 | 37 | -------------------------------------------------------------------------------- /assets/help/files.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Files 5 | --- 6 | 7 | When TreeTag opens, it shows a list of files in the app's private storage 8 | folder. It will be empty the first time the app is run. A tap/click on a file 9 | name will select the file. A double tap/click or a long press/click will open 10 | the file. 11 | 12 | In addition to opening TreeTag files (with a .trtg file extension), it can also 13 | import files from TreeLine (with a .trln file extension). Double or long 14 | tapping/clicking on these files will show a prompt to select a single node type 15 | to be imported. Imports should only be done from basic TreeLine files - 16 | formatting and complex field types are not currently supported. 17 | 18 | If a file to be opened is not a TreeTag or a TreeLine file, it will try to 19 | import it as a CSV table. The first row becomes the field names, and every 20 | subsequent row becomes a leaf node. The file will have a simple tree structure 21 | that can then be configured manually to add more categories. 22 | 23 | In the top bar, the "+" icon can be used to create a new file. When a single 24 | file is selected, it will instead show an "i" icon, used to show file details 25 | (path, modified time and size). 26 | 27 | The three-dots icon shows a menu whose commands vary depending on how many 28 | files are currently selected. There are commands that can copy a file to or 29 | from an external folder, make a local copy of a file, rename a file, or delete 30 | a file. 31 | 32 | Selecting "Sample Files" from the hamburger (three lines) menu on the left 33 | shows a list of available samples. A double tap/click or a long press/click 34 | will open a sample. If the sample is edited, a modified copy will show up in 35 | the app's working storage folder. 36 | 37 | Once a file is opened, the "Close File" command in the menu will return to the 38 | file list. 39 | -------------------------------------------------------------------------------- /assets/help/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Installation 3 | --- 4 | 5 | ## Android 6 | 7 | Treetag can be installed from Google Play, 8 | [here](https://play.google.com/store/apps/details?id=org.bellz.treetag). 9 | 10 | Alternatively, an APK file (treetag_x.x.x.apk) is provided that can be 11 | downloaded to an Android device and run. 12 | 13 | --- 14 | 15 | ## Linux 16 | 17 | Extract the files from the archive (treetag_x.x.x.tar.gz) into a user-owned 18 | directory. You need to have at least 2GB of disk space available for the 19 | automated build. Then change to the `TreeTag` directory in a terminal, and 20 | run the following commands: 21 | 22 | $ sudo ./tt_make.sh depends 23 | $ ./tt_make.sh build 24 | $ sudo ./tt_make.sh install 25 | 26 | The first command automatically installs dependencies using the `apt-get`, 27 | `dnf` or `pacman` native packaging system. If desired, you can manually 28 | install the dependencies in the [Requirements](requirements.md) section and 29 | skip this line. 30 | 31 | The second line (build) downloads Flutter and builds TreeTag. 32 | 33 | The third line (install) copies the necessary files into directories under 34 | `/opt`. After this step, the temporary `TreeTag` build directory can be 35 | deleted. 36 | 37 | --- 38 | 39 | ## Windows 40 | 41 | The simplest approach is to download the "treetag_x.x.x.zip" file and extract 42 | all of its contents to an empty folder. Then run the "treetag.exe" file. 43 | 44 | To compile TreeTag from source, install the TreeTag source from 45 | . Also install Flutter based on the 46 | instructions in . The 47 | Android Setup is not required - just the Linux setup from the bottom of the 48 | page. 49 | -------------------------------------------------------------------------------- /assets/help/introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Introduction 3 | --- 4 | 5 | TreeTag is a personal data manager. It stores information in a hierarchy (the 6 | "Tree" part of the name). But unlike other tree-based applications, TreeTag 7 | automatically positions items in the tree based on field values (the "Tag" part 8 | of the name). 9 | 10 | The data items are generally configured to contain several fields. Different 11 | types of fields are available, including text, numbers, dates, times and 12 | predefined choices. The output format of each field can be defined for group 13 | headings, for data item titles and for data item output. 14 | 15 | The user configures the base portion of the tree, defining rules that will 16 | group the data items into desired categories. The same items can appear in 17 | multiple locations, with sections of the tree structure using different fields 18 | for grouping or sorting. For example, data items can be arranged by a date 19 | field in one section, by a name field sorted alphabetically in another, and by 20 | a category field in another. This allows the differently organized portions of 21 | the tree to act much like predefined searches. 22 | 23 | Also visit for more information. 24 | -------------------------------------------------------------------------------- /assets/help/net_files.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Network Files 5 | --- 6 | 7 | TreeTag can interface with a Kinto storage server to access files from multiple 8 | devices or locations. You can either install and run your own server or choose 9 | a low-cost cloud provider. 10 | 11 | The server information is entered under the Settings item in the hamburger menu. 12 | The Network Address is set to the full URL of a specific bucket object on a 13 | Kinto server. The Network User Name must also be set. Setting the Network 14 | Password item is optional. If not set (the more secure option), TreeTag will 15 | prompt you for the password once per session. 16 | 17 | Use the Local and Network Storage items in the hamburger menu to switch between 18 | network and local storage. The file list and commands work basically the same 19 | way under both. The upload and download commands can be used to copy a file 20 | from one storage area to the other. Note that only JSON files, such as TreeTag 21 | and TreeLine file formats, can be stored in the network. 22 | -------------------------------------------------------------------------------- /assets/help/quick_start.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Quick Start 5 | --- 6 | 7 | TreeTag shows an empty file list when it first starts. The "+" icon can be used 8 | to create a new file that can be modified and re-configured. 9 | 10 | But a new file, with its simple structure, is probably not the best way to learn 11 | about and understand TreeTag. There are two built-in sample files that are 12 | better choices. Select "Sample Files" from the hamburger (three lines) menu on 13 | the left. Then either a double tap/click or a long press/click will open a 14 | listed file. 15 | 16 | In the tree view, tapping/clicking on a title or grouping node (proceeded by 17 | small triangles) will expand or collapse the node's children. On a leaf node 18 | (proceeded by a dot), it will toggle from showing just a title line to showing 19 | multiple output lines. 20 | 21 | A long press/click on any node will show details in a detail view. The "+" icon 22 | in the top bar can be used to create new leaf nodes. If a leaf node is being 23 | shown, the pencil icon will allow its data to be edited. 24 | 25 | All leaf nodes are automatically placed into location(s) in the tree based on 26 | their data and the configuration of the tree. The "Edit Configuration" command 27 | in the hamburger menu will show controls for setting up the leaf node data, how 28 | they are arranged and how they are displayed. Please refer to the sections 29 | below for more information. 30 | -------------------------------------------------------------------------------- /assets/help/requirements.md: -------------------------------------------------------------------------------- 1 | --- 2 | # System Requirements 3 | --- 4 | 5 | ## Android 6 | 7 | TreeTag should run on Android 4.1 (Jelly Bean) and above. 8 | 9 | --- 10 | 11 | ## Linux 12 | 13 | TreeTag should run on any 64-bit Linux OS. There is no support for 32-bit 14 | platforms. 15 | 16 | The following dependencies are required to build and run TreeTag, but the 17 | install script will automatically install them using your native packaging 18 | system: 19 | * Clang 20 | * CMake 21 | * curl 22 | * git 23 | * GTK development headers 24 | * Mesa OpenGL utility library 25 | * Ninja build 26 | * pkg-config 27 | * standard C++ development headers 28 | * unzip 29 | * XZ development headers 30 | * XZ utilities 31 | * zenity 32 | * zip 33 | 34 | --- 35 | 36 | ## Windows 37 | 38 | TreeTag should run on Windows 10 and above, 64-bit. There is no support for 39 | 32-bit platforms. 40 | 41 | --- 42 | 43 | ## macOS 44 | 45 | Due to a lack of Macs for testing, TreeTag on macOS is not supported. 46 | Assistance with creating a Mac port would be appreciated. 47 | 48 | --- 49 | 50 | ## iOS 51 | 52 | Due to a lack of hardware for development and testing, TreeTag on iOS is not 53 | supported. Assistance with creating an iOS port would be appreciated. 54 | -------------------------------------------------------------------------------- /assets/help/settings_view.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Settings View 5 | --- 6 | 7 | The settings view contains general customization options. Options not 8 | previously discussed include hiding dot files, enabling spell checks, tight 9 | line spacing, a dark theme, remember window geometry and a view scale ratio. 10 | File names that begin with a dot will not be shown if the hidden option is 11 | enabled. The red underline under misspelled English words is controlled by the 12 | spell check setting (currently, no suggestions are shown for misspelled words 13 | on desktop platforms). The tight line spacing option allows more lines to fit 14 | on the screen - it is recommended when using a mouse, but may not leave enough 15 | space for touch interfaces. A darker theme can be enabled in place of the 16 | default light theme. The window size and position will be restored from the 17 | previous session use if enabled. The view scale ratio can be set to make the 18 | content smaller or larger (useful for high-dpi displays). 19 | 20 | On desktop platforms, there is also an option to set the working directory. 21 | This is where all files in the main file list are stored. 22 | -------------------------------------------------------------------------------- /assets/help/tree_view.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Tree View 5 | --- 6 | 7 | In the tree view, title and grouping nodes are proceeded by small triangles. 8 | These nodes can be tapped/clicked to expand or collapse the node's children. 9 | The leaf nodes, proceeded by circles, contain the data. They have no children 10 | but they can be tapped/clicked to toggle between showing a single title line 11 | (the default) or multiple output lines. 12 | 13 | A long press/click on a tree node will show a detail view listing that node's 14 | children (for title and grouping nodes) or the node output (for a leaf node). On 15 | wide screens/windows (generally on desktops or tablets), the detail view is 16 | shown to the right of the tree view. Otherwise it temporarily covers the tree 17 | view. The detail view is described in the next section. The tree view will 18 | highlight current parent or node in the detail view. 19 | 20 | The "+" icon in the top bar will create a new leaf node and show it in an edit 21 | view. Once the editing is complete, the new node will be properly placed into 22 | the tree. In many cases, it's easier to start new nodes when the detail view is 23 | showing a group or leaf node, since at least some of the fields will initially 24 | be populated to match the group or leaf. 25 | 26 | The magnifying glass icon will show a search view for finding matching leaf 27 | nodes. If the detail view is showing a grouping node, search results will be 28 | limited to the children of that group. If the detail view is showing a title 29 | node or no node, all leaf nodes will be searched. Note that searching is not 30 | available if a leaf node is being shown. The search view menu can be used to 31 | set the search method to a phrase, keywords or regular expressions. Note that 32 | only regular expressions are case sensitive. As a string is typed in the top 33 | bar, matching nodes will be shown in the main view. Tapping/clicking on a 34 | resulting node will select it and show its full output, with the matching text 35 | highlighted. The last node selected when leaving the search view will become 36 | current in the detail view and expanded in the tree. There is also a replace 37 | option in the menu when searching by phrase or regular expression. When 38 | searching with regular expressions, adding "$1", "$2", etc. in the replacement 39 | string will substitute matching groups from the search results. 40 | 41 | The hamburger (three lines) menu includes commands for the configuration 42 | editor, the settings view and the undo list, all described in subsequent 43 | sections. There is also a command to merge the data from a second file. The 44 | second file should have similar fields, but any missing fields will be added as 45 | necessary. Otherwise, the configuration of the current file is kept. Finally, 46 | there are commands to export the current data to a TreeLine file, to a CSV file 47 | or to an indented text file. The CSV export gives options for field text to be 48 | as output (same as displayed) or as stored (better for re-import). The 49 | indented text export gives options to include titles only or all node output 50 | lines. 51 | -------------------------------------------------------------------------------- /assets/help/undo_view.md: -------------------------------------------------------------------------------- 1 | --- 2 | # Usage 3 | --- 4 | ## Undo View 5 | --- 6 | 7 | Undo operations can be essential because TreeTag is continually writing changes 8 | to the file. The undo list is also stored in the file. It contains all undo 9 | operations that have not been explicitly deleted by the user. The undo items 10 | are listed from oldest to newest. 11 | 12 | To undo some operations, select "Undo to here" from the three-dots menu on the 13 | earliest (highest) item to be undone. That item and the lower, newer items will 14 | change color to indicate that they have been selected. Exiting the view using 15 | the left arrow at the top will complete the undo operation. The undo can be 16 | aborted by selecting "Cancel undo" on the earliest item set to be undone. 17 | 18 | Once operations are undone, they are automatically converted to redo operations. 19 | They can be redone the same as undo operations, by selecting "Undo to here". An 20 | exception is if undo operations prior to the redo operations are also selected 21 | to be completed. In this case the redo operations will become gray to indicate 22 | that they will be removed to allow the older undo operations to be completed. 23 | 24 | Undo operations can be removed to keep the list manageable and to reduce the 25 | size of the TreeTag data file. To remove old undo operations, select "Delete to 26 | here" from the three-dots menu on the most recent (lowest) item to be removed. 27 | That item and the higher, older items will become gray to indicate that they 28 | have been marked for deletion. The deletion can be aborted by selecting "Cancel 29 | delete" on the most recent item set to be removed. Exiting the view using the 30 | left arrow at the top will complete the deletion. Once completed, deleted items 31 | cannot be recovered. 32 | 33 | In TreeTag Settings, there is an option for the Days to Store Undo History. 34 | Undo operations older than this many days are not written to files. This does 35 | not remove undos currently in a session - it only affects what is written. So 36 | undo operations from the most recent changes will always be available, even if 37 | older than this setting. They only disappear after more changes are made 38 | (written to a file), and then the file is closed. Setting the number of days to 39 | 0 will prevent all undo operations from being written to files. Setting it to a 40 | very large number will effectively prevent undos from being automatically 41 | removed. 42 | -------------------------------------------------------------------------------- /assets/images/tree_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/assets/images/tree_icon_32.png -------------------------------------------------------------------------------- /assets/images/tree_icon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/assets/images/tree_icon_48.png -------------------------------------------------------------------------------- /assets/images/tree_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/assets/images/tree_icon_64.png -------------------------------------------------------------------------------- /assets/launcher/tree_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/assets/launcher/tree_icon_1024.png -------------------------------------------------------------------------------- /assets/launcher/tree_icon_1024_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/assets/launcher/tree_icon_1024_white.png -------------------------------------------------------------------------------- /assets/launcher/tree_icon_108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/assets/launcher/tree_icon_108.png -------------------------------------------------------------------------------- /assets/launcher/tree_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/assets/launcher/tree_icon_512.png -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | treetag.bellz.org 2 | -------------------------------------------------------------------------------- /docs/default.css: -------------------------------------------------------------------------------- 1 | /* bellz.org style sheet */ 2 | 3 | body { 4 | background: #033; 5 | color: white; 6 | } 7 | 8 | a { 9 | color: #0f9; 10 | text-decoration: none; 11 | } 12 | 13 | a:hover { 14 | text-decoration: underline; 15 | } 16 | 17 | hr { 18 | height: 4px; 19 | } 20 | 21 | h1 { 22 | text-align: center; 23 | border-top: thick double #ccc; 24 | padding: .3em; 25 | margin: 1em 0 0; 26 | clear: both; 27 | } 28 | 29 | h2 { 30 | border-top: thin solid #ccc; 31 | padding: .3em 0 0; 32 | margin: 1em 0 0; 33 | } 34 | 35 | ul { 36 | margin-left: 0; 37 | } 38 | 39 | li { 40 | list-style-type: square; 41 | padding: .2em 0; 42 | margin-left: 2em; 43 | } 44 | 45 | img { 46 | border: 0; 47 | } 48 | 49 | .interior { 50 | margin: 0 auto; 51 | width: 90%; 52 | } 53 | 54 | .title { 55 | margin: 0; 56 | padding: 4px 0; 57 | float: left; 58 | } 59 | 60 | .title h1 { 61 | font-size: 4em; 62 | margin: 0; 63 | padding: 0; 64 | } 65 | 66 | .toplinks { 67 | float: right; 68 | text-align: right; 69 | } 70 | 71 | .toplinks p { 72 | margin: 0; 73 | padding: 0; 74 | } 75 | 76 | .navigation { 77 | clear: both; 78 | line-height: 3em; 79 | margin: 0; 80 | padding: 0; 81 | } 82 | 83 | .navigation a { 84 | background: #366; 85 | margin-right: 3px; 86 | padding: .4em .4em; 87 | } 88 | 89 | .navigation a:hover { 90 | background: #099; 91 | text-decoration: none; 92 | } 93 | 94 | .current-nav { 95 | background: #366; 96 | margin-right: 3px; 97 | padding: .4em .4em 1em; 98 | } 99 | 100 | .content { 101 | background: #366; 102 | margin: 0 0 2em; 103 | padding: .5em 1.5em; 104 | zoom: 1; /* fixes IE layout bug */ 105 | /* height: 1%; /* fixes IE layout bug */ 106 | } 107 | 108 | .centered { 109 | text-align: center; 110 | } 111 | 112 | .smallimage { 113 | float: left; 114 | margin: 0 1em; 115 | } 116 | 117 | .clearer { 118 | clear: both; 119 | } 120 | -------------------------------------------------------------------------------- /docs/download.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | TreeTag - Downloads 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 | TreeTag 19 |
20 | 21 | 27 | 28 | 37 | 38 |
39 | 40 |

TreeTag Downloads

41 | 42 |

Android

43 | 44 |

For an Android device that conforms to the requirements page:

46 |
    47 |
  • TreeTag can be downloaded and installed from Google Play, here. 49 |
  • Alternately, it can be installed from an APK file: 51 | treetag_0.8.1.apk (24 MB)
  • 52 |
53 | 54 |

Linux

55 | 56 |

On any 64-bit Linux OS, TreeTag can be installed using the script included 57 | in:

58 | 61 | 62 |

Windows

63 | 64 |

On a Windows system that conforms to the requirements page, all that is needed is:

66 | 69 | 70 |

Alternately, TreeTag can be compiled from source — see the Installation page for more information.

72 | 73 | 74 |

Older Versions

75 | 76 |

Previous versions of TreeTag are available from GitHub.

78 | 79 |
80 | 81 |
82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /docs/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/docs/favicon.png -------------------------------------------------------------------------------- /docs/feature.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | TreeTag - Features 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 | TreeTag 19 |
20 | 21 | 27 | 28 | 37 | 38 |
39 | 40 |

TreeTag Features

41 | 42 |
    43 | 44 |
  • Stores almost any type of information, including plain text, formatted 45 | text, numbers, dates, times, booleans, URLs, etc.
  • 46 | 47 |
  • Nodes can have several fields that form a mini-database.
  • 48 | 49 |
  • The user-defined tree structure keeps things organized automatically.
  • 50 | 51 |
  • The same nodes can appear in multiple locations.
  • 52 | 53 |
  • Users can drill down into various sections of the tree to find nodes using 54 | different criteria.
  • 55 | 56 |
  • Pressing on a leaf node in the tree expands it to show its full 57 | output.
  • 58 | 59 |
  • A long or double press on a node in the tree opens a detail view showing 60 | the full output of the node and any children.
  • 61 | 62 |
  • Creating a new leaf node when the detail view shows a grouping node will 63 | pre-populate fields to match the group.
  • 64 | 65 |
  • Phrase, keyword and regular expression searches will list all matching 66 | nodes from an active group or from the entire tree.
  • 67 | 68 |
  • String replace operations can be performed on search results.
  • 69 | 70 |
  • By default, the text field editor will show misspelled English words with 71 | a red underline.
  • 72 | 73 |
  • An option can be set to support Markdown text formatting in all text 74 | fields.
  • 75 | 76 |
  • When using Markdown, links can be added that will open web pages in an 77 | external browser.
  • 78 | 79 |
  • When using Markdown on desktop platforms, file links can be added that 80 | will open files using their default applications.
  • 81 | 82 |
  • An option can be set to allow multiple entries in a field, so leaf nodes 83 | can show up in multiple categories.
  • 84 | 85 |
  • Undo operations are stored in the files, so operations from a previous 86 | session can be undone.
  • 87 | 88 |
  • The data from a two TreeTag files can be merged together.
  • 89 | 90 |
  • Files can be imported and exported to or from both TreeLine and CSV 91 | files.
  • 92 | 93 |
  • Files can be exported to indented text files.
  • 94 | 95 |
  • TreeTag can interface with a Kinto storage server to store and retrieve 96 | files from the cloud.
  • 97 | 98 |
99 | 100 |
101 | 102 |
103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /docs/install.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | TreeTag - Installation 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 | TreeTag 19 |
20 | 21 | 27 | 28 | 37 | 38 |
39 | 40 |

TreeTag Installation

41 | 42 |

Android

43 | 44 |

TreeTag can be installed from Google Play, here. 46 | 47 |

Alternatively an APK file (treetag_x.x.x.apk) is provided that can be 48 | downloaded to an Android device and run.

49 | 50 |

Linux

51 | 52 |

Extract the files from the archive (treetag_x.x.x.tar.gz) into a user-owned 53 | directory. You need to have at least 2GB of disk space available for the 54 | automated build. Then change to the TreeTag directory in a 55 | terminal, and run the following commands:

56 | 57 |
58 |     $ sudo ./tt_make.sh depends
59 |     $ ./tt_make.sh build
60 |     $ sudo ./tt_make.sh install
61 | 
62 | 63 |

The first command automatically installs dependencies using the apt-get, 64 | dnf or pacman native packaging system. If desired, you can manually install 65 | the dependencies in the Requirements section and 66 | skip this line.

67 | 68 |

The second line (build) downloads Flutter and builds TreeTag.

69 | 70 |

The third line (install) copies the necessary files into directories under 71 | /opt. After this step, the temporary TreeTag build 72 | directory can be deleted.

73 | 74 |

Windows

75 | 76 |

The simplest approach is to download the "treetag_x.x.x.zip" file and 77 | extract all of its contents into an empty directory. Then run the 78 | "treetag.exe" file.

79 | 80 |

To compile TreeTag from source, install the TreeTag source from GitHub. Also install Flutter 82 | based on the instructions here. The 84 | Android Setup is not required - just the Linux setup from the bottom of the 85 | page.

86 | 87 |
88 | 89 |
90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/docs/logo.png -------------------------------------------------------------------------------- /docs/privacy.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | TreeTag - Privacy 11 | 12 | 13 | 14 | 15 |

Privacy Policy

16 |
    17 |
  • TreeTag and its developer take your privacy very seriously.
  • 18 |
  • By default, all data that users input is stored locally, on the user's own 19 | device.
  • 20 |
  • To remotely store data, users may optionally select a third-party Kinto 21 | server and enter the server's address in TreeTag's settings. In this case, the 22 | user is responsible for evaluating the security and privacy policies of the 23 | third party server.
  • 24 |
  • TreeTag uses no third-party analytics or advertising frameworks.
  • 25 |
  • If you email the developer for support or other feedback, the emails will be 26 | retained for quality assurance purposes. The email addresses will be used only 27 | to reply to the concerns or suggestions raised and will never be used for any 28 | other purpose.
  • 29 |
  • Other than as noted above, TreeTag does not collect, transmit, distribute or 30 | sell your data.
  • 31 |
32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/require.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | TreeTag - Requirements 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 | TreeTag 19 |
20 | 21 | 27 | 28 | 37 | 38 |
39 | 40 |

Legal Issues

41 | 42 |

TreeTag is free software; you can redistribute it and/or modify it under 43 | the terms of the GNU General Public License as published by the Free Software 44 | Foundation; either Version 2 of the License, or (at your option) any later 45 | version.

46 | 47 |

This program is distributed in the hope that it will be useful, but 48 | WITHOUT ANY WARRANTY. See the LICENSE file provided with this program 49 | for more information.

50 | 51 |

Also, TreeTag will protect your privacy. See the full privacy policy 52 | here. 53 | 54 |

System Requirements

55 | 56 |

Android

57 | 58 |

TreeTag should run on Android 4.1 (Jelly Bean) and above.

59 | 60 |

Linux

61 | 62 |

TreeTag should run on any 64-bit Linux OS. There is no support for 32-bit 63 | platforms.

64 | 65 |

The following dependencies are required to build and run TreeTag, but the 66 | install script will automatically install them using your native packaging 67 | system:

68 |
    69 |
  • Clang
  • 70 |
  • CMake
  • 71 |
  • curl
  • 72 |
  • git
  • 73 |
  • GTK development headers
  • 74 |
  • Mesa OpenGL utility library
  • 75 |
  • Ninja build
  • 76 |
  • pkg-config
  • 77 |
  • standard C++ development headers
  • 78 |
  • unzip
  • 79 |
  • XZ development headers
  • 80 |
  • XZ utilities
  • 81 |
  • zenity
  • 82 |
  • zip
  • 83 |
84 | 85 |

Windows

86 | 87 |

TreeTag should run on Windows 10 and above, 64-bit. There is no support 88 | for 32-bit platforms.

89 | 90 |

macOS

91 | 92 |

Due to a lack of Macs for testing, TreeTag on macOS is not supported. 93 | Assistance with creating a Mac port would be appreciated.

94 | 95 |

iOS

96 | 97 |

Due to a lack of hardware for development and testing, TreeTag on iOS is 98 | not supported. Assistance with creating an iOS port would be appreciated.

99 | 100 |
101 | 102 |
103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /docs/scrnsht.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | TreeTag - Screenshots 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 | TreeTag 19 |
20 | 21 | 27 | 28 | 37 | 38 |
39 | 40 |

TreeTag Screenshots

41 | 42 |
43 | 44 |
45 | 46 |

47 |

Typical split view - light theme

48 | 49 |
50 | 51 |

52 |

Typical split view - dark theme

53 | 54 |
55 | 56 |


57 |

Editing a node

58 | 59 |


60 | 61 |


62 |

On a narrow device - light theme

63 | 64 |


65 | 66 |


67 |

On a narrow device - dark theme

68 | 69 |

70 | 71 |
72 | 73 |
74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /docs/treetag_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/docs/treetag_sm.png -------------------------------------------------------------------------------- /docs/tt_edit_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/docs/tt_edit_light.png -------------------------------------------------------------------------------- /docs/tt_phone_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/docs/tt_phone_dark.png -------------------------------------------------------------------------------- /docs/tt_phone_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/docs/tt_phone_light.png -------------------------------------------------------------------------------- /docs/tt_split_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/docs/tt_split_dark.png -------------------------------------------------------------------------------- /docs/tt_split_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/docs/tt_split_light.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/ephemeral/ 22 | Flutter/app.flx 23 | Flutter/app.zip 24 | Flutter/flutter_assets/ 25 | Flutter/flutter_export_environment.sh 26 | ServiceDefinitions.json 27 | Runner/GeneratedPluginRegistrant.* 28 | 29 | # Exceptions to above rules. 30 | !default.mode1v3 31 | !default.mode2v3 32 | !default.pbxuser 33 | !default.perspectivev3 34 | -------------------------------------------------------------------------------- /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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | TreeTag 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | 26 | LSApplicationQueriesSchemes 27 | 28 | http 29 | https 30 | 31 | UILaunchStoryboardName 32 | LaunchScreen 33 | UIMainStoryboardFile 34 | Main 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/model/csv_export.dart: -------------------------------------------------------------------------------- 1 | // csv_export.dart, translations to export tree data to a CSV table. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'package:csv/csv.dart'; 7 | import 'structure.dart'; 8 | 9 | /// Main class for exports to CSV tables. 10 | class CsvExport { 11 | final Structure model; 12 | 13 | CsvExport(this.model); 14 | 15 | /// Check for fields with formats for raw vs. output string options. 16 | bool hasFieldFormats() { 17 | return model.fieldMap.values.any((field) => field.format.isNotEmpty); 18 | } 19 | 20 | /// Convert the structure to CSV and return the result. 21 | String csvString({bool useOutput = false}) { 22 | var rows = [ 23 | [for (var field in model.fieldMap.values) field.name] 24 | ]; 25 | for (var node in model.leafNodes) { 26 | final row = []; 27 | for (var field in model.fieldMap.values) { 28 | final text = useOutput 29 | ? field.allOutputText(node).join(' ') 30 | : node.data[field.name]?.join(' ') ?? ''; 31 | row.add(text); 32 | } 33 | rows.add(row); 34 | } 35 | return const ListToCsvConverter().convert(rows); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/model/csv_import.dart: -------------------------------------------------------------------------------- 1 | // csv_import.dart, translations to import leaf node data from CSV files. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'package:csv/csv.dart'; 7 | import 'package:csv/csv_settings_autodetection.dart'; 8 | import 'display_node.dart'; 9 | import 'fields.dart'; 10 | import 'parsed_line.dart'; 11 | import 'stored_node.dart'; 12 | import 'structure.dart'; 13 | 14 | /// Main class for CSV file imports. 15 | class CsvImport { 16 | final String strData; 17 | 18 | CsvImport(this.strData); 19 | 20 | /// Convert the CSV data in [strData] to leaf nodes in a TreeTag file. 21 | void convertCsv(Structure model) { 22 | // Detect the first EOL and quotation delimiters in the file. 23 | const detector = FirstOccurrenceSettingsDetector( 24 | eols: ['\r\n', '\n'], 25 | fieldDelimiters: [',', ';', '\t'], 26 | textDelimiters: ['"', "'"], 27 | ); 28 | const converter = CsvToListConverter( 29 | shouldParseNumbers: false, 30 | allowInvalid: false, 31 | csvSettingsDetector: detector, 32 | ); 33 | final rows = converter.convert(strData); 34 | for (var fieldName in rows.first) { 35 | // Replace all illegal characters with underscores. 36 | fieldName = fieldName.replaceAll(RegExp(r'\W'), '_'); 37 | if (fieldName.isEmpty) throw const FormatException(); 38 | var field = Field.createField(name: fieldName); 39 | model.fieldMap[fieldName] = field; 40 | model.outputLines.add(ParsedLine.fromSingleField(field)); 41 | } 42 | final fieldList = List.of(model.fieldMap.values); 43 | // Check for duplicate fields. 44 | if (Set.of(fieldList).length != fieldList.length) { 45 | throw const FormatException(); 46 | } 47 | model.titleLine = ParsedLine.fromSingleField(fieldList.first); 48 | rows.removeAt(0); 49 | for (var row in rows) { 50 | if (row.length > fieldList.length) throw const FormatException(); 51 | final data = >{}; 52 | for (var i = 0; i < row.length; i++) { 53 | data[fieldList[i].name] = [row[i]]; 54 | } 55 | model.leafNodes.add(LeafNode(data: data)); 56 | } 57 | final root = TitleNode(title: 'Root'); 58 | root.isOpen = true; 59 | model.rootNodes.add(root); 60 | root.childRuleNode = RuleNode(rule: 'All Nodes', storedParent: root); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/model/field_format_tools.dart: -------------------------------------------------------------------------------- 1 | // field_format_tools.dart, functions to work with field format strings. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | const numberFormatMap = { 7 | '0': 'Required digit', 8 | '#': 'Optional digit', 9 | '.': 'Decimal separator', 10 | ',': 'Group separator', 11 | 'E': 'Exponent separator', 12 | '+': 'Exponent sign', 13 | }; 14 | 15 | const dateFormatMap = { 16 | 'yyyy': 'Year (4 digits)', 17 | 'yy': 'Year (2 digits)', 18 | 'MMMM': 'Month (full text)', 19 | 'MMM': 'Month (abbrev. text)', 20 | 'MM': 'Month (2 digits)', 21 | 'M': 'Month (1 or 2 digits)', 22 | 'dd': 'Day (2 digits)', 23 | 'd': 'Day (1 or 2 digits)', 24 | 'EEEE': 'Day of week (full text)', 25 | 'EEE': 'Day of week (abbrev. text)', 26 | 'D': 'Day of year (1 to 3 digits)', 27 | 'G': 'Era (AD or BC)', 28 | 'QQQ': 'Quarter (Q1, etc.)', 29 | }; 30 | 31 | const timeFormatMap = { 32 | 'hh': 'Hour, 01-12 (2 digits)', 33 | 'h': 'Hour, 1-12 (1 or 2 digits)', 34 | 'HH': 'Hour, 00-23 (2 digits)', 35 | 'H': 'Hour, 0-23 (1 or 2 digits)', 36 | 'mm': 'Minute (2 digits)', 37 | 'm': 'Minute (1 or 2 digits)', 38 | 'ss': 'Second (2 digits)', 39 | 's': 'Second (1 or 2 digits)', 40 | 'S': 'Milliseconds (3 digits)', 41 | 'a': 'AM/PM marker', 42 | }; 43 | 44 | /// Contains either a format code or extra text from a format string. 45 | class FormatSegment { 46 | String? formatCode; 47 | String? extraText; 48 | 49 | FormatSegment({this.formatCode, this.extraText}); 50 | } 51 | 52 | /// Split a format, return segments with codes or extra text. 53 | List parseFieldFormat( 54 | String format, Map formatMap) { 55 | // Use null char to hande escaped (double) single quotes. 56 | format = format.replaceAll("''", "\x00"); 57 | final result = []; 58 | while (format.isNotEmpty) { 59 | if (format[0] == "'") { 60 | final endPos = format.indexOf("'", 1); 61 | if (endPos < 0) throw const FormatException('Expected closing quote'); 62 | result.add(FormatSegment( 63 | extraText: format.substring(1, endPos).replaceAll("\x00", "'"))); 64 | format = format.substring(endPos + 1); 65 | } else { 66 | final formatLen = format.length; 67 | for (var len = 4 <= format.length ? 4 : format.length; len > 0; len--) { 68 | if (formatMap.containsKey(format.substring(0, len))) { 69 | result.add(FormatSegment(formatCode: format.substring(0, len))); 70 | format = format.substring(len); 71 | break; 72 | } 73 | } 74 | if (formatLen == format.length) { 75 | final matchLen = RegExp(r"\W+").matchAsPrefix(format)?.end; 76 | if (matchLen != null && matchLen > 0) { 77 | result.add( 78 | FormatSegment( 79 | extraText: format.substring(0, matchLen).replaceAll("\x00", "'"), 80 | ), 81 | ); 82 | format = format.substring(matchLen); 83 | } else { 84 | throw const FormatException('Invalid format code'); 85 | } 86 | } 87 | } 88 | } 89 | return result; 90 | } 91 | 92 | /// Combine parsed format back into a single format string. 93 | /// 94 | /// If [condense], combine adjacent text segments. 95 | String combineFieldFormat(List parsedList, 96 | {bool condense = false}) { 97 | if (condense) { 98 | final condensedList = []; 99 | for (var segment in parsedList) { 100 | if (condensedList.isNotEmpty && 101 | condensedList.last.extraText != null && 102 | segment.extraText != null) { 103 | condensedList.last.extraText = 104 | condensedList.last.extraText! + segment.extraText!; 105 | } else { 106 | condensedList.add(segment); 107 | } 108 | } 109 | parsedList = condensedList; 110 | } 111 | final result = StringBuffer(); 112 | for (var segment in parsedList) { 113 | if (segment.formatCode != null) { 114 | if (result.toString().endsWith(segment.formatCode![0]) && 115 | segment.formatCode != '0' && 116 | segment.formatCode != '#') { 117 | // Add a space to adjacent codes with the same letter to avoid garbage. 118 | result.write(' '); 119 | } 120 | result.write(segment.formatCode); 121 | } else { 122 | // Duplicate the single quotes to escape them. 123 | final text = segment.extraText!.replaceAll("'", "''"); 124 | if (RegExp(r'\w').hasMatch(text)) { 125 | // Quotes required if alphabetic char are in text. 126 | result.write("'$text'"); 127 | } else { 128 | result.write(text); 129 | } 130 | } 131 | } 132 | return result.toString(); 133 | } 134 | 135 | /// Split a [ChoiceField] format into text segments. 136 | List splitChoiceFormat(String format) { 137 | format = format.replaceAll(r'\/', '\x00'); 138 | return [for (var s in format.split('/')) s.replaceAll('\x00', '/')]; 139 | } 140 | 141 | /// Combime [ChoiceField] text segments into a format string. 142 | String combineChoiceFormat(List choices) { 143 | choices = [for (var s in choices) s.replaceAll('/', '\x00')]; 144 | return choices.join('/').replaceAll('\x00', r'\/'); 145 | } 146 | -------------------------------------------------------------------------------- /lib/model/text_export.dart: -------------------------------------------------------------------------------- 1 | // text_export.dart, translations to export tree data to indented text. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'display_node.dart'; 7 | import 'structure.dart'; 8 | 9 | const emptyName = '[Empty Title]'; 10 | 11 | /// Main class for exports to indented text. 12 | class TextExport { 13 | final Structure model; 14 | 15 | TextExport(this.model); 16 | 17 | String textString({bool includeOutput = false}) { 18 | final resultLines = []; 19 | for (var root in model.rootNodes) { 20 | for (var leveledNode in leveledNodeGenerator(root, openOnly: false)) { 21 | final node = leveledNode.node; 22 | final lines = includeOutput && node is LeafNode 23 | ? node.outputs() + [''] 24 | : [node.title.isNotEmpty ? node.title : emptyName]; 25 | for (var line in lines) { 26 | for (var ln in line.trimRight().split('\n')) { 27 | resultLines.add('\t' * leveledNode.level + ln); 28 | } 29 | } 30 | } 31 | } 32 | return resultLines.join('\n'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/model/theme_model.dart: -------------------------------------------------------------------------------- 1 | // theme_model.dart, retrieves and updates light and dark color themes. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'package:flutter/material.dart'; 7 | import '../main.dart' show prefs; 8 | 9 | /// This class is used to retrieve and update theme data. 10 | class ThemeModel extends ChangeNotifier { 11 | ThemeModel(); 12 | 13 | /// Return the theme based on the current light/dark setting. 14 | ThemeData getTheme() { 15 | final isDark = prefs.getBool('darktheme') ?? false; 16 | return isDark ? darkTheme : lightTheme; 17 | } 18 | 19 | /// Update the themes throughout the app. 20 | void updateTheme() { 21 | notifyListeners(); 22 | } 23 | 24 | static final ThemeData lightTheme = ThemeData( 25 | colorScheme: ColorScheme.light( 26 | // Primary is used for highlighted text and other accents. 27 | primary: Colors.teal, 28 | onPrimary: Colors.black, 29 | // Secondary is used for the tree selection indicator. 30 | secondary: Colors.orange, 31 | // Tertiary is used for the drawer header. 32 | tertiary: Colors.blueGrey.shade900, 33 | onTertiary: Colors.teal.shade300, 34 | // Surface is the default view background. 35 | surface: Colors.grey.shade50, 36 | onSurface: Colors.black, 37 | ), 38 | appBarTheme: AppBarTheme( 39 | backgroundColor: Colors.teal.shade700, 40 | foregroundColor: Colors.white, 41 | ), 42 | chipTheme: ChipThemeData( 43 | backgroundColor: Colors.transparent, 44 | selectedColor: Colors.blueGrey.shade100, 45 | ), 46 | cardTheme: CardTheme( 47 | color: Colors.grey.shade100, 48 | ), 49 | listTileTheme: ListTileThemeData( 50 | tileColor: Colors.grey.shade100, 51 | textColor: Colors.black, 52 | selectedTileColor: Colors.grey.shade400, 53 | selectedColor: Colors.black, 54 | ), 55 | useMaterial3: true, 56 | ); 57 | 58 | static final ThemeData darkTheme = ThemeData( 59 | colorScheme: ColorScheme.dark( 60 | // Primary is used for highlighted text and other accents. 61 | primary: Colors.teal, 62 | onPrimary: Colors.white, 63 | // Secondary is used for the tree selection indicator. 64 | secondary: Colors.orange, 65 | // Tertiary is used for the drawer header. 66 | tertiary: Colors.teal.shade700, 67 | onTertiary: Colors.black, 68 | // Surface is the default view background. 69 | surface: Colors.grey.shade900, 70 | onSurface: Colors.white, 71 | ), 72 | appBarTheme: const AppBarTheme( 73 | backgroundColor: Colors.white12, 74 | foregroundColor: Colors.teal, 75 | ), 76 | chipTheme: ChipThemeData( 77 | backgroundColor: Colors.transparent, 78 | selectedColor: Colors.blueGrey.shade600, 79 | ), 80 | cardTheme: CardTheme( 81 | color: Colors.grey[850], 82 | ), 83 | listTileTheme: ListTileThemeData( 84 | tileColor: Colors.grey[850], 85 | textColor: Colors.white, 86 | selectedTileColor: Colors.grey.shade600, 87 | selectedColor: Colors.white, 88 | ), 89 | useMaterial3: true, 90 | ); 91 | } 92 | -------------------------------------------------------------------------------- /lib/model/treeline_export.dart: -------------------------------------------------------------------------------- 1 | // treeline_export.dart, translations to export a tree to a TreeLine file. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'dart:convert' show HtmlEscape, HtmlEscapeMode; 7 | import 'package:uuid/uuid.dart'; 8 | import 'display_node.dart'; 9 | import 'field_format_tools.dart'; 10 | import 'structure.dart'; 11 | 12 | /// Main class for exports to TreeLine files. 13 | class TreeLineExport { 14 | final Structure model; 15 | 16 | TreeLineExport(this.model); 17 | 18 | Map jsonData() { 19 | var headingFormat = { 20 | 'formatname': 'HEADING', 21 | 'fields': [ 22 | { 23 | 'fieldname': 'Title', 24 | 'fieldtype': 'Text', 25 | }, 26 | ], 27 | 'titleline': '{*Title*}', 28 | 'outputlines': ['{*Title*}'], 29 | }; 30 | final fieldData = >[]; 31 | for (var field in model.fieldMap.values) { 32 | final data = field.toJson(); 33 | if (field.fieldType == 'LongText' || field.allowMultiples) { 34 | // TreeLine can't handle multiple field values, so fall back to text. 35 | data['fieldtype'] = 'Text'; 36 | data.remove('format'); 37 | } else if (field.fieldType == 'Date') { 38 | data['format'] = _adjustDateFormat(field.format); 39 | } else if (field.fieldType == 'Time') { 40 | data['format'] = _adjustTimeFormat(field.format); 41 | } 42 | if (data['initvalue'] != null) { 43 | data['init'] = data['initvalue']; 44 | data.remove('initvalue'); 45 | } 46 | data.remove('separator'); 47 | data.remove('allow_multiples'); 48 | fieldData.add(data); 49 | } 50 | final leafFormat = { 51 | 'formatname': 'LEAF', 52 | 'fields': fieldData, 53 | 'titleline': model.titleLine.getUnparsedLine(), 54 | 'outputlines': [ 55 | for (var line in model.outputLines) line.getUnparsedLine() 56 | ], 57 | }; 58 | const uuid = Uuid(); 59 | final nodeIDs = {}; 60 | for (var root in model.rootNodes) { 61 | for (var node in allNodeGenerator(root)) { 62 | nodeIDs.putIfAbsent(node, () => uuid.v1().replaceAll('-', '')); 63 | } 64 | } 65 | final nodeData = >[]; 66 | const htmlEscape = HtmlEscape(HtmlEscapeMode.attribute); 67 | for (var entry in nodeIDs.entries) { 68 | final node = entry.key; 69 | final uid = entry.value; 70 | Map data; 71 | if (node is LeafNode) { 72 | data = {}; 73 | for (var field in model.fieldMap.values) { 74 | var value = node.data[field.name]?.join(', '); 75 | if (value != null) data[field.name] = htmlEscape.convert(value); 76 | } 77 | } else { 78 | data = {'Title': node.title}; 79 | } 80 | nodeData.add({ 81 | 'format': node is LeafNode ? 'LEAF' : 'HEADING', 82 | 'uid': uid, 83 | 'data': data, 84 | 'children': [for (var child in node.childNodes()) nodeIDs[child]], 85 | }); 86 | } 87 | final topNodes = [for (var node in model.rootNodes) nodeIDs[node]]; 88 | return { 89 | 'formats': [headingFormat, leafFormat], 90 | 'nodes': nodeData, 91 | 'properties': {'topnodes': topNodes}, 92 | }; 93 | } 94 | } 95 | 96 | /// Change the Date field formats to match the Python tags. 97 | String _adjustDateFormat(String origFormat) { 98 | const replacements = { 99 | 'yyyy': '%Y', 100 | 'yy': '%y', 101 | 'MMMM': '%B', 102 | 'MMM': '%b', 103 | 'MM': '%m', 104 | 'M': '%-m', 105 | 'dd': '%d', 106 | 'd': '%-d', 107 | 'EEEE': '%A', 108 | 'EEE': '%a', 109 | 'D': '%-j', 110 | }; 111 | final result = StringBuffer(); 112 | for (var segment in parseFieldFormat(origFormat, dateFormatMap)) { 113 | if (segment.formatCode != null) { 114 | final replace = replacements[segment.formatCode]; 115 | if (replace != null) result.write(replace); 116 | } else if (segment.extraText != null) { 117 | result.write(segment.extraText); 118 | } 119 | } 120 | return result.toString(); 121 | } 122 | 123 | /// Change the Time field formats to match the Python tags. 124 | String _adjustTimeFormat(String origFormat) { 125 | const replacements = { 126 | 'hh': '%I', 127 | 'h': '%-I', 128 | 'HH': '%H', 129 | 'H': '%-H', 130 | 'mm': '%M', 131 | 'm': '%-M', 132 | 'ss': '%S', 133 | 's': '%-S', 134 | 'S': '%f', 135 | 'a': '%p', 136 | }; 137 | final result = StringBuffer(); 138 | for (var segment in parseFieldFormat(origFormat, timeFormatMap)) { 139 | if (segment.formatCode != null) { 140 | final replace = replacements[segment.formatCode]; 141 | if (replace != null) result.write(replace); 142 | } else if (segment.extraText != null) { 143 | result.write(segment.extraText); 144 | } 145 | } 146 | return result.toString(); 147 | } 148 | -------------------------------------------------------------------------------- /lib/model/treeline_import.dart: -------------------------------------------------------------------------------- 1 | // treeline_import.dart, translations to import a node type from TreeLine files. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'package:html_unescape/html_unescape_small.dart'; 7 | import 'display_node.dart'; 8 | import 'field_format_tools.dart'; 9 | import 'fields.dart'; 10 | import 'parsed_line.dart'; 11 | import 'stored_node.dart'; 12 | import 'structure.dart'; 13 | 14 | /// Main class for TreeLine file imports. 15 | class TreeLineImport { 16 | final Map jsonData; 17 | 18 | TreeLineImport(this.jsonData); 19 | 20 | /// Return a list of node format types that could be converted. 21 | List formatNames() { 22 | return [for (var format in jsonData['formats']) format['formatname'] ?? '']; 23 | } 24 | 25 | /// Convert the nodes matching [typeName] in the [jsonData] to a TreeTag file. 26 | void convertNodeType(String typeName, Structure model) { 27 | final boolFieldNames = {}; 28 | final textFieldNames = {}; 29 | final formatData = jsonData['formats'] 30 | .firstWhere((item) => item['formatname'] == typeName); 31 | for (var fieldData in formatData['fields'] ?? []) { 32 | if (fieldData['fieldtype'] == 'Boolean') { 33 | // Convert a Boolean field to a Choice field. 34 | fieldData['fieldtype'] = 'Choice'; 35 | boolFieldNames.add(fieldData['fieldname']); 36 | } else if (fieldData['fieldtype'] == 'Text' || 37 | fieldData['fieldtype'] == 'HtmlText') { 38 | // Store text field names for later tag conversions. 39 | textFieldNames.add(fieldData['fieldname']); 40 | } 41 | final field = Field.fromJson(fieldData); 42 | model.fieldMap[field.name] = field; 43 | if (field.fieldType == 'Date' || field.fieldType == 'Time') { 44 | field.format = _adjustDateTimeFormat(field.format); 45 | } 46 | } 47 | model.titleLine = ParsedLine(formatData['titleline'] ?? '', model.fieldMap); 48 | for (var lineString in formatData['outputlines'] ?? []) { 49 | model.outputLines.add(ParsedLine(lineString ?? '', model.fieldMap)); 50 | } 51 | final lineEndExp = RegExp(r'', multiLine: true); 52 | final htmlTagExp = RegExp(r'<[^>]*>', multiLine: true); 53 | final unescape = HtmlUnescape(); 54 | for (var nodeInfo in jsonData['nodes']) { 55 | if (nodeInfo['format'] == typeName && nodeInfo['data'] != null) { 56 | final data = >{}; 57 | for (var key in nodeInfo['data'].keys) { 58 | data[key] = [nodeInfo['data'][key]]; 59 | } 60 | final leafNode = LeafNode(data: data); 61 | model.leafNodes.add(leafNode); 62 | for (var field in model.fieldMap.values) { 63 | if (leafNode.data[field.name] != null) { 64 | if (field is AutoChoiceField) { 65 | field.options.add(leafNode.data[field.name]![0]); 66 | } else if (boolFieldNames.contains(field.name)) { 67 | if ({'true', 'yes'} 68 | .contains(leafNode.data[field.name]![0].toLowerCase())) { 69 | leafNode.data[field.name] = [ 70 | splitChoiceFormat(field.format)[0] 71 | ]; 72 | } else { 73 | leafNode.data[field.name] = [ 74 | splitChoiceFormat(field.format)[1] 75 | ]; 76 | } 77 | } else if (textFieldNames.contains(field.name)) { 78 | var text = leafNode.data[field.name]![0]; 79 | text = text.replaceAll(lineEndExp, '\n'); 80 | text = text.replaceAll(htmlTagExp, ''); 81 | text = unescape.convert(text); 82 | leafNode.data[field.name] = [text]; 83 | } else if (!field.isStoredTextValid(leafNode)) { 84 | leafNode.data.remove(field.name); 85 | } 86 | } 87 | } 88 | } 89 | } 90 | final root = TitleNode(title: 'Root'); 91 | root.isOpen = true; 92 | model.rootNodes.add(root); 93 | root.childRuleNode = RuleNode( 94 | rule: 'All Nodes', 95 | storedParent: root, 96 | ); 97 | } 98 | } 99 | 100 | /// Change the Date and Time field formats to match the Dart tags. 101 | String _adjustDateTimeFormat(String origFormat) { 102 | const replacements = { 103 | '%-d': 'd', 104 | '%d': 'dd', 105 | '%a': 'EEE', 106 | '%A': 'EEEE', 107 | '%-m': 'M', 108 | '%m': 'MM', 109 | '%b': 'MMM', 110 | '%B': 'MMMM', 111 | '%y': 'yy', 112 | '%Y': 'yyyy', 113 | '%-j': 'D', 114 | '%-H': 'H', 115 | '%H': 'HH', 116 | '%-I': 'h', 117 | '%I': 'hh', 118 | '%-M': 'm', 119 | '%M': 'mm', 120 | '%-S': 's', 121 | '%S': 'ss', 122 | '%f': 'S', 123 | '%p': 'a', 124 | '%%': "'%'", 125 | }; 126 | final regExp = RegExp(r'%-?[daAmbByYjHIMSfp%]'); 127 | var newFormat = origFormat.replaceAllMapped( 128 | regExp, 129 | (Match m) => replacements[m.group(0)] != null 130 | ? "'${replacements[m.group(0)]}'" 131 | : m.group(0)!); 132 | newFormat = "'$newFormat'"; 133 | newFormat = newFormat.replaceAll("''", ""); 134 | return newFormat; 135 | } 136 | -------------------------------------------------------------------------------- /lib/views/common_widgets.dart: -------------------------------------------------------------------------------- 1 | // common_widgets.dart, miscellaneous custom widgets. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_markdown_selectionarea/flutter_markdown.dart' 8 | as renderer; 9 | import 'package:markdown/markdown.dart' as markdown; 10 | import 'package:path/path.dart' as p; 11 | import 'package:url_launcher/url_launcher.dart'; 12 | import '../main.dart' show prefs; 13 | 14 | /// A widget that displays Markdown and launches URLs. 15 | class MarkdownWithLinks extends StatelessWidget { 16 | final String data; 17 | final ThemeData? theme; 18 | final bool doShowMatches; 19 | 20 | const MarkdownWithLinks( 21 | {super.key, required this.data, this.theme, this.doShowMatches = false}); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | renderer.MarkdownStyleSheet? style; 26 | if (theme != null) style = renderer.MarkdownStyleSheet.fromTheme(theme!); 27 | return renderer.MarkdownBody( 28 | data: data, 29 | // Tried internal links to headers, but not supported. 30 | //extensionSet: md.ExtensionSet.gitHubWeb, 31 | styleSheet: style, 32 | builders: { 33 | if (doShowMatches) 'match': ShowMatchBuilder(), 34 | }, 35 | inlineSyntaxes: [ 36 | if (doShowMatches) ShowMatchSyntax(), 37 | ], 38 | onTapLink: (String text, String? href, String title) async { 39 | if (href != null && !href.startsWith('#')) { 40 | if (href.startsWith('file:')) { 41 | var path = href.substring(5); 42 | if (p.isRelative(path)) { 43 | path = p.normalize(p.join(prefs.getString('workdir')!, path)); 44 | href = 'file:$path'; 45 | } 46 | } 47 | launchUrl( 48 | Uri.parse(href), 49 | mode: LaunchMode.externalApplication, 50 | ); 51 | } 52 | }, 53 | ); 54 | } 55 | } 56 | 57 | class ShowMatchSyntax extends markdown.InlineSyntax { 58 | static const matchPrefix = '\u001e'; 59 | static const matchSuffix = '\u001f'; 60 | 61 | ShowMatchSyntax() : super('$matchPrefix(.*?)$matchSuffix'); 62 | 63 | @override 64 | bool onMatch(markdown.InlineParser parser, Match match) { 65 | markdown.Element matchTag = markdown.Element.text('match', match[1] ?? ''); 66 | parser.addNode(matchTag); 67 | return true; 68 | } 69 | } 70 | 71 | class ShowMatchBuilder extends renderer.MarkdownElementBuilder { 72 | @override 73 | Widget? visitElementAfterWithContext( 74 | BuildContext context, 75 | markdown.Element element, 76 | TextStyle? preferredStyle, 77 | TextStyle? parentStyle, 78 | ) { 79 | return SelectableText.rich( 80 | TextSpan( 81 | text: element.textContent, 82 | style: (preferredStyle ?? parentStyle ?? const TextStyle()).copyWith( 83 | color: Colors.red, 84 | ), 85 | ), 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /lib/views/config/config_view.dart: -------------------------------------------------------------------------------- 1 | // config_view.dart, a view to edit file configurations. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'package:flutter/material.dart'; 7 | import 'field_config.dart'; 8 | import 'option_config.dart'; 9 | import 'output_config.dart'; 10 | import 'tree_config.dart'; 11 | 12 | /// The base config view. 13 | /// 14 | /// Holds three views in tabs: [FieldConfig], [TreeConfig], [OutputConfig], 15 | /// [OptionConfig]. 16 | /// Called from a menu in the [TreeView]. 17 | class ConfigView extends StatefulWidget { 18 | const ConfigView({super.key}); 19 | 20 | @override 21 | State createState() => _ConfigViewState(); 22 | } 23 | 24 | class _ConfigViewState extends State { 25 | int _selectedIndex = 0; 26 | 27 | static List pages = [ 28 | const FieldConfig(), 29 | const TreeConfig(), 30 | const OutputConfig(), 31 | const OptionConfig(), 32 | ]; 33 | 34 | void _onItemTapped(int index) { 35 | setState(() { 36 | _selectedIndex = index; 37 | }); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | appBar: AppBar( 44 | title: const Text('File Config'), 45 | ), 46 | body: pages[_selectedIndex], 47 | bottomNavigationBar: BottomNavigationBar( 48 | type: BottomNavigationBarType.fixed, 49 | currentIndex: _selectedIndex, 50 | onTap: _onItemTapped, 51 | items: const [ 52 | BottomNavigationBarItem( 53 | label: 'Fields', 54 | icon: Icon(Icons.settings), 55 | ), 56 | BottomNavigationBarItem( 57 | icon: Icon(Icons.settings), 58 | label: 'Tree', 59 | ), 60 | BottomNavigationBarItem( 61 | icon: Icon(Icons.settings), 62 | label: 'Output', 63 | ), 64 | BottomNavigationBarItem( 65 | icon: Icon(Icons.settings), 66 | label: 'Options', 67 | ), 68 | ], 69 | ), 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/views/config/line_field_edit.dart: -------------------------------------------------------------------------------- 1 | // line_field_edit.dart, a view to customize a field's details in a line. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'package:flutter/material.dart'; 7 | import '../../model/fields.dart'; 8 | import 'field_format_edit.dart'; 9 | 10 | // The field edit view with a form for only format, prefix and suffix. 11 | // 12 | // Called from [LineEdit] views for fields in rules and output lines. 13 | class LineFieldEdit extends StatefulWidget { 14 | final Field field; 15 | 16 | // Original values stored to determine whether there are changes. 17 | late final String origFormat; 18 | late final String origPrefix; 19 | late final String origSuffix; 20 | 21 | LineFieldEdit({super.key, required this.field}) { 22 | origFormat = field.format; 23 | origPrefix = field.prefix; 24 | origSuffix = field.suffix; 25 | } 26 | 27 | @override 28 | State createState() => _LineFieldEditState(); 29 | } 30 | 31 | class _LineFieldEditState extends State { 32 | final _formKey = GlobalKey(); 33 | 34 | // Keys are needed to allow a reset back to the alt format's parent field. 35 | final _fieldFormatKey = GlobalKey>(); 36 | final _fieldPrefixKey = GlobalKey>(); 37 | final _fieldSuffixKey = GlobalKey>(); 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | appBar: AppBar( 43 | title: Text('${widget.field.name} Line Field'), 44 | leading: IconButton( 45 | icon: const Icon(Icons.check_circle), 46 | tooltip: 'Save current settings and close', 47 | onPressed: () { 48 | _formKey.currentState!.save(); 49 | final isChanged = widget.origPrefix != widget.field.prefix || 50 | widget.origSuffix != widget.field.suffix || 51 | widget.origFormat != widget.field.format; 52 | Navigator.pop(context, isChanged); 53 | }, 54 | ), 55 | actions: [ 56 | // Reset back to the alt format's parent field. 57 | IconButton( 58 | icon: const Icon(Icons.restore), 59 | tooltip: 'Restore settings', 60 | onPressed: () { 61 | final parentField = widget.field.altFormatParent; 62 | if (parentField != null) { 63 | if (parentField.format.isNotEmpty) { 64 | _fieldFormatKey.currentState!.didChange(parentField.format); 65 | } 66 | _fieldPrefixKey.currentState!.didChange(parentField.prefix); 67 | _fieldSuffixKey.currentState!.didChange(parentField.suffix); 68 | } else { 69 | _formKey.currentState!.reset(); 70 | } 71 | }, 72 | ), 73 | IconButton( 74 | icon: const Icon(Icons.close), 75 | tooltip: 'Revert all changes', 76 | onPressed: () { 77 | Navigator.pop(context, false); 78 | }, 79 | ), 80 | ], 81 | ), 82 | body: Form( 83 | key: _formKey, 84 | canPop: false, 85 | onPopInvokedWithResult: (bool didPop, Object? result) { 86 | if (!didPop && _formKey.currentState!.validate()) { 87 | // Pop manually (bypass canPop) if validated. 88 | _formKey.currentState!.save(); 89 | final isChanged = widget.origPrefix != widget.field.prefix || 90 | widget.origSuffix != widget.field.suffix || 91 | widget.origFormat != widget.field.format; 92 | Navigator.pop(context, isChanged); 93 | } 94 | }, 95 | child: Padding( 96 | padding: const EdgeInsets.all(10.0), 97 | child: ListView( 98 | children: [ 99 | // Check for a field format; exclude Choice since the data 100 | // cannot change. 101 | if (widget.field.format.isNotEmpty && 102 | widget.field is! ChoiceField) 103 | // Defined in field_format_edit.dart. 104 | FieldFormatDisplay( 105 | key: _fieldFormatKey, 106 | fieldType: widget.field.fieldType, 107 | initialFormat: widget.field.format, 108 | onSaved: (String? value) { 109 | if (value != null) widget.field.format = value; 110 | }, 111 | ), 112 | TextFormField( 113 | key: _fieldPrefixKey, 114 | decoration: const InputDecoration(labelText: 'Prefix'), 115 | initialValue: widget.field.prefix, 116 | onSaved: (String? value) { 117 | if (value != null) widget.field.prefix = value; 118 | }, 119 | ), 120 | TextFormField( 121 | key: _fieldSuffixKey, 122 | decoration: const InputDecoration(labelText: 'Suffix'), 123 | initialValue: widget.field.suffix, 124 | onSaved: (String? value) { 125 | if (value != null) widget.field.suffix = value; 126 | }, 127 | ), 128 | ], 129 | ), 130 | ), 131 | ), 132 | ); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /lib/views/config/option_config.dart: -------------------------------------------------------------------------------- 1 | // option_config.dart, a view to edit extra config options for this file. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'dart:io'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:provider/provider.dart'; 9 | import '../common_dialogs.dart' as common_dialogs; 10 | import '../../model/structure.dart'; 11 | 12 | /// The extra config option widget. 13 | /// 14 | /// Lists options that don't belong elsewhere. 15 | class OptionConfig extends StatefulWidget { 16 | const OptionConfig({super.key}); 17 | 18 | @override 19 | State createState() => _OptionConfigState(); 20 | } 21 | 22 | class _OptionConfigState extends State { 23 | @override 24 | Widget build(BuildContext context) { 25 | final model = Provider.of(context, listen: false); 26 | return Padding( 27 | padding: const EdgeInsets.all(10.0), 28 | child: Center( 29 | child: SizedBox( 30 | width: 450.0, 31 | child: ListView( 32 | children: [ 33 | SwitchListTile( 34 | title: const Text('Enable Markdown text formatting'), 35 | value: model.useMarkdownOutput, 36 | onChanged: (bool value) { 37 | model.setMarkdownOutput(value); 38 | setState(() {}); 39 | }, 40 | ), 41 | // File liks are only supported on the desktop. 42 | if (!Platform.isAndroid && !Platform.isIOS) 43 | SwitchListTile( 44 | title: const Text('Use relative paths for file links'), 45 | value: model.useRelativeLinks, 46 | onChanged: (bool value) async { 47 | model.setUseRelativeLink(value); 48 | if (!model.useMarkdownOutput) { 49 | await common_dialogs.okDialog( 50 | context: context, 51 | title: 'Markdown Required', 52 | label: 'Markdwon formatting must be enabled to use ' 53 | 'file links', 54 | ); 55 | } 56 | setState(() {}); 57 | }, 58 | ), 59 | ], 60 | ), 61 | ), 62 | ), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lib/views/detail_view.dart: -------------------------------------------------------------------------------- 1 | // detail_view.dart, a view showing node and child output. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'dart:io'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:provider/provider.dart'; 9 | import 'common_widgets.dart'; 10 | import '../main.dart' show prefs; 11 | import '../model/display_node.dart'; 12 | import '../model/structure.dart'; 13 | 14 | const emptyTitleName = '[Empty Title]'; 15 | 16 | /// A detail view that shows node and child output. 17 | /// 18 | /// This view is opened after a long press on a [TreeView], with content 19 | /// based on the last entry in [detailViewNodes] in the model. 20 | /// Previous entries are the history of this view. 21 | /// Shows details of a single node if it is a [LeafNode]. 22 | /// Shows a node and children if it is a [TitleNode] or a [GroupNode]. 23 | class DetailView extends StatelessWidget { 24 | const DetailView({super.key}); 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | final innerMargin = (prefs.getBool('linespacing') ?? 29 | Platform.isLinux || Platform.isWindows || Platform.isMacOS) 30 | ? const EdgeInsets.symmetric(vertical: 4, horizontal: 10) 31 | : const EdgeInsets.all(10.0); 32 | final outerMargin = (prefs.getBool('linespacing') ?? 33 | Platform.isLinux || Platform.isWindows || Platform.isMacOS) 34 | ? const EdgeInsets.symmetric(vertical: 3, horizontal: 5) 35 | : const EdgeInsets.all(5.0); 36 | return Consumer( 37 | builder: (context, model, child) { 38 | final outWidget = model.useMarkdownOutput 39 | ? ((String s) { 40 | return MarkdownWithLinks(data: s); 41 | }) 42 | : ((String s) { 43 | return Text(s); 44 | }); 45 | final lineEnd = model.useMarkdownOutput ? '\n\n' : '\n'; 46 | final rootNode = model.currentDetailViewNode(); 47 | final cards = []; 48 | if (rootNode != null) { 49 | if (model.obsoleteNodes.contains(rootNode)) { 50 | cards.add( 51 | // Show a deleted or removed notation if the node is already gone. 52 | Card( 53 | child: Container( 54 | margin: innerMargin, 55 | child: Text( 56 | rootNode is LeafNode ? 'Node Deleted' : 'Group Removed', 57 | style: const TextStyle(color: Colors.red)), 58 | ), 59 | ), 60 | ); 61 | } else if (rootNode is LeafNode) { 62 | cards.add( 63 | Card( 64 | child: SelectionArea( 65 | // A key is required to clear selection at rebuild. 66 | key: UniqueKey(), 67 | child: Container( 68 | margin: innerMargin, 69 | child: outWidget(rootNode.outputs().join(lineEnd)), 70 | ), 71 | ), 72 | ), 73 | ); 74 | } else { 75 | // Show node and children for [GroupNode] or [TitleNode]. 76 | for (var childNode in rootNode.childNodes()) { 77 | cards.add( 78 | Card( 79 | margin: outerMargin, 80 | child: InkWell( 81 | // Add tapped child to view history and update this view. 82 | onTap: () { 83 | model.addDetailViewRecord(childNode, parent: rootNode); 84 | }, 85 | child: Container( 86 | margin: innerMargin, 87 | child: childNode is LeafNode 88 | ? outWidget(childNode.outputs().join(lineEnd)) 89 | : outWidget(childNode.title.isNotEmpty 90 | ? childNode.title 91 | : emptyTitleName), 92 | ), 93 | ), 94 | ), 95 | ); 96 | } 97 | } 98 | } 99 | return ListView( 100 | controller: ScrollController(), 101 | children: cards, 102 | ); 103 | }, 104 | ); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /lib/views/help_view.dart: -------------------------------------------------------------------------------- 1 | // help_view.dart, shows a Markdown output of the README file. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'package:flutter/material.dart'; 7 | import 'package:url_launcher/url_launcher.dart'; 8 | import 'package:flutter/services.dart' show rootBundle; 9 | import 'package:flutter_markdown_selectionarea/flutter_markdown.dart'; 10 | 11 | const pathPrefix = 'assets/help/'; 12 | 13 | /// Provides a view with Markdown output of the README file. 14 | class HelpView extends StatefulWidget { 15 | const HelpView({super.key}); 16 | 17 | @override 18 | State createState() => _HelpViewState(); 19 | } 20 | 21 | class _HelpViewState extends State { 22 | static final _pageHistory = ['contents.md']; 23 | static final _pageList = []; 24 | String _currentContent = ''; 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | _loadContent(); 30 | } 31 | 32 | void _loadContent() async { 33 | _currentContent = 34 | await rootBundle.loadString(pathPrefix + _pageHistory.last); 35 | // Initialize _pageList once with link addresses from contents page. 36 | if (_pageList.isEmpty) { 37 | for (var match in RegExp(r'\[.+\]\((.+)\)').allMatches(_currentContent)) { 38 | _pageList.add(match.group(1)!); 39 | } 40 | } 41 | setState(() {}); 42 | } 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | final pagePos = _pageList.indexOf(_pageHistory.last); 47 | // Size placeholder for hidden icons, includes 8/side padding. 48 | final iconSize = (IconTheme.of(context).size ?? 24.0) + 16.0; 49 | return PopScope( 50 | // Avoid pop due to back button until page history is empty. 51 | canPop: _pageHistory.length <= 1, 52 | onPopInvokedWithResult: (bool didPop, Object? result) async { 53 | if (!didPop) { 54 | _pageHistory.removeLast(); 55 | _loadContent(); 56 | } 57 | }, 58 | child: Scaffold( 59 | appBar: AppBar( 60 | title: const Text('Help - TreeTag'), 61 | actions: [ 62 | if (pagePos > 0) 63 | IconButton( 64 | icon: const Icon(Icons.arrow_back_ios), 65 | tooltip: 'Previous', 66 | onPressed: () { 67 | _pageHistory.add(_pageList[pagePos - 1]); 68 | _loadContent(); 69 | }, 70 | ), 71 | if (pagePos >= 0 && pagePos < _pageList.length - 1) ...[ 72 | IconButton( 73 | icon: const Icon(Icons.arrow_forward_ios), 74 | tooltip: 'Next', 75 | onPressed: () { 76 | _pageHistory.add(_pageList[pagePos + 1]); 77 | _loadContent(); 78 | }, 79 | ), 80 | ] else ...[ 81 | SizedBox( 82 | width: iconSize, 83 | height: 1.0, 84 | ), 85 | ], 86 | if (_pageHistory.last != _pageHistory.first) ...[ 87 | IconButton( 88 | icon: const Icon(Icons.home_outlined), 89 | tooltip: 'Home', 90 | onPressed: () { 91 | _pageHistory.add(_pageHistory.first); 92 | _loadContent(); 93 | }, 94 | ), 95 | ] else ...[ 96 | SizedBox( 97 | width: iconSize, 98 | height: 1.0, 99 | ), 100 | ], 101 | IconButton( 102 | icon: const Icon(Icons.close), 103 | tooltip: 'Close', 104 | onPressed: () { 105 | Navigator.pop(context); 106 | }, 107 | ), 108 | ], 109 | ), 110 | body: SelectionArea( 111 | child: Markdown( 112 | data: _currentContent, 113 | onTapLink: (String text, String? href, String title) async { 114 | if (href != null) { 115 | if (href.contains(':')) { 116 | launchUrl( 117 | Uri.parse(href), 118 | mode: LaunchMode.externalApplication, 119 | ); 120 | } else if (href.endsWith('.md')) { 121 | _pageHistory.add(href); 122 | _loadContent(); 123 | } 124 | } 125 | }, 126 | ), 127 | ), 128 | ), 129 | ); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /lib/views/sample_control.dart: -------------------------------------------------------------------------------- 1 | // sample_control.dart, a view listing and opening sample files. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'dart:convert' show jsonDecode; 7 | import 'package:flutter/material.dart'; 8 | import 'package:path/path.dart' as p; 9 | import 'package:provider/provider.dart'; 10 | import 'package:flutter/services.dart'; 11 | import 'common_dialogs.dart' as common_dialogs; 12 | import '../model/io_file.dart'; 13 | import '../model/structure.dart'; 14 | 15 | /// Provides a sample listview that can open sample files. 16 | class SampleControl extends StatefulWidget { 17 | const SampleControl({super.key}); 18 | 19 | @override 20 | State createState() => _SampleControlState(); 21 | } 22 | 23 | class _SampleControlState extends State { 24 | var _samplePaths = []; 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | _loadSampleList(); 30 | } 31 | 32 | /// Load the sample file list from the resources. 33 | void _loadSampleList() async { 34 | final manifest = await AssetManifest.loadFromAssetBundle(rootBundle); 35 | _samplePaths = List.of( 36 | manifest.listAssets().where((path) => path.startsWith('assets/samples')), 37 | ); 38 | setState(() {}); 39 | } 40 | 41 | /// Open a sample file after a user tap. 42 | void _openSample(String path) async { 43 | final model = Provider.of(context, listen: false); 44 | 45 | final newFile = IOFile.currentType(p.basename(path)); 46 | if (await newFile.exists) { 47 | if (!mounted) return; 48 | // Handle a sample already in the working directory. 49 | final ans = await common_dialogs.okCancelDialog( 50 | context: context, 51 | title: 'Working File Exists', 52 | label: 'Working file ${newFile.filename} already exists.\n\n' 53 | 'Open it from the working directory?', 54 | ); 55 | if (ans == null || !ans) return; 56 | try { 57 | await model.openFile(newFile); 58 | } on FormatException { 59 | if (!mounted) return; 60 | await common_dialogs.okDialog( 61 | context: context, 62 | title: 'Error', 63 | label: 'Could not open file: ' 64 | '${newFile.nameNoExtension}', 65 | isDissmissable: false, 66 | ); 67 | return; 68 | } 69 | } else { 70 | final data = await rootBundle.loadString(path); 71 | model.openFromData(jsonDecode(data)); 72 | model.fileObject = newFile; 73 | } 74 | if (!mounted) return; 75 | Navigator.pushNamed(context, '/frameView', 76 | arguments: newFile.nameNoExtension) 77 | .then((value) async { 78 | if (!mounted) return; 79 | Navigator.pop(context); 80 | }); 81 | } 82 | 83 | @override 84 | Widget build(BuildContext context) { 85 | return Scaffold( 86 | appBar: AppBar( 87 | title: const Text('Sample Files'), 88 | ), 89 | body: Padding( 90 | padding: const EdgeInsets.all(4), 91 | child: Center( 92 | child: SizedBox( 93 | width: 350.0, 94 | child: ListView( 95 | children: [ 96 | for (var path in _samplePaths) 97 | Card( 98 | child: InkWell( 99 | onLongPress: () { 100 | _openSample(path); 101 | }, 102 | onDoubleTap: () { 103 | _openSample(path); 104 | }, 105 | child: ListTile( 106 | title: Text(p.basenameWithoutExtension(path)), 107 | ), 108 | ), 109 | ), 110 | ], 111 | ), 112 | ), 113 | ), 114 | ), 115 | ); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /lib/views/tree_view.dart: -------------------------------------------------------------------------------- 1 | // tree_view.dart, the main view showing indented tree data. 2 | // TreeTag, an information storage program with an automatic tree structure. 3 | // Copyright (c) 2024, Douglas W. Bell. 4 | // Free software, GPL v2 or later. 5 | 6 | import 'dart:io'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:provider/provider.dart'; 9 | import 'common_widgets.dart'; 10 | import '../main.dart' show prefs; 11 | import '../model/display_node.dart'; 12 | import '../model/structure.dart'; 13 | 14 | const emptyName = '[Empty Title]'; 15 | 16 | /// The main indented tree view. 17 | /// 18 | /// A tap opens or closes tree items. 19 | /// A long press opens a [DetailView] for an item and/or its children. 20 | /// Menu items open config views, undo views and do file operations. 21 | class TreeView extends StatelessWidget { 22 | late final String headerName; 23 | 24 | TreeView({super.key, required String fileRootName}) { 25 | headerName = 'TreeTag - $fileRootName'; 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Consumer( 31 | builder: (context, model, child) { 32 | final items = []; 33 | for (var root in model.rootNodes) { 34 | for (var leveledNode in leveledNodeGenerator(root)) { 35 | items.add(_row(leveledNode, context)); 36 | } 37 | } 38 | return ListView( 39 | controller: ScrollController(), 40 | children: items, 41 | ); 42 | }, 43 | ); 44 | } 45 | 46 | /// A single widget for a tree node. 47 | Widget _row(LeveledNode leveledNode, BuildContext context) { 48 | final spacing = (prefs.getBool('linespacing') ?? 49 | Platform.isLinux || Platform.isWindows || Platform.isMacOS) 50 | ? 2.0 51 | : 8.0; 52 | final model = Provider.of(context, listen: false); 53 | final node = leveledNode.node; 54 | String nodeText; 55 | if (node is LeafNode && node.isExpanded(leveledNode.parent!)) { 56 | nodeText = node.outputs().join(model.useMarkdownOutput ? '\n\n' : '\n'); 57 | } else { 58 | nodeText = node.title.isNotEmpty ? node.title : emptyName; 59 | } 60 | final isNodeSelected = 61 | model.hasWideDisplay && node == model.currentDetailViewNode(); 62 | return Padding( 63 | padding: EdgeInsets.fromLTRB( 64 | 25.0 * leveledNode.level + 4.0, spacing, 4.0, spacing), 65 | child: GestureDetector( 66 | onTap: () { 67 | if (node.hasChildren) { 68 | model.toggleNodeOpen(node); 69 | } else if (node is LeafNode) { 70 | model.toggleNodeExpanded(node, leveledNode.parent!); 71 | } 72 | }, 73 | onLongPress: () { 74 | model.addDetailViewRecord( 75 | node, 76 | parent: leveledNode.parent, 77 | doClearFirst: true, 78 | ); 79 | }, 80 | child: Row( 81 | crossAxisAlignment: node.hasChildren 82 | ? CrossAxisAlignment.center 83 | : CrossAxisAlignment.baseline, 84 | textBaseline: TextBaseline.alphabetic, 85 | children: [ 86 | node.hasChildren 87 | ? node.isOpen 88 | ? isNodeSelected 89 | ? Icon( 90 | Icons.arrow_drop_down, 91 | size: 24.0, 92 | color: Theme.of(context).colorScheme.secondary, 93 | ) 94 | : const Icon(Icons.arrow_drop_down, size: 24.0) 95 | : isNodeSelected 96 | ? Icon( 97 | Icons.arrow_right, 98 | size: 24.0, 99 | color: Theme.of(context).colorScheme.secondary, 100 | ) 101 | : const Icon(Icons.arrow_right, size: 24.0) 102 | : Padding( 103 | padding: const EdgeInsets.only(left: 8.0, right: 8.0), 104 | child: isNodeSelected 105 | ? Icon( 106 | Icons.circle, 107 | size: 8.0, 108 | color: Theme.of(context).colorScheme.secondary, 109 | ) 110 | : const Icon(Icons.circle, size: 8.0), 111 | ), 112 | Expanded( 113 | child: model.useMarkdownOutput 114 | ? MarkdownWithLinks( 115 | data: nodeText, 116 | ) 117 | : Text( 118 | nodeText, 119 | softWrap: true, 120 | ), 121 | ), 122 | ], 123 | ), 124 | ), 125 | ); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void fl_register_plugins(FlPluginRegistry* registry) { 14 | g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar = 15 | fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin"); 16 | screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar); 17 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 18 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 19 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 20 | g_autoptr(FlPluginRegistrar) window_manager_registrar = 21 | fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin"); 22 | window_manager_plugin_register_with_registrar(window_manager_registrar); 23 | } 24 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | screen_retriever_linux 7 | url_launcher_linux 8 | window_manager 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "treetag"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "treetag"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import file_picker 9 | import package_info_plus 10 | import path_provider_foundation 11 | import screen_retriever_macos 12 | import shared_preferences_foundation 13 | import url_launcher_macos 14 | import window_manager 15 | 16 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 17 | FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) 18 | FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) 19 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 20 | ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) 21 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 22 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 23 | WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) 24 | } 25 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /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 = treetag 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = org.bellz.treetag 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 org.bellz. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/1.txt: -------------------------------------------------------------------------------- 1 | April 19, 2022 - Release 0.0.1 (beta) 2 | 3 | New Features: 4 | - Initial release. 5 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/10.txt: -------------------------------------------------------------------------------- 1 | May 26, 2023 - Release 0.6.0 (stable) 2 | 3 | New Features: 4 | - An option was added to select between light and dark visual themes. 5 | - Added a view scale setting for high-dpi displays. 6 | - Added a command to export the TreeTag tree to an indented text file. 7 | - Before saving a file, TreeTag checks for external modifications from 8 | other sessions or over a network, giving options to load or overwrite 9 | the file. 10 | 11 | Updates & Bug Fixes: 12 | - See the CHANGELOG.md file for the full list of changes. 13 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/12.txt: -------------------------------------------------------------------------------- 1 | August 27, 2023 - Release 0.7.0 (stable) 2 | 3 | New Features: 4 | - Created a new script for Linux installation. It uses the native 5 | packaging system to install dependencies, builds TreeTag and 6 | installs it. 7 | - On desktop systems, a new interface can easily add local file links 8 | in Markdown text fields. Clicking on a link opens the default 9 | application for that file type. 10 | 11 | Updates & Bug Fixes: 12 | - See the CHANGELOG.md file for the full list of changes. 13 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/13.txt: -------------------------------------------------------------------------------- 1 | November 26, 2023 - Release 0.7.1 (stable) 2 | 3 | Updates: 4 | - A file path given in the command line will be opened at startup. 5 | - The maximum width of several views has been reduced. 6 | - The minimum size of the desktop window has been adjusted. 7 | - A warning was added to the Linux installer if the directory used for 8 | the startup symlink is not in the PATH variable. 9 | 10 | Bug Fixes: 11 | - The Linux installer explicitly sets permissions for the installation 12 | directory. 13 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/14.txt: -------------------------------------------------------------------------------- 1 | November 30, 2023 - Release 0.7.2 (stable) 2 | 3 | Bug Fixes: 4 | - Fixed theme color visibility problems under the new Material 3 5 | default settings. 6 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/15.txt: -------------------------------------------------------------------------------- 1 | July 24, 2024 - Release 0.7.3 (stable) 2 | 3 | New Features: 4 | - Added a setting to hide the windows title bar on desktop platforms. 5 | 6 | Updates: 7 | - Made many minor code cleanup changes. 8 | - Updated several versions of library code used for building TreeTag. 9 | - Updated to use the latest target API (level 34) for Android. 10 | 11 | Bug Fixes: 12 | - Fixed problems with Android permissions for the copy to folder 13 | command. 14 | - Display formatted search results when using Markdown formatting, 15 | including highlighted matches. 16 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/17.txt: -------------------------------------------------------------------------------- 1 | November 24, 2024 - Release 0.8.0 (stable) 2 | 3 | New Features: 4 | - Added a field configuration option that allows multiple entries for a single 5 | field. Nodes with multiple entries can show under multiple categories. 6 | - In a group rule, the default child sort fields now exclude the fields used in 7 | upstream rules. 8 | - Changed from a back button to separate accept & reject buttons on several 9 | views. 10 | - Added commands to the file list view for refreshing the list and for clearing 11 | selections. 12 | 13 | Updates: 14 | - Tweaked the theme colors to make cards and tiles more visible. 15 | - Made several code cleanup changes. 16 | - Updated the movies sample to include multiple field entries. 17 | - The Android build was updated to work with Android 15. 18 | - Updated the versions of several libraries used to build TreeTag. 19 | 20 | Bug Fixes: 21 | - Fixed a problem with the search and replace function that could cause a loss 22 | of data. 23 | - Fixed exporting special field types to TreeLine files. 24 | 25 | Notes: 26 | - Changes to support multiple field entries broke backward compatibility. This 27 | version can open files from older versions, but older versions can not open 28 | files saved in this version. 29 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/18.txt: -------------------------------------------------------------------------------- 1 | ## April 23, 2025 - Release 0.8.1 (stable) 2 | 3 | ### New Features: 4 | - On CSV imports, auto-detect semicolon and tab delimiters. 5 | - Support Windows-1252 character encoding for CSV imports. 6 | - Add a back key to unselect items on the file list. 7 | - On desktop platforms, support use of shift+click for chain selection on the 8 | file list. 9 | 10 | ### Updates: 11 | - Update the versions of several libraries used to build TreeTag. 12 | - Update the list of dependencies on the Linux install script. 13 | 14 | ### Bug Fixes: 15 | - Fixed a Linux error occurring when XDG is not installed. 16 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/2.txt: -------------------------------------------------------------------------------- 1 | April 23, 2022 - Release 0.0.2 (beta) 2 | 3 | Updates: 4 | - Updated build parameters to work with older Android devices. 5 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/3.txt: -------------------------------------------------------------------------------- 1 | May 9, 2022 - Release 0.0.3 (beta) 2 | 3 | New Features: 4 | - Added import and export to/from TreeLine files. 5 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/4.txt: -------------------------------------------------------------------------------- 1 | July 30, 2022 - Release 0.1.0 (beta) 2 | 3 | New Features: 4 | - Ported TreeTag to Linux and Windows desktops. 5 | - Added a two-pane view on wide screens. 6 | - Added sample files. 7 | 8 | Bug Fixes: 9 | - Many bug fixes. 10 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/5.txt: -------------------------------------------------------------------------------- 1 | October 29, 2022 - Release 0.2.0 (beta) 2 | 3 | New Features: 4 | - Added a search function. 5 | - Added commands to edit or delete multiple child nodes 6 | simultaneously. 7 | - Added the ability to select and copy text from the detail view. 8 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/6.txt: -------------------------------------------------------------------------------- 1 | January 14, 2023 - Release 0.3.0 (beta) 2 | 3 | New Features: 4 | - Added optional display of formatted text using Markdown text tags. 5 | - Added support for storing and retrieving files from a Kinto network 6 | server. 7 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/7.txt: -------------------------------------------------------------------------------- 1 | February 21, 2023 - Release 0.4.0 (beta) 2 | 3 | New Features: 4 | - Added a spell checker that shows misspelled English words with a red 5 | underline by default. 6 | - Added functions to import and output node data as CSV files. 7 | - A new command merges node data from a second TreeTag file. 8 | - A new setting automatically removes undo operations stored in 9 | TreeTag files that are older than a set number of days. 10 | 11 | Updates & Bug Fixes: 12 | - See the CHANGELOG.md file for the full list of changes. 13 | -------------------------------------------------------------------------------- /metadata/en-US/changelogs/9.txt: -------------------------------------------------------------------------------- 1 | March 31, 2023 - Release 0.5.0 (stable) 2 | 3 | New Features: 4 | - Improved searching by adding options to search by phrase, keywords 5 | or regular expressions. 6 | - Added highlighting of matched words to the search results. 7 | - Implemented a replace function for use on search results. 8 | - Added an option on desktop platforms to restore the window size and 9 | position at startup. 10 | 11 | Updates & Bug Fixes: 12 | - See the CHANGELOG.md file for the full list of changes. 13 | -------------------------------------------------------------------------------- /metadata/en-US/full_description.txt: -------------------------------------------------------------------------------- 1 | TreeTag is a personal data manager. It stores information in a hierarchy (the 2 | "Tree" part of the name). But unlike other tree-based applications, TreeTag 3 | automatically positions items in the tree based on field values (the "Tag" part 4 | of the name). 5 | 6 | The data items are generally configured to contain several fields. Different 7 | types of fields are available, including text, numbers, dates, times and 8 | predefined choices. The output format of each field can be defined for group 9 | headings, for data item titles and for data item output. 10 | 11 | The user configures the base portion of the tree, defining rules that will 12 | group the data items into desired categories. The same items can appear in 13 | multiple locations, with sections of the tree structure using different fields 14 | for grouping or sorting. For example, data items can be arranged by a date 15 | field in one section, by a name field sorted alphabetically in another, and by 16 | a category field in another. This allows the differently organized portions of 17 | the tree to act much like predefined searches. 18 | -------------------------------------------------------------------------------- /metadata/en-US/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/metadata/en-US/images/icon.png -------------------------------------------------------------------------------- /metadata/en-US/images/phoneScreenshots/tt_phone_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/metadata/en-US/images/phoneScreenshots/tt_phone_dark.png -------------------------------------------------------------------------------- /metadata/en-US/images/phoneScreenshots/tt_phone_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/metadata/en-US/images/phoneScreenshots/tt_phone_light.png -------------------------------------------------------------------------------- /metadata/en-US/short_description.txt: -------------------------------------------------------------------------------- 1 | A hierarchical personal data manager that tags fields 2 | -------------------------------------------------------------------------------- /metadata/en-US/title.txt: -------------------------------------------------------------------------------- 1 | TreeTag 2 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: treetag 2 | description: An information storage program with an automatic tree structure. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 0.8.1+18 19 | 20 | environment: 21 | sdk: '>=3.0.0 <4.0.0' 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | 27 | 28 | # The following adds the Cupertino Icons font to your application. 29 | # Use with the CupertinoIcons class for iOS style icons. 30 | #cupertino_icons: ^1.0.2 31 | 32 | charset: ^2.0.1 33 | csv: ^6.0.0 34 | file_picker: ^10.1.2 35 | # flutter_markdown: ^0.6.10 36 | flutter_markdown_selectionarea: ^0.6.14 37 | html_unescape: ^2.0.0 38 | http: ^1.1.0 39 | intl: ^0.20.2 40 | markdown: ^7.2.2 41 | package_info_plus: ^8.0.0 42 | path: ^1.9.0 43 | path_provider: ^2.0.5 44 | provider: ^6.0.0 45 | shared_preferences: ^2.0.15 46 | split_view: ^3.1.0 47 | url_launcher: ^6.2.1 48 | uuid: ^4.2.1 49 | window_manager: ^0.4.2 50 | 51 | dev_dependencies: 52 | flutter_launcher_icons: 53 | flutter_lints: ^5.0.0 54 | flutter_test: 55 | sdk: flutter 56 | 57 | flutter_icons: 58 | android: true 59 | ios: true 60 | image_path_android: "assets/launcher/tree_icon_1024.png" 61 | image_path_ios: "assets/launcher/tree_icon_1024_white.png" 62 | adaptive_icon_foreground: "assets/launcher/tree_icon_108.png" 63 | adaptive_icon_background: "#ffffff" 64 | 65 | # For information on the generic Dart part of this file, see the 66 | # following page: https://dart.dev/tools/pub/pubspec 67 | 68 | # The following section is specific to Flutter. 69 | flutter: 70 | 71 | # The following line ensures that the Material Icons font is 72 | # included with your application, so that you can use the icons in 73 | # the material Icons class. 74 | uses-material-design: true 75 | 76 | # To add assets to your application, add an assets section, like this: 77 | assets: 78 | - assets/images/tree_icon_48.png 79 | - assets/samples/ 80 | - assets/help/ 81 | 82 | # An image asset can refer to one or more resolution-specific "variants", see 83 | # https://flutter.dev/assets-and-images/#resolution-aware. 84 | 85 | # For details regarding adding assets from package dependencies, see 86 | # https://flutter.dev/assets-and-images/#from-packages 87 | 88 | # To add custom fonts to your application, add a fonts section here, 89 | # in this "flutter" section. Each entry in this list should have a 90 | # "family" key with the font family name, and a "fonts" key with a 91 | # list giving the asset and other descriptors for the font. For 92 | # example: 93 | # fonts: 94 | # - family: Schyler 95 | # fonts: 96 | # - asset: fonts/Schyler-Regular.ttf 97 | # - asset: fonts/Schyler-Italic.ttf 98 | # style: italic 99 | # - family: Trajan Pro 100 | # fonts: 101 | # - asset: fonts/TrajanPro.ttf 102 | # - asset: fonts/TrajanPro_Bold.ttf 103 | # weight: 700 104 | # 105 | # For details regarding fonts from package dependencies, 106 | # see https://flutter.dev/custom-fonts/#from-packages 107 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:treetag/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /treetag.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Version=0.8.1 4 | Name=TreeTag 5 | GenericName=Info Manager 6 | Exec=treetag 7 | Icon=/opt/treetag/treetag_icon_64.png 8 | Terminal=false 9 | Categories=Office;TextTools; 10 | Comment=Organize data in a tree structure 11 | -------------------------------------------------------------------------------- /treetag_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/treetag_icon_64.png -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(treetag LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "treetag") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); 16 | UrlLauncherWindowsRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 18 | WindowManagerPluginRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("WindowManagerPlugin")); 20 | } 21 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | screen_retriever_windows 7 | url_launcher_windows 8 | window_manager 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 37 | 38 | # Run the Flutter tool portions of the build. This must not be removed. 39 | add_dependencies(${BINARY_NAME} flutter_assemble) 40 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "org.bellz" "\0" 93 | VALUE "FileDescription", "treetag" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "treetag" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 org.bellz. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "treetag.exe" "\0" 98 | VALUE "ProductName", "treetag" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"treetag", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doug-101/TreeTag/eb354c10a46632cc671496f4f6d4437fa04b1949/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------