build: add the SIBO SDK
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
QU3.C
|
||||
*/
|
||||
|
||||
#include <p_std.h>
|
||||
#include <wlib.h>
|
||||
#include <hwif.h>
|
||||
|
||||
|
||||
LOCAL_D TEXT *cmds[]=
|
||||
{
|
||||
"iInches/Centimetres",
|
||||
"mMiles/Kilometres",
|
||||
"lPounds/Kilogrammes",
|
||||
"pPints/Litres",
|
||||
"fFahrenheit/Centigrade",
|
||||
"dDay of week",
|
||||
"cCombinations",
|
||||
"tTime difference",
|
||||
"hHoroscope",
|
||||
"nNow",
|
||||
"wPassword",
|
||||
"eEncrypt",
|
||||
"uDecrypt",
|
||||
"sSignificance",
|
||||
"zFile size",
|
||||
"xExit",
|
||||
NULL
|
||||
};
|
||||
|
||||
LOCAL_D H_MENU_DATA mdata[]=
|
||||
{
|
||||
"Conversions",5,
|
||||
"Calendar",5,
|
||||
"Secret",3,
|
||||
"Special",3,
|
||||
NULL
|
||||
};
|
||||
|
||||
GLDEF_D TEXT ** _cmds=(&cmds[0]);
|
||||
GLDEF_D H_MENU_DATA * _mdata=(&mdata[0]);
|
||||
|
||||
|
||||
LOCAL_D UINT MainWid;
|
||||
|
||||
LOCAL_C VOID ManageCommand(INT keycode)
|
||||
{
|
||||
INT index;
|
||||
TEXT buf[40];
|
||||
|
||||
switch (keycode)
|
||||
{
|
||||
case 'x':
|
||||
p_exit(0);
|
||||
default:
|
||||
index=uLocateCommand(keycode);
|
||||
if (index>=0)
|
||||
{
|
||||
p_atos(&buf[0],"You chose `%s'",cmds[index]+1);
|
||||
wInfoMsg(&buf[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL_C VOID MainLoop(VOID)
|
||||
{
|
||||
INT ret;
|
||||
WMSG_KEY key;
|
||||
|
||||
FOREVER
|
||||
{
|
||||
uGetKey(&key);
|
||||
if (key.keycode&W_SPECIAL_KEY)
|
||||
ManageCommand(key.keycode&(~W_SPECIAL_KEY));
|
||||
else if (key.keycode==W_KEY_MENU && !(key.modifiers&W_CTRL_MODIFIER))
|
||||
{
|
||||
ret=uPresentMenus();
|
||||
if (ret>0)
|
||||
ManageCommand(ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL_C VOID ReduceScreenSize(VOID)
|
||||
{
|
||||
W_WINDATA wd;
|
||||
|
||||
wd.extent.tl.x=wd.extent.tl.y=0;
|
||||
wd.extent.width=189;
|
||||
wd.extent.height=80;
|
||||
wSetWindow(MainWid,W_WIN_EXTENT,&wd);
|
||||
if (uErrorValue(wCheckPoint()))
|
||||
p_exit(0);
|
||||
}
|
||||
|
||||
LOCAL_C VOID CreateGC(VOID)
|
||||
{
|
||||
INT hgc;
|
||||
|
||||
hgc=gCreateGC0(MainWid);
|
||||
if (hgc<0)
|
||||
p_exit(hgc);
|
||||
}
|
||||
|
||||
LOCAL_C VOID SpecificInit(VOID)
|
||||
{
|
||||
MainWid=uFindMainWid();
|
||||
ReduceScreenSize();
|
||||
CreateGC();
|
||||
gBorder(W_BORD_CORNER_4);
|
||||
wsEnable();
|
||||
wInfoMsg("Hello world");
|
||||
}
|
||||
|
||||
GLDEF_C VOID main(VOID)
|
||||
{
|
||||
uCommonInit();
|
||||
SpecificInit();
|
||||
MainLoop();
|
||||
}
|
||||
Reference in New Issue
Block a user