diff --git a/README.md b/README.md index 57c384e..153987f 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Even a C beginner could master GUI-lite quickly. The source code only uses basic ## Demo wall - Zero dependency, 100% build pass & runnable - Click the demo you like, and run it on your hardware -- Most of the demos have about 100 lines of UI code, code repository is [here.](https://gitee.com/idea4good/GuiLiteSamples) +- Most of the demos have about 100 lines of UI code, the code repository is [GuiLiteSamples](https://gitee.com/idea4good/GuiLiteSamples) --- ### MCU platform --- @@ -96,7 +96,7 @@ Even a C beginner could master GUI-lite quickly. The source code only uses basic
Code Telemetry & Analysis in real time
-
Track IoT device over the world
+
Track IoT device over the world
diff --git a/README_zh.md b/README_zh.md index 28a86cf..f189dfd 100644 --- a/README_zh.md +++ b/README_zh.md @@ -60,7 +60,7 @@ ## Demo展示墻 - 0依赖,100%编译通过,可直接运行 - 点击你喜欢的实例,并运行在你的硬件上面 -- 大部分demo的UI代码只有100行左右,代碼庫在[这里。](https://gitee.com/idea4good/GuiLiteSamples) +- 大部分demo的UI代码只有100行左右,代碼庫在[GuiLiteSamples](https://gitee.com/idea4good/GuiLiteSamples) --- ### 單片機平臺 --- @@ -94,7 +94,7 @@
Code Telemetry & Analysis in real time
-
Track IoT device over the world
+
Track IoT device over the world
diff --git a/documents/HelloAzureIoT.jpg b/documents/HelloAzureIoT.jpg deleted file mode 100644 index 091bc5d..0000000 Binary files a/documents/HelloAzureIoT.jpg and /dev/null differ diff --git a/documents/HelloAzureIoT.png b/documents/HelloAzureIoT.png new file mode 100644 index 0000000..0eddf2f Binary files /dev/null and b/documents/HelloAzureIoT.png differ diff --git a/documents/HowToUse.md b/documents/HowToUse.md index 28493b4..02685d0 100644 --- a/documents/HowToUse.md +++ b/documents/HowToUse.md @@ -62,6 +62,6 @@ Output here: GuiLite/workspace/libGuiLite.a ## Build header-only GuiLite.h? ```bash -cd GuiLite/workspace -./header-only.sh +cd GuiLite/src +./GenerateGuiLite.h.sh ``` diff --git a/documents/HowToWork-cn.md b/documents/HowToWork-cn.md index 409acf8..cc7c7c9 100644 --- a/documents/HowToWork-cn.md +++ b/documents/HowToWork-cn.md @@ -70,36 +70,31 @@ widgets: ## 文件注释 | core 重要程度/文件名称 | 代码简介 | 推荐学习时间 | | --- | --- | --- | -| ★★★ wnd.cpp | UI元素的基本类,定义所有的UI元素信息、绘制及管理办法 | 1.5小时 | -| ★★ display.cpp | 生成显示设备,设定surface的数目,一个surface对应一个滑动页面 | 0.5小时 | -| word.cpp | 显示文字 | < 1小时 | -| bitmap.cpp | 绘制位图,支持16 bits和32 bits | < 0.5小时 | -| rect.cpp | UI元素的位置信息 | < 0.5小时 | +| ★★★ wnd.h | UI元素的基本类,定义所有的UI元素信息、绘制及管理办法 | 1.5小时 | +| ★★ display.h | 生成显示设备,设定surface的数目,一个surface对应一个滑动页面 | 0.5小时 | +| word.h | 显示文字 | < 1小时 | +| image.h | 绘制位图,支持16 bits和32 bits | < 0.5小时 | +| rect.h | UI元素的位置信息 | < 0.5小时 | | api_linux.cpp | Linux适配层 | < 0.5小时 | | api_win.cpp | Window适配层 | < 0.5小时 | | api_unknow.cpp | 无OS或其他OS适配层 | < 0.5小时 | -| audio_linux.cpp | Linux audio适配层 | < 0.5小时 | -| audio_win.cpp | Windows audio适配层 | < 0.5小时 | -| msg_linux.cpp | 消息管道在Linux上的实现 | < 0.5小时 | -| msg_win.cpp | 消息管道在Windows上的实现 | < 0.5小时 | -| msg_unknow.cpp | 消息管道在其他OS(或无OS)上的实现 | < 0.5小时 | *** | widgets 难度/文件名称 | 代码简介 | 推荐学习时间 | | --- | --- | --- | -| label.cpp | 标签控件的绘制 | < 0.5小时 | -| button.cpp | 按钮控件的绘制及用户点击响应函数 | < 0.5小时 | -| table.cpp | Table控件的绘制 | < 0.5小时 | -| dialog.cpp | 对话框的绘制及管理方法 | < 0.5小时 | -| ★ gesture.cpp | 手势识别方法,包括:鼠标按下,弹起及滑动 | 0.5小时 | -| ★ keyboard.cpp | 键盘控件的绘制及用户点击响应函数 | 0.5小时 | -| ★★ list_box.cpp | List控件的绘制及用户点击响应函数 | 1.5小时 | -| ★★ spinbox.cpp | Spinbox控件的绘制及用户点击响应函数 | 1.5小时 | -| ★★ edit.cpp | Edit控件的绘制及用户点击响应函数 | 1.5小时 | -| ★★★ wave_buffer.cpp | 波形数据的缓冲管理 | 1.5小时 | -| ★★★ wave_ctrl.cpp | 实现波形控件 | 1.5小时 | +| label.h | 标签控件的绘制 | < 0.5小时 | +| button.h | 按钮控件的绘制及用户点击响应函数 | < 0.5小时 | +| table.h | Table控件的绘制 | < 0.5小时 | +| dialog.h | 对话框的绘制及管理方法 | < 0.5小时 | +| ★ keyboard.h | 键盘控件的绘制及用户点击响应函数 | 0.5小时 | +| ★★ list_box.h | List控件的绘制及用户点击响应函数 | 1.5小时 | +| ★★ spinbox.h | Spinbox控件的绘制及用户点击响应函数 | 1.5小时 | +| ★★ edit.h | Edit控件的绘制及用户点击响应函数 | 1.5小时 | +| ★ slide_group.h | 多屏GUI的实现,以及用来切换屏幕的划屏操作 | 1.5小时 | +| ★★★ wave_buffer.h | 波形数据的缓冲管理 | 1.5小时 | +| ★★★ wave_ctrl.h | 它通过波形数据,绘制实时的波形控件 | 1.5小时 | ## 函数注释 -| 函数名称 | display.cpp 函数接口注释 | +| 函数名称 | display.h::c_display 函数接口注释 | | --- | --- | | c_display | c_display构造函数。phy_fb:物理framebuffer指针;display_width:物理显示器宽度;display_height:物理显示器高度;surface_width:surface宽度;surface_height:surface高度;color_bytes:颜色深度;surface_cnt:surface个数/滑动页面的个数;gfx_op:外部绘制接口,用以适配非framebuffer的渲染方式,如果该值不为空,surface在作底层渲染的时候,会调用该接口 | | alloc_surface | 分配surface/滑动页面。usr: 用户ID;max_zorder:该surface所拥有的图层数量| @@ -107,7 +102,7 @@ widgets: | get_updated_fb | 获取该display的framebuffer指针,常用来将GUI显示在任意需要的地方。widght:用来获取framebuffer的宽度;height:用来获取framebuffer的高度;force_update:是否需要强制更新framebuffer的内容,如果不需要强制更新,且framebuffer没法发生变化,将返回NULL | | snap_shot | 生成当前显示的快照,并输出到bitmap文件。file_name:快照文件的名称 | *** -| 函数名称 | surface.cpp 函数接口注释 | +| 函数名称 | display.h::c_surface 函数接口注释 | | --- | --- | | c_surface | c_surface构造函数。 display:surface所属于的display;width:surface的宽度;height:surface的高度;color_bytes:颜色深度| | set_surface | 设置surface。wnd_root:使用者者ID,通常为root window,其子窗口自动获得该surface的使用权。 max_z_order:该surface拥有的图层数量 | diff --git a/documents/HowToWork.md b/documents/HowToWork.md index 12ce48b..ec806a4 100644 --- a/documents/HowToWork.md +++ b/documents/HowToWork.md @@ -71,30 +71,25 @@ Rendering include rendering method and graphic management. ## Source file annotation | core Importance/File name | Introduction | Time cost | | --- | --- | --- | -| ★★★ wnd.cpp | Basic class for widgets; connect/disconnect widgets; response user on_touch, on_key action | 1.5 hour | -| ★★ display.cpp | Initialize display device, create surface, | 0.5 hour | -| word.cpp | Draw text | < 1 hour | -| bitmap.cpp | Draw bitmap | < 0.5 hour | -| rect.cpp | Rect for basic use(e.g, widgets location) | < 0.5 hour | +| ★★★ wnd.h | Basic class for widgets; connect/disconnect widgets; response user on_touch, on_key action | 1.5 hour | +| ★★ display.h | Initialize display device, create surface, | 0.5 hour | +| word.h | Draw text | < 1 hour | +| image.h | Draw bitmap | < 0.5 hour | +| rect.h | Rect for basic use(e.g, widgets location) | < 0.5 hour | | api_linux.cpp | Adapter for Linux | < 0.5 hour | | api_win.cpp | Adapter for Windows | < 0.5 hour | | api_unknow.cpp | Adapter for other OS or none OS | < 0.5 hour | -| audio_linux.cpp | Adapter for Linux audio | < 0.5 hour | -| audio_win.cpp | Adapter Windows audio | < 0.5 hour | -| msg_linux.cpp | Implement message pipe on Linux | < 0.5 hour | -| msg_win.cpp | Implement message pipe on Windows | < 0.5 hour | -| msg_unknow.cpp | Implement message pipe on other OS or none OS | < 0.5 hour | *** | widgets Difficulty/File name | Introduction | Time cost | | --- | --- | --- | -| label.cpp | Source code for label | < 0.5 hour | -| button.cpp | Source code for button | < 0.5 hour | -| table.cpp | Source code for table | < 0.5 hour | -| dialog.cpp | Source code for dialog | < 0.5 hour | -| ★ gesture.cpp | Recognize finger gesture(e.g, press/release/slip) | 0.5 hour | -| ★ keyboard.cpp | Source code for keyboard | 0.5 hour | -| ★★ list_box.cpp | Source code for list box | 1.5 hour | -| ★★ spinbox.cpp | Source code for spin box | 1.5 hour | -| ★★ edit.cpp | Source code for edit widget | 1.5 hour | -| ★★★ wave_buffer.cpp | Source code for wave buffer | 1.5 hour | -| ★★★ wave_ctrl.cpp | Source code for wave widget | 1.5 hour | +| label.h | Draw label | < 0.5 hour | +| button.h | Draw/Click button | < 0.5 hour | +| table.h | Draw table | < 0.5 hour | +| dialog.h | Draw/Open/Close dialog | < 0.5 hour | +| ★ keyboard.h | Draw/Click keyboard | 0.5 hour | +| ★★ list_box.h | Draw/Click list box | 1.5 hour | +| ★★ spinbox.h | Draw/Click spin box | 1.5 hour | +| ★★ edit.h | Draw/Click edit widget | 1.5 hour | +| ★ slide_group.cpp | Draw multiple screens & Swip screen | 1.5 hour | +| ★★★ wave_buffer.h | Manage wave buffer data | 1.5 hour | +| ★★★ wave_ctrl.h | Draw wave widget with wave buffer data | 1.5 hour | diff --git a/src/.sync.sh b/src/.sync.sh deleted file mode 100644 index 5e1f571..0000000 --- a/src/.sync.sh +++ /dev/null @@ -1,38 +0,0 @@ -if [ "$#" -ne 1 ]; then - echo "Invalid arguments" - exit -1 -fi - -url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/2ff1e8a8-2f6f-4d73-a75d-86829e3f4574/rows?key=8f5xLp1gP8%2FzSee4vCUBcyjR65I9zZ6nb%2B%2F7bbzex%2FSctLX3ntIlAR0sxWpDdguuYyDtLdHK%2Fxbxj%2FrSBkX7eQ%3D%3D" -build_time=`date +%Y-%m-%dT%H:%M:%S.000%z` -device_info=`uname -s -n -m` - -#--------------- Geo info ----------------# -timeout 30s curl ipinfo.io > /tmp/ip_info.tmp # get IP info - -grep city /tmp/ip_info.tmp > /tmp/ip_city.tmp # filter city -sed -i 's/"city"://g' /tmp/ip_city.tmp #remove property name -sed -i 's/"//g' /tmp/ip_city.tmp #remove double quotes -city=`sed 's/,//g' /tmp/ip_city.tmp` #remove comma - -grep country /tmp/ip_info.tmp > /tmp/ip_country.tmp # filter country -sed -i 's/"country"://g' /tmp/ip_country.tmp #remove property name -sed -i 's/"//g' /tmp/ip_country.tmp #remove double quotes -country=`sed 's/,//g' /tmp/ip_country.tmp` #remove comma - -grep org /tmp/ip_info.tmp > /tmp/ip_org.tmp # filter org -sed -i 's/"org"://g' /tmp/ip_org.tmp #remove property name -sed -i 's/"//g' /tmp/ip_org.tmp #remove double quotes -org=`sed 's/,//g' /tmp/ip_org.tmp` #remove comma - -timeout 30s curl --include --request POST --header "Content-Type: application/json" --data-binary "[{ -\"device_info\" :\"$device_info\", -\"project_info\" :\"$1\", -\"time\" :\"$build_time\", -\"weight\" :1, -\"country\" :\"$country\", -\"city\" :\"$city\", -\"org\" :\"$org\", -\"log\" :\"$build_time\", -\"version\" :\"v3.0\" -}]" $url diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ea25b6c..efece1b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,5 +20,3 @@ ADD_LIBRARY(GuiLite STATIC ${CORE_SRC} ${CORE_ADAPTER} ${WIDGETS_SRC}) # build shared library # ADD_LIBRARY(GuiLite SHARED ${CORE_SRC} ${CORE_ADAPTER} ${WIDGETS_SRC}) - -execute_process(COMMAND ${CMAKE_SOURCE_DIR}/.sync.sh GuiLite) diff --git a/src/GenerateGuiLite.h.sh b/src/GenerateGuiLite.h.sh index 29909d7..673e49f 100644 --- a/src/GenerateGuiLite.h.sh +++ b/src/GenerateGuiLite.h.sh @@ -50,4 +50,3 @@ echo "You could find GuiLite.h in root folder" # clean rm *.h *.cpp *.o -./.sync.sh GuiLite-header > .sync_log.txt 2>&1 & diff --git a/src/GuiLite.uvprojx b/src/GuiLite.uvprojx index 67b5cc4..16b6f4f 100644 --- a/src/GuiLite.uvprojx +++ b/src/GuiLite.uvprojx @@ -82,7 +82,7 @@ 1 0 - sync_build.bat GuiLite-keil + 0 0 diff --git a/src/GuiLite.vcxproj b/src/GuiLite.vcxproj index a2d1a43..7a41db6 100644 --- a/src/GuiLite.vcxproj +++ b/src/GuiLite.vcxproj @@ -145,9 +145,6 @@ %(AdditionalOptions) /machine:X86 - - call "$(SolutionDir)sync_build.bat" "GuiLite" - @@ -181,9 +178,6 @@ %(AdditionalOptions) /machine:X64 - - call "$(SolutionDir)sync_build.bat" "GuiLite" - @@ -217,9 +211,6 @@ %(AdditionalOptions) /machine:X86 - - call "$(SolutionDir)sync_build.bat" "GuiLite" - @@ -253,9 +244,6 @@ %(AdditionalOptions) /machine:X64 - - call "$(SolutionDir)sync_build.bat" "GuiLite" - diff --git a/src/sync_build.bat b/src/sync_build.bat deleted file mode 100644 index 4004277..0000000 --- a/src/sync_build.bat +++ /dev/null @@ -1,74 +0,0 @@ -echo off -setlocal - -set argC=0 -for %%x in (%*) do set /A argC+=1 -if NOT "1" == "%argC%" ( - echo "Invalidate arguments" - goto :eof - ) - -set url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/2ff1e8a8-2f6f-4d73-a75d-86829e3f4574/rows?key=8f5xLp1gP8%%2FzSee4vCUBcyjR65I9zZ6nb%%2B%%2F7bbzex%%2FSctLX3ntIlAR0sxWpDdguuYyDtLdHK%%2Fxbxj%%2FrSBkX7eQ%%3D%%3D" - -::analyze date time -for /f %%x in ('wmic path win32_utctime get /format:list ^| findstr "="') do ( - set %%x -) - -set Second=0%Second% -set Second=%Second:~-2% -set Minute=0%Minute% -set Minute=%Minute:~-2% -set Hour=0%Hour% -set Hour=%Hour:~-2% -set Day=0%Day% -set Day=%Day:~-2% -set Month=0%Month% -set Month=%Month:~-2% -set datetime=%Year%-%Month%-%Day%T%Hour%:%Minute%:%Second%.000+0000 - -::----------------- for GEO info ----------------- -set tmpPath=%userprofile%\AppData\Local\Temp\ -if not exist "%tmpPath%ip_info.tmp" ( - curl.exe ipinfo.io > %tmpPath%ip_info.tmp -) - -if not exist "%tmpPath%ip_country.tmp" ( - findstr.exe country %tmpPath%ip_info.tmp > %tmpPath%ip_country.tmp - powershell -Command "(gc %tmpPath%ip_country.tmp) -replace '\"country\":', '' | Out-File -encoding ASCII %tmpPath%ip_country.tmp" - powershell -Command "(gc %tmpPath%ip_country.tmp) -replace '""' , '' | Out-File -encoding ASCII %tmpPath%ip_country.tmp" - powershell -Command "(gc %tmpPath%ip_country.tmp) -replace ',' , '' | Out-File -encoding ASCII %tmpPath%ip_country.tmp" -) - -if not exist "%tmpPath%ip_city.tmp" ( - findstr.exe city %tmpPath%ip_info.tmp > %tmpPath%ip_city.tmp - powershell -Command "(gc %tmpPath%ip_city.tmp) -replace '\"city\":', '' | Out-File -encoding ASCII %tmpPath%ip_city.tmp" - powershell -Command "(gc %tmpPath%ip_city.tmp) -replace '""' , '' | Out-File -encoding ASCII %tmpPath%ip_city.tmp" - powershell -Command "(gc %tmpPath%ip_city.tmp) -replace ',' , '' | Out-File -encoding ASCII %tmpPath%ip_city.tmp" -) - -if not exist "%tmpPath%ip_org.tmp" ( - findstr.exe org %tmpPath%ip_info.tmp > %tmpPath%ip_org.tmp - powershell -Command "(gc %tmpPath%ip_org.tmp) -replace '\"org\":', '' | Out-File -encoding ASCII %tmpPath%ip_org.tmp" - powershell -Command "(gc %tmpPath%ip_org.tmp) -replace '""' , '' | Out-File -encoding ASCII %tmpPath%ip_org.tmp" - powershell -Command "(gc %tmpPath%ip_org.tmp) -replace ',' , '' | Out-File -encoding ASCII %tmpPath%ip_org.tmp" -) - -set /p country=<%tmpPath%ip_country.tmp -set /p city=<%tmpPath%ip_city.tmp -set /p org=<%tmpPath%ip_org.tmp -set raw_data=[{^ -\"device_info\" :\"Win-%USERNAME%\",^ -\"project_info\" :\"%1\",^ -\"time\" :\"%datetime%\",^ -\"weight\" : 1,^ -\"country\" :\"%country%\",^ -\"city\" :\"%city%\",^ -\"org\" :\"%org%\",^ -\"log\" :\"%datetime%\",^ -\"version\" :\"v3.0\"^ -}] - -curl.exe --include --request POST --header "Content-Type: application/json" --data-binary "%raw_data%" "%url%" - -exit /B 0