demo工程暂存 优化菜单界面UI和功能
This commit is contained in:
2455
Demo/lvgl/scripts/Doxyfile
Normal file
2455
Demo/lvgl/scripts/Doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
20
Demo/lvgl/scripts/build_html_examples.sh
Normal file
20
Demo/lvgl/scripts/build_html_examples.sh
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
CURRENT_REF="$(git rev-parse HEAD)"
|
||||
rm -rf emscripten_builder
|
||||
git clone https://github.com/lvgl/lv_sim_emscripten.git emscripten_builder
|
||||
scripts/genexamplelist.sh > emscripten_builder/examplelist.c
|
||||
cd emscripten_builder
|
||||
git submodule update --init -- lvgl
|
||||
cd lvgl
|
||||
git checkout $CURRENT_REF
|
||||
cd ..
|
||||
git submodule update --init -- lv_drivers
|
||||
mkdir cmbuild
|
||||
cd cmbuild
|
||||
emcmake cmake .. -DLVGL_CHOSEN_DEMO=lv_example_noop -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
emmake make -j$(nproc)
|
||||
rm -rf CMakeFiles
|
||||
cd ../..
|
||||
cp -a emscripten_builder/cmbuild docs/_static/built_lv_examples
|
BIN
Demo/lvgl/scripts/built_in_font/DejaVuSans.ttf
Normal file
BIN
Demo/lvgl/scripts/built_in_font/DejaVuSans.ttf
Normal file
Binary file not shown.
Binary file not shown.
BIN
Demo/lvgl/scripts/built_in_font/Montserrat-Medium.ttf
Normal file
BIN
Demo/lvgl/scripts/built_in_font/Montserrat-Medium.ttf
Normal file
Binary file not shown.
BIN
Demo/lvgl/scripts/built_in_font/SimSun.woff
Normal file
BIN
Demo/lvgl/scripts/built_in_font/SimSun.woff
Normal file
Binary file not shown.
63
Demo/lvgl/scripts/built_in_font/built_in_font_gen.py
Normal file
63
Demo/lvgl/scripts/built_in_font/built_in_font_gen.py
Normal file
@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python3.6
|
||||
|
||||
import argparse
|
||||
from argparse import RawTextHelpFormatter
|
||||
import os
|
||||
import sys
|
||||
|
||||
parser = argparse.ArgumentParser(description="""Create fonts for LittelvGL including the built-in symbols. lv_font_conv needs to be installed. See https://github.com/littlevgl/lv_font_conv
|
||||
Example: python built_in_font_gen.py --size 16 -o lv_font_roboto_16.c --bpp 4 -r 0x20-0x7F""", formatter_class=RawTextHelpFormatter)
|
||||
parser.add_argument('-s', '--size',
|
||||
type=int,
|
||||
metavar = 'px',
|
||||
nargs='?',
|
||||
help='Size of the font in px')
|
||||
parser.add_argument('--bpp',
|
||||
type=int,
|
||||
metavar = '1,2,4',
|
||||
nargs='?',
|
||||
help='Bit per pixel')
|
||||
parser.add_argument('-r', '--range',
|
||||
nargs='+',
|
||||
metavar = 'start-end',
|
||||
default=['0x20-0x7F,0xB0,0x2022'],
|
||||
help='Ranges and/or characters to include. Default is 0x20-7F (ASCII). E.g. -r 0x20-0x7F, 0x200, 324')
|
||||
parser.add_argument('--symbols',
|
||||
nargs='+',
|
||||
metavar = 'sym',
|
||||
default=[''],
|
||||
help=u'Symbols to include. E.g. -s ÁÉŐ'.encode('utf-8'))
|
||||
parser.add_argument('--font',
|
||||
metavar = 'file',
|
||||
nargs='?',
|
||||
default='Montserrat-Medium.ttf',
|
||||
help='A TTF or WOFF file')
|
||||
parser.add_argument('-o', '--output',
|
||||
nargs='?',
|
||||
metavar='file',
|
||||
help='Output file name. E.g. my_font_20.c')
|
||||
parser.add_argument('--compressed', action='store_true',
|
||||
help='Compress the bitmaps')
|
||||
parser.add_argument('--subpx', action='store_true',
|
||||
help='3 times wider letters for sub pixel rendering')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.compressed == False:
|
||||
compr = "--no-compress --no-prefilter"
|
||||
else:
|
||||
compr = ""
|
||||
|
||||
if len(args.symbols[0]) != 0:
|
||||
args.symbols[0] = "--symbols " + args.symbols[0]
|
||||
|
||||
subpx = ""
|
||||
if args.subpx: subpx = "--lcd"
|
||||
|
||||
|
||||
#Built in symbols
|
||||
syms = "61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61507,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61641,61664,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650"
|
||||
|
||||
#Run the command (Add degree and bbullet symbol)
|
||||
cmd = "lv_font_conv {} {} --bpp {} --size {} --font {} -r {} {} --font FontAwesome5-Solid+Brands+Regular.woff -r {} --format bin -o {} --force-fast-kern-format".format(subpx, compr, args.bpp, args.size, args.font, args.range[0], args.symbols[0], syms, args.output)
|
||||
os.system(cmd)
|
113
Demo/lvgl/scripts/built_in_font/generate_all.py
Normal file
113
Demo/lvgl/scripts/built_in_font/generate_all.py
Normal file
@ -0,0 +1,113 @@
|
||||
#!/usr/bin/env python3.6
|
||||
|
||||
import os
|
||||
|
||||
print("Generating 8 px")
|
||||
os.system("./built_in_font_gen.py --size 8 -o lv_font_montserrat_8.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_8.c')
|
||||
|
||||
print("\nGenerating 10 px")
|
||||
os.system("./built_in_font_gen.py --size 10 -o lv_font_montserrat_10.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_10.c')
|
||||
|
||||
print("\nGenerating 12 px")
|
||||
os.system("./built_in_font_gen.py --size 12 -o lv_font_montserrat_12.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_12.c')
|
||||
|
||||
print("\nGenerating 14 px")
|
||||
os.system("./built_in_font_gen.py --size 14 -o lv_font_montserrat_14.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_14.c')
|
||||
|
||||
print("\nGenerating 16 px")
|
||||
os.system("./built_in_font_gen.py --size 16 -o lv_font_montserrat_16.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_16.c')
|
||||
|
||||
print("\nGenerating 18 px")
|
||||
os.system("./built_in_font_gen.py --size 18 -o lv_font_montserrat_18.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_18.c')
|
||||
|
||||
print("\nGenerating 20 px")
|
||||
os.system("./built_in_font_gen.py --size 20 -o lv_font_montserrat_20.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_20.c')
|
||||
|
||||
print("\nGenerating 22 px")
|
||||
os.system("./built_in_font_gen.py --size 22 -o lv_font_montserrat_22.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_22.c')
|
||||
|
||||
print("\nGenerating 24 px")
|
||||
os.system("./built_in_font_gen.py --size 24 -o lv_font_montserrat_24.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_24.c')
|
||||
|
||||
print("\nGenerating 26 px")
|
||||
os.system("./built_in_font_gen.py --size 26 -o lv_font_montserrat_26.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_26.c')
|
||||
|
||||
print("\nGenerating 28 px")
|
||||
os.system("./built_in_font_gen.py --size 28 -o lv_font_montserrat_28.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_28.c')
|
||||
|
||||
print("\nGenerating 30 px")
|
||||
os.system("./built_in_font_gen.py --size 30 -o lv_font_montserrat_30.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_30.c')
|
||||
|
||||
print("\nGenerating 32 px")
|
||||
os.system("./built_in_font_gen.py --size 32 -o lv_font_montserrat_32.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_32.c')
|
||||
|
||||
print("\nGenerating 34 px")
|
||||
os.system("./built_in_font_gen.py --size 34 -o lv_font_montserrat_34.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_34.c')
|
||||
|
||||
print("\nGenerating 36 px")
|
||||
os.system("./built_in_font_gen.py --size 36 -o lv_font_montserrat_36.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_36.c')
|
||||
|
||||
print("\nGenerating 38 px")
|
||||
os.system("./built_in_font_gen.py --size 38 -o lv_font_montserrat_38.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_38.c')
|
||||
|
||||
print("\nGenerating 40 px")
|
||||
os.system("./built_in_font_gen.py --size 40 -o lv_font_montserrat_40.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_40.c')
|
||||
|
||||
print("\nGenerating 42 px")
|
||||
os.system("./built_in_font_gen.py --size 42 -o lv_font_montserrat_42.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_42.c')
|
||||
|
||||
print("\nGenerating 44 px")
|
||||
os.system("./built_in_font_gen.py --size 44 -o lv_font_montserrat_44.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_44.c')
|
||||
|
||||
print("\nGenerating 46 px")
|
||||
os.system("./built_in_font_gen.py --size 46 -o lv_font_montserrat_46.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_46.c')
|
||||
|
||||
print("\nGenerating 48 px")
|
||||
os.system("./built_in_font_gen.py --size 48 -o lv_font_montserrat_48.c --bpp 4")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_48.c')
|
||||
|
||||
print("\nGenerating 12 px subpx")
|
||||
os.system("./built_in_font_gen.py --size 12 -o lv_font_montserrat_12_subpx.c --bpp 4 --subpx")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_12_subpx.c')
|
||||
|
||||
print("\nGenerating 28 px compressed")
|
||||
os.system("./built_in_font_gen.py --size 28 -o lv_font_montserrat_28_compressed.c --bpp 4 --compressed")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_28_compressed.c')
|
||||
|
||||
print("\nGenerating 16 px CJK")
|
||||
os.system(u"./built_in_font_gen.py --size 16 -o lv_font_simsun_16_cjk.c --bpp 4 --font SimSun.woff -r 0x20-0x7f --symbols (),盗提陽帯鼻画輕ッ冊ェル写父ぁフ結想正四O夫源庭場天續鳥れ講猿苦階給了製守8祝己妳薄泣塩帰ぺ吃変輪那着仍嗯爭熱創味保字宿捨準查達肯ァ薬得査障該降察ね網加昼料等図邪秋コ態品屬久原殊候路願楽確針上被怕悲風份重歡っ附ぷ既4黨價娘朝凍僅際洋止右航よ专角應酸師個比則響健昇豐筆歷適修據細忙跟管長令家ザ期般花越ミ域泳通些油乏ラ。營ス返調農叫樹刊愛間包知把ヤ貧橋拡普聞前ジ建当繰ネ送習渇用補ィ覺體法遊宙ョ酔余利壊語くつ払皆時辺追奇そ們只胸械勝住全沈力光ん深溝二類北面社值試9和五勵ゃ貿幾逐打課ゲて領3鼓辦発評1渉詳暇込计駄供嘛郵頃腦反構絵お容規借身妻国慮剛急乗静必議置克土オ乎荷更肉還混古渡授合主離條値決季晴東大尚央州が嗎験流先医亦林田星晩拿60旅婦量為痛テ孫う環友況玩務其ぼち揺坐一肩腰犯タょ希即果ぶ物練待み高九找やヶ都グ去」サ、气仮雑酒許終企笑録形リ銀切ギ快問滿役単黄集森毎實研喜蘇司鉛洲川条媽ノ才兩話言雖媒出客づ卻現異故り誌逮同訊已視本題ぞを横開音第席費持眾怎選元退限ー賽処喝就残無いガ多ケ沒義遠歌隣錢某雪析嬉採自透き側員予ゼ白婚电へ顯呀始均畫似懸格車騒度わ親店週維億締慣免帳電甚來園浴ゅ愈京と杯各海怒ぜ排敗挙老買7極模実紀ヒ携隻告シ並屋這孩讓質ワブ富賃争康由辞マ火於短樣削弟材注節另室ダ招擁ぃ若套底波行勤關著泊背疲狭作念推ぐ民貸祖介說ビ代温契你我レ入描變再札ソ派頭智遅私聽舉灣山伸放直安ト誕煙付符幅ふ絡她届耳飲忘参革團仕様載ど歩獲嫌息の汚交興魚指資雙與館初学年幸史位柱族走括び考青也共腕Lで販擔理病イ今逃當寺猫邊菓係ム秘示解池影ド文例斷曾事茶寫明科桃藝売便え導禁財飛替而亡到し具空寝辛業ウ府セ國何基菜厳市努張缺雲根外だ断万砂ゴ超使台实ぽ礼最慧算軟界段律像夕丈窓助刻月夏政呼ぴざ擇趣除動従涼方勉名線対存請子氏將5少否諸論美感或西者定食御表は參歳緑命進易性錯房も捕皿判中觀戦ニ緩町ピ番ず金千ろ?不た象治関ャ每看徒卒統じ手範訪押座步号ベ旁以母すほ密減成往歲件緒読歯效院种七謂凝濃嵌震喉繼クュ拭死円2積水欲如ポにさ寒道區精啦姐ア聯能足及停思壓2春且メ裏株官答概黒過氷柿戻厚ぱ党祭織引計け委暗複誘港バ失下村較続神ぇ尤強秀膝兒来績十書済化服破新廠1紹您情半式產系好教暑早め樂地休協良な哪常要揮周かエ麗境働避護ンツ香夜太見設非改広聲他検求危清彼經未在起葉控靴所差內造寄南望尺換向展備眠點完約ぎ裡分説申童優伝島机須塊日立拉,鉄軽單気信很転識支布数紙此迎受心輸坊モ處「訳三曇兄野顔戰增ナ伊列又髪両有取左毛至困吧昔赤狀相夠整別士経頼然簡ホ会發隨営需脱ヨば接永居冬迫圍甘醫誰部充消連弱宇會咲覚姉麼的増首统帶糖朋術商担移景功育庫曲總劃牛程駅犬報ロ學責因パ嚴八世後平負公げ曜陸專午之閉ぬ談ご災昨冷職悪謝對它近射敢意運船臉局難什産頗!球真記ま但蔵究制機案湖臺ひ害券男留内木驗雨施種特復句末濟キ色訴依せ百型る石牠討呢时任執飯歐宅組傳配小活ゆべ暖ズ漸站素らボ束価チ浅回女片独妹英目從認生違策僕楚ペ米こ掛む爸六状落漢プ投カ校做啊洗声探あ割体項履触々訓技ハ低工映是標速善点人デ口次可".encode('utf-8'))
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_simsun_16_cjk.c')
|
||||
|
||||
print("\nGenerating 16 px Hebrew, Persian")
|
||||
os.system("./built_in_font_gen.py --size 16 -o lv_font_dejavu_16_persian_hebrew.c --bpp 4 --font DejaVuSans.ttf -r 0x20-0x7f,0x5d0-0x5ea,0x600-0x6FF,0xFB50-0xFDFF,0xFE70-0xFEFF")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_dejavu_16_persian_hebrew.c')
|
||||
|
||||
print("\nGenerating 8 px unscii")
|
||||
os.system("lv_font_conv --no-compress --no-prefilter --bpp 1 --size 8 --font unscii-8.ttf -r 0x20-0x7F --format lvgl -o lv_font_unscii_8.c --force-fast-kern-format")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_unscii_8.c')
|
||||
|
||||
print("\nGenerating 16 px unscii")
|
||||
os.system("lv_font_conv --no-compress --no-prefilter --bpp 1 --size 16 --font unscii-8.ttf -r 0x20-0x7F --format lvgl -o lv_font_unscii_16.c --force-fast-kern-format")
|
||||
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_unscii_16.c')
|
||||
|
||||
|
BIN
Demo/lvgl/scripts/built_in_font/unscii-8.ttf
Normal file
BIN
Demo/lvgl/scripts/built_in_font/unscii-8.ttf
Normal file
Binary file not shown.
49
Demo/lvgl/scripts/code-format.cfg
Normal file
49
Demo/lvgl/scripts/code-format.cfg
Normal file
@ -0,0 +1,49 @@
|
||||
--style=kr
|
||||
--indent=spaces=4
|
||||
--indent-classes
|
||||
--indent-switches
|
||||
--indent-cases
|
||||
--indent-preproc-block
|
||||
--indent-preproc-define
|
||||
--indent-col1-comments
|
||||
--pad-oper
|
||||
--unpad-paren
|
||||
--align-pointer=middle
|
||||
--align-reference=middle
|
||||
--convert-tabs
|
||||
--max-code-length=120
|
||||
--break-after-logical
|
||||
--break-closing-braces
|
||||
--attach-closing-while
|
||||
--min-conditional-indent=0
|
||||
--max-continuation-indent=120
|
||||
--mode=c
|
||||
--lineend=linux
|
||||
--recursive
|
||||
--suffix=none
|
||||
--preserve-date
|
||||
--formatted
|
||||
--exclude=lv_conf_internal.h
|
||||
--exclude=../src/font/lv_font_montserrat_12.c
|
||||
--exclude=../src/font/lv_font_montserrat_14.c
|
||||
--exclude=../src/font/lv_font_montserrat_16.c
|
||||
--exclude=../src/font/lv_font_montserrat_18.c
|
||||
--exclude=../src/font/lv_font_montserrat_20.c
|
||||
--exclude=../src/font/lv_font_montserrat_22.c
|
||||
--exclude=../src/font/lv_font_montserrat_24.c
|
||||
--exclude=../src/font/lv_font_montserrat_26.c
|
||||
--exclude=../src/font/lv_font_montserrat_28.c
|
||||
--exclude=../src/font/lv_font_montserrat_30.c
|
||||
--exclude=../src/font/lv_font_montserrat_32.c
|
||||
--exclude=../src/font/lv_font_montserrat_34.c
|
||||
--exclude=../src/font/lv_font_montserrat_36.c
|
||||
--exclude=../src/font/lv_font_montserrat_38.c
|
||||
--exclude=../src/font/lv_font_montserrat_40.c
|
||||
--exclude=../src/font/lv_font_montserrat_42.c
|
||||
--exclude=../src/font/lv_font_montserrat_44.c
|
||||
--exclude=../src/font/lv_font_montserrat_46.c
|
||||
--exclude=../src/font/lv_font_montserrat_48.c
|
||||
--exclude=../src/font/lv_font_montserrat_12_subpx.c
|
||||
--exclude=../src/font/lv_font_montserrat_28_compressed.c
|
||||
--exclude=../src/font/lv_font_simsun_16_cjk.c
|
||||
--exclude=../src/font/lv_font_dejavu_16_persian_hebrew.c
|
1
Demo/lvgl/scripts/code-format.sh
Normal file
1
Demo/lvgl/scripts/code-format.sh
Normal file
@ -0,0 +1 @@
|
||||
astyle --options=code-format.cfg "../src/*.c,*.h"
|
1
Demo/lvgl/scripts/cppcheck_run.sh
Normal file
1
Demo/lvgl/scripts/cppcheck_run.sh
Normal file
@ -0,0 +1 @@
|
||||
cppcheck -j8 --template="{severity}\t{file}:{line}\t{id}: {message}" --enable=all ../src/ --output-file=cppcheck_res.txt --suppress=unusedFunction --suppress=preprocessorErrorDirective --force
|
8
Demo/lvgl/scripts/find_version.sh
Normal file
8
Demo/lvgl/scripts/find_version.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
# Credit: https://stackoverflow.com/a/4774063
|
||||
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
TMPENVFILE=$(mktemp /tmp/lvgl.script.XXXXXX)
|
||||
cat $SCRIPTPATH/../lvgl.h | grep "#define LVGL_VERSION_" | sed 's/#define //g' | sed -r 's/\s+/=/' > $TMPENVFILE
|
||||
. $TMPENVFILE
|
||||
rm $TMPENVFILE
|
||||
echo $LVGL_VERSION_MAJOR.$LVGL_VERSION_MINOR
|
15
Demo/lvgl/scripts/genexamplelist.sh
Normal file
15
Demo/lvgl/scripts/genexamplelist.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
echo "/* Autogenerated */"
|
||||
echo '#include <stddef.h>'
|
||||
echo '#include "examplelist.h"'
|
||||
TMPFILE=$(mktemp)
|
||||
find examples -name \*.h | xargs grep -h "^void lv_example" | sed 's/(/ /g' | awk '{print $2}' > $TMPFILE
|
||||
cat $TMPFILE | while read -r line; do
|
||||
echo "extern void ${line}(void);"
|
||||
done
|
||||
echo "const struct lv_ci_example lv_ci_example_list[] = {"
|
||||
cat $TMPFILE | while read -r line; do
|
||||
echo " { \"$line\", $line },";
|
||||
done
|
||||
echo " { NULL, NULL }"
|
||||
echo "};"
|
9
Demo/lvgl/scripts/infer_run.sh
Normal file
9
Demo/lvgl/scripts/infer_run.sh
Normal file
@ -0,0 +1,9 @@
|
||||
# https://github.com/facebook/infer
|
||||
#
|
||||
# Install:
|
||||
# VERSION=0.17.0; \
|
||||
# curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" \
|
||||
# | sudo tar -C /opt -xJ && \
|
||||
# sudoln -s "/opt/infer-linux64-v$VERSION/bin/infer" /usr/local/bin/infer
|
||||
|
||||
infer run -- make -j8
|
133
Demo/lvgl/scripts/lv_conf_internal_gen.py
Normal file
133
Demo/lvgl/scripts/lv_conf_internal_gen.py
Normal file
@ -0,0 +1,133 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
'''
|
||||
Generates a checker file for lv_conf.h from lv_conf_template.h define all the not defined values
|
||||
'''
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
if sys.version_info < (3,6,0):
|
||||
print("Python >=3.6 is required", file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
fin = open("../lv_conf_template.h", "r")
|
||||
fout = open("../src/lv_conf_internal.h", "w")
|
||||
|
||||
fout.write(
|
||||
'''/**
|
||||
* GENERATED FILE, DO NOT EDIT IT!
|
||||
* @file lv_conf_internal.h
|
||||
* Make sure all the defines of lv_conf.h have a default value
|
||||
**/
|
||||
|
||||
#ifndef LV_CONF_INTERNAL_H
|
||||
#define LV_CONF_INTERNAL_H
|
||||
/*clang-format off*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Handle special Kconfig options */
|
||||
#ifndef LV_KCONFIG_IGNORE
|
||||
# include "lv_conf_kconfig.h"
|
||||
# ifdef CONFIG_LV_CONF_SKIP
|
||||
# define LV_CONF_SKIP
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*If "lv_conf.h" is available from here try to use it later.*/
|
||||
#if defined __has_include
|
||||
# if __has_include("lv_conf.h")
|
||||
# ifndef LV_CONF_INCLUDE_SIMPLE
|
||||
# define LV_CONF_INCLUDE_SIMPLE
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*If lv_conf.h is not skipped include it*/
|
||||
#if !defined(LV_CONF_SKIP)
|
||||
# if defined(LV_CONF_PATH) /*If there is a path defined for lv_conf.h use it*/
|
||||
# define __LV_TO_STR_AUX(x) #x
|
||||
# define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
|
||||
# include __LV_TO_STR(LV_CONF_PATH)
|
||||
# undef __LV_TO_STR_AUX
|
||||
# undef __LV_TO_STR
|
||||
# elif defined(LV_CONF_INCLUDE_SIMPLE) /*Or simply include lv_conf.h is enabled*/
|
||||
# include "lv_conf.h"
|
||||
# else
|
||||
# include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder*/
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------
|
||||
* Start parsing lv_conf_template.h
|
||||
-----------------------------------*/
|
||||
'''
|
||||
)
|
||||
|
||||
started = 0
|
||||
|
||||
for i in fin.read().splitlines():
|
||||
if not started:
|
||||
if '#define LV_CONF_H' in i:
|
||||
started = 1
|
||||
continue
|
||||
else:
|
||||
continue
|
||||
|
||||
if '/*--END OF LV_CONF_H--*/' in i: break
|
||||
|
||||
r = re.search(r'^ *# *define ([^\s]+).*$', i)
|
||||
|
||||
#ifndef LV_USE_BTN /*Only if not defined in lv_conf.h*/
|
||||
# ifdef CONFIG_LV_USE_BTN /*Use KConfig value if set*/
|
||||
# define LV_USE_BTN CONFIG_LV_USE_BTN
|
||||
# else
|
||||
# define LV_USE_BTN 1 /*Use default value*/
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if r:
|
||||
line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros
|
||||
dr = re.sub('.*# *define', '', i, 1)
|
||||
d = "# define " + dr
|
||||
|
||||
fout.write(
|
||||
f'#ifndef {line}\n'
|
||||
f'# ifdef CONFIG_{line.upper()}\n'
|
||||
f'# define {line} CONFIG_{line.upper()}\n'
|
||||
f'# else\n'
|
||||
f'{d}\n'
|
||||
f'# endif\n'
|
||||
f'#endif\n'
|
||||
)
|
||||
elif re.search('^ *typedef .*;.*$', i):
|
||||
continue #ignore typedefs to avoide redeclaration
|
||||
else:
|
||||
fout.write(f'{i}\n')
|
||||
|
||||
fout.write(
|
||||
'''
|
||||
|
||||
/*----------------------------------
|
||||
* End of parsing lv_conf_template.h
|
||||
-----------------------------------*/
|
||||
|
||||
LV_EXPORT_CONST_INT(LV_DPI_DEF);
|
||||
|
||||
/*If running without lv_conf.h add typdesf with default value*/
|
||||
#if defined(LV_CONF_SKIP)
|
||||
|
||||
# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /*Disable warnings for Visual Studio*/
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
# endif
|
||||
|
||||
#endif /*defined(LV_CONF_SKIP)*/
|
||||
|
||||
#endif /*LV_CONF_INTERNAL_H*/
|
||||
'''
|
||||
)
|
||||
|
||||
fin.close()
|
||||
fout.close()
|
9
Demo/lvgl/scripts/release/patch.py
Normal file
9
Demo/lvgl/scripts/release/patch.py
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Applies a commit or commits on baranch or branches
|
||||
# USAGE:
|
||||
# patch.py -c <commit-list> -b <branch-list> [-p] [-t]
|
||||
# - <commit-list>: list of commit SHAs to apply.
|
||||
# - <branch-list>: branches where the commit should be applied. * can be used as wildchar
|
||||
# - p: push the changes to <brach-list>
|
||||
# - t: increment version number and create a tag
|
17
Demo/lvgl/scripts/release/release.py
Normal file
17
Demo/lvgl/scripts/release/release.py
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Create a new release from master. Execute the followings:
|
||||
# - On lvgl, lv_demos, and lv_drivers:
|
||||
# - Detect the current version of master. E.g. 8.1-dev
|
||||
# - Create a new branch from the master for the release. E.g. release/v8.1
|
||||
# - Remove the "-dev" postfix from the version numbers
|
||||
# - Create a tag for the new version. E.g. v8.1
|
||||
# - Push the new branch and tag
|
||||
# - Get the relevant changes from docs/CHANGELOG.md and create a blog post from it
|
||||
# - Increment the version number in master. E.g.g 8.1-dev to 8.2-dev
|
||||
# - Add a new section to the CHANGELOG with the new version
|
||||
# - Update the simulator and lv_port projects
|
||||
#
|
||||
# USAGE:
|
||||
# release.py <type>
|
||||
# - <type>: -minor or -major
|
523
Demo/lvgl/scripts/style_api_gen.py
Normal file
523
Demo/lvgl/scripts/style_api_gen.py
Normal file
@ -0,0 +1,523 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys, os, re
|
||||
|
||||
props = [
|
||||
{'section': 'Size and position', 'dsc':'TODO' },
|
||||
{'name': 'WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the width of object. Pixel, percentage and `LV_SIZE_CONTENT` values can be used. Percentage values are relative to the width of the parent's content area."},
|
||||
|
||||
{'name': 'MIN_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets a minimal width. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
|
||||
|
||||
{'name': 'MAX_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets a maximal width. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
|
||||
|
||||
{'name': 'HEIGHT',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the height of object. Pixel, percentage and `LV_SIZE_CONTENT` can be used. Percentage values are relative to the height of the parent's content area."},
|
||||
|
||||
{'name': 'MIN_HEIGHT',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets a minimal height. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
|
||||
|
||||
{'name': 'MAX_HEIGHT',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets a maximal height. Pixel and percentage values can be used. Percentage values are relative to the height of the parent's content area."},
|
||||
|
||||
{'name': 'X',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the X coordinate of the object considering the set `align`. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
|
||||
|
||||
{'name': 'Y',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the Y coordinate of the object considering the set `align`. Pixel and percentage values can be used. Percentage values are relative to the height of the parent's content area."},
|
||||
|
||||
{'name': 'ALIGN',
|
||||
'style_type': 'num', 'var_type': 'lv_align_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the alignment which tells from which point of the parent the X and Y coordinates should be interpreted. The possible values are: `LV_ALIGN_TOP_LEFT/MID/RIGHT`, `LV_ALIGN_BOTTOM_LEFT/MID/RIGHT`, `LV_ALIGN_LEFT/RIGHT_MID`, `LV_ALIGN_CENTER`"},
|
||||
|
||||
{'name': 'TRANSFORM_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Make the object wider on both sides with this value. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's width." },
|
||||
|
||||
{'name': 'TRANSFORM_HEIGHT',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Make the object higher on both sides with this value. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's height." },
|
||||
|
||||
{'name': 'TRANSLATE_X',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Move the object with this value in X direction. Applied after layouts, aligns and other positioning. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's width." },
|
||||
|
||||
{'name': 'TRANSLATE_Y',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Move the object with this value in Y direction. Applied after layouts, aligns and other positioning. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's height." },
|
||||
|
||||
{'name': 'TRANSFORM_ZOOM',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Zoom image-like objects. Multiplied with the zoom set on the object. The value 256 (or `LV_IMG_ZOOM_NONE`) means normal size, 128 half size, 512 double size, and so on" },
|
||||
|
||||
{'name': 'TRANSFORM_ANGLE',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': " Rotate image-like objects. Added to the rotation set on the object. The value is interpreted in 0.1 degree unit. E.g. 45 deg. = 450 " },
|
||||
|
||||
{'section': 'Padding', 'dsc':'TODO' },
|
||||
{'name': 'PAD_TOP',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the padding on the top. It makes the content area smaller in this direction."},
|
||||
|
||||
{'name': 'PAD_BOTTOM',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the padding on the bottom. It makes the content area smaller in this direction."},
|
||||
|
||||
{'name': 'PAD_LEFT',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the padding on the left. It makes the content area smaller in this direction."},
|
||||
|
||||
{'name': 'PAD_RIGHT',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the padding on the right. It makes the content area smaller in this direction."},
|
||||
|
||||
{'name': 'PAD_ROW',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the padding between the rows. Used by the layouts."},
|
||||
|
||||
{'name': 'PAD_COLUMN',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the padding between the columns. Used by the layouts."},
|
||||
|
||||
{'section': 'Miscellaneous', 'dsc':'TODO' },
|
||||
{'name': 'RADIUS',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the radius on every corner. The value is interpreted in pixel (>= 0) or `LV_RADIUS_CIRCLE` for max. radius"},
|
||||
|
||||
{'name': 'CLIP_CORNER',
|
||||
'style_type': 'num', 'var_type': 'bool', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Enable to clip the overflowed content on the rounded corner. Can be `true` or `false`." },
|
||||
|
||||
{'name': 'OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Scale down all opacity values of the object by this factor. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency." },
|
||||
|
||||
{'name': 'COLOR_FILTER_DSC',
|
||||
'style_type': 'ptr', 'var_type': 'const lv_color_filter_dsc_t *', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Mix a color to all colors of the object." },
|
||||
|
||||
{'name': 'COLOR_FILTER_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "The intensity of mixing of color filter."},
|
||||
|
||||
{'name': 'ANIM_TIME',
|
||||
'style_type': 'num', 'var_type': 'uint32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "The animation time in milliseconds. It's meaning is widget specific. E.g. blink time of the cursor on the text area or scroll time of a roller. See the widgets' documentation to learn more."},
|
||||
|
||||
{'name': 'ANIM_SPEED',
|
||||
'style_type': 'num', 'var_type': 'uint32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "The animation speed in pixel/sec. It's meaning is widget specific. E.g. scroll speed of label. See the widgets' documentation to learn more."},
|
||||
|
||||
{'name': 'TRANSITION',
|
||||
'style_type': 'ptr', 'var_type': 'const lv_style_transition_dsc_t *' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "An initialized `lv_style_transition_dsc_t` to describe a transition."},
|
||||
|
||||
{'name': 'BLEND_MODE',
|
||||
'style_type': 'num', 'var_type': 'lv_blend_mode_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Describes how to blend the colors to the background. The possibel values are `LV_BLEND_MODE_NORMAL/ADDITIVE/SUBTRACTIVE`"},
|
||||
|
||||
{'name': 'LAYOUT',
|
||||
'style_type': 'num', 'var_type': 'uint16_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the layout if the object. The children will be repositioned and resized according to the policies set for the layout. For the possible values see the documentation of the layouts."},
|
||||
|
||||
{'name': 'BASE_DIR',
|
||||
'style_type': 'num', 'var_type': 'lv_base_dir_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the base direction of the obejct. The possible values are `LV_BIDI_DIR_LTR/RTL/AUTO`."},
|
||||
|
||||
|
||||
{'section': 'Background', 'dsc':'TODO' },
|
||||
{'name': 'BG_COLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the background color of the object."},
|
||||
|
||||
{'name': 'BG_COLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
{'name': 'BG_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opacity of the background. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
|
||||
{'name': 'BG_GRAD_COLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the gradient color of the background. Used only if `grad_dir` is not `LV_GRAD_DIR_NONE`"},
|
||||
|
||||
{'name': 'BG_GRAD_COLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
|
||||
{'name': 'BG_GRAD_DIR',
|
||||
'style_type': 'num', 'var_type': 'lv_grad_dir_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the direction of the gradient of the background. The possible values are `LV_GRAD_DIR_NONE/HOR/VER`."},
|
||||
|
||||
{'name': 'BG_MAIN_STOP',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the point from which the background color should start for gradients. 0 means to top/left side, 255 the bottom/right side, 128 the center, and so on"},
|
||||
|
||||
{'name': 'BG_GRAD_STOP',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the point from which the background's gradient color should start. 0 means to top/left side, 255 the bottom/right side, 128 the center, and so on"},
|
||||
|
||||
{'name': 'BG_IMG_SRC',
|
||||
'style_type': 'ptr', 'var_type': 'const void *', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set a background image. Can be a pointer to `lv_img_dsc_t`, a path to a file or an `LV_SYMBOL_...`"},
|
||||
|
||||
{'name': 'BG_IMG_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opacity of the background image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
|
||||
{'name': 'BG_IMG_RECOLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set a color to mix to the background image."},
|
||||
|
||||
{'name': 'BG_IMG_RECOLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t'},
|
||||
|
||||
{'name': 'BG_IMG_RECOLOR_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the intensity of background image recoloring. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means no mixing, 256, `LV_OPA_100` or `LV_OPA_COVER` means full recoloring, other values or LV_OPA_10, LV_OPA_20, etc are interpreted proportionally."},
|
||||
|
||||
{'name': 'BG_IMG_TILED',
|
||||
'style_type': 'num', 'var_type': 'bool', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "If enbaled the background image will be tiled. The possible values are `true` or `false`."},
|
||||
|
||||
{'section': 'Border', 'dsc':'TODO' },
|
||||
{'name': 'BORDER_COLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the color of the border"},
|
||||
|
||||
{'name': 'BORDER_COLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
|
||||
{'name': 'BORDER_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opcitiy of the border. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
|
||||
{'name': 'BORDER_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set hte width of the border. Only pixel values can be used."},
|
||||
|
||||
{'name': 'BORDER_SIDE',
|
||||
'style_type': 'num', 'var_type': 'lv_border_side_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set ony which side(s) the border should be drawn. The possible values are `LV_BORDER_SIDE_NONE/TOP/BOTTOM/LEFT/RIGHT/INTERNAL`. OR-ed calues an be used as well, e.g. `LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_LEFT`."},
|
||||
|
||||
{'name': 'BORDER_POST',
|
||||
'style_type': 'num', 'var_type': 'bool' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets wheter the the border should be drawn before or after the children ar drawn. `true`: after children, `false`: before children"},
|
||||
|
||||
{'section': 'Text', 'dsc':'TODO' },
|
||||
{'name': 'TEXT_COLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Sets the color of the text."},
|
||||
|
||||
{'name': 'TEXT_COLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t'},
|
||||
|
||||
{'name': 'TEXT_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opacity of the text. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
|
||||
{'name': 'TEXT_FONT',
|
||||
'style_type': 'ptr', 'var_type': 'const lv_font_t *', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the font of the text (a pointer `lv_font_t *`). "},
|
||||
|
||||
{'name': 'TEXT_LETTER_SPACE',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the letter space in pixels"},
|
||||
|
||||
{'name': 'TEXT_LINE_SPACE',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the line space in pixels."},
|
||||
|
||||
{'name': 'TEXT_DECOR',
|
||||
'style_type': 'num', 'var_type': 'lv_text_decor_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set decoration for the text. The possible values are `LV_TEXT_DECOR_NONE/UNDERLINE/STRIKETHROUGH`. OR-ed values can be used as well." },
|
||||
|
||||
{'name': 'TEXT_ALIGN',
|
||||
'style_type': 'num', 'var_type': 'lv_text_align_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set how to align the lines of the text. Note that it doesn't align the object itself, only the lines inside the object. The possible values are `LV_TEXT_ALIGN_LEFT/CENTER/RIGHT/AUTO`. `LV_TEXT_ALIGN_AUTO` detect the text base direction and uses left or right alignment accordingly"},
|
||||
|
||||
{'section': 'Image', 'dsc':'TODO' },
|
||||
{'name': 'IMG_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opacity of an image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
|
||||
{'name': 'IMG_RECOLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set color to mixt to the image."},
|
||||
|
||||
{'name': 'IMG_RECOLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t'},
|
||||
|
||||
{'name': 'IMG_RECOLOR_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the intensity of the color mixing. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
|
||||
{'section': 'Outline', 'dsc':'TODO' },
|
||||
{'name': 'OUTLINE_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the width of the outline in pixels. "},
|
||||
|
||||
{'name': 'OUTLINE_COLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the color of the outline."},
|
||||
|
||||
{'name': 'OUTLINE_COLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t'},
|
||||
|
||||
{'name': 'OUTLINE_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opacity of the outline. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
|
||||
{'name': 'OUTLINE_PAD',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the padding of the outline, i.e. the gap between object and the outline."},
|
||||
|
||||
{'section': 'Shadow', 'dsc':'TODO' },
|
||||
{'name': 'SHADOW_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the width of the shadow in pixels. The value should be >= 0."},
|
||||
|
||||
{'name': 'SHADOW_OFS_X',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set an offset on the shadow in pixels in X direction. "},
|
||||
|
||||
{'name': 'SHADOW_OFS_Y',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set an offset on the shadow in pixels in Y direction. "},
|
||||
|
||||
{'name': 'SHADOW_SPREAD',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Make the shadow calcuation to use a larger or smaller rectangle as base. The value can be in pixel t make the area larger/smaller"},
|
||||
|
||||
{'name': 'SHADOW_COLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the color of the shadow"},
|
||||
|
||||
{'name': 'SHADOW_COLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t'},
|
||||
|
||||
{'name': 'SHADOW_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opacity of the shadow. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 256, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
|
||||
{'section': 'Line', 'dsc':'TODO' },
|
||||
{'name': 'LINE_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the width of the lines in pixel."},
|
||||
|
||||
{'name': 'LINE_DASH_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the width of dashes in pixel. Note that dash works only on horizontal and vertical lines"},
|
||||
|
||||
{'name': 'LINE_DASH_GAP',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the gap between dashes in pixel. Note that dash works only on horizontal and vertical lines"},
|
||||
|
||||
{'name': 'LINE_ROUNDED',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Make the end points of the lines rounded. `true`: rounded, `false`: perpandicular line ending "},
|
||||
|
||||
{'name': 'LINE_COLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the color fo the lines."},
|
||||
|
||||
{'name': 'LINE_COLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t'},
|
||||
|
||||
{'name': 'LINE_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opacity of the lines."},
|
||||
|
||||
{'section': 'Arc', 'dsc':'TODO' },
|
||||
{'name': 'ARC_WIDTH',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the width (ticjkness) of the arcs in pixel."},
|
||||
|
||||
{'name': 'ARC_ROUNDED',
|
||||
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Make the end points of the arcs rounded. `true`: rounded, `false`: perpandicular line ending "},
|
||||
|
||||
{'name': 'ARC_COLOR',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the color of the arc."},
|
||||
|
||||
{'name': 'ARC_COLOR_FILTERED',
|
||||
'style_type': 'color', 'var_type': 'lv_color_t' },
|
||||
|
||||
{'name': 'ARC_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set the opacity of the arcs."},
|
||||
|
||||
{'name': 'ARC_IMG_SRC',
|
||||
'style_type': 'ptr', 'var_type': 'const void *', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set an image from which the arc will be masked out. It's useful to display complex effects on the arcs. Can be a pointer to `lv_img_dsc_t` or a path to a file"},
|
||||
]
|
||||
|
||||
def style_get_cast(style_type, var_type):
|
||||
cast = ""
|
||||
if style_type != 'color':
|
||||
cast = "(" + var_type + ")"
|
||||
return cast
|
||||
|
||||
def obj_style_get(p):
|
||||
if 'section' in p: return
|
||||
|
||||
cast = style_get_cast(p['style_type'], p['var_type'])
|
||||
print("static inline " + p['var_type'] + " lv_obj_get_style_" + p['name'].lower() +"(const struct _lv_obj_t * obj, uint32_t part)")
|
||||
print("{")
|
||||
print(" lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_" + p['name'] + ");")
|
||||
print(" return " + cast + "v." + p['style_type'] + ";")
|
||||
print("}")
|
||||
print("")
|
||||
|
||||
def style_set_cast(style_type):
|
||||
cast = ""
|
||||
if style_type == 'num':
|
||||
cast = "(int32_t)"
|
||||
return cast
|
||||
|
||||
def style_set_c(p):
|
||||
if 'section' in p: return
|
||||
|
||||
cast = style_set_cast(p['style_type'])
|
||||
print("void lv_style_set_" + p['name'].lower() +"(lv_style_t * style, "+ p['var_type'] +" value)")
|
||||
print("{")
|
||||
print(" lv_style_value_t v = {")
|
||||
print(" ." + p['style_type'] +" = " + cast + "value")
|
||||
print(" };")
|
||||
print(" lv_style_set_prop(style, LV_STYLE_" + p['name'] +", v);")
|
||||
print("}")
|
||||
print("")
|
||||
|
||||
def style_set_h(p):
|
||||
if 'section' in p: return
|
||||
|
||||
print("void lv_style_set_" + p['name'].lower() +"(lv_style_t * style, "+ p['var_type'] +" value);")
|
||||
|
||||
def local_style_set_c(p):
|
||||
if 'section' in p: return
|
||||
|
||||
cast = style_set_cast(p['style_type'])
|
||||
print("void lv_obj_set_style_" + p['name'].lower() + "(struct _lv_obj_t * obj, " + p['var_type'] +" value, lv_style_selector_t selector)")
|
||||
print("{")
|
||||
print(" lv_style_value_t v = {")
|
||||
print(" ." + p['style_type'] +" = " + cast + "value")
|
||||
print(" };")
|
||||
print(" lv_obj_set_local_style_prop(obj, LV_STYLE_" + p['name'] +", v, selector);")
|
||||
print("}")
|
||||
print("")
|
||||
|
||||
|
||||
def local_style_set_h(p):
|
||||
if 'section' in p: return
|
||||
print("void lv_obj_set_style_" + p['name'].lower() + "(struct _lv_obj_t * obj, " + p['var_type'] +" value, lv_style_selector_t selector);")
|
||||
|
||||
|
||||
def style_const_set(p):
|
||||
if 'section' in p: return
|
||||
|
||||
cast = style_set_cast(p['style_type'])
|
||||
print("#define LV_STYLE_CONST_" + p['name'] + "(val) \\")
|
||||
print(" { \\")
|
||||
print(" .prop = LV_STYLE_" + p['name'] + ", \\")
|
||||
print(" .value = { \\")
|
||||
print(" ." + p['style_type'] +" = " + cast + "val \\")
|
||||
print(" } \\")
|
||||
print(" }")
|
||||
print("")
|
||||
|
||||
|
||||
|
||||
docs_prop_cnt = 0
|
||||
def docs(p):
|
||||
if "section" in p:
|
||||
print("")
|
||||
print("## " + p['section'])
|
||||
print(p['dsc'])
|
||||
return
|
||||
|
||||
if "default" not in p: return
|
||||
|
||||
d = str(p["default"])
|
||||
|
||||
i = "No"
|
||||
if p["inherited"]: i = "Yes"
|
||||
|
||||
l = "No"
|
||||
if p["layout"]: l = "Yes"
|
||||
|
||||
e = "No"
|
||||
if p["ext_draw"]: e = "Yes"
|
||||
|
||||
li_style = "style='display:inline; margin-right: 20px; margin-left: 0px"
|
||||
|
||||
global docs_prop_cnt
|
||||
div_style = "padding: 16px;"
|
||||
if docs_prop_cnt % 2:
|
||||
div_style += " background-color:#eee;"
|
||||
|
||||
docs_prop_cnt+=1
|
||||
|
||||
dsc = p['dsc'];
|
||||
|
||||
print("")
|
||||
#print("<div style=\"" + div_style +"\">");
|
||||
print("")
|
||||
print("### " + p["name"].lower())
|
||||
print(dsc)
|
||||
|
||||
print("<ul>")
|
||||
print("<li " + li_style + "'><strong>Default</strong> " + d + "</li>")
|
||||
print("<li " + li_style + "'><strong>Inherited</strong> " + i + "</li>")
|
||||
print("<li " + li_style + "'><strong>Layout</strong> " + l + "</li>")
|
||||
print("<li " + li_style + "'><strong>Ext. draw</strong> " + e + "</li>")
|
||||
print("</ul>")
|
||||
#print("</div>")
|
||||
print("")
|
||||
|
||||
base_dir = os.path.abspath(os.path.dirname(__file__))
|
||||
sys.stdout = open(base_dir + '/../src/core/lv_obj_style_gen.h', 'w')
|
||||
|
||||
for p in props:
|
||||
obj_style_get(p)
|
||||
|
||||
for p in props:
|
||||
local_style_set_h(p)
|
||||
|
||||
sys.stdout = open(base_dir + '/../src/core/lv_obj_style_gen.c', 'w')
|
||||
|
||||
print("#include \"lv_obj.h\"")
|
||||
for p in props:
|
||||
local_style_set_c(p)
|
||||
|
||||
sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.c', 'w')
|
||||
|
||||
print("#include \"lv_style.h\"")
|
||||
print("#include <stdbool.h>")
|
||||
for p in props:
|
||||
style_set_c(p)
|
||||
|
||||
sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.h', 'w')
|
||||
|
||||
for p in props:
|
||||
style_set_h(p)
|
||||
|
||||
for p in props:
|
||||
style_const_set(p)
|
||||
|
||||
sys.stdout = open(base_dir + '/../docs/overview/style-props.md', 'w')
|
||||
|
||||
print('# Style properties')
|
||||
for p in props:
|
||||
docs(p)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user