⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curses.h

📁 curses界面编程
💻 H
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0067)http://www.opengroup.org/onlinepubs/007908799/xcurses/curses.h.html -->
<HTML><HEAD><TITLE><curses.h></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><!-- Copyright 1997 The Open Group, All Rights Reserved -->
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY bgColor=white>
<CENTER><FONT size=2>The Single UNIX &reg; Specification, Version 2<BR>Copyright &copy; 
1997 The Open Group </FONT></CENTER>
<HR noShade SIZE=2>
<XREF name="curses.h" type="10"></XREF>
<H4><A name=tag_000_000_256>&nbsp;</A>NAME</H4>
<BLOCKQUOTE>curses.h - definitions for screen handling and optimisation 
  functions </BLOCKQUOTE>
<H4><A name=tag_000_000_257>&nbsp;</A>SYNOPSIS</H4>
<BLOCKQUOTE><PRE><CODE>

#include &lt;curses.h&gt;
</CODE>
</PRE></BLOCKQUOTE>
<H4><A name=tag_000_000_258>&nbsp;</A>DESCRIPTION</H4>
<BLOCKQUOTE>
  <H5><A name=tag_000_000_258_001>&nbsp;</A>Objects</H5>The 
  <I>&lt;curses.h&gt;</I> header provides a declaration for <I>COLOR_PAIRS</I>, 
  <I>COLORS</I>, <I>COLS</I>, <I>curscr</I>, <I>LINES</I> and <I>stdscr</I>. 
  <H5><A name=tag_000_000_258_002>&nbsp;</A>Constants</H5>The following 
  constants are defined: 
  <DL compact>
    <DT>EOF
    <DD>Function return value for end-of-file 
    <DT>ERR
    <DD>Function return value for failure 
    <DT>FALSE
    <DD>Boolean <I>false</I> value 
    <DT>OK
    <DD>Function return value for success 
    <DT>TRUE
    <DD>Boolean <I>true</I> value 
    <DT>WEOF
    <DD>Wide-character function return value for end-of-file, as defined in 
    <I><A 
    href="http://www.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html">&lt;wchar.h&gt;</A></I>. 
    </DD></DL>
  <P>The following constant is defined if the implementation supports the 
  indicated revision of the X/Open Curses specification: 
  <DL compact>
    <DT>_XOPEN_CURSES
    <DD>X/Open Curses, Issue 4, Version 2, July 1996, (ISBN: 1-85912-171-3, 
    C610) (this document). </DD></DL>
  <H5><A name=tag_000_000_258_003>&nbsp;</A>Data Types</H5>The following data 
  types are defined through <B>typedef</B>: 
  <DL compact>
    <DT><B>attr_t</B>
    <DD>An OR-ed set of attributes 
    <DT><B>bool</B>
    <DD>Boolean data type 
    <DT><B>chtype</B>
    <DD>A character, attributes &nbsp;and a colour-pair 
    <DT><B>SCREEN</B>
    <DD>An opaque terminal representation 
    <DT><B>wchar_t</B>
    <DD>As described in <I><A 
    href="http://www.opengroup.org/onlinepubs/007908799/xsh/stddef.h.html">&lt;stddef.h&gt;</A></I> 

    <DT><B>wint_t</B>
    <DD>As described in <I><A 
    href="http://www.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html">&lt;wchar.h&gt;</A></I> 

    <DT><B>cchar_t</B>
    <DD>References a string of wide characters 
    <DT><B>WINDOW</B>
    <DD>An opaque window representation </DD></DL>
  <P>These data types are described in more detail in <XREF 
  href="datatypes"></XREF><A 
  href="http://www.opengroup.org/onlinepubs/007908799/xcurses/implement.html#datatypes">Data 
  Types</A>. 
  <P>The inclusion of <I>&lt;curses.h&gt;</I> may make visible all symbols from 
  the headers <I><A 
  href="http://www.opengroup.org/onlinepubs/007908799/xsh/stdio.h.html">&lt;stdio.h&gt;</A></I>, 
  <I><A 
  href="http://www.opengroup.org/onlinepubs/007908799/xcurses/term.h.html">&lt;term.h&gt;</A></I>, 
  <I><A 
  href="http://www.opengroup.org/onlinepubs/007908799/xsh/termios.h.html">&lt;termios.h&gt;</A></I> 
  and <I><A 
  href="http://www.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html">&lt;wchar.h&gt;</A></I>. 
  <BR>
  <H5><A name=tag_000_000_258_004>&nbsp;</A>Attribute Bits</H5>The following 
  symbolic constants are used to manipulate objects of type <B>attr_t</B>: <PRE><CODE>
