-+-+-+-+-+-+-+-+ START OF PART 283 -+-+-+-+-+-+-+-+ X** \param`7BPint`7D`7Btitlecolour`7D`7Btitle string colour index`7D`7BIN`7D X** \param`7BPint`7D`7Bbannercolour`7D`7Bbanner colour index`7D`7BIN`7D X** \param`7BPint`7D`7Bbackgdcolour`7D`7Bbackground colour index of window`7D V`7BIN`7D X** \param`7BPint`7D`7Bedgecolour`7D`7Bedge colour index of window`7D`7BIN`7D X** \param`7BPint`7D`7Bframetlcolour`7D`7Btop-left frame colour index`7D`7BIN V`7D X** \param`7BPint`7D`7Bframebrcolour`7D`7Bbottom-right frame colour index`7D` V7BIN`7D X** \paramend X** \blurb`7BThis function sets the window text font and colour attribute X** values. Each window has a banner region which contains the title X** string of the window. The text font value applies to this string.`7D`20 X*/ X`7B `20 X setwindow(windid); X if (windptr != NULL) X `7B `20 X /* other window defaults */ X windptr->titlefont = titlefont; X windptr->titlecolour = titlecolour; `20 X windptr->bannercolour = bannercolour; X windptr->backgdcolour = backgdcolour; X windptr->edgecolour = edgecolour; X windptr->frametlcolour = frametlcolour; X windptr->framebrcolour = framebrcolour; X X ptk_openstruct(windptr->windowstid); X psetelemptr(0); `20 X /* set window frame attributes */ X pdelelemslabels(ptk_stringtoint("label", "begin-frame"),`20 X ptk_stringtoint("label", "end-frame")); `20 X ptk_seteditmode(PEDIT_INSERT); `20 X buildframe(); X ptk_unseteditmode(); X ptk_closestruct(); X `7D X`7D /* ptk_setwindowattrs */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_posttowindow(C(Pint) windid, C(Pint) id) XPreANSI(Pint windid)`20 XPreANSI(Pint id)`20 X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPint`7D`7Bid`7D`7Bitem identifier`7D`7BIN`7D X** \paramend X** \blurb`7BThis function posts an item to a window depending on the`20 X** window type. In the case X** of STRUCT and CONTENT windows, `7B\tt id`7D is a structure identifier. X** For TOPOLOGY windows, `7B\tt id`7D is a topology identifier. If the windo Vw is X** a TERMINAL window this function is ignored.`7D X*/ X`7B X Pint stid, err, elptr, lstnum, fid; X Peltype eltype; X Psrchstatus stat; X ptkboolean found; X X setwindow(windid); X if (windptr != NULL) X `7B X if (windptr->windowtype != PTKETERMINALWINDOW) X `7B X if (windptr->windowtype == PTKETOPOLOGYWINDOW) X ptk_inqtopologystructid(id, &stid, &err); X else X stid = id; X /* add to window structure */ X ptk_openstruct(windptr->windowstid); X ptk_seteditmode(PEDIT_INSERT); X psetelemptr(0); X psetelemptrlabel(ptk_stringtoint("label", "begin-window")); X `20 X /* check if execute is already there */ X eltype = PEL_EXECUTE_STRUCTURE; X found = FALSE; X do X `7B X ptk_findelemtype(&eltype, 1, PFORWARD, &stat, &elptr, &lstnum); X if (stat == PSUCCESS) X`09`7B X ptk_getexecuteid(windptr->windowstid, elptr, &fid); X if (fid == stid) X found = TRUE; X psetelemptr(elptr + 1); X `7D X `7D while ((!found) && (stat == PSUCCESS));`20 X if (!found) X `7B X psetelemptr(0); X psetelemptrlabel(ptk_stringtoint("label", "begin-window")); X pexecutestruct(stid); X `7D X ptk_unseteditmode(); X ptk_closestruct(); X if (windptr->windowtype == PTKECONTENTWINDOW) X `7B X ptk_inqstructcontentrange(stid, &windptr->range1, &windptr->range2, X &err); X windptr->viewrange1 = 0; X windptr->viewrange2 = windptr->range2; X `7D X `7D X `7D X`7D /* ptk_posttowindow */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_frontwindow(C(Pint) windid) XPreANSI(Pint windid) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \paramend`20 X** \blurb`7BThis function sets the post priority of the window structure X** so that it is displayed on top of all other posted windows but X** has a lower prioity than the current back menu.`7D X*/ X`7B X Pint ind, err, frontmenu, backmenu, backmenustid; X ptkboolean menus; X X setwindow(windid); X if (windptr != NULL) X `7B X findwsid(windptr->wsid, &ind); X menus = ptk_inqfrontbackmenuid(windptr->wsid, &frontmenu, &backmenu,`20 X &err); X if (menus) X `7B X ptk_inqmenustructid(backmenu, &backmenustid, &err); X ptk_postrelative(windptr->wsid, windptr->currentstid, PLOWER, X backmenustid, &err); X `7D X else X if (!wswindows`5Bind`5D.postedwindows) X ppoststruct(windptr->wsid, windptr->windowstid, 0.0); X else X ptk_postrelative(windptr->wsid, windptr->currentstid, PHIGHER, X wswindows`5Bind`5D.frontptr->currentstid, &err); X if (!wswindows`5Bind`5D.postedwindows) X `7B X wswindows`5Bind`5D.frontptr = wswindows`5Bind`5D.backptr = windptr; X wswindows`5Bind`5D.postedwindows = TRUE; X `7D X else X `7B X wswindows`5Bind`5D.frontptr = windptr; X if (windptr->currentstid == wswindows`5Bind`5D.backptr->currentstid) X findback(windptr->wsid, &wswindows`5Bind`5D); X `7D X windptr->posted = TRUE; X `7D X`7D /* ptk_frontwindow */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_backwindow(C(Pint) windid) XPreANSI(Pint windid) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \paramend`20 X** \blurb`7BThis function sets the post priority of a window structure X** so that it is displayed behind all the other posted windows and menus.`7D X*/ X`7B X Pint ind, err, frontmenu, backmenu, backmenustid; X ptkboolean menus; X X setwindow(windid); X if (windptr != NULL) X `7B X findwsid(windptr->wsid, &ind); X menus = ptk_inqfrontbackmenuid(windptr->wsid, &frontmenu, &backmenu, X &err); X if (!wswindows`5Bind`5D.postedwindows) X `7B X if (menus) X `7B X ptk_inqmenustructid(backmenu, &backmenustid, &err); X ptk_postrelative(windptr->wsid, windptr->currentstid, PLOWER, X backmenustid, &err); X `7D X else X ppoststruct(windptr->wsid, windptr->currentstid, 0.0); X wswindows`5Bind`5D.frontptr = wswindows`5Bind`5D.backptr = windptr; X wswindows`5Bind`5D.postedwindows = TRUE; X `7D X else X `7B X ptk_postrelative(windptr->wsid, windptr->currentstid, PLOWER, X wswindows`5Bind`5D.backptr->currentstid, &err); X wswindows`5Bind`5D.backstid = windptr->currentstid; X if (windptr == wswindows`5Bind`5D.frontptr) X findfront(windptr->wsid, &wswindows`5Bind`5D); X `7D X windptr->posted = TRUE; X `7D X`7D /* ptk_backwindow */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_unpostfromwindow(C(Pint) windid, C(Pint) id) XPreANSI(Pint windid)`20 XPreANSI(Pint id)`20 X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \param`7BPint`7D`7Bid`7D`7Bitem identifier`7D`7BIN`7D X** \paramend X** \blurb`7BThis function unposts an item from a window depending on the X** window type. In the case X** of STRUCT and CONTENT windows, id is a structure identifier. X** For TOPOLOGY windows, id is a topology identifier. If the window is X** a TERMINAL window this function is ignored.`7D X*/ X`7B X Pint stid, elptr, lstnum, err, fid; X Peltype eltype; X Psrchstatus stat; X ptkboolean found; X X setwindow(windid); X if (windptr != NULL) X `7B X if (windptr->windowtype != PTKETERMINALWINDOW) X `7B X if (windptr->windowtype == PTKETOPOLOGYWINDOW) X ptk_inqtopologystructid(id, &stid, &err); X else X stid = id; X /* add to window structure */ X ptk_openstruct(windptr->windowstid); X ptk_seteditmode(PEDIT_INSERT); X psetelemptr(0); X psetelemptrlabel(ptk_stringtoint("label", "begin-window")); X `20 X /* check if execute is already there */ X eltype = PEL_EXECUTE_STRUCTURE; X found = FALSE; X do X `7B X ptk_findelemtype(&eltype, 1, PFORWARD, &stat, &elptr, &lstnum); X if (stat == PSUCCESS) X`09`7B X ptk_getexecuteid(windptr->windowstid, elptr, &fid); X if (fid == stid) X found = TRUE; X psetelemptr(elptr + 1); X `7D X `7D while ((!found) && (stat == PSUCCESS)); X if (found) X `7B X psetelemptr(elptr); X pdelelem(); X `7D X ptk_unseteditmode(); X ptk_closestruct(); X `7D X `7D X`7D /* ptk_unpostfromwindow */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_unpostallfromwindow(C(Pint) windid) XPreANSI(Pint windid) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \paramend`20 X** \blurb`7BThis function unposts all items posted to window `7B\tt windid`7 VD. X** If the window is a TERMINAL window this function is ignored.`7D X*/ X`7B X Pint label1, label2; X X setwindow(windid); X if (windptr != NULL) X `7B X if (windptr->windowtype != PTKETERMINALWINDOW) X `7B X ptk_openstruct(windptr->windowstid); X#ifdef SUN X psetelemptr(0); X ptk_findlabel(ptk_stringtoint("label", "begin-window"), &label1); X ptk_findlabel(ptk_stringtoint("label", "end-window"), &label2); X#endif X psetelemptr(0); X#ifdef SUN X if (label2 - label1 > 1) X pdelelemrange(label1 + 1, label2 - 1); X#endif X#ifdef VMS X pdelelemslabels(ptk_stringtoint("label", "begin-window"), X `09`09 ptk_stringtoint("label", "end-window")); X#endif X ptk_closestruct(); X `7D X `7D X`7D /* ptk_unpostallfromwindow */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_postwindow(C(Pint) windid) XPreANSI(Pint windid)`20 X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \paramend X** \blurb`7BThis function posts a window structure to the workstation X** specified when the window was initially created. Windows are bound X** to workstation because they each use one view table entry to X** define the window view. The priority of the window structure is X** controlled by the PHIGS Toolkit window system to provide an ordered X** stacking mechanism for windows.`7D X*/ X`7B X ptk_frontwindow(windid); X`7D /* ptk_postwindow */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_unpostwindow(C(Pint) windid) XPreANSI(Pint windid)`20 X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \paramend X** \blurb`7BThis function unposts a window from the workstation it is X** bound to.`7D X*/ X`7B X Pint ind; X X setwindow(windid); X if (windptr != NULL) X `7B X punpoststruct(windptr->wsid, windptr->currentstid); X findwsid(windptr->wsid, &ind); X if (windptr == wswindows`5Bind`5D.backptr) X findback(windptr->wsid, &wswindows`5Bind`5D); X if (windptr == wswindows`5Bind`5D.frontptr) X findfront(windptr->wsid, &wswindows`5Bind`5D); X windptr->posted = FALSE; X `7D X`7D /* ptk_unpostwindow */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern ptkboolean ptk_delwindow(C(Pint) windid) XPreANSI(Pint windid)`20 X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \paramend X** \blurb`7BThis function deletes a window from the PHIGS Toolkit window X** store.`7D X*/ X`7B X ptkswindow *ptr, *junk; X Pchar stname`5B20`5D; X X ptk_unpostwindow(windid); X ptr = firstwind; X if (ptr->windowid == windid) X `7B X firstwind = firstwind->next; X if (lastwind->windowid == windid) X lastwind = firstwind; X pdelstruct(ptr->windowstid); X pdelstruct(ptr->iconstid); X if (ptr->windowtype == PTKETERMINALWINDOW) X `7B X pdelstruct(ptr->term.textstid); X sprintf(stname, "struct$term%d", windid); X ptk_delstring("structureid", stname); X `7D X free(ptr); X `7D X else X `7B X while (ptr->next->windowid != windid) X `7B X ptr = ptr->next; X if (ptr->next == NULL) X return FALSE; X `7D X junk = ptr->next; X ptr->next = junk->next; X pdelstruct(junk->windowstid); X pdelstruct(junk->iconstid); X if (ptr->windowtype == PTKETERMINALWINDOW) X `7B X pdelstruct(junk->term.textstid); X sprintf(stname, "struct$term%d", windid); X ptk_delstring("structureid", stname); X `7D X free(junk); X if (ptr->next == NULL) X lastwind = ptr; X `7D X X /* delete strings */ X sprintf(stname, "struct$window%d", windid); X ptk_delstring("structureid", stname); X sprintf(stname, "struct$icon%d", windid); X ptk_delstring("structureid", stname); X sprintf(stname, "view$window%d", windid); X ptk_delstring("viewindex", stname); X sprintf(stname, "name$window%d", windid); X ptk_delstring("name", stname); X windowcount--; X return TRUE; X`7D /* ptk_delwindow */ X X/*-------------------------------------------------------------------------- V*/ X X/*function:external*/ Xextern void ptk_openwindow(C(Pint) windid) XPreANSI(Pint windid) X/* X** \parambegin X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D X** \paramend`20 X** \blurb`7BThis function posts the window structure and unposts the icon X** structure from the window's workstation.`7D X*/ X`7B X Pfloat priority; X Pint err; X X setwindow(windid); X if (windptr != NULL) X `7B X if (windptr->windowstate == PTKEWINDOWCLOSED) X `7B X ptk_inqpostpriority(windptr->wsid, windptr->iconstid, &priority, &err) V; X punpoststruct(windptr->wsid, windptr->iconstid); +-+-+-+-+-+-+-+- END OF PART 283 +-+-+-+-+-+-+-+-