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

📄 show.h

📁 Unix环境下的curses编程库。
💻 H
字号:
#ifndef _MINE_SHOW_H
#define _MINE_SHOW_H

#include <curses.h>


/* this define used by the returned value of function nGetCharNoDelay() */
#define UpArrow 	0x0441
#define DownArrow	0x0442
#define LeftArrow	0x0444
#define RightArrow	0x0443
#define NoArrow 	0x0445
#define HomeKey 	0x0448
#define EndKey  	0x0446
#define PgUpKey 	0x0449
#define PgDnKey 	0x0447
#define EscKey  	0x001B
#define BackSpace	0x0008

#define ColorBlack      COLOR_BLACK
#define ColorRed        COLOR_RED
#define ColorGreen      COLOR_GREEN
#define ColorYellow     COLOR_YELLOW
#define ColorBlue       COLOR_BLUE
#define ColorMagenta    COLOR_MAGENTA
#define ColorCyan       COLOR_CYAN
#define ColorWhite      COLOR_WHITE

   /* Set the colors pair for specified attribute. */
#define setColorAttrs(nAttrs, nForeColor, nBackColor) init_pair(nAttrs, nForeColor, nBackColor)

#define displayOneProcInfo(wno, ns, title, con)  displayAttrOneProcInfo(wno, ns, 0, 0, title, con)
#define displayMessage(wno, con)  displayAttrMessage(wno, 0, con)
#define displayWindowTitle(wno, title)  displayAttrWindowTitle(wno, 0, title)
#define displayErrorMsg(con)  displayAttrErrorMsg(0, con)
#define displayPromptMsg(con)  displayAttrPromptMsg(0, con)
#define displayPromptStatus(ns, con)  displayAttrPromptStatus(ns, 0, con)

#ifdef __cplusplus
extern "C" {
#endif

/* Write In show.c */
   /* In all function of display...(), it returns 0 if success,
      or returns -1 if fail. */
   /* Initial the curses, and set the delay time when get char.
      If set nDelayTime to -1, get-char will return only after
       user presses any key. */
extern void initShowSystem(int nDelayTime);
   /* Create all windows, the main window's number is nMainWinNumber.
      Main window is numbered from 0 to nMainWinNumber-1.
      If need window for show error message, set nHaveErrWin to 1. */
extern int  createWindows(int nMainWinNumber, int nHaveErrWin);
   /* Display the title of No. nWindowNo window.
      If nWindow is -1, the title is for errormsg-window. */
extern int  displayAttrWindowTitle(int nWindowNo, short nAttrs, char *sTitle);
   /* Display the running sign, which is offered by system. */
extern void displayFlag();
   /* Display the runnig sign, which is offered by sRunSign. */
extern void displayStringFlag(char *sRunSign);

   /* Display one item of message to No. nWindowNo window.
      This message's serial number is nSerno(from 0 to ...).
      The title of message is sTitle and the contents is sContents. */
extern int  displayAttrOneProcInfo(int nWindowNo, int nSerno, short nIdAttrs,
                               short nStsAttrs, char *sTitle, char *sContents);
   /* Display error message */
extern int  displayAttrErrorMsg(short nAttrs, char *spErrorMsg);

   /* Set the No. nWindowNo window to current window */
extern void setCurActiveWindow(int nWindowNo);
   /* Let the current window move up nScrollLines lines. */
extern void upScrollWindow(int nScrollLines);
   /* Let the current window move down nScrollLines lines. */
extern void downScrollWindow(int nScrollLines);
   /* Get User's key from current window. */
extern int  getCharNoDelay();
   /* Let current window scrolls up one page. */
extern void pageupWindow();
   /* Let current window scrolls down one page. */
extern void pagedownWindow();
   /* Delete the message, which serial is nSerno, from
       No. nWindowNo window. */
extern int  deleteContent(int nWindowNo, int nSerno);
   /* display messages in specified window. */
extern int  displayAttrMessage(int nWindowNo, short nAttrs, char *sMessages);

   /* Destroy all windows before quit. */
extern void destroyWindows();
   /* Quit the curses. */
extern void exitShowSystem();

   /* This function is used for debug.
      It will get a string from prompt-window,
      and return the length of sGetContents. 
      The string contents are storaged in sGetContents,
      the string's maximum length is nMaxLength. */
extern int  getPrompt(char *sGetContents, int nMaxLength);
   /* Display prompt message */
extern int  displayAttrPromptMsg(short nAttrs, char *sPromptMsg);

   /* Display system's status in the bottom of prompt window,
      nSerial must be from 1 to 5. sContents is the contents.
      If nSerial is less than 1, we will assume it as 1;
      if nSerial is greater than 5, we will assume it as 5. */
extern int  displayAttrPromptStatus(int nSerial, short nAttrs, char *sContents);
   /* clear system's status showed in the bottom of prompt window.
      nSerial must be from 1 to 5.
      If nSerial is less than 1, we will assume it as 1;
      if nSerial is greater than 5, we will assume it as 5. */
extern int  clearPromptStatus(int nSerial);

#ifdef __cplusplus
}
#endif

#endif      /* end of _MINE_SHOW_H */

⌨️ 快捷键说明

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