-+-+-+-+-+-+-+-+ START OF PART 285 -+-+-+-+-+-+-+-+ X *windowid = ptrwindow->windowid; X *value = ptk_point(0.0, 0.0); X `7D X `7D X `7D X if (!windowfound) X i--; X `7D X if (windowfound) X `7B X if (ptrwindow->windowstate == PTKEWINDOWCLOSED) X `7B X *windowarea = PTKEWINDOWICON; X ptk_boundingbox(ptrwindow->iconstid, &area, TRUE); X `7D X else X `7B X area = ptk_limit3(ptrwindow->windowposition.x -`20 X (ptrwindow->windowsize.x / 2.0), X ptrwindow->windowposition.x +`20 X (ptrwindow->windowsize.x / 2.0), X ptrwindow->windowposition.y -`20 X (ptrwindow->windowsize.y / 2.0), X ptrwindow->windowposition.y +`20 X (ptrwindow->windowsize.y / 2.0), 0.0, 0.0); X if (ptinlimit3(point, &area)) X *windowarea = PTKEWINDOWVIEW; X else X `7B X area.ymin = area.ymax; X area.ymax += ptrwindow->bannerheight; X if (ptinlimit3(point, &area)) X *windowarea = PTKEWINDOWBANNER; X else X`09`7B X *windowarea = PTKEWINDOWFRAME; X#ifdef VMS X area = windowbox; X#endif X#ifdef SUN X ptk_openstruct(ptrwindow->currentstid); X psetelemptr(0); X ptk_findelemtype(&eltype, 1, PFORWARD, &stat, &stopelem, &lstnum); X ptk_closestruct(); X ptk_inittsl(); X ptk_tsltraverserange(ptrwindow->currentstid, 1,`20 X ptrwindow->currentstid, stopelem, TRUE); X ptk_inqboundingbox(&area); X#endif X `7D X `7D X `7D X div = area.xmax - area.xmin; X if (div != 0.0) X value->x = (point->x - area.xmin)/div; X div = area.ymax - area.ymin; X if (div != 0.0) X value->y = (point->y - area.ymin)/div; X `7D X free(structlist.postings); X ptk_unstackbbox(); X ptk_unstacktsl(); X return windowfound;`20 X`7D /* ptk_locscanwindows */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern ptkboolean ptk_scanwindows(C(Pint) wsid, C(ptksgeneralinput *) input, V`20 X C(ptkswindowoutput *) output) XPreANSI(Pint wsid) XPreANSI(ptksgeneralinput *input) XPreANSI(ptkswindowoutput *output) X/* X** \parambegin X** \param`7BPint`7D`7Bwsid`7D`7Bworkstation identifier`7D`7BIN`7D X** \param`7Bptksgeneralinput *`7D`7Binput`7D`7Binput data`7D`7BIN`7D X** \param`7Bptkswindowoutput *`7D`7Boutput`7D`7Boutput data`7D`7BIN`7D X** \paramend X** \blurb`7BThis function performs a scan on all posted windows using X** either string, pick or locator data. X** The function returns TRUE if a window has been selected,`20 X** otherwise FALSE.`7D X*/ X`7B X ptkboolean result; X X switch (input->inputclass)`20 X `7B X X case PI_LOCATOR: X result = ptk_locscanwindows(wsid, &input->ptkugeninput.locpoint, &output V->windowid, &output->windowarea, &output->value); X output->measure = TRUE; X break; X X case PI_STROKE: X result = FALSE; X break; X X case PI_VALUATOR: X result = FALSE; X break; X X case PI_CHOICE: X result = FALSE; X break; X X case PI_PICK: X result = ptk_pickscanwindows(&input->ptkugeninput.ptkspickinput.pickdata V,`20 X input->ptkugeninput.ptkspickinput.pathorder, X &output->windowid, &output->windowarea); X output->measure = FALSE; X break; X X case PI_STRING: X result = ptk_stringscanwindows(wsid, input->ptkugeninput.str, &output->w Vindowid); X output->measure = FALSE; X output->windowarea = PTKEWINDOWBANNER; X break; X `7D X return result; X`7D /* ptk_scanwindows */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqpostedwindows(C(Pint) wsid, C(Pint) size,`20 X C(Pintlst *) windowids, C(Pint *) totalsize, X C(Pint *) err) XPreANSI(Pint wsid) XPreANSI(Pint size) XPreANSI(Pintlst *windowids) XPreANSI(Pint *totalsize) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwsid`7D`7Bworkstation identifier`7D`7BIN`7D X** \param`7BPint`7D`7Bsize`7D`7Bsize of buffer`7D`7BIN`7D X** \param`7BPintlst *`7D`7Bwindowids`7D`7Blist of posted windows`7D`7BOUT`7D X** \param`7BPint *`7D`7Btotalsize`7D`7Blength of posted windows list`7D`7BOU VT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain a list of all windows X** posted to the workstation `7B\tt wsid`7D. X** The error code is a standard PHIGS error code.`7D X*/ X`7B X ptkswindow *ptrwindow; X Pint numstructs, i; X Pstructpostlst structlist; X X *err = 0; X *totalsize = 0; X ptrwindow = firstwind; X while (ptrwindow != NULL) X `7B X if (ptrwindow->posted &&`20 X (ptrwindow->wsid == wsid)) X (*totalsize)++; X ptrwindow = ptrwindow->next; X `7D X if (size >= *totalsize) X `7B X pinqpostedstruct(wsid, 0, 0, err, &structlist, &numstructs); X structlist.postings = (Pstructpost *)calloc(numstructs,`20 X sizeof(Pstructpost)); X pinqpostedstruct(wsid, numstructs, 0, err, &structlist, &numstructs); X windowids->number = 0; X for (i = 0; i < structlist.number; i++) X `7B X if (iswindow(structlist.postings`5Bi`5D.id, &ptrwindow)) X `7B X windowids->integers`5Bwindowids->number`5D = ptrwindow->windowid; X windowids->number++; X `7D X `7D X `7D X`7D /* ptk_inqpostedwindows */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqwindowids(C(Pint) size, C(Pintlst *) windowids,`20 X C(Pint *) totalsize, C(Pint *) err) XPreANSI(Pint size) XPreANSI(Pintlst *windowids) XPreANSI(Pint *totalsize) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bsize`7D`7Bsize of buffer`7D`7BIN`7D X** \param`7BPintlst *`7D`7Bwindowids`7D`7Blist of windows`7D`7BOUT`7D X** \param`7BPint *`7D`7Btotalsize`7D`7Blength of windows list`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain a list of all X** windows in the PHIGS Toolkit window store.`7D X*/ X`7B X ptkswindow *ptrwindow; X X *err = 0; X *totalsize = windowcount; X if (size >= *totalsize) X `7B X windowids->number = 0; X ptrwindow = firstwind; X while (ptrwindow != NULL) X `7B X windowids->integers`5Bwindowids->number`5D = ptrwindow->windowid; X windowids->number++; X ptrwindow = ptrwindow->next; X `7D X `7D X`7D /* ptk_inqwindowids */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqwindowstructid(C(Pint) windid, C(Pint *) windowstid,`20 X C(Pint *) iconstid, C(Pint *) err) XPreANSI(Pint windid) XPreANSI(Pint *windowstid) XPreANSI(Pint *iconstid) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPint *`7D`7Bwindowstid`7D`7Bwindow structure identifier`7D`7BOUT V`7D X** \param`7BPint *`7D`7Biconstid`7D`7Bwindow structure identifier`7D`7BOUT`7 VD X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the identifier of X** a window structure and its corresponding icon structure. X** The window structure is a network with references to all the items X** posted to the window. The default icon is a single structure X** containing the window identifier. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X `7B X *windowstid = windptr->windowstid; X *iconstid = windptr->iconstid; X `7D X else X *err = 1; X`7D /* ptk_inqwindowstructid */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqwindowname(C(Pint) windid, C(Pint *) name,`20 X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Pint *name) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPint *`7D`7Bname`7D`7Bwindow name`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the window name`20 X** to be used in namesets for the pick, invisibility and`20 X** highlighting filters. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *name = windptr->windowname; X else X *err = 1; X`7D /* ptk_inqwindowname */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern ptkboolean ptk_inqfrontbackwindowid(C(Pint) wsid, C(Pint *) frontid, X C(ptkewindowstate *) frontstate, C(Pint *) backid,`20 X C(ptkewindowstate *) backstate, C(Pint *) err) XPreANSI(Pint wsid) XPreANSI(Pint *frontid) XPreANSI(ptkewindowstate *frontstate) XPreANSI(Pint *backid) XPreANSI(ptkewindowstate *backstate) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwsid`7D`7Bworkstation identifier`7D`7BIN`7D X** \param`7BPint *`7D`7Bfrontstid`7D`7Bfront window identifier`7D`7BOUT`7D X** \param`7Bptkewindowstate *`7D`7Bfrontstate`7D`7Bfront window state`7D`7BO VUT`7D X** \param`7BPint *`7D`7Bbackstid`7D`7Bback window identifier`7D`7BOUT`7D X** \param`7Bptkewindowstate *`7D`7Bbackstate`7D`7Bback window state`7D`7BOUT V`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the identifiers X** of the front and back windows and there current state (OPEN or X** CLOSED).`7D X*/ X`7B X Pint ind; X X *err = 0; X findwsid(wsid, &ind); X if (wswindows`5Bind`5D.postedwindows) X `7B X *frontid = wswindows`5Bind`5D.frontptr->windowid; X *frontstate = wswindows`5Bind`5D.frontptr->windowstate; X *backid = wswindows`5Bind`5D.backptr->windowid; X *backstate = wswindows`5Bind`5D.backptr->windowstate; X return TRUE; X `7D X else`20 X return FALSE; X`7D /* ptk_inqfrontbackwindowid */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqwindowposition(C(Pint) windid, C(Ppoint *) position, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Ppoint *position) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint *`7D`7Bposition`7D`7Bwindow position`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the position of the centre X** of a window. The position is returned in the range `5B0, 1`5D. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *position = windptr->windowposition; X else X *err = 1; X`7D /* ptk_inqwindowposition */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqwindowsize(C(Pint) windid, C(Ppoint *) size,`20 X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Ppoint *size) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint *`7D`7Bsize`7D`7Bwindow size`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the size of a window X** which is returned in the range `5B0, 1`5D. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *size = windptr->windowsize; X else X *err = 1; X`7D /* ptk_inqwindowsize */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqiconposition(C(Pint) windid, C(Ppoint *) position,`20 X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Ppoint *position) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint *`7D`7Bposition`7D`7Bicon position`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the position of the centre o Vf`20 X** a window icon which is returned in the range `5B0, 1`5D. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *position = windptr->iconposition; X else X *err = 1; X`7D /* ptk_inqiconposition */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqiconsize(C(Pint) windid, C(Ppoint *) size, C(Pint *) err) V`20 XPreANSI(Pint windid) XPreANSI(Ppoint *size) XPreANSI(Pint *err) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPpoint *`7D`7Bsize`7D`7Bicon size`7D`7BOUT`7D X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D X** \paramend X** \blurb`7BThis function may be used to obtain the size of a window's icon X** structure and is returned in the range `5B0, 1`5D. X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D X*/ X`7B X *err = 0; X setwindow(windid); X if (windptr != NULL) X *size = windptr->iconsize; X else X *err = 1; X`7D /* ptk_inqiconsize */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_inqusericon(C(Pint) windid, C(Pint *) iconstid, X C(Pint *) err)`20 XPreANSI(Pint windid) XPreANSI(Pint *iconstid) XPreANSI(Pint *err) X/* X** \parambegin +-+-+-+-+-+-+-+- END OF PART 285 +-+-+-+-+-+-+-+-