On Thursday 24 September 2009 22:23, Jiří Gabriel wrote:
> <br>It is a good idea to
> > discuss API _before_ you start working
> <br>on implementing it, to prevent
> > redoing the work again when
> <br>it needs changes.
> <br>
> <br>Let's discuss
> > "write text" command.
> <br>
> <br>I propose the following format:
> <br>
> <br> />"write[#CLR][.ROW[.COL]]:text"
> <br>
> <br>(or
> > "write[,#CLR][,rROW][,cCOL]:text" - it's more extensible?)
> <br>
> <br>It
> > should draw the text _and_ background picture, so that
> <br> />"write.10.20:HELLO"
> <br>...wait few sec...
> <br>"write.10.20: "
> <br> />would erase HELLO and restore the background.
> <br>
> <br>(Or do we need
> > "erase" cmd to draw background only inside text's pixels?
> <br>That would work
> > better if we will ever have proportional font...)
> <br>
> <br>Should it wrap
> > around end of line? end of screen?
> <br>
> <br>Should it understand TAB? BS?
> > CR/LF?
> <br>
> --
> <br>vda
> <br>
> > <br><br>Writing on more than one place is very complicated -
> for erasing to background image.<br>We must cache whole image or
> background picture must be available in any time - before pivot_root
> and after. If we cache whole image then memory usage growth.
This may be controlled by a command-line option,
so that size-conscious users can disable it.
> If we decompress and color recalculate before each write then
> redrawing text be slowly.<br><br>My proposing:<br>New command
> "textbox[:x:y[:maxwidth[:lines]]]" - define text area for writing.
> Can be saved background of defined area only.
Maybe later. Let's have at least something simpler first.
> <br>Command "write:text" -
> colorized by \e[30m .. \e[1;37m sequences for console compatibility
> and colorize char by char.
We'll need ESC parser. Kinda complex.
> Need anyone more than 16 colors in splash
> texts?<br>
Yes, I bet people will want that.
> First char of text can be \r - then last text line
> is replaced by new one otherwise old text scroll up (when multi
> line textbox) and new line is displayed.
Maybe later. Let's have at least something simpler first,
for example, simple non-wrapping output at any point in the image
(the "cursor" goes to the right and off the screen).
This is simple(r) to code.
> Command can be named
> "echo" for intuitive use.<br>For clearing text can be usable
> textbox command without parameters.<br>After writing texts,
> new use of command textbox always erase old textbox area
> and define new.
And if user does NOT want to erase text?
> <br><br>TABs and BS I not need.<br><br>Need
> anyone right aligned text for standard [OK/ERROR] boot
> messages?
Perhaps not.
> <br><br>For multiline boot messaging can be usable
> centered image and last few lines can be defined as scroll
> area - then console outs leave image as is and text scrolling
> under it. This code can be used in init scripts:
> <br><br>row=$((LINES - 5))<br># scroll area on lower 5 lines only
> <br>echo -en "\033[6h\033[${row};${LINES}r\033[2J\033[${row};1H"
> <br><br>--<br>tykef<br><br>
I prefer to not have ESC parser just yet.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox