home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / BD1.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  2.1 KB  |  85 lines

  1. /*
  2.     bd1.c    5/29/87
  3.  
  4.     % single lined border routine.
  5.  
  6.     OWL 1.1
  7.     Copyright (c) 1986, 1987, by Oakland Group, Inc.
  8.     ALL RIGHTS RESERVED.
  9.  
  10.     Revision History:
  11.     -----------------
  12.     11/22/87 jmd     Replaced line characters with octal escape sequences
  13.      7/27/88 jmd     Upgraded to new border stuff
  14.      9/12/88 jmd    Added in and out data to objects
  15.     11/07/88 ted    Upgraded to new new border stuff
  16.     11/20/88 jmd    Added ID to obj struct
  17.     12/20/88 jmd    removed SETSIZE msg
  18.  
  19.      4/21/89 jmd    added object data
  20.      5/28/89 jmd    added Shadow support
  21. */
  22.  
  23. #include "oakhead.h"
  24. #include "disppriv.h"
  25. #include "bordobj.h"
  26. #include "bordod.h"
  27.  
  28. #define OUTER_BOX    "\332\304\277\263\331\304\300\263"
  29.  
  30. /*** bd1 object data struct (contains border super class data) ***/
  31.  
  32. typedef struct {
  33.     border_od    bdd;                          /* border object super class */
  34. } bd1_od;
  35.  
  36. int bd_1(objdata, msg, indata, outdata)
  37.     VOID *objdata;            /* object instance data pointer */
  38.     int msg;                /* message */
  39.     VOID *indata;            /* message input data */
  40.     VOID *outdata;            /* message output data */
  41. /*
  42.     This is a simple single lined border.
  43. */
  44. {
  45.     bd1_od         *bd1d;
  46.     ocbox         cbox;
  47.     byte         attr;
  48.  
  49.     bd1d = (bd1_od *)objdata;
  50.  
  51.     switch(msg) {
  52.     case OBJM_GETDATASIZE:
  53.         /* tell obj_Open how big we are */
  54.         ((ogds_struct *) outdata)->odsize = sizeof(bd1_od);
  55.         ((ogds_struct *) outdata)->xdsize = sizeof(border_xd);
  56.         ((ogds_struct *) outdata)->id = ID_BD1;
  57.         break;
  58.  
  59.     case OBJM_OPEN:
  60.         /* initialize our object data */
  61.         if (!border_DoRaw(&bd1d->bdd, msg, indata, outdata)) {
  62.             return(FALSE);
  63.         }
  64.         bord_SetSides(bd1d->bdd.win, -1, -1, 1, 1);
  65.         break;
  66.  
  67.     case BDM_SHADOW:
  68.     case BDM_DRAW:
  69.         /* paint ourself */
  70.         bord_GetBox(bd1d->bdd.win, &cbox);
  71.         attr = (msg == BDM_DRAW) ? 
  72.             bord_GetAttr(bd1d->bdd.win) : win_GetShadowAttr(bd1d->bdd.win);
  73.  
  74.         ptd_DrawCharBox((ptd_struct *)indata, OUTER_BOX, &cbox, attr);
  75.  
  76.         /* else no break; pass message up to superclass */
  77.  
  78.     default:
  79.         /* pass messages up to border super class (inheritance) */
  80.         return(border_DoRaw(&bd1d->bdd, msg, indata, outdata));
  81.     }
  82.     return(TRUE);
  83. }
  84.  
  85.