Usermode/AxWin3 - Preparing for SDL build
authorJohn Hodge <[email protected]>
Tue, 2 Jul 2013 15:53:34 +0000 (23:53 +0800)
committerJohn Hodge <[email protected]>
Tue, 2 Jul 2013 15:53:34 +0000 (23:53 +0800)
Usermode/Applications/axwin3_src/WM/Makefile
Usermode/Applications/axwin3_src/WM/common.mk [new file with mode: 0644]
Usermode/Applications/axwin3_src/WM/include/common.h
Usermode/Applications/axwin3_src/WM/include/image.h
Usermode/Applications/axwin3_src/WM/include/lowlevel.h [new file with mode: 0644]
Usermode/Applications/axwin3_src/WM/main.c
Usermode/Applications/axwin3_src/WM/video.c

index 3bc24f8..b2019be 100644 (file)
@@ -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 (file)
index 0000000..3cf2b02
--- /dev/null
@@ -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
+
index e074450..1f0e749 100644 (file)
@@ -8,7 +8,12 @@
 #ifndef _COMMON_H_
 #define _COMMON_H_
 
+#ifndef AXWIN_SDL_BUILD
 #include <acess/sys.h>
+#else
+#include <stdio.h>
+#define _SysDebug(f,a...)      fprintf(stderr, f"\n" ,## a)
+#endif
 
 #define TODO(str)      
 
 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
 
index 12b2909..d200edf 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _IMAGE_H_
 #define _IMAGE_H_
 
+#include <stdint.h>
+
 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 (file)
index 0000000..5b33fbf
--- /dev/null
@@ -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 <acess/sys.h>
+
+// === 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
+
index a9266b4..bf796d7 100644 (file)
@@ -10,6 +10,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <axwin3/keysyms.h>
+#include <string.h>
+#include "include/lowlevel.h"
 
 // === IMPORTS ===
 extern void    Video_Setup(void);
index 0028560..98c88c8 100644 (file)
@@ -15,6 +15,7 @@
 #include <video.h>
 #include <wm.h>
 #include <string.h>
+#include "include/lowlevel.h"
 
 // === IMPORTS ===
 extern int     giTerminalFD_Input;

UCC git Repository :: git.ucc.asn.au