]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/curses.priv.h
ncurses 5.7 - patch 20100227
[ncurses.git] / ncurses / curses.priv.h
index 3a61f764e4b1caf474417f501b39a011fdbf52a3..7d75ebae36c9965352d69cdcbab0f8ce73255201 100644 (file)
@@ -35,7 +35,7 @@
 
 
 /*
- * $Id: curses.priv.h,v 1.447 2010/01/16 21:32:59 tom Exp $
+ * $Id: curses.priv.h,v 1.451 2010/02/06 19:15:52 tom Exp $
  *
  *     curses.priv.h
  *
@@ -61,6 +61,7 @@ extern "C" {
 #define MODULE_ID(id) /*nothing*/
 #endif
 
+#include <stddef.h>            /* for offsetof */
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -557,6 +558,9 @@ typedef enum {
 #if USE_SYSMOUSE
        ,M_SYSMOUSE             /* FreeBSD sysmouse on console */
 #endif
+#ifdef USE_TERM_DRIVER
+       ,M_TERM_DRIVER          /* Win32 console, etc */
+#endif
 } MouseType;
 
 /*
@@ -1030,6 +1034,13 @@ struct screen {
        int             _sysmouse_new_buttons;
 #endif
 
+#ifdef USE_TERM_DRIVER
+       MEVENT          _drv_mouse_fifo[FIFO_SIZE];
+       int             _drv_mouse_head;
+       int             _drv_mouse_tail;
+       int             _drv_mouse_old_buttons;
+       int             _drv_mouse_new_buttons;
+#endif
        /*
         * This supports automatic resizing
         */
@@ -1098,9 +1109,9 @@ extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;
 extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 
        WINDOWLIST {
-       WINDOW  win;            /* first, so WINDOW_EXT() works */
        WINDOWLIST *next;
        SCREEN *screen;         /* screen containing the window */
+       WINDOW  win;            /* WINDOW_EXT() needs to account for offset */
 #ifdef _XOPEN_SOURCE_EXTENDED
        char addch_work[(MB_LEN_MAX * 9) + 1];
        unsigned addch_used;    /* number of bytes in addch_work[] */
@@ -1109,7 +1120,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 #endif
 };
 
-#define WINDOW_EXT(win,field) (((WINDOWLIST *)(win))->field)
+#define WINDOW_EXT(w,m) (((WINDOWLIST *)((char *)(w) - offsetof(WINDOWLIST, win)))->m)
 
 #define SP_PRE_INIT(sp)                         \
     sp->_cursrow = -1;                          \