curs_add_wch.3x 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. .\"***************************************************************************
  2. .\" Copyright (c) 2001-2002,2006 Free Software Foundation, Inc. *
  3. .\" *
  4. .\" Permission is hereby granted, free of charge, to any person obtaining a *
  5. .\" copy of this software and associated documentation files (the *
  6. .\" "Software"), to deal in the Software without restriction, including *
  7. .\" without limitation the rights to use, copy, modify, merge, publish, *
  8. .\" distribute, distribute with modifications, sublicense, and/or sell *
  9. .\" copies of the Software, and to permit persons to whom the Software is *
  10. .\" furnished to do so, subject to the following conditions: *
  11. .\" *
  12. .\" The above copyright notice and this permission notice shall be included *
  13. .\" in all copies or substantial portions of the Software. *
  14. .\" *
  15. .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
  16. .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
  17. .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
  18. .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
  19. .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
  20. .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
  21. .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
  22. .\" *
  23. .\" Except as contained in this notice, the name(s) of the above copyright *
  24. .\" holders shall not be used in advertising or otherwise to promote the *
  25. .\" sale, use or other dealings in this Software without prior written *
  26. .\" authorization. *
  27. .\"***************************************************************************
  28. .\"
  29. .\" $Id: curs_add_wch.3x,v 1.6 2006/12/24 15:22:22 tom Exp $
  30. .TH curs_add_wch 3X ""
  31. .SH NAME
  32. \fBadd_wch\fP,
  33. \fBwadd_wch\fP,
  34. \fBmvadd_wch\fP,
  35. \fBmvwadd_wch\fP,
  36. \fBecho_wchar\fP,
  37. \fBwecho_wchar\fP - add a complex character and rendition to a \fBcurses\fR window, then advance the cursor
  38. .SH SYNOPSIS
  39. .PP
  40. \fB#include <curses.h>\fP
  41. .sp
  42. .B "int add_wch( const cchar_t *\fIwch\fB );"
  43. .br
  44. .B "int wadd_wch( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
  45. .br
  46. .B "int mvadd_wch( int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );"
  47. .br
  48. .B "int mvwadd_wch( WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );"
  49. .br
  50. .B "int echo_wchar( const cchar_t *\fIwch\fB );"
  51. .br
  52. .B "int wecho_wchar( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
  53. .br
  54. .SH DESCRIPTION
  55. .PP
  56. The
  57. \fBadd_wch\fP,
  58. \fBwadd_wch\fP,
  59. \fBmvadd_wch\fP, and
  60. \fBmvwadd_wch\fP
  61. functions put the complex character \fIwch\fP into the given
  62. window at its current position,
  63. which is then advanced.
  64. These functions perform
  65. wrapping and special-character processing as follows:
  66. .TP 5
  67. -
  68. If \fIwch\fP refers to a spacing character,
  69. then any previous character at that location is removed.
  70. A new character specified by \fIwch\fP is
  71. placed at that location with rendition specified by \fIwch\fP.
  72. The cursor then advances to
  73. the next spacing character on the screen.
  74. .TP 5
  75. -
  76. If \fIwch\fP refers to a non-spacing character,
  77. all previous characters at that location are preserved.
  78. The non-spacing characters of \fIwch\fP
  79. are added to the spacing complex character,
  80. and the rendition specified by \fIwch\fP is ignored.
  81. .TP 5
  82. -
  83. If the character part of \fIwch\fP is
  84. a tab, newline, backspace or other control character,
  85. the window is updated and the cursor moves as if \fBaddch\fR were called.
  86. .PP
  87. The \fBecho_wchar\fP
  88. function is functionally equivalent to a call to
  89. \fBadd_wch\fP
  90. followed by a call to
  91. \fBrefresh\fP.
  92. Similarly, the
  93. \fBwecho_wchar\fP
  94. is functionally equivalent to a call to
  95. \fBwadd_wch\fP
  96. followed by a call to
  97. \fBwrefresh\fP.
  98. The knowledge
  99. that only a single character is being output is taken into consideration and,
  100. for non-control characters, a considerable performance gain might be seen
  101. by using the *\fBecho\fP* functions instead of their equivalents.
  102. .SH RETURN VALUES
  103. .PP
  104. All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
  105. .SH NOTES
  106. .PP
  107. Note that
  108. \fBadd_wch\fP,
  109. \fBmvadd_wch\fP,
  110. \fBmvwadd_wch\fP, and
  111. \fBecho_wchar\fP
  112. may be macros.
  113. .SH PORTABILITY
  114. .PP
  115. All these functions are described in the XSI Curses standard, Issue 4.
  116. The defaults specified for forms-drawing characters apply in the POSIX locale.
  117. .PP
  118. XSI documents constants beginning with \fBWACS_\fP which are used for
  119. line-drawing.
  120. Those are not currently implemented in \fBncurses\fP.
  121. .SH SEE ALSO
  122. .PP
  123. \fBcurses\fR(3X),
  124. \fBcurs_addch\fR(3X),
  125. \fBcurs_attr\fR(3X),
  126. \fBcurs_clear\fR(3X),
  127. \fBcurs_outopts\fR(3X),
  128. \fBcurs_refresh\fR(3X),
  129. \fBputwc\fR(3)
  130. .\"#
  131. .\"# The following sets edit modes for GNU EMACS
  132. .\"# Local Variables:
  133. .\"# mode:nroff
  134. .\"# fill-column:79
  135. .\"# End: