-+-+-+-+-+-+-+-+ START OF PART 286 -+-+-+-+-+-+-+-+
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPint *`7D`7Biconstid`7D`7Buser icon structure identifier`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 the identifier of a
X** user created icon structure. The structure is referenced by the
X** window's icon structure.
X** The error code = 1 if `7B\tt windid`7D doesn't exist and = 2 if
X** the default icon is used.`7D
X*/
X`7B
X  *err = 0;
X  setwindow(windid);
X  if (windptr != NULL)
X  `7B
X    if (!windptr->defaulticon)
X      *iconstid = windptr->usericon;
X    else
X      *err = 2;
X  `7D
X  else
X    *err = 1;
X`7D  /* ptk_inqusericon */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_inqframesize(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`7Bframe 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 dimensions of the
X** window frame. They are returned in the range `5B0, 1`5D and the default
X** dimensions are (0.01, 0.01).
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->framesize;
X  else
X    *err = 1;
X`7D  /* ptk_inqframesize */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_inqwindowtype(C(Pint) windid, C(ptkewindowtype *) type,`20
X                              C(Pint *) err)`20
XPreANSI(Pint windid)
XPreANSI(ptkewindowtype *type)
XPreANSI(Pint *err)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7Bptkewindowtype *`7D`7Btype`7D`7Bwindow type`7D`7BOUT`7D
X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D
X** \paramend
X** \blurb`7BThis function may be used to inquire the type of a window.
X** The available types are STRUCT, TOPOLOGY, CONTENT and TERMINAL.
X** The default window type is STRUCT and may be used to view any PHIGS
X** structures.
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    *type = windptr->windowtype;
X  else
X    *err = 1;
X`7D  /* ptk_inqwindowtype */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_inqwindowattrs(C(Pint) windid,
X      C(Pint *) titlefont, C(Pint *) titlecolour, C(Pint *) bannercolour,
X      C(Pint *) backgdcolour, C(Pint *) edgecolour,`20
X      C(Pint *) frametlcolour, C(Pint *) framebrcolour, C(Pint *) err)
XPreANSI(Pint windid)
XPreANSI(Pint *titlefont)
XPreANSI(Pint *titlecolour)
XPreANSI(Pint *bannercolour)
XPreANSI(Pint *backgdcolour)
XPreANSI(Pint *edgecolour)
XPreANSI(Pint *frametlcolour)
XPreANSI(Pint *framebrcolour)
XPreANSI(Pint *err)
X/*`20
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPint *`7D`7Btitlefont`7D`7Btitle string font`7D`7BOUT`7D
X** \param`7BPint *`7D`7Btitlecolour`7D`7Btitle string colour index`7D`7BOUT`
V7D
X** \param`7BPint *`7D`7Bbannercolour`7D`7Bbanner colour index`7D`7BOUT`7D
X** \param`7BPint *`7D`7Bbackgdcolour`7D`7Bbackground colour index of window`
V7D`7BOUT`7D
X** \param`7BPint *`7D`7Bedgecolour`7D`7Bedge colour index of window`7D`7BOUT
V`7D
X** \param`7BPint *`7D`7Bframetlcolour`7D`7Btop-left frame colour index`7D`7B
VOUT`7D
X** \param`7BPint *`7D`7Bframebrcolour`7D`7Bbottom-right frame colour index`7
VD`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 text font and
X** colour attribute values of a window.
X** The error code = 1 if `7B\tt windid`7D doesn't exist.`7D
X*/
X`7B  `20
X  *err = 0;
X  setwindow(windid);
X  if (windptr != NULL)
X  `7B `20
X    *titlefont = windptr->titlefont;
X    *titlecolour = windptr->titlecolour; `20
X    *bannercolour = windptr->bannercolour;
X    *backgdcolour = windptr->backgdcolour;
X    *edgecolour = windptr->edgecolour;
X    *frametlcolour = windptr->frametlcolour;
X    *framebrcolour = windptr->framebrcolour;
X  `7D
X  else
X    *err = 1;
X`7D  /* ptk_inqwindowattrs */
X
X/*--------------------------------------------------------------------------
V*/
X/*-------------------------- icon functions --------------------------------
V*/
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_seticonposition(C(Pint) windid, C(Ppoint *) position)
XPreANSI(Pint windid)
XPreANSI(Ppoint *position)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPpoint *`7D`7Bposition`7D`7Bicon position`7D`7BIN`7D
X** \paramend`20
X** \blurb`7BThis function sets the position of the centre of the`20
X** window's icon structure. The position is given in the range `5B0, 1`5D.`7
VD
X*/
X`7B`20
X  setwindow(windid);
X  if (windptr != NULL)
X  `7B
X    if ((position->x > 0.0) && (position->x < 1.0) &&
X        (position->y > 0.0) && (position->y < 1.0))
X    `7B
X      windptr->iconposition = *position;
X      updateicon();
X    `7D
X  `7D
X`7D  /* ptk_seticonposition */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_seticonsize(C(Pint) windid, C(Ppoint *) size)
XPreANSI(Pint windid)
XPreANSI(Ppoint *size)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPpoint *`7D`7Bsize`7D`7Bicon size`7D`7BIN`7D
X** \paramend`20
X** \blurb`7BThis function sets the size of the window's icon structure.
X** The size is given in the range `5B0, 1`5D.`7D
X*/
X`7B
X  setwindow(windid);
X  if (windptr != NULL)
X  `7B
X    if ((size->x > 0.0) && (size->y > 0.0))
X    `7B `20
X      windptr->iconsize = *size;
X      updateicon();
X    `7D
X  `7D
X`7D  /* ptk_seticonsize */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_setusericon(C(Pint) windid, C(Pint) usericon)
XPreANSI(Pint windid)
XPreANSI(Pint usericon)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPint`7D`7Buser icon`7D`7Bicon structure identifier`7D`7BIN`7D
X** \paramend`20
X** \blurb`7BThis function enables the application to specify a structure
X** identifier to use as a window icon. The structure is executed from
X** the window's default icon structure and the icon size and position
X** functions still apply provided the user icon is defined within
X** the World Coordinate range `5B0, 1`5D.`7D
X*/
X`7B
X  setwindow(windid);
X  if (windptr != NULL)
X  `7B
X    if (windptr->defaulticon)
X    `7B
X      ptk_openstruct(windptr->iconstid);
X      pdelelemslabels(ptk_stringtoint("label", "begin-icon"),`20
X                      ptk_stringtoint("label", "end-icon")); `20
X      ptk_seteditmode(PEDIT_INSERT);
X      pexecutestruct(usericon);
X      ptk_unseteditmode();
X      ptk_closestruct();`20
X      windptr->defaulticon = FALSE;
X    `7D
X  `7D
X`7D  /* ptk_setusericon */
X
X/*--------------------------------------------------------------------------
V*/
X/*------------------------- banner functions -------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_setbannercolours(C(Pint) windid, C(Pint) bannercolour,`20
X                               C(Pint) titlecolour)
XPreANSI(Pint windid)
XPreANSI(Pint bannercolour)
XPreANSI(Pint titlecolour)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPint`7D`7Bbannercolour`7D`7Bbanner colour index`7D`7BIN`7D
X** \param`7BPint`7D`7Btitlecolour`7D`7Btitle string colour index`7D`7BIN`7D
X** \paramend`20
X** \blurb`7BThis function sets the colour indicies of a window banner.
X** It is useful for highlighting a current window, for example
X** in a `60point and click' window system.`7D
X*/
X`7B
X  setwindow(windid);
X  if (windptr != NULL)
X  `7B
X    windptr->bannercolour = bannercolour;
X    windptr->titlecolour = titlecolour;
X    updateframe();
X  `7D
X`7D  /* ptk_setbannercolours */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_setbannerheight(C(Pint) windid, C(Pfloat) bannerheight)
XPreANSI(Pint windid)
XPreANSI(Pfloat bannerheight)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPfloat`7D`7Bbannerheight`7D`7Bheight of banner`7D`7BIN`7D
X** \paramend`20
X** \blurb`7BThis function sets the height of the window banner to
X** `7B\tt bannerheight`7D which is given in the range `5B0, 1`5D. The window
X** title is re-scaled to fit the new height.`7D
X*/
X`7B
X  setwindow(windid);
X  if (windptr != NULL)
X  `7B
X    windptr->bannerheight = bannerheight;
X    updateframe();
X  `7D
X`7D  /* ptk_setbannerheight */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_inqbannerheight(C(Pint) windid, C(Pfloat *) bannerheight,
X                                C(Pint *) err)
XPreANSI(Pint windid)
XPreANSI(Pfloat *bannerheight)
XPreANSI(Pint *err)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPfloat *`7D`7Bbannerheight`7D`7Bheight of banner`7D`7BOUT`7D
X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D
X** \paramend`20
X** \blurb`7BThis function may be used to obtain the height of a window
X** banner. It 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    *bannerheight = windptr->bannerheight;
X  else
X    *err = 1;
X`7D  /* ptk_inqbannerheight */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_setbannertitle(C(Pint) windid, C(Pchar *) titlestring)
XPreANSI(Pint windid)
XPreANSI(Pchar *titlestring)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPchar *`7D`7Btitlestring`7D`7Btitle string of window banner`7D`7
VBIN`7D
X** \paramend`20
X** \blurb`7BThis function sets the title string of a window. The title
X** is displayed in the window banner and is automatically scaled to
X** fit inside the banner area.`7D
X*/
X`7B
X  setwindow(windid);
X  if (windptr != NULL)
X  `7B `20
X    strncpy(windptr->titlestring, titlestring, strlen(titlestring) + 1);
X    updateframe();
X  `7D
X`7D  /* ptk_setbannertitle */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_inqbannertitle(C(Pint) windid, C(Pint) len,
X                    C(Pchar *) titlestr, C(Pint *) totlen, C(Pint *) err)
XPreANSI(Pint windid)
XPreANSI(Pint len)
XPreANSI(Pchar *titlestr)
XPreANSI(Pint *totlen)
XPreANSI(Pint *err)
X/*
X** \parambegin
X** \param`7BPint`7D`7Bwindid`7D`7Bwindow identifier`7D`7BIN`7D
X** \param`7BPint`7D`7Blen`7D`7Blength of string`7D`7BIN`7D
X** \param`7BPchar *`7D`7Btitlestr`7D`7Btitle string of banner`7D`7BIN`7D
X** \param`7BPint *`7D`7Btotlen`7D`7Bactual length of string`7D`7BOUT`7D
X** \param`7BPint *`7D`7Berr`7D`7Berror indicator`7D`7BOUT`7D
X** \paramend`20
X** \blurb`7BThis function may be used to obtain the title of a window.
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 `20
X    *totlen = strlen(windptr->titlestring) + 1;
X    if (len >= *totlen)
X      strncpy(titlestr, windptr->titlestring, *totlen);
X  `7D
X  else
X    *err = 1;
X`7D  /* ptk_inqbannertitle */
X
X/*--------------------------------------------------------------------------
V*/
X/*---------------------- Terminal window functions -------------------------
V*/
X/*--------------------------------------------------------------------------
V*/
X
Xstatic void addline(C(Pchar *) line, C(Peditmode) edtype)
XPreANSI(Pchar *line)
XPreANSI(Peditmode edtype)
X/*
X** \parambegin
X** \param`7B`7D`7Btermnum`7D`7Bindex to terminal window array`7D`7BIN`7D
X** \param`7B`7D`7Bline`7D`7Bline to add or replace`7D`7BIN`7D
X** \param`7B`7D`7Bedtype`7D`7Bedit mode`7D`7BIN`7D
X** \paramend
X** \blurb`7BUpdates the PHIGS structure containing the terminal window
X** text. Either replaces the last line or inserts a new one.`7D
X*/
X`7B
X  Ppoint textpos;
X  Pint i;
X
X  /* initialise ptr to last elem */
X  /* remove old text elements from structure */
X  ptk_openstruct(windptr->term.textstid);
X  poffsetelemptr(-1);
X  ptk_seteditmode(edtype);
X
X  /* insert new text element */
X  i = windptr->term.curr_line;
X  textpos = ptk_point(ptkctmlinespace,
X                      -(Pfloat)i * windptr->term.increment);
X  ptext(&textpos, line);
X  ptk_unseteditmode();
X  ptk_closestruct();
X`7D  /* addline */
X
X/*--------------------------------------------------------------------------
V*/
X
Xstatic void setterminalline()
X`7B
X  Pfloat oneline;
X
X  /* view orientation */
X  oneline = -windptr->windowsize.y/(Pfloat)windptr->term.lines;
X  windptr->vrp = ptk_point3(0.0, -windptr->windowsize.y +`20
X                   (oneline * (Pfloat)(windptr->term.visline - 1)), 0.0);
X  /* set view rep */
X  updateview();
X`7D  /* setterminalline */
X
X/*--------------------------------------------------------------------------
V*/
X
X/*function:external*/
Xextern void ptk_scrollterminal(C(Pint) windid, C(Ptxpath) scrolldir,
X                           C(Pint) numlines)
XPreANSI(Pint windid)
XPreANSI(Ptxpath scrolldir)
XPreANSI(Pint numlines)
X/*
X** \parambegin
X** \param`7B`7D`7Bwindid`7D`7Bterminal window identifier`7D`7BIN`7D
X** \param`7B`7D`7Bscrolldir`7D`7Bscroll direction (up or down)`7D`7BIN`7D
X** \param`7B`7D`7Bnumlines`7D`7Bnumber of lines to scroll by`7D`7BIN`7D
X** \paramend
+-+-+-+-+-+-+-+-  END  OF PART 286 +-+-+-+-+-+-+-+-