]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - include/curses.h.in
ncurses 6.0 - patch 20170212
[ncurses.git] / include / curses.h.in
index 9825424c2b5d4c8dcae8c2567ec07e00d68ac394..4c6e370a78e168419d30965f71777b37fc2a2879 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.243 2016/01/23 22:20:31 tom Exp $ */
+/* $Id: curses.h.in,v 1.246 2017/02/11 16:00:56 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
@@ -95,7 +95,7 @@
  * total foreground and background colors.
  *
  * X/Open uses "short" for both of these types, ultimately because they are
- * numbers from the terminal database, which uses 16-bit signed values.
+ * numbers from the SVr4 terminal database, which uses 16-bit signed values.
  */
 #undef NCURSES_COLOR_T
 #define        NCURSES_COLOR_T short
 #define        NCURSES_PAIRS_T short
 
 /*
- * Definition used to make WINDOW and similar structs opaque.
+ * Definitions used to make WINDOW and similar structs opaque.
  */
-#ifndef @cf_cv_enable_opaque@
-#define NCURSES_OPAQUE @NCURSES_OPAQUE@
+#ifndef NCURSES_INTERNALS
+#define NCURSES_OPAQUE       @NCURSES_OPAQUE@
+#define NCURSES_OPAQUE_FORM  @NCURSES_OPAQUE_FORM@
+#define NCURSES_OPAQUE_MENU  @NCURSES_OPAQUE_MENU@
+#define NCURSES_OPAQUE_PANEL @NCURSES_OPAQUE_PANEL@
+#endif
+
+/*
+ * Definition used to optionally suppress wattr* macros to help with the
+ * transition from ncurses5 to ncurses6 by allowing the header files to
+ * be shared across development packages for ncursesw in both ABIs.
+ */
+#ifndef NCURSES_WATTR_MACROS
+#define NCURSES_WATTR_MACROS @NCURSES_WATTR_MACROS@
 #endif
 
 /*
@@ -1153,6 +1165,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);     /*
 #define wattroff(win,at)       wattr_off(win, NCURSES_CAST(attr_t, at), NULL)
 
 #if !NCURSES_OPAQUE
+#if NCURSES_WATTR_MACROS
 #if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@
 #define wattrset(win,at)       ((win) \
                                  ? ((win)->_color = NCURSES_CAST(int, PAIR_NUMBER(at)), \
@@ -1165,6 +1178,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);     /*
                                     OK) \
                                  : ERR)
 #endif
+#endif /* NCURSES_WATTR_MACROS */
 #endif /* NCURSES_OPAQUE */
 
 #define scroll(win)            wscrl(win,1)
@@ -1192,7 +1206,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);     /*
 /*
  * These apply to the first 256 color pairs.
  */
-#define COLOR_PAIR(n)  NCURSES_BITS((n), 0)
+#define COLOR_PAIR(n)  (NCURSES_BITS((n), 0) & A_COLOR)
 #define PAIR_NUMBER(a) (NCURSES_CAST(int,((NCURSES_CAST(unsigned long,(a)) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
 
 /*
@@ -1301,6 +1315,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);     /*
 #define slk_attr_on(a,v)               ((v) ? ERR : slk_attron(a))
 
 #if !NCURSES_OPAQUE
+#if NCURSES_WATTR_MACROS
 #if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@
 #define wattr_set(win,a,p,opts)                (((win) \
                                          ? ((win)->_attrs = ((a) & ~A_COLOR), \
@@ -1319,6 +1334,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);     /*
                                         (void)(((p) != (void *)0) ? (*(p) = (NCURSES_PAIRS_T) ((win) ? PAIR_NUMBER((win)->_attrs) : 0)) : OK), \
                                         OK)
 #endif
+#endif /* NCURSES_WATTR_MACROS */
 #endif /* NCURSES_OPAQUE */
 
 /*