home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / program / gempp15b.zoo / src / geme.cc < prev    next >
C/C++ Source or Header  |  1993-05-01  |  1KB  |  58 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is Copyright 1992,1993 by Warwick W. Allison.
  4. //  This file is part of the gem++ library.
  5. //  You are free to copy and modify these sources, provided you acknowledge
  6. //  the origin by retaining this notice, and adhere to the conditions
  7. //  described in the file COPYING.LIB.
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10.  
  11. #include "geme.h"
  12. #include <aesbind.h>
  13.  
  14. GEMevent::GEMevent() :
  15.     ev_which(MU_BUTTON),
  16.     clicks(1),
  17.     btn_clicks(1),
  18.     btn_mask(3), btn_state(0), btn_not(TRUE), // Wait for not-both to be 0... ie. either.
  19.     interval(-1)
  20. {
  21.     graf_mkstate(&mx,&my,&btn,&meta);
  22. }
  23.  
  24. GEMevent::GEMevent(int x, int y, int b=0, int n=1) :
  25.     ev_which(MU_BUTTON),
  26.     btn(b),
  27.     mx(x), my(y),
  28.     clicks(n),
  29.     btn_clicks(n),
  30.     btn_mask(3), btn_state(0), btn_not(TRUE), // Wait for not-both to be 0... ie. either.
  31.     interval(-1)
  32. {
  33.     int j;
  34.     graf_mkstate(&j,&j,&j,&meta);
  35. }
  36.  
  37. GEMevent::GEMevent(int k) :
  38.     ev_which(MU_KEYBD),
  39.     key(k),
  40.     btn_clicks(1),
  41.     btn_mask(3), btn_state(0), btn_not(TRUE), // Wait for not-both to be 0... ie. either.
  42.     interval(-1)
  43. {
  44.     graf_mkstate(&mx,&my,&btn,&meta);
  45. }
  46.  
  47. void GEMevent::Get(int ev_flags)
  48. {
  49.     ev_which=evnt_multi(ev_flags,
  50.             btn_clicks|(btn_not ? 256 : 0),
  51.             btn_mask,
  52.             btn_state,
  53.             rf[0],r[0][0],r[0][1],r[0][2],r[0][3],
  54.             rf[1],r[1][0],r[1][1],r[1][2],r[1][3],
  55.             msg,interval,&mx,&my,&btn,&meta,&key,&clicks
  56.         );
  57. }
  58.