MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "module.h"
+#include "signals.h"
#include "settings.h"
#include "term.h"
#include "mainwindows.h"
-#ifdef HAVE_CUIX
-#include "cuix.h"
-#endif
-
-#include "term-curses.h"
+#if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
+# include <ncurses.h>
+#else
+# include <curses.h>
+#endif
#include <termios.h>
#include <signal.h>
# define _POSIX_VDISABLE 0
#endif
+struct _TERM_WINDOW {
+ int x, y;
+ int width, height;
+ WINDOW *win;
+};
+
TERM_WINDOW *root_window;
static int curs_x, curs_y;
wmove(window->win, y, x);
}
-void term_addch(TERM_WINDOW *window, int chr)
+void term_addch(TERM_WINDOW *window, char chr)
{
waddch(window->win, chr);
}
void term_refresh(TERM_WINDOW *window)
{
-#ifdef HAVE_CUIX
- if (!cuix_active) {
-#endif
if (window != NULL)
wnoutrefresh(window->win);
if (freeze_refresh == 0) {
move(curs_y, curs_x);
wnoutrefresh(stdscr);
-#ifdef HAVE_CUIX
- cuix_refresh ();
-#endif
doupdate();
}
-#ifdef HAVE_CUIX
- } else {
- update_panels ();
- doupdate ();
- }
-#endif
}
void term_stop(void)
irssi_redraw();
}
-void term_auto_detach(int set)
-{
-}
-
void term_set_input_type(int type)
{
}
-int term_gets(unichar *buffer, int size)
+void term_gets(GArray *buffer, int *line_count)
{
- int count;
#ifdef WIDEC_CURSES
wint_t key;
#else
int key;
#endif
- for (count = 0; count < size; ) {
+ for (;;) {
#ifdef WIDEC_CURSES
if (get_wch(&key) == ERR)
#else
continue;
#endif
- buffer[count++] = key;
+ g_array_append_val(buffer, key);
+ if (key == '\r' || key == '\n')
+ (*line_count)++;
}
-
- return count;
}