Index Index for
Section 9
Index Alphabetical
listing for L
Bottom of page Bottom of
page

load_cursor(9r)

NAME

load_cursor - Graphics: Loads the cursor

SYNOPSIS

int (*ws_cursor_functions->load_cursor)( caddr_t cursor_handle, ws_screen_descriptor *screen, ws_cursor_data *cursor );

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. screen Specifies a pointer to the ws_screen_descriptor structure, which describes the attributes of the screen. cursor Specifies a pointer to the ws_cursor_data structure, which describes the cursor.

DATA STRUCTURES

The load_cursor function accesses the ws_color_cell and ws_cursor_data structures defined in /usr/sys/include/sys/workstation.h.

DESCRIPTION

The load_cursor function loads the cursor with the cursor specified by *cursor. Since this function may need information about the screen the cursor is associated with, the screen structure *screen is also passed.

RETURN VALUES

If successful, the load_cursor function returns 0 (zero). If unsuccessful, it returns -1.

EXAMPLES

The following example shows how the myvga example driver implements the load_cursor function: int myvga_load_cursor(caddr_t cursor_handle, ws_screen_descriptor *screen, ws_cursor_data *cursor) { register struct myvga_type *scp = (struct myvga_type *)cursor_handle; scp->x_hot = cursor->x_hot; scp->y_hot = cursor->y_hot; if (myvga_developer_debug) printf("myvga_load_cursor: entry: screen=%d hot (%d,%d)\n", scp->screen.screen, scp->x_hot, scp->y_hot); myvga_set_cursor_position(cursor_handle, screen, screen->x, screen->y); return(0); }

FILES

/usr/sys/include/sys/workstation.h /usr/sys/include/sys/wsdevice.h

SEE ALSO

Data Structures: ws_color_cell(9s), ws_cursor_data(9s), ws_cursor_functions(9s)

Index Index for
Section 9
Index Alphabetical
listing for L
Top of page Top of
page