// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 2007 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2011,2012 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 *
#include "internal.h"
#include "cursesw.h"
-MODULE_ID("$Id: cursesw.cc,v 1.48 2007/03/24 19:00:58 tom Exp $")
+MODULE_ID("$Id: cursesw.cc,v 1.53 2012/12/08 22:06:41 tom Exp $")
#define COLORS_NEED_INITIALIZATION -1
#define COLORS_NOT_INITIALIZED 0
}
+int
+NCursesWindow::scanw(const char* fmt, va_list args)
+{
+ int result = ERR;
+
+ result = ::vw_scanw (w, const_cast<NCURSES_CONST char *>(fmt), args);
+
+ return result;
+}
+
+
+int
+NCursesWindow::scanw(int y, int x, const char* fmt, va_list args)
+{
+ int result = ERR;
+
+ if (::wmove(w, y, x) != ERR) {
+ result = ::vw_scanw (w, const_cast<NCURSES_CONST char *>(fmt), args);
+ }
+ return result;
+}
+
+
int
NCursesWindow::printw(const char * fmt, ...)
{
}
+int
+NCursesWindow::printw(const char * fmt, va_list args)
+{
+ int result = ::vw_printw(w, fmt, args);
+ return result;
+}
+
+
+int
+NCursesWindow::printw(int y, int x, const char * fmt, va_list args)
+{
+ int result = ::wmove(w, y, x);
+ if (result == OK) {
+ result = ::vw_printw(w, fmt, args);
+ }
+ return result;
+}
+
+
void
NCursesWindow::set_keyboard(void)
{
constructing();
w = static_cast<WINDOW *>(0);
- set_keyboard();
}
NCursesWindow::NCursesWindow(int nlines, int ncols, int begin_y, int begin_x)
NCursesWindow::NCursesWindow(WINDOW *win, int ncols)
: w(0), alloced(FALSE), par(0), subwins(0), sib(0)
{
+ (void) ncols;
initialize();
w = win;
- assert((w->_maxx +1 ) == ncols);
}
int _nc_xx_ripoff_init(WINDOW *w, int ncols)
{
+ (void) ncols;
int res = ERR;
RIPOFFINIT init = *prip++;
if (init) {
- NCursesWindow* W = new NCursesWindow(w,ncols);
- res = init(*W);
+ res = init(*(new NCursesWindow(w,ncols)));
}
return res;
}
#if HAVE_HAS_KEY
bool NCursesWindow::has_mouse() const
{
- return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse())
+ return ((::has_key(KEY_MOUSE) || ::has_mouse())
? TRUE : FALSE);
}
#endif