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

  1. /*
  2.     blwin.c    3/11/88
  3.  
  4.     % Blank window object
  5.     used for unsaved default window etc.
  6.     By Ted.
  7.  
  8.     OWL 1.1
  9.     Copyright (c) 1988, by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      6/16/88 Ted    revised to have inheritance and class factory functions.
  15.      8/09/88 jmd    revised to use new object stuff
  16.      9/12/88 jmd    Added in and out data to objects
  17.     11/20/88 jmd    Added ID to obj struct
  18.      3/13/89 ted    fixed bug: put color in emsgdata for paint/clear.
  19.  
  20.      8/12/89 jmd    added WHO message
  21. */
  22.  
  23. #include "oakhead.h"
  24. #include "disppriv.h"
  25. #include "winod.h"
  26. /* -------------------------------------------------------------------------- */
  27.  
  28. int blwin_Class(objdata, msg, indata, outdata)
  29.     VOID *objdata;            /* object instance data pointer */
  30.     int msg;                /* message */
  31.     VOID *indata;            /* message input data */
  32.     VOID *outdata;            /* message output data */
  33. /* 
  34.     blank window object dispatch function
  35. */
  36. {
  37.     blwin_od    *blwd;
  38.     ptd_struct    *ptd;
  39.     opixval        blcolor;
  40.     int            rval;
  41.  
  42.     blwd = (blwin_od *) objdata;
  43.  
  44.     switch(msg) {
  45.     case OBJM_GETDATASIZE:
  46.         ((ogds_struct *) outdata)->odsize = sizeof(blwin_od);
  47.         ((ogds_struct *) outdata)->xdsize = sizeof(blwin_xd);
  48.         ((ogds_struct *) outdata)->id = ID_BLWIN;
  49.         break;
  50.  
  51.     case OBJM_OPEN:
  52.         /* Send OPEN msg to win superclass */
  53.         rval = win_DoRaw(&(blwd->wd), msg, indata, outdata);
  54.  
  55.         /* Override default: allow any pix size for pmwin's */
  56.         win_SetCharSize(blwinod_GetSelf(blwd), FALSE);
  57.  
  58.         return(rval);
  59.  
  60.     case OBJM_WHO:
  61.         /* Identify ourselves */
  62.         if (*((int *) indata) == ID_BLWIN) {
  63.             return(TRUE);
  64.         }
  65.         return(win_DoRaw(&(blwd->wd), msg, indata, outdata));
  66.  
  67.     case WINM_SCROLL:
  68.         break;                /* don't bother scrolling- it's blank anyway */
  69.  
  70.     case WINM_PAINT:
  71.         ptd = (ptd_struct *)indata;
  72.  
  73.         msg = WINM_CLEAR;    /* to paint, just let the window clear itself */
  74.         blcolor = win_GetBgColor(blwinod_GetSelf(blwd));
  75.         ptd->emsgdata = (VOID *) &blcolor;
  76.         /* no break; fall through to win class */
  77.     default:
  78.         return(win_DoRaw(&(blwd->wd), msg, indata, outdata));
  79.     }
  80.     return(TRUE);
  81. }
  82. /* -------------------------------------------------------------------------- */
  83.  
  84.