Difference between revisions of "Source:NetHack 3.6.0/include/winami.h"

From NetHackWiki
Jump to navigation Jump to search
m (oopsies)
 
Line 1: Line 1:
 
__MIXEDSYNTAXHIGHLIGHT__
 
__MIXEDSYNTAXHIGHLIGHT__
Below is the full text to '''winGnome.h''' from the [[NetHack 3.6.0 source code|source code]] of [[NetHack 3.6.0]]. To link to a particular line, write [[Source:NetHack 3.6.0/include/winGnome.h#line123|<nowiki>[[Source:NetHack 3.6.0/include/winGnome.h#line123]]</nowiki>]], for example.
+
Below is the full text to '''winami.h''' from the [[NetHack 3.6.0 source code|source code]] of [[NetHack 3.6.0]]. To link to a particular line, write [[Source:NetHack 3.6.0/include/winami.h#line123|<nowiki>[[Source:NetHack 3.6.0/include/winami.h#line123]]</nowiki>]], for example.
  
 
{{NGPL}}
 
{{NGPL}}
  <span id="line1">1. /* NetHack 3.6 winGnome.h $NHDT-Date: 1432512782 2015/05/25 00:13:02 $  $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */</span>
+
  <span id="line1">1. /* NetHack 3.6 winami.h $NHDT-Date: 1432512780 2015/05/25 00:13:00 $  $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */</span>
  <span id="line2">2. /* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */</span>
+
  <span id="line2">2. /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991. */</span>
  <span id="line3">3. /* Copyright (C) 1998 by Anthony Taylor <tonyt@ptialaska.net> */</span>
+
  <span id="line3">3. /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1992, 1993. */</span>
 
  <span id="line4">4. /* NetHack may be freely redistributed.  See license for details. */</span>
 
  <span id="line4">4. /* NetHack may be freely redistributed.  See license for details. */</span>
 
  <span id="line5">5. </span>
 
  <span id="line5">5. </span>
  <span id="line6">6. #ifndef WINGNOME_H</span>
+
  <span id="line6">6. #ifndef WINAMI_H</span>
  <span id="line7">7. #define WINGNOME_H</span>
+
  <span id="line7">7. #define WINAMI_H</span>
 
  <span id="line8">8. </span>
 
  <span id="line8">8. </span>
  <span id="line9">9. #define E extern</span>
+
  <span id="line9">9. #define MAXWINTAGS 5</span>
 
  <span id="line10">10. </span>
 
  <span id="line10">10. </span>
  <span id="line11">11. E struct window_procs Gnome_procs;</span>
+
  <span id="line11">11. /*</span>
  <span id="line12">12. </span>
+
  <span id="line12">12.  * Information specific to a menu window.  First a structure for each</span>
  <span id="line13">13. #undef E</span>
+
  <span id="line13">13.  * menu entry, then the structure for each menu window.</span>
  <span id="line14">14. </span>
+
  <span id="line14">14.  */</span>
  <span id="line15">15. #define NHW_WORN 6</span>
+
  <span id="line15">15. typedef struct amii_mi {</span>
  <span id="line16">16. extern winid WIN_WORN;</span>
+
  <span id="line16">16.     struct amii_mi *next;</span>
  <span id="line17">17. </span>
+
  <span id="line17">17.    anything identifier; /* Opaque type to identify this selection */</span>
  <span id="line18">18. #endif /* WINGNOME_H */</span>
+
  <span id="line18">18.     long glyph;          /* Glyph for menu item */</span>
[[Category:NetHack 3.6.0 source code|include/winGnome.h]]
+
<span id="line19">19.     long count;          /* Object count */</span>
 +
<span id="line20">20.     char selected;      /* Been selected? */</span>
 +
<span id="line21">21.     char selector;      /* Char used to select this entry. */</span>
 +
<span id="line22">22.     char gselector;      /* Group selector */</span>
 +
<span id="line23">23.     char canselect;      /* Can user select this entry. */</span>
 +
<span id="line24">24.     char attr;          /* Attribute for the line. */</span>
 +
<span id="line25">25.     char *str;          /* The text of the item. */</span>
 +
<span id="line26">26. } amii_menu_item;</span>
 +
<span id="line27">27. </span>
 +
<span id="line28">28. struct amii_menu {</span>
 +
<span id="line29">29.     amii_menu_item *items; /* Starting pointer for item list. */</span>
 +
<span id="line30">30.     amii_menu_item *last;  /* End pointer for item list. */</span>
 +
<span id="line31">31.     const char *query;    /* Query string */</span>
 +
<span id="line32">32.     int count;            /* Number of strings. */</span>
 +
<span id="line33">33.     char chr;              /* Character to assign for accelerator */</span>
 +
<span id="line34">34. };</span>
 +
<span id="line35">35. </span>
 +
<span id="line36">36. /* descriptor for Amiga Intuition-based windows.  If we decide to cope with</span>
 +
<span id="line37">37.  * tty-style windows also, then things will need to change. */</span>
 +
<span id="line38">38. /* per-window data */</span>
 +
<span id="line39">39. struct amii_WinDesc {</span>
 +
<span id="line40">40.     xchar type; /* type of window */</span>
 +
<span id="line41">41.     struct amii_menu menu;</span>
 +
<span id="line42">42.     boolean active; /* true if window is active */</span>
 +
<span id="line43">43.     boolean wasup;  /* true if menu/text window was already open */</span>
 +
<span id="line44">44.     short</span>
 +
<span id="line45">45.         disprows; /* Rows displayed so far (used for paging in message win) */</span>
 +
<span id="line46">46.     xchar offx, offy;        /* offset from topleft of display */</span>
 +
<span id="line47">47.     short vwx, vwy, vcx, vcy; /* View cursor location */</span>
 +
<span id="line48">48.     short rows, cols;        /* dimensions */</span>
 +
<span id="line49">49.     short curx, cury;        /* current cursor position */</span>
 +
<span id="line50">50.     short maxrow, maxcol;    /* the maximum size used -- for INVEN wins */</span>
 +
<span id="line51">51.     /* maxcol is also used by WIN_MESSAGE for */</span>
 +
<span id="line52">52.     /* tracking the ^P command */</span>
 +
<span id="line53">53.     char **data;        /* window data [row][column] */</span>
 +
<span id="line54">54.     menu_item *mi;      /* Menu information */</span>
 +
<span id="line55">55.     char *resp;        /* valid menu responses (for NHW_INVEN) */</span>
 +
<span id="line56">56.     char *canresp;      /* cancel responses; 1st is the return value */</span>
 +
<span id="line57">57.     char *morestr;      /* string to display instead of default */</span>
 +
<span id="line58">58.                         /* amiga stuff */</span>
 +
<span id="line59">59.     struct Window *win; /* Intuition window pointer */</span>
 +
<span id="line60">60. #ifdef INTUI_NEW_LOOK</span>
 +
<span id="line61">61.     struct ExtNewWindow *newwin; /* NewWindow alloc'd */</span>
 +
<span id="line62">62. #else</span>
 +
<span id="line63">63.     struct NewWindow *newwin; /* ExtNewWindow alloc'd */</span>
 +
<span id="line64">64. #endif</span>
 +
<span id="line65">65. #ifdef INTUI_NEW_LOOK</span>
 +
<span id="line66">66.     struct TagItem wintags[MAXWINTAGS]; /* Tag items for this window */</span>
 +
<span id="line67">67. #else</span>
 +
<span id="line68">68.     long wintags[MAXWINTAGS * 2];</span>
 +
<span id="line69">69. #endif</span>
 +
<span id="line70">70.     void *hook;        /* Hook structure pointer for tiles version */</span>
 +
<span id="line71">71. #define FLMAP_INGLYPH 1 /* An NHW_MAP window is in glyph mode */</span>
 +
<span id="line72">72. #define FLMAP_CURSUP 2  /* An NHW_MAP window has the cursor displayed */</span>
 +
<span id="line73">73. #define FLMAP_SKIP 4</span>
 +
<span id="line74">74. #define FLMSG_FIRST \</span>
 +
<span id="line75">75.     1 /* First message in the NHW_MESSAGE window for this turn */</span>
 +
<span id="line76">76.     long wflags;</span>
 +
<span id="line77">77.     short cursx, cursy; /* Where the cursor is displayed at */</span>
 +
<span id="line78">78.     short curs_apen,    /* Color cursor is displayed in */</span>
 +
<span id="line79">79.         curs_bpen;</span>
 +
<span id="line80">80. };</span>
 +
<span id="line81">81. </span>
 +
<span id="line82">82. /* descriptor for intuition-based displays -- all the per-display data */</span>
 +
<span id="line83">83. /* this is a generic thing - think of it as Screen level */</span>
 +
<span id="line84">84. </span>
 +
<span id="line85">85. struct amii_DisplayDesc {</span>
 +
<span id="line86">86.     /* we need this for Screen size (which will vary with display mode) */</span>
 +
<span id="line87">87.     uchar rows, cols; /* width & height of display in text units */</span>
 +
<span id="line88">88.     short xpix, ypix; /* width and height of display in pixels */</span>
 +
<span id="line89">89.     int toplin;      /* flag for topl stuff */</span>
 +
<span id="line90">90.     int rawprint;    /* number of raw_printed lines since synch */</span>
 +
<span id="line91">91.     winid lastwin;    /* last window used for I/O */</span>
 +
<span id="line92">92. };</span>
 +
<span id="line93">93. </span>
 +
<span id="line94">94. typedef enum {</span>
 +
<span id="line95">95.     WEUNK,</span>
 +
<span id="line96">96.     WEKEY,</span>
 +
<span id="line97">97.     WEMOUSE,</span>
 +
<span id="line98">98.     WEMENU,</span>
 +
<span id="line99">99. } WETYPE;</span>
 +
<span id="line100">100. </span>
 +
<span id="line101">101. typedef struct WEVENT {</span>
 +
<span id="line102">102.     WETYPE type;</span>
 +
<span id="line103">103.     union {</span>
 +
<span id="line104">104.         int key;</span>
 +
<span id="line105">105.         struct {</span>
 +
<span id="line106">106.             int x, y;</span>
 +
<span id="line107">107.             int qual;</span>
 +
<span id="line108">108.         } mouse;</span>
 +
<span id="line109">109.         long menucode;</span>
 +
<span id="line110">110.     } un;</span>
 +
<span id="line111">111. } WEVENT;</span>
 +
<span id="line112">112. </span>
 +
<span id="line113">113. #define MAXWIN 20 /* maximum number of windows, cop-out */</span>
 +
<span id="line114">114. </span>
 +
<span id="line115">115. /* port specific variable declarations */</span>
 +
<span id="line116">116. extern winid WIN_BASE;</span>
 +
<span id="line117">117. extern winid WIN_OVER;</span>
 +
<span id="line118">118. #define NHW_BASE 6</span>
 +
<span id="line119">119. #define NHW_OVER 7 /* overview window */</span>
 +
<span id="line120">120. </span>
 +
<span id="line121">121. extern struct amii_WinDesc *amii_wins[MAXWIN + 1];</span>
 +
<span id="line122">122. </span>
 +
<span id="line123">123. extern struct amii_DisplayDesc</span>
 +
<span id="line124">124.     *amiIDisplay; /* the Amiga Intuition descriptor */</span>
 +
<span id="line125">125. </span>
 +
<span id="line126">126. extern char morc;        /* last character typed to xwaitforspace */</span>
 +
<span id="line127">127. extern char defmorestr[]; /* default --more-- prompt */</span>
 +
<span id="line128">128. </span>
 +
<span id="line129">129. #endif /* WINAMI_H */</span>
 +
[[Category:NetHack 3.6.0 source code|include/winami.h]]

Latest revision as of 13:46, 15 December 2015

Below is the full text to winami.h from the source code of NetHack 3.6.0. To link to a particular line, write [[Source:NetHack 3.6.0/include/winami.h#line123]], for example.

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.

 /* NetHack 3.6	winami.h	$NHDT-Date: 1432512780 2015/05/25 00:13:00 $  $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991. */
 /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1992, 1993. */
 /* NetHack may be freely redistributed.  See license for details. */
 
 #ifndef WINAMI_H
 #define WINAMI_H
 
 #define MAXWINTAGS 5
 
 /*
  * Information specific to a menu window.  First a structure for each
  * menu entry, then the structure for each menu window.
  */
 typedef struct amii_mi {
     struct amii_mi *next;
     anything identifier; /* Opaque type to identify this selection */
     long glyph;          /* Glyph for menu item */
     long count;          /* Object count */
     char selected;       /* Been selected? */
     char selector;       /* Char used to select this entry. */
     char gselector;      /* Group selector */
     char canselect;      /* Can user select this entry. */
     char attr;           /* Attribute for the line. */
     char *str;           /* The text of the item. */
 } amii_menu_item;
 
 struct amii_menu {
     amii_menu_item *items; /* Starting pointer for item list. */
     amii_menu_item *last;  /* End pointer for item list. */
     const char *query;     /* Query string */
     int count;             /* Number of strings. */
     char chr;              /* Character to assign for accelerator */
 };
 
 /* descriptor for Amiga Intuition-based windows.  If we decide to cope with
  * tty-style windows also, then things will need to change. */
 /* per-window data */
 struct amii_WinDesc {
     xchar type; /* type of window */
     struct amii_menu menu;
     boolean active; /* true if window is active */
     boolean wasup;  /* true if menu/text window was already open */
     short
         disprows; /* Rows displayed so far (used for paging in message win) */
     xchar offx, offy;         /* offset from topleft of display */
     short vwx, vwy, vcx, vcy; /* View cursor location */
     short rows, cols;         /* dimensions */
     short curx, cury;         /* current cursor position */
     short maxrow, maxcol;     /* the maximum size used -- for INVEN wins */
     /* maxcol is also used by WIN_MESSAGE for */
     /* tracking the ^P command */
     char **data;        /* window data [row][column] */
     menu_item *mi;      /* Menu information */
     char *resp;         /* valid menu responses (for NHW_INVEN) */
     char *canresp;      /* cancel responses; 1st is the return value */
     char *morestr;      /* string to display instead of default */
                         /* amiga stuff */
     struct Window *win; /* Intuition window pointer */
 #ifdef INTUI_NEW_LOOK
     struct ExtNewWindow *newwin; /* NewWindow alloc'd */
 #else
     struct NewWindow *newwin; /* ExtNewWindow alloc'd */
 #endif
 #ifdef INTUI_NEW_LOOK
     struct TagItem wintags[MAXWINTAGS]; /* Tag items for this window */
 #else
     long wintags[MAXWINTAGS * 2];
 #endif
     void *hook;         /* Hook structure pointer for tiles version */
 #define FLMAP_INGLYPH 1 /* An NHW_MAP window is in glyph mode */
 #define FLMAP_CURSUP 2  /* An NHW_MAP window has the cursor displayed */
 #define FLMAP_SKIP 4
 #define FLMSG_FIRST \
     1 /* First message in the NHW_MESSAGE window for this turn */
     long wflags;
     short cursx, cursy; /* Where the cursor is displayed at */
     short curs_apen,    /* Color cursor is displayed in */
         curs_bpen;
 };
 
 /* descriptor for intuition-based displays -- all the per-display data */
 /* this is a generic thing - think of it as Screen level */
 
 struct amii_DisplayDesc {
     /* we need this for Screen size (which will vary with display mode) */
     uchar rows, cols; /* width & height of display in text units */
     short xpix, ypix; /* width and height of display in pixels */
     int toplin;       /* flag for topl stuff */
     int rawprint;     /* number of raw_printed lines since synch */
     winid lastwin;    /* last window used for I/O */
 };
 
 typedef enum {
     WEUNK,
     WEKEY,
     WEMOUSE,
     WEMENU,
 } WETYPE;
 
 typedef struct WEVENT {
     WETYPE type;
     union {
         int key;
         struct {
             int x, y;
             int qual;
         } mouse;
         long menucode;
     } un;
 } WEVENT;
 
 #define MAXWIN 20 /* maximum number of windows, cop-out */
 
 /* port specific variable declarations */
 extern winid WIN_BASE;
 extern winid WIN_OVER;
 #define NHW_BASE 6
 #define NHW_OVER 7 /* overview window */
 
 extern struct amii_WinDesc *amii_wins[MAXWIN + 1];
 
 extern struct amii_DisplayDesc
     *amiIDisplay; /* the Amiga Intuition descriptor */
 
 extern char morc;         /* last character typed to xwaitforspace */
 extern char defmorestr[]; /* default --more-- prompt */
 
 #endif /* WINAMI_H */