diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-06-29 16:43:15 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-06-29 16:43:15 +0000 |
commit | 3f54121fde834041970ddeda09edd06ba1939850 (patch) | |
tree | 289b2a511d23bb7b7580a9017639d6f2538c48f9 /uisimulator/x11 | |
parent | ba371fb595affd68c823926b85718d1d613dc7d3 (diff) | |
download | rockbox-3f54121fde834041970ddeda09edd06ba1939850.tar.gz rockbox-3f54121fde834041970ddeda09edd06ba1939850.zip |
Added plugin loader. Moved games, demos and the text viewer to loadable plugins. Copy your *.rock files to /.rockbox/rocks/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3770 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11')
-rw-r--r-- | uisimulator/x11/Makefile | 41 | ||||
-rw-r--r-- | uisimulator/x11/dir.h | 9 | ||||
-rw-r--r-- | uisimulator/x11/file.h | 11 | ||||
-rw-r--r-- | uisimulator/x11/io.c | 2 | ||||
-rw-r--r-- | uisimulator/x11/kernel.h | 4 | ||||
-rw-r--r-- | uisimulator/x11/sprintf.h | 2 |
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 | ||
93 | APPS = main.c tree.c menu.c credits.c main_menu.c language.c\ | 93 | APPS = 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 | ||
98 | MENUS = games_menu.c demo_menu.c settings_menu.c sound_menu.c | 98 | MENUS = games_menu.c demo_menu.c settings_menu.c sound_menu.c |
99 | 99 | ||
100 | ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP) | 100 | ifeq ($(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 |
102 | endif | 102 | endif |
103 | 103 | ||
104 | SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c stubs.c \ | 104 | SRCS = 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 | ||
107 | ROCKSRC := $(wildcard $(APPDIR)/plugins/*.c) | ||
108 | ROCKS := $(ROCKSRC:$(APPDIR)/plugins/%.c=$(OBJDIR)/%.rock) | ||
109 | |||
107 | OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) | 110 | OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) |
108 | 111 | ||
109 | all: $(TARGET) $(EXTRA_TARGETS) | 112 | all: $(TARGET) $(EXTRA_TARGETS) $(ROCKS) |
110 | 113 | ||
111 | clean: | 114 | clean: |
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 | |||
116 | distclean: clean | 123 | distclean: 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> |
21 | typedef void DIR; | 23 | typedef void DIR; |
@@ -29,7 +31,9 @@ typedef void * MYDIR; | |||
29 | 31 | ||
30 | extern MYDIR *x11_opendir(char *name); | 32 | extern MYDIR *x11_opendir(char *name); |
31 | extern struct x11_dirent* x11_readdir(MYDIR* dir); | 33 | extern struct x11_dirent* x11_readdir(MYDIR* dir); |
32 | extern void x11_closedir(MYDIR *dir); | 34 | extern 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 | ||
26 | int x11_open(char *name, int opts); | 26 | int x11_open(const char *name, int opts); |
27 | int x11_close(int fd); | 27 | int x11_close(int fd); |
28 | int x11_filesize(int fd); | 28 | int x11_filesize(int fd); |
29 | int x11_creat(char *name, int mode); | 29 | int x11_creat(char *name, int mode); |
30 | int x11_remove(char *name); | 30 | int x11_remove(char *name); |
31 | int x11_rename(char *oldpath, char *newpath); | 31 | int 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 | ||
42 | extern int open(char* pathname, int flags); | 44 | int open(const char* pathname, int flags); |
43 | extern int close(int fd); | 45 | int close(int fd); |
44 | extern int printf(const char *format, ...); | 46 | int printf(const char *format, ...); |
47 | int ftruncate(int fd, off_t length); | ||
45 | 48 | ||
46 | off_t lseek(int fildes, off_t offset, int whence); | 49 | off_t lseek(int fildes, off_t offset, int whence); |
47 | ssize_t read(int fd, void *buf, size_t count); | 50 | ssize_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 | ||
100 | int x11_open(char *name, int opts) | 100 | int 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 | |||
24 | void x11_sleep(int); | 28 | void 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, ...); | |||
5 | int rockbox_vsnprintf (char *buf, int size, const char *fmt, va_list ap); | 5 | int rockbox_vsnprintf (char *buf, int size, const char *fmt, va_list ap); |
6 | int rockbox_fprintf (int fd, const char *fmt, ...); | 6 | int 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 | ||