Category : C Source Code
Archive   : WIND.ZIP
Filename : W_CURSOR.C

 
Output of file : W_CURSOR.C contained in archive : WIND.ZIP

/* w_cursor.c -- part of Windows package; contains w_putcrs, crs_off, crs_on
*/

#include
#include "windows.h"

/*
* physically locate the cursor in appropriate place for window *w
*
* calls: int86()
*/

void w_putcrs(w)
Window *w;
{
union REGS r;

r.h.ah = 15; /* get video mode (to determine active page) */
int86(0x10, &r, &r);
r.h.dh = w->cursor.row + w->rect.top;
r.h.dl = w->cursor.col + w->rect.left;
r.h.ah = 2; /* set cursor position */
int86(0x10, &r, &r);
}

/*
* Turn off the cursor display
*
* calls: int86()
*/

void crs_off()
{
union REGS r;

r.h.ah = 3;
r.h.bh = 0; /* using page 0 */
int86(0x10, &r, &r);
r.h.ch |= 0x20;
r.h.ah = 1;
r.h.bh = 0; /* page 0 */
int86(0x10, &r, &r);
}

/*
* Turn the cursor display back on
*
* calls: int86()
*/

void crs_on()
{
union REGS r;

r.h.ah = 3;
r.h.bh = 0; /* using page 0 */
int86(0x10, &r, &r);
r.h.ch &= 0xdf;
r.h.ah = 1;
r.h.bh = 0; /* page 0 */
int86(0x10, &r, &r);
}