From 91d300c3c18adcc6581f268b787db0b34a7a6150 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 8 Jun 2014 14:23:50 +0800 Subject: [PATCH] Usermode/AxWin4 - Add very basic start on a UI program --- Usermode/Applications/axwin4_src/Makefile | 5 +++ Usermode/Applications/axwin4_src/UI/Makefile | 12 +++++++ Usermode/Applications/axwin4_src/UI/main.c | 33 ++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 Usermode/Applications/axwin4_src/Makefile create mode 100644 Usermode/Applications/axwin4_src/UI/Makefile create mode 100644 Usermode/Applications/axwin4_src/UI/main.c 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; +} -- 2.20.1