Skip to content

Commit

Permalink
improve for custom_widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Dec 21, 2023
1 parent 1242b5c commit 05c9d0f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
9 changes: 9 additions & 0 deletions awtk_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
import glob
import os.path

sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), 'scripts'))
Expand Down Expand Up @@ -275,6 +276,14 @@
joinPath(TK_3RD_ROOT, 'gtest/googletest/include'),
TK_TOOLS_ROOT] + OS_CPPPATH + NANOVG_BACKEND_CPPPATH

CUSTOM_WIDGETS_SRC=glob.glob('src/custom_widgets/*/src') + \
glob.glob('src/custom_widgets/*/src/*/src') + \
glob.glob('src/custom_widgets/*/src/*/include')

for iter in CUSTOM_WIDGETS_SRC:
fullpath = os.path.join(TK_ROOT, str(iter));
CPPPATH.append(fullpath);

os.environ['LCD'] = LCD
os.environ['TK_ROOT'] = TK_ROOT
os.environ['CCFLAGS'] = CCFLAGS + BUILD_DEBUG_FLAG
Expand Down
6 changes: 5 additions & 1 deletion src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ WIDGETS_SOURCES = Glob('widgets/*.c')
env.Library(os.path.join(LIB_DIR, 'widgets'), WIDGETS_SOURCES, LIBS=[])

EXT_WIDGETS_SOURCES = Glob('ext_widgets/*.c') + Glob('ext_widgets/*/*.c') + \
Glob('custom_widgets/*.c') + Glob('custom_widgets/*/*.c')
Glob('custom_widgets/*.c') + Glob('custom_widgets/*/*.c') \
+ Glob('custom_widgets/*/src/*.cpp') + Glob('custom_widgets/*/src/*/*.cpp') \
+ Glob('custom_widgets/*/src/*.c') + Glob('custom_widgets/*/src/*/*.c') \
+ Glob('custom_widgets/*/src/*/src/*.cpp')

env.Library(os.path.join(LIB_DIR, 'extwidgets'), EXT_WIDGETS_SOURCES, LIBS=[])

env.Library(os.path.join(LIB_DIR, 'awtk_global'), ['awtk_global.c'], LIBS=[])
Expand Down
4 changes: 2 additions & 2 deletions src/custom_widgets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
注意:

* 仍然需要自己注册控件,包含相应的头文件。
* 拷贝自定义控件的 src 目录下的文件和子目录到此即可
* 拷贝自定义控件下载到本目录

如:
```
cp -rf ../../../awtk-widget-vlabel/src/* .
git clone https://gitee.com/zlgopen/awtk-widget-table-view
```
17 changes: 17 additions & 0 deletions src/custom_widgets/download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
GITHUB=github.com
GITEE=gitee.com

for f in $(cat repos.txt)
do
echo $f
if [ -e $f ]
then
cd $f
git pull
cd -
else
git clone https://$GITEE/zlgopen/$f
fi
done


5 changes: 5 additions & 0 deletions src/custom_widgets/repos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
awtk-widget-liquid-flow
awtk-widget-table-view
awtk-widget-html-view
awtk-widget-slidable-row
awtk-sqlite3

0 comments on commit 05c9d0f

Please sign in to comment.