]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - menu/menu.priv.h
ncurses 5.0
[ncurses.git] / menu / menu.priv.h
index fb39c77975fd55d3e040a24ccf3089b352d13c56..4c2a22d1ff8e0443939ce36acbf4b094b3620c27 100644 (file)
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /****************************************************************************
- *   Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1995,1997        *
+ *   Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997            *
  ****************************************************************************/
 
 /***************************************************************************
@@ -50,10 +50,12 @@ extern MENU _nc_Default_Menu;
 /* Normalize menu to default if none was given */
 #define Normalize_Menu( menu ) ((menu)=(menu)?(menu):&_nc_Default_Menu)
 
+/* Get the user defined (framing) window of the menu */
+#define Get_Menu_UserWin(menu) ((menu)->userwin ? (menu)->userwin : stdscr)
+
 /* Normalize menu window */
 #define Get_Menu_Window(  menu ) \
-   ( (menu)->usersub  ? (menu)->usersub  : (\
-     (menu)->userwin  ? (menu)->userwin  : stdscr ))
+   ((menu)->usersub  ? (menu)->usersub  : Get_Menu_UserWin(menu))
 
 /* menu specific status flags */
 #define _LINK_NEEDED    (0x04)
@@ -83,7 +85,7 @@ extern MENU _nc_Default_Menu;
 
 /* This macro ensures, that the item becomes visible, if possible with the
    specified row as the top row of the window. If this is not possible,
-   the top row will be adjusted and the value is stored in the row argument. 
+   the top row will be adjusted and the value is stored in the row argument.
 */
 #define Adjust_Current_Item(menu,row,item) \
   { if ((item)->y < row) \
@@ -98,7 +100,7 @@ extern MENU _nc_Default_Menu;
   { (menu)->pindex = 0; \
     (menu)->pattern[0] = '\0'; }
 
-/* Internal functions. */                                              
+/* Internal functions. */
 extern void _nc_Draw_Menu(const MENU *);
 extern void _nc_Show_Menu(const MENU *);
 extern void _nc_Calculate_Item_Length_and_Width(MENU *);
@@ -108,3 +110,5 @@ extern void _nc_Disconnect_Items(MENU *);
 extern void _nc_New_TopRow_and_CurrentItem(MENU *,int, ITEM *);
 extern void _nc_Link_Items(MENU *);
 extern int  _nc_Match_Next_Character_In_Item_Name(MENU*,int,ITEM**);
+extern int  _nc_menu_cursor_pos(const MENU* menu, const ITEM* item,
+                               int* pY, int* pX);