 |
Index for Section 9 |
|
 |
Alphabetical listing for C |
|
 |
Bottom of page |
|
cursor_on_off(9r)
NAME
cursor_on_off - Graphics: Turns the cursor on and off
SYNOPSIS
int (*ws_cursor_functions->cursor_on_off)(
caddr_t cursor_handle,
int on_off );
ARGUMENTS
cursor_handle
Specifies the virtual address (handle) of device-specific information.
Typically this is a pointer to a private data structure that may
contain information such as the address of the hardware, state
information, and other information that may be shared between drivers.
The Workstation Subsystem allows separate handles for the cursor,
colormap, and the screen functions.
on_off
Specifies whether the cursor is on or off. A positive number indicates
that the cursor is on.
DESCRIPTION
The cursor_on_off function turns the cursor on and off.
RETURN VALUES
If successful, the cursor_on_off function returns 0 (zero). If
unsuccessful, it returns -1.
EXAMPLES
The following example shows how an ATI Mach64 graphics adapter might
implement the cursor_on_off function:
ati64_cursor_on_off(cursor_handle, on_off)
caddr_t cursor_handle;
int on_off;
{
register struct vga_info *vp =
(struct vga_info *)cursor_handle;
register struct ati64_type *ap =
&ati64_info[vp->unit];
unsigned int data = 0;
/* Set local driver flags. */
if (on_off)
SET_VGA_CURSOR_ON(vp);
else
CLR_VGA_CURSOR_ON(vp);
/* Do not bother if screen is OFF. */
if (!IS_VGA_SCREEN_ON(vp))
return(0);
/*
* The following code assumes that the cursor position is
* up-to-date (by ati64_cursor_set_position), so that
* simply turning the cursor back on will find it at
* the desired spot.
*/
data = REGR(vp, ap, GEN_TEST_CNTL);
if (on_off) {
/*
* Turn ON the cursor by setting
* bit 7 of the GEN_TEST_CNTL register.
*/
data |= 0x80;
}
else {
/*
* Turn OFF the cursor by resetting
* bit 8 of the GEN_TEST_CNTL register.
*/
data &= ~0x80;
}
REGW(vp, ap, GEN_TEST_CNTL, data);
return(0);
}
FILES
/usr/sys/include/sys/workstation.h
/usr/sys/include/sys/wsdevice.h
SEE ALSO
Data Structures: ws_cursor_functions(9s)
 |
Index for Section 9 |
|
 |
Alphabetical listing for C |
|
 |
Top of page |
|