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

  1. /*
  2.     npwin.c        6/23/88
  3.  
  4.     % Non-painting window object
  5.     used for masking out portions of the screen.
  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.      8/09/88 jmd    revised to use new object stuff
  15.      9/12/88 jmd    Added in and out data to objects
  16.     11/20/88 jmd    Added ID to obj struct
  17.      8/12/89 jmd    added WHO message
  18.      8/13/89 ted    added WINM_SETSIZE support.
  19. */
  20.  
  21. #include "oakhead.h"
  22. #include "disppriv.h"
  23. #include "winod.h"
  24. /* -------------------------------------------------------------------------- */
  25.  
  26. int npwin_Class(objdata, msg, indata, outdata)
  27.     VOID *objdata;            /* object instance data pointer */
  28.     int msg;                /* message */
  29.     VOID *indata;            /* message input data */
  30.     VOID *outdata;            /* message output data */
  31. /* 
  32.     npwin object dispatch function
  33.     Handles no window messages except for GETATTR and SETATTR.
  34. */
  35. {
  36.     npwin_od    *npwd;
  37.     win_type    win;
  38.     int            rval;
  39.  
  40.     npwd = (npwin_od *) objdata;
  41.  
  42.     switch(msg) {
  43.  
  44.     case OBJM_GETDATASIZE:
  45.         ((ogds_struct *) outdata)->odsize = sizeof(npwin_od);
  46.         ((ogds_struct *) outdata)->xdsize = sizeof(npwin_xd);
  47.         ((ogds_struct *) outdata)->id = ID_NPWIN;
  48.         break;
  49.  
  50.     case OBJM_OPEN:
  51.         /* Send OPEN to win superclass */
  52.         rval = win_DoRaw(&(npwd->wd), msg, indata, outdata);
  53.  
  54.         /* Override default: allow any pix size for pmwin's */
  55.         win = npwinod_GetSelf(npwd);
  56.         win_SetCharSize(win, FALSE);
  57.  
  58.         return(rval);
  59.  
  60.     case OBJM_WHO:
  61.         /* Identify ourselves */
  62.         if (*((int *) indata) == ID_NPWIN) {
  63.             return(TRUE);
  64.         }
  65.         return(win_DoRaw(&(npwd->wd), msg, indata, outdata));
  66.  
  67.     default:
  68.         /* pass only object messages to win superclass */
  69.         /* also pass the SETFONT message because it is part of the OPEN method */
  70.         if (msg < OBJM_LASTMSG || msg == WINM_SETFONT || msg == WINM_SETSIZE) {
  71.             return(win_DoRaw(&(npwd->wd), msg, indata, outdata));
  72.         }
  73.     }
  74.     return(TRUE);
  75. }
  76. /* -------------------------------------------------------------------------- */
  77.  
  78.