From 76e7cd79e42c40a63c4a9a18dc774da2c44fdb6d Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 2 Jul 2013 23:53:34 +0800 Subject: [PATCH] Usermode/AxWin3 - Preparing for SDL build --- Usermode/Applications/axwin3_src/WM/Makefile | 43 ++----------------- Usermode/Applications/axwin3_src/WM/common.mk | 38 ++++++++++++++++ .../axwin3_src/WM/include/common.h | 19 +++----- .../axwin3_src/WM/include/image.h | 2 + .../axwin3_src/WM/include/lowlevel.h | 28 ++++++++++++ Usermode/Applications/axwin3_src/WM/main.c | 2 + Usermode/Applications/axwin3_src/WM/video.c | 1 + 7 files changed, 80 insertions(+), 53 deletions(-) create mode 100644 Usermode/Applications/axwin3_src/WM/common.mk create mode 100644 Usermode/Applications/axwin3_src/WM/include/lowlevel.h diff --git a/Usermode/Applications/axwin3_src/WM/Makefile b/Usermode/Applications/axwin3_src/WM/Makefile index 3bc24f8e..b2019be7 100644 --- a/Usermode/Applications/axwin3_src/WM/Makefile +++ b/Usermode/Applications/axwin3_src/WM/Makefile @@ -2,32 +2,13 @@ -include ../../Makefile.cfg -CPPFLAGS += -I include/ -I ../include/ -CFLAGS += -std=gnu99 DIR := Apps/AxWin/3.0 BIN := AxWinWM -OBJ := main.o input.o video.o ipc.o image.o -OBJ += wm.o wm_input.o wm_render.o wm_render_text.o wm_hotkeys.o -OBJ += decorator.o -OBJ += renderers/framebuffer.o -OBJ += renderers/background.o -OBJ += renderers/menu.o -OBJ += renderers/richtext.o -# TODO: Move to a lower makefile -OBJ += renderers/widget.o -OBJ += renderers/widget/button.o -OBJ += renderers/widget/image.o -OBJ += renderers/widget/disptext.o -OBJ += renderers/widget/textinput.o -OBJ += renderers/widget/spacer.o -OBJ += renderers/widget/subwin.o - -PNGIMAGES := toolbar_new.png toolbar_save.png toolbar_open.png - -LDFLAGS += -limage_sif -luri -lnet -lunicode - -IMG2SIF = ../../../../Tools/img2sif +OBJ := main.o input.o video.o ipc.o +include common.mk + +LDFLAGS += -lnet -include ../../Makefile.tpl @@ -35,22 +16,6 @@ IMG2SIF = ../../../../Tools/img2sif install: install_resources -#all: resources/LogoSmall.sif.res.h - -%.res.h: % Makefile - echo "#define RESOURCE_$(notdir $<) \\"| sed -e 's/\./_/g' > $@ - base64 $< | sed -e 's/.*/"&"\\/' >> $@ - echo "" >> $@ - -$(IMG2SIF): - $(MAKE) -C $(dir $(IMG2SIF)) img2sif - -all: $(addprefix resources/,$(PNGIMAGES:%.png=.%.sif)) - -resources/.%.sif: $(IMG2SIF) Makefile resources/%.png - @echo img2sif resources/$*.png - @$(IMG2SIF) --rle1x32 resources/$*.png resources/.$*.sif - install_%.sif: resources/.%.sif ; @echo [xCP] $(DISTROOT)/$(DIR)/$*.sif @$(xCP) $< $(DISTROOT)/$(DIR)/$*.sif diff --git a/Usermode/Applications/axwin3_src/WM/common.mk b/Usermode/Applications/axwin3_src/WM/common.mk new file mode 100644 index 00000000..3cf2b028 --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/common.mk @@ -0,0 +1,38 @@ + +CPPFLAGS += -I include/ -I ../include/ +CFLAGS += -std=gnu99 + +OBJ += image.o wm.o wm_input.o wm_render.o wm_render_text.o wm_hotkeys.o +OBJ += decorator.o +OBJ += renderers/framebuffer.o +OBJ += renderers/background.o +OBJ += renderers/menu.o +OBJ += renderers/richtext.o +# TODO: Move to a lower makefile +OBJ += renderers/widget.o +OBJ += renderers/widget/button.o +OBJ += renderers/widget/image.o +OBJ += renderers/widget/disptext.o +OBJ += renderers/widget/textinput.o +OBJ += renderers/widget/spacer.o +OBJ += renderers/widget/subwin.o + +LDFLAGS += -limage_sif -luri -lunicode + +PNGIMAGES := toolbar_new.png toolbar_save.png toolbar_open.png +IMG2SIF = ../../../../Tools/img2sif + +all: $(addprefix resources/,$(PNGIMAGES:%.png=.%.sif)) + +%.res.h: % Makefile + echo "#define RESOURCE_$(notdir $<) \\"| sed -e 's/\./_/g' > $@ + base64 $< | sed -e 's/.*/"&"\\/' >> $@ + echo "" >> $@ + +$(IMG2SIF): + $(MAKE) -C $(dir $(IMG2SIF)) img2sif + +resources/.%.sif: $(IMG2SIF) Makefile resources/%.png + @echo img2sif resources/$*.png + @$(IMG2SIF) --rle1x32 resources/$*.png resources/.$*.sif + diff --git a/Usermode/Applications/axwin3_src/WM/include/common.h b/Usermode/Applications/axwin3_src/WM/include/common.h index e074450d..1f0e749f 100644 --- a/Usermode/Applications/axwin3_src/WM/include/common.h +++ b/Usermode/Applications/axwin3_src/WM/include/common.h @@ -8,7 +8,12 @@ #ifndef _COMMON_H_ #define _COMMON_H_ +#ifndef AXWIN_SDL_BUILD #include +#else +#include +#define _SysDebug(f,a...) fprintf(stderr, f"\n" ,## a) +#endif #define TODO(str) @@ -21,21 +26,7 @@ static inline int MIN(int a, int b) { return (a < b) ? a : b; } static inline int MAX(int a, int b) { return (a > b) ? a : b; } -// === GLOBALS === -extern int giTerminalFD; -extern const char *gsTerminalDevice; - extern int giScreenWidth, giScreenHeight; -// === FUNCTIONS === -// --- Input --- -extern int Input_Init(void); -extern void Input_FillSelect(int *nfds, fd_set *set); -extern void Input_HandleSelect(fd_set *set); -// --- IPC --- -extern void IPC_Init(void); -extern void IPC_FillSelect(int *nfds, fd_set *set); -extern void IPC_HandleSelect(fd_set *set); - #endif diff --git a/Usermode/Applications/axwin3_src/WM/include/image.h b/Usermode/Applications/axwin3_src/WM/include/image.h index 12b29095..d200edf2 100644 --- a/Usermode/Applications/axwin3_src/WM/include/image.h +++ b/Usermode/Applications/axwin3_src/WM/include/image.h @@ -7,6 +7,8 @@ #ifndef _IMAGE_H_ #define _IMAGE_H_ +#include + typedef struct sImage tImage; struct sImage diff --git a/Usermode/Applications/axwin3_src/WM/include/lowlevel.h b/Usermode/Applications/axwin3_src/WM/include/lowlevel.h new file mode 100644 index 00000000..5b33fbf7 --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/include/lowlevel.h @@ -0,0 +1,28 @@ +/* + * Acess2 Window Manager v3 (axwin3) + * - By John Hodge (thePowersGang) + * + * include/lowlevel.h + * - Definitions for system-dependent code + */ +#ifndef _LOWLEVEL_H_ +#define _LOWLEVEL_H_ + +#include + +// === GLOBALS === +extern int giTerminalFD; +extern const char *gsTerminalDevice; + +// === FUNCTIONS === +// --- Input --- +extern int Input_Init(void); +extern void Input_FillSelect(int *nfds, fd_set *set); +extern void Input_HandleSelect(fd_set *set); +// --- IPC --- +extern void IPC_Init(void); +extern void IPC_FillSelect(int *nfds, fd_set *set); +extern void IPC_HandleSelect(fd_set *set); + +#endif + diff --git a/Usermode/Applications/axwin3_src/WM/main.c b/Usermode/Applications/axwin3_src/WM/main.c index a9266b41..bf796d7b 100644 --- a/Usermode/Applications/axwin3_src/WM/main.c +++ b/Usermode/Applications/axwin3_src/WM/main.c @@ -10,6 +10,8 @@ #include #include #include +#include +#include "include/lowlevel.h" // === IMPORTS === extern void Video_Setup(void); diff --git a/Usermode/Applications/axwin3_src/WM/video.c b/Usermode/Applications/axwin3_src/WM/video.c index 00285606..98c88c86 100644 --- a/Usermode/Applications/axwin3_src/WM/video.c +++ b/Usermode/Applications/axwin3_src/WM/video.c @@ -15,6 +15,7 @@ #include #include #include +#include "include/lowlevel.h" // === IMPORTS === extern int giTerminalFD_Input; -- 2.20.1