00001 #include <curses.h>
00002 #include "mucurses.h"
00003 #include "cursor.h"
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 int box ( WINDOW *win, chtype verch, chtype horch ) {
00021 chtype corner = '+' | win->attrs;
00022 return wborder( win, verch, verch, horch, horch,
00023 corner, corner, corner, corner );
00024 }
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 int wborder ( WINDOW *win, chtype ls, chtype rs,
00042 chtype ts, chtype bs, chtype tl,
00043 chtype tr, chtype bl, chtype br ) {
00044 struct cursor_pos pos;
00045
00046 _store_curs_pos( win, &pos );
00047 wmove(win,0,0);
00048
00049 _wputch(win,tl,WRAP);
00050 while ( ( win->width - 1 ) - win->curs_x ) {
00051 _wputch(win,ts,WRAP);
00052 }
00053 _wputch(win,tr,WRAP);
00054
00055 while ( ( win->height - 1 ) - win->curs_y ) {
00056 _wputch(win,ls,WRAP);
00057 wmove(win,win->curs_y,(win->width)-1);
00058 _wputch(win,rs,WRAP);
00059 }
00060
00061 _wputch(win,bl,WRAP);
00062 while ( ( win->width -1 ) - win->curs_x ) {
00063 _wputch(win,bs,WRAP);
00064 }
00065 _wputch(win,br,NOWRAP);
00066
00067 _restore_curs_pos( win, &pos );
00068
00069 return OK;
00070 }
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 int whline ( WINDOW *win, chtype ch, int n ) {
00081 struct cursor_pos pos;
00082
00083 _store_curs_pos ( win, &pos );
00084 while ( ( win->curs_x - win->width ) && n-- ) {
00085 _wputch ( win, ch, NOWRAP );
00086 }
00087 _restore_curs_pos ( win, &pos );
00088
00089 return OK;
00090 }
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 int wvline ( WINDOW *win, chtype ch, int n ) {
00101 struct cursor_pos pos;
00102
00103 _store_curs_pos ( win, &pos );
00104 while ( ( win->curs_y - win->height ) && n-- ) {
00105 _wputch ( win, ch, NOWRAP );
00106 wmove( win, ++(win->curs_y), pos.x);
00107 }
00108 _restore_curs_pos ( win, &pos );
00109
00110 return OK;
00111 }