home *** CD-ROM | disk | FTP | other *** search
- /*
- bcwin.c 4/22/89
-
- % Blank char window object
- used for unsaved default window etc.
- By Ted.
-
- OWL 1.1
- Copyright (c) 1989 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "cmwinod.h"
- #include "cmwinobj.h"
-
- OSTATIC void OWLPRIV bcwin_PlotBox(_arg2(ptd_struct *, bcwin_od *));
- /* -------------------------------------------------------------------------- */
-
- int bcwin_Class(objdata, msg, indata, outdata)
- VOID *objdata; /* object instance data pointer */
- int msg; /* message */
- VOID *indata; /* message input data */
- VOID *outdata; /* message output data */
- /*
- Blank char window object dispatch function
- */
- {
- bcwin_od *bcwd;
- win_type win;
- ptd_struct *ptd;
- ptd_struct inptd; /* for use in inner-coordinate computations */
- opbox inbox; /* ditto; gets hooked in by ptd_SetInner */
- int rval;
-
- bcwd = (bcwin_od *) objdata;
-
- switch(msg) {
- case OBJM_GETDATASIZE:
- ((ogds_struct *) outdata)->odsize = sizeof(bcwin_od);
- ((ogds_struct *) outdata)->xdsize = sizeof(bcwin_xd);
- ((ogds_struct *) outdata)->id = ID_BCWIN;
- break;
-
- case OBJM_OPEN:
- win = bcwinod_GetSelf(bcwd);
-
- /* Initialize the char to be repeatedly painted in this window. */
- bcwin_SetChar(win, ' ');
-
- /* Send OPEN msg to win superclass */
- rval = win_DoRaw(&(bcwd->wd), msg, indata, outdata);
-
- /* Override default: allow any pix size for pmwin's */
- win_SetCharSize(win, FALSE);
-
- return(rval);
-
- case OBJM_WHO:
- /* Identify ourselves */
- if (*((int *) indata) == ID_BCWIN) {
- return(TRUE);
- }
- return(win_DoRaw(&(bcwd->wd), msg, indata, outdata));
-
- case WINM_SCROLL:
- break; /* don't bother scrolling- it's blank anyway */
-
- case WINM_PAINT:
- ptd = (ptd_struct *)indata;
- if (ptd_SetInner(ptd, &inptd, &inbox)) {
- bcwin_PlotBox(&inptd, bcwd);
- }
- /* No break; send msg to win superclass */
- default:
- return(win_DoRaw(&(bcwd->wd), msg, indata, outdata));
- }
- return(TRUE);
- }
- /* -------------------------------------------------------------------------- */
-
- static void OWLPRIV bcwin_PlotBox(ptd, bcwd)
- ptd_struct *ptd;
- bcwin_od *bcwd;
- /*
- Plots a region of a cmap window to the display.
- */
- {
- win_type win;
- char bchar;
- byte attr;
- ocbox relcbox;
- opcoord xpix, ypix;
- int row, cwidth;
- ofont_type font;
- odim fheight;
-
- win = bcwinod_GetSelf(bcwd);
- bchar = bcwin_GetChar(win);
- attr = win_GetAttr(win);
-
- font = win_GetFont(ptd->win);
-
- opbox_charcoords(ptd->relboxp, font, &relcbox);
-
- xpix = (relcbox.leftcol) * ofont_GetWidth(font);
- fheight = ofont_GetHeight(font);
- ypix = (relcbox.toprow + 1) * fheight;
- cwidth = ocbox_GetWidth(&relcbox);
-
- for (row = ocbox_GetHeight(&relcbox); row > 0; row--, ypix += fheight) {
- ptd_PlotChar(ptd, xpix, ypix, bchar, attr, cwidth);
- }
- }
- /* -------------------------------------------------------------------------- */
-
-