From 3a2b77cb3ddb52fc46cd42086fb77dceab94c349 Mon Sep 17 00:00:00 2001 From: Gabor de Mooij Date: Tue, 28 Jan 2025 17:19:09 +0100 Subject: [PATCH] GUI plugin 0.1 --- plugins/gui/examples/en/guien.ctr | 84 +++ plugins/gui/examples/es/guies.ctr | 87 +++ plugins/gui/examples/nl/gui.ctr | 47 ++ plugins/gui/examples/nl/guinl.ctr | 87 +++ plugins/gui/extra/en/lvglen | 43 ++ plugins/gui/extra/en/supplementen | 10 + plugins/gui/extra/en/xmltree | 88 +++ plugins/gui/extra/es/arbolxml | 89 +++ plugins/gui/extra/es/lvgles | 45 ++ plugins/gui/extra/es/supplementoes | 10 + plugins/gui/extra/nl/lvglnl | 47 ++ plugins/gui/extra/nl/supplementnl | 13 + plugins/gui/extra/nl/xmlboom | 102 +++ plugins/gui/gui.c | 148 ++++ plugins/gui/i18n/de/gui.h | 3 + plugins/gui/i18n/en/gui.h | 2 + plugins/gui/i18n/es/gui.h | 3 + plugins/gui/i18n/fr/gui.h | 3 + plugins/gui/i18n/nl/gui.h | 2 + plugins/gui/i18n/ru/gui.h | 3 + plugins/gui/lv_conf.h | 1121 ++++++++++++++++++++++++++++ plugins/gui/makefile | 73 ++ plugins/gui/makefile.win64 | 96 +++ plugins/gui/mouse_cursor_icon.c | 33 + 24 files changed, 2239 insertions(+) create mode 100644 plugins/gui/examples/en/guien.ctr create mode 100644 plugins/gui/examples/es/guies.ctr create mode 100644 plugins/gui/examples/nl/gui.ctr create mode 100644 plugins/gui/examples/nl/guinl.ctr create mode 100644 plugins/gui/extra/en/lvglen create mode 100644 plugins/gui/extra/en/supplementen create mode 100644 plugins/gui/extra/en/xmltree create mode 100644 plugins/gui/extra/es/arbolxml create mode 100644 plugins/gui/extra/es/lvgles create mode 100644 plugins/gui/extra/es/supplementoes create mode 100644 plugins/gui/extra/nl/lvglnl create mode 100644 plugins/gui/extra/nl/supplementnl create mode 100644 plugins/gui/extra/nl/xmlboom create mode 100644 plugins/gui/gui.c create mode 100644 plugins/gui/i18n/de/gui.h create mode 100644 plugins/gui/i18n/en/gui.h create mode 100644 plugins/gui/i18n/es/gui.h create mode 100644 plugins/gui/i18n/fr/gui.h create mode 100644 plugins/gui/i18n/nl/gui.h create mode 100644 plugins/gui/i18n/ru/gui.h create mode 100644 plugins/gui/lv_conf.h create mode 100644 plugins/gui/makefile create mode 100644 plugins/gui/makefile.win64 create mode 100644 plugins/gui/mouse_cursor_icon.c diff --git a/plugins/gui/examples/en/guien.ctr b/plugins/gui/examples/en/guien.ctr new file mode 100644 index 00000000..c47a2c88 --- /dev/null +++ b/plugins/gui/examples/en/guien.ctr @@ -0,0 +1,84 @@ +# Title.......: GUIEN +# Author......: Gabor de Mooij (c) copyright 2025 +# Date........: 28 januari 2025 +# License.....: BSD-3/MIT +# Version.....: 1.0 +# +# Description: +# This is a demo program that shows how to use the +# GUI plugin to create a graphical user interface. +# +# Dependencies: +# - supplementen +# - xmltree +# - lvglen + +Program use: (File new: Path supplementen). +Program use: (File new: Path xmltree). +Program use: (File new: Path lvglen). + +>> gui := Gui new. +>> i := 0. + +gui on: ['click'] do: { :info + i add: 1. + (info = 123) true: { + gui xml: (b copy ~counter~: i) name: ['btn'] at: 100. + }. +}. + +>> b := +LVGLEN new +component +elements + view + extends: ['object'], + events: True, + width: ['100%'], + height: ['100%'], + elements + button + events: True, + id: 123, + elements + label + text: ['~counter~'], + close + close + close +close +text. + +>> a := +LVGLEN new +component +elements + view + extends: ['object'], + id: 100, + events: True, + height: ['400px'], + width: ['800px'], + elements + object + events: ['verdadero'], + width: ['100%'], + height: ['100%'], + elements + button + events: True, + id: 123, + elements + label + text: ['CLICK ME!'], + close + close + close + close +close +text. + +gui screen: a. + + + diff --git a/plugins/gui/examples/es/guies.ctr b/plugins/gui/examples/es/guies.ctr new file mode 100644 index 00000000..f9ef1927 --- /dev/null +++ b/plugins/gui/examples/es/guies.ctr @@ -0,0 +1,87 @@ +# Título.....: GUIES +# Autor......: Gabor de Mooij (c) copyright 2025 +# Fecha......: 2025-01-28 +# Licencia...: BSD-3/MIT +# Versión....: 1.0 +# +# Descripción: +# Este es un programa de demostración que muestra cómo usar el +# complemento GUI para crear una interfaz gráfica de usuario. +# +# Dependencias: +# - supplementoes +# - abrolxml +# - lvgles + +>> gui := Gui nuevo. +>> i := 0. + +Programa utilizar: (Ubicación-del-archivo supplementoes). +Programa utilizar: (Ubicación-del-archivo arbolxml). +Programa utilizar: (Ubicación-del-archivo lvgles). + +gui en: ['click'] hacer: { :info + i añadir: 1. + (info = 123) verdadero: { + gui xml: (b copiar ~contar~: i) nombre: ['btn'] en: 100. + }. +}. + + + +>> b := +LVGLES nuevo +componente +elementos + vista + extiende: ['objeto'], + burbuja-evento: ['verdadero'], + altura: ['100%'], + ancho: ['100%'], + elementos + boton + burbuja-evento: ['verdadero'], + id: 123, + elementos + etiqueta + texto: ['~contar~'], + cerrar + cerrar + cerrar +cerrar +texto. + +>> a := +LVGLES nuevo +componente +elementos + vista + extiende: ['objeto'], + id: 100, + burbuja-evento: ['verdadero'], + altura: ['400px'], + ancho: ['800px'], + elementos + objeto + burbuja-evento: ['verdadero'], + ancho: ['100%'], + altura: ['100%'], + elementos + boton + burbuja-evento: ['verdadero'], + id: 123, + elementos + etiqueta + texto: ['HAZ CLIC'], + cerrar + cerrar + cerrar + cerrar +cerrar +texto. + +Salida escribir: a, detener. +gui pantalla: a. + + + diff --git a/plugins/gui/examples/nl/gui.ctr b/plugins/gui/examples/nl/gui.ctr new file mode 100644 index 00000000..ea43460a --- /dev/null +++ b/plugins/gui/examples/nl/gui.ctr @@ -0,0 +1,47 @@ + +>> gui := Gui nieuw. +>> i := 0. + +Programma gebruik: ( Bestand nieuw: ['../../../../misc/supplements/nl'] ). +Programma gebruik: ( Bestand nieuw: ['../../extra/nl/lvglnl'] ). + + +gui bij: ['klik'] doen: { :info + i optellen: 1. + Uit schrijf: ['klik!'], stop. + Uit schrijf: info getal, stop. + (info = 123) ja: { + gui xml: (knop kopieer ~teller~: i) name: ['knop'] at: 100. + }. +}. + +>> knop := [' + + + + + + + +']. + +>> xml := XML-boom nieuw. + + +>> xml := [' + + + + + + + + + +']. + +gui scherm: xml. + + + + diff --git a/plugins/gui/examples/nl/guinl.ctr b/plugins/gui/examples/nl/guinl.ctr new file mode 100644 index 00000000..87ed8376 --- /dev/null +++ b/plugins/gui/examples/nl/guinl.ctr @@ -0,0 +1,87 @@ +# Titel.......: GUINL +# Auteur......: Gabor de Mooij (c) copyright 2025 +# Datum.......: 28 januari 2025 +# Licentie....: BSD-3/MIT +# Versie......: 1.0 +# +# Beschrijving: +# GUINL is een voorbeeldprogramma van een GUI in Citrine/NL. +# +# Benodigdheden: +# - xmlboom +# - lvglnl +# - supplementnl + +Programma gebruik: ( Bestand nieuw: Bestandslocatie supplementnl ). +Programma gebruik: ( Bestand nieuw: Bestandslocatie xmlboom ). +Programma gebruik: ( Bestand nieuw: Bestandslocatie lvglnl ). + +>> gui := Gui nieuw. +>> i := 0. + +gui bij: ['klik'] doen: { :info + i optellen: 1. + (info = 123) ja: { + gui xml: ( + knopstructuur + tekst + kopieer + ~teller~: i + ) + naam: ['knop'] + bij: 100. + }. +}. + +>> knopstructuur := LVGLNL nieuw. + +knopstructuur + component + elementen + weergave + baseer-op: ['object'], + interactief: Ja, + breedte: ['100%'], + hoogte: ['100%'], + elementen + knop + id: 123, + interactief: Ja, + elementen + label + tekst: ['~teller~'], + sluit + sluit + sluit + sluit. + +>> boomstructuur := LVGLNL nieuw. + +boomstructuur + component + elementen + weergave + baseer-op: ['object'], + id: 100, + interactief: Ja, + hoogte: ['400px'], + breedte: ['800px'], + elementen + object + interactief: Ja, + breedte: ['100%'], + hoogte: ['100%'], + elementen + knop + interactief: Ja, + id: 123, + elementen + label + tekst: ['klik mij!'], + sluit + sluit + sluit + sluit + sluit. + +gui scherm: boomstructuur tekst. diff --git a/plugins/gui/extra/en/lvglen b/plugins/gui/extra/en/lvglen new file mode 100644 index 00000000..37ff97ab --- /dev/null +++ b/plugins/gui/extra/en/lvglen @@ -0,0 +1,43 @@ +# Title.......: LVGLEN +# Author......: Gabor de Mooij (c) copyright 2025 +# Date........: 28 januari 2025 +# License.....: BSD-3/MIT +# Version.....: 1.0 +# +# Description: +# LVGLEN is an English XML tree to build +# graphical user interfaces with LVGL. +# +# Dependencies: +# - supplementen +# - xmltree + +>> LVGLEN := Object new. + +LVGLEN on: ['new'] do: { + + >> xml := XML-tree new. + + xml + names: ( + List new + object: ['lv_obj'], + button: ['lv_button'], + label: ['lv_label'] + ) + attributes: ( + List new + events: ['event_bubble'] + + ) + values: ( + List new + True: ['true'], + False: ['false'], + object: ['lv_obj'], + button: ['lv_boton'], + label: ['lv_label'] + ). + + <- xml. +}. diff --git a/plugins/gui/extra/en/supplementen b/plugins/gui/extra/en/supplementen new file mode 100644 index 00000000..47428fab --- /dev/null +++ b/plugins/gui/extra/en/supplementen @@ -0,0 +1,10 @@ +# Title.......: Supplement English Language +# Author......: Gabor de Mooij (c) copyright 2025 +# Date........: 28 januari 2025 +# License.....: BSD-3/MIT +# Version.....: 1.0 +# +# Description: +# This supplement contains extensions for the English language. + +None on: ['otherwise:'] do: { :fallback <- fallback. }. \ No newline at end of file diff --git a/plugins/gui/extra/en/xmltree b/plugins/gui/extra/en/xmltree new file mode 100644 index 00000000..7fdd1042 --- /dev/null +++ b/plugins/gui/extra/en/xmltree @@ -0,0 +1,88 @@ +# Title.......: XML-tree +# Author......: Gabor de Mooij (c) copyright 2025 +# Date........: 28 januari 2025 +# License.....: BSD-3/MIT +# Version.....: 1.0 +# +# Description: +# This library provides an XML tree generator object that you +# can use to create XML by sending generic messages. This +# allows you to mix XML with native Citrine code as if it were +# one language. No need for XML syntax! +# +# Dependencies: +# - supplementen + +>> XML-tree := Object new. + +XML-tree on: ['new'] do: { + <- self new init. +}. + +XML-tree on: ['init'] do: { + own attrs := List new. + own values := List new. + own names := List new. + self clear. +}. + +XML-tree on: ['clear'] do: { + own textmode := False. + own str := ['']. + own tags := Sequence new. + own elementmode := False. +}. + +XML-tree on: ['names:attributes:values:'] do: { :names :attrs :values + own attrs := attrs. + own values := values. + own names := names. +}. + + +XML-tree on: ['respond:'] do: { :message + >> tag := (own names ? message otherwise: message). + own tags append: tag. + own str append: ( + ['\n']. + own elementmode := True. +}. + +XML-tree on: ['textual'] do: { :message :arg + own textmode := True. +}. + +XML-tree on: ['close'] do: { :message :arg + >> end := own tags pop. + own elementmode true: { + own str append: (['\n'] tag: end). + }, else: { + own str append: (['>'] tag: end). + own elementmode := True. + }. +}. + + +XML-tree on: ['text'] do: { <- own str. }. + diff --git a/plugins/gui/extra/es/arbolxml b/plugins/gui/extra/es/arbolxml new file mode 100644 index 00000000..d61966e5 --- /dev/null +++ b/plugins/gui/extra/es/arbolxml @@ -0,0 +1,89 @@ +# Título.....: Árbol-XML +# Autor......: Gabor de Mooij (c) copyright 2025 +# Fecha......: 2025-01-28 +# Licencia...: BSD-3/MIT +# Versión....: 1.0 +# +# Descripción: +# Este es un árbol XML para crear interfaces de usuario LVGL. +# +# Dependencias: +# - supplementoes + +>> Árbol-XML := Objeto nuevo. + +Árbol-XML en: ['nuevo'] hacer: { <- yo nuevo inicializar. }. + +Árbol-XML en: ['inicializar'] hacer: { + mi textmode := Falso. + mi str := ['']. + mi tags := Serie nuevo. + mi attrs := Lista nuevo. + mi valores := Lista nuevo. + mi names := Lista nuevo. + mi elementmode := Falso. +}. + +Árbol-XML en: ['nombres:atributos:valores:'] hacer: { :names :attrs :valores + mi attrs := attrs. + mi valores := valores. + mi names := names. +}. + + +Árbol-XML en: ['responder:'] hacer: { :message + + >> tag := (mi names ? message alternancia: message). + + mi tags adjuntar: tag. + mi str adjuntar: ( + ['\ +']. + mi elementmode := Verdadero. +}. + +Árbol-XML en: ['textual'] hacer: { :message :arg + mi textmode := Verdadero. +}. + + +Árbol-XML en: ['cerrar'] hacer: { :message :arg + >> finalizar := mi tags toma-el-último. + mi elementmode verdadero: { + mi str adjuntar: (['\n'] tag: finalizar). + }, otro: { + mi str adjuntar: (['>'] tag: finalizar). + mi elementmode := Verdadero. + }. +}. + +Árbol-XML en: ['claro'] hacer: { + mi textmode := Falso. + mi str := ['']. + mi tags := Serie nuevo. + mi elementmode := Falso. +}. + +Árbol-XML en: ['texto'] hacer: { <- mi str. }. + diff --git a/plugins/gui/extra/es/lvgles b/plugins/gui/extra/es/lvgles new file mode 100644 index 00000000..4382e9c2 --- /dev/null +++ b/plugins/gui/extra/es/lvgles @@ -0,0 +1,45 @@ +# Título.....: LVGLES +# Autor......: Gabor de Mooij (c) copyright 2025 +# Fecha......: 2025-01-28 +# Licencia...: BSD-3/MIT +# Versión....: 1.0 +# +# Descripción: +# Este es un árbol XML para crear interfaces de usuario LVGL. +# +# Dependencias: +# - supplementoes +# - abrolxml +# - lvgles + +>> LVGLES := Objeto nuevo. + +LVGLES en: ['nuevo'] hacer: { + >> xml := Árbol-XML nuevo. + xml + nombres: ( + Lista nuevo + componente: ['component'], + vista: ['view'], + poner: ['lv_obj'] en: ['objeto'], + boton: ['lv_button'], + etiqueta: ['lv_label'] + ) + atributos: ( + Lista nuevo + extiende: ['extends'], + burbuja-evento: ['event_bubble'], + ancho: ['width'], + altura: ['height'], + texto: ['text'] + + ) valores: ( + Lista nuevo + poner: ['true'] en: ['verdadero'], + poner: ['false'] en: ['falso'], + poner: ['lv_obj'] en: ['objeto'], + boton: ['lv_boton'], + etiqueta: ['lv_label'] + ). + <- xml. +}. \ No newline at end of file diff --git a/plugins/gui/extra/es/supplementoes b/plugins/gui/extra/es/supplementoes new file mode 100644 index 00000000..ed21da89 --- /dev/null +++ b/plugins/gui/extra/es/supplementoes @@ -0,0 +1,10 @@ +# Título.....: GUIES +# Autor......: Gabor de Mooij (c) copyright 2025 +# Fecha......: 2025-01-28 +# Licencia...: BSD-3/MIT +# Versión....: 1.0 +# +# Descripción: +# Este suplemento contiene extensiones para el idioma español. + +Nulo en: ['alternancia:'] hacer: { :a <- a. }. \ No newline at end of file diff --git a/plugins/gui/extra/nl/lvglnl b/plugins/gui/extra/nl/lvglnl new file mode 100644 index 00000000..8ac8d9c5 --- /dev/null +++ b/plugins/gui/extra/nl/lvglnl @@ -0,0 +1,47 @@ +# Titel.......: LVGLNL +# Auteur......: Gabor de Mooij (c) copyright 2025 +# Datum.......: 28 januari 2025 +# Licentie....: BSD-3/MIT +# Versie......: 1.0 +# +# Beschrijving: +# LVGLNL is een Nederlandse XML-boom voor het maken van een +# LVGL-gebruikersinterface. +# +# Benodigdheden: +# - xmlboom +# - supplementnl + + +>> LVGLNL := Object nieuw. + +LVGLNL bij: ['nieuw'] doen: { + + >> xml-boom := XML-boom nieuw. + xml-boom + elementen: ( + Lijst nieuw + component: ['component'], + weergave: ['view'], + zet: ['object'] bij: ['lv_obj'], + knop: ['lv_button'], + label: ['lv_label'] + ) + attributen: ( + Lijst nieuw + baseer-op: ['extends'], + interactief: ['event_bubble'], + breedte: ['width'], + hoogte: ['height'], + tekst: ['text'] + ) + waarden: ( + Lijst nieuw + zet: ['true'] bij: Ja, + zet: ['false'] bij: Nee, + zet: ['lv_obj'] bij: ['object'], + knop: ['lv_boton'], + label: ['lv_label'] + ). + <- xml-boom. +}. diff --git a/plugins/gui/extra/nl/supplementnl b/plugins/gui/extra/nl/supplementnl new file mode 100644 index 00000000..588e9cd5 --- /dev/null +++ b/plugins/gui/extra/nl/supplementnl @@ -0,0 +1,13 @@ +# Titel.......: Supplement Nederlandse Taal +# Auteur......: Gabor de Mooij (c) copyright 2025 +# Datum.......: 28 januari 2025 +# Licentie....: BSD-3/MIT +# Versie......: 1.0 +# +# Beschrijving: +# Dit supplementpakket bevat uitbreidingen voor Citrine +# in de Nederlandse taal. + + +Niets bij: ['of-anders:'] doen: { :alternatief <- alternatief. }. + diff --git a/plugins/gui/extra/nl/xmlboom b/plugins/gui/extra/nl/xmlboom new file mode 100644 index 00000000..3d38fe46 --- /dev/null +++ b/plugins/gui/extra/nl/xmlboom @@ -0,0 +1,102 @@ +# Titel.......: Xmlboom +# Auteur......: Gabor de Mooij (c) copyright 2025 +# Datum.......: 28 januari 2025 +# Licentie....: BSD-3/MIT +# Versie......: 1.0 +# +# Beschrijving: +# Xmlboom is een hulpprogramma om XML-bomen +# te bouwen die verweven zijn met reguliere programmacode. +# +# Benodigdheden: +# - supplementnl + +>> XML-boom := Object nieuw. + +XML-boom bij: ['nieuw'] doen: { + <- zelf nieuw voorbereiden. +}. + +XML-boom bij: ['voorbereiden'] doen: { + zelf opschonen. + eigen attribuutnamen := Lijst nieuw. + eigen attribuutwaarden := Lijst nieuw. + eigen elementnamen := Lijst nieuw. +}. + +XML-boom bij: ['opschonen'] doen: { + eigen tekstmodus := Nee. + eigen uitkomst := ['']. + eigen elementen := Reeks nieuw. + eigen elementmodus := Nee. +}. + +XML-boom bij: ['elementen:attributen:waarden:'] doen: { :elementen :attributen :waarden + eigen attribuutnamen := attributen. + eigen attribuutwaarden := waarden. + eigen elementnamen := elementen. +}. + + +XML-boom bij: ['bericht:'] doen: { :bericht + + >> elementnaam := ( + eigen elementnamen ? bericht of-anders: bericht + ). + + eigen elementen toevoegen: elementnaam. + eigen uitkomst toevoegen: ( + ['\n']. + eigen elementmodus := Ja. +}. + +XML-boom bij: ['tekstueel'] doen: { + eigen tekstmodus := Ja. +}. + + +XML-boom bij: ['sluit'] doen: { + >> slot := eigen elementen rknip. + eigen elementmodus ja: { + eigen uitkomst toevoegen: (['\n'] element: slot). + }, anders: { + eigen uitkomst toevoegen: (['>'] element: slot). + eigen elementmodus := Ja. + }. +}. + + + + + +XML-boom bij: ['tekst'] doen: { <- eigen uitkomst. }. + diff --git a/plugins/gui/gui.c b/plugins/gui/gui.c new file mode 100644 index 00000000..c1b92b50 --- /dev/null +++ b/plugins/gui/gui.c @@ -0,0 +1,148 @@ +#include +#include +#include +#include +#include + +#include "lvgl/lvgl.h" +#include "../../citrine.h" +#include +#include + +uint16_t CtrGUIWidth = 800; +uint16_t CtrGUIHeight = 400; +ctr_object* guiObject; + + + + +void ctr_gui_internal_event_handler(lv_event_t* e) { + ctr_argument* arguments; + char* message; + + int event_code = lv_event_get_code(e); + char* event_name = lv_event_code_get_name(lv_event_get_code(e)); + lv_obj_t* target = lv_event_get_target(e); + printf("---- event: %s \n", event_name); + uint32_t id = (uint32_t) lv_obj_get_id(target); + if (id != NULL) { + printf("id %p \n", id); + arguments = ctr_heap_allocate(sizeof(ctr_argument)); + arguments->object = ctr_build_number_from_float( (double) id ); + arguments->next = NULL; + message = "???"; + if (event_code == LV_EVENT_CLICKED) { + message = CTR_DICT_ON_CLICK; + } + ctr_send_message(guiObject, message, strlen(message), arguments); + ctr_heap_free(arguments); + //ctr_heap_free(message); + } +} + +void ctr_gui_destructor(ctr_resource* rs) { + return; +} + +ctr_object* ctr_gui_new(ctr_object* myself, ctr_argument* argumentList) { + printf("Nieuwe GUI!\n"); + if (guiObject != NULL) { + printf("singleton!\n"); + return guiObject; + } + printf("guiObject @ %p \n", &guiObject); + ctr_object* instance = ctr_internal_create_object(CTR_OBJECT_TYPE_OTEX); + ctr_resource* rs = ctr_heap_allocate( sizeof(ctr_resource) ); + rs->ptr = NULL; + rs->destructor = &ctr_gui_destructor; + instance->link = myself; + instance->value.rvalue = rs; + instance->info.sticky = 1; // just in case, dont let gc clean it up + return instance; +} + + +ctr_object* ctr_gui_width_height_set(ctr_object* myself, ctr_argument* argumentList) { + CtrGUIWidth = ctr_tonum(argumentList->object); + CtrGUIHeight = ctr_tonum(argumentList->next->object); + return myself; +} + + +lv_event_dsc_t* CtrEventHandler = NULL; + + +ctr_object* ctr_gui_xml_at_set(ctr_object* myself, ctr_argument* argumentList) { + lv_obj_t* root = lv_screen_active(); + char* xml = ctr_heap_allocate_cstring(argumentList->object); + char* name = ctr_heap_allocate_cstring(ctr_internal_cast2string(argumentList->next->object)); + uint32_t id = ctr_tonum(argumentList->next->next->object); + lv_obj_t* child = lv_obj_get_child_by_id(root, &id); + if (CtrEventHandler == NULL) { + CtrEventHandler = lv_obj_add_event_cb(root, &ctr_gui_internal_event_handler, LV_EVENT_ALL, NULL); + } + if (!child) child = root; + uint32_t n = lv_obj_get_child_count(child); + for(int i = 0; i < n; i++) { + lv_obj_t* old = lv_obj_get_child(child, i); + lv_obj_delete(old); + } + printf("XML change: %d at: %p name: %s\n", (int) strlen(xml), child, name); + lv_xml_component_register_from_data(name, xml); + lv_xml_create(child, name, NULL); + ctr_heap_free(xml); + ctr_heap_free(name); + return myself; +} + + +ctr_object* ctr_gui_screen(ctr_object* myself, ctr_argument* argumentList) { + printf("Start GUI!\n"); + lv_init(); + printf("sdl\n"); + lv_sdl_window_create(CtrGUIWidth, CtrGUIHeight); + printf("created window\n"); + lv_group_t * g = lv_group_create(); + lv_group_set_default(g); + lv_indev_t* mouse = lv_sdl_mouse_create(); + lv_indev_set_group(mouse, lv_group_get_default()); + lv_indev_t * mousewheel = lv_sdl_mousewheel_create(); + lv_indev_set_group(mousewheel, lv_group_get_default()); + lv_indev_t * keyboard = lv_sdl_keyboard_create(); + lv_indev_set_group(keyboard, lv_group_get_default()); + ctr_argument xml; + ctr_argument rootname; + ctr_argument rootnode; + xml.object = argumentList->object; + rootname.object = ctr_build_string_from_cstring("root"); + rootnode.object = CtrStdNil; + xml.next = &rootname; + rootname.next = &rootnode; + ctr_gui_xml_at_set(myself, &xml); + //ctr_heap_free(rootname.object); + uint32_t idle_time; + printf("startbericht zenden\n"); + ctr_argument* arguments = ctr_heap_allocate(sizeof(ctr_argument)); + arguments->object = CtrStdNil; + ctr_send_message(guiObject, CTR_DICT_RUN, strlen(CTR_DICT_RUN), arguments); + ctr_heap_free(arguments); + printf("startbericht verzonden\n"); + /*Handle LVGL tasks*/ + while(1) { + idle_time = lv_timer_handler(); /*Returns the time to the next timer execution*/ + usleep(idle_time * 1000); + } + return myself; +} + +void begin() { + guiObject = NULL; + guiObject = ctr_gui_new(CtrStdObject, NULL); + guiObject->link = CtrStdObject; + ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_NEW ), &ctr_gui_new ); + ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_XML_NAME_AT_SET ), &ctr_gui_xml_at_set ); + ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_WIDTH_HEIGHT_SET ), &ctr_gui_width_height_set ); + ctr_internal_create_func(guiObject, ctr_build_string_from_cstring( CTR_DICT_SCREEN ), &ctr_gui_screen ); + ctr_internal_object_add_property(CtrStdWorld, ctr_build_string_from_cstring( CTR_DICT_GUI_PLUGIN_ID ), guiObject, CTR_CATEGORY_PUBLIC_PROPERTY); + ctr_internal_object_add_property(CtrStdWorld, ctr_build_string_from_cstring( "Gui" ), guiObject, CTR_CATEGORY_PUBLIC_PROPERTY); +} diff --git a/plugins/gui/i18n/de/gui.h b/plugins/gui/i18n/de/gui.h new file mode 100644 index 00000000..10e83ad4 --- /dev/null +++ b/plugins/gui/i18n/de/gui.h @@ -0,0 +1,3 @@ +#define CTR_DICT_GUI_PLUGIN_ID "_GUI" +#define CTR_DICT_XML_NAME_AT_SET "xml:name:um:" + diff --git a/plugins/gui/i18n/en/gui.h b/plugins/gui/i18n/en/gui.h new file mode 100644 index 00000000..8bc1333f --- /dev/null +++ b/plugins/gui/i18n/en/gui.h @@ -0,0 +1,2 @@ +#define CTR_DICT_GUI_PLUGIN_ID "_GUI" +#define CTR_DICT_XML_NAME_AT_SET "xml:name:at:" \ No newline at end of file diff --git a/plugins/gui/i18n/es/gui.h b/plugins/gui/i18n/es/gui.h new file mode 100644 index 00000000..e74bcf4a --- /dev/null +++ b/plugins/gui/i18n/es/gui.h @@ -0,0 +1,3 @@ +#define CTR_DICT_GUI_PLUGIN_ID "_GUI" +#define CTR_DICT_XML_NAME_AT_SET "xml:nombre:en:" + diff --git a/plugins/gui/i18n/fr/gui.h b/plugins/gui/i18n/fr/gui.h new file mode 100644 index 00000000..929661d9 --- /dev/null +++ b/plugins/gui/i18n/fr/gui.h @@ -0,0 +1,3 @@ +#define CTR_DICT_GUI_PLUGIN_ID "_GUI" +#define CTR_DICT_XML_NAME_AT_SET "xml:nom:à:" + diff --git a/plugins/gui/i18n/nl/gui.h b/plugins/gui/i18n/nl/gui.h new file mode 100644 index 00000000..e2f7027c --- /dev/null +++ b/plugins/gui/i18n/nl/gui.h @@ -0,0 +1,2 @@ +#define CTR_DICT_GUI_PLUGIN_ID "_GUI" +#define CTR_DICT_XML_NAME_AT_SET "xml:naam:bij:" \ No newline at end of file diff --git a/plugins/gui/i18n/ru/gui.h b/plugins/gui/i18n/ru/gui.h new file mode 100644 index 00000000..c64ca1a3 --- /dev/null +++ b/plugins/gui/i18n/ru/gui.h @@ -0,0 +1,3 @@ +#define CTR_DICT_GUI_PLUGIN_ID "_GUI" +#define CTR_DICT_XML_NAME_AT_SET "xml:имя:в:" + diff --git a/plugins/gui/lv_conf.h b/plugins/gui/lv_conf.h new file mode 100644 index 00000000..8c16aa3d --- /dev/null +++ b/plugins/gui/lv_conf.h @@ -0,0 +1,1121 @@ +/** + * @file lv_conf.h + * Configuration file for v9.2.0 + */ + +/* + * Copy this file as `lv_conf.h` + * 1. simply next to the `lvgl` folder + * 2. or any other places and + * - define `LV_CONF_INCLUDE_SIMPLE` + * - add the path as include path + */ + +/* clang-format off */ +#if 1 /*Content enable*/ +#ifndef LV_CONF_H +#define LV_CONF_H + +/*If you need to include anything here, do it inside the `__ASSEMBLY__` guard */ +#if 0 && defined(__ASSEMBLY__) +#include "my_include.h" +#endif + +/*==================== + COLOR SETTINGS + *====================*/ + +/*Color depth: 1 (I1), 8 (L8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ +#define LV_COLOR_DEPTH 32 + +/*========================= + STDLIB WRAPPER SETTINGS + *=========================*/ + +/* Possible values + * - LV_STDLIB_BUILTIN: LVGL's built in implementation + * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc + * - LV_STDLIB_MICROPYTHON: MicroPython implementation + * - LV_STDLIB_RTTHREAD: RT-Thread implementation + * - LV_STDLIB_CUSTOM: Implement the functions externally + */ +#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN +#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN +#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN + +#define LV_STDINT_INCLUDE +#define LV_STDDEF_INCLUDE +#define LV_STDBOOL_INCLUDE +#define LV_INTTYPES_INCLUDE +#define LV_LIMITS_INCLUDE +#define LV_STDARG_INCLUDE + +#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN + /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ + #define LV_MEM_SIZE (1024 * 1024 * 1) + + /*Size of the memory expand for `lv_malloc()` in bytes*/ + #define LV_MEM_POOL_EXPAND_SIZE 0 + + /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ + #define LV_MEM_ADR 0 /*0: unused*/ + /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ + #if LV_MEM_ADR == 0 + #undef LV_MEM_POOL_INCLUDE + #undef LV_MEM_POOL_ALLOC + #endif +#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ + +/*==================== + HAL SETTINGS + *====================*/ + +/*Default display refresh, input device read and animation step period.*/ +#define LV_DEF_REFR_PERIOD 33 /*[ms]*/ + +/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. + *(Not so important, you can adjust it to modify default sizes and spaces)*/ +#define LV_DPI_DEF 130 /*[px/inch]*/ + +/*================= + * OPERATING SYSTEM + *=================*/ +/*Select an operating system to use. Possible options: + * - LV_OS_NONE + * - LV_OS_PTHREAD + * - LV_OS_FREERTOS + * - LV_OS_CMSIS_RTOS2 + * - LV_OS_RTTHREAD + * - LV_OS_WINDOWS + * - LV_OS_MQX + * - LV_OS_CUSTOM */ +#define LV_USE_OS LV_OS_NONE + +#if LV_USE_OS == LV_OS_CUSTOM + #define LV_OS_CUSTOM_INCLUDE +#endif + +/*======================== + * RENDERING CONFIGURATION + *========================*/ + +/*Align the stride of all layers and images to this bytes*/ +#define LV_DRAW_BUF_STRIDE_ALIGN 1 + +/*Align the start address of draw_buf addresses to this bytes*/ +#define LV_DRAW_BUF_ALIGN 4 + +/*Using matrix for transformations. + *Requirements: + `LV_USE_MATRIX = 1`. + The rendering engine needs to support 3x3 matrix transformations.*/ +#define LV_DRAW_TRANSFORM_USE_MATRIX 0 + +/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode + * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. + * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers + * and can't be drawn in chunks. */ + +/*The target buffer size for simple layer chunks.*/ +#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ + +/* The stack size of the drawing thread. + * NOTE: If FreeType or ThorVG is enabled, it is recommended to set it to 32KB or more. + */ +#define LV_DRAW_THREAD_STACK_SIZE (8 * 1024) /*[bytes]*/ + +#define LV_USE_DRAW_SW 1 +#if LV_USE_DRAW_SW == 1 + + /* + * Selectively disable color format support in order to reduce code size. + * NOTE: some features use certain color formats internally, e.g. + * - gradients use RGB888 + * - bitmaps with transparency may use ARGB8888 + */ + + #define LV_DRAW_SW_SUPPORT_RGB565 1 + #define LV_DRAW_SW_SUPPORT_RGB565A8 1 + #define LV_DRAW_SW_SUPPORT_RGB888 1 + #define LV_DRAW_SW_SUPPORT_XRGB8888 1 + #define LV_DRAW_SW_SUPPORT_ARGB8888 1 + #define LV_DRAW_SW_SUPPORT_L8 1 + #define LV_DRAW_SW_SUPPORT_AL88 1 + #define LV_DRAW_SW_SUPPORT_A8 1 + #define LV_DRAW_SW_SUPPORT_I1 1 + + /* Set the number of draw unit. + * > 1 requires an operating system enabled in `LV_USE_OS` + * > 1 means multiple threads will render the screen in parallel */ + #define LV_DRAW_SW_DRAW_UNIT_CNT 1 + + /* Use Arm-2D to accelerate the sw render */ + #define LV_USE_DRAW_ARM2D_SYNC 0 + + /* Enable native helium assembly to be compiled */ + #define LV_USE_NATIVE_HELIUM_ASM 0 + + /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only + * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ + #define LV_DRAW_SW_COMPLEX 1 + + #if LV_DRAW_SW_COMPLEX == 1 + /*Allow buffering some shadow calculation. + *LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/ + #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 + + /* Set number of maximally cached circle data. + * The circumference of 1/4 circle are saved for anti-aliasing + * radius * 4 bytes are used per circle (the most often used radiuses are saved) + * 0: to disable caching */ + #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 + #endif + + #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE + + #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM + #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" + #endif + + /* Enable drawing complex gradients in software: linear at an angle, radial or conical */ + #define LV_USE_DRAW_SW_COMPLEX_GRADIENTS 1 +#endif + +/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */ +#define LV_USE_DRAW_VGLITE 0 + +#if LV_USE_DRAW_VGLITE + /* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ + #define LV_USE_VGLITE_BLIT_SPLIT 0 + + #if LV_USE_OS + /* Use additional draw thread for VG-Lite processing.*/ + #define LV_USE_VGLITE_DRAW_THREAD 1 + + #if LV_USE_VGLITE_DRAW_THREAD + /* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ + #define LV_USE_VGLITE_DRAW_ASYNC 1 + #endif + #endif + + /* Enable VGLite asserts. */ + #define LV_USE_VGLITE_ASSERT 0 +#endif + +/* Use NXP's PXP on iMX RTxxx platforms. */ +#define LV_USE_DRAW_PXP 0 + +#if LV_USE_DRAW_PXP + #if LV_USE_OS + /* Use additional draw thread for PXP processing.*/ + #define LV_USE_PXP_DRAW_THREAD 1 + #endif + + /* Enable PXP asserts. */ + #define LV_USE_PXP_ASSERT 0 +#endif + +/* Use Renesas Dave2D on RA platforms. */ +#define LV_USE_DRAW_DAVE2D 0 + +/* Draw using cached SDL textures*/ +#define LV_USE_DRAW_SDL 0 + +/* Use VG-Lite GPU. */ +#define LV_USE_DRAW_VG_LITE 0 + +#if LV_USE_DRAW_VG_LITE + /* Enable VG-Lite custom external 'gpu_init()' function */ + #define LV_VG_LITE_USE_GPU_INIT 0 + + /* Enable VG-Lite assert. */ + #define LV_VG_LITE_USE_ASSERT 0 + + /* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */ + #define LV_VG_LITE_FLUSH_MAX_COUNT 8 + + /* Enable border to simulate shadow + * NOTE: which usually improves performance, + * but does not guarantee the same rendering quality as the software. */ + #define LV_VG_LITE_USE_BOX_SHADOW 0 + + /* VG-Lite gradient maximum cache number. + * NOTE: The memory usage of a single gradient image is 4K bytes. + */ + #define LV_VG_LITE_GRAD_CACHE_CNT 32 + + /* VG-Lite stroke maximum cache number. + */ + #define LV_VG_LITE_STROKE_CACHE_CNT 32 + +#endif + +/*======================= + * FEATURE CONFIGURATION + *=======================*/ + +/*------------- + * Logging + *-----------*/ + +/*Enable the log module*/ +#define LV_USE_LOG 1 +#if LV_USE_LOG + + /*How important log should be added: + *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information + *LV_LOG_LEVEL_INFO Log important events + *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem + *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail + *LV_LOG_LEVEL_USER Only logs added by the user + *LV_LOG_LEVEL_NONE Do not log anything*/ + #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN + + /*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ + #define LV_LOG_PRINTF 1 + + /*Set callback to print the logs. + *E.g `my_print`. The prototype should be `void my_print(lv_log_level_t level, const char * buf)` + *Can be overwritten by `lv_log_register_print_cb`*/ + //#define LV_LOG_PRINT_CB + + /*1: Enable print timestamp; + *0: Disable print timestamp*/ + #define LV_LOG_USE_TIMESTAMP 1 + + /*1: Print file and line number of the log; + *0: Do not print file and line number of the log*/ + #define LV_LOG_USE_FILE_LINE 1 + + + /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ + #define LV_LOG_TRACE_MEM 1 + #define LV_LOG_TRACE_TIMER 1 + #define LV_LOG_TRACE_INDEV 1 + #define LV_LOG_TRACE_DISP_REFR 1 + #define LV_LOG_TRACE_EVENT 1 + #define LV_LOG_TRACE_OBJ_CREATE 1 + #define LV_LOG_TRACE_LAYOUT 1 + #define LV_LOG_TRACE_ANIM 1 + #define LV_LOG_TRACE_CACHE 1 + +#endif /*LV_USE_LOG*/ + +/*------------- + * Asserts + *-----------*/ + +/*Enable asserts if an operation is failed or an invalid data is found. + *If LV_USE_LOG is enabled an error message will be printed on failure*/ +#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ +#define LV_USE_ASSERT_STYLE 1 +#define LV_USE_ASSERT_MEM_INTEGRITY 1 +#define LV_USE_ASSERT_OBJ 1 + +/*Add a custom handler when assert happens e.g. to restart the MCU*/ +#define LV_ASSERT_HANDLER_INCLUDE +#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ + +/*------------- + * Debug + *-----------*/ + +/*1: Draw random colored rectangles over the redrawn areas*/ +#define LV_USE_REFR_DEBUG 0 + +/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/ +#define LV_USE_LAYER_DEBUG 0 + +/*1: Draw overlays with different colors for each draw_unit's tasks. + *Also add the index number of the draw unit on white background. + *For layers add the index number of the draw unit on black background.*/ +#define LV_USE_PARALLEL_DRAW_DEBUG 0 + +/*------------- + * Others + *-----------*/ + +#define LV_ENABLE_GLOBAL_CUSTOM 0 +#if LV_ENABLE_GLOBAL_CUSTOM + /*Header to include for the custom 'lv_global' function"*/ + #define LV_GLOBAL_CUSTOM_INCLUDE +#endif + +/*Default cache size in bytes. + *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. + *If size is not set to 0, the decoder will fail to decode when the cache is full. + *If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/ +#define LV_CACHE_DEF_SIZE 0 + +/*Default number of image header cache entries. The cache is used to store the headers of images + *The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/ +#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0 + +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#define LV_GRADIENT_MAX_STOPS 2 + +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#define LV_COLOR_MIX_ROUND_OFS 0 + +/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */ +#define LV_OBJ_STYLE_CACHE 1 + +/* Add `id` field to `lv_obj_t` */ +#define LV_USE_OBJ_ID 1 + +/* Automatically assign an ID when obj is created */ +#define LV_OBJ_ID_AUTO_ASSIGN 0 + +/*Use the builtin obj ID handler functions: +* - lv_obj_assign_id: Called when a widget is created. Use a separate counter for each widget class as an ID. +* - lv_obj_id_compare: Compare the ID to decide if it matches with a requested value. +* - lv_obj_stringify_id: Return e.g. "button3" +* - lv_obj_free_id: Does nothing, as there is no memory allocation for the ID. +* When disabled these functions needs to be implemented by the user.*/ +#define LV_USE_OBJ_ID_BUILTIN 1 + +/*Use obj property set/get API*/ +#define LV_USE_OBJ_PROPERTY 0 + +/*Enable property name support*/ +#define LV_USE_OBJ_PROPERTY_NAME 1 + +/* VG-Lite Simulator */ +/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */ +#define LV_USE_VG_LITE_THORVG 0 + +#if LV_USE_VG_LITE_THORVG + + /*Enable LVGL's blend mode support*/ + #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0 + + /*Enable YUV color format support*/ + #define LV_VG_LITE_THORVG_YUV_SUPPORT 0 + + /*Enable Linear gradient extension support*/ + #define LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT 0 + + /*Enable 16 pixels alignment*/ + #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1 + + /*Buffer address alignment*/ + #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64 + + /*Enable multi-thread render*/ + #define LV_VG_LITE_THORVG_THREAD_RENDER 0 + +#endif + +/*===================== + * COMPILER SETTINGS + *====================*/ + +/*For big endian systems set to 1*/ +#define LV_BIG_ENDIAN_SYSTEM 0 + +/*Define a custom attribute to `lv_tick_inc` function*/ +#define LV_ATTRIBUTE_TICK_INC + +/*Define a custom attribute to `lv_timer_handler` function*/ +#define LV_ATTRIBUTE_TIMER_HANDLER + +/*Define a custom attribute to `lv_display_flush_ready` function*/ +#define LV_ATTRIBUTE_FLUSH_READY + +/*Required alignment size for buffers*/ +#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 + +/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). + * E.g. __attribute__((aligned(4)))*/ +#define LV_ATTRIBUTE_MEM_ALIGN + +/*Attribute to mark large constant arrays for example font's bitmaps*/ +#define LV_ATTRIBUTE_LARGE_CONST + +/*Compiler prefix for a big array declaration in RAM*/ +#define LV_ATTRIBUTE_LARGE_RAM_ARRAY + +/*Place performance critical functions into a faster memory (e.g RAM)*/ +#define LV_ATTRIBUTE_FAST_MEM + +/*Export integer constant to binding. This macro is used with constants in the form of LV_ that + *should also appear on LVGL binding API such as MicroPython.*/ +#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ + +/*Prefix all global extern data with this*/ +#define LV_ATTRIBUTE_EXTERN_DATA + +/* Use `float` as `lv_value_precise_t` */ +#define LV_USE_FLOAT 1 + +/*Enable matrix support + *Requires `LV_USE_FLOAT = 1`*/ +#define LV_USE_MATRIX 1 + +/*Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default*/ +#define LV_USE_PRIVATE_API 0 + +/*================== + * FONT USAGE + *===================*/ + +/*Montserrat fonts with ASCII range and some symbols using bpp = 4 + *https://fonts.google.com/specimen/Montserrat*/ +#define LV_FONT_MONTSERRAT_8 0 +#define LV_FONT_MONTSERRAT_10 0 +#define LV_FONT_MONTSERRAT_12 1 +#define LV_FONT_MONTSERRAT_14 1 +#define LV_FONT_MONTSERRAT_16 1 +#define LV_FONT_MONTSERRAT_18 1 +#define LV_FONT_MONTSERRAT_20 1 +#define LV_FONT_MONTSERRAT_22 1 +#define LV_FONT_MONTSERRAT_24 1 +#define LV_FONT_MONTSERRAT_26 1 +#define LV_FONT_MONTSERRAT_28 1 +#define LV_FONT_MONTSERRAT_30 1 +#define LV_FONT_MONTSERRAT_32 1 +#define LV_FONT_MONTSERRAT_34 1 +#define LV_FONT_MONTSERRAT_36 1 +#define LV_FONT_MONTSERRAT_38 1 +#define LV_FONT_MONTSERRAT_40 1 +#define LV_FONT_MONTSERRAT_42 1 +#define LV_FONT_MONTSERRAT_44 1 +#define LV_FONT_MONTSERRAT_46 1 +#define LV_FONT_MONTSERRAT_48 1 + +/*Demonstrate special features*/ +#define LV_FONT_MONTSERRAT_28_COMPRESSED 1 +#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 1 +#define LV_FONT_SIMSUN_14_CJK 0 /*1000 most common CJK radicals*/ +#define LV_FONT_SIMSUN_16_CJK 1 + +/*Pixel perfect monospace fonts*/ +#define LV_FONT_UNSCII_8 1 +#define LV_FONT_UNSCII_16 0 + +/*Optionally declare custom fonts here. + *You can use these fonts as default font too and they will be available globally. + *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ +#define LV_FONT_CUSTOM_DECLARE + +/*Always set a default font*/ +#define LV_FONT_DEFAULT &lv_font_montserrat_14 + +/*Enable handling large font and/or fonts with a lot of characters. + *The limit depends on the font size, font face and bpp. + *Compiler error will be triggered if a font needs it.*/ +#define LV_FONT_FMT_TXT_LARGE 0 + +/*Enables/disables support for compressed fonts.*/ +#define LV_USE_FONT_COMPRESSED 0 + +/*Enable drawing placeholders when glyph dsc is not found*/ +#define LV_USE_FONT_PLACEHOLDER 1 + +/*================= + * TEXT SETTINGS + *=================*/ + +/** + * Select a character encoding for strings. + * Your IDE or editor should have the same character encoding + * - LV_TXT_ENC_UTF8 + * - LV_TXT_ENC_ASCII + */ +#define LV_TXT_ENC LV_TXT_ENC_UTF8 + +/*Can break (wrap) texts on these chars*/ +#define LV_TXT_BREAK_CHARS " ,.;:-_)]}" + +/*If a word is at least this long, will break wherever "prettiest" + *To disable, set to a value <= 0*/ +#define LV_TXT_LINE_BREAK_LONG_LEN 0 + +/*Minimum number of characters in a long word to put on a line before a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 + +/*Minimum number of characters in a long word to put on a line after a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 + +/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. + *The direction will be processed according to the Unicode Bidirectional Algorithm: + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ +#define LV_USE_BIDI 0 +#if LV_USE_BIDI + /*Set the default direction. Supported values: + *`LV_BASE_DIR_LTR` Left-to-Right + *`LV_BASE_DIR_RTL` Right-to-Left + *`LV_BASE_DIR_AUTO` detect texts base direction*/ + #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO +#endif + +/*Enable Arabic/Persian processing + *In these languages characters should be replaced with another form based on their position in the text*/ +#define LV_USE_ARABIC_PERSIAN_CHARS 0 + +/*================== + * WIDGETS + *================*/ + +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ + +#define LV_WIDGETS_HAS_DEFAULT_VALUE 1 + +#define LV_USE_ANIMIMG 1 + +#define LV_USE_ARC 1 + +#define LV_USE_BAR 1 + +#define LV_USE_BUTTON 1 + +#define LV_USE_BUTTONMATRIX 1 + +#define LV_USE_CALENDAR 1 +#if LV_USE_CALENDAR + #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 + #if LV_CALENDAR_WEEK_STARTS_MONDAY + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} + #endif + + #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + #define LV_USE_CALENDAR_HEADER_ARROW 1 + #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 + #define LV_USE_CALENDAR_CHINESE 0 +#endif /*LV_USE_CALENDAR*/ + +#define LV_USE_CANVAS 1 + +#define LV_USE_CHART 1 + +#define LV_USE_CHECKBOX 1 + +#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ + +#define LV_USE_IMAGE 1 /*Requires: lv_label*/ + +#define LV_USE_IMAGEBUTTON 1 + +#define LV_USE_KEYBOARD 1 + +#define LV_USE_LABEL 1 +#if LV_USE_LABEL + #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ + #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ + #define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/ +#endif + +#define LV_USE_LED 1 + +#define LV_USE_LINE 1 + +#define LV_USE_LIST 1 + +#define LV_USE_LOTTIE 0 + +#define LV_USE_MENU 1 + +#define LV_USE_MSGBOX 1 + +#define LV_USE_ROLLER 1 /*Requires: lv_label*/ + +#define LV_USE_SCALE 1 + +#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ + +#define LV_USE_SPAN 1 +#if LV_USE_SPAN + /*A line text can contain maximum num of span descriptor */ + #define LV_SPAN_SNIPPET_STACK_SIZE 64 +#endif + +#define LV_USE_SPINBOX 1 + +#define LV_USE_SPINNER 1 + +#define LV_USE_SWITCH 1 + +#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ +#if LV_USE_TEXTAREA != 0 + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ +#endif + +#define LV_USE_TABLE 1 + +#define LV_USE_TABVIEW 1 + +#define LV_USE_TILEVIEW 1 + +#define LV_USE_WIN 1 + +/*================== + * THEMES + *==================*/ + +/*A simple, impressive and very complete theme*/ +#define LV_USE_THEME_DEFAULT 1 +#if LV_USE_THEME_DEFAULT + + /*0: Light mode; 1: Dark mode*/ + #define LV_THEME_DEFAULT_DARK 0 + + /*1: Enable grow on press*/ + #define LV_THEME_DEFAULT_GROW 1 + + /*Default transition time in [ms]*/ + #define LV_THEME_DEFAULT_TRANSITION_TIME 80 +#endif /*LV_USE_THEME_DEFAULT*/ + +/*A very simple theme that is a good starting point for a custom theme*/ +#define LV_USE_THEME_SIMPLE 1 + +/*A theme designed for monochrome displays*/ +#define LV_USE_THEME_MONO 1 + +/*================== + * LAYOUTS + *==================*/ + +/*A layout similar to Flexbox in CSS.*/ +#define LV_USE_FLEX 1 + +/*A layout similar to Grid in CSS.*/ +#define LV_USE_GRID 1 + +/*==================== + * 3RD PARTS LIBRARIES + *====================*/ + +/*File system interfaces for common APIs */ + +/*Setting a default driver letter allows skipping the driver prefix in filepaths*/ +#define LV_FS_DEFAULT_DRIVE_LETTER '\0' + +/*API for fopen, fread, etc*/ +#define LV_USE_FS_STDIO 1 +#if LV_USE_FS_STDIO + #define LV_FS_STDIO_LETTER 'A' + #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for open, read, etc*/ +#define LV_USE_FS_POSIX 0 +#if LV_USE_FS_POSIX + #define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for CreateFile, ReadFile, etc*/ +#define LV_USE_FS_WIN32 0 +#if LV_USE_FS_WIN32 + #define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/ +#define LV_USE_FS_FATFS 0 +#if LV_USE_FS_FATFS + #define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for memory-mapped file access. */ +#define LV_USE_FS_MEMFS 0 +#if LV_USE_FS_MEMFS + #define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*API for LittleFs. */ +#define LV_USE_FS_LITTLEFS 0 +#if LV_USE_FS_LITTLEFS + #define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*API for Arduino LittleFs. */ +#define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0 +#if LV_USE_FS_ARDUINO_ESP_LITTLEFS + #define LV_FS_ARDUINO_ESP_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*API for Arduino Sd. */ +#define LV_USE_FS_ARDUINO_SD 0 +#if LV_USE_FS_ARDUINO_SD + #define LV_FS_ARDUINO_SD_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*LODEPNG decoder library*/ +#define LV_USE_LODEPNG 1 + +/*PNG decoder(libpng) library*/ +#define LV_USE_LIBPNG 0 + +/*BMP decoder library*/ +#define LV_USE_BMP 1 + +/* JPG + split JPG decoder library. + * Split JPG is a custom format optimized for embedded systems. */ +#define LV_USE_TJPGD 1 + +/* libjpeg-turbo decoder library. + * Supports complete JPEG specifications and high-performance JPEG decoding. */ +#define LV_USE_LIBJPEG_TURBO 0 + +/*GIF decoder library*/ +#define LV_USE_GIF 0 +#if LV_USE_GIF + /*GIF decoder accelerate*/ + #define LV_GIF_CACHE_DECODE_DATA 0 +#endif + + +/*Decode bin images to RAM*/ +#define LV_BIN_DECODER_RAM_LOAD 1 + +/*RLE decompress library*/ +#define LV_USE_RLE 1 + +/*QR code library*/ +#define LV_USE_QRCODE 1 + +/*Barcode code library*/ +#define LV_USE_BARCODE 1 + +/*FreeType library*/ +#define LV_USE_FREETYPE 0 +#if LV_USE_FREETYPE + /*Let FreeType to use LVGL memory and file porting*/ + #define LV_FREETYPE_USE_LVGL_PORT 0 + + /*Cache count of the glyphs in FreeType. It means the number of glyphs that can be cached. + *The higher the value, the more memory will be used.*/ + #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 +#endif + +/* Built-in TTF decoder */ +#define LV_USE_TINY_TTF 1 +#if LV_USE_TINY_TTF + /* Enable loading TTF data from files */ + #define LV_TINY_TTF_FILE_SUPPORT 0 + #define LV_TINY_TTF_CACHE_GLYPH_CNT 256 +#endif + +/*Rlottie library*/ +#define LV_USE_RLOTTIE 0 + +/*Enable Vector Graphic APIs + *Requires `LV_USE_MATRIX = 1`*/ +#define LV_USE_VECTOR_GRAPHIC 1 + +/* Enable ThorVG (vector graphics library) from the src/libs folder */ +#define LV_USE_THORVG_INTERNAL 0 + +/* Enable ThorVG by assuming that its installed and linked to the project */ +#define LV_USE_THORVG_EXTERNAL 0 + +/*Use lvgl built-in LZ4 lib*/ +#define LV_USE_LZ4_INTERNAL 1 + +/*Use external LZ4 library*/ +#define LV_USE_LZ4_EXTERNAL 0 + +/*FFmpeg library for image decoding and playing videos + *Supports all major image formats so do not enable other image decoder with it*/ +#define LV_USE_FFMPEG 0 +#if LV_USE_FFMPEG + /*Dump input information to stderr*/ + #define LV_FFMPEG_DUMP_FORMAT 0 +#endif + +/*================== + * OTHERS + *==================*/ + +/*1: Enable API to take snapshot for object*/ +#define LV_USE_SNAPSHOT 0 + +/*1: Enable system monitor component*/ +#define LV_USE_SYSMON 0 +#if LV_USE_SYSMON + /*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/ + #define LV_SYSMON_GET_IDLE lv_timer_get_idle + + /*1: Show CPU usage and FPS count + * Requires `LV_USE_SYSMON = 1`*/ + #define LV_USE_PERF_MONITOR 1 + #if LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT + + /*0: Displays performance data on the screen, 1: Prints performance data using log.*/ + #define LV_USE_PERF_MONITOR_LOG_MODE 0 + #endif + + /*1: Show the used memory and the memory fragmentation + * Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN` + * Requires `LV_USE_SYSMON = 1`*/ + #define LV_USE_MEM_MONITOR 0 + #if LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT + #endif + +#endif /*LV_USE_SYSMON*/ + +/*1: Enable the runtime performance profiler*/ +#define LV_USE_PROFILER 0 +#if LV_USE_PROFILER + /*1: Enable the built-in profiler*/ + #define LV_USE_PROFILER_BUILTIN 1 + #if LV_USE_PROFILER_BUILTIN + /*Default profiler trace buffer size*/ + #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/ + #endif + + /*Header to include for the profiler*/ + #define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h" + + /*Profiler start point function*/ + #define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN + + /*Profiler end point function*/ + #define LV_PROFILER_END LV_PROFILER_BUILTIN_END + + /*Profiler start point function with custom tag*/ + #define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG + + /*Profiler end point function with custom tag*/ + #define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG +#endif + +/*1: Enable Monkey test*/ +#define LV_USE_MONKEY 0 + +/*1: Enable grid navigation*/ +#define LV_USE_GRIDNAV 0 + +/*1: Enable lv_obj fragment*/ +#define LV_USE_FRAGMENT 0 + +/*1: Support using images as font in label or span widgets */ +#define LV_USE_IMGFONT 1 + +/*1: Enable an observer pattern implementation*/ +#define LV_USE_OBSERVER 1 + +/*1: Enable Pinyin input method*/ +/*Requires: lv_keyboard*/ +#define LV_USE_IME_PINYIN 0 +#if LV_USE_IME_PINYIN + /*1: Use default thesaurus*/ + /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesaurus*/ + #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 + /*Set the maximum number of candidate panels that can be displayed*/ + /*This needs to be adjusted according to the size of the screen*/ + #define LV_IME_PINYIN_CAND_TEXT_NUM 6 + + /*Use 9 key input(k9)*/ + #define LV_IME_PINYIN_USE_K9_MODE 1 + #if LV_IME_PINYIN_USE_K9_MODE == 1 + #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 + #endif /*LV_IME_PINYIN_USE_K9_MODE*/ +#endif + +/*1: Enable file explorer*/ +/*Requires: lv_table*/ +#define LV_USE_FILE_EXPLORER 0 +#if LV_USE_FILE_EXPLORER + /*Maximum length of path*/ + #define LV_FILE_EXPLORER_PATH_MAX_LEN (128) + /*Quick access bar, 1:use, 0:not use*/ + /*Requires: lv_list*/ + #define LV_FILE_EXPLORER_QUICK_ACCESS 1 +#endif + +/** Enable loading XML UIs runtime */ +#define LV_USE_XML 1 + +/*================== + * DEVICES + *==================*/ + +/*Use SDL to open window on PC and handle mouse and keyboard*/ +#define LV_USE_SDL 1 +#if LV_USE_SDL + #define LV_SDL_INCLUDE_PATH + #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/ + #define LV_SDL_BUF_COUNT 1 /*1 or 2*/ + #define LV_SDL_ACCELERATED 1 /*1: Use hardware acceleration*/ + #define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/ + #define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/ + #define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/ +#endif + +/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/ +#define LV_USE_X11 0 +#if LV_USE_X11 + #define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/ + #define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for rendering*/ + /*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/ + #define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/ + #define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/ + #define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/ +#endif + +/*Use Wayland to open a window and handle input on Linux or BSD desktops */ +#define LV_USE_WAYLAND 0 +#if LV_USE_WAYLAND + #define LV_WAYLAND_WINDOW_DECORATIONS 0 /*Draw client side window decorations only necessary on Mutter/GNOME*/ + #define LV_WAYLAND_WL_SHELL 0 /*Use the legacy wl_shell protocol instead of the default XDG shell*/ +#endif + +/*Driver for /dev/fb*/ +#define LV_USE_LINUX_FBDEV 0 +#if LV_USE_LINUX_FBDEV + #define LV_LINUX_FBDEV_BSD 0 + #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL + #define LV_LINUX_FBDEV_BUFFER_COUNT 0 + #define LV_LINUX_FBDEV_BUFFER_SIZE 60 +#endif + +/*Use Nuttx to open window and handle touchscreen*/ +#define LV_USE_NUTTX 0 + +#if LV_USE_NUTTX + #define LV_USE_NUTTX_LIBUV 0 + + /*Use Nuttx custom init API to open window and handle touchscreen*/ + #define LV_USE_NUTTX_CUSTOM_INIT 0 + + /*Driver for /dev/lcd*/ + #define LV_USE_NUTTX_LCD 0 + #if LV_USE_NUTTX_LCD + #define LV_NUTTX_LCD_BUFFER_COUNT 0 + #define LV_NUTTX_LCD_BUFFER_SIZE 60 + #endif + + /*Driver for /dev/input*/ + #define LV_USE_NUTTX_TOUCHSCREEN 0 + +#endif + +/*Driver for /dev/dri/card*/ +#define LV_USE_LINUX_DRM 0 + +/*Interface for TFT_eSPI*/ +#define LV_USE_TFT_ESPI 0 + +/*Driver for evdev input devices*/ +#define LV_USE_EVDEV 0 + +/*Driver for libinput input devices*/ +#define LV_USE_LIBINPUT 0 + +#if LV_USE_LIBINPUT + #define LV_LIBINPUT_BSD 0 + + /*Full keyboard support*/ + #define LV_LIBINPUT_XKB 0 + #if LV_LIBINPUT_XKB + /*"setxkbmap -query" can help find the right values for your keyboard*/ + #define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL } + #endif +#endif + +/*Drivers for LCD devices connected via SPI/parallel port*/ +#define LV_USE_ST7735 0 +#define LV_USE_ST7789 0 +#define LV_USE_ST7796 0 +#define LV_USE_ILI9341 0 + +#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) + +/*Driver for Renesas GLCD*/ +#define LV_USE_RENESAS_GLCDC 0 + +/* LVGL Windows backend */ +#define LV_USE_WINDOWS 0 + +/* Use OpenGL to open window on PC and handle mouse and keyboard */ +#define LV_USE_OPENGLES 0 +#if LV_USE_OPENGLES + #define LV_USE_OPENGLES_DEBUG 1 /* Enable or disable debug for opengles */ +#endif + +/* QNX Screen display and input drivers */ +#define LV_USE_QNX 0 +#if LV_USE_QNX + #define LV_QNX_BUF_COUNT 1 /*1 or 2*/ +#endif + +/*================== +* EXAMPLES +*==================*/ + +/*Enable the examples to be built with the library*/ +#define LV_BUILD_EXAMPLES 1 + +/*=================== + * DEMO USAGE + ====================*/ + +/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ +#define LV_USE_DEMO_WIDGETS 1 + +/*Demonstrate the usage of encoder and keyboard*/ +#define LV_USE_DEMO_KEYPAD_AND_ENCODER 1 + +/*Benchmark your system*/ +#define LV_USE_DEMO_BENCHMARK 1 + +/*Render test for each primitives. Requires at least 480x272 display*/ +#define LV_USE_DEMO_RENDER 1 + +/*Stress test for LVGL*/ +#define LV_USE_DEMO_STRESS 1 + +/*Music player demo*/ +#define LV_USE_DEMO_MUSIC 1 +#if LV_USE_DEMO_MUSIC + #define LV_DEMO_MUSIC_SQUARE 0 + #define LV_DEMO_MUSIC_LANDSCAPE 0 + #define LV_DEMO_MUSIC_ROUND 0 + #define LV_DEMO_MUSIC_LARGE 0 + #define LV_DEMO_MUSIC_AUTO_PLAY 0 +#endif + +/*Flex layout demo*/ +#define LV_USE_DEMO_FLEX_LAYOUT 1 + +/*Smart-phone like multi-language demo*/ +#define LV_USE_DEMO_MULTILANG 1 + +/*Widget transformation demo*/ +#define LV_USE_DEMO_TRANSFORM 1 + +/*Demonstrate scroll settings*/ +#define LV_USE_DEMO_SCROLL 1 + +/*Vector graphic demo*/ +#define LV_USE_DEMO_VECTOR_GRAPHIC 1 + +/*E-bike demo with Lottie animations (if LV_USE_LOTTIE is enabled)*/ +#define LV_USE_DEMO_EBIKE 0 +#if LV_USE_DEMO_EBIKE + #define LV_DEMO_EBIKE_PORTRAIT 0 /*0: for 480x270..480x320, 1: for 480x800..720x1280*/ +#endif + +/*--END OF LV_CONF_H--*/ + +#endif /*LV_CONF_H*/ + +#endif /*End of "Content enable"*/ diff --git a/plugins/gui/makefile b/plugins/gui/makefile new file mode 100644 index 00000000..3ae594b5 --- /dev/null +++ b/plugins/gui/makefile @@ -0,0 +1,73 @@ +# +# Makefile +# +CC ?= gcc +LVGL_DIR_NAME ?= lvgl +LVGL_DIR ?= . + +WARNINGS ?= -Wall -Wshadow -Wundef -Wno-discarded-qualifiers -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith \ + -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits \ + -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security \ + -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body \ + -Wshift-negative-value -Wstack-usage=2048 -Wno-unused-value -std=gnu99 +CFLAGS ?= -shared -O3 -g0 -I ./i18n/${ISO}/ -I ../../i18n/${ISO} -I ../media/i18n/${ISO} -I$(LVGL_DIR)/ $(WARNINGS) -fPIC +CXXFLAGS ?= -fPIC +LDFLAGS = -lSDL2 -lm -shared +BIN = ../../../../mods/gui/libctrgui.so +BUILD_DIR = ./build +BUILD_OBJ_DIR = $(BUILD_DIR)/obj +BUILD_BIN_DIR = $(BUILD_DIR)/bin + +prefix ?= /usr +bindir ?= $(prefix)/bin + +#Collect the files to compile +MAINSRC = ./gui.c + +include $(LVGL_DIR)/lvgl/lvgl.mk +CSRCS +=$(LVGL_DIR)/mouse_cursor_icon.c +OBJEXT ?= .o + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cpp=$(OBJEXT)) + +MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) $(MAINOBJ) +TARGET = $(addprefix $(BUILD_OBJ_DIR)/, $(patsubst ./%, %, $(OBJS))) + + +## MAINOBJ -> OBJFILES +all: default + +$(BUILD_OBJ_DIR)/%.o: %.cpp + @mkdir -p $(dir $@) + @$(CXX) $(CXXFLAGS) -c $< -o $@ + @echo "CXX $<" + +$(BUILD_OBJ_DIR)/%.o: %.c + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) -c $< -o $@ + @echo "CC $<" + +$(BUILD_OBJ_DIR)/%.o: %.S + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) -c $< -o $@ + @echo "CC $<" + + +default: $(TARGET) + @mkdir -p $(dir $(BUILD_BIN_DIR)/) + $(CXX) -o $(BUILD_BIN_DIR)/$(BIN) $(TARGET) $(LDFLAGS) + +clean: + rm -rf $(BUILD_DIR) + +install: + install -d $(DESTDIR)$(bindir) + install $(BUILD_BIN_DIR)/$(BIN) $(DESTDIR)$(bindir) + +uninstall: + $(RM) -r $(addprefix $(DESTDIR)$(bindir)/,$(BIN)) diff --git a/plugins/gui/makefile.win64 b/plugins/gui/makefile.win64 new file mode 100644 index 00000000..ecc8747d --- /dev/null +++ b/plugins/gui/makefile.win64 @@ -0,0 +1,96 @@ +#Usage: ISO=... CC=x86_64-w64-mingw32-gcc-8.3-win32 DLLTOOL=x86_64-w64-mingw32-dlltool make -f makefile.win64 +#LDFLAGS= -shared +#CFLAGS= -D WIN \ +# -D REPLACE_MEDIA_SOCK -D WINDOWS_MEDIA_SOCK +#all:libctrmedia.dll +#install-libctrmedia.dll: libctrmedia.dll +#install libctrmedia.dll ../../mods/media/ +# +#libctrmedia.dll: media.o +# $(CC) ${LDFLAGS} media.o -lffi -lcurl -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf ../../ctr${ISO}import.lib -o libctrmedia.dll +# +#media.o: +# $(CC) ${CFLAGS} -D SDL -D LIBCURL -D FFI $(EXTRACFLAGS) -I /usr/x86_64-w64-mingw32/include -I /usr/include/SDL2 -I ../../i18n/${ISO} -I i18n/${ISO} -c media.c -Wall -Werror -fPIC -o media.o +# +#clean: +# rm media.o + + +CC = x86_64-w64-mingw32-gcc-win32 +CXX = x86_64-w64-mingw32-g++ + +LVGL_DIR_NAME ?= lvgl +LVGL_DIR ?= . + +WARNINGS ?= -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith \ + -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits \ + -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security \ + -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body \ + -Wshift-negative-value -Wstack-usage=2048 -Wno-unused-value -std=gnu99 +CFLAGS ?= -D WIN -shared -O3 -g0 -I ./i18n/${ISO}/ -I ../../i18n/${ISO} -I ../media/i18n/${ISO} -I$(LVGL_DIR)/ $(WARNINGS) -fPIC +CXXFLAGS ?= -fPIC +LDFLAGS = -lSDL2 -lm -shared +BIN = ../../../../mods/gui/libctrgui.dll +BUILD_DIR = ./build +BUILD_OBJ_DIR = $(BUILD_DIR)/obj +BUILD_BIN_DIR = $(BUILD_DIR)/bin + +prefix ?= /usr +bindir ?= $(prefix)/bin + +#Collect the files to compile +MAINSRC = ./gui.c + +include $(LVGL_DIR)/lvgl/lvgl.mk +CSRCS +=$(LVGL_DIR)/mouse_cursor_icon.c + + + +OBJEXT ?= .o + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cpp=$(OBJEXT)) + + +MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) $(MAINOBJ) +TARGET = $(addprefix $(BUILD_OBJ_DIR)/, $(patsubst ./%, %, $(OBJS))) + + +## MAINOBJ -> OBJFILES + + +all: default + +$(BUILD_OBJ_DIR)/%.o: %.cpp + @mkdir -p $(dir $@) + @$(CXX) $(CXXFLAGS) -c $< -o $@ + @echo "CXX $<" + +$(BUILD_OBJ_DIR)/%.o: %.c + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) -c $< -o $@ + @echo "CC $<" + +$(BUILD_OBJ_DIR)/%.o: %.S + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) -c $< -o $@ + @echo "CC $<" + + +default: $(TARGET) + @mkdir -p $(dir $(BUILD_BIN_DIR)/) + $(CC) -o $(BUILD_BIN_DIR)/$(BIN) $(TARGET) $(LDFLAGS) ../../ctr${ISO}import.lib + +clean: + rm -rf $(BUILD_DIR) + +install: + install -d $(DESTDIR)$(bindir) + install $(BUILD_BIN_DIR)/$(BIN) $(DESTDIR)$(bindir) + +uninstall: + $(RM) -r $(addprefix $(DESTDIR)$(bindir)/,$(BIN)) diff --git a/plugins/gui/mouse_cursor_icon.c b/plugins/gui/mouse_cursor_icon.c new file mode 100644 index 00000000..ef1ab26b --- /dev/null +++ b/plugins/gui/mouse_cursor_icon.c @@ -0,0 +1,33 @@ +#include "lvgl/lvgl.h" + +const uint8_t mouse_cursor_icon_map[] = { + 0x19, 0x19, 0x19, 0xb8, 0x1e, 0x1e, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x48, 0x48, 0x48, 0xcc, 0xb2, 0xb2, 0xb2, 0xff, 0x3a, 0x3a, 0x3a, 0xcc, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x3b, 0x3b, 0xc8, 0xf6, 0xf6, 0xf6, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0x43, 0x43, 0x43, 0xe0, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x3b, 0x3b, 0xcb, 0xe6, 0xe6, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xe5, 0xe5, 0xe5, 0xff, 0x59, 0x59, 0x59, 0xf3, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x3c, 0x3c, 0xcb, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xf5, 0xf5, 0xff, 0x72, 0x72, 0x72, 0xff, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3d, 0x3d, 0x3d, 0xcb, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8a, 0x8a, 0x8a, 0xff, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x99, 0x99, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x3e, 0x3e, 0xcb, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa2, 0xa2, 0xa2, 0xff, 0x13, 0x13, 0x13, 0xab, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0x3f, 0x3f, 0xcb, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb7, 0xb7, 0xb7, 0xff, 0x1f, 0x1f, 0x1f, 0xbb, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x41, 0x41, 0x41, 0xcc, 0xea, 0xea, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0xca, 0xca, 0xff, 0x3d, 0x3d, 0x3d, 0xd8, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x41, 0x41, 0x41, 0xcc, 0xea, 0xea, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xde, 0xde, 0xde, 0xff, 0x56, 0x56, 0x56, 0xef, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, + 0x42, 0x42, 0x42, 0xcc, 0xea, 0xea, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xf3, 0xf3, 0xff, 0x76, 0x76, 0x76, 0xff, 0x00, 0x00, 0x00, 0x6b, + 0x43, 0x43, 0x43, 0xcc, 0xea, 0xea, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xce, 0xce, 0xff, 0x80, 0x80, 0x80, 0xf7, 0x74, 0x74, 0x74, 0xf8, 0x6d, 0x6d, 0x6d, 0xfb, 0x72, 0x72, 0x72, 0xf8, 0x57, 0x57, 0x57, 0xff, 0x0c, 0x0c, 0x0c, 0xb3, + 0x44, 0x44, 0x44, 0xcc, 0xeb, 0xeb, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfb, 0xfb, 0xfb, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0xc9, 0xc9, 0xff, 0x13, 0x13, 0x13, 0xb7, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x0c, 0x29, 0x29, 0x29, 0x07, + 0x45, 0x45, 0x45, 0xcc, 0xe8, 0xe8, 0xe8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd9, 0xd9, 0xd9, 0xff, 0x5e, 0x5e, 0x5e, 0xff, 0xe2, 0xe2, 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x62, 0x62, 0x62, 0xf0, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x45, 0x45, 0x45, 0xcc, 0xf9, 0xf9, 0xf9, 0xff, 0xec, 0xec, 0xec, 0xff, 0x4a, 0x4a, 0x4a, 0xd8, 0x00, 0x00, 0x00, 0x78, 0x8a, 0x8a, 0x8a, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc3, 0xc3, 0xff, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x58, 0x58, 0xd3, 0xd9, 0xd9, 0xd9, 0xff, 0x5e, 0x5e, 0x5e, 0xef, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x3b, 0x3b, 0xc7, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0xf4, 0xf4, 0xff, 0x54, 0x54, 0x54, 0xdc, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x3e, 0x3e, 0xe0, 0x54, 0x54, 0x54, 0xff, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x8e, 0x8e, 0x8e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0xb0, 0xb0, 0xff, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x4c, 0x4c, 0x4c, 0xd0, 0xec, 0xec, 0xec, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf4, 0xf4, 0xf4, 0xff, 0x53, 0x53, 0x53, 0xd8, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xab, 0xab, 0xab, 0xff, 0xf6, 0xf6, 0xf6, 0xff, 0x80, 0x80, 0x80, 0xff, 0x31, 0x31, 0x31, 0xac, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x09, 0x09, 0x09, 0x03, 0x02, 0x02, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x2e, 0x2e, 0x2e, 0xd7, 0x38, 0x38, 0x38, 0xc7, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +lv_image_dsc_t mouse_cursor_icon = { + .header.magic = LV_IMAGE_HEADER_MAGIC, + .header.w = 14, + .header.h = 20, + .data_size = 280 * 4, + .header.cf = LV_COLOR_FORMAT_ARGB8888, + .data = mouse_cursor_icon_map, +};