mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-25 00:05:16 +00:00
flash() was not implemented for Win32 or X (despite much code to that
effect). Here's a nice portable implementation, which also allows me to remove PDC_scroll() (this is the last place it was used). To Do: Should the delay be longer?
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* See the file maintain.er for details of the current maintainer. *
|
||||
************************************************************************/
|
||||
|
||||
/* $Id: curspriv.h,v 1.85 2006/07/15 15:13:40 wmcbrine Exp $ */
|
||||
/* $Id: curspriv.h,v 1.86 2006/07/15 20:46:23 wmcbrine Exp $ */
|
||||
|
||||
/* CURSPRIV.H
|
||||
|
||||
@@ -118,7 +118,6 @@ int PDC_reset_shell_mode(void);
|
||||
int PDC_resize_screen(int, int);
|
||||
int PDC_scr_close(void);
|
||||
int PDC_scr_open(SCREEN *, bool);
|
||||
int PDC_scroll(int, int, int, int, int, chtype);
|
||||
int PDC_set_ctrl_break(bool);
|
||||
int PDC_set_cursor_mode(int, int);
|
||||
int PDC_set_font(int);
|
||||
@@ -176,11 +175,11 @@ void PDC_debug(const char *, ...);
|
||||
#ifdef XCURSES
|
||||
enum
|
||||
{
|
||||
CURSES_CLEAR_SELECTION = 999985, CURSES_DISPLAY_CURSOR,
|
||||
CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR,
|
||||
CURSES_SET_SELECTION, CURSES_GET_SELECTION, CURSES_TITLE,
|
||||
CURSES_REFRESH_SCROLLBAR, CURSES_RESIZE, CURSES_CLEAR,
|
||||
CURSES_FLASH, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR,
|
||||
CURSES_CHILD, CURSES_REFRESH, CURSES_EXIT
|
||||
CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR, CURSES_CHILD,
|
||||
CURSES_REFRESH, CURSES_EXIT
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -555,7 +555,6 @@ FUNCTIONS
|
||||
PDC_query_adapter_type pdcgetsc
|
||||
PDC_rawgetch pdckbd
|
||||
PDC_scrn_modes_equal pdcscrn
|
||||
PDC_scroll pdcdisp
|
||||
PDC_scr_close pdcscrn
|
||||
PDC_scr_open pdcscrn
|
||||
PDC_set_ctrl_break pdckbd
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
RCSID("$Id: pdcdisp.c,v 1.33 2006/07/15 15:38:24 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcdisp.c,v 1.34 2006/07/15 20:46:23 wmcbrine Exp $");
|
||||
|
||||
extern unsigned char atrtab[MAX_ATRTAB];
|
||||
|
||||
@@ -279,56 +279,6 @@ int PDC_putctty(chtype character, chtype color)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
PDC_scroll() - low level screen scroll
|
||||
|
||||
PDCurses Description:
|
||||
Scrolls a window in the current page up or down. Urow, lcol,
|
||||
lrow, rcol are the window coordinates. Lines is the number of
|
||||
lines to scroll. If 0, clears the window, if < 0 scrolls down,
|
||||
if > 0 scrolls up. Blanks areas that are left, and sets
|
||||
character attributes to attr. If in a colour graphics mode,
|
||||
fills them with the colour 'attr' instead.
|
||||
|
||||
PDCurses Return Value:
|
||||
The PDC_scroll() function returns OK on success otherwise ERR is
|
||||
returned.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scroll(int urow, int lcol, int rcol,
|
||||
int nlines, chtype attr);
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr)
|
||||
{
|
||||
int phys_attr = chtype_attr(attr);
|
||||
|
||||
PDC_LOG(("PDC_scroll() - called: urow %d lcol %d lrow %d "
|
||||
"rcol %d nlines %d\n", urow, lcol, lrow, rcol, nlines));
|
||||
|
||||
if (nlines >= 0)
|
||||
{
|
||||
regs.h.ah = 0x06;
|
||||
regs.h.al = (unsigned char) nlines;
|
||||
}
|
||||
else
|
||||
{
|
||||
regs.h.ah = 0x07;
|
||||
regs.h.al = (unsigned char) (-nlines);
|
||||
}
|
||||
|
||||
regs.h.bh = (unsigned char)(phys_attr >> 8);
|
||||
regs.h.ch = (unsigned char) urow;
|
||||
regs.h.cl = (unsigned char) lcol;
|
||||
regs.h.dh = (unsigned char) lrow;
|
||||
regs.h.dl = (unsigned char) rcol;
|
||||
int86(0x10, ®s, ®s);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
PDC_transform_line() - display a physical line of the screen
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <curses.h>
|
||||
#include <string.h>
|
||||
|
||||
RCSID("$Id: pdcdisp.c,v 1.26 2006/07/15 16:07:05 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcdisp.c,v 1.27 2006/07/15 20:46:23 wmcbrine Exp $");
|
||||
|
||||
extern unsigned char atrtab[MAX_ATRTAB];
|
||||
|
||||
@@ -192,63 +192,6 @@ int PDC_putctty(chtype character, chtype color)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
PDC_scroll() - low level screen scroll
|
||||
|
||||
PDCurses Description:
|
||||
Scrolls a window in the current page up or down. Urow, lcol,
|
||||
lrow, rcol are the window coordinates. Lines is the number of
|
||||
lines to scroll. If 0, clears the window, if < 0 scrolls down,
|
||||
if > 0 scrolls up. Blanks areas that are left, and sets
|
||||
character attributes to attr. If in a colour graphics mode,
|
||||
fills them with the colour 'attr' instead.
|
||||
|
||||
PDCurses Return Value:
|
||||
The PDC_scroll() function returns OK on success otherwise ERR is
|
||||
returned.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scroll(int urow, int lcol, int rcol,
|
||||
int nlines, chtype attr);
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr)
|
||||
{
|
||||
int phys_attr = chtype_attr(attr);
|
||||
|
||||
#ifndef EMXVIDEO
|
||||
USHORT ch = (phys_attr | SP->blank);
|
||||
#endif
|
||||
|
||||
PDC_LOG(("PDC_scroll() - called: urow %d lcol %d lrow %d "
|
||||
"rcol %d nlines %d\n", urow, lcol, lrow, rcol, nlines));
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
v_attrib(phys_attr);
|
||||
|
||||
if (nlines > 0)
|
||||
v_scroll(lcol, urow, rcol, lrow, nlines, V_SCROLL_UP);
|
||||
else
|
||||
if (nlines < 0)
|
||||
v_scroll(lcol, urow, rcol, lrow, -nlines,
|
||||
V_SCROLL_DOWN);
|
||||
else /* this clears the whole screen */
|
||||
v_scroll(lcol, urow, rcol, lrow, -1, V_SCROLL_CLEAR);
|
||||
#else
|
||||
if (nlines > 0)
|
||||
VioScrollUp(urow, lcol, lrow, rcol, nlines, (PBYTE)&ch, 0);
|
||||
else
|
||||
if (nlines < 0)
|
||||
VioScrollDn(urow, lcol, lrow, rcol, nlines,
|
||||
(PBYTE)&ch, 0);
|
||||
else /* this clears the whole screen ?? */
|
||||
VioScrollUp(0, 0, -1, -1, -1, (PBYTE)&ch, 0);
|
||||
#endif
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
PDC_transform_line() - display a physical line of the screen
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
# undef wrefresh
|
||||
#endif
|
||||
|
||||
RCSID("$Id: beep.c,v 1.20 2006/07/15 15:38:24 wmcbrine Exp $");
|
||||
RCSID("$Id: beep.c,v 1.21 2006/07/15 20:46:23 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -73,15 +73,21 @@ int beep(void)
|
||||
|
||||
int flash(void)
|
||||
{
|
||||
int z, y, x;
|
||||
|
||||
PDC_LOG(("flash() - called\n"));
|
||||
|
||||
#ifdef XCURSES
|
||||
XCursesInstructAndWait(CURSES_FLASH);
|
||||
#else
|
||||
PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, A_NORMAL);
|
||||
napms(50);
|
||||
PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, A_REVERSE);
|
||||
wrefresh(curscr);
|
||||
#endif
|
||||
for (z = 0; z < 2; z++) {
|
||||
|
||||
for (y = 0; y < LINES; y++)
|
||||
for (x = 0; x < COLS; x++)
|
||||
curscr->_y[y][x] ^= A_REVERSE;
|
||||
|
||||
wrefresh(curscr);
|
||||
|
||||
if (!z)
|
||||
napms(50);
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -295,7 +295,6 @@ EXPORTS PDC_putc
|
||||
EXPORTS PDC_putctty
|
||||
EXPORTS PDC_query_adapter_type
|
||||
EXPORTS PDC_rawgetch
|
||||
EXPORTS PDC_scroll
|
||||
EXPORTS PDC_scr_close
|
||||
EXPORTS PDC_scr_open
|
||||
EXPORTS PDC_setclipboard
|
||||
|
||||
@@ -288,7 +288,6 @@ PDC_putc
|
||||
PDC_putctty
|
||||
PDC_query_adapter_type
|
||||
PDC_rawgetch
|
||||
PDC_scroll
|
||||
PDC_scr_close
|
||||
PDC_scr_open
|
||||
PDC_setclipboard
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
extern HANDLE hConOut;
|
||||
extern unsigned char atrtab[MAX_ATRTAB];
|
||||
|
||||
RCSID("$Id: pdcdisp.c,v 1.25 2006/07/15 16:07:06 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcdisp.c,v 1.26 2006/07/15 20:46:23 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -195,36 +195,6 @@ int PDC_putctty(chtype character, chtype color)
|
||||
return PDC_putc(character, color);
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
PDC_scroll() - low level screen scroll
|
||||
|
||||
PDCurses Description:
|
||||
Scrolls a window in the current page up or down. Urow, lcol,
|
||||
lrow, rcol are the window coordinates. Lines is the number of
|
||||
lines to scroll. If 0, clears the window, if < 0 scrolls down,
|
||||
if > 0 scrolls up. Blanks areas that are left, and sets
|
||||
character attributes to attr. If in a colour graphics mode,
|
||||
fills them with the colour 'attr' instead.
|
||||
|
||||
PDCurses Return Value:
|
||||
The PDC_scroll() function returns OK on success otherwise ERR is
|
||||
returned.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scroll(int urow, int lcol, int rcol,
|
||||
int nlines, chtype attr);
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr)
|
||||
{
|
||||
PDC_LOG(("PDC_scroll() - called: urow %d lcol %d lrow %d "
|
||||
"rcol %d nlines %d\n", urow, lcol, lrow, rcol, nlines));
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
PDC_transform_line() - display a physical line of the screen
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
RCSID("$Id: x11.c,v 1.49 2006/07/08 00:21:41 wmcbrine Exp $");
|
||||
RCSID("$Id: x11.c,v 1.50 2006/07/15 20:46:24 wmcbrine Exp $");
|
||||
|
||||
int visible_cursor = 0;
|
||||
int windowEntered = 1;
|
||||
@@ -211,25 +211,6 @@ void XCursesProcessRequestsFromCurses(XtPointer client_data, int *fid,
|
||||
XClearWindow(XCURSESDISPLAY, XCURSESWIN);
|
||||
break;
|
||||
|
||||
case CURSES_FLASH:
|
||||
XC_LOG(("CURSES_FLASH received from child\n"));
|
||||
#if 0
|
||||
XFillRectangle(XCURSESDISPLAY, XCURSESWIN,
|
||||
normal_highlight_gc, 10, 10,
|
||||
XCursesWindowWidth - 10, XCursesWindowHeight - 10);
|
||||
|
||||
napms(50);
|
||||
|
||||
XFillRectangle(XCURSESDISPLAY, XCURSESWIN,
|
||||
normal_highlight_gc, 10, 10,
|
||||
XCursesWindowWidth - 10, XCursesWindowHeight - 10);
|
||||
|
||||
XCursesDisplayCursor(SP->cursrow, SP->curscol,
|
||||
SP->cursrow, SP->curscol);
|
||||
#endif
|
||||
XCursesContinue();
|
||||
break;
|
||||
|
||||
/* request from curses to confirm completion of display */
|
||||
|
||||
case CURSES_REFRESH:
|
||||
|
||||
Reference in New Issue
Block a user