Bernhard Reutner-Fischer ha scritto:
Somebody goofed with the alphabetical ordering in usage.h, it seems.
Can you please have a look if fbsplash's helptext is really in the
correct place here?
It seems to me that there is not any alphabetical ordering in 'usage.h'.
Anyway I moved the fbsplash help text in a more appropriate place.
+config FBSPLASH_TEXT_RENDERING
+ bool "text rendering"
+ default n
+ depends on FBSPLASH
+ help
+ This option adds the ability to print text messages on the
+ image displayed by the fbsplash applet.
+ - command for fifo:
+ "write:string to print" - print the string after the word "write:"
+
+choice
+ prompt "Choose the font map"
+ depends on FBSPLASH_TEXT_RENDERING
+ default FONTMAP_HARDCODED
+
+config FONTMAP_HARDCODED
there is FBSPLASH missing in that symbol name. Better use
config FBSPLASH_FONTMAP_HARDCODED
Ok, done.
In order to introduce the patch that adds the text rendering to the
fbsplash applet, I think it is better subdivide the patch into small pieces.
I attach a first patch that manages the new parameters (text position;
text color; text size); please, take a look and eventually apply it.
Then I will send the second part of the patch.
Thanks a lot.
--
Michele Sanges
diff -urP busybox/include/usage.h busybox_fbsplash_first_patch/include/usage.h
--- busybox/include/usage.h 2009-03-01 01:20:22.000000000 +0100
+++ busybox_fbsplash_first_patch/include/usage.h 2009-03-02
17:05:38.000000000 +0100
@@ -143,19 +143,6 @@
"$ basename /foo/bar.txt .txt\n" \
"bar"
-#define fbsplash_trivial_usage \
- "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]"
-#define fbsplash_full_usage "\n\n" \
- "Options:\n" \
- "\n -s Image" \
- "\n -c Hide cursor" \
- "\n -d Framebuffer device (default /dev/fb0)" \
- "\n -i Config file (var=value):" \
- "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT" \
- "\n BAR_R,BAR_G,BAR_B" \
- "\n -f Control pipe (else exit after drawing image)" \
- "\n commands: 'NN' (% for progress bar) or 'exit'" \
-
#define brctl_trivial_usage \
"COMMAND [BRIDGE [INTERFACE]]"
#define brctl_full_usage "\n\n" \
@@ -1109,6 +1096,21 @@
" rgba 5/11,6/5,5/0,0/0\n" \
"endmode\n"
+#define fbsplash_trivial_usage \
+ "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD] [-m FONTMAPFILE]"
+#define fbsplash_full_usage "\n\n" \
+ "Options:\n" \
+ "\n -s Image" \
+ "\n -c Hide cursor" \
+ "\n -d Framebuffer device (default /dev/fb0)" \
+ "\n -i Config file (var=value):" \
+ "\n BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT" \
+ "\n BAR_R,BAR_G,BAR_B" \
+ "\n
TEXT_LEFT,TEXT_TOP,TEXT_R,TEXT_G,TEXT_B,TEXT_SIZE" \
+ "\n -m Font map file" \
+ "\n -f Control pipe (else exit after drawing image)" \
+ "\n commands: 'NN' (% for progress bar),
'write:string to print' or 'exit'"
+
#define fdflush_trivial_usage \
"DEVICE"
#define fdflush_full_usage "\n\n" \
diff -urP busybox/miscutils/Config.in
busybox_fbsplash_first_patch/miscutils/Config.in
--- busybox/miscutils/Config.in 2009-03-01 01:20:21.000000000 +0100
+++ busybox_fbsplash_first_patch/miscutils/Config.in 2009-03-02
17:10:31.000000000 +0100
@@ -250,6 +250,32 @@
"NN" (ASCII decimal number) - percentage to show on progress bar
"exit" - well you guessed it
+config FBSPLASH_TEXT_RENDERING
+ bool "text rendering"
+ default n
+ depends on FBSPLASH
+ help
+ This option adds the ability to print text messages on the
+ image displayed by the fbsplash applet.
+ - command for fifo:
+ "write:string to print" - print the string after the word "write:"
+choice
+ prompt "Choose the font map"
+ depends on FBSPLASH_TEXT_RENDERING
+ default FBSPLASH_FONTMAP_HARDCODED
+config FBSPLASH_FONTMAP_HARDCODED
+ bool "hardcoded"
+ help
+ The font map is hard-coded to use the default font map.
+ Adds about 1.6Kb.
+config FBSPLASH_FONTMAP_DYNAMICALLY_LOADED
+ bool "dynamically loaded"
+ help
+ The font map is dynamically loaded from a file.
+ Adds about 700 byte.
+endchoice
+
+
config FLASH_ERASEALL
bool "flash_eraseall"
default n
diff -urP busybox/miscutils/fbsplash.c
busybox_fbsplash_first_patch/miscutils/fbsplash.c
--- busybox/miscutils/fbsplash.c 2009-03-01 01:20:21.000000000 +0100
+++ busybox_fbsplash_first_patch/miscutils/fbsplash.c 2009-03-02
16:53:11.000000000 +0100
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
- * Copyright (C) 2008 Michele Sanges <[email protected]>
+ * Copyright (C) 2008-2009 Michele Sanges <[email protected]>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
@@ -37,7 +37,7 @@
FILE *logfile_fd; // log file
#endif
unsigned char *addr; // pointer to framebuffer memory
- unsigned ns[7]; // n-parameters
+ unsigned ns[13]; // n-parameters
const char *image_filename;
struct fb_var_screeninfo scr_var;
struct fb_fix_screeninfo scr_fix;
@@ -54,6 +54,12 @@
#define nbar_colr ns[4] // progress bar color red component
#define nbar_colg ns[5] // progress bar color green component
#define nbar_colb ns[6] // progress bar color blue component
+#define text_posx ns[7] // text horizontal position
+#define text_posy ns[8] // text vertical position
+#define text_colr ns[9] // text color red component
+#define text_colg ns[10] // text color green component
+#define text_colb ns[11] // text color blue component
+#define text_size ns[12] // text size (1 to 4)
#if DEBUG
#define DEBUG_MESSAGE(strMessage, args...) \
@@ -298,6 +304,7 @@
"BAR_WIDTH\0" "BAR_HEIGHT\0"
"BAR_LEFT\0" "BAR_TOP\0"
"BAR_R\0" "BAR_G\0" "BAR_B\0"
+ "TEXT_LEFT\0" "TEXT_TOP\0" "TEXT_R\0" "TEXT_G\0" "TEXT_B\0"
"TEXT_SIZE\0"
#if DEBUG
"DEBUG\0"
#endif
@@ -310,10 +317,10 @@
int i = index_in_strings(param_names, token[0]);
if (i < 0)
bb_error_msg_and_die("syntax error: %s", token[0]);
- if (i >= 0 && i < 7)
+ if (i >= 0 && i < 13)
G.ns[i] = val;
#if DEBUG
- if (i == 7) {
+ if (i == 13) {
G.bdebug_messages = val;
if (G.bdebug_messages)
G.logfile_fd =
xfopen_for_write("/tmp/fbsplash.log");
diff -urP busybox/miscutils/fbsplash.cfg
busybox_fbsplash_first_patch/miscutils/fbsplash.cfg
--- busybox/miscutils/fbsplash.cfg 2009-03-01 01:20:21.000000000 +0100
+++ busybox_fbsplash_first_patch/miscutils/fbsplash.cfg 2009-03-02
17:49:43.000000000 +0100
@@ -7,3 +7,13 @@
BAR_R=80
BAR_G=80
BAR_B=130
+# settings below are active only if you enable the option
FBSPLASH_TEXT_RENDERING
+# text position
+TEXT_LEFT=100
+TEXT_TOP=350
+# text color
+TEXT_R=80
+TEXT_G=80
+TEXT_B=130
+# text size (1 to 4)
+TEXT_SIZE=2
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox