From: John Hodge Date: Sun, 8 Jun 2014 06:23:50 +0000 (+0800) Subject: Usermode/AxWin4 - Add very basic start on a UI program X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=91d300c3c18adcc6581f268b787db0b34a7a6150;p=tpg%2Facess2.git Usermode/AxWin4 - Add very basic start on a UI program --- diff --git a/Usermode/Applications/axwin4_src/Makefile b/Usermode/Applications/axwin4_src/Makefile new file mode 100644 index 00000000..28fb532f --- /dev/null +++ b/Usermode/Applications/axwin4_src/Makefile @@ -0,0 +1,5 @@ +%: + @echo --- AxWin4 Server + @make -C Server/ $* + @echo --- AxWin4 UI + @make -C UI/ $* diff --git a/Usermode/Applications/axwin4_src/UI/Makefile b/Usermode/Applications/axwin4_src/UI/Makefile new file mode 100644 index 00000000..096cd9cd --- /dev/null +++ b/Usermode/Applications/axwin4_src/UI/Makefile @@ -0,0 +1,12 @@ + +include ../../Makefile.cfg + +DIR := Apps/AxWin/4.0 + +OBJ := main.o + +BIN := AxWinUI + +LDFLAGS += -laxwin4 + +include ../../Makefile.tpl diff --git a/Usermode/Applications/axwin4_src/UI/main.c b/Usermode/Applications/axwin4_src/UI/main.c new file mode 100644 index 00000000..e599cb91 --- /dev/null +++ b/Usermode/Applications/axwin4_src/UI/main.c @@ -0,0 +1,33 @@ +/* + * AxWin4 GUI - UI Core + * - By John Hodge (thePowersGang) + * + * main.c + * - Program core + */ +#include +#include + +// === CODE === +int main(int argc, const char *argv[]) +{ + assert( AxWin4_Connect("ipcpipe:///Devices/ipcpipe/axwin4") ); + + tAxWin4_Window *bgwin = AxWin4_CreateWindow("background"); + + AxWin4_MoveWindow(bgwin, 0,0); + AxWin4_ResizeWindow(bgwin, 640,480); + //AxWin4_SetWindowFlags(bgwin, AXWIN4_WNDFLAG_NODECORATE|AXWIN4_WNDFLAG_KEEPBELOW); + + // Load image + char *image = malloc(640*480*4); + AxWin4_DrawBitmap(bgwin, 0, 0, 640, 480, image); + + _SysDebug("Beginning queue"); + + while( AxWin4_WaitEventQueue(0) ) + ; + _SysDebug("Clean exit"); + + return 0; +}