/****************************************************************************
- * Copyright (c) 2008-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2008-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 *
# endif
#endif
-MODULE_ID("$Id: tinfo_driver.c,v 1.24 2012/07/28 20:12:11 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.38 2014/04/26 18:47:20 juergen Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
return TINFO_DOUPDATE(TCB->csp);
}
+static const char *
+drv_Name(TERMINAL_CONTROL_BLOCK * TCB)
+{
+ (void) TCB;
+ return "tinfo";
+}
+
static bool
drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret)
{
TERMINAL *termp;
SCREEN *sp;
+ T((T_CALLED("tinfo::drv_CanHandle(%p)"), TCB));
+
assert(TCB != 0 && tname != 0);
termp = (TERMINAL *) TCB;
sp = TCB->csp;
TCB->magic = TCBMAGIC;
-#if (USE_DATABASE || USE_TERMCAP)
+#if (NCURSES_USE_DATABASE || NCURSES_USE_TERMCAP)
status = _nc_setup_tinfo(tname, &termp->type);
#else
status = TGETENT_NO;
ret_error1(TGETENT_YES, "I can't handle hardcopy terminals.\n", tname);
}
- return result;
+ returnBool(result);
}
static int
/* FIXME: should make sure that we are not in altchar mode */
if (beepFlag) {
if (bell) {
- res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell);
+ res = NCURSES_PUTP2("bell", bell);
NCURSES_SP_NAME(_nc_flush) (sp);
} else if (flash_screen) {
- res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
- "flash_screen",
- flash_screen);
+ res = NCURSES_PUTP2("flash_screen", flash_screen);
NCURSES_SP_NAME(_nc_flush) (sp);
}
} else {
if (flash_screen) {
- res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
- "flash_screen",
- flash_screen);
+ res = NCURSES_PUTP2("flash_screen", flash_screen);
NCURSES_SP_NAME(_nc_flush) (sp);
} else if (bell) {
- res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell);
+ res = NCURSES_PUTP2("bell", bell);
NCURSES_SP_NAME(_nc_flush) (sp);
}
}
SetSP();
if (orig_pair != 0) {
- NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_pair", orig_pair);
+ NCURSES_PUTP2("orig_pair", orig_pair);
result = TRUE;
}
return result;
SetSP();
if (orig_colors != 0) {
- NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_colors", orig_colors);
+ NCURSES_PUTP2("orig_colors", orig_colors);
result = TRUE;
}
return result;
/* try asking the OS */
{
TERMINAL *termp = (TERMINAL *) TCB;
- if (isatty(termp->Filedes)) {
+ if (NC_ISATTY(termp->Filedes)) {
STRUCT_WINSIZE size;
errno = 0;
if (sp) {
if (sp->_keypad_on)
_nc_keypad(sp, TRUE);
- NC_BUFFERED(sp, TRUE);
}
code = OK;
}
if (sp) {
_nc_keypad(sp, FALSE);
NCURSES_SP_NAME(_nc_flush) (sp);
- NC_BUFFERED(sp, FALSE);
}
code = drv_sgmode(TCB, TRUE, &(_term->Ottyb));
}
* _nc_setupscreen(). Do it now anyway, so we can initialize the
* baudrate.
*/
- if (isatty(trm->Filedes)) {
- TCB->drv->mode(TCB, TRUE, TRUE);
+ if (NC_ISATTY(trm->Filedes)) {
+ TCB->drv->td_mode(TCB, TRUE, TRUE);
}
}
tp[f].red, tp[f].green, tp[f].blue,
tp[b].red, tp[b].green, tp[b].blue));
- NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
- "initialize_pair",
- TPARM_7(initialize_pair,
- pair,
- tp[f].red, tp[f].green, tp[f].blue,
- tp[b].red, tp[b].green, tp[b].blue));
+ NCURSES_PUTP2("initialize_pair",
+ TPARM_7(initialize_pair,
+ pair,
+ tp[f].red, tp[f].green, tp[f].blue,
+ tp[b].red, tp[b].green, tp[b].blue));
}
}
AssertTCB();
if (initialize_color != NULL) {
- NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
- "initialize_color",
- TPARM_4(initialize_color, color, r, g, b));
+ NCURSES_PUTP2("initialize_color",
+ TPARM_4(initialize_color, color, r, g, b));
}
}
} else
#endif
{
- rc = TCBOf(sp)->drv->twait(TCBOf(sp),
- TWAIT_MASK,
- delay,
- (int *) 0
- EVENTLIST_2nd(evl));
+ rc = TCBOf(sp)->drv->td_twait(TCBOf(sp),
+ TWAIT_MASK,
+ delay,
+ (int *) 0
+ EVENTLIST_2nd(evl));
#if USE_SYSMOUSE
if ((sp->_mouse_type == M_SYSMOUSE)
&& (sp->_sysmouse_head < sp->_sysmouse_tail)
{
SCREEN *sp = TCB->csp;
AssertTCB();
- return TINFO_MVCUR(sp, yold, xold, ynew, xnew);
+ return NCURSES_SP_NAME(_nc_mvcur) (sp, yold, xold, ynew, xnew);
}
static void
AssertTCB();
if (labnum > 0 && labnum <= num_labels) {
- NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
- "plab_norm",
- TPARM_2(plab_norm, labnum, text));
+ NCURSES_PUTP2("plab_norm",
+ TPARM_2(plab_norm, labnum, text));
}
}
AssertTCB();
if (OnFlag) {
- NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_on", label_on);
+ NCURSES_PUTP2("label_on", label_on);
} else {
- NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_off", label_off);
+ NCURSES_PUTP2("label_off", label_off);
}
}
if (sp && sp->_coloron)
attrs |= A_COLOR;
+#if USE_ITALIC
+ if (enter_italics_mode)
+ attrs |= A_ITALIC;
+#endif
+
return (attrs);
}
AssertTCB();
assert(sp != 0);
if (ena_acs != NULL) {
- NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "ena_acs", ena_acs);
+ NCURSES_PUTP2("ena_acs", ena_acs);
}
#if NCURSES_EXT_FUNCS
/*
size_t i;
for (i = 1; i < ACS_LEN; ++i) {
if (real_map[i] == 0) {
- real_map[i] = i;
+ real_map[i] = (chtype) i;
if (real_map != fake_map) {
if (sp != 0)
sp->_screen_acs_map[i] = TRUE;
if (magic_cookie_glitch > 0) { /* tvi, wyse */
- sp->_xmc_triggers = sp->_ok_attributes & (
- A_STANDOUT |
- A_UNDERLINE |
- A_REVERSE |
- A_BLINK |
- A_DIM |
- A_BOLD |
- A_INVIS |
- A_PROTECT
- );
+ sp->_xmc_triggers = sp->_ok_attributes & XMC_CONFLICT;
#if 0
/*
* We "should" treat colors as an attribute. The wyse350 (and its
int rc = ERR;
if (value) {
- rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value);
+ rc = NCURSES_PUTP2(name, value);
}
return rc;
}
NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_TINFO_DRIVER = {
TRUE,
+ drv_Name, /* Name */
drv_CanHandle, /* CanHandle */
drv_init, /* init */
drv_release, /* release */