Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #include <curses.h>
  2. #include "mucurses.h"
  3. #include "cursor.h"
  4. /** @file
  5. *
  6. * MuCurses clearing functions
  7. *
  8. */
  9. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  10. /**
  11. * Clear a window to the bottom from current cursor position
  12. *
  13. * @v *win subject window
  14. * @ret rc return status code
  15. */
  16. int wclrtobot ( WINDOW *win ) {
  17. struct cursor_pos pos;
  18. _store_curs_pos( win, &pos );
  19. do {
  20. _wputc( win, ' ', WRAP );
  21. } while ( win->curs_y + win->curs_x );
  22. _restore_curs_pos( win, &pos );
  23. return OK;
  24. }
  25. /**
  26. * Clear a window to the end of the current line
  27. *
  28. * @v *win subject window
  29. * @ret rc return status code
  30. */
  31. int wclrtoeol ( WINDOW *win ) {
  32. struct cursor_pos pos;
  33. _store_curs_pos( win, &pos );
  34. while ( ( win->curs_y - pos.y ) == 0 ) {
  35. _wputc( win, ' ', WRAP );
  36. }
  37. _restore_curs_pos( win, &pos );
  38. return OK;
  39. }
  40. /**
  41. * Delete character under the cursor in a window
  42. *
  43. * @v *win subject window
  44. * @ret rc return status code
  45. */
  46. int wdelch ( WINDOW *win ) {
  47. _wputc( win, ' ', NOWRAP );
  48. _wcursback( win );
  49. return OK;
  50. }
  51. /**
  52. * Delete line under a window's cursor
  53. *
  54. * @v *win subject window
  55. * @ret rc return status code
  56. */
  57. int wdeleteln ( WINDOW *win ) {
  58. struct cursor_pos pos;
  59. _store_curs_pos( win, &pos );
  60. /* let's just set the cursor to the beginning of the line and
  61. let wclrtoeol do the work :) */
  62. wmove( win, win->curs_y, 0 );
  63. wclrtoeol( win );
  64. _restore_curs_pos( win, &pos );
  65. return OK;
  66. }
  67. /**
  68. * Completely clear a window
  69. *
  70. * @v *win subject window
  71. * @ret rc return status code
  72. */
  73. int werase ( WINDOW *win ) {
  74. wmove( win, 0, 0 );
  75. wclrtobot( win );
  76. return OK;
  77. }
  78. /**
  79. * Completely clear the screen
  80. *
  81. * @ret rc return status code
  82. */
  83. int erase ( void ) {
  84. stdscr->scr->erase( stdscr->scr, stdscr->attrs );
  85. return OK;
  86. }