summaryrefslogtreecommitdiff
path: root/uisimulator/x11
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/x11')
-rw-r--r--uisimulator/x11/Makefile41
-rw-r--r--uisimulator/x11/dir.h9
-rw-r--r--uisimulator/x11/file.h11
-rw-r--r--uisimulator/x11/io.c2
-rw-r--r--uisimulator/x11/kernel.h4
-rw-r--r--uisimulator/x11/sprintf.h2
6 files changed, 37 insertions, 32 deletions
diff --git a/uisimulator/x11/Makefile b/uisimulator/x11/Makefile
index 14b204bb62..4a95046ea0 100644
--- a/uisimulator/x11/Makefile
+++ b/uisimulator/x11/Makefile
@@ -92,27 +92,34 @@ FIRMSRCS = $(LCDSRSC) id3.c debug.c usb.c mpeg.c power.c\
92 92
93APPS = main.c tree.c menu.c credits.c main_menu.c language.c\ 93APPS = main.c tree.c menu.c credits.c main_menu.c language.c\
94 playlist.c wps.c wps-display.c settings.c status.c icons.c\ 94 playlist.c wps.c wps-display.c settings.c status.c icons.c\
95 screens.c peakmeter.c viewer.c sleeptimer.c keyboard.c onplay.c\ 95 screens.c peakmeter.c sleeptimer.c keyboard.c onplay.c\
96 misc.c 96 misc.c plugin.c
97 97
98MENUS = games_menu.c demo_menu.c settings_menu.c sound_menu.c 98MENUS = games_menu.c demo_menu.c settings_menu.c sound_menu.c
99 99
100ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP) 100ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP)
101 APPS += tetris.c sokoban.c bounce.c snow.c bmp.c widgets.c wormlet.c cube.c 101 APPS += bmp.c widgets.c
102endif 102endif
103 103
104SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c stubs.c \ 104SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c stubs.c \
105 button-x11.c io.c thread.c sim_icons.c $(APPS) $(MENUS) $(FIRMSRCS) 105 button-x11.c io.c thread.c sim_icons.c $(APPS) $(MENUS) $(FIRMSRCS)
106 106
107ROCKSRC := $(wildcard $(APPDIR)/plugins/*.c)
108ROCKS := $(ROCKSRC:$(APPDIR)/plugins/%.c=$(OBJDIR)/%.rock)
109
107OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) 110OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o)
108 111
109all: $(TARGET) $(EXTRA_TARGETS) 112all: $(TARGET) $(EXTRA_TARGETS) $(ROCKS)
110 113
111clean: 114clean:
112 $(RM) $(OBJS) *~ core $(TARGET) $(CLIENTS) $(OBJDIR)/lang.[cho] \ 115 $(RM) $(OBJS) *~ core $(TARGET) $(CLIENTS) $(OBJDIR)/lang.[cho] \
113 $(OBJDIR)/build.lang $(OBJDIR)/*.o $(OBJDIR)/sysfont.c 116 $(OBJDIR)/build.lang $(OBJDIR)/*.o $(OBJDIR)/sysfont.c \
117 $(ROCKS) $(OBJDIR)/credits.raw
114 $(RM) -r $(DEPS) 118 $(RM) -r $(DEPS)
115 119
120$(OBJDIR)/%.rock: $(APPDIR)/plugins/%.c $(APPDIR)/plugin.h
121 $(CC) $(APPCFLAGS) -DPLUGIN -shared $< -o $@
122
116distclean: clean 123distclean: clean
117 $(RM) config.cache 124 $(RM) config.cache
118 125
@@ -128,6 +135,9 @@ $(OBJDIR)/menu.o: $(APPDIR)/menu.c
128$(OBJDIR)/main_menu.o: $(APPDIR)/main_menu.c 135$(OBJDIR)/main_menu.o: $(APPDIR)/main_menu.c
129 $(CC) $(APPCFLAGS) -c $< -o $@ 136 $(CC) $(APPCFLAGS) -c $< -o $@
130 137
138$(OBJDIR)/plugin.o: $(APPDIR)/plugin.c
139 $(CC) $(APPCFLAGS) -c $< -o $@
140
131$(OBJDIR)/keyboard.o: $(MACHINEDIR)/keyboard.c 141$(OBJDIR)/keyboard.o: $(MACHINEDIR)/keyboard.c
132 $(CC) $(APPCFLAGS) -c $< -o $@ 142 $(CC) $(APPCFLAGS) -c $< -o $@
133 143
@@ -152,24 +162,6 @@ $(OBJDIR)/icons.o: $(MACHINEDIR)/icons.c
152$(OBJDIR)/widgets.o: $(RECDIR)/widgets.c 162$(OBJDIR)/widgets.o: $(RECDIR)/widgets.c
153 $(CC) $(APPCFLAGS) -c $< -o $@ 163 $(CC) $(APPCFLAGS) -c $< -o $@
154 164
155$(OBJDIR)/tetris.o: $(RECDIR)/tetris.c
156 $(CC) $(APPCFLAGS) -c $< -o $@
157
158$(OBJDIR)/wormlet.o: $(RECDIR)/wormlet.c
159 $(CC) $(APPCFLAGS) -c $< -o $@
160
161$(OBJDIR)/sokoban.o: $(RECDIR)/sokoban.c
162 $(CC) $(APPCFLAGS) -c $< -o $@
163
164$(OBJDIR)/bounce.o: $(RECDIR)/bounce.c
165 $(CC) $(APPCFLAGS) -c $< -o $@
166
167$(OBJDIR)/cube.o: $(RECDIR)/cube.c
168 $(CC) $(APPCFLAGS) -c $< -o $@
169
170$(OBJDIR)/snow.o: $(RECDIR)/snow.c
171 $(CC) $(APPCFLAGS) -c $< -o $@
172
173$(OBJDIR)/main.o: $(APPDIR)/main.c 165$(OBJDIR)/main.o: $(APPDIR)/main.c
174 $(CC) $(APPCFLAGS) -c $< -o $@ 166 $(CC) $(APPCFLAGS) -c $< -o $@
175 167
@@ -182,9 +174,6 @@ $(OBJDIR)/wps.o: $(APPDIR)/wps.c
182$(OBJDIR)/sleeptimer.o: $(APPDIR)/sleeptimer.c 174$(OBJDIR)/sleeptimer.o: $(APPDIR)/sleeptimer.c
183 $(CC) $(APPCFLAGS) -c $< -o $@ 175 $(CC) $(APPCFLAGS) -c $< -o $@
184 176
185$(OBJDIR)/viewer.o: $(APPDIR)/viewer.c
186 $(CC) $(APPCFLAGS) -c $< -o $@
187
188$(OBJDIR)/wps-display.o: $(APPDIR)/wps-display.c 177$(OBJDIR)/wps-display.o: $(APPDIR)/wps-display.c
189 $(CC) $(APPCFLAGS) -c $< -o $@ 178 $(CC) $(APPCFLAGS) -c $< -o $@
190 179
diff --git a/uisimulator/x11/dir.h b/uisimulator/x11/dir.h
index 28cfcc8646..6b019c833e 100644
--- a/uisimulator/x11/dir.h
+++ b/uisimulator/x11/dir.h
@@ -16,6 +16,8 @@
16 * KIND, either express or implied. 16 * KIND, either express or implied.
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19#ifndef _X11_DIR_H_
20#define _X11_DIR_H_
19 21
20#include <sys/types.h> 22#include <sys/types.h>
21typedef void DIR; 23typedef void DIR;
@@ -29,7 +31,9 @@ typedef void * MYDIR;
29 31
30extern MYDIR *x11_opendir(char *name); 32extern MYDIR *x11_opendir(char *name);
31extern struct x11_dirent* x11_readdir(MYDIR* dir); 33extern struct x11_dirent* x11_readdir(MYDIR* dir);
32extern void x11_closedir(MYDIR *dir); 34extern int x11_closedir(MYDIR *dir);
35
36#ifndef NO_REDEFINES_PLEASE
33 37
34#define DIR MYDIR 38#define DIR MYDIR
35#define dirent x11_dirent 39#define dirent x11_dirent
@@ -37,3 +41,6 @@ extern void x11_closedir(MYDIR *dir);
37#define readdir(x) x11_readdir(x) 41#define readdir(x) x11_readdir(x)
38#define closedir(x) x11_closedir(x) 42#define closedir(x) x11_closedir(x)
39 43
44#endif
45
46#endif
diff --git a/uisimulator/x11/file.h b/uisimulator/x11/file.h
index f11f5056c9..7658a1b2f1 100644
--- a/uisimulator/x11/file.h
+++ b/uisimulator/x11/file.h
@@ -23,25 +23,28 @@
23#include <stdio.h> 23#include <stdio.h>
24#include <sys/types.h> 24#include <sys/types.h>
25 25
26int x11_open(char *name, int opts); 26int x11_open(const char *name, int opts);
27int x11_close(int fd); 27int x11_close(int fd);
28int x11_filesize(int fd); 28int x11_filesize(int fd);
29int x11_creat(char *name, int mode); 29int x11_creat(char *name, int mode);
30int x11_remove(char *name); 30int x11_remove(char *name);
31int x11_rename(char *oldpath, char *newpath); 31int x11_rename(char *oldpath, char *newpath);
32 32
33#ifndef NO_REDEFINES_PLEASE
33#define open(x,y) x11_open(x,y) 34#define open(x,y) x11_open(x,y)
34#define close(x) x11_close(x) 35#define close(x) x11_close(x)
35#define filesize(x) x11_filesize(x) 36#define filesize(x) x11_filesize(x)
36#define creat(x,y) x11_creat(x,y) 37#define creat(x,y) x11_creat(x,y)
37#define remove(x) x11_remove(x) 38#define remove(x) x11_remove(x)
38#define rename(x,y) x11_rename(x,y) 39#define rename(x,y) x11_rename(x,y)
40#endif
39 41
40#include "../../firmware/include/file.h" 42#include "../../firmware/include/file.h"
41 43
42extern int open(char* pathname, int flags); 44int open(const char* pathname, int flags);
43extern int close(int fd); 45int close(int fd);
44extern int printf(const char *format, ...); 46int printf(const char *format, ...);
47int ftruncate(int fd, off_t length);
45 48
46off_t lseek(int fildes, off_t offset, int whence); 49off_t lseek(int fildes, off_t offset, int whence);
47ssize_t read(int fd, void *buf, size_t count); 50ssize_t read(int fd, void *buf, size_t count);
diff --git a/uisimulator/x11/io.c b/uisimulator/x11/io.c
index c33a42d636..5b3cff7006 100644
--- a/uisimulator/x11/io.c
+++ b/uisimulator/x11/io.c
@@ -97,7 +97,7 @@ void x11_closedir(MYDIR *dir)
97} 97}
98 98
99 99
100int x11_open(char *name, int opts) 100int x11_open(const char *name, int opts)
101{ 101{
102 char buffer[256]; /* sufficiently big */ 102 char buffer[256]; /* sufficiently big */
103 103
diff --git a/uisimulator/x11/kernel.h b/uisimulator/x11/kernel.h
index 397a1562a1..7ec2979748 100644
--- a/uisimulator/x11/kernel.h
+++ b/uisimulator/x11/kernel.h
@@ -19,6 +19,10 @@
19 19
20#include "../../firmware/export/kernel.h" 20#include "../../firmware/export/kernel.h"
21 21
22#ifndef NO_REDEFINES_PLEASE
23
22#define sleep(x) x11_sleep(x) 24#define sleep(x) x11_sleep(x)
23 25
26#endif
27
24void x11_sleep(int); 28void x11_sleep(int);
diff --git a/uisimulator/x11/sprintf.h b/uisimulator/x11/sprintf.h
index 1e95459d41..64a22f3c6e 100644
--- a/uisimulator/x11/sprintf.h
+++ b/uisimulator/x11/sprintf.h
@@ -5,6 +5,8 @@ int rockbox_snprintf (char *buf, size_t size, const char *fmt, ...);
5int rockbox_vsnprintf (char *buf, int size, const char *fmt, va_list ap); 5int rockbox_vsnprintf (char *buf, int size, const char *fmt, va_list ap);
6int rockbox_fprintf (int fd, const char *fmt, ...); 6int rockbox_fprintf (int fd, const char *fmt, ...);
7 7
8#ifndef NO_REDEFINES_PLEASE
8#define snprintf rockbox_snprintf 9#define snprintf rockbox_snprintf
9#define vsnprintf rockbox_vsnprintf 10#define vsnprintf rockbox_vsnprintf
10#define fprintf rockbox_fprintf 11#define fprintf rockbox_fprintf
12#endif