Oliver Fabel 1 год назад
Родитель
Сommit
5390628bef
5 измененных файлов с 214 добавлено и 0 удалено
  1. 4 0
      CHANGELOG.md
  2. 1 0
      application.fam
  3. BIN
      images/splash.png
  4. 183 0
      splash.svg
  5. 26 0
      upython.c

+ 4 - 0
CHANGELOG.md

@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 
 ## [Unreleased]
 ## [Unreleased]
 
 
+### Added
+
+* Display splash screen upon application start.
+
 ## [1.0.0] - 2024-08-22
 ## [1.0.0] - 2024-08-22
 
 
 ### Added
 ### Added

+ 1 - 0
application.fam

@@ -8,6 +8,7 @@ App(
     fap_version="1.0",
     fap_version="1.0",
     fap_description="Compile and execute MicroPython scripts",
     fap_description="Compile and execute MicroPython scripts",
     fap_icon="icon.png",
     fap_icon="icon.png",
+    fap_icon_assets="images",
     fap_author="Oliver Fabel",
     fap_author="Oliver Fabel",
     fap_file_assets="examples",
     fap_file_assets="examples",
     fap_weburl="https://github.com/ofabel/mp-flipper",
     fap_weburl="https://github.com/ofabel/mp-flipper",

BIN
images/splash.png


+ 183 - 0
splash.svg

@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="128"
+   height="64"
+   viewBox="0 0 33.866666 16.933333"
+   version="1.1"
+   id="svg1"
+   inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
+   sodipodi:docname="splash.svg"
+   inkscape:export-filename="images/splash.png"
+   inkscape:export-xdpi="96"
+   inkscape:export-ydpi="96"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#ffffff"
+     bordercolor="#000000"
+     borderopacity="0.25"
+     inkscape:showpageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:document-units="px"
+     showguides="true"
+     inkscape:zoom="6.7496002"
+     inkscape:cx="64.003791"
+     inkscape:cy="32.001896"
+     inkscape:window-width="2000"
+     inkscape:window-height="1252"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="layer1">
+    <sodipodi:guide
+       position="3.9687499,16.933333"
+       orientation="-1,0"
+       id="guide2"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="4.2333333,16.933333"
+       orientation="-1,0"
+       id="guide3"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="0,12.964583"
+       orientation="0,1"
+       id="guide4"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="8.2020832,16.933333"
+       orientation="-1,0"
+       id="guide5"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="8.4666665,16.933333"
+       orientation="-1,0"
+       id="guide6"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="0,3.9687499"
+       orientation="0,1"
+       id="guide7"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="12.435416,16.933333"
+       orientation="-1,0"
+       id="guide8"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="12.7,16.933333"
+       orientation="-1,0"
+       id="guide9"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="16.66875,16.933333"
+       orientation="-1,0"
+       id="guide10"
+       inkscape:label=""
+       inkscape:locked="false"
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="0,16.933333"
+       orientation="0,1"
+       id="guide11"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="0,0"
+       orientation="0,-1"
+       id="guide12"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="0,0"
+       orientation="1,0"
+       id="guide13"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="14.684375,16.933333"
+       orientation="-1,0"
+       id="guide14"
+       inkscape:label=""
+       inkscape:locked="false"
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="0,1.984375"
+       orientation="0,1"
+       id="guide15"
+       inkscape:label=""
+       inkscape:locked="false"
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="0,8.4666665"
+       orientation="0,1"
+       id="guide16"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+    <sodipodi:guide
+       position="25.399999,16.933333"
+       orientation="-1,0"
+       id="guide18"
+       inkscape:locked="false"
+       inkscape:label=""
+       inkscape:color="rgb(0,134,229)" />
+  </sodipodi:namedview>
+  <defs
+     id="defs1" />
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round"
+       d="M 0,16.933333 V 0 H 8.2020832 V 12.964583 H 8.4666666 V 0 H 16.66875 V 16.933333 H 12.7 V 3.96875 H 12.435416 V 16.933333 H 4.2333333 V 3.96875 H 3.96875 v 12.964583 z"
+       id="path13" />
+    <rect
+       style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round"
+       id="rect15"
+       width="0.52916664"
+       height="1.0583333"
+       x="14.419791"
+       y="14.287499" />
+    <text
+       xml:space="preserve"
+       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333px;line-height:1;font-family:Sans;-inkscape-font-specification:Sans;letter-spacing:-0.0529167px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round"
+       x="18.140495"
+       y="7.1850882"
+       id="text16"><tspan
+         sodipodi:role="line"
+         style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;line-height:1;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Bold';letter-spacing:-0.0529167px;fill:#000000;fill-opacity:1;stroke-width:2"
+         x="18.140495"
+         y="7.1850882"
+         id="tspan17"
+         dy="0">Micro</tspan><tspan
+         sodipodi:role="line"
+         style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;line-height:1;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Bold';letter-spacing:-0.0529167px;fill:#000000;fill-opacity:1;stroke-width:2"
+         x="18.140495"
+         y="11.519282"
+         id="tspan18">Python</tspan></text>
+  </g>
+</svg>

+ 26 - 0
upython.c

@@ -1,12 +1,15 @@
 #include <malloc.h>
 #include <malloc.h>
 
 
 #include <furi.h>
 #include <furi.h>
+#include <gui/gui.h>
 #include <dialogs/dialogs.h>
 #include <dialogs/dialogs.h>
 #include <storage/storage.h>
 #include <storage/storage.h>
 
 
 #include <mp_flipper_runtime.h>
 #include <mp_flipper_runtime.h>
 #include <mp_flipper_compiler.h>
 #include <mp_flipper_compiler.h>
 
 
+#include "upython_icons.h"
+
 #define TAG "uPython"
 #define TAG "uPython"
 
 
 static void execute_file(FuriString* file) {
 static void execute_file(FuriString* file) {
@@ -68,9 +71,32 @@ static bool select_python_file(FuriString* file_path) {
     return result;
     return result;
 }
 }
 
 
+static void show_splash_screen() {
+    Gui* gui = furi_record_open(RECORD_GUI);
+    ViewPort* view_port = view_port_alloc();
+
+    gui_add_view_port(gui, view_port, GuiLayerFullscreen);
+
+    Canvas* canvas = gui_direct_draw_acquire(gui);
+
+    canvas_draw_icon(canvas, 0, 0, &I_splash);
+    canvas_commit(canvas);
+
+    furi_delay_ms(5000);
+
+    gui_direct_draw_release(gui);
+    gui_remove_view_port(gui, view_port);
+
+    view_port_free(view_port);
+
+    furi_record_close(RECORD_GUI);
+}
+
 int32_t upython(void* p) {
 int32_t upython(void* p) {
     UNUSED(p);
     UNUSED(p);
 
 
+    show_splash_screen();
+
     FuriString* file_path = furi_string_alloc();
     FuriString* file_path = furi_string_alloc();
 
 
     if(select_python_file(file_path)) {
     if(select_python_file(file_path)) {