merge guilte-xxx.cpp into guilite.cpp

This commit is contained in:
idea4good
2019-11-10 23:01:59 +08:00
parent e8057f2e3e
commit ff66d3fa4d
6 changed files with 615 additions and 7299 deletions

View File

@@ -1,15 +1,8 @@
./.sync.sh 1h1cpp
echo "Merge GuiLite source code into: 1 hearder & 1 source file"
echo ""
echo "Choose 1: Build for Linux"
echo "Choose 2: Build for Windows"
echo "Choose 3: Build for None OS or any OS"
echo "Choose 4: exit"
echo "Flatten source code into: GuiLite.h/GuiLite.cpp"
read -p "Please input:[1-3]:" input
# build GuiLite.h
# build GuiLiteRaw.h
cd core_include
cat api.h cmd_target.h rect.h resource.h theme.h surface.h display.h word.h bitmap.h wnd.h audio.h > core.h
mv core.h ../
@@ -22,40 +15,13 @@ cd ..
cat core.h widgets.h > GuiLiteRaw.h
rm core.h widgets.h
# build GuiLite-xxx.cpp
cppFileName="GuiLite-win.cpp"
# build GuiLiteRaw.cpp
cd core
cat *.cpp > core.cpp
mv core.cpp ../
cd adapter
while :
do
case $input in
1)
echo "Choose 1"
cat *linux*.cpp > adapter.cpp
cppFileName="GuiLite-linux.cpp"
break
;;
2)
echo "Choose 2"
cat *win*.cpp > adapter.cpp
break
;;
3)
echo "Choose 3"
cat *unknow*.cpp > adapter.cpp
cppFileName="GuiLite-unknow.cpp"
break
;;
*)
rm ../../GuiLiteRaw.h ../../core.cpp
exit 0
;;
esac
done
cat *.cpp > adapter.cpp
mv adapter.cpp ../../
cd ../../widgets
@@ -74,13 +40,13 @@ sed -i '1s/^/#include "GuiLite.h" /' GuiLiteNoInclude.cpp
# Delete empty lines or blank lines
sed '/^$/d' GuiLiteRaw.h > GuiLite.h
sed '/^$/d' GuiLiteNoInclude.cpp > $cppFileName
sed '/^$/d' GuiLiteNoInclude.cpp > GuiLite.cpp
# Verify
gcc -c $cppFileName
gcc -c GuiLite.cpp
# clean
rm GuiLiteRaw.h GuiLiteRaw.cpp GuiLiteNoInclude.cpp
echo "Done!"
echo "You could find GuiLite.h/$cppFileName in this folder"
echo "You could find GuiLite.h/GuiLite.cpp in this folder"

View File

@@ -1,4 +1,4 @@
#if (!defined _WIN32) && (!defined WIN32) && (!defined _WIN64) && (!defined WIN64) && (!defined __linux__) && && (!defined __APPLE__)
#if (!defined _WIN32) && (!defined WIN32) && (!defined _WIN64) && (!defined WIN64) && (!defined __linux__) && (!defined __APPLE__)
#include "../../core_include/api.h"
#include <stdio.h>