diff --git a/programs/bcc32/examples/template/Makefile b/programs/bcc32/examples/template/Makefile new file mode 100755 index 0000000000..a0c87cbcf3 --- /dev/null +++ b/programs/bcc32/examples/template/Makefile @@ -0,0 +1,19 @@ +# Path to /programs +SVN_PROGR:=../../.. + +# Path to /programs/bcc32 +SVN_BCC32:=$(SVN_PROGR)/bcc32 + +# Path to t2fasm +T2FASM:=$(SVN_BCC32)/t2fasm + +# Path to include +INCLUDE:=$(SVN_BCC32)/include + +# Path to Bin folder +KOS32_BCC:=/home/autobuild/borlandcpp/bin + +# Filename without .cpp +FILENAME:=template + +include $(SVN_BCC32)/Makefile_app diff --git a/programs/bcc32/examples/template/template.cpp b/programs/bcc32/examples/template/template.cpp new file mode 100755 index 0000000000..93e49543cb --- /dev/null +++ b/programs/bcc32/examples/template/template.cpp @@ -0,0 +1,52 @@ +#include +#include +#include + +using namespace Kolibri; + +const char header[] = "bcc32 program template"; + +bool KolibriOnStart(TStartData &kos_start, TThreadData th) +{ + kos_start.Left = 10; + kos_start.Top = 40; + kos_start.Width = 500; + kos_start.Height = 500; + kos_start.WinData.WindowColor = 0xFFFFFF; + kos_start.WinData.WindowType = 0x34; // 0x34 - fixed, 0x33 - not fixed + kos_start.WinData.Title = header; + return true; +} + +void KolibriOnPaint(void) +{ + // SOME DRAWING CODE +} + +void KolibriOnButton(long id, TThreadData th) +{ + // button event (BUTTON ID) + /* + switch(id){ + case 2: + SetWindowCaption("Red"); + break; + ... + case N: + SetWindowCaption("Yellow"); + //break; + }; + */ +} +/* +int KolibriOnIdle(TThreadData th) +{ + return -1; +} +void KolibriOnSize(int window_rect[], TThreadData th) {} +void KolibriOnKeyPress(TThreadData th) +{ + GetKey(); +} +void KolibriOnMouse(TThreadData th) {} +*/ diff --git a/programs/bcc32/examples/template/template_cpp.bat b/programs/bcc32/examples/template/template_cpp.bat new file mode 100755 index 0000000000..19d88a0b65 --- /dev/null +++ b/programs/bcc32/examples/template/template_cpp.bat @@ -0,0 +1,16 @@ +Set NAME=template +Set BCC_DIR=..\..\..\bcc32 +kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include %NAME%.cpp + +echo STACKSIZE equ 102400> kos_make.inc +echo HEAPSIZE equ 102400>> kos_make.inc +echo include "%BCC_DIR%\include\kos_start.inc">> kos_make.inc +echo include "%BCC_DIR%\include\kos_func.inc">> kos_make.inc +echo include "%BCC_DIR%\include\kos_heap.inc">> kos_make.inc + +echo include "kos_make.inc" > f_%NAME%.asm +t2fasm < %NAME%.asm >> f_%NAME%.asm +fasm f_%NAME%.asm %NAME%.kex +if exist %NAME%.kex kpack %NAME%.kex +if exist %NAME%.kex del kos_make.inc +pause