clear.c
Go to the documentation of this file.00001 #include <curses.h>
00002 #include "mucurses.h"
00003 #include "cursor.h"
00004
00005
00006
00007
00008
00009
00010
00011 FILE_LICENCE ( GPL2_OR_LATER );
00012
00013
00014
00015
00016
00017
00018
00019 int wclrtobot ( WINDOW *win ) {
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 }
00030
00031
00032
00033
00034
00035
00036
00037 int wclrtoeol ( WINDOW *win ) {
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 }
00048
00049
00050
00051
00052
00053
00054
00055 int wdelch ( WINDOW *win ) {
00056 _wputc( win, ' ', NOWRAP );
00057 _wcursback( win );
00058
00059 return OK;
00060 }
00061
00062
00063
00064
00065
00066
00067
00068 int wdeleteln ( WINDOW *win ) {
00069 struct cursor_pos pos;
00070
00071 _store_curs_pos( win, &pos );
00072
00073
00074 wmove( win, win->curs_y, 0 );
00075 wclrtoeol( win );
00076 _restore_curs_pos( win, &pos );
00077 return OK;
00078 }
00079
00080
00081
00082
00083
00084
00085
00086 int werase ( WINDOW *win ) {
00087 wmove( win, 0, 0 );
00088 wclrtobot( win );
00089 return OK;
00090 }