Exemplo n.º 1
0
char killchar(void)
{
    PDC_LOG(("killchar() - called\n"));

    return _DLCHAR;     /* line delete char (^U) */
}
Exemplo n.º 2
0
int wvline_set(WINDOW *win, const cchar_t *wch, int n)
{
    PDC_LOG(("wvline_set() - called\n"));

    return wch ? wvline(win, *wch, n) : ERR;
}
Exemplo n.º 3
0
bool has_colors(void)
{
    PDC_LOG(("has_colors() - called\n"));

    return !(SP->mono);
}
Exemplo n.º 4
0
int scr_set(const char *filename)
{
    PDC_LOG(("scr_set() - called: filename %s\n", filename));

    return scr_restore(filename);
}
Exemplo n.º 5
0
int box(WINDOW *win, chtype verch, chtype horch)
{
    PDC_LOG(("box() - called\n"));

    return wborder(win, verch, verch, horch, horch, 0, 0, 0, 0);
}
Exemplo n.º 6
0
int resetterm(void)
{
    PDC_LOG(("resetterm() - called\n"));

    return reset_shell_mode();
}
Exemplo n.º 7
0
int saveterm(void)
{
    PDC_LOG(("saveterm() - called\n"));

    return def_prog_mode();
}
Exemplo n.º 8
0
bool has_il(void)
{
    PDC_LOG(("has_il() - called\n"));

    return TRUE;
}
Exemplo n.º 9
0
int pnoutrefresh(WINDOW *w, int py, int px, int sy1, int sx1, int sy2, int sx2)
{
    int num_cols;
    int sline = sy1;
    int pline = py;

    PDC_LOG(("pnoutrefresh() - called\n"));

    if (!w || !(w->_flags & (_PAD|_SUBPAD)) || (sy2 >= LINES) || (sy2 >= COLS))
        return ERR;

    if (py < 0)
        py = 0;
    if (px < 0)
        px = 0;
    if (sy1 < 0)
        sy1 = 0;
    if (sx1 < 0)
        sx1 = 0;

    if (sy2 < sy1 || sx2 < sx1)
        return ERR;

    num_cols = min((sx2 - sx1 + 1), (w->_maxx - px));

    while (sline <= sy2)
    {
        if (pline < w->_maxy)
        {
            memcpy(curscr->_y[sline] + sx1, w->_y[pline] + px,
                   num_cols * sizeof(chtype));

            if ((curscr->_firstch[sline] == _NO_CHANGE) 
                || (curscr->_firstch[sline] > sx1))
                curscr->_firstch[sline] = sx1;

            if (sx2 > curscr->_lastch[sline])
                curscr->_lastch[sline] = sx2;

            w->_firstch[pline] = _NO_CHANGE; /* updated now */
            w->_lastch[pline] = _NO_CHANGE;  /* updated now */
        }

        sline++;
        pline++;
    }

    if (w->_clear)
    {
        w->_clear = FALSE;
        curscr->_clear = TRUE;
    }

    /* position the cursor to the pad's current position if possible -- 
       is the pad current position going to end up displayed? if not, 
       then don't move the cursor; if so, move it to the correct place */

    if (!w->_leaveit && w->_cury >= py && w->_curx >= px &&
         w->_cury <= py + (sy2 - sy1) && w->_curx <= px + (sx2 - sx1))
    {
        curscr->_cury = (w->_cury - py) + sy1;
        curscr->_curx = (w->_curx - px) + sx1;
    }

    return OK;
}
Exemplo n.º 10
0
int baudrate(void)
{
    PDC_LOG(("baudrate() - called\n"));

    return INT_MAX;
}
Exemplo n.º 11
0
char erasechar(void)
{
    PDC_LOG(("erasechar() - called\n"));

    return _ECHAR;      /* character delete char (^H) */
}
Exemplo n.º 12
0
char wordchar(void)
{
    PDC_LOG(("wordchar() - called\n"));

    return _DWCHAR;         /* word delete char */
}
Exemplo n.º 13
0
attr_t term_attrs(void)
{
    PDC_LOG(("term_attrs() - called\n"));

    return SP->termattrs;
}
Exemplo n.º 14
0
char *longname(void)
{
    PDC_LOG(("longname() - called\n"));

    return ttytype + 9; /* skip "pdcurses|" */
}
Exemplo n.º 15
0
int resetty(void)
{
    PDC_LOG(("resetty() - called\n"));

    return _restore_mode(PDC_SAVE_TTY);
}
Exemplo n.º 16
0
Arquivo: panel.c Projeto: ryoon/eCos
WINDOW *panel_window(const PANEL *pan)
{
    PDC_LOG(("panel_window() - called\n"));

    return pan->win;
}
Exemplo n.º 17
0
int draino(int ms)
{
    PDC_LOG(("draino() - called\n"));

    return napms(ms);
}
Exemplo n.º 18
0
//------------------------------------------------------------------------------
int waddch( WINDOW* win, const chtype ch )
{
	__QCS_FCONTEXT( "waddch" );

    int x, y;
    chtype text, attr;
    bool xlat;

    PDC_LOG(("waddch() - called: win=%p ch=%x (text=%c attr=0x%x)\n",
             win, ch, ch & A_CHARTEXT, ch & A_ATTRIBUTES));

    if( !win )
	{
        return ERR;
	}

    x = win->_curx;
    y = win->_cury;

    if( y > win->_maxy || x > win->_maxx || y < 0 || x < 0 )
	{
        return ERR;
	}

    xlat = !SP->raw_out && !(ch & A_ALTCHARSET);
    text = ch & A_CHARTEXT;
    attr = ch & A_ATTRIBUTES;

    if( xlat && ( text < ' ' || text == 0x7f ) )
    {
        int x2;

        switch( text )
        {
        case '\t':
            for( x2 = ( ( x / TABSIZE ) + 1 ) * TABSIZE; x < x2; x++ )
            {
                if( waddch( win, attr | ' ' ) == ERR )
				{
                    return ERR;
				}

                // if tab to next line, exit the loop

                if( !win->_curx )
				{
                    break;
				}
            }
            return 0;

        case '\n':
            // if lf -> crlf

            if( !SP->raw_out )
			{
                x = 0;
			}

            wclrtoeol( win );

            if( ++y > win->_bmarg )
            {
                y--;

                if( wscrl( win, 1 ) == ERR )
				{
                    return ERR;
				}
            }

            break;

        case '\b':
            // don't back over left margin

            if( --x < 0 )
        case '\r':
			{
                x = 0;
			}
            break;

        case 0x7f:

            if( waddch( win, attr | '^' ) == ERR )
			{
                return ERR;
			}

            return waddch( win, attr | '?' );

        default:
            // handle control chars

            if( waddch( win, attr | '^' ) == ERR )
			{
                return ERR;
			}

            return waddch( win, ch + '@' );
        }
    }
    else
    {
        /* If the incoming character doesn't have its own attribute,
           then use the current attributes for the window. If it has
           attributes but not a color component, OR the attributes to
           the current attributes for the window. If it has a color
           component, use the attributes solely from the incoming
           character. */

        if( !( attr & A_COLOR ) )
		{
            attr |= win->_attrs;
		}

        /* wrs (4/10/93): Apply the same sort of logic for the window 
           background, in that it only takes precedence if other color 
           attributes are not there and that the background character 
           will only print if the printing character is blank. */

        if( !( attr & A_COLOR ) )
		{
            attr |= win->_bkgd & A_ATTRIBUTES;
		}
        else
		{
            attr |= win->_bkgd & ( A_ATTRIBUTES ^ A_COLOR );
		}

        if( text == ' ' )
		{
            text = win->_bkgd & A_CHARTEXT;
		}

        // Add the attribute back into the character.

        text |= attr;

        /* Only change _firstch/_lastch if the character to be added is
           different from the character/attribute that is already in
           that position in the window. */

        if( win->_y[ y ][ x ] != text )
        {
            if( win->_firstch[ y ] == _NO_CHANGE )
			{
                win->_firstch[ y ] = win->_lastch[ y ] = x;
			}
            else
			{
                if( x < win->_firstch[ y ] )
				{
                    win->_firstch[ y ] = x;
				}
                else
				{
                    if( x > win->_lastch[ y ] )
					{
                        win->_lastch[ y ] = x;
					}
				}
			}

            win->_y[ y ][ x ] = text;
        }

        if( ++x >= win->_maxx )
        {
            // wrap around test

            x = 0;

            if( ++y > win->_bmarg )
            {
                y--;

                if( wscrl( win, 1 ) == ERR )
                {
                    PDC_sync( win );
                    return ERR;
                }
            }
        }
    }

    win->_curx = x;
    win->_cury = y;

    if( win->_immed )
	{
        wrefresh( win );
	}

    if( win->_sync )
	{
        wsyncup( win );
	}

    return 0;
}
Exemplo n.º 19
0
int fixterm(void)
{
    PDC_LOG(("fixterm() - called\n"));

    return reset_prog_mode();
}
Exemplo n.º 20
0
int clrtobot(void)
{
	PDC_LOG(("clrtobot() - called\n"));

	return wclrtobot(stdscr);
}
Exemplo n.º 21
0
int scr_init(const char *filename)
{
    PDC_LOG(("scr_init() - called: filename %s\n", filename));

    return OK;
}
Exemplo n.º 22
0
int erase(void)
{
	PDC_LOG(("erase() - called\n"));

	return werase(stdscr);
}
Exemplo n.º 23
0
WINDOW *getwin(FILE *filep)
{
    WINDOW *win;
    char marker[4];
    int i, nlines, ncols;

    PDC_LOG(("getwin() - called\n"));

    if ( !(win = malloc(sizeof(WINDOW))) )
        return (WINDOW *)NULL;

    /* check for the marker, and load the WINDOW struct */

    if (!filep || !fread(marker, 4, 1, filep) || strncmp(marker, "PDC", 3)
            || marker[3] != DUMPVER || !fread(win, sizeof(WINDOW), 1, filep))
    {
        free(win);
        return (WINDOW *)NULL;
    }

    nlines = win->_maxy;
    ncols = win->_maxx;

    /* allocate the line pointer array */

    if ( !(win->_y = malloc(nlines * sizeof(chtype *))) )
    {
        free(win);
        return (WINDOW *)NULL;
    }

    /* allocate the minchng and maxchng arrays */

    if ( !(win->_firstch = malloc(nlines * sizeof(int))) )
    {
        free(win->_y);
        free(win);
        return (WINDOW *)NULL;
    }

    if ( !(win->_lastch = malloc(nlines * sizeof(int))) )
    {
        free(win->_firstch);
        free(win->_y);
        free(win);
        return (WINDOW *)NULL;
    }

    /* allocate the lines */

    if ( !(win = PDC_makelines(win)) )
        return (WINDOW *)NULL;

    /* read them */

    for (i = 0; i < nlines; i++)
    {
        if (!fread(win->_y[i], ncols * sizeof(chtype), 1, filep))
        {
            delwin(win);
            return (WINDOW *)NULL;
        }
    }

    touchwin(win);

    return win;
}
Exemplo n.º 24
0
int clear(void)
{
	PDC_LOG(("clear() - called\n"));

	return wclear(stdscr);
}
Exemplo n.º 25
0
int vline(chtype ch, int n)
{
    PDC_LOG(("vline() - called\n"));

    return wvline(stdscr, ch, n);
}
Exemplo n.º 26
0
int clrtoeol(void)
{
	PDC_LOG(("clrtoeol() - called\n"));

	return wclrtoeol(stdscr);
}
Exemplo n.º 27
0
int vline_set(const cchar_t *wch, int n)
{
    PDC_LOG(("vline_set() - called\n"));

    return wvline_set(stdscr, wch, n);
}
Exemplo n.º 28
0
int draino_async(int ms, void (*callback)(void*))
{
    PDC_LOG(("draino_async() - called\n"));

    return napms_async(ms, callback);
}
Exemplo n.º 29
0
bool can_change_color(void)
{
    PDC_LOG(("can_change_color() - called\n"));

    return PDC_can_change_color();
}
Exemplo n.º 30
0
void PDC_reset_shell_mode(void)
{
    PDC_LOG(("PDC_reset_shell_mode() - called.\n"));
}