Bug Fix
- Conditional compilation (via FEATURE_NCURSES_COLS) to either use ncurses COLS and LINES global variables, or determine these from the WINDOW structure.
This commit is contained in:
@@ -58,14 +58,15 @@ int Context::interactive ()
|
|||||||
// throw std::string ("unimplemented Context::interactive");
|
// throw std::string ("unimplemented Context::interactive");
|
||||||
|
|
||||||
// Fake interactive teaser...
|
// Fake interactive teaser...
|
||||||
/*
|
#ifdef FEATURE_NCURSES_COLS
|
||||||
WINDOW* w = initscr ();
|
|
||||||
int width = w->_maxx + 1;
|
|
||||||
int height = w->_maxy + 1;
|
|
||||||
*/
|
|
||||||
initscr ();
|
initscr ();
|
||||||
int width = COLS;
|
int width = COLS;
|
||||||
int height = LINES;
|
int height = LINES;
|
||||||
|
#else
|
||||||
|
WINDOW* w = initscr ();
|
||||||
|
int width = w->_maxx + 1;
|
||||||
|
int height = w->_maxy + 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
(void) nonl ();
|
(void) nonl ();
|
||||||
(void) cbreak ();
|
(void) cbreak ();
|
||||||
@@ -141,12 +142,13 @@ int Context::getWidth ()
|
|||||||
#ifdef HAVE_LIBNCURSES
|
#ifdef HAVE_LIBNCURSES
|
||||||
if (config.get ("curses", true))
|
if (config.get ("curses", true))
|
||||||
{
|
{
|
||||||
/*
|
#ifdef FEATURE_NCURSES_COLS
|
||||||
WINDOW* w = initscr ();
|
|
||||||
width = w->_maxx + 1;
|
|
||||||
*/
|
|
||||||
initscr ();
|
initscr ();
|
||||||
width = COLS;
|
width = COLS;
|
||||||
|
#else
|
||||||
|
WINDOW* w = initscr ();
|
||||||
|
width = w->_maxx + 1;
|
||||||
|
#endif
|
||||||
endwin ();
|
endwin ();
|
||||||
|
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
|
|||||||
@@ -27,9 +27,10 @@
|
|||||||
#ifndef INCLUDED_MAIN
|
#ifndef INCLUDED_MAIN
|
||||||
#define INCLUDED_MAIN
|
#define INCLUDED_MAIN
|
||||||
|
|
||||||
#define FEATURE_TDB_OPT 1 // TDB Optimization reduces file I/O.
|
#define FEATURE_TDB_OPT 1 // TDB Optimization reduces file I/O.
|
||||||
#define FEATURE_NEW_ID 1 // Echoes back new id.
|
#define FEATURE_NEW_ID 1 // Echoes back new id.
|
||||||
#define FEATURE_SHELL 1 // Interactive shell.
|
#define FEATURE_SHELL 1 // Interactive shell.
|
||||||
|
#define FEATURE_NCURSES_COLS 1 // Shortcut that avoids WINDOW.
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
Reference in New Issue
Block a user