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

📄 form.h

📁 ncurses 库 可能有用酒用 没用就算了 我觉得还可以用
💻 H
📖 第 1 页 / 共 2 页
字号:
/**************************************************************************** * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              * *                                                                          * * Permission is hereby granted, free of charge, to any person obtaining a  * * copy of this software and associated documentation files (the            * * "Software"), to deal in the Software without restriction, including      * * without limitation the rights to use, copy, modify, merge, publish,      * * distribute, distribute with modifications, sublicense, and/or sell       * * copies of the Software, and to permit persons to whom the Software is    * * furnished to do so, subject to the following conditions:                 * *                                                                          * * The above copyright notice and this permission notice shall be included  * * in all copies or substantial portions of the Software.                   * *                                                                          * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    * * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               * *                                                                          * * Except as contained in this notice, the name(s) of the above copyright   * * holders shall not be used in advertising or otherwise to promote the     * * sale, use or other dealings in this Software without prior written       * * authorization.                                                           * ****************************************************************************//**************************************************************************** *   Author:  Juergen Pfeifer, 1995,1997                                    * ****************************************************************************//* $Id: form.h,v 0.20 2004/12/04 22:22:10 tom Exp $ */#ifndef FORM_H#define FORM_H#include <curses.h>#include <eti.h>#ifdef __cplusplus  extern "C" {#endif#ifndef FORM_PRIV_Htypedef void *FIELD_CELL;#endif#ifndef NCURSES_FIELD_INTERNALS#define NCURSES_FIELD_INTERNALS /* nothing */#endiftypedef int Form_Options;typedef int Field_Options;	/**********	*  _PAGE  *	**********/typedef struct {  short pmin;		/* index of first field on page			*/  short pmax;		/* index of last field on page			*/  short smin;		/* index of top leftmost field on page		*/  short smax;		/* index of bottom rightmost field on page	*/} _PAGE;	/**********	*  FIELD  *	**********/typedef struct fieldnode {  unsigned short	status;		/* flags			*/  short			rows;		/* size in rows			*/  short			cols;		/* size in cols			*/  short			frow;		/* first row			*/  short			fcol;		/* first col			*/  int			drows;		/* dynamic rows			*/  int			dcols;		/* dynamic cols			*/  int			maxgrow;	/* maximum field growth		*/  int			nrow;		/* off-screen rows		*/  short			nbuf;		/* additional buffers		*/  short			just;		/* justification		*/  short			page;		/* page on form			*/  short			index;		/* into form -> field		*/  int			pad;		/* pad character		*/  chtype		fore;		/* foreground attribute		*/  chtype		back;		/* background attribute		*/  Field_Options		opts;		/* options			*/  struct fieldnode *	snext;		/* sorted order pointer		*/  struct fieldnode *	sprev;		/* sorted order pointer		*/  struct fieldnode *	link;		/* linked field chain		*/  struct formnode *	form;		/* containing form		*/  struct typenode *	type;		/* field type			*/  void *		arg;		/* argument for type		*/  FIELD_CELL *		buf;		/* field buffers		*/  void *		usrptr;		/* user pointer			*/  /*   * The wide-character configuration requires extra information.  Because   * there are existing applications that manipulate the members of FIELD   * directly, we cannot make the struct opaque.  Offsets of members up to   * this point are the same in the narrow- and wide-character configuration.   * But note that the type of buf depends on the configuration, and is made   * opaque for that reason.   */  NCURSES_FIELD_INTERNALS} FIELD;	/**************	*  FIELDTYPE  *	**************/typedef struct typenode {  unsigned short	status;			/* flags		*/  long			ref;			/* reference count	*/  struct typenode *	left;			/* ptr to operand for | */  struct typenode *	right;			/* ptr to operand for | */  void* (*makearg)(va_list *);			/* make fieldtype arg	*/  void* (*copyarg)(const void *);		/* copy fieldtype arg	*/  void	(*freearg)(void *);			/* free fieldtype arg	*/  bool	(*fcheck)(FIELD *,const void *);	/* field validation	*/  bool	(*ccheck)(int,const void *);		/* character validation */  bool	(*next)(FIELD *,const void *);		/* enumerate next value */  bool	(*prev)(FIELD *,const void *);		/* enumerate prev value */} FIELDTYPE;	/*********	*  FORM  *	*********/typedef struct formnode {  unsigned short	status;		/* flags			*/  short			rows;		/* size in rows			*/  short			cols;		/* size in cols			*/  int			currow;		/* current row in field window	*/  int			curcol;		/* current col in field window	*/  int			toprow;		/* in scrollable field window	*/  int			begincol;	/* in horiz. scrollable field	*/  short			maxfield;	/* number of fields		*/  short			maxpage;	/* number of pages		*/  short			curpage;	/* index into page		*/  Form_Options		opts;		/* options			*/  WINDOW *		win;		/* window			*/  WINDOW *		sub;		/* subwindow			*/  WINDOW *		w;		/* window for current field	*/  FIELD **		field;		/* field [maxfield]		*/  FIELD *		current;	/* current field		*/  _PAGE *		page;		/* page [maxpage]		*/  void *		usrptr;		/* user pointer			*/  void			(*forminit)(struct formnode *);  void			(*formterm)(struct formnode *);  void			(*fieldinit)(struct formnode *);  void			(*fieldterm)(struct formnode *);} FORM;typedef void (*Form_Hook)(FORM *);	/***************************	*  miscellaneous #defines  *	***************************//* field justification */#define NO_JUSTIFICATION	(0)#define JUSTIFY_LEFT		(1)#define JUSTIFY_CENTER		(2)#define JUSTIFY_RIGHT		(3)/* field options */#define O_VISIBLE		(0x0001U)#define O_ACTIVE		(0x0002U)#define O_PUBLIC		(0x0004U)#define O_EDIT			(0x0008U)#define O_WRAP			(0x0010U)#define O_BLANK			(0x0020U)#define O_AUTOSKIP		(0x0040U)#define O_NULLOK		(0x0080U)#define O_PASSOK		(0x0100U)#define O_STATIC		(0x0200U)/* form options */#define O_NL_OVERLOAD		(0x0001U)#define O_BS_OVERLOAD		(0x0002U)/* form driver commands */#define REQ_NEXT_PAGE	 (KEY_MAX + 1)	/* move to next page		*/#define REQ_PREV_PAGE	 (KEY_MAX + 2)	/* move to previous page	*/#define REQ_FIRST_PAGE	 (KEY_MAX + 3)	/* move to first page		*/#define REQ_LAST_PAGE	 (KEY_MAX + 4)	/* move to last page		*/#define REQ_NEXT_FIELD	 (KEY_MAX + 5)	/* move to next field		*/#define REQ_PREV_FIELD	 (KEY_MAX + 6)	/* move to previous field	*/#define REQ_FIRST_FIELD	 (KEY_MAX + 7)	/* move to first field		*/#define REQ_LAST_FIELD	 (KEY_MAX + 8)	/* move to last field		*/#define REQ_SNEXT_FIELD	 (KEY_MAX + 9)	/* move to sorted next field	*/#define REQ_SPREV_FIELD	 (KEY_MAX + 10)	/* move to sorted prev field	*/#define REQ_SFIRST_FIELD (KEY_MAX + 11)	/* move to sorted first field	*/#define REQ_SLAST_FIELD	 (KEY_MAX + 12)	/* move to sorted last field	*/

⌨️ 快捷键说明

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