]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/curses.priv.h
ncurses 5.9 - patch 20140215
[ncurses.git] / ncurses / curses.priv.h
index 281bb4b700fcfbc5b63517e76167ad501be75a20..7deffad5ea68b8f723cd1c6029fb2ec5fa613f86 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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            *
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.523 2013/01/26 21:51:56 tom Exp $
+ * $Id: curses.priv.h,v 1.530 2014/02/01 22:09:27 tom Exp $
  *
  *     curses.priv.h
  *
@@ -288,14 +288,6 @@ typedef TRIES {
  * Structure for palette tables
  */
 
-typedef struct
-{
-    short red, green, blue;    /* what color_content() returns */
-    short r, g, b;             /* params to init_color() */
-    int init;                  /* true if we called init_color() */
-}
-color_t;
-
 #define MAXCOLUMNS    135
 #define MAXLINES      66
 #define FIFO_SIZE     MAXCOLUMNS+2  /* for nocbreak mode input */
@@ -320,6 +312,14 @@ color_t;
 
 #include <curses.h>    /* we'll use -Ipath directive to get the right one! */
 
+typedef struct
+{
+    NCURSES_COLOR_T red, green, blue;  /* what color_content() returns */
+    NCURSES_COLOR_T r, g, b;           /* params to init_color() */
+    int init;                  /* true if we called init_color() */
+}
+color_t;
+
 /*
  * If curses.h did not expose the SCREEN-functions, then we do not need the
  * parameter in the corresponding unextended functions.
@@ -350,7 +350,7 @@ color_t;
 #define HasTerminal(sp)      (((sp) != 0) && (0 != ((sp)->_term)))
 #define IsValidScreen(sp)    (HasTerminal(sp) && !IsPreScreen(sp))
 
-#if BROKEN_LINKER || USE_REENTRANT
+#if USE_REENTRANT
 #define CurTerm              _nc_prescreen._cur_term
 #else
 #define CurTerm              cur_term
@@ -379,6 +379,16 @@ color_t;
 
 #include <nc_tparm.h>
 
+/*
+ * Simplify ifdef's for the "*_ATTR" macros in case italics are not configured.
+ */
+#ifdef A_ITALIC
+#define USE_ITALIC 1
+#else
+#define USE_ITALIC 0
+#define A_ITALIC 0
+#endif
+
 /*
  * Use these macros internally, to make tracing less verbose.  But leave the
  * option for compiling the tracing into the library.
@@ -835,6 +845,7 @@ typedef struct {
 
        char            *first_name;
        char            **keyname_table;
+       int             init_keyname;
 
        int             slk_format;
 
@@ -1088,6 +1099,9 @@ struct screen {
        /* used in lib_vidattr.c */
        bool            _use_rmso;      /* true if we may use 'rmso'         */
        bool            _use_rmul;      /* true if we may use 'rmul'         */
+#if USE_ITALIC
+       bool            _use_ritm;      /* true if we may use 'ritm'         */
+#endif
 
 #if USE_KLIBC_KBD
        bool            _extended_key;  /* true if an extended key           */
@@ -1333,8 +1347,8 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 
 #define UChar(c)       ((unsigned char)(c))
 #define UShort(c)      ((unsigned short)(c))
-#define ChCharOf(c)    ((c) & (chtype)A_CHARTEXT)
-#define ChAttrOf(c)    ((c) & (chtype)A_ATTRIBUTES)
+#define ChCharOf(c)    ((chtype)(c) & (chtype)A_CHARTEXT)
+#define ChAttrOf(c)    ((chtype)(c) & (chtype)A_ATTRIBUTES)
 
 #ifndef MB_LEN_MAX
 #define MB_LEN_MAX 8 /* should be >= MB_CUR_MAX, but that may be a function */
@@ -1703,7 +1717,9 @@ extern    NCURSES_EXPORT(void) name (void); \
        NCURSES_EXPORT(void) name (void) { }
 
 #define ALL_BUT_COLOR ((chtype)~(A_COLOR))
-#define NONBLANK_ATTR (A_NORMAL|A_BOLD|A_DIM|A_BLINK)
+#define NONBLANK_ATTR (A_BOLD | A_DIM | A_BLINK | A_ITALIC)
+#define TPARM_ATTR    (A_STANDOUT | A_UNDERLINE | A_REVERSE | A_BLINK | A_DIM | A_BOLD | A_ALTCHARSET | A_INVIS | A_PROTECT)
+#define XMC_CONFLICT  (A_STANDOUT | A_UNDERLINE | A_REVERSE | A_BLINK | A_DIM | A_BOLD | A_INVIS | A_PROTECT | A_ITALIC)
 #define XMC_CHANGES(c) ((c) & SP_PARM->_xmc_suppress)
 
 #define toggle_attr_on(S,at) {\
@@ -2328,12 +2344,13 @@ extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER;
 #endif
 
 #ifdef USE_TERM_DRIVER
-#define IsTermInfo(sp)       (TCBOf(sp) && ((TCBOf(sp)->drv->isTerminfo)))
+#define IsTermInfo(sp)       ((TCBOf(sp) != 0) && ((TCBOf(sp)->drv->isTerminfo)))
+#define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp))
 #else
 #define IsTermInfo(sp)       TRUE
+#define HasTInfoTerminal(sp) (0 != TerminalOf(sp))
 #endif
 
-#define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp))
 #define IsValidTIScreen(sp)  (HasTInfoTerminal(sp))
 
 /*
@@ -2383,7 +2400,7 @@ extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_set_tty_mode)(SCREEN*, TTY*)
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_setupscreen)(SCREEN**, int, int, FILE *, int, int);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_tgetent)(SCREEN*,char*,const char *);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_tigetnum)(SCREEN*,NCURSES_CONST char*);
-extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_vid_attr)(SCREEN *, attr_t, short, void *);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_vid_attr)(SCREEN *, attr_t, NCURSES_COLOR_T, void *);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_vidputs)(SCREEN*,chtype,int(*) (SCREEN*, int));
 extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_do_color)(SCREEN*, int, int, int, NCURSES_SP_OUTC);
 extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_do_xmc_glitch)(SCREEN*, attr_t);