| There may be another way to accomplish what you want. The following is a
program which will cause the cursor to wrap around the screen. Move the cursor
off the right of the screen and it will show up on the left of the screen and
vice versa. This uses qiow's to the driver in the same fashion the server does
to implement cursor jumping from screen to screen in multi-head support. Good
luck.
#include <iodef>
#include <ssdef>
#include <descrip>
#include <lnmdef>
#include <lib$routines>
#include <starlet>
typedef struct _itemlist
{
short bufferLen;
short itemCode;
char *bufferAddress;
int *returnLength;
} itemlist;
static $DESCRIPTOR (DEVNAM, "DECW$SERVER_SCREENS");
static $DESCRIPTOR(SERVER0,"DECW$SERVER0_TABLE");
static $DESCRIPTOR(first_dev,"xxxx");
static $DESCRIPTOR(last_dev,"xxxx");
/* */
/* DECwindows Driver for SETMODE of ATTACH_SCREEN call. */
/* The following are different parameters allowed by */
/* attach screen. Thus the prefix "DECW_AS_". */
/* */
#define IO$K_DECW_AS_TO_INPUT 2
#define IO$K_DECW_AS_TO_RIGHT 3
#define IO$K_DECW_AS_TO_LEFT 4
#define IO$K_DECW_AS_TO_TOP 5
#define IO$K_DECW_AS_TO_BOTTOM 6
/* */
/* QIO function codes, modifiers and submodifiers */
/* */
/* */
/* DECwindows Driver SENSEMODE and SETMODE function modifier codes */
/* */
#define IO$K_DECW_CURSOR_ASSOC 2
#define IO$K_DECW_ENABLE_INPUT 3
#define IO$K_DECW_BUTTON_INFO 4
#define IO$K_DECW_CURSOR_COLOR 5
#define IO$K_DECW_CURSOR_PATTERN 6
#define IO$K_DECW_CURSOR_POSITION 7
#define IO$K_DECW_DEVICE_INFO 8
#define IO$K_DECW_KB_INFO 9
#define IO$K_DECW_MOTION_BUFFER 10
#define IO$K_DECW_POINTER_FILTER_BOX 11
#define IO$K_DECW_POINTER_INFO 12
#define IO$K_DECW_OPWIN_KEY 13
#define IO$K_DECW_SCREEN_SAVER 14
#define IO$K_DECW_KB_LED 15
#define IO$K_DECW_RING_BELL 16
#define IO$K_DECW_ATTACH_SCREEN 17
#define IO$K_DECW_PMOUSE_KEY 18
#define IO$K_DECW_PTR_ACCEL 19
#define IO$K_DECW_MOTION_COMP 20
#define IO$K_DECW_MOTION_BUFFER_INIT 21
#define IO$K_DECW_CURSOR_BOUNDRIES 22
main()
{
unsigned long int condValue; /* VMS condition value */
unsigned short int iosb[4]; /* i/o status block */
unsigned short int chan;
int index;
int maxIndex;
int temp,size;
itemlist crelnm_itemlist[20];
itemlist trnlnm_itemlist[3];
itemlist *crelnm_listptr;
char lognam_buffer[2048];
trnlnm_itemlist[1].itemCode = LNM$_MAX_INDEX;
trnlnm_itemlist[1].bufferAddress = &maxIndex;
trnlnm_itemlist[1].returnLength = &temp;
trnlnm_itemlist[1].bufferLen = 4;
trnlnm_itemlist[2].itemCode=trnlnm_itemlist[2].bufferLen=0;
condValue = sys$trnlnm(0,&SERVER0,&DEVNAM,0,&trnlnm_itemlist[1]);
if (condValue != SS$_NORMAL)
{
PrintF("Couldn't translate logical name\n");
lib$stop(condValue);
return;
}
/*
* Get first device
*/
index = 0;
trnlnm_itemlist[0].returnLength = &temp;
trnlnm_itemlist[0].itemCode = LNM$_INDEX;
trnlnm_itemlist[0].bufferLen = 4;
trnlnm_itemlist[0].bufferAddress = &index;
trnlnm_itemlist[1].bufferLen = 4;
trnlnm_itemlist[1].itemCode = LNM$_STRING;
trnlnm_itemlist[1].bufferAddress = first_dev.dsc$a_pointer;
trnlnm_itemlist[1].returnLength = &size;
trnlnm_itemlist[2].itemCode = trnlnm_itemlist[2].bufferLen = 0;
condValue = sys$trnlnm(0,&SERVER0,&DEVNAM,0,&trnlnm_itemlist[0]);
if (condValue != SS$_NORMAL)
{
PrintF("Couldn't translate logical name\n");
lib$stop(condValue);
return;
}
/*
* Get last device
*/
index = maxIndex;
trnlnm_itemlist[0].returnLength = &temp;
trnlnm_itemlist[0].itemCode = LNM$_INDEX;
trnlnm_itemlist[0].bufferLen = 4;
trnlnm_itemlist[0].bufferAddress = &index;
trnlnm_itemlist[1].bufferLen = 4;
trnlnm_itemlist[1].itemCode = LNM$_STRING;
trnlnm_itemlist[1].bufferAddress = last_dev.dsc$a_pointer;
trnlnm_itemlist[1].returnLength = &size;
trnlnm_itemlist[2].itemCode = trnlnm_itemlist[2].bufferLen = 0;
condValue = sys$trnlnm(0,&SERVER0,&DEVNAM,0,&trnlnm_itemlist[0]);
if (condValue != SS$_NORMAL)
{
PrintF("Couldn't translate logical name\n");
lib$stop(condValue);
return;
}
condValue = sys$assign (&first_dev, &chan, 0, 0);
if (condValue != SS$_NORMAL)
{
PrintF("Couldn't assign channel to DECW$SERVER_SCREENS\n");
lib$stop(condValue);
return;
}
condValue = sys$qiow (0, chan,
IO$_SETMODE,
&iosb, 0, 0,
IO$K_DECW_ATTACH_SCREEN,
IO$K_DECW_AS_TO_RIGHT,
&last_dev, 0, 0, 0) ;
if (condValue != SS$_NORMAL)
{
PrintF("\nAttach screen failed %d", condValue) ;
lib$stop(condValue);
return;
}
}
|