Patch #1768 has been updated. 

Project: 
Category: None
Status: Closed
Summary: Adds non-std. resolution support and ncursesw bug-fixes

Follow-Ups:

Date: Mon 07/28/2003 at 04:18
By: marco_g

Comment:
Changelog entry:

2003-07-18  Marco Gerards  <[EMAIL PROTECTED]>

        * console.c (cons_vcons_update): Call setres for every display
        driver before the driver is used.
        (cons_vcons_set_cursor_pos): Likewise.
        (cons_vcons_clear): Likewise.
        (cons_vcons_write): Likewise.
        * display.h (display_ops): New  interface set_resolution.       
        * vga.c (vga_disp_op): Set NULL for set_resolution.
        * ncursesw.c (ncursesw_set_resolution): New function.
        (ncursesw_displ): Add ncursesw_set_resolution.
        (ncurses_lock): Make variable static.
        (current_width): New variable.
        (current_height): Likewise.

        (conspad): New variable.
        (input_loop): Use conspad instead of (the default) stdscr.
        (mvwputsn): Likewise.
        (ncursesw_update): Likewise.
        (ncursesw_set_cursor_pos): Likewise.
        (ncursesw_scroll): Likewise.
        (ncursesw_write): Likewise.
        (ncursesw_driver_start): Likewise. Initialize conspad.

        (ncursesw_driver_start): Remove endwin call at the end of the
        function.

        (ncursesw_set_cursor_status): If the status can not be set, try
        another status that can sanely be used instead of the unavailable
        status.

        (ncursesw_write): Make it wrap around the edge.

-------------------------------------------------------

Date: Thu 08/07/2003 at 00:53
By: marcus

Comment:
Please put the changelog before the patch in the patch file, so I can copy it from 
there.

Put a cons_vcons_set_dimension callback into the console, which is called from libcons 
refresh function (and possibly if the change records indicate the dimensions have 
changed, but that is not supported yet and isn't as easy, just focus on refresh and 
one-time initialization for now).

Then get rid of all these calls to the set resolution function.

The drivers also get a set_dimension function.  Resolution is the wrong word here (a 
resolution is for example pixel per inch, while this is really a dimension, more text 
cells will require a larger screen).

Please add keys to scroll the pad around, that allows you to at least play a bit with 
larger dimensions than screensize in ncursesw.

Please revert the breaking up of line in write of ncursesw, it shouldn't be required 
with pads.

After removing this endwin() you can just as well return 0 instead ERR.  'x' should 
release the lock and call console_exit() instead endwin and exit().



-------------------------------------------------------

Date: Thu 08/07/2003 at 00:56
By: marcus

Comment:
Oh, and please imlpement the set_dimes call for the VGA driver as well, and make it 
truncate/wrap correctly for different dimensions.  We won't be able to implement a 
full pad window as easily as in ncursesw, but at least for lower dimensions it can be 
used and for larger dimensions it will at least show the upper left corner properly.

-------------------------------------------------------

Date: Fri 08/08/2003 at 22:05
By: marco_g

Comment:
He is the new patch that implements everything you asked for.

M-w + j,k,l,i can be used to scroll the pad. Because this sucks when doing real work 
I've added an "autoscroll" option. It scrolls the pad automaticly, depending on the 
cursor position. Autoscroll can be enabled/disabled with "C-w a".

For the vga driver the changes were a bit more difficult. For example scrolling is 
disabled if the vcons is bigger than the physical screen.

cons_vcons_set_dimension also deallocates the scarce resources now so cons_vcons_clear 
is not called anymore in cons_vcons_refresh. I did think about this, this is not a 
mistake. It is not possible to deallocate the resources before 
cons_vcons_set_dimension and deallocating it after the call is also impossible.

Please notice that this patch is actually two patches + changeslog entries.

Please look at my changelog entry, it seems a bit to big for me, possibly because I 
split it up in logical sections. (First part for set_dimensions related stuff, 2nd 
part for pad related stuff, the other parts are for bugfixes, etc.). I appreciate 
comments. :)

-------------------------------------------------------

Date: Sat 08/09/2003 at 19:22
By: marcus

Comment:
I still have a couple of issues:

* Never split a changelog entry with an empty line if you don't start a new entry with 
a file "* file.c (foo)" etc.
It doesn't make sense.  If they are truly separate issues, then repeat the "* file.c" 
part.

You have this comment:

+  /* Change the dimension of the physical screen to or one that can
+     display the vcons with the size of WIDTH * HEIGHT. If the
+     physical screen already has the right resolution do
+     nothing. Deallocate all scarce resources occupied by the screen.
+     */

Please change the wording to be more clear.  The "to or" construct is confusing.  Then 
never end a comment with "*/" on its own line, use emacs to properly break the lines 
(Meta-TAB).  And please put two spaces after a ".".  This also will allow emacs to do 
proper line breaking (because it can separate initials and abbreviations from sentence 
endings).

I think the current width and height will be automatically initialized by 
set_dimension.  We can make it the protocol that it must be called once before any 
output happens.  So they don't need to be initialized to the magic values 80 and 25.  
Likewise for the VGA driver.

In the autoscroll comment, there again is a "." with only one space after it.

Don't call the function ncurses_refresh, because it is confusing (is it a function in 
ncurses?).  Call it refresh_screen.

I liked the previous visibility code better.  Checking for an error and then doing the 
right thing is better than unconditionally do something unnecessary.

In the VGA driver, if the cursor position is outside the visible area, the cursor must 
be switched off (made invisible) internally, and independent of the actual cursor 
status.  If it is put back into the visible area, it must be turned on again.

I see what you mean with the scrolling.  That is in fact a problem.  We have to fix 
that (either by keeping a copy of the content, or by somehow being able to return an 
error indicating that no scrolling is possible, and the data needs to be supplied - 
this will be hard to do on a per-driver basis, though).  Please put a FIXME in there, 
and the reason why we can't scroll.

The comment in the VGA set_dimension is confusing, can you reword this?  Like: "FIXME: 
Should support greater dimensions by changing the video mode." or something.

For clear, I think it is ok to have set_dimension clear the screen implicitely.  But 
don't say "scarce resources" in the comment, just say that this should include a clear 
on the whole (old) screen, and that it will be followed by a write that covers the 
whole (new) screen.



-------------------------------------------------------

Date: Mon 08/11/2003 at 22:22
By: marco_g

Comment:
Thanks for your comments. Here is a new patch.

I'm using the visibility code that I've used in the first patch again. I've also 
improved the vga_display_write function, the one in my first patch didn't work right 
when using a vcon that is bigger than the physical screen.


-------------------------------------------------------

Date: Fri 08/15/2003 at 23:07
By: marcus

Comment:
I committed the patch, but with the change that cons_vcons_set_dimension takes the 
dimension.  The fact that nothing else in console-client touches the internals of the 
vcons structure should have been a hint.

I also fixed a couple of coding style issues.  Please always go over the patch until 
you don't find anymore.  Some were really obvious, like lines > 78 chars long.

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://savannah.gnu.org/patch/?func=detailpatch&patch_id=1768&group_id=30

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to