WA_ALTCHARSET  Alternate character set
WA_BLINK       Blinking
WA_BOLD        Extra bright or bold
WA_DIM         Half bright
WA_HORIZONTAL  Horizontal highlight
WA_INVIS       Invisible
WA_LEFT        Left highlight
WA_LOW         Low highlight
WA_PROTECT     Protected
WA_REVERSE     Reverse video
WA_RIGHT       Right highlight
WA_STANDOUT    Best highlighting mode of the terminal
WA_TOP         Top highlight
WA_UNDERLINE   Underlining
WA_VERTICAL    Vertical highlight
</CODE>
</PRE>These attribute flags shall be distinct. 
  <P>The following symbolic constants are used to manipulate attribute bits in 
  objects of type <B>chtype</B>: <PRE><CODE>
A_ALTCHARSET   Alternate character set
A_BLINK        Blinking
A_BOLD         Extra bright or bold
A_DIM          Half bright
A_INVIS        Invisible
A_PROTECT      Protected
A_REVERSE      Reverse video
A_STANDOUT     Best highlighting mode of the terminal
A_UNDERLINE    Underlining
</CODE>
</PRE>These attribute flags need not be distinct &nbsp;except when 
  _XOPEN_CURSES is defined and the application sets _XOPEN_SOURCE_EXTENDED to 1. 

  <P>The following symbolic constants can be used as bit-masks to extract the 
  components of a <B>chtype</B>: <PRE><CODE>
A_ATTRIBUTES   Bit-mask to extract attributes
A_CHARTEXT     Bit-mask to extract a character
A_COLOR        Bit-mask to extract colour-pair information
</CODE>
</PRE><BR>
  <H5><A name=tag_000_000_258_005>&nbsp;</A>Line-drawing Constants</H5>The 
  <I>&lt;curses.h&gt;</I> header defines the symbolic constants shown in the 
  leftmost two columns of the following table for use in drawing lines. The 
  symbolic constants that begin with ACS_ are <B>char</B> constants. The 
  symbolic constants that begin with WACS_ are <B>cchar_t</B> constants for use 
  with the wide-character interfaces that take a pointer to a <B>cchar_t</B>. 
  <P>In the POSIX locale, the characters shown in the <B>POSIX Locale 
  Default</B> column are used when the terminal database does not specify a 
  value using the <B>acsc</B> capability. 
  <P>
  <P>
  <TABLE align=center>
    <TBODY>
    <TR vAlign=top>
      <TH align=middle><B>char Constant</B> 
      <TH align=middle><B>cchar_t Constant</B> 
      <TH align=middle><B>POSIX Locale Default</B> 
      <TH align=middle><B>Glyph Description</B> 
    <TR vAlign=top>
      <TD align=middle>ACS_ULCORNER 
      <TD align=middle>WACS_ULCORNER 
      <TD align=middle>+ 
      <TD align=left>upper left-hand corner 
    <TR vAlign=top>
      <TD align=middle>ACS_LLCORNER 
      <TD align=middle>WACS_LLCORNER 
      <TD align=middle>+ 
      <TD align=left>lower left-hand corner 
    <TR vAlign=top>
      <TD align=middle>ACS_URCORNER 
      <TD align=middle>WACS_URCORNER 
      <TD align=middle>+ 
      <TD align=left>upper right-hand corner 
    <TR vAlign=top>
      <TD align=middle>ACS_LRCORNER 
      <TD align=middle>WACS_LRCORNER 
      <TD align=middle>+ 
      <TD align=left>lower right-hand corner 
    <TR vAlign=top>
      <TD align=middle>ACS_RTEE 
      <TD align=middle>WACS_RTEE 
      <TD align=middle>+ 
      <TD align=left>right tee 
    <TR vAlign=top>
      <TD align=middle>ACS_LTEE 
      <TD align=middle>WACS_LTEE 
      <TD align=middle>+ 
      <TD align=left>left tee 
    <TR vAlign=top>
      <TD align=middle>ACS_BTEE 
      <TD align=middle>WACS_BTEE 
      <TD align=middle>+ 
      <TD align=left>bottom tee 
    <TR vAlign=top>
      <TD align=middle>ACS_TTEE 
      <TD align=middle>WACS_TTEE 
      <TD align=middle>+ 
      <TD align=left>top tee 
    <TR vAlign=top>
      <TD align=middle>ACS_HLINE 
      <TD align=middle>WACS_HLINE 
      <TD align=middle>- 
      <TD align=left>horizontal line 
    <TR vAlign=top>
      <TD align=middle>ACS_VLINE 
      <TD align=middle>WACS_VLINE 
      <TD align=middle>| 
      <TD align=left>vertical line 
    <TR vAlign=top>
      <TD align=middle>ACS_PLUS 
      <TD align=middle>WACS_PLUS 
      <TD align=middle>+ 
      <TD align=left>plus 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -