]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/curses.priv.h
ncurses 5.7 - patch 20100306
[ncurses.git] / ncurses / curses.priv.h
index 3a61f764e4b1caf474417f501b39a011fdbf52a3..0018291d860c0d0fc79aad10b8168bff1c9c9618 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.452 2010/03/06 19:15:50 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>
@@ -176,6 +177,20 @@ extern NCURSES_EXPORT(int) _nc_env_access (void);
 extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
 #endif
 
+/*
+ * If we have va_copy(), use it for assigning va_list's.
+ */
+#if defined(HAVE___VA_COPY)
+#define begin_va_copy(dst,src) __va_copy(dst, src)
+#define end_va_copy(dst)       va_end(dst)
+#elif defined(va_copy) || defined(HAVE_VA_COPY)
+#define begin_va_copy(dst,src) va_copy(dst, src)
+#define end_va_copy(dst)       va_end(dst)
+#else
+#define begin_va_copy(dst,src) (dst) = (src)
+#define end_va_copy(dst)       /* nothing */
+#endif
+
 /*
  * Scroll hints are useless when hashmap is used
  */
@@ -557,6 +572,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 +1048,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 +1123,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 +1134,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;                          \