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

  1. /*
  2.     bdplain.c    1/22/87
  3.  
  4.     % plain 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.      8/15/88 jmd     Upgraded to new border stuff
  14.      9/12/88 jmd    Added in and out data
  15.     11/13/88 jmd    Upgraded to 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\267\272\274\315\324\263"
  29.  
  30. /* border object data */
  31.  
  32. typedef struct {
  33.     border_od    bdd;                          /* border object super class */
  34. } bdplain_od;
  35.  
  36. int bd_plain(objdata, msg, indata, outdata)
  37.     VOID *objdata;
  38.     int msg;
  39.     VOID *indata;                /* message input data */
  40.     VOID *outdata;                /* message output data */
  41. /*
  42.     This is a simple single lined border.
  43. */
  44. {
  45.     bdplain_od *bdpd;
  46.     ocbox        cbox;
  47.     byte         attr;
  48.  
  49.     bdpd = (bdplain_od *)objdata;
  50.  
  51.     switch(msg) {
  52.     case OBJM_GETDATASIZE:
  53.         ((ogds_struct *) outdata)->odsize = sizeof(bdplain_od);
  54.         ((ogds_struct *) outdata)->xdsize = sizeof(border_xd);
  55.         ((ogds_struct *) outdata)->id = ID_BDPLAIN;
  56.         break;
  57.  
  58.     case OBJM_OPEN:
  59.         if (!border_DoRaw(&bdpd->bdd, msg, indata, outdata)) {
  60.             return(FALSE);
  61.         }
  62.         bord_SetSides(bdpd->bdd.win, -1, -1, 1, 1);
  63.         break;
  64.  
  65.     case BDM_SHADOW:
  66.     case BDM_DRAW:
  67.         bord_GetBox(bdpd->bdd.win, &cbox);
  68.         attr = (msg == BDM_DRAW) ? 
  69.             bord_GetAttr(bdpd->bdd.win) : win_GetShadowAttr(bdpd->bdd.win);
  70.  
  71.         ptd_DrawCharBox((ptd_struct *)indata, OUTER_BOX, &cbox, attr);
  72.  
  73.         /* else no break; pass message up to superclass */
  74.  
  75.     default:
  76.         /* pass messages up to border super class */
  77.         return(border_DoRaw(&bdpd->bdd, msg, indata, outdata));
  78.     }
  79.  
  80.     return(TRUE);
  81. }
  82.  
  83.