clear.c File Reference

MuCurses clearing functions. More...

#include <curses.h>
#include "mucurses.h"
#include "cursor.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
int wclrtobot (WINDOW *win)
 Clear a window to the bottom from current cursor position.
int wclrtoeol (WINDOW *win)
 Clear a window to the end of the current line.
int wdelch (WINDOW *win)
 Delete character under the cursor in a window.
int wdeleteln (WINDOW *win)
 Delete line under a window's cursor.
int werase (WINDOW *win)
 Completely clear a window.


Detailed Description

MuCurses clearing functions.

Definition in file clear.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

int wclrtobot ( WINDOW win  ) 

Clear a window to the bottom from current cursor position.

Parameters:
*win subject window
Return values:
rc return status code

Definition at line 19 of file clear.c.

References _restore_curs_pos(), _store_curs_pos(), _wputc(), _curses_window::curs_x, _curses_window::curs_y, OK, and WRAP.

Referenced by clrtobot(), and werase().

00019                               {
00020         struct cursor_pos pos;
00021 
00022         _store_curs_pos( win, &pos );
00023         do {
00024                 _wputc( win, ' ', WRAP );
00025         } while ( win->curs_y + win->curs_x );
00026         _restore_curs_pos( win, &pos );
00027 
00028         return OK;
00029 }

int wclrtoeol ( WINDOW win  ) 

Clear a window to the end of the current line.

Parameters:
*win subject window
Return values:
rc return status code

Definition at line 37 of file clear.c.

References _restore_curs_pos(), _store_curs_pos(), _wputc(), _curses_window::curs_y, OK, WRAP, and cursor_pos::y.

Referenced by clrtoeol(), slk_clear(), and wdeleteln().

00037                               {
00038         struct cursor_pos pos;
00039 
00040         _store_curs_pos( win, &pos );
00041         while ( ( win->curs_y - pos.y ) == 0 ) {
00042                 _wputc( win, ' ', WRAP );
00043         }
00044         _restore_curs_pos( win, &pos );
00045 
00046         return OK;
00047 }

int wdelch ( WINDOW win  ) 

Delete character under the cursor in a window.

Parameters:
*win subject window
Return values:
rc return status code

Definition at line 55 of file clear.c.

References _wcursback(), _wputc(), NOWRAP, and OK.

Referenced by delch(), mvdelch(), mvwdelch(), wgetch(), and wgetnstr().

00055                            {
00056         _wputc( win, ' ', NOWRAP );
00057         _wcursback( win );
00058 
00059         return OK;
00060 }

int wdeleteln ( WINDOW win  ) 

Delete line under a window's cursor.

Parameters:
*win subject window
Return values:
rc return status code

Definition at line 68 of file clear.c.

References _restore_curs_pos(), _store_curs_pos(), _curses_window::curs_y, OK, wclrtoeol(), and wmove().

Referenced by deleteln().

00068                               {
00069         struct cursor_pos pos;
00070 
00071         _store_curs_pos( win, &pos );
00072         /* let's just set the cursor to the beginning of the line and
00073            let wclrtoeol do the work :) */
00074         wmove( win, win->curs_y, 0 );
00075         wclrtoeol( win );
00076         _restore_curs_pos( win, &pos );
00077         return OK;
00078 }

int werase ( WINDOW win  ) 

Completely clear a window.

Parameters:
*win subject window
Return values:
rc return status code

Definition at line 86 of file clear.c.

References OK, wclrtobot(), and wmove().

Referenced by erase().

00086                            {
00087         wmove( win, 0, 0 );
00088         wclrtobot( win );
00089         return OK;
00090 }


Generated on Tue Apr 6 20:01:46 2010 for gPXE by  doxygen 1.5.7.1