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

  1. /*
  2.     pmwinimo.c    12/12/88
  3.  
  4.     % Window Request handler function for use by mouse borders & maybe others.
  5.     By Ted.
  6.  
  7.     OWL 1.1
  8.     Copyright (c) 1988, by Oakland Group, Inc.
  9.     ALL RIGHTS RESERVED.
  10.  
  11.     Revision History:
  12.     -----------------
  13.      5/19/89 jmd    removed static for silly UNIX compiler
  14.      8/11/89 jmd    reconstructed init function
  15. */
  16.  
  17. #include "oakhead.h"
  18. #include "disppriv.h"
  19. #include "pmwinod.h"
  20. #include "pmwinobj.h"
  21. #include "bordobj.h"
  22.  
  23. OSTATIC objreq_func (pmwinreq_mouse);
  24.  
  25. /* -------------------------------------------------------------------------- */
  26.  
  27. void pmwin_MouseInit()
  28. /*
  29.     Attach mouse handling function to pmwin_Class
  30. */
  31. {
  32.     pmwinreq_mousefptr = pmwinreq_mouse;
  33.  
  34.     win_MouseInit();
  35. }
  36.  
  37. /* -------------------------------------------------------------------------- */
  38.  
  39. static int pmwinreq_mouse(objdata, msg, indata, outdata)
  40.     VOID *objdata;
  41.     int msg;                /* message */
  42.     VOID *indata;            /* message input data */
  43.     VOID *outdata;            /* message output data */
  44. {
  45.     pmwin_od *pmwd;
  46.     win_type win;
  47.     opcoord nx, ny;
  48.  
  49.     /* outdata not used in this function */ oak_notused(outdata);
  50.  
  51.     pmwd = (pmwin_od *) objdata;
  52.  
  53.     switch(msg) {
  54.     case WINM_SCROLLREQ:
  55.         win = pmwinod_GetSelf(pmwd);
  56.         nx = ((opoint *)indata)->x;
  57.         ny = ((opoint *)indata)->y;
  58.         pmwd->xoffs += nx;
  59.         pmwd->yoffs += ny;
  60.         
  61.         win_ScrollPix(win, nx, ny);
  62.  
  63.         bord_SendMsg(win, BDM_SCROLL, NULL, NULL);
  64.         break;
  65.     }
  66.     return(TRUE);
  67. }
  68. /* -------------------------------------------------------------------------- */
  69.  
  70.