Source:NetHack 3.1.0/wintty.h

From NetHackWiki
Revision as of 07:54, 4 March 2008 by Kernigh bot (talk | contribs) (NetHack 3.1.0/wintty.h moved to Source:NetHack 3.1.0/wintty.h: Robot: moved page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Below is the full text to wintty.h from the source code of NetHack 3.1.0. To link to a particular line, write [[NetHack 3.1.0/wintty.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1.    /*	SCCS Id: @(#)wintty.h	3.1	92/10/06		  */
2.    /* Copyright (c) David Cohrs, 1991,1992				  */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #ifndef WINTTY_H
6.    #define WINTTY_H
7.    
8.    #define E extern
9.    
10.   #ifndef WINDOW_STRUCTS
11.   #define WINDOW_STRUCTS
12.   
13.   /* descriptor for tty-based windows */
14.   struct WinDesc {
15.       int flags;			/* window flags */
16.       xchar type;			/* type of window */
17.       boolean active;		/* true if window is active */
18.       uchar offx, offy;		/* offset from topleft of display */
19.       short rows, cols;		/* dimensions */
20.       short curx, cury;		/* current cursor position */
21.       short maxrow, maxcol;	/* the maximum size used -- for MENU wins */
22.   				/* maxcol is also used by WIN_MESSAGE for */
23.   				/* tracking the ^P command */
24.       char **data;		/* window data [row][column] */
25.       char *resp;			/* valid menu responses (for NHW_MENU) */
26.       char *canresp;		/* cancel responses; 1st is the return value */
27.       char *morestr;		/* string to display instead of default */
28.   };
29.   
30.   /* window flags */
31.   #define WIN_CANCELLED 1
32.   #define WIN_STOP 1		/* for NHW_MESSAGE; stops output */
33.   
34.   /* descriptor for tty-based displays -- all the per-display data */
35.   struct DisplayDesc {
36.       uchar rows, cols;		/* width and height of tty display */
37.       uchar curx, cury;		/* current cursor position on the screen */
38.   #ifdef TEXTCOLOR
39.       int color;			/* current color */
40.   #endif
41.       int attrs;			/* attributes in effect */
42.       int toplin;			/* flag for topl stuff */
43.       int rawprint;		/* number of raw_printed lines since synch */
44.       int inmore;			/* non-zero if more() is active */
45.       int inread;			/* non-zero if reading a character */
46.       winid lastwin;		/* last window used for I/O */
47.   };
48.   
49.   #endif /* WINDOW_STRUCTS */
50.   
51.   #define MAXWIN 20		/* maximum number of windows, cop-out */
52.   
53.   /* tty dependent window types */
54.   #define NHW_BASE    6
55.   
56.   extern struct window_procs tty_procs;
57.   
58.   /* port specific variable declarations */
59.   extern winid BASE_WINDOW;
60.   
61.   extern struct WinDesc *wins[MAXWIN];
62.   
63.   extern struct DisplayDesc *ttyDisplay;	/* the tty display descriptor */
64.   
65.   extern char morc;		/* last character typed to xwaitforspace */
66.   extern char defmorestr[];	/* default --more-- prompt */
67.   
68.   /* port specific external function references */
69.   
70.   /* ### getline.c ### */
71.   E void FDECL(xwaitforspace, (const char *));
72.   
73.   /* ### termcap.c ### */
74.   
75.   E void FDECL(tty_startup,(int*, int*));
76.   #if defined(apollo)
77.   /* Apollos don't widen old-style function definitions properly -- they try to
78.    * be smart and use the prototype, or some such strangeness.  So we have to
79.    * define UNWIDENDED_PROTOTYPES (in tradstdc.h), which makes CHAR_P below a
80.    * char.  But the tputs termcap call was compiled as if xputc's argument
81.    * actually would be expanded.  So here, we have to make an exception. */
82.   E void FDECL(xputc, (int));
83.   #else
84.   E void FDECL(xputc, (CHAR_P));
85.   #endif
86.   E void FDECL(xputs, (const char *));
87.   E void NDECL(cl_end);
88.   E void NDECL(clear_screen);
89.   E void NDECL(home);
90.   E void NDECL(standoutbeg);
91.   E void NDECL(standoutend);
92.   # if 0
93.   E void NDECL(revbeg);
94.   E void NDECL(boldbeg);
95.   E void NDECL(blinkbeg);
96.   E void NDECL(dimbeg);
97.   E void NDECL(m_end);
98.   # endif
99.   E void NDECL(backsp);
100.  E void NDECL(graph_on);
101.  E void NDECL(graph_off);
102.  E void NDECL(cl_eos);
103.  
104.  /* ### topl.c ### */
105.  
106.  E void FDECL(addtopl, (const char *));
107.  E void NDECL(more);
108.  E void FDECL(update_topl, (const char *));
109.  E void FDECL(putsyms, (const char*));
110.  
111.  /* ### wintty.c ### */
112.  #ifdef CLIPPING
113.  E void NDECL(setclipped);
114.  #endif
115.  E void FDECL(docorner, (int, int));
116.  E void NDECL(end_glyphout);
117.  E void FDECL(g_putch, (UCHAR_P));
118.  E void NDECL(win_tty_init);
119.  
120.  /* external declarations */
121.  E void NDECL(tty_init_nhwindows);
122.  E void NDECL(tty_player_selection);
123.  E void NDECL(tty_askname);
124.  E void NDECL(tty_get_nh_event) ;
125.  E void FDECL(tty_exit_nhwindows, (const char *));
126.  E void FDECL(tty_suspend_nhwindows, (const char *));
127.  E void NDECL(tty_resume_nhwindows);
128.  E winid FDECL(tty_create_nhwindow, (int));
129.  E void FDECL(tty_clear_nhwindow, (winid));
130.  E void FDECL(tty_display_nhwindow, (winid, BOOLEAN_P));
131.  E void FDECL(tty_dismiss_nhwindow, (winid));
132.  E void FDECL(tty_destroy_nhwindow, (winid));
133.  E void FDECL(tty_curs, (winid,int,int));
134.  E void FDECL(tty_putstr, (winid, int, const char *));
135.  E void FDECL(tty_display_file, (const char *, BOOLEAN_P));
136.  E void FDECL(tty_start_menu, (winid));
137.  E void FDECL(tty_add_menu, (winid, CHAR_P, int, const char *));
138.  E void FDECL(tty_end_menu, (winid, CHAR_P, const char *, const char *));
139.  E char FDECL(tty_select_menu, (winid));
140.  E void NDECL(tty_update_inventory);
141.  E void NDECL(tty_mark_synch);
142.  E void NDECL(tty_wait_synch);
143.  #ifdef CLIPPING
144.  E void FDECL(tty_cliparound, (int, int));
145.  #endif
146.  E void FDECL(tty_print_glyph, (winid,XCHAR_P,XCHAR_P,int));
147.  E void FDECL(tty_raw_print, (const char *));
148.  E void FDECL(tty_raw_print_bold, (const char *));
149.  E int NDECL(tty_nhgetch);
150.  E int FDECL(tty_nh_poskey, (int *, int *, int *));
151.  E void NDECL(tty_nhbell);
152.  E int NDECL(tty_doprev_message);
153.  E char FDECL(tty_yn_function, (const char *, const char *, CHAR_P));
154.  E void FDECL(tty_getlin, (const char *,char *));
155.  #ifdef COM_COMPL
156.  E void FDECL(tty_get_ext_cmd, (char *));
157.  #endif /* COM_COMPL */
158.  E void FDECL(tty_number_pad, (int));
159.  E void NDECL(tty_delay_output);
160.  
161.  /* other defs that really should go away (they're tty specific) */
162.  E void NDECL(tty_start_screen);
163.  E void NDECL(tty_end_screen);
164.  
165.  #undef E
166.  
167.  #endif /* WINTTY_H